Xonotic
dialog_multiplayer_media_musicplayer.qc
Go to the documentation of this file.
2 
3 #include "soundlist.qh"
4 #include "playlist.qh"
5 
6 #include "textlabel.qh"
7 #include "inputbox.qh"
8 #include "button.qh"
9 #include "checkbox.qh"
10 
12 {
13  entity me;
15  me.configureDialog(me);
16  return me;
17 }
19 {
20  entity e;
21  entity soundList, playList;
22  float columns_nospacing = (me.columns - 0.2);
23 
24  me.TR(me);
25  me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Filter:")));
26  me.TD(me, 1, 2.5, e = makeXonoticInputBox(0, string_null));
27  soundList = makeXonoticSoundList();
28  e.onChange = SoundList_Filter_Change;
29  e.onChangeEntity = soundList;
30  playList = makeXonoticPlayList();
31  soundList.playlist = playList;
32 
33  me.TR(me);
34  me.TD(me, me.rows - 4, columns_nospacing / 2, soundList);
35 
36  me.gotoRC(me, me.rows - 3, 0);
37  me.TD(me, 1, columns_nospacing / 4, e = makeXonoticButton(ZCTX(_("MUSICPL^Add")), '0 0 0'));
38  e.onClick = SoundList_Add;
39  e.onClickEntity = soundList;
40  me.TD(me, 1, columns_nospacing / 4, e = makeXonoticButton(ZCTX(_("MUSICPL^Add all")), '0 0 0'));
41  e.onClick = SoundList_Add_All;
42  e.onClickEntity = soundList;
43  me.TR(me);
44  me.TD(me, 1, columns_nospacing / 2, e = makeXonoticButton(_("Set as menu track"), '0 0 0'));
45  e.onClick = SoundList_Menu_Track_Change;
46  e.onClickEntity = soundList;
47  me.TR(me);
48  me.TD(me, 1, columns_nospacing / 2, e = makeXonoticButton(_("Reset default menu track"), '0 0 0'));
49  e.onClick = SoundList_Menu_Track_Reset;
50  e.onClickEntity = soundList;
51  me.TR(me);
52  me.TR(me);
53  me.gotoRC(me, 0, columns_nospacing / 2 + 0.2); me.setFirstColumn(me, me.currentColumn);
54  me.TD(me, 1, columns_nospacing / 4, e = makeXonoticTextLabel(0, _("Playlist:")));
55  me.TD(me, 1, columns_nospacing / 4, e = makeXonoticCheckBox(0, "music_playlist_random0", _("Random order")));
56  me.TR(me);
57  me.TD(me, me.rows - 3, columns_nospacing / 2, playList);
58 
59  me.gotoRC(me, me.rows - 2, columns_nospacing / 2 + 0.2);
60  me.TD(me, 1, columns_nospacing / 10, e = makeXonoticButton(ZCTX(_("MUSICPL^Stop")), '0 0 0'));
61  e.onClick = StopSound_Click;
62  e.onClickEntity = playList;
63  me.TD(me, 1, columns_nospacing / 10, e = makeXonoticButton(ZCTX(_("MUSICPL^Play")), '0 0 0'));
64  e.onClick = StartSound_Click;
65  e.onClickEntity = playList;
66  me.TD(me, 1, columns_nospacing / 10, e = makeXonoticButton(ZCTX(_("MUSICPL^Pause")), '0 0 0'));
67  e.onClick = PauseSound_Click;
68  e.onClickEntity = playList;
69  me.TD(me, 1, columns_nospacing / 10, e = makeXonoticButton(ZCTX(_("MUSICPL^Prev")), '0 0 0'));
70  e.onClick = PrevSound_Click;
71  e.onClickEntity = playList;
72  me.TD(me, 1, columns_nospacing / 10, e = makeXonoticButton(ZCTX(_("MUSICPL^Next")), '0 0 0'));
73  e.onClick = NextSound_Click;
74  e.onClickEntity = playList;
75  me.TR(me);
76  me.TD(me, 1, columns_nospacing / 4, e = makeXonoticButton(ZCTX(_("MUSICPL^Remove")), '0 0 0'));
77  e.onClick = PlayList_Remove;
78  e.onClickEntity = playList;
79  me.TD(me, 1, columns_nospacing / 4, e = makeXonoticButton(ZCTX(_("MUSICPL^Remove all")), '0 0 0'));
80  e.onClick = PlayList_Remove_All;
81  e.onClickEntity = playList;
82 }
entity makeXonoticSoundList()
Definition: soundlist.qc:6
string string_null
Definition: nil.qh:9
entity makeXonoticPlayList()
Definition: playlist.qc:3
#define NEW(cname,...)
Definition: oo.qh:105
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
entity makeXonoticMusicPlayerTab()
void SoundList_Menu_Track_Change(entity box, entity me)
Definition: soundlist.qc:97
void SoundList_Add(entity box, entity me)
Definition: soundlist.qc:117
void PlayList_Remove_All(entity btn, entity me)
Definition: playlist.qc:97
void SoundList_Add_All(entity box, entity me)
Definition: soundlist.qc:122
void PlayList_Remove(entity btn, entity me)
Definition: playlist.qc:92
#define ZCTX(s)
Definition: i18n.qh:68
void StopSound_Click(entity btn, entity me)
Definition: playlist.qc:174
void XonoticMusicPlayerTab_fill(entity me)
void PrevSound_Click(entity btn, entity me)
Definition: playlist.qc:217
void SoundList_Menu_Track_Reset(entity box, entity me)
Definition: soundlist.qc:102
void SoundList_Filter_Change(entity box, entity me)
Definition: soundlist.qc:107
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
void StartSound_Click(entity btn, entity me)
Definition: playlist.qc:212
void NextSound_Click(entity btn, entity me)
Definition: playlist.qc:222
entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
Definition: inputbox.qc:10
void PauseSound_Click(entity btn, entity me)
Definition: playlist.qc:243