author | rubidium |
Fri, 23 Mar 2007 22:54:19 +0000 | |
branch | 0.5 |
changeset 5478 | 8067046917c1 |
parent 5408 | 1ed4ede56477 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#include "stdafx.h" |
1891
92a3b0aa0946
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents:
1884
diff
changeset
|
4 |
#include "openttd.h" |
507
8aa8100b0b22
(svn r815) Include strings.h only in the files which need it.
tron
parents:
341
diff
changeset
|
5 |
#include "table/strings.h" |
4937
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4867
diff
changeset
|
6 |
#include "table/sprites.h" |
2163
637ec3c361f5
(svn r2673) Include functions.h directly, not globally via openttd.h
tron
parents:
2159
diff
changeset
|
7 |
#include "functions.h" |
0 | 8 |
#include "window.h" |
9 |
#include "gfx.h" |
|
10 |
#include "sound.h" |
|
11 |
#include "hal.h" |
|
2159
3b634157c3b2
(svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents:
2155
diff
changeset
|
12 |
#include "macros.h" |
3b634157c3b2
(svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents:
2155
diff
changeset
|
13 |
#include "variables.h" |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
14 |
#include "music.h" |
0 | 15 |
|
2155
aa88ed6fe2e3
(svn r2665) Move some variables, which are only used by music_gui.c, there
tron
parents:
2140
diff
changeset
|
16 |
static byte _music_wnd_cursong; |
aa88ed6fe2e3
(svn r2665) Move some variables, which are only used by music_gui.c, there
tron
parents:
2140
diff
changeset
|
17 |
static bool _song_is_active; |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
18 |
static byte _cur_playlist[NUM_SONGS_PLAYLIST]; |
2155
aa88ed6fe2e3
(svn r2665) Move some variables, which are only used by music_gui.c, there
tron
parents:
2140
diff
changeset
|
19 |
|
0 | 20 |
|
21 |
||
22 |
static byte _playlist_all[] = { |
|
2639 | 23 |
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0 |
0 | 24 |
}; |
25 |
||
26 |
static byte _playlist_old_style[] = { |
|
2639 | 27 |
1, 8, 2, 9, 14, 15, 19, 13, 0 |
0 | 28 |
}; |
29 |
||
30 |
static byte _playlist_new_style[] = { |
|
31 |
6, 11, 10, 17, 21, 18, 5, 0 |
|
32 |
}; |
|
33 |
||
34 |
static byte _playlist_ezy_street[] = { |
|
35 |
12, 7, 16, 3, 20, 4, 0 |
|
36 |
}; |
|
37 |
||
38 |
static byte * const _playlists[] = { |
|
39 |
_playlist_all, |
|
40 |
_playlist_old_style, |
|
41 |
_playlist_new_style, |
|
42 |
_playlist_ezy_street, |
|
43 |
msf.custom_1, |
|
44 |
msf.custom_2, |
|
45 |
}; |
|
46 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
47 |
static void SkipToPrevSong(void) |
0 | 48 |
{ |
49 |
byte *b = _cur_playlist; |
|
50 |
byte *p = b; |
|
51 |
byte t; |
|
52 |
||
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
53 |
if (b[0] == 0) return; // empty playlist |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
54 |
|
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
55 |
do p++; while (p[0] != 0); // find the end |
0 | 56 |
|
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
57 |
t = *--p; // and copy the bytes |
0 | 58 |
while (p != b) { |
59 |
p--; |
|
60 |
p[1] = p[0]; |
|
61 |
} |
|
62 |
*b = t; |
|
63 |
||
64 |
_song_is_active = false; |
|
65 |
} |
|
66 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
67 |
static void SkipToNextSong(void) |
0 | 68 |
{ |
2639 | 69 |
byte* b = _cur_playlist; |
70 |
byte t; |
|
0 | 71 |
|
2639 | 72 |
t = b[0]; |
73 |
if (t != 0) { |
|
74 |
while (b[1] != 0) { |
|
0 | 75 |
b[0] = b[1]; |
76 |
b++; |
|
77 |
} |
|
78 |
b[0] = t; |
|
79 |
} |
|
80 |
||
81 |
_song_is_active = false; |
|
82 |
} |
|
83 |
||
84 |
static void MusicVolumeChanged(byte new_vol) |
|
85 |
{ |
|
86 |
_music_driver->set_volume(new_vol); |
|
87 |
} |
|
88 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
89 |
static void DoPlaySong(void) |
0 | 90 |
{ |
91 |
char filename[256]; |
|
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
92 |
snprintf(filename, sizeof(filename), "%s%s", |
5296
6a4aaa66eed3
(svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents:
4938
diff
changeset
|
93 |
_paths.gm_dir, origin_songs_specs[_music_wnd_cursong - 1].filename); |
0 | 94 |
_music_driver->play_song(filename); |
95 |
} |
|
96 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
97 |
static void DoStopMusic(void) |
0 | 98 |
{ |
99 |
_music_driver->stop_song(); |
|
100 |
} |
|
101 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
102 |
static void SelectSongToPlay(void) |
0 | 103 |
{ |
2247 | 104 |
uint i = 0; |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
105 |
uint j = 0; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
106 |
char filename[256]; |
0 | 107 |
|
2247 | 108 |
memset(_cur_playlist, 0, sizeof(_cur_playlist)); |
1884
ae1d6213c6dd
(svn r2390) - Codechange: Fix some warnings on GCC 4.0.0
hackykid
parents:
1724
diff
changeset
|
109 |
do { |
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
110 |
if (_playlists[msf.playlist][i] != 0) { // Don't evaluate playlist terminator |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
111 |
snprintf(filename, sizeof(filename), "%s%s", |
5296
6a4aaa66eed3
(svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents:
4938
diff
changeset
|
112 |
_paths.gm_dir, origin_songs_specs[(_playlists[msf.playlist][i]) - 1].filename); |
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
113 |
|
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
114 |
/* we are now checking for the existence of that file prior |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
115 |
* to add it to the list of available songs */ |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
116 |
if (FileExists(filename)) { |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
117 |
_cur_playlist[j] = _playlists[msf.playlist][i]; |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
118 |
j++; |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
119 |
} |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
120 |
} |
2247 | 121 |
} while (_playlists[msf.playlist][i++] != 0 && i < lengthof(_cur_playlist) - 1); |
0 | 122 |
|
123 |
if (msf.shuffle) { |
|
124 |
i = 500; |
|
125 |
do { |
|
126 |
uint32 r = InteractiveRandom(); |
|
2140
d708eb80ab8b
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
tron
parents:
2133
diff
changeset
|
127 |
byte *a = &_cur_playlist[GB(r, 0, 5)]; |
d708eb80ab8b
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
tron
parents:
2133
diff
changeset
|
128 |
byte *b = &_cur_playlist[GB(r, 8, 5)]; |
0 | 129 |
|
130 |
if (*a != 0 && *b != 0) { |
|
131 |
byte t = *a; |
|
132 |
*a = *b; |
|
133 |
*b = t; |
|
134 |
} |
|
135 |
} while (--i); |
|
136 |
} |
|
137 |
} |
|
138 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
139 |
static void StopMusic(void) |
0 | 140 |
{ |
141 |
_music_wnd_cursong = 0; |
|
142 |
DoStopMusic(); |
|
143 |
_song_is_active = false; |
|
144 |
InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9); |
|
145 |
} |
|
146 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
147 |
static void PlayPlaylistSong(void) |
0 | 148 |
{ |
149 |
if (_cur_playlist[0] == 0) { |
|
150 |
SelectSongToPlay(); |
|
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
151 |
/* if there is not songs in the playlist, it may indicate |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
152 |
* no file on the gm folder, or even no gm folder. |
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
153 |
* Stop the playback, then */ |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
154 |
if (_cur_playlist[0] == 0) { |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
155 |
_song_is_active = false; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
156 |
_music_wnd_cursong = 0; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
157 |
msf.playing = false; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
158 |
return; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
159 |
} |
0 | 160 |
} |
161 |
_music_wnd_cursong = _cur_playlist[0]; |
|
162 |
DoPlaySong(); |
|
163 |
_song_is_active = true; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
164 |
|
0 | 165 |
InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9); |
166 |
} |
|
167 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
168 |
void ResetMusic(void) |
0 | 169 |
{ |
170 |
_music_wnd_cursong = 1; |
|
171 |
DoPlaySong(); |
|
172 |
} |
|
173 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
174 |
void MusicLoop(void) |
0 | 175 |
{ |
3052
95e4eaf303d5
(svn r3641) - Rename MusicFilesettings 'btn_down' to more sensible 'playing'
Darkvater
parents:
2952
diff
changeset
|
176 |
if (!msf.playing && _song_is_active) { |
0 | 177 |
StopMusic(); |
3052
95e4eaf303d5
(svn r3641) - Rename MusicFilesettings 'btn_down' to more sensible 'playing'
Darkvater
parents:
2952
diff
changeset
|
178 |
} else if (msf.playing && !_song_is_active) { |
0 | 179 |
PlayPlaylistSong(); |
180 |
} |
|
181 |
||
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
182 |
if (!_song_is_active) return; |
0 | 183 |
|
1724
f2df13e9b628
(svn r2228) - Fix: [ 1188986 ] Song in main menu screen should loop when it ends.
Darkvater
parents:
1608
diff
changeset
|
184 |
if (!_music_driver->is_song_playing()) { |
f2df13e9b628
(svn r2228) - Fix: [ 1188986 ] Song in main menu screen should loop when it ends.
Darkvater
parents:
1608
diff
changeset
|
185 |
if (_game_mode != GM_MENU) { |
f2df13e9b628
(svn r2228) - Fix: [ 1188986 ] Song in main menu screen should loop when it ends.
Darkvater
parents:
1608
diff
changeset
|
186 |
StopMusic(); |
f2df13e9b628
(svn r2228) - Fix: [ 1188986 ] Song in main menu screen should loop when it ends.
Darkvater
parents:
1608
diff
changeset
|
187 |
SkipToNextSong(); |
f2df13e9b628
(svn r2228) - Fix: [ 1188986 ] Song in main menu screen should loop when it ends.
Darkvater
parents:
1608
diff
changeset
|
188 |
PlayPlaylistSong(); |
2639 | 189 |
} else { |
1724
f2df13e9b628
(svn r2228) - Fix: [ 1188986 ] Song in main menu screen should loop when it ends.
Darkvater
parents:
1608
diff
changeset
|
190 |
ResetMusic(); |
2639 | 191 |
} |
0 | 192 |
} |
193 |
} |
|
194 |
||
195 |
static void MusicTrackSelectionWndProc(Window *w, WindowEvent *e) |
|
196 |
{ |
|
2952 | 197 |
switch (e->event) { |
0 | 198 |
case WE_PAINT: { |
2630 | 199 |
const byte* p; |
2133 | 200 |
uint i; |
201 |
int y; |
|
0 | 202 |
|
4709
eff35edfb653
(svn r6619) -Codechange: Use accessors for disabled_state.
belugas
parents:
4634
diff
changeset
|
203 |
SetWindowWidgetDisabledState(w, 11, msf.playlist <= 3); |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
204 |
LowerWindowWidget(w, 3); |
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
205 |
LowerWindowWidget(w, 4); |
0 | 206 |
DrawWindowWidgets(w); |
207 |
||
208 |
GfxFillRect(3, 23, 3+177,23+191,0); |
|
209 |
GfxFillRect(251, 23, 251+177,23+191,0); |
|
210 |
||
211 |
DrawStringCentered(92, 15, STR_01EE_TRACK_INDEX, 0); |
|
212 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
213 |
SetDParam(0, STR_01D5_ALL + msf.playlist); |
0 | 214 |
DrawStringCentered(340, 15, STR_01EF_PROGRAM, 0); |
215 |
||
2133 | 216 |
for (i = 1; i <= NUM_SONGS_AVAILABLE; i++) { |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
217 |
SetDParam(0, i); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
218 |
SetDParam(2, i); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
219 |
SetDParam(1, SPECSTR_SONGNAME); |
0 | 220 |
DrawString(4, 23+(i-1)*6, (i < 10) ? STR_01EC_0 : STR_01ED, 0); |
221 |
} |
|
222 |
||
2639 | 223 |
for (i = 0; i != 6; i++) { |
224 |
DrawStringCentered(216, 45 + i * 8, STR_01D5_ALL + i, (i == msf.playlist) ? 0xC : 0x10); |
|
0 | 225 |
} |
226 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
227 |
DrawStringCentered(216, 45+8*6+16, STR_01F0_CLEAR, 0); |
4468
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
228 |
#if 0 |
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
229 |
DrawStringCentered(216, 45 + 8 * 6 + 16 * 2, STR_01F1_SAVE, 0); |
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
230 |
#endif |
0 | 231 |
|
232 |
y = 23; |
|
2639 | 233 |
for (p = _playlists[msf.playlist], i = 0; (i = *p) != 0; p++) { |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
234 |
SetDParam(0, i); |
2639 | 235 |
SetDParam(1, SPECSTR_SONGNAME); |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
236 |
SetDParam(2, i); |
0 | 237 |
DrawString(252, y, (i < 10) ? STR_01EC_0 : STR_01ED, 0); |
238 |
y += 6; |
|
239 |
} |
|
240 |
break; |
|
241 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
242 |
|
0 | 243 |
case WE_CLICK: |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4468
diff
changeset
|
244 |
switch (e->we.click.widget) { |
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
245 |
case 3: { // add to playlist |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4468
diff
changeset
|
246 |
int y = (e->we.click.pt.y - 23) / 6; |
2639 | 247 |
uint i; |
0 | 248 |
byte *p; |
2639 | 249 |
|
0 | 250 |
if (msf.playlist < 4) return; |
2639 | 251 |
if (!IS_INT_INSIDE(y, 0, NUM_SONGS_AVAILABLE)) return; |
0 | 252 |
|
253 |
p = _playlists[msf.playlist]; |
|
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
254 |
for (i = 0; i != NUM_SONGS_PLAYLIST - 1; i++) { |
0 | 255 |
if (p[i] == 0) { |
2639 | 256 |
p[i] = y + 1; |
257 |
p[i + 1] = 0; |
|
0 | 258 |
SetWindowDirty(w); |
259 |
SelectSongToPlay(); |
|
260 |
break; |
|
261 |
} |
|
262 |
} |
|
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
263 |
} break; |
0 | 264 |
|
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
265 |
case 4: { // remove from playlist |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4468
diff
changeset
|
266 |
int y = (e->we.click.pt.y - 23) / 6; |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
267 |
uint i; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
268 |
byte *p; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
269 |
|
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
270 |
if (msf.playlist < 4) return; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
271 |
if (!IS_INT_INSIDE(y, 0, NUM_SONGS_AVAILABLE)) return; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
272 |
|
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
273 |
p = _playlists[msf.playlist]; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
274 |
for (i = y; i != NUM_SONGS_PLAYLIST - 1; i++) { |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
275 |
p[i] = p[i + 1]; |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
276 |
} |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
277 |
|
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
278 |
SetWindowDirty(w); |
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
279 |
SelectSongToPlay(); |
0 | 280 |
} break; |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
281 |
|
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
282 |
case 11: // clear |
0 | 283 |
_playlists[msf.playlist][0] = 0; |
284 |
SetWindowDirty(w); |
|
285 |
StopMusic(); |
|
286 |
SelectSongToPlay(); |
|
287 |
break; |
|
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
288 |
|
4432
33631ac88c40
(svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents:
4344
diff
changeset
|
289 |
#if 0 |
4867
68d23729ca86
(svn r6793) -Fix(5464): When checking items on an array, make sure to respect boundaries(jez).
belugas
parents:
4719
diff
changeset
|
290 |
case 12: // save |
5408
1ed4ede56477
(svn r8172) -Backport from trunk (r8013, r8134):
Darkvater
parents:
5296
diff
changeset
|
291 |
ShowInfo("MusicTrackSelectionWndProc:save not implemented"); |
4432
33631ac88c40
(svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents:
4344
diff
changeset
|
292 |
break; |
33631ac88c40
(svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents:
4344
diff
changeset
|
293 |
#endif |
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
294 |
|
0 | 295 |
case 5: case 6: case 7: case 8: case 9: case 10: /* set playlist */ |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4468
diff
changeset
|
296 |
msf.playlist = e->we.click.widget - 5; |
0 | 297 |
SetWindowDirty(w); |
298 |
InvalidateWindow(WC_MUSIC_WINDOW, 0); |
|
299 |
StopMusic(); |
|
300 |
SelectSongToPlay(); |
|
301 |
break; |
|
302 |
} |
|
303 |
break; |
|
304 |
} |
|
305 |
} |
|
306 |
||
307 |
static const Widget _music_track_selection_widgets[] = { |
|
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4120
diff
changeset
|
308 |
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
654
diff
changeset
|
309 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 431, 0, 13, STR_01EB_MUSIC_PROGRAM_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
310 |
{ WWT_PANEL, RESIZE_NONE, 14, 0, 431, 14, 217, 0x0, STR_NULL}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
311 |
{ WWT_PANEL, RESIZE_NONE, 14, 2, 181, 22, 215, 0x0, STR_01FA_CLICK_ON_MUSIC_TRACK_TO}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
312 |
{ WWT_PANEL, RESIZE_NONE, 14, 250, 429, 22, 215, 0x0, STR_CLICK_ON_TRACK_TO_REMOVE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
313 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 44, 51, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
314 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 52, 59, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
315 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 60, 67, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
316 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 68, 75, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
317 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 76, 83, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
318 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 84, 91, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
319 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 108, 115, 0x0, STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1}, |
4468
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
320 |
#if 0 |
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
321 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 124, 131, 0x0, STR_01F9_SAVE_MUSIC_SETTINGS}, |
4468
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
322 |
#endif |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
0
diff
changeset
|
323 |
{ WIDGETS_END}, |
0 | 324 |
}; |
325 |
||
326 |
static const WindowDesc _music_track_selection_desc = { |
|
327 |
104, 131, 432, 218, |
|
328 |
WC_MUSIC_TRACK_SELECTION,0, |
|
329 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
|
330 |
_music_track_selection_widgets, |
|
331 |
MusicTrackSelectionWndProc |
|
332 |
}; |
|
333 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
334 |
static void ShowMusicTrackSelection(void) |
0 | 335 |
{ |
336 |
AllocateWindowDescFront(&_music_track_selection_desc, 0); |
|
337 |
} |
|
338 |
||
339 |
static void MusicWindowWndProc(Window *w, WindowEvent *e) |
|
340 |
{ |
|
2952 | 341 |
switch (e->event) { |
0 | 342 |
case WE_PAINT: { |
2639 | 343 |
uint i; |
0 | 344 |
StringID str; |
345 |
||
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
346 |
RaiseWindowWidget(w, 7); |
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
347 |
RaiseWindowWidget(w, 9); |
0 | 348 |
DrawWindowWidgets(w); |
349 |
||
350 |
GfxFillRect(187, 16, 200, 33, 0); |
|
351 |
||
2639 | 352 |
for (i = 0; i != 8; i++) { |
0 | 353 |
int color = 0xD0; |
354 |
if (i > 4) { |
|
355 |
color = 0xBF; |
|
356 |
if (i > 6) { |
|
357 |
color = 0xB8; |
|
358 |
} |
|
359 |
} |
|
4120
90e678fd7d8d
(svn r5464) [Behaviour Fix] : When starting the game, the system will now verify the presence of music files in gm forlder.
belugas
parents:
3052
diff
changeset
|
360 |
GfxFillRect(187, NUM_SONGS_PLAYLIST - i * 2, 200, NUM_SONGS_PLAYLIST - i * 2, color); |
0 | 361 |
} |
362 |
||
363 |
GfxFillRect(60, 46, 239, 52, 0); |
|
364 |
||
2639 | 365 |
if (_song_is_active == 0 || _music_wnd_cursong == 0) { |
366 |
str = STR_01E3; |
|
367 |
} else { |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
368 |
SetDParam(0, _music_wnd_cursong); |
2639 | 369 |
str = (_music_wnd_cursong < 10) ? STR_01E4_0 : STR_01E5; |
0 | 370 |
} |
371 |
DrawString(62, 46, str, 0); |
|
372 |
||
373 |
str = STR_01E6; |
|
374 |
if (_song_is_active != 0 && _music_wnd_cursong != 0) { |
|
375 |
str = STR_01E7; |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
376 |
SetDParam(0, SPECSTR_SONGNAME); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
377 |
SetDParam(1, _music_wnd_cursong); |
0 | 378 |
} |
379 |
DrawStringCentered(155, 46, str, 0); |
|
380 |
||
381 |
||
382 |
DrawString(60, 38, STR_01E8_TRACK_XTITLE, 0); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
383 |
|
2639 | 384 |
for (i = 0; i != 6; i++) { |
385 |
DrawStringCentered(25 + i * 50, 59, STR_01D5_ALL + i, msf.playlist == i ? 0xC : 0x10); |
|
0 | 386 |
} |
387 |
||
388 |
DrawStringCentered(31, 43, STR_01E9_SHUFFLE, (msf.shuffle ? 0xC : 0x10)); |
|
389 |
DrawStringCentered(269, 43, STR_01EA_PROGRAM, 0); |
|
390 |
DrawStringCentered(141, 15, STR_01DB_MUSIC_VOLUME, 0); |
|
391 |
DrawStringCentered(141, 29, STR_01DD_MIN_MAX, 0); |
|
392 |
DrawStringCentered(247, 15, STR_01DC_EFFECTS_VOLUME, 0); |
|
393 |
DrawStringCentered(247, 29, STR_01DD_MIN_MAX, 0); |
|
394 |
||
1938
21bd6ef5f85e
(svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents:
1891
diff
changeset
|
395 |
DrawFrameRect(108, 23, 174, 26, 14, FR_LOWERED); |
21bd6ef5f85e
(svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents:
1891
diff
changeset
|
396 |
DrawFrameRect(214, 23, 280, 26, 14, FR_LOWERED); |
0 | 397 |
|
4468
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
398 |
DrawFrameRect( |
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
399 |
108 + msf.music_vol / 2, 22, 111 + msf.music_vol / 2, 28, 14, 0 |
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
400 |
); |
0 | 401 |
|
4468
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
402 |
DrawFrameRect( |
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
403 |
214 + msf.effect_vol / 2, 22, 217 + msf.effect_vol / 2, 28, 14, 0 |
fb18502e2c12
(svn r6253) Comment out code with #if 0, not //. Join statements which needlessly span many lines into fewer lines
tron
parents:
4432
diff
changeset
|
404 |
); |
0 | 405 |
} break; |
406 |
||
407 |
case WE_CLICK: |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4468
diff
changeset
|
408 |
switch (e->we.click.widget) { |
0 | 409 |
case 2: // skip to prev |
410 |
if (!_song_is_active) |
|
411 |
return; |
|
412 |
SkipToPrevSong(); |
|
413 |
break; |
|
414 |
case 3: // skip to next |
|
415 |
if (!_song_is_active) |
|
416 |
return; |
|
417 |
SkipToNextSong(); |
|
418 |
break; |
|
419 |
case 4: // stop playing |
|
3052
95e4eaf303d5
(svn r3641) - Rename MusicFilesettings 'btn_down' to more sensible 'playing'
Darkvater
parents:
2952
diff
changeset
|
420 |
msf.playing = false; |
0 | 421 |
break; |
422 |
case 5: // start playing |
|
3052
95e4eaf303d5
(svn r3641) - Rename MusicFilesettings 'btn_down' to more sensible 'playing'
Darkvater
parents:
2952
diff
changeset
|
423 |
msf.playing = true; |
0 | 424 |
break; |
425 |
case 6:{ // volume sliders |
|
426 |
byte *vol,new_vol; |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4468
diff
changeset
|
427 |
int x = e->we.click.pt.x - 88; |
0 | 428 |
|
429 |
if (x < 0) |
|
430 |
return; |
|
431 |
||
432 |
vol = &msf.music_vol; |
|
433 |
if (x >= 106) { |
|
434 |
vol = &msf.effect_vol; |
|
435 |
x -= 106; |
|
436 |
} |
|
437 |
||
438 |
new_vol = min(max(x-21,0)*2,127); |
|
439 |
if (new_vol != *vol) { |
|
440 |
*vol = new_vol; |
|
441 |
if (vol == &msf.music_vol) |
|
442 |
MusicVolumeChanged(new_vol); |
|
443 |
SetWindowDirty(w); |
|
444 |
} |
|
445 |
||
446 |
_left_button_clicked = false; |
|
447 |
} break; |
|
448 |
case 10: //toggle shuffle |
|
449 |
msf.shuffle ^= 1; |
|
450 |
StopMusic(); |
|
451 |
SelectSongToPlay(); |
|
452 |
break; |
|
453 |
case 11: //show track selection |
|
454 |
ShowMusicTrackSelection(); |
|
455 |
break; |
|
456 |
case 12: case 13: case 14: case 15: case 16: case 17: // playlist |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4468
diff
changeset
|
457 |
msf.playlist = e->we.click.widget - 12; |
0 | 458 |
SetWindowDirty(w); |
459 |
InvalidateWindow(WC_MUSIC_TRACK_SELECTION, 0); |
|
460 |
StopMusic(); |
|
461 |
SelectSongToPlay(); |
|
462 |
break; |
|
463 |
} |
|
464 |
break; |
|
465 |
||
466 |
case WE_MOUSELOOP: |
|
467 |
InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 7); |
|
468 |
break; |
|
469 |
} |
|
470 |
||
471 |
} |
|
472 |
||
473 |
static const Widget _music_window_widgets[] = { |
|
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4120
diff
changeset
|
474 |
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
654
diff
changeset
|
475 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 299, 0, 13, STR_01D2_JAZZ_JUKEBOX, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
4937
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4867
diff
changeset
|
476 |
{ WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 21, 14, 35, SPR_IMG_SKIP_TO_PREV, STR_01DE_SKIP_TO_PREVIOUS_TRACK}, |
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4867
diff
changeset
|
477 |
{ WWT_PUSHIMGBTN, RESIZE_NONE, 14, 22, 43, 14, 35, SPR_IMG_SKIP_TO_NEXT, STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION}, |
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4867
diff
changeset
|
478 |
{ WWT_PUSHIMGBTN, RESIZE_NONE, 14, 44, 65, 14, 35, SPR_IMG_STOP_MUSIC, STR_01E0_STOP_PLAYING_MUSIC}, |
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4867
diff
changeset
|
479 |
{ WWT_PUSHIMGBTN, RESIZE_NONE, 14, 66, 87, 14, 35, SPR_IMG_PLAY_MUSIC, STR_01E1_START_PLAYING_MUSIC}, |
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
480 |
{ WWT_PANEL, RESIZE_NONE, 14, 88, 299, 14, 35, 0x0, STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
481 |
{ WWT_PANEL, RESIZE_NONE, 14, 186, 201, 15, 34, 0x0, STR_NULL}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
482 |
{ WWT_PANEL, RESIZE_NONE, 14, 0, 299, 36, 57, 0x0, STR_NULL}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
483 |
{ WWT_PANEL, RESIZE_NONE, 14, 59, 240, 45, 53, 0x0, STR_NULL}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
484 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 6, 55, 42, 49, 0x0, STR_01FB_TOGGLE_PROGRAM_SHUFFLE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
485 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 244, 293, 42, 49, 0x0, STR_01FC_SHOW_MUSIC_TRACK_SELECTION}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
486 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 0, 49, 58, 65, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
487 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 50, 99, 58, 65, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
488 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 100, 149, 58, 65, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
489 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 150, 199, 58, 65, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
490 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 200, 249, 58, 65, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
491 |
{ WWT_PUSHBTN, RESIZE_NONE, 14, 250, 299, 58, 65, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
0
diff
changeset
|
492 |
{ WIDGETS_END}, |
0 | 493 |
}; |
494 |
||
495 |
static const WindowDesc _music_window_desc = { |
|
496 |
0, 22, 300, 66, |
|
497 |
WC_MUSIC_WINDOW,0, |
|
498 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
|
499 |
_music_window_widgets, |
|
500 |
MusicWindowWndProc |
|
501 |
}; |
|
502 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
867
diff
changeset
|
503 |
void ShowMusicWindow(void) |
0 | 504 |
{ |
505 |
AllocateWindowDescFront(&_music_window_desc, 0); |
|
506 |
} |