From e9331e39b1eb9a6c11c978fef04c4dbd1a06331a Mon Sep 17 00:00:00 2001 From: Spencer Williams Date: Wed, 30 Jul 2025 13:25:24 -0400 Subject: Minor reformatting --- mpc-bar.m | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mpc-bar.m b/mpc-bar.m index 0d1807c..91597ab 100644 --- a/mpc-bar.m +++ b/mpc-bar.m @@ -16,16 +16,16 @@ // along with this program; if not, see // . -#import -#include +#include "ini.h" +#include "mpc/song_format.h" + #include #include #include #include #include -#include "ini.h" -#include "mpc/song_format.h" +#import #define VERSION "0.4" #define TITLE_MAX_LENGTH 96 @@ -99,16 +99,22 @@ static int handler(void *userdata, const char *section, const char *name, - (void)initConfig { config.host = "localhost"; config.port = 6600; - config.format = "[%name%: &[[%artist%|%performer%|%composer%|%albumartist%] - ]%title%]|%name%|[[%artist%|%performer%|%composer%|%albumartist%] - ]%title%|%file%"; + config.format = + "[%name%: &[[%artist%|%performer%|%composer%|%albumartist%] - " + "]%title%]|%name%|[[%artist%|%performer%|%composer%|%albumartist%] - " + "]%title%|%file%"; config.idle_message = "No song playing"; config.show_queue = 1; config.show_queue_idle = -1; } - (BOOL)tryReadConfigFile:(NSString *)file { - return (0 == ini_parse([[NSHomeDirectory() stringByAppendingPathComponent:file] UTF8String], handler, &config)); + return (0 == ini_parse([[NSHomeDirectory() + stringByAppendingPathComponent:file] UTF8String], + handler, &config)); } - (void)readConfigFile { - if (!([self tryReadConfigFile: @".mpc-bar.ini"] || [self tryReadConfigFile: @".mpcbar"])) { + if (!([self tryReadConfigFile:@".mpc-bar.ini"] || + [self tryReadConfigFile:@".mpcbar"])) { NSLog(@"Failed to read config file"); } if (config.show_queue_idle == -1) { @@ -125,7 +131,6 @@ static int handler(void *userdata, const char *section, const char *name, } errorMessage = @"Failed to get status (is MPD running?)"; - if (mpd_connection_get_error(connection) == MPD_ERROR_SUCCESS) { if (config.password != NULL) { if (!mpd_run_password(connection, config.password)) { -- cgit v1.2.3