ScummVM API documentation
MADS::Nebular::ASound Class Referenceabstract

#include <asound.h>

Inheritance diagram for MADS::Nebular::ASound:
MADS::SoundDriver MADS::Nebular::RexASound MADS::Nebular::ASound1 MADS::Nebular::ASound2 MADS::Nebular::ASound3 MADS::Nebular::ASound4 MADS::Nebular::ASound5 MADS::Nebular::ASound6 MADS::Nebular::ASound7 MADS::Nebular::ASound8 MADS::Nebular::ASound9

Classes

struct  CachedDataEntry
 

Public Member Functions

 ASound (Audio::Mixer *mixer, OPL::OPL *opl, const Common::Path &filename, int dataOffset, int dataSize)
 
 ~ASound () override
 
CachedDataEntrygetCachedData (byte *pData)
 
int stop () override
 
int poll () override
 
void noise () override
 
int getFrameCounter ()
 
void setVolume (int volume) override
 
- Public Member Functions inherited from MADS::SoundDriver
 SoundDriver (Audio::Mixer *mixer, OPL::OPL *opl, const Common::Path &filename, int dataOffset, int dataSize)
 
virtual int command (int commandId, int param)=0
 

Static Public Member Functions

static void validate ()
 

Public Attributes

AdlibChannel _channels [9]
 
AdlibChannel_activeChannelPtr
 
AdlibChannelData _channelData [11]
 
Common::Array< AdlibSample_samples
 
AdlibSample_samplePtr
 
Common::Queue< RegisterValue_queue
 
int _frameCounter
 
bool _isDisabled
 
int _v1
 
int _v2
 
int _activeChannelNumber
 
int _freqMask1
 
int _freqMask2
 
int _freqBase1
 
int _freqBase2
 
int _channelNum1
 
int _channelNum2
 
int _v7
 
int _v8
 
int _v9
 
int _v10
 
int _pollResult
 
int _resultFlag
 
byte _nullData [2]
 
int _ports [256]
 
bool _stateFlag
 
int _activeChannelReg
 
int _v11
 
bool _amDep
 
bool _vibDep
 
bool _splitPoint
 

Protected Member Functions

virtual void channelCommand (byte *&pSrc, bool &updateFlag)=0
 
byte * loadData (int offset, int size)
 
int getDataOffset (byte *ptr) const
 
void loadSample (int sampleIndex)
 
void write (int reg, int val)
 
int write2 (int state, int reg, int val)
 
void flush ()
 
void channelOn (int reg, int volume)
 
void channelOff (int reg)
 
void resultCheck ()
 
void playSound (int offset, int size)
 
void playSoundData (byte *pData, int startingChannel=5)
 
bool isSoundActive (byte *pData)
 
void setFrequency (int channel, int freq)
 
int getRandomNumber ()
 
byte * getDataPtr (int nearPtr)
 
virtual int command0 ()
 
int command1 ()
 
int command2 ()
 
int command3 ()
 
int command4 ()
 
int command5 ()
 
int command6 ()
 
int command7 ()
 
int command8 ()
 
int nullCommand ()
 
- Protected Member Functions inherited from MADS::SoundDriver
Common::MemoryReadStream getDataStream (int offset) const
 

Protected Attributes

int _chanCommandCount
 
int _commandParam
 
- Protected Attributes inherited from MADS::SoundDriver
Audio::Mixer_mixer
 
OPL::OPL_opl
 
Common::Array< byte > _soundData
 
Common::Mutex _driverMutex
 

Detailed Description

Base class for the sound player resource files

Constructor & Destructor Documentation

◆ ASound()

MADS::Nebular::ASound::ASound ( Audio::Mixer mixer,
OPL::OPL opl,
const Common::Path filename,
int  dataOffset,
int  dataSize 
)

Constructor

Parameters
mixerMixer
oplOPL
filenameSpecifies the adlib sound player file to use
dataOffsetOffset in the file of the data segment
dataSizeSize of the data segment

◆ ~ASound()

MADS::Nebular::ASound::~ASound ( )
inlineoverride

Destructor

Member Function Documentation

◆ loadData()

byte* MADS::Nebular::ASound::loadData ( int  offset,
int  size 
)
protected

Returns data for the specified offset. It also caches the data size for that offset, for any future references that need it.

◆ loadSample()

void MADS::Nebular::ASound::loadSample ( int  sampleIndex)
protected

Loads up the specified sample

◆ write()

void MADS::Nebular::ASound::write ( int  reg,
int  val 
)
protected

Queue a byte for an Adlib register

◆ write2()

int MADS::Nebular::ASound::write2 ( int  state,
int  reg,
int  val 
)
protected

Queue a byte for an Adlib register, and store it in the _ports array

◆ flush()

void MADS::Nebular::ASound::flush ( )
protected

Flush any pending Adlib register values to the OPL driver

◆ channelOn()

void MADS::Nebular::ASound::channelOn ( int  reg,
int  volume 
)
protected

Turn a channel on

◆ channelOff()

void MADS::Nebular::ASound::channelOff ( int  reg)
protected

Turn a channel off

◆ resultCheck()

void MADS::Nebular::ASound::resultCheck ( )
protected

Checks for whether a poll result needs to be set

◆ playSound()

void MADS::Nebular::ASound::playSound ( int  offset,
int  size 
)
protected

Play the specified sound

Parameters
offsetOffset of sound data within sound player data segment
sizeSize of sound data block

◆ playSoundData()

void MADS::Nebular::ASound::playSoundData ( byte *  pData,
int  startingChannel = 5 
)
protected

Play the specified raw sound data

Parameters
pDataPointer to data block containing sound data
startingChannelChannel to start scan from

◆ isSoundActive()

bool MADS::Nebular::ASound::isSoundActive ( byte *  pData)
protected

Checks to see whether the given block of data is already loaded into a channel.

◆ setFrequency()

void MADS::Nebular::ASound::setFrequency ( int  channel,
int  freq 
)
protected

Sets the frequency for a given channel.

◆ getRandomNumber()

int MADS::Nebular::ASound::getRandomNumber ( )
protected

Returns a 16-bit random number

◆ getDataPtr()

byte* MADS::Nebular::ASound::getDataPtr ( int  nearPtr)
protected

Converts a 16-bit near pointer (data-segment offset) to a C++ byte pointer by searching the data cache for the matching block.

◆ validate()

static void MADS::Nebular::ASound::validate ( )
static

Validates the Adlib sound files

◆ getCachedData()

CachedDataEntry& MADS::Nebular::ASound::getCachedData ( byte *  pData)

Return the cached data block record for previously loaded sound data

◆ stop()

int MADS::Nebular::ASound::stop ( )
overridevirtual

Stop all currently playing sounds

Implements MADS::SoundDriver.

◆ poll()

int MADS::Nebular::ASound::poll ( )
overridevirtual

Main poll method to allow sounds to progress

Implements MADS::SoundDriver.

◆ noise()

void MADS::Nebular::ASound::noise ( )
overridevirtual

General noise/note output

Implements MADS::SoundDriver.

◆ getFrameCounter()

int MADS::Nebular::ASound::getFrameCounter ( )
inline

Return the current frame counter

◆ setVolume()

void MADS::Nebular::ASound::setVolume ( int  volume)
overridevirtual

Set the volume

Implements MADS::SoundDriver.


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