b956bbb799515a168da929ff5bc3e7326b34c181
[multipass-eu.git] / src / message_handler.sma
1 /* $Id: message_handler.sma 19 2005-04-29 14:31:53Z tilman $ */
2
3 #define MSG_ID_SET_SONGNAME 0
4
5 public message (Msg_Type:type, id, ...)
6 {
7         switch (id) {
8                 case MSG_ID_SET_SONGNAME: {
9                         new buf[256], artist[128], title[128], len;
10
11                         if (type != MSG_STRING_SET || numargs () != 4)
12                                 return;
13
14                         getsarg (2, artist, 128);
15                         getsarg (3, title, 128);
16
17                         len = snprintf (buf, 256, "%s - %s", artist, title);
18                         set_songname (buf, len);
19                 }
20         }
21 }