summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-12-15 17:08:19 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-12-15 17:08:19 +0100
commit6a62ae4231c2ce10b6623e32198f40f0a2a8e777 (patch)
tree524e9322520bdbee06cdc20f1b8d636147d7aa9f /src/settings.c
parent927a878f171580c1fdeb4d01caf0a2c9c32f8b42 (diff)
downloadpianobar-6a62ae4231c2ce10b6623e32198f40f0a2a8e777.tar.gz
pianobar-6a62ae4231c2ce10b6623e32198f40f0a2a8e777.tar.bz2
pianobar-6a62ae4231c2ce10b6623e32198f40f0a2a8e777.zip
New history feature
Default key is 'h', playlists are no longer part of PianoHandle_t now (=> libpiano's api changed)
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c
index a7d6f61..1726a78 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -149,6 +149,8 @@ void BarSettingsRead (BarSettings_t *settings) {
"act_songexplain", NULL},
{'g', BarUiActStationFromGenre, "add genre station",
"act_stationaddbygenre", NULL},
+ {'h', BarUiActHistory, "song history",
+ "act_history", NULL},
{'i', BarUiActSongInfo,
"print information about current song/station",
"act_songinfo", NULL},
@@ -181,6 +183,7 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->audioFormat = PIANO_AF_MP3;
#endif
#endif
+ settings->history = 5;
BarGetXdgConfigDir (PACKAGE "/config", configfile, sizeof (configfile));
if ((configfd = fopen (configfile, "r")) == NULL) {
@@ -192,6 +195,7 @@ void BarSettingsRead (BarSettings_t *settings) {
return;
}
+ /* read config file */
while (!feof (configfd)) {
memset (val, 0, sizeof (*val));
memset (key, 0, sizeof (*key));
@@ -233,6 +237,8 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->autostartStation = strdup (val);
} else if (strcmp ("event_command", key) == 0) {
settings->eventCmd = strdup (val);
+ } else if (strcmp ("history", key) == 0) {
+ settings->history = atoi (val);
}
}