summaryrefslogtreecommitdiff
path: root/packages/musicpd/mpd
diff options
context:
space:
mode:
authorJustin Patrin <papercrane@gmail.com>2005-09-02 17:15:26 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-09-02 17:15:26 +0000
commit65ea38815d60bdb7250e46d5fccd067369b3c93d (patch)
treedda2b015a50a2ba980fa1e8fd5c10c5decca2707 /packages/musicpd/mpd
parent74f3606769fee83c891d84776bee6dbb523cb7e8 (diff)
mpd: Add a patch to save/restore volume state in the state_file
Diffstat (limited to 'packages/musicpd/mpd')
-rw-r--r--packages/musicpd/mpd/.mtn2git_empty0
-rw-r--r--packages/musicpd/mpd/save-volume-state.patch31
2 files changed, 31 insertions, 0 deletions
diff --git a/packages/musicpd/mpd/.mtn2git_empty b/packages/musicpd/mpd/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/musicpd/mpd/.mtn2git_empty
diff --git a/packages/musicpd/mpd/save-volume-state.patch b/packages/musicpd/mpd/save-volume-state.patch
new file mode 100644
index 0000000000..3e9be0eafb
--- /dev/null
+++ b/packages/musicpd/mpd/save-volume-state.patch
@@ -0,0 +1,31 @@
+diff -Nur mpd-0.11.5~/src/playlist.c mpd-0.11.5/src/playlist.c
+--- mpd-0.11.5~/src/playlist.c 2005-08-31 17:11:14.000000000 -0700
++++ mpd-0.11.5/src/playlist.c 2005-08-31 17:14:36.000000000 -0700
+@@ -49,6 +49,7 @@
+ #define PLAYLIST_STATE_FILE_CURRENT "current: "
+ #define PLAYLIST_STATE_FILE_TIME "time: "
+ #define PLAYLIST_STATE_FILE_CROSSFADE "crossfade: "
++#define PLAYLIST_STATE_FILE_VOLUME "volume: "
+ #define PLAYLIST_STATE_FILE_PLAYLIST_BEGIN "playlist_begin"
+ #define PLAYLIST_STATE_FILE_PLAYLIST_END "playlist_end"
+
+@@ -275,6 +276,8 @@
+ myfprintf(fp,"%s\n",PLAYLIST_STATE_FILE_STATE_STOP);
+ break;
+ }
++ myfprintf(fp,"%s%i\n",PLAYLIST_STATE_FILE_VOLUME,
++ getVolumeLevel());
+ myfprintf(fp,"%s%i\n",PLAYLIST_STATE_FILE_RANDOM,
+ playlist.random);
+ myfprintf(fp,"%s%i\n",PLAYLIST_STATE_FILE_REPEAT,
+@@ -403,6 +406,10 @@
+ current = atoi(&(buffer
+ [strlen(PLAYLIST_STATE_FILE_CURRENT)]));
+ }
++ else if(strncmp(buffer,PLAYLIST_STATE_FILE_VOLUME,
++ strlen(PLAYLIST_STATE_FILE_VOLUME)) == 0) {
++ changeVolumeLevel(1, atoi(&(buffer[strlen(PLAYLIST_STATE_FILE_VOLUME)])), 0);
++ }
+ else if(strncmp(buffer,
+ PLAYLIST_STATE_FILE_PLAYLIST_BEGIN,
+ strlen(PLAYLIST_STATE_FILE_PLAYLIST_BEGIN)