GUI for the music playback. More...
#include "stdafx.h"
#include "openttd.h"
#include "base_media_base.h"
#include "music/music_driver.hpp"
#include "window_gui.h"
#include "strings_func.h"
#include "window_func.h"
#include "sound_func.h"
#include "gfx_func.h"
#include "core/random_func.hpp"
#include "gui.h"
#include "core/geometry_func.hpp"
#include "string_func.h"
#include "settings_type.h"
#include "table/strings.h"
#include "table/sprites.h"
Go to the source code of this file.
Data Structures | |
struct | MusicTrackSelectionWindow |
struct | MusicWindow |
Enumerations | |
enum | MusicTrackSelectionWidgets { MTSW_LIST_LEFT, MTSW_PLAYLIST, MTSW_LIST_RIGHT, MTSW_ALL, MTSW_OLD, MTSW_NEW, MTSW_EZY, MTSW_CUSTOM1, MTSW_CUSTOM2, MTSW_CLEAR } |
enum | MusicWidgets { MW_PREV, MW_NEXT, MW_STOP, MW_PLAY, MW_SLIDERS, MW_MUSIC_VOL, MW_EFFECT_VOL, MW_BACKGROUND, MW_TRACK, MW_TRACK_NR, MW_TRACK_TITLE, MW_TRACK_NAME, MW_SHUFFLE, MW_PROGRAMME, MW_ALL, MW_OLD, MW_NEW, MW_EZY, MW_CUSTOM1, MW_CUSTOM2 } |
Functions | |
static const char * | GetSongName (int index) |
Get the name of the song. | |
static int | GetTrackNumber (int index) |
Get the track number of the song. | |
assert_compile (lengthof(_settings_client.music.custom_1)==NUM_SONGS_PLAYLIST+1) | |
assert_compile (lengthof(_settings_client.music.custom_2)==NUM_SONGS_PLAYLIST+1) | |
void | ValidatePlaylist (byte *playlist, byte *last) |
Validate a playlist. | |
void | InitializeMusic () |
Initialize the playlists. | |
static void | SkipToPrevSong () |
static void | SkipToNextSong () |
static void | MusicVolumeChanged (byte new_vol) |
static void | DoPlaySong () |
static void | DoStopMusic () |
static void | SelectSongToPlay () |
static void | StopMusic () |
static void | PlayPlaylistSong () |
void | ResetMusic () |
void | MusicLoop () |
static void | SelectPlaylist (byte list) |
static void | ShowMusicTrackSelection () |
void | ShowMusicWindow () |
Variables | |
static byte | _music_wnd_cursong = 1 |
The currently played song. | |
static bool | _song_is_active = false |
Whether a song is currently played. | |
static byte | _cur_playlist [NUM_SONGS_PLAYLIST+1] |
Indices of the songs in the current playlist. | |
static byte | _playlist_all [NUM_SONGS_AVAILABLE+1] |
Indices of all songs. | |
static byte | _playlist_old_style [NUM_SONGS_CLASS+1] |
Indices of all old style songs. | |
static byte | _playlist_new_style [NUM_SONGS_CLASS+1] |
Indices of all new style songs. | |
static byte | _playlist_ezy_street [NUM_SONGS_CLASS+1] |
Indices of all ezy street songs. | |
static byte *const | _playlists [] |
The different playlists that can be played. | |
static const NWidgetPart | _nested_music_track_selection_widgets [] |
static const WindowDesc | _music_track_selection_desc (WDP_AUTO, 0, 0, WC_MUSIC_TRACK_SELECTION, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_music_track_selection_widgets, lengthof(_nested_music_track_selection_widgets)) |
static const NWidgetPart | _nested_music_window_widgets [] |
static const WindowDesc | _music_window_desc (WDP_AUTO, 0, 0, WC_MUSIC_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_music_window_widgets, lengthof(_nested_music_window_widgets)) |
GUI for the music playback.
Definition in file music_gui.cpp.
static const char* GetSongName | ( | int | index | ) | [static] |
Get the name of the song.
index | of the song. |
Definition at line 35 of file music_gui.cpp.
References BaseMedia< MusicSet >::GetUsedSet(), and MusicSet::song_name.
Referenced by MusicWindow::DrawWidget(), MusicTrackSelectionWindow::DrawWidget(), InitializeMusic(), MusicWindow::UpdateWidgetSize(), MusicTrackSelectionWindow::UpdateWidgetSize(), and ValidatePlaylist().
static int GetTrackNumber | ( | int | index | ) | [static] |
Get the track number of the song.
index | of the song. |
Definition at line 45 of file music_gui.cpp.
References BaseMedia< MusicSet >::GetUsedSet().
Referenced by MusicWindow::DrawWidget(), MusicTrackSelectionWindow::DrawWidget(), MusicTrackSelectionWindow::OnClick(), and MusicTrackSelectionWindow::UpdateWidgetSize().
void ValidatePlaylist | ( | byte * | playlist, | |
byte * | last | |||
) |
Validate a playlist.
playlist | The playlist to validate. | |
last | The last location in the list. |
Definition at line 85 of file music_gui.cpp.
References GetSongName(), NUM_SONGS_AVAILABLE, and StrEmpty().
Referenced by InitializeMusic().
byte* const _playlists[] [static] |
{ _playlist_all, _playlist_old_style, _playlist_new_style, _playlist_ezy_street, _settings_client.music.custom_1, _settings_client.music.custom_2, }
The different playlists that can be played.
Definition at line 71 of file music_gui.cpp.