MusicProcess Class Reference

#include <MusicProcess.h>

Inheritance diagram for MusicProcess:

Process List of all members.

Public Member Functions

 MusicProcess ()
 MusicProcess (MidiDriver *)
virtual ~MusicProcess ()
 ENABLE_RUNTIME_CLASSTYPE ()
void playMusic (int track)
void playCombatMusic (int track)
void queueMusic (int track)
void unqueueMusic ()
void restoreMusic ()
 INTRINSIC (I_playMusic)
 INTRINSIC (I_musicStop)
int getTrack () const
virtual bool run (const uint32 framenum)
bool loadData (IDataSource *ids, uint32 version)

Static Public Member Functions

static MusicProcessget_instance ()
static void ConCmd_playMusic (const Console::ArgvType &argv)

Private Types

 MUSIC_NORMAL = 1
 MUSIC_TRANSITION = 2
 MUSIC_PLAY_WANTED = 3
enum  MusicStates { MUSIC_NORMAL = 1, MUSIC_TRANSITION = 2, MUSIC_PLAY_WANTED = 3 }

Private Member Functions

virtual void saveData (ODataSource *ods)
void playMusic_internal (int track)

Private Attributes

MidiDriverdriver
int state
int current_track
int wanted_track
int song_branches [128]
int last_request
int queued_track

Static Private Attributes

static MusicProcessthe_music_process = 0

Detailed Description

Definition at line 28 of file MusicProcess.h.


Member Enumeration Documentation

enum MusicProcess::MusicStates [private]

Enumerator:
MUSIC_NORMAL 
MUSIC_TRANSITION 
MUSIC_PLAY_WANTED 

Definition at line 79 of file MusicProcess.h.


Constructor & Destructor Documentation

MusicProcess::MusicProcess (  ) 

Definition at line 40 of file MusicProcess.cpp.

References song_branches.

MusicProcess::MusicProcess ( MidiDriver  ) 

Definition at line 46 of file MusicProcess.cpp.

References Process::flags, Process::PROC_RUNPAUSED, song_branches, the_music_process, and Process::type.

MusicProcess::~MusicProcess (  )  [virtual]

Definition at line 57 of file MusicProcess.cpp.

References the_music_process.


Member Function Documentation

void MusicProcess::ConCmd_playMusic ( const Console::ArgvType argv  )  [static]

Definition at line 311 of file MusicProcess.cpp.

References playMusic_internal(), pout, and the_music_process.

Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().

MusicProcess::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Process.

static MusicProcess* MusicProcess::get_instance (  )  [inline, static]

Get the current instance of the Music Processes.

Definition at line 39 of file MusicProcess.h.

References the_music_process.

Referenced by MainActor::clearInCombat(), MenuGump::Close(), CreditsGump::Close(), Actor::die(), AvatarMoverProcess::handleCombatMode(), MenuGump::MenuGump(), U8Game::playCredits(), U8Game::playQuotes(), SKFPlayer::run(), AvatarDeathProcess::run(), MainActor::setInCombat(), SKFPlayer::start(), and SKFPlayer::stop().

int MusicProcess::getTrack (  )  const [inline]

Get the number of the current or wanted track.

Definition at line 52 of file MusicProcess.h.

References wanted_track.

Referenced by MenuGump::MenuGump().

MusicProcess::INTRINSIC ( I_musicStop   ) 

MusicProcess::INTRINSIC ( I_playMusic   ) 

bool MusicProcess::loadData ( IDataSource ids,
uint32  version 
)

load Process data

Reimplemented from Process.

Definition at line 272 of file MusicProcess.cpp.

References driver, Pentagram::AudioMixer::get_instance(), last_request, Process::loadData(), MUSIC_PLAY_WANTED, queued_track, state, the_music_process, and wanted_track.

void MusicProcess::playCombatMusic ( int  track  ) 

Definition at line 84 of file MusicProcess.cpp.

References playMusic_internal().

Referenced by Actor::die(), AvatarMoverProcess::handleCombatMode(), AvatarDeathProcess::run(), and MainActor::setInCombat().

void MusicProcess::playMusic ( int  track  ) 

Definition at line 62 of file MusicProcess.cpp.

References Actor::ACT_COMBATRUN, ObjectManager::get_instance(), Actor::getActorFlags(), getMainActor(), Actor::isInCombat(), last_request, playMusic_internal(), and queued_track.

Referenced by MenuGump::Close(), CreditsGump::Close(), U8Game::playCredits(), U8Game::playQuotes(), SKFPlayer::run(), SKFPlayer::start(), and SKFPlayer::stop().

void MusicProcess::playMusic_internal ( int  track  )  [private]

Play a music track

Parameters:
track The track number to play. Pass 0 to stop music

Definition at line 109 of file MusicProcess.cpp.

References current_track, driver, MidiDriver::finishSequence(), GameData::get_instance(), XMidiFile::GetEventList(), GameData::getMusic(), MidiDriver::getSequenceCallbackData(), MusicFlex::getSongInfo(), MusicFlex::getXMidi(), MidiDriver::isFMSynth(), MidiDriver::isSequencePlaying(), MUSIC_NORMAL, MUSIC_PLAY_WANTED, MUSIC_TRANSITION, MusicFlex::SongInfo::num_measures, MidiDriver::setSequenceSpeed(), song_branches, MidiDriver::startSequence(), state, MusicFlex::SongInfo::transitions, and wanted_track.

Referenced by ConCmd_playMusic(), playCombatMusic(), playMusic(), and restoreMusic().

void MusicProcess::queueMusic ( int  track  ) 

Definition at line 89 of file MusicProcess.cpp.

References queued_track, and wanted_track.

Referenced by Actor::die().

void MusicProcess::restoreMusic (  ) 

Definition at line 101 of file MusicProcess.cpp.

References last_request, playMusic_internal(), and queued_track.

Referenced by MainActor::clearInCombat().

bool MusicProcess::run ( const uint32  framenum  )  [virtual]

Implements Process.

Definition at line 190 of file MusicProcess.cpp.

References current_track, driver, XMidiEventList::findBranchEvent(), MidiDriver::finishSequence(), GameData::get_instance(), XMidiFile::GetEventList(), GameData::getMusic(), MusicFlex::getXMidi(), MidiDriver::isFMSynth(), MidiDriver::isSequencePlaying(), MUSIC_NORMAL, MUSIC_PLAY_WANTED, MUSIC_TRANSITION, MidiDriver::pauseSequence(), queued_track, song_branches, MidiDriver::startSequence(), state, and wanted_track.

void MusicProcess::saveData ( ODataSource ods  )  [private, virtual]

save the Process data

Reimplemented from Process.

Definition at line 263 of file MusicProcess.cpp.

References last_request, queued_track, Process::saveData(), wanted_track, and ODataSource::write4().

void MusicProcess::unqueueMusic (  ) 

Definition at line 96 of file MusicProcess.cpp.

References queued_track.

Referenced by AvatarDeathProcess::run().


Member Data Documentation

int MusicProcess::current_track [private]

Definition at line 72 of file MusicProcess.h.

Referenced by playMusic_internal(), and run().

MidiDriver* MusicProcess::driver [private]

Definition at line 70 of file MusicProcess.h.

Referenced by loadData(), playMusic_internal(), and run().

int MusicProcess::last_request [private]

Definition at line 76 of file MusicProcess.h.

Referenced by loadData(), playMusic(), restoreMusic(), and saveData().

int MusicProcess::queued_track [private]

Definition at line 77 of file MusicProcess.h.

Referenced by loadData(), playMusic(), queueMusic(), restoreMusic(), run(), saveData(), and unqueueMusic().

int MusicProcess::song_branches[128] [private]

Definition at line 74 of file MusicProcess.h.

Referenced by MusicProcess(), playMusic_internal(), and run().

int MusicProcess::state [private]

Definition at line 71 of file MusicProcess.h.

Referenced by loadData(), playMusic_internal(), and run().

MusicProcess * MusicProcess::the_music_process = 0 [static, private]

Definition at line 68 of file MusicProcess.h.

Referenced by ConCmd_playMusic(), get_instance(), loadData(), MusicProcess(), and ~MusicProcess().

int MusicProcess::wanted_track [private]

Definition at line 73 of file MusicProcess.h.

Referenced by getTrack(), loadData(), playMusic_internal(), queueMusic(), run(), and saveData().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:40 2007 for pentagram by  doxygen 1.4.7