Removed RCS-style IDs.
[multipass-eu.git] / src / message_handler.sma
index ff3244093232ac298269402816c72afbb471a474..8a04ca35ad745d9d95bf56bcd98592994bd95fc9 100644 (file)
@@ -1,17 +1,18 @@
-/* $Id: message_handler.sma 1 2005-04-19 09:41:42Z tilman $ */
-
 #define MSG_ID_SET_SONGNAME 0
 
 public message (Msg_Type:type, id, ...)
 {
        switch (id) {
                case MSG_ID_SET_SONGNAME: {
-                       new buf[256], len;
+                       new buf[256], artist[128], title[128], len;
 
-                       if (type != MSG_STRING)
+                       if (type != MSG_STRING_SET || numargs () < 4)
                                return;
 
-                       len = snprintf (buf, 256, "%s", getarg (2));
+                       getsarg (2, artist, 128);
+                       getsarg (3, title, 128);
+
+                       len = snprintf (buf, 256, "%s - %s", artist, title);
                        set_songname (buf, len);
                }
        }