OpenTTD Source 20250331-master-g3c15e0c889
|
Generic functions for replacing base music data. More...
#include "base_media_base.h"
Go to the source code of this file.
Data Structures | |
struct | MusicSongInfo |
Metadata about a music track. More... | |
struct | BaseSetTraits< struct MusicSet > |
struct | MusicSet |
All data of a music set. More... | |
class | BaseMusic |
All data/functions related with replacing the base music. More... | |
Enumerations | |
enum | MusicTrackType : uint8_t { MTT_STANDARDMIDI , MTT_MPSMIDI } |
Functions | |
std::optional< std::string > | GetMusicCatEntryName (const std::string &filename, size_t entrynum) |
Read the name of a music CAT file entry. | |
std::optional< std::vector< uint8_t > > | GetMusicCatEntryData (const std::string &filename, size_t entrynum) |
Read the full data of a music CAT file entry. | |
Variables | |
static const uint | NUM_SONGS_CLASS = 10 |
Maximum number of songs in the 'class' playlists. | |
static const uint | NUM_SONG_CLASSES = 3 |
Number of classes for songs. | |
static const uint | NUM_SONGS_AVAILABLE = 1 + NUM_SONG_CLASSES * NUM_SONGS_CLASS |
Maximum number of songs in the full playlist; theme song + the classes. | |
static const uint | NUM_SONGS_PLAYLIST = 32 |
Maximum number of songs in the (custom) playlist. | |
Generic functions for replacing base music data.
Definition in file base_media_music.h.
enum MusicTrackType : uint8_t |
Enumerator | |
---|---|
MTT_STANDARDMIDI | Standard MIDI file. |
MTT_MPSMIDI | MPS GM driver MIDI format (contained in a CAT file) |
Definition at line 29 of file base_media_music.h.
std::optional< std::vector< uint8_t > > GetMusicCatEntryData | ( | const std::string & | filename, |
size_t | entrynum | ||
) |
Read the full data of a music CAT file entry.
filename | Name of CAT file to read from. |
entrynum | Index of entry to read |
Definition at line 49 of file music.cpp.
References BASESET_DIR, FioCheckFileExists(), RandomAccessFile::ReadBlock(), RandomAccessFile::ReadByte(), RandomAccessFile::ReadDword(), RandomAccessFile::SeekTo(), and RandomAccessFile::SkipBytes().
Referenced by MidiFile::GetSMFFile().
std::optional< std::string > GetMusicCatEntryName | ( | const std::string & | filename, |
size_t | entrynum | ||
) |
Read the name of a music CAT file entry.
filename | Name of CAT file to read from |
entrynum | Index of entry whose name to read |
Definition at line 25 of file music.cpp.
References BASESET_DIR, FioCheckFileExists(), RandomAccessFile::ReadBlock(), RandomAccessFile::ReadByte(), RandomAccessFile::ReadDword(), RandomAccessFile::SeekTo(), and StrMakeValid().
|
static |
Number of classes for songs.
Definition at line 18 of file base_media_music.h.
|
static |
Maximum number of songs in the full playlist; theme song + the classes.
Definition at line 20 of file base_media_music.h.
Referenced by MusicSystem::BuildPlaylists().
|
static |
Maximum number of songs in the 'class' playlists.
Definition at line 16 of file base_media_music.h.
Referenced by MusicSystem::BuildPlaylists().
|
static |
Maximum number of songs in the (custom) playlist.
Definition at line 23 of file base_media_music.h.
Referenced by MusicSystem::BuildPlaylists(), MusicSystem::PlaylistAdd(), and MusicSystem::SaveCustomPlaylist().