2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file music_gui.cpp GUI for the music playback. */
|
2007-03-03 04:04:22 +00:00
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#include "stdafx.h"
|
2005-06-02 19:30:21 +00:00
|
|
|
#include "openttd.h"
|
2008-08-31 10:50:05 +00:00
|
|
|
#include "fileio_func.h"
|
2006-07-07 02:44:51 +00:00
|
|
|
#include "music.h"
|
2007-07-05 12:23:54 +00:00
|
|
|
#include "music/music_driver.hpp"
|
2007-12-19 19:44:29 +00:00
|
|
|
#include "window_gui.h"
|
2007-12-21 19:49:27 +00:00
|
|
|
#include "strings_func.h"
|
2007-12-25 11:26:07 +00:00
|
|
|
#include "window_func.h"
|
2007-12-29 09:24:26 +00:00
|
|
|
#include "sound_func.h"
|
2008-01-09 09:45:45 +00:00
|
|
|
#include "gfx_func.h"
|
|
|
|
#include "core/math_func.hpp"
|
2008-01-29 00:26:31 +00:00
|
|
|
#include "core/random_func.hpp"
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-01-13 01:21:35 +00:00
|
|
|
#include "table/strings.h"
|
|
|
|
#include "table/sprites.h"
|
|
|
|
|
2005-07-21 19:46:58 +00:00
|
|
|
static byte _music_wnd_cursong;
|
|
|
|
static bool _song_is_active;
|
2006-07-07 02:44:51 +00:00
|
|
|
static byte _cur_playlist[NUM_SONGS_PLAYLIST];
|
2005-07-21 19:46:58 +00:00
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
static byte _playlist_all[] = {
|
2005-11-14 19:48:04 +00:00
|
|
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static byte _playlist_old_style[] = {
|
2005-11-14 19:48:04 +00:00
|
|
|
1, 8, 2, 9, 14, 15, 19, 13, 0
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static byte _playlist_new_style[] = {
|
|
|
|
6, 11, 10, 17, 21, 18, 5, 0
|
|
|
|
};
|
|
|
|
|
|
|
|
static byte _playlist_ezy_street[] = {
|
|
|
|
12, 7, 16, 3, 20, 4, 0
|
|
|
|
};
|
|
|
|
|
|
|
|
static byte * const _playlists[] = {
|
|
|
|
_playlist_all,
|
|
|
|
_playlist_old_style,
|
|
|
|
_playlist_new_style,
|
|
|
|
_playlist_ezy_street,
|
|
|
|
msf.custom_1,
|
|
|
|
msf.custom_2,
|
|
|
|
};
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void SkipToPrevSong()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
byte *b = _cur_playlist;
|
|
|
|
byte *p = b;
|
|
|
|
byte t;
|
|
|
|
|
2006-10-17 03:39:30 +00:00
|
|
|
if (b[0] == 0) return; // empty playlist
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2006-10-17 03:39:30 +00:00
|
|
|
do p++; while (p[0] != 0); // find the end
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2006-10-17 03:39:30 +00:00
|
|
|
t = *--p; // and copy the bytes
|
2004-08-09 17:04:08 +00:00
|
|
|
while (p != b) {
|
|
|
|
p--;
|
|
|
|
p[1] = p[0];
|
|
|
|
}
|
|
|
|
*b = t;
|
|
|
|
|
|
|
|
_song_is_active = false;
|
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void SkipToNextSong()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2009-01-10 00:31:47 +00:00
|
|
|
byte *b = _cur_playlist;
|
2005-11-14 19:48:04 +00:00
|
|
|
byte t;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2005-11-14 19:48:04 +00:00
|
|
|
t = b[0];
|
|
|
|
if (t != 0) {
|
|
|
|
while (b[1] != 0) {
|
2004-08-09 17:04:08 +00:00
|
|
|
b[0] = b[1];
|
|
|
|
b++;
|
|
|
|
}
|
|
|
|
b[0] = t;
|
|
|
|
}
|
|
|
|
|
|
|
|
_song_is_active = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void MusicVolumeChanged(byte new_vol)
|
|
|
|
{
|
2007-07-05 12:23:54 +00:00
|
|
|
_music_driver->SetVolume(new_vol);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void DoPlaySong()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2007-06-17 15:48:57 +00:00
|
|
|
char filename[MAX_PATH];
|
|
|
|
FioFindFullPath(filename, lengthof(filename), GM_DIR,
|
2009-01-03 17:09:31 +00:00
|
|
|
_origin_songs_specs[_music_wnd_cursong - 1].filename);
|
2007-07-05 12:23:54 +00:00
|
|
|
_music_driver->PlaySong(filename);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void DoStopMusic()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2007-07-05 12:23:54 +00:00
|
|
|
_music_driver->StopSong();
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void SelectSongToPlay()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2005-07-31 17:18:43 +00:00
|
|
|
uint i = 0;
|
2006-07-07 02:44:51 +00:00
|
|
|
uint j = 0;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2005-07-31 17:18:43 +00:00
|
|
|
memset(_cur_playlist, 0, sizeof(_cur_playlist));
|
2005-06-01 11:52:44 +00:00
|
|
|
do {
|
2007-06-17 15:48:57 +00:00
|
|
|
/* We are now checking for the existence of that file prior
|
|
|
|
* to add it to the list of available songs */
|
2009-01-03 17:09:31 +00:00
|
|
|
if (FioCheckFileExists(_origin_songs_specs[_playlists[msf.playlist][i] - 1].filename, GM_DIR)) {
|
2007-06-17 15:48:57 +00:00
|
|
|
_cur_playlist[j] = _playlists[msf.playlist][i];
|
|
|
|
j++;
|
2006-07-07 02:44:51 +00:00
|
|
|
}
|
2009-01-03 17:10:20 +00:00
|
|
|
} while (_playlists[msf.playlist][++i] != 0 && j < lengthof(_cur_playlist) - 1);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2007-10-17 01:33:21 +00:00
|
|
|
/* Do not shuffle when on the intro-start window, as the song to play has to be the original TTD Theme*/
|
|
|
|
if (msf.shuffle && _game_mode != GM_MENU) {
|
2004-08-09 17:04:08 +00:00
|
|
|
i = 500;
|
|
|
|
do {
|
|
|
|
uint32 r = InteractiveRandom();
|
2005-07-20 15:29:28 +00:00
|
|
|
byte *a = &_cur_playlist[GB(r, 0, 5)];
|
|
|
|
byte *b = &_cur_playlist[GB(r, 8, 5)];
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
if (*a != 0 && *b != 0) {
|
|
|
|
byte t = *a;
|
|
|
|
*a = *b;
|
|
|
|
*b = t;
|
|
|
|
}
|
|
|
|
} while (--i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void StopMusic()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
_music_wnd_cursong = 0;
|
|
|
|
DoStopMusic();
|
|
|
|
_song_is_active = false;
|
|
|
|
InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9);
|
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void PlayPlaylistSong()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
if (_cur_playlist[0] == 0) {
|
|
|
|
SelectSongToPlay();
|
2006-10-17 03:39:30 +00:00
|
|
|
/* if there is not songs in the playlist, it may indicate
|
|
|
|
* no file on the gm folder, or even no gm folder.
|
|
|
|
* Stop the playback, then */
|
2006-07-07 02:44:51 +00:00
|
|
|
if (_cur_playlist[0] == 0) {
|
|
|
|
_song_is_active = false;
|
|
|
|
_music_wnd_cursong = 0;
|
|
|
|
msf.playing = false;
|
|
|
|
return;
|
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
_music_wnd_cursong = _cur_playlist[0];
|
|
|
|
DoPlaySong();
|
|
|
|
_song_is_active = true;
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9);
|
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
void ResetMusic()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
_music_wnd_cursong = 1;
|
|
|
|
DoPlaySong();
|
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
void MusicLoop()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2006-02-20 23:40:53 +00:00
|
|
|
if (!msf.playing && _song_is_active) {
|
2004-08-09 17:04:08 +00:00
|
|
|
StopMusic();
|
2006-02-20 23:40:53 +00:00
|
|
|
} else if (msf.playing && !_song_is_active) {
|
2007-10-17 01:33:21 +00:00
|
|
|
PlayPlaylistSong();
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2006-07-07 02:44:51 +00:00
|
|
|
if (!_song_is_active) return;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2007-07-05 12:23:54 +00:00
|
|
|
if (!_music_driver->IsSongPlaying()) {
|
2005-04-24 19:04:56 +00:00
|
|
|
if (_game_mode != GM_MENU) {
|
|
|
|
StopMusic();
|
|
|
|
SkipToNextSong();
|
|
|
|
PlayPlaylistSong();
|
2005-11-14 19:48:04 +00:00
|
|
|
} else {
|
2005-04-24 19:04:56 +00:00
|
|
|
ResetMusic();
|
2005-11-14 19:48:04 +00:00
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-10 11:02:09 +00:00
|
|
|
enum MusicTrackSelectionWidgets {
|
|
|
|
MTSW_CLOSE,
|
|
|
|
MTSW_CAPTION,
|
|
|
|
MTSW_BACKGROUND,
|
|
|
|
MTSW_LIST_LEFT,
|
|
|
|
MTSW_LIST_RIGHT,
|
|
|
|
MTSW_ALL,
|
|
|
|
MTSW_OLD,
|
|
|
|
MTSW_NEW,
|
|
|
|
MTSW_EZY,
|
|
|
|
MTSW_CUSTOM1,
|
|
|
|
MTSW_CUSTOM2,
|
|
|
|
MTSW_CLEAR,
|
|
|
|
MTSW_SAVE,
|
|
|
|
};
|
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
struct MusicTrackSelectionWindow : public Window {
|
|
|
|
MusicTrackSelectionWindow(const WindowDesc *desc, WindowNumber number) : Window(desc, number)
|
|
|
|
{
|
|
|
|
this->FindWindowPlacementAndResize(desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnPaint()
|
|
|
|
{
|
|
|
|
this->SetWidgetDisabledState(MTSW_CLEAR, msf.playlist <= 3);
|
|
|
|
this->LowerWidget(MTSW_LIST_LEFT);
|
|
|
|
this->LowerWidget(MTSW_LIST_RIGHT);
|
|
|
|
this->DrawWidgets();
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-07-31 14:42:55 +00:00
|
|
|
GfxFillRect( 3, 23, 3 + 177, 23 + 191, 0);
|
2007-04-18 22:10:36 +00:00
|
|
|
GfxFillRect(251, 23, 251 + 177, 23 + 191, 0);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(this->widget[MTSW_LIST_LEFT].left + 2, this->widget[MTSW_LIST_LEFT].right - 2, 15, STR_01EE_TRACK_INDEX, TC_FROMSTRING, SA_CENTER);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2004-12-02 22:53:07 +00:00
|
|
|
SetDParam(0, STR_01D5_ALL + msf.playlist);
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(this->widget[MTSW_LIST_RIGHT].left + 2, this->widget[MTSW_LIST_RIGHT].right - 2, 15, STR_01EF_PROGRAM, TC_FROMSTRING, SA_CENTER);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
for (uint i = 1; i <= NUM_SONGS_AVAILABLE; i++) {
|
2004-12-02 22:53:07 +00:00
|
|
|
SetDParam(0, i);
|
|
|
|
SetDParam(2, i);
|
|
|
|
SetDParam(1, SPECSTR_SONGNAME);
|
2009-04-10 09:43:53 +00:00
|
|
|
DrawString(this->widget[MTSW_LIST_LEFT].left + 2, this->widget[MTSW_LIST_LEFT].right - 2, 23 + (i - 1) * 6, (i < 10) ? STR_01EC_0 : STR_01ED, TC_FROMSTRING);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
for (uint i = 0; i != 6; i++) {
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(this->widget[MTSW_ALL].left + 2, this->widget[MTSW_ALL].right - 2, 45 + i * 8, STR_01D5_ALL + i, (i == msf.playlist) ? TC_WHITE : TC_BLACK, SA_CENTER);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(this->widget[MTSW_ALL].left + 2, this->widget[MTSW_ALL].right - 2, 45 + 8 * 6 + 16, STR_01F0_CLEAR, TC_FROMSTRING, SA_CENTER);
|
2006-08-31 07:09:13 +00:00
|
|
|
#if 0
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(this->widget[MTSW_SAVE].left + 2, this->widget[MTSW_SAVE].right - 2, 45 + 8 * 6 + 16 * 2, STR_01F1_SAVE, TC_FROMSTRING, SA_CENTER);
|
2006-08-31 07:09:13 +00:00
|
|
|
#endif
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
int y = 23;
|
|
|
|
for (const byte *p = _playlists[msf.playlist]; *p != 0; p++) {
|
|
|
|
uint i = *p;
|
2004-12-02 22:53:07 +00:00
|
|
|
SetDParam(0, i);
|
|
|
|
SetDParam(1, SPECSTR_SONGNAME);
|
2005-11-14 19:48:04 +00:00
|
|
|
SetDParam(2, i);
|
2009-04-10 09:43:53 +00:00
|
|
|
DrawString(this->widget[MTSW_LIST_RIGHT].left + 2, this->widget[MTSW_LIST_RIGHT].right - 2, y, (i < 10) ? STR_01EC_0 : STR_01ED, TC_FROMSTRING);
|
2004-08-09 17:04:08 +00:00
|
|
|
y += 6;
|
|
|
|
}
|
|
|
|
}
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
virtual void OnClick(Point pt, int widget)
|
|
|
|
{
|
|
|
|
switch (widget) {
|
|
|
|
case MTSW_LIST_LEFT: { // add to playlist
|
|
|
|
int y = (pt.y - 23) / 6;
|
|
|
|
|
|
|
|
if (msf.playlist < 4) return;
|
|
|
|
if (!IsInsideMM(y, 0, NUM_SONGS_AVAILABLE)) return;
|
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
byte *p = _playlists[msf.playlist];
|
|
|
|
for (uint i = 0; i != NUM_SONGS_PLAYLIST - 1; i++) {
|
2008-05-17 22:52:51 +00:00
|
|
|
if (p[i] == 0) {
|
|
|
|
p[i] = y + 1;
|
|
|
|
p[i + 1] = 0;
|
|
|
|
this->SetDirty();
|
|
|
|
SelectSongToPlay();
|
|
|
|
break;
|
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
2008-05-17 22:52:51 +00:00
|
|
|
} break;
|
2006-07-07 02:44:51 +00:00
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
case MTSW_LIST_RIGHT: { // remove from playlist
|
|
|
|
int y = (pt.y - 23) / 6;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
if (msf.playlist < 4) return;
|
|
|
|
if (!IsInsideMM(y, 0, NUM_SONGS_AVAILABLE)) return;
|
2006-07-07 02:44:51 +00:00
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
byte *p = _playlists[msf.playlist];
|
|
|
|
for (uint i = y; i != NUM_SONGS_PLAYLIST - 1; i++) {
|
2008-05-17 22:52:51 +00:00
|
|
|
p[i] = p[i + 1];
|
2006-07-07 02:44:51 +00:00
|
|
|
}
|
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
this->SetDirty();
|
|
|
|
SelectSongToPlay();
|
|
|
|
} break;
|
2006-07-07 02:44:51 +00:00
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
case MTSW_CLEAR: // clear
|
|
|
|
_playlists[msf.playlist][0] = 0;
|
|
|
|
this->SetDirty();
|
|
|
|
StopMusic();
|
|
|
|
SelectSongToPlay();
|
|
|
|
break;
|
2006-07-07 02:44:51 +00:00
|
|
|
|
2006-08-28 10:14:37 +00:00
|
|
|
#if 0
|
2008-05-17 22:52:51 +00:00
|
|
|
case MTSW_SAVE: // save
|
|
|
|
ShowInfo("MusicTrackSelectionWndProc:save not implemented");
|
|
|
|
break;
|
2006-08-28 10:14:37 +00:00
|
|
|
#endif
|
2006-07-07 02:44:51 +00:00
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
case MTSW_ALL: case MTSW_OLD: case MTSW_NEW:
|
|
|
|
case MTSW_EZY: case MTSW_CUSTOM1: case MTSW_CUSTOM2: // set playlist
|
|
|
|
msf.playlist = widget - MTSW_ALL;
|
|
|
|
this->SetDirty();
|
|
|
|
InvalidateWindow(WC_MUSIC_WINDOW, 0);
|
|
|
|
StopMusic();
|
|
|
|
SelectSongToPlay();
|
|
|
|
break;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
}
|
2008-05-17 22:52:51 +00:00
|
|
|
};
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
static const Widget _music_track_selection_widgets[] = {
|
2008-07-31 14:42:55 +00:00
|
|
|
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // MTSW_CLOSE
|
|
|
|
{ WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 11, 431, 0, 13, STR_01EB_MUSIC_PROGRAM_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // MTSW_CAPTION
|
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 431, 14, 217, 0x0, STR_NULL}, // MTSW_BACKGROUND
|
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 2, 181, 22, 215, 0x0, STR_01FA_CLICK_ON_MUSIC_TRACK_TO}, // MTSW_LIST_LEFT
|
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 250, 429, 22, 215, 0x0, STR_CLICK_ON_TRACK_TO_REMOVE}, // MTSW_LIST_RIGHT
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 44, 51, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, // MTSW_ALL
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 52, 59, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, // MTSW_OLD
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 60, 67, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, // MTSW_NEW
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 68, 75, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, // MTSW_EZY
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 76, 83, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, // MTSW_CUSTOM1
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 84, 91, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, // MTSW_CUSTOM2
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 108, 115, 0x0, STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1}, // MTSW_CLEAR
|
2006-08-31 07:09:13 +00:00
|
|
|
#if 0
|
2008-07-31 14:42:55 +00:00
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 186, 245, 124, 131, 0x0, STR_01F9_SAVE_MUSIC_SETTINGS}, // MTSW_SAVE
|
2006-08-31 07:09:13 +00:00
|
|
|
#endif
|
2004-09-07 21:48:09 +00:00
|
|
|
{ WIDGETS_END},
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
2009-04-10 11:06:12 +00:00
|
|
|
static const NWidgetPart _nested_music_track_selection_widgets[] = {
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
|
NWidget(WWT_CLOSEBOX, COLOUR_GREY, MTSW_CLOSE),
|
|
|
|
NWidget(WWT_CAPTION, COLOUR_GREY, MTSW_CAPTION), SetDataTip(STR_01EB_MUSIC_PROGRAM_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS),
|
|
|
|
EndContainer(),
|
|
|
|
NWidget(WWT_PANEL, COLOUR_GREY, MTSW_BACKGROUND),
|
|
|
|
NWidget(NWID_HORIZONTAL), SetPIP(2, 4, 2),
|
|
|
|
/* Left panel. */
|
|
|
|
NWidget(NWID_VERTICAL),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 8), // Space for the left heading text.
|
|
|
|
NWidget(WWT_PANEL, COLOUR_GREY, MTSW_LIST_LEFT), SetMinimalSize(180, 194), SetDataTip(0x0, STR_01FA_CLICK_ON_MUSIC_TRACK_TO), EndContainer(),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
|
|
|
|
EndContainer(),
|
|
|
|
/* Middle buttons. */
|
|
|
|
NWidget(NWID_VERTICAL),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 30), // Space above the first button from the title bar.
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_ALL), SetMinimalSize(60, 8), SetDataTip(0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_OLD), SetMinimalSize(60, 8), SetDataTip(0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_NEW), SetMinimalSize(60, 8), SetDataTip(0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_EZY), SetMinimalSize(60, 8), SetDataTip(0x0, STR_0330_SELECT_EZY_STREET_STYLE),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_CUSTOM1), SetMinimalSize(60, 8), SetDataTip(0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_CUSTOM2), SetMinimalSize(60, 8), SetDataTip(0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 16), // Space above 'clear' button
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_CLEAR), SetMinimalSize(60, 8), SetDataTip(0x0, STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1),
|
|
|
|
#if 0
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 8), // Space above 'save' button
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MTSW_SAVE), SetMinimalSize(60, 8), SetDataTip(0x0, STR_01F9_SAVE_MUSIC_SETTINGS),
|
|
|
|
#endif
|
|
|
|
NWidget(NWID_SPACER), SetFill(0, 1),
|
|
|
|
EndContainer(),
|
|
|
|
/* Right panel. */
|
|
|
|
NWidget(NWID_VERTICAL),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 8), // Space for the right heading text.
|
|
|
|
NWidget(WWT_PANEL, COLOUR_GREY, MTSW_LIST_RIGHT), SetMinimalSize(180, 194), SetDataTip(0x0, STR_CLICK_ON_TRACK_TO_REMOVE), EndContainer(),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
|
|
|
|
EndContainer(),
|
|
|
|
EndContainer(),
|
|
|
|
EndContainer(),
|
|
|
|
};
|
|
|
|
|
2009-03-15 15:12:06 +00:00
|
|
|
static const WindowDesc _music_track_selection_desc(
|
2007-07-27 12:49:04 +00:00
|
|
|
104, 131, 432, 218, 432, 218,
|
2007-02-01 15:49:12 +00:00
|
|
|
WC_MUSIC_TRACK_SELECTION, WC_NONE,
|
2004-08-09 17:04:08 +00:00
|
|
|
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
|
2009-04-10 11:06:12 +00:00
|
|
|
_music_track_selection_widgets, _nested_music_track_selection_widgets, lengthof(_nested_music_track_selection_widgets)
|
2009-03-15 15:12:06 +00:00
|
|
|
);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
static void ShowMusicTrackSelection()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2008-05-17 22:52:51 +00:00
|
|
|
AllocateWindowDescFront<MusicTrackSelectionWindow>(&_music_track_selection_desc, 0);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2009-04-10 11:02:09 +00:00
|
|
|
enum MusicWidgets {
|
|
|
|
MW_CLOSE,
|
|
|
|
MW_CAPTION,
|
|
|
|
MW_PREV,
|
|
|
|
MW_NEXT,
|
|
|
|
MW_STOP,
|
|
|
|
MW_PLAY,
|
|
|
|
MW_SLIDERS,
|
|
|
|
MW_GAUGE,
|
|
|
|
MW_BACKGROUND,
|
|
|
|
MW_INFO,
|
|
|
|
MW_SHUFFLE,
|
|
|
|
MW_PROGRAMME,
|
|
|
|
MW_ALL,
|
|
|
|
MW_OLD,
|
|
|
|
MW_NEW,
|
|
|
|
MW_EZY,
|
|
|
|
MW_CUSTOM1,
|
|
|
|
MW_CUSTOM2,
|
|
|
|
};
|
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
struct MusicWindow : public Window {
|
|
|
|
MusicWindow(const WindowDesc *desc, WindowNumber number) : Window(desc, number)
|
|
|
|
{
|
|
|
|
this->FindWindowPlacementAndResize(desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnPaint()
|
|
|
|
{
|
|
|
|
this->RaiseWidget(MW_GAUGE);
|
|
|
|
this->RaiseWidget(MW_INFO);
|
|
|
|
this->DrawWidgets();
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
GfxFillRect(187, 16, 200, 33, 0);
|
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
for (uint i = 0; i != 8; i++) {
|
2009-02-09 02:57:15 +00:00
|
|
|
int colour = 0xD0;
|
2004-08-09 17:04:08 +00:00
|
|
|
if (i > 4) {
|
2009-02-09 02:57:15 +00:00
|
|
|
colour = 0xBF;
|
2004-08-09 17:04:08 +00:00
|
|
|
if (i > 6) {
|
2009-02-09 02:57:15 +00:00
|
|
|
colour = 0xB8;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-09 02:57:15 +00:00
|
|
|
GfxFillRect(187, NUM_SONGS_PLAYLIST - i * 2, 200, NUM_SONGS_PLAYLIST - i * 2, colour);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GfxFillRect(60, 46, 239, 52, 0);
|
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
StringID str = STR_01E3;
|
2009-04-10 10:21:16 +00:00
|
|
|
if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
2004-12-02 22:53:07 +00:00
|
|
|
SetDParam(0, _music_wnd_cursong);
|
2005-11-14 19:48:04 +00:00
|
|
|
str = (_music_wnd_cursong < 10) ? STR_01E4_0 : STR_01E5;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
2009-03-22 12:01:21 +00:00
|
|
|
DrawString(this->widget[MW_INFO].left + 3, this->widget[MW_INFO].right - 3, 46, str, TC_FROMSTRING);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
str = STR_01E6;
|
|
|
|
if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
|
|
|
str = STR_01E7;
|
2004-12-02 22:53:07 +00:00
|
|
|
SetDParam(0, SPECSTR_SONGNAME);
|
|
|
|
SetDParam(1, _music_wnd_cursong);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(this->widget[MW_INFO].left, this->widget[MW_INFO].right, 46, str, TC_FROMSTRING, SA_CENTER);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-03-22 12:01:21 +00:00
|
|
|
DrawString(this->widget[MW_INFO].left + 1, this->widget[MW_INFO].right, 38, STR_01E8_TRACK_XTITLE, TC_FROMSTRING);
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
for (uint i = 0; i != 6; i++) {
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(this->widget[i + MW_ALL].left, this->widget[i + MW_ALL].right, 59, STR_01D5_ALL + i, msf.playlist == i ? TC_WHITE : TC_BLACK, SA_CENTER);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2009-03-25 14:15:34 +00:00
|
|
|
DrawString(this->widget[MW_SHUFFLE].left, this->widget[MW_SHUFFLE].right, this->widget[MW_SHUFFLE].top + 1, STR_01E9_SHUFFLE, (msf.shuffle ? TC_WHITE : TC_BLACK), SA_CENTER);
|
|
|
|
DrawString(this->widget[MW_PROGRAMME].left, this->widget[MW_PROGRAMME].right, this->widget[MW_PROGRAMME].top + 1, STR_01EA_PROGRAM, TC_FROMSTRING, SA_CENTER);
|
2009-03-21 22:00:00 +00:00
|
|
|
DrawString(108, 174, 15, STR_01DB_MUSIC_VOLUME, TC_FROMSTRING, SA_CENTER);
|
|
|
|
DrawString(108, 174, 29, STR_01DD_MIN_MAX, TC_FROMSTRING, SA_CENTER);
|
|
|
|
DrawString(214, 280, 15, STR_01DC_EFFECTS_VOLUME, TC_FROMSTRING, SA_CENTER);
|
|
|
|
DrawString(214, 280, 29, STR_01DD_MIN_MAX, TC_FROMSTRING, SA_CENTER);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-07-31 14:42:55 +00:00
|
|
|
DrawFrameRect(108, 23, 174, 26, COLOUR_GREY, FR_LOWERED);
|
|
|
|
DrawFrameRect(214, 23, 280, 26, COLOUR_GREY, FR_LOWERED);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2006-08-31 07:09:13 +00:00
|
|
|
DrawFrameRect(
|
2008-07-31 14:42:55 +00:00
|
|
|
108 + msf.music_vol / 2, 22, 111 + msf.music_vol / 2, 28, COLOUR_GREY, FR_NONE
|
2006-08-31 07:09:13 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
DrawFrameRect(
|
2008-07-31 14:42:55 +00:00
|
|
|
214 + msf.effect_vol / 2, 22, 217 + msf.effect_vol / 2, 28, COLOUR_GREY, FR_NONE
|
2006-08-31 07:09:13 +00:00
|
|
|
);
|
2008-05-17 22:52:51 +00:00
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
virtual void OnClick(Point pt, int widget)
|
|
|
|
{
|
|
|
|
switch (widget) {
|
|
|
|
case MW_PREV: // skip to prev
|
|
|
|
if (!_song_is_active) return;
|
|
|
|
SkipToPrevSong();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MW_NEXT: // skip to next
|
|
|
|
if (!_song_is_active) return;
|
|
|
|
SkipToNextSong();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MW_STOP: // stop playing
|
|
|
|
msf.playing = false;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MW_PLAY: // start playing
|
|
|
|
msf.playing = true;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MW_SLIDERS: { // volume sliders
|
|
|
|
int x = pt.x - 88;
|
|
|
|
if (x < 0) return;
|
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
byte *vol = &msf.music_vol;
|
2008-05-17 22:52:51 +00:00
|
|
|
if (x >= 106) {
|
|
|
|
vol = &msf.effect_vol;
|
|
|
|
x -= 106;
|
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-04-10 10:29:28 +00:00
|
|
|
byte new_vol = min(max(x - 21, 0) * 2, 127);
|
2008-05-17 22:52:51 +00:00
|
|
|
if (new_vol != *vol) {
|
|
|
|
*vol = new_vol;
|
|
|
|
if (vol == &msf.music_vol) MusicVolumeChanged(new_vol);
|
|
|
|
this->SetDirty();
|
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
_left_button_clicked = false;
|
|
|
|
} break;
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
case MW_SHUFFLE: // toggle shuffle
|
2008-05-17 22:52:51 +00:00
|
|
|
msf.shuffle ^= 1;
|
|
|
|
StopMusic();
|
|
|
|
SelectSongToPlay();
|
|
|
|
break;
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
case MW_PROGRAMME: // show track selection
|
2008-05-17 22:52:51 +00:00
|
|
|
ShowMusicTrackSelection();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MW_ALL: case MW_OLD: case MW_NEW:
|
|
|
|
case MW_EZY: case MW_CUSTOM1: case MW_CUSTOM2: // playlist
|
|
|
|
msf.playlist = widget - MW_ALL;
|
|
|
|
this->SetDirty();
|
|
|
|
InvalidateWindow(WC_MUSIC_TRACK_SELECTION, 0);
|
|
|
|
StopMusic();
|
|
|
|
SelectSongToPlay();
|
|
|
|
break;
|
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2008-05-17 22:52:51 +00:00
|
|
|
#if 0
|
|
|
|
virtual void OnTick()
|
|
|
|
{
|
|
|
|
this->InvalidateWidget(MW_GAUGE);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
};
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
static const Widget _music_window_widgets[] = {
|
2008-07-31 14:42:55 +00:00
|
|
|
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // MW_CLOSE
|
|
|
|
{ WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 11, 299, 0, 13, STR_01D2_JAZZ_JUKEBOX, STR_018C_WINDOW_TITLE_DRAG_THIS}, // MW_CAPTION
|
|
|
|
{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 0, 21, 14, 35, SPR_IMG_SKIP_TO_PREV, STR_01DE_SKIP_TO_PREVIOUS_TRACK}, // MW_PREV
|
|
|
|
{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 22, 43, 14, 35, SPR_IMG_SKIP_TO_NEXT, STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION}, // MW_NEXT
|
|
|
|
{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 44, 65, 14, 35, SPR_IMG_STOP_MUSIC, STR_01E0_STOP_PLAYING_MUSIC}, // MW_STOP
|
|
|
|
{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 66, 87, 14, 35, SPR_IMG_PLAY_MUSIC, STR_01E1_START_PLAYING_MUSIC}, // MW_PLAY
|
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 88, 299, 14, 35, 0x0, STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC}, // MW_SLIDERS
|
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 186, 201, 15, 34, 0x0, STR_NULL}, // MW_GAUGE
|
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 299, 36, 57, 0x0, STR_NULL}, // MW_BACKGROUND
|
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 59, 240, 45, 53, 0x0, STR_NULL}, // MW_INFO
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 6, 55, 42, 49, 0x0, STR_01FB_TOGGLE_PROGRAM_SHUFFLE}, // MW_SHUFFLE
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 244, 293, 42, 49, 0x0, STR_01FC_SHOW_MUSIC_TRACK_SELECTION}, // MW_PROGRAMME
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 0, 49, 58, 65, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, // MW_ALL
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 50, 99, 58, 65, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, // MW_OLD
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 100, 149, 58, 65, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, // MW_NEW
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 150, 199, 58, 65, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, // MW_EZY
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 200, 249, 58, 65, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, // MW_CUSTOM1
|
|
|
|
{ WWT_PUSHBTN, RESIZE_NONE, COLOUR_GREY, 250, 299, 58, 65, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, // MW_CUSTOM2
|
2004-09-07 21:48:09 +00:00
|
|
|
{ WIDGETS_END},
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|
|
|
|
|
2009-04-10 11:06:12 +00:00
|
|
|
static const NWidgetPart _nested_music_window_widgets[] = {
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
|
NWidget(WWT_CLOSEBOX, COLOUR_GREY, MW_CLOSE),
|
|
|
|
NWidget(WWT_CAPTION, COLOUR_GREY, MW_CAPTION), SetDataTip(STR_01D2_JAZZ_JUKEBOX, STR_018C_WINDOW_TITLE_DRAG_THIS),
|
|
|
|
EndContainer(),
|
|
|
|
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
|
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_PREV), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_SKIP_TO_PREV, STR_01DE_SKIP_TO_PREVIOUS_TRACK),
|
|
|
|
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_NEXT), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_SKIP_TO_NEXT, STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION),
|
|
|
|
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_STOP), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_STOP_MUSIC, STR_01E0_STOP_PLAYING_MUSIC),
|
|
|
|
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_PLAY), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_PLAY_MUSIC, STR_01E1_START_PLAYING_MUSIC),
|
|
|
|
NWidget(WWT_PANEL, COLOUR_GREY, MW_SLIDERS), SetDataTip(0x0, STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC),
|
|
|
|
NWidget(WWT_PANEL, COLOUR_GREY, MW_GAUGE), SetMinimalSize(16, 20), SetPadding(1, 98, 1, 98), EndContainer(),
|
|
|
|
EndContainer(),
|
|
|
|
NWidget(NWID_SPACER), SetFill(1, 0),
|
|
|
|
EndContainer(),
|
|
|
|
NWidget(WWT_PANEL, COLOUR_GREY, MW_BACKGROUND),
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_SHUFFLE), SetMinimalSize(50, 8), SetDataTip(0x0, STR_01FB_TOGGLE_PROGRAM_SHUFFLE), SetPadding(6, 3, 8, 6),
|
|
|
|
NWidget(NWID_VERTICAL),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 9),
|
|
|
|
NWidget(WWT_PANEL, COLOUR_GREY, MW_INFO), SetMinimalSize(182, 9), SetFill(0, 0), EndContainer(),
|
|
|
|
NWidget(NWID_SPACER), SetFill(0, 1),
|
|
|
|
EndContainer(),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_PROGRAMME), SetMinimalSize(50, 8), SetDataTip(0x0, STR_01FC_SHOW_MUSIC_TRACK_SELECTION), SetPadding(6, 0, 8, 3),
|
|
|
|
NWidget(NWID_SPACER), SetFill(1, 0),
|
|
|
|
EndContainer(),
|
|
|
|
EndContainer(),
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_ALL), SetMinimalSize(50, 8), SetDataTip(0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_OLD), SetMinimalSize(50, 8), SetDataTip(0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_NEW), SetMinimalSize(50, 8), SetDataTip(0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_EZY), SetMinimalSize(50, 8), SetDataTip(0x0, STR_0330_SELECT_EZY_STREET_STYLE),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_CUSTOM1), SetMinimalSize(50, 8), SetDataTip(0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED),
|
|
|
|
NWidget(WWT_PUSHBTN, COLOUR_GREY, MW_CUSTOM2), SetMinimalSize(50, 8), SetDataTip(0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED),
|
|
|
|
EndContainer(),
|
|
|
|
};
|
|
|
|
|
2009-03-15 15:12:06 +00:00
|
|
|
static const WindowDesc _music_window_desc(
|
2007-07-27 12:49:04 +00:00
|
|
|
0, 22, 300, 66, 300, 66,
|
2007-02-01 15:49:12 +00:00
|
|
|
WC_MUSIC_WINDOW, WC_NONE,
|
2004-08-09 17:04:08 +00:00
|
|
|
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
|
2009-04-10 11:06:12 +00:00
|
|
|
_music_window_widgets, _nested_music_window_widgets, lengthof(_nested_music_window_widgets)
|
2009-03-15 15:12:06 +00:00
|
|
|
);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
void ShowMusicWindow()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2008-05-17 22:52:51 +00:00
|
|
|
AllocateWindowDescFront<MusicWindow>(&_music_window_desc, 0);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|