OpenTTD Source: src/music_gui.cpp File Reference

OpenTTD Source 1.11.0-RC1

Data Structures | Functions | Variables
music_gui.cpp File Reference
`#include "stdafx.h"`
`#include <vector>`
`#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 "zoom_func.h"`
`#include "core/random_func.hpp"`
`#include "error.h"`
`#include "core/geometry_func.hpp"`
`#include "string_func.h"`
`#include "settings_type.h"`
`#include "settings_gui.h"`
`#include "widgets/dropdown_func.h"`
`#include "widgets/dropdown_type.h"`
`#include "widgets/music_widget.h"`
`#include "table/strings.h"`
`#include "table/sprites.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | MusicSystem
struct | MusicSystem::PlaylistEntry
struct | MusicTrackSelectionWindow
struct | MusicWindow

## Functions
void | MusicLoop ()
| Check music playback status and start/stop/song-finished. More...
void | ChangeMusicSet (int index)
| Change the configured music set and reset playback. More...
void | InitializeMusic ()
| Prepare the music system for use. More...
static void | ShowMusicTrackSelection ()
void | ShowMusicWindow ()

## Variables
MusicSystem | _music
static const NWidgetPart | _nested_music_track_selection_widgets []
static WindowDesc | _music_track_selection_desc (WDP_AUTO, "music_track", 0, 0, WC_MUSIC_TRACK_SELECTION, WC_NONE, 0, _nested_music_track_selection_widgets, lengthof(_nested_music_track_selection_widgets))
static const NWidgetPart | _nested_music_window_widgets []
static WindowDesc | _music_window_desc (WDP_AUTO, "music", 0, 0, WC_MUSIC_WINDOW, WC_NONE, 0, _nested_music_window_widgets, lengthof(_nested_music_window_widgets))

## Detailed Description

GUI for the music playback.

Definition in file music_gui.cpp.

## Function Documentation

## ◆ ChangeMusicSet()

void ChangeMusicSet | ( | int | index | ) |

Change the configured music set and reset playback.

Parameters

  index | Index of music set to switch to

Definition at line 431 of file music_gui.cpp.

References _music, BaseMedia< MusicSet >::GetIndexOfUsedSet(), and BaseMedia< MusicSet >::GetSet().

Referenced by MusicTrackSelectionWindow::OnDropdownSelect().

## ◆ InitializeMusic()

void InitializeMusic | ( |  | ) |

Prepare the music system for use.

Called from `InitializeGame`

Definition at line 441 of file music_gui.cpp.

References _music.

## ◆ MusicLoop()

void MusicLoop | ( |  | ) |

Check music playback status and start/stop/song-finished.

Called from main loop.

Definition at line 422 of file music_gui.cpp.

References _music.