Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

Kyra::SoundMidiPC Class Reference

#include <sound.h>

Inheritance diagram for Kyra::SoundMidiPC:

MidiDriver Kyra::Sound

List of all members.


Detailed Description

MIDI output device.

This device supports both MT-32 MIDI, as used in Kyrandia 1 and 2, and GM MIDI, as used in Kyrandia 2.

Currently it does not initialize the MT-32 output properly, so MT-32 output does sound a bit odd in some cases.

TODO: this code needs some serious cleanup and rework to support MT-32 and GM properly.

Definition at line 292 of file sound.h.


Public Types

enum  { MERR_CANNOT_CONNECT = 1, MERR_DEVICE_NOT_AVAILABLE = 3, MERR_ALREADY_OPEN = 4 }
enum  { PROP_OLD_ADLIB = 2, PROP_CHANNEL_MASK = 3 }

Public Member Functions

MidiChannel * allocateChannel ()
virtual void assignData (kMusicDataID id)
void beginFadeOut ()
void close ()
void enableMusic (int enable)
void enableSFX (bool enable)
uint32 getBaseTempo (void)
MidiChannel * getPercussionChannel ()
int getVolume ()
void haltTrack ()
void hasNativeMT32 (bool nativeMT32)
bool init ()
bool isMT32 ()
void loadSoundFile (uint file)
void metaEvent (byte type, byte *data, uint16 length)
int musicEnabled () const
int open ()
void playSoundEffect (uint8 track)
void playTrack (uint8 track)
virtual void process ()
virtual uint32 property (int prop, uint32 param)
void send (byte status, byte firstOp, byte secondOp)
void send (uint32 b)
void setPassThrough (bool b)
virtual void setPitchBendRange (byte channel, uint range)
virtual void setSoundFileList (const char *const *list, uint s)
virtual void setTimerCallback (void *timer_param, Common::TimerManager::TimerProc timer_proc)=0
void setTimerCallback (void *timerParam, void(*timerProc)(void *))
void setVolume (int volume)
bool sfxEnabled () const
 SoundMidiPC (KyraEngine *vm, Audio::Mixer *mixer, MidiDriver *driver)
virtual void sysEx (const byte *msg, uint16 length)
virtual void sysEx_customInstrument (byte channel, uint32 type, const byte *instr)
bool voiceIsPlaying ()
virtual void voicePlay (const char *file)
void voiceStop ()

Static Public Member Functions

static MidiDrivercreateMidi (int midiDriver)
static int detectMusicDriver (int flags)
static const
MidiDriverDescription
findMusicDriver (const Common::String &str)
static const
MidiDriverDescription
getAvailableMidiDrivers ()
static const char * getErrorName (int error_code)
static int parseMusicDriver (const Common::String &str)

Static Public Attributes

static const byte _gmToMt32 [128]
static const byte _mt32ToGm [128]

Protected Member Functions

const char * soundFilename (uint file)

Protected Attributes

int _currentTheme
Audio::Mixer_mixer
int _musicEnabled
bool _sfxEnabled
KyraEngine * _vm

Private Member Functions

void loadSoundEffectFile (uint8 *data, uint32 size)
void loadSoundEffectFile (uint file)
void playMusic (uint8 *data, uint32 size)
void stopMusic ()
void stopSoundEffect ()

Static Private Member Functions

static void onTimer (void *data)

Private Attributes

MidiChannel * _channel [32]
uint8 _channelVolume [16]
MidiDriver_driver
bool _eventFromMusic
bool _fadeMusicOut
uint32 _fadeStartTime
bool _isPlaying
Common::Mutex _mutex
bool _nativeMT32
MidiParser_parser
byte * _parserSource
bool _passThrough
bool _sfxIsPlaying
MidiParser_soundEffect
byte * _soundEffectSource
bool _useC55
int _virChannel [16]
uint8 _volume

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

Generated by  Doxygen 1.6.0   Back to index