ScummVM API documentation
Gob::MUSPlayer Class Reference

#include <musplayer.h>

Inheritance diagram for Gob::MUSPlayer:
Gob::AdLib

Public Member Functions

bool loadSND (Common::SeekableReadStream &snd)
 
bool loadMUS (Common::SeekableReadStream &mus)
 
void unload ()
 
uint32 getSongID () const
 
const Common::StringgetSongName () const
 
- Public Member Functions inherited from Gob::AdLib
 AdLib (int callbackFrequency)
 
bool isPlaying () const
 Are we currently playing?
 
int32 getRepeating () const
 Return number of times left to loop.
 
void setRepeating (int32 repCount)
 
void startPlay ()
 
void stopPlay ()
 
void syncVolume ()
 

Protected Member Functions

uint32 pollMusic (bool first) override
 
void rewind () override
 
- Protected Member Functions inherited from Gob::AdLib
void writeOPL (byte reg, byte val)
 
void end (bool killRepeat=false)
 
bool isPercussionMode () const
 
void setPercussionMode (bool percussion)
 
void enableWaveSelect (bool enable)
 
void setPitchRange (uint8 range)
 
void setTremoloDepth (bool tremoloDepth)
 
void setVibratoDepth (bool vibratoDepth)
 
void setKeySplit (bool keySplit)
 
void setVoiceTimbre (uint8 voice, const uint16 *params)
 
void setVoiceVolume (uint8 voice, uint8 volume)
 
void bendVoicePitch (uint8 voice, uint16 pitchBend)
 
void noteOn (uint8 voice, uint8 note)
 
void noteOff (uint8 voice)
 
void setTimerFrequency (int timerFrequency)
 

Additional Inherited Members

- Protected Types inherited from Gob::AdLib
enum  kVoice {
  kVoiceMelody0 = 0, kVoiceMelody1 = 1, kVoiceMelody2 = 2, kVoiceMelody3 = 3,
  kVoiceMelody4 = 4, kVoiceMelody5 = 5, kVoiceMelody6 = 6, kVoiceMelody7 = 7,
  kVoiceMelody8 = 8, kVoiceBaseDrum = 6, kVoiceSnareDrum = 7, kVoiceTom = 8,
  kVoiceCymbal = 9, kVoiceHihat = 10
}
 
enum  kParam {
  kParamKeyScaleLevel = 0, kParamFreqMulti = 1, kParamFeedback = 2, kParamAttack = 3,
  kParamSustain = 4, kParamSustaining = 5, kParamDecay = 6, kParamRelease = 7,
  kParamLevel = 8, kParamAM = 9, kParamVib = 10, kParamKeyScaleRate = 11,
  kParamFM = 12, kParamWaveSelect = 13
}
 
- Static Protected Attributes inherited from Gob::AdLib
static const int kOperatorCount = 18
 Number of operators.
 
static const int kParamCount = 14
 Number of operator parameters.
 
static const int kPitchStepCount = 25
 Number of pitch bend steps in a half tone.
 
static const int kOctaveCount = 8
 Number of octaves we can play.
 
static const int kHalfToneCount = 12
 Number of half tones in an octave.
 
static const int kOperatorsPerVoice = 2
 Number of operators per voice.
 
static const int kMelodyVoiceCount = 9
 Number of melody voices.
 
static const int kPercussionVoiceCount = 5
 Number of percussion voices.
 
static const int kMaxVoiceCount = 11
 Max number of voices.
 
static const int kNoteCount = kHalfToneCount * kOctaveCount
 
static const int kMaxVolume = 0x007F
 
static const int kMaxPitch = 0x3FFF
 
static const int kMidPitch = 0x2000
 
static const int kStandardMidC = 60
 A mid C in standard MIDI.
 
static const int kOPLMidC = 48
 A mid C for the OPL.
 

Detailed Description

A player for the AdLib MUS format, with the instrument information in SND files.

In the Gob engine, those files are usually named .MDY and .TBR instead.

Member Function Documentation

◆ loadSND()

bool Gob::MUSPlayer::loadSND ( Common::SeekableReadStream snd)

Load the instruments (.SND or .TBR)

◆ loadMUS()

bool Gob::MUSPlayer::loadMUS ( Common::SeekableReadStream mus)

Load the melody (.MUS or .MDY)

◆ pollMusic()

uint32 Gob::MUSPlayer::pollMusic ( bool  first)
overrideprotectedvirtual

The callback function that's called for polling more AdLib commands.

Parameters
firstIs this the first poll since the start of the song?
Returns
The number of ticks until the next poll.

Implements Gob::AdLib.

◆ rewind()

void Gob::MUSPlayer::rewind ( )
overrideprotectedvirtual

Rewind the song.

Implements Gob::AdLib.


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