The MSG_ID_SET_SONGNAME message now handles streams.
[euphoria.git] / data / themes / winter / groups / euphoria.edc
1     group {
2         name, "euphoria";
3         min, 200 300;
4         max, 99999 99999;
5
6         data {
7                 item, "shaped" "hell yeah";
8         }
9
10         script {
11                 public message (Msg_Type:type, id, ...)
12                 {
13                         switch (id) {
14                                 case MSG_ID_SET_SONGNAME: {
15                                         new buf[128], args_left;
16
17                                         args_left = numargs () - 2;
18
19                                         /* if the one argument is a string, the current song
20                                          * is a stream, and the argument is the stream's name
21                                          * (channel name).
22                                          */
23                                         if (type == MSG_STRING && args_left == 1) {
24                                                 getsarg (2, buf, 128);
25                                                 set_text (PART:"artist_name", buf);
26
27                                                 set_text (PART:"song_name", "");
28                                                 set_text (PART:"album_name", "");
29                                         } else if (type == MSG_STRING_SET && args_left > 1) {
30                                                 getsarg (2, buf, 128);
31                                                 set_text (PART:"artist_name", buf);
32
33                                                 getsarg (3, buf, 128);
34                                                 set_text (PART:"song_name", buf);
35
36                                                 getsarg (4, buf, 128);
37                                                 set_text (PART:"album_name", buf);
38                                         }
39                                 }
40                         }
41                 }
42         }
43
44         parts {
45 #include "../parts/main.edc"
46 #include "../parts/playlist.edc"
47 #include "../parts/buttons.edc"
48 #include "../parts/volume.edc"
49 #include "../parts/text.edc"
50 #include "../parts/seeker.edc"
51 #include "../parts/ani.edc"
52         
53         } //parts
54
55         programs {
56 #include "../programs/buttons.edc"
57 #include "../programs/volume.edc"
58 #include "../programs/playlist.edc"
59 #include "../programs/seeker.edc"
60 #include "../programs/text.edc"
61 #include "../programs/ani.edc"
62 #include "../programs/switch.edc"
63         } //programs
64         
65     } //group