diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2020-08-09 09:23:38 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2020-08-09 09:23:38 +0200 |
commit | 4c228cd60890c0ef09c345c13713453c4c2dd508 (patch) | |
tree | 12b39298dd172291ea82529354578cf6e0cf8d73 /src/settings.c | |
parent | bc6bd8a2b8b84a79dd77b81d6a25b661c5d1d1ca (diff) | |
download | pianobar-4c228cd60890c0ef09c345c13713453c4c2dd508.tar.gz pianobar-4c228cd60890c0ef09c345c13713453c4c2dd508.tar.bz2 pianobar-4c228cd60890c0ef09c345c13713453c4c2dd508.zip |
Allow choosing time format
Introduce new format string for playback time, supporting formats like
-remaining/total, elapsed/total, …
Fixes #699.
Diffstat (limited to 'src/settings.c')
-rw-r--r-- | src/settings.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c index 7518177..5859b82 100644 --- a/src/settings.c +++ b/src/settings.c @@ -124,6 +124,7 @@ void BarSettingsDestroy (BarSettings_t *settings) { free (settings->npSongFormat); free (settings->npStationFormat); free (settings->listSongFormat); + free (settings->timeFormat); free (settings->fifo); free (settings->audioPipe); free (settings->rpcHost); @@ -175,6 +176,7 @@ void BarSettingsRead (BarSettings_t *settings) { settings->npSongFormat = strdup ("\"%t\" by \"%a\" on \"%l\"%r%@%s"); settings->npStationFormat = strdup ("Station \"%n\" (%i)"); settings->listSongFormat = strdup ("%i) %a - %t%r"); + settings->timeFormat = strdup ("%s%r/%t"); settings->rpcHost = strdup (PIANO_RPC_HOST); settings->rpcTlsPort = strdup ("443"); settings->partnerUser = strdup ("android"); @@ -389,6 +391,9 @@ void BarSettingsRead (BarSettings_t *settings) { } else if (streq ("format_list_song", key)) { free (settings->listSongFormat); settings->listSongFormat = strdup (val); + } else if (streq ("format_time", key)) { + free (settings->timeFormat); + settings->timeFormat = strdup (val); } else if (streq ("fifo", key)) { free (settings->fifo); settings->fifo = BarSettingsExpandTilde (val, userhome); |