summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
authorMichał Cichoń <michcic@gmail.com>2018-10-30 13:12:47 +0100
committerMichał Cichoń <michcic@gmail.com>2018-10-30 13:12:47 +0100
commitcb6789b17f81d29c6884c27715c705083e09a5db (patch)
treed6a47c38ff7dcb937992b15dc3c2d051bb877ac8 /src/settings.c
parentcd5c65097ecf03480f477e47e0bb706dbf705a21 (diff)
parent82a13ad77bfcf2c6dc37fe0d1d55f93372db6509 (diff)
downloadpianobar-windows-master.tar.gz
pianobar-windows-master.tar.bz2
pianobar-windows-master.zip
Merge branch 'release/2018.10.30'HEAD2018.10.30master
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/settings.c b/src/settings.c
index 4f0ef8c..affb7f2 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -129,6 +129,7 @@ void BarSettingsDestroy (BarSettings_t *settings) {
free (settings->eventCmd);
free (settings->loveIcon);
free (settings->banIcon);
+ free (settings->tiredIcon);
free (settings->atIcon);
free (settings->npSongFormat);
free (settings->npStationFormat);
@@ -172,11 +173,14 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->autoselect = true;
settings->history = 5;
settings->volume = 0;
+ settings->timeout = 30; /* seconds */
settings->gainMul = 1.0;
- settings->maxPlayerErrors = 5;
+ /* should be > 4, otherwise expired audio urls (403) can stop playback */
+ settings->maxRetry = 5;
settings->sortOrder = BAR_SORT_NAME_AZ;
settings->loveIcon = strdup (" <3");
settings->banIcon = strdup (" </3");
+ settings->tiredIcon = strdup (" zZ");
settings->atIcon = strdup (" @ ");
settings->npSongFormat = strdup ("\"%t\" by \"%a\" on \"%l\"%r%@%s");
settings->npStationFormat = strdup ("Station \"%n\" (%i)");
@@ -351,8 +355,10 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->eventCmd = BarSettingsExpandTilde (val, userhome);
} else if (streq ("history", key)) {
settings->history = atoi (val);
- } else if (streq ("max_player_errors", key)) {
- settings->maxPlayerErrors = atoi (val);
+ } else if (streq ("max_retry", key)) {
+ settings->maxRetry = atoi (val);
+ } else if (streq ("timeout", key)) {
+ settings->timeout = atoi (val);
} else if (streq ("sort", key)) {
size_t i;
static const char *mapping[] = {"name_az",
@@ -374,6 +380,9 @@ void BarSettingsRead (BarSettings_t *settings) {
} else if (streq ("ban_icon", key)) {
free (settings->banIcon);
settings->banIcon = strdup (val);
+ } else if (streq ("tired_icon", key)) {
+ free (settings->tiredIcon);
+ settings->tiredIcon = strdup (val);
} else if (streq ("at_icon", key)) {
free (settings->atIcon);
settings->atIcon = strdup (val);