OpenTTD Source 20260304-master-g1baaa74679
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.

Parameters
fileThe file to load.
Returns
true iff the file was loaded without issues.

Definition at line 472 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.

Parameters
fThe file to read the data from.
list_lengthThe length of the data chunk in the file.
outThe container to read the DLS articulation into.
Returns
true iff the data was loaded without issues.

Definition at line 201 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.

Parameters
fThe file to read the data from.
list_lengthThe length of the data chunk in the file.
Returns
true iff the data was loaded without issues.

Definition at line 311 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.

Parameters
fThe file to read the data from.
list_lengthThe length of the data chunk in the file.
Returns
true iff the data was loaded without issues.

Definition at line 354 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.

Parameters
fThe file to read the data from.
list_lengthThe length of the data chunk in the file.
outThe container to read the DLS region into.
Returns
true iff the data was loaded without issues.

Definition at line 227 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.

Parameters
fThe file to read the data from.
list_lengthThe length of the data chunk in the file.
instrumentThe instrument to load the region list for.
Returns
true iff the data was loaded without issues.

Definition at line 285 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.

Parameters
fThe file to read the data from.
list_lengthThe length of the data chunk in the file.
offsetThe offset within the file.
Returns
true iff the data was loaded without issues.

Definition at line 382 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.

Parameters
fThe file to read the data from.
list_lengthThe length of the data chunk in the file.
Returns
true iff the data was loaded without issues.

Definition at line 440 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: