Add command line options --mood and --playlist.
authorAndre Noll <maan@systemlinux.org>
Thu, 4 Oct 2007 14:41:05 +0000 (16:41 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 4 Oct 2007 14:41:05 +0000 (16:41 +0200)
And replace the temporary strings which were hardcoded
in afs.c.

afs.c
server.ggo

diff --git a/afs.c b/afs.c
index f6d6b8d78145829993fd6e817555b56b669fc460..33bc6e277ea2c3fb8a2b1efe30df775905890c9d 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -474,22 +474,18 @@ static void play_loop(enum play_mode current_play_mode)
 static enum play_mode init_admissible_files(void)
 {
        int ret;
-       char *given_mood, *given_playlist;
 
-       given_mood = "mood_that_was_given_at_the_command_line";
-       given_playlist = "given_playlist";
-
-       if (given_mood) {
-               ret = change_current_mood(given_mood);
+       if (conf.mood_given) {
+               ret = change_current_mood(conf.mood_arg);
                if (ret >= 0) {
-                       if (given_playlist)
+                       if (conf.playlist_given)
                                PARA_WARNING_LOG("ignoring playlist %s\n",
-                                       given_playlist);
+                                       conf.playlist_arg);
                        return PLAY_MODE_MOOD;
                }
        }
-       if (given_playlist) {
-               ret = playlist_open(given_playlist);
+       if (conf.playlist_given) {
+               ret = playlist_open(conf.playlist_arg);
                if (ret >= 0)
                        return PLAY_MODE_PLAYLIST;
        }
index 54aea85a9738bdf398ee047ec151616574f28c56..f0e5bb0410ea09b32b4efb5e0462333162954521 100644 (file)
@@ -156,6 +156,23 @@ option "afs_socket" s
        default="/var/paraslash/afs_command_socket"
        optional
 
+option "mood" m
+#~~~~~~~~~~~~~~
+
+"Mood to load on startup."
+
+       string typestr="mood_name"
+       optional
+
+option "playlist" P
+#~~~~~~~~~~~~~~
+
+"Playlist to load on startup. Ignored if
+--mood is given as well."
+
+       string typestr="playlist_name"
+       optional
+
 section "mysql selector"
 #~~~~~~~~~~~~~~~~~~~~~~~