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