coastline 0.0.4
Loading...
Searching...
No Matches
musicdevice.h File Reference
#include <stdint.h>
#include <windows.h>
#include <mmsystem.h>
#include "ear/musicdevice.h"
Include dependency graph for musicdevice.h:

Go to the source code of this file.

Classes

struct  EarCdTrackPosition
 Absolute CD track positions in the MCI millisecond time format. More...

Typedefs

typedef struct EarCdTrackPosition EarCdTrackPosition
 Absolute CD track positions in the MCI millisecond time format.

Functions

void StopAndCloseMidiSequencer (void)
 CD mixer initialisation marker, also set when mixer access is disabled.
void CloseActiveMidiSequencer (void)
 Stop and close the MIDI sequencer when a playback is using it.
void RestoreMusicMixerControls (void)
 Give the volume and the mute controls of the mixers back their values and close the mixers.
uint16_t __stdcall FindCdTrackAtPosition (DWORD position)
 Find the track at a position using the loaded table.
DWORD __stdcall GetCdTrackStartPosition (uint16_t track)
DWORD __stdcall GetCdTrackEndPosition (uint16_t track)
int __stdcall OpenCdAudioMixer (UINT mixer)
 Open the mixer of the CD audio, sharing the MIDI mixer when it is the same device.
void CloseCdAudioMixer (void)
 Close the mixer of the CD audio, unless the MIDI mixer shares it.
int __stdcall OpenMidiMixer (UINT mixer)
 Open the mixer of the MIDI music, sharing the CD audio mixer when it is the same device.
void CloseMidiMixer (void)
 Close the mixer of the MIDI music, unless the CD audio mixer shares it.
int __stdcall CacheMidiMixerControls (DWORD line)
 Find the volume and the mute controls of a line of the MIDI mixer and save their values.
int __stdcall CacheCdAudioMixerControls (DWORD line)
 Find the volume and the mute controls of a line of the CD audio mixer and save their values.
int InitializeMusicMixers (void)
 Open the mixers the configuration selects and save the values of their controls.
int OpenCdAudioDevice (void)
 Open the CD audio device, timed in milliseconds, and read its tracks.
DWORD GetCdAudioDeviceMode (void)
int __stdcall IsCdTrackInRange (DWORD track)
int WaitForCdAudioReady (void)
 Wait for an open CD audio device to close, closing its door when it has no CD and waiting up to a second at a time.
int OpenMidiSequencerDevice (void)
 Open the MIDI sequencer.
void MarkMidiSequencerActive (void)
 Record that a playback is using the MIDI sequencer.

Typedef Documentation

◆ EarCdTrackPosition

typedef struct EarCdTrackPosition EarCdTrackPosition

Absolute CD track positions in the MCI millisecond time format.

Function Documentation

◆ StopAndCloseMidiSequencer()

void StopAndCloseMidiSequencer ( void )

CD mixer initialisation marker, also set when mixer access is disabled.

An independently closed mixer does not clear the native marker.

Ghidra address:
EAR: 0x1003b7c4 Stop and close the MIDI sequencer.
Ghidra address:
EAR: 0x1000406e

◆ CloseActiveMidiSequencer()

void CloseActiveMidiSequencer ( void )

Stop and close the MIDI sequencer when a playback is using it.

Ghidra address:
EAR: 0x1000409e

◆ RestoreMusicMixerControls()

void RestoreMusicMixerControls ( void )

Give the volume and the mute controls of the mixers back their values and close the mixers.

Ghidra address:
EAR: 0x100040e2

◆ FindCdTrackAtPosition()

uint16_t __stdcall FindCdTrackAtPosition ( DWORD position)

Find the track at a position using the loaded table.

The native comparison excludes the stored final millisecond of each track.

Parameters
positionThe position, in milliseconds.
Returns
The number of the track, or 0 for none.
Ghidra address:
EAR: 0x1000477c

◆ GetCdTrackStartPosition()

DWORD __stdcall GetCdTrackStartPosition ( uint16_t track)
Parameters
trackThe one-based track number in a loaded table. Zero is not a valid index.
Returns
The absolute track start in milliseconds, or zero past the last audio track.
Ghidra address:
EAR: 0x100047cf

◆ GetCdTrackEndPosition()

DWORD __stdcall GetCdTrackEndPosition ( uint16_t track)
Parameters
trackThe one-based track number in a loaded table. Zero is not a valid index.
Returns
The absolute start plus duration minus one in milliseconds, or zero past the last audio track.
Ghidra address:
EAR: 0x10004800

◆ OpenCdAudioMixer()

int __stdcall OpenCdAudioMixer ( UINT mixer)

Open the mixer of the CD audio, sharing the MIDI mixer when it is the same device.

Parameters
mixerThe mixer device.
Returns
Whether opening succeeds or an existing initialisation marker permits reuse. A stale marker does not guarantee a valid mixer handle.
Ghidra address:
EAR: 0x10005e20

◆ CloseCdAudioMixer()

void CloseCdAudioMixer ( void )

Close the mixer of the CD audio, unless the MIDI mixer shares it.

Ghidra address:
EAR: 0x10005ea9

◆ OpenMidiMixer()

int __stdcall OpenMidiMixer ( UINT mixer)

Open the mixer of the MIDI music, sharing the CD audio mixer when it is the same device.

Parameters
mixerThe mixer device.
Returns
Whether opening succeeds or an existing initialisation marker permits reuse. A stale marker does not guarantee a valid mixer handle.
Ghidra address:
EAR: 0x10005ef3

◆ CloseMidiMixer()

void CloseMidiMixer ( void )

Close the mixer of the MIDI music, unless the CD audio mixer shares it.

Ghidra address:
EAR: 0x10005f7c

◆ CacheMidiMixerControls()

int __stdcall CacheMidiMixerControls ( DWORD line)

Find the volume and the mute controls of a line of the MIDI mixer and save their values.

Parameters
lineThe line.
Returns
Whether both controls were found.
Ghidra address:
EAR: 0x10005fc6

◆ CacheCdAudioMixerControls()

int __stdcall CacheCdAudioMixerControls ( DWORD line)

Find the volume and the mute controls of a line of the CD audio mixer and save their values.

Parameters
lineThe line.
Returns
Whether both controls were found.
Ghidra address:
EAR: 0x10006114

◆ InitializeMusicMixers()

int InitializeMusicMixers ( void )

Open the mixers the configuration selects and save the values of their controls.

Returns
Zero when either required mixer open fails; otherwise nonzero, including when mixer access is disabled. Control-discovery failures do not change the return value.
Ghidra address:
EAR: 0x10006262

◆ OpenCdAudioDevice()

int OpenCdAudioDevice ( void )

Open the CD audio device, timed in milliseconds, and read its tracks.

Returns
Whether the device opens, accepts millisecond timing, reports media, and loads tracks. Track loading can accept a previously discovered first audio-track number.
Ghidra address:
EAR: 0x10006313

◆ GetCdAudioDeviceMode()

DWORD GetCdAudioDeviceMode ( void )
Returns
The mode of the CD audio device, an MCI_MODE value.
Ghidra address:
EAR: 0x10006409

◆ IsCdTrackInRange()

int __stdcall IsCdTrackInRange ( DWORD track)
Parameters
trackThe track number to compare with the cached first and last audio-track numbers.
Returns
Whether the number falls within the inclusive cached range, without querying track type.
Ghidra address:
EAR: 0x100064bd

◆ WaitForCdAudioReady()

int WaitForCdAudioReady ( void )

Wait for an open CD audio device to close, closing its door when it has no CD and waiting up to a second at a time.

Returns
Whether the device is ready.
Ghidra address:
EAR: 0x100064f5

◆ OpenMidiSequencerDevice()

int OpenMidiSequencerDevice ( void )

Open the MIDI sequencer.

Returns
Whether the sequencer opened.
Ghidra address:
EAR: 0x10006560

◆ MarkMidiSequencerActive()

void MarkMidiSequencerActive ( void )

Record that a playback is using the MIDI sequencer.

Ghidra address:
EAR: 0x100094f0