OpenTTD Source 20260206-master-g4d4e37dbf1
DLSFile Struct Reference

A DLS file. More...

Data Structures

struct  DLSRegion
 An instrument region maps a note range to wave data. More...
struct  DLSInstrument
 Instrument definition read from a DLS file. More...
struct  DLSWave
 Wave data definition from a DLS file. More...

Public Member Functions

bool LoadFile (std::string_view file)
 Try loading a DLS file into memory.

Data Fields

std::vector< DLSInstrumentinstruments
std::vector< POOLCUE > pool_cues
std::vector< DLSWavewaves

Private Member Functions

bool ReadDLSArticulation (FileHandle &f, DWORD list_length, std::vector< CONNECTION > &out)
 Load an articulation structure from a DLS file.
bool ReadDLSRegionList (FileHandle &f, DWORD list_length, DLSInstrument &instrument)
 Load a list of regions from a DLS file.
bool ReadDLSRegion (FileHandle &f, DWORD list_length, std::vector< DLSRegion > &out)
 Load a single region from a DLS file.
bool ReadDLSInstrumentList (FileHandle &f, DWORD list_length)
 Load a list of instruments from a DLS file.
bool ReadDLSInstrument (FileHandle &f, DWORD list_length)
 Load a single instrument from a DLS file.
bool ReadDLSWaveList (FileHandle &f, DWORD list_length)
 Load a list of waves from a DLS file.
bool ReadDLSWave (FileHandle &f, DWORD list_length, long offset)
 Load a single wave from a DLS file.

Detailed Description

A DLS file.

Definition at line 45 of file dmusic.cpp.

Member Function Documentation

◆ LoadFile()

bool DLSFile::LoadFile ( std::string_view file)

Try loading a DLS file into memory.

Definition at line 423 of file dmusic.cpp.

References Debug, FileHandle::Open(), ReadDLSInstrumentList(), and ReadDLSWaveList().

◆ ReadDLSArticulation()

bool DLSFile::ReadDLSArticulation ( FileHandle & f,
DWORD list_length,
std::vector< CONNECTION > & out )
private

Load an articulation structure from a DLS file.

Definition at line 152 of file dmusic.cpp.

Referenced by ReadDLSInstrument(), and ReadDLSRegion().

◆ ReadDLSInstrument()

bool DLSFile::ReadDLSInstrument ( FileHandle & f,
DWORD list_length )
private

Load a single instrument from a DLS file.

Definition at line 262 of file dmusic.cpp.

References Debug, ReadDLSArticulation(), and ReadDLSRegionList().

Referenced by ReadDLSInstrumentList().

◆ ReadDLSInstrumentList()

bool DLSFile::ReadDLSInstrumentList ( FileHandle & f,
DWORD list_length )
private

Load a list of instruments from a DLS file.

Definition at line 305 of file dmusic.cpp.

References Debug, and ReadDLSInstrument().

Referenced by LoadFile().

◆ ReadDLSRegion()

bool DLSFile::ReadDLSRegion ( FileHandle & f,
DWORD list_length,
std::vector< DLSRegion > & out )
private

Load a single region from a DLS file.

Definition at line 178 of file dmusic.cpp.

References Debug, and ReadDLSArticulation().

Referenced by ReadDLSRegionList().

◆ ReadDLSRegionList()

bool DLSFile::ReadDLSRegionList ( FileHandle & f,
DWORD list_length,
DLSInstrument & instrument )
private

Load a list of regions from a DLS file.

Definition at line 236 of file dmusic.cpp.

References Debug, and ReadDLSRegion().

Referenced by ReadDLSInstrument().

◆ ReadDLSWave()

bool DLSFile::ReadDLSWave ( FileHandle & f,
DWORD list_length,
long offset )
private

Load a single wave from a DLS file.

Definition at line 333 of file dmusic.cpp.

References Debug.

Referenced by ReadDLSWaveList().

◆ ReadDLSWaveList()

bool DLSFile::ReadDLSWaveList ( FileHandle & f,
DWORD list_length )
private

Load a list of waves from a DLS file.

Definition at line 391 of file dmusic.cpp.

References Debug, and ReadDLSWave().

Referenced by LoadFile().

Field Documentation

◆ instruments

std::vector<DLSInstrument> DLSFile::instruments

Definition at line 75 of file dmusic.cpp.

◆ pool_cues

std::vector<POOLCUE> DLSFile::pool_cues

Definition at line 76 of file dmusic.cpp.

◆ waves

std::vector<DLSWave> DLSFile::waves

Definition at line 77 of file dmusic.cpp.


The documentation for this struct was generated from the following file: