mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
several small sound changes; added more Miles sync'ing; stopped finished callback
This commit is contained in:
parent
e5a2973e65
commit
67a4e0c56d
@ -24,6 +24,10 @@
|
|||||||
|
|
||||||
#include "load_dso.h"
|
#include "load_dso.h"
|
||||||
|
|
||||||
|
|
||||||
|
TypeHandle AudioManager::_type_handle;
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
PT(AudioManager) create_NullAudioManger() {
|
PT(AudioManager) create_NullAudioManger() {
|
||||||
audio_debug("create_NullAudioManger()");
|
audio_debug("create_NullAudioManger()");
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
typedef PT(AudioManager) Create_AudioManager_proc();
|
typedef PT(AudioManager) Create_AudioManager_proc();
|
||||||
|
|
||||||
|
|
||||||
class EXPCL_PANDA AudioManager : public ReferenceCount {
|
class EXPCL_PANDA AudioManager : public TypedReferenceCount {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
// Create an AudioManager for each category of sounds you have.
|
// Create an AudioManager for each category of sounds you have.
|
||||||
// E.g.
|
// E.g.
|
||||||
@ -121,6 +121,24 @@ protected:
|
|||||||
AudioManager() {
|
AudioManager() {
|
||||||
// intentionally blank.
|
// intentionally blank.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
static TypeHandle get_class_type() {
|
||||||
|
return _type_handle;
|
||||||
|
}
|
||||||
|
static void init_type() {
|
||||||
|
TypedReferenceCount::init_type();
|
||||||
|
register_type(_type_handle, "AudioManager",
|
||||||
|
TypedReferenceCount::get_class_type());
|
||||||
|
}
|
||||||
|
virtual TypeHandle get_type() const {
|
||||||
|
return get_class_type();
|
||||||
|
}
|
||||||
|
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TypeHandle _type_handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __AUDIO_MANAGER_H__ */
|
#endif /* __AUDIO_MANAGER_H__ */
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
#define __AUDIOSOUND_H__
|
#define __AUDIOSOUND_H__
|
||||||
|
|
||||||
#include "config_audio.h"
|
#include "config_audio.h"
|
||||||
#include "referenceCount.h"
|
#include "typedReferenceCount.h"
|
||||||
#include "pointerTo.h"
|
#include "pointerTo.h"
|
||||||
|
|
||||||
|
|
||||||
class AudioManager;
|
class AudioManager;
|
||||||
|
|
||||||
class EXPCL_PANDA AudioSound : public ReferenceCount {
|
class EXPCL_PANDA AudioSound : public TypedReferenceCount {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
virtual ~AudioSound() {}
|
virtual ~AudioSound() {}
|
||||||
|
|
||||||
@ -111,10 +111,14 @@ public:
|
|||||||
return _type_handle;
|
return _type_handle;
|
||||||
}
|
}
|
||||||
static void init_type() {
|
static void init_type() {
|
||||||
ReferenceCount::init_type();
|
TypedReferenceCount::init_type();
|
||||||
register_type(_type_handle, "AudioSound",
|
register_type(_type_handle, "AudioSound",
|
||||||
ReferenceCount::get_class_type());
|
TypedReferenceCount::get_class_type());
|
||||||
}
|
}
|
||||||
|
virtual TypeHandle get_type() const {
|
||||||
|
return get_class_type();
|
||||||
|
}
|
||||||
|
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static TypeHandle _type_handle;
|
static TypeHandle _type_handle;
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "config_audio.h"
|
#include "config_audio.h"
|
||||||
#include "dconfig.h"
|
#include "dconfig.h"
|
||||||
|
#include "audioManager.h"
|
||||||
#include "audioSound.h"
|
#include "audioSound.h"
|
||||||
|
|
||||||
Configure(config_audio);
|
Configure(config_audio);
|
||||||
@ -67,6 +68,7 @@ ConfigureFn(config_audio) {
|
|||||||
audio_library_name = new string(
|
audio_library_name = new string(
|
||||||
config_audio.GetString("audio-library-name", "miles_audio"));
|
config_audio.GetString("audio-library-name", "miles_audio"));
|
||||||
|
|
||||||
|
AudioManager::init_type();
|
||||||
AudioSound::init_type();
|
AudioSound::init_type();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,9 @@ init_libMilesAudio() {
|
|||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
AudioManager::register_AudioManager_creator(Create_AudioManager);
|
AudioManager::register_AudioManager_creator(Create_AudioManager);
|
||||||
|
|
||||||
|
MilesAudioManager::init_type();
|
||||||
|
MilesAudioSound::init_type();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //]
|
#endif //]
|
||||||
|
@ -30,6 +30,9 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
|
TypeHandle MilesAudioManager::_type_handle;
|
||||||
|
|
||||||
int MilesAudioManager::_active_managers = 0;
|
int MilesAudioManager::_active_managers = 0;
|
||||||
HDLSFILEID MilesAudioManager::_dls_field = NULL;
|
HDLSFILEID MilesAudioManager::_dls_field = NULL;
|
||||||
|
|
||||||
@ -84,7 +87,10 @@ void CustomMilesShutdown() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioManager::MilesAudioManager
|
// Function: MilesAudioManager::MilesAudioManager
|
||||||
// Access: Public
|
// Access: Public
|
||||||
// Description:
|
// Description: Create an audio manager. This may open the Miles
|
||||||
|
// sound system if there were no other MilesAudioManager
|
||||||
|
// instances. Subsequent managers may use the same
|
||||||
|
// Miles resources.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
MilesAudioManager::
|
MilesAudioManager::
|
||||||
MilesAudioManager() {
|
MilesAudioManager() {
|
||||||
@ -165,6 +171,7 @@ MilesAudioManager() {
|
|||||||
// either way.
|
// either way.
|
||||||
++_active_managers;
|
++_active_managers;
|
||||||
audio_debug(" _active_managers="<<_active_managers);
|
audio_debug(" _active_managers="<<_active_managers);
|
||||||
|
nassertv(_active_managers>0);
|
||||||
|
|
||||||
if (_is_valid) {
|
if (_is_valid) {
|
||||||
assert(is_valid());
|
assert(is_valid());
|
||||||
@ -180,7 +187,10 @@ MilesAudioManager() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioManager::~MilesAudioManager
|
// Function: MilesAudioManager::~MilesAudioManager
|
||||||
// Access: Public
|
// Access: Public
|
||||||
// Description:
|
// Description: Clean up this audio manager and possibly release
|
||||||
|
// the Miles resources that are reserved by the
|
||||||
|
// application (the later happens if this is the last
|
||||||
|
// active manager).
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
MilesAudioManager::
|
MilesAudioManager::
|
||||||
~MilesAudioManager() {
|
~MilesAudioManager() {
|
||||||
@ -188,6 +198,7 @@ MilesAudioManager::
|
|||||||
// Be sure to delete associated sounds before deleting the manager:
|
// Be sure to delete associated sounds before deleting the manager:
|
||||||
nassertv(_sounds_on_loan.empty());
|
nassertv(_sounds_on_loan.empty());
|
||||||
clear_cache();
|
clear_cache();
|
||||||
|
nassertv(_active_managers>0);
|
||||||
--_active_managers;
|
--_active_managers;
|
||||||
audio_debug(" _active_managers="<<_active_managers);
|
audio_debug(" _active_managers="<<_active_managers);
|
||||||
if (_active_managers==0) {
|
if (_active_managers==0) {
|
||||||
@ -209,20 +220,22 @@ MilesAudioManager::
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioManager::is_valid
|
// Function: MilesAudioManager::is_valid
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description: This is mostly for debugging, but it it could be
|
||||||
|
// used to detect errors in a release build if you
|
||||||
|
// don't mind the cpu cost.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool MilesAudioManager::
|
bool MilesAudioManager::
|
||||||
is_valid() {
|
is_valid() {
|
||||||
bool check=true;
|
bool check=true;
|
||||||
if (_sounds.size() != _lru.size()) {
|
if (_sounds.size() != _lru.size()) {
|
||||||
audio_debug("--sizes--");
|
audio_debug("-- Error _sounds.size() != _lru.size() --");
|
||||||
check=false;
|
check=false;
|
||||||
} else {
|
} else {
|
||||||
LRU::const_iterator i=_lru.begin();
|
LRU::const_iterator i=_lru.begin();
|
||||||
for (; i != _lru.end(); ++i) {
|
for (; i != _lru.end(); ++i) {
|
||||||
SoundMap::const_iterator smi=_sounds.find(**i);
|
SoundMap::const_iterator smi=_sounds.find(**i);
|
||||||
if (smi == _sounds.end()) {
|
if (smi == _sounds.end()) {
|
||||||
audio_debug("--"<<**i<<"--");
|
audio_debug("-- "<<**i<<" in _lru and not in _sounds --");
|
||||||
check=false;
|
check=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -559,14 +572,14 @@ starting_sound(MilesAudioSound* audio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioManager::stoping_sound
|
// Function: MilesAudioManager::stopping_sound
|
||||||
// Access:
|
// Access:
|
||||||
// Description: Inform the manager that a sound is finished or
|
// Description: Inform the manager that a sound is finished or
|
||||||
// someone called stop on the sound (this should not
|
// someone called stop on the sound (this should not
|
||||||
// be called if a sound is only paused).
|
// be called if a sound is only paused).
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void MilesAudioManager::
|
void MilesAudioManager::
|
||||||
stoping_sound(MilesAudioSound* audio) {
|
stopping_sound(MilesAudioSound* audio) {
|
||||||
_sounds_playing.erase(audio);
|
_sounds_playing.erase(audio);
|
||||||
if (_hasMidiSounds && _sounds_playing.size() == 0) {
|
if (_hasMidiSounds && _sounds_playing.size() == 0) {
|
||||||
force_midi_reset();
|
force_midi_reset();
|
||||||
|
@ -98,7 +98,7 @@ private:
|
|||||||
void uncache_a_sound();
|
void uncache_a_sound();
|
||||||
|
|
||||||
void starting_sound(MilesAudioSound* audio);
|
void starting_sound(MilesAudioSound* audio);
|
||||||
void stoping_sound(MilesAudioSound* audio);
|
void stopping_sound(MilesAudioSound* audio);
|
||||||
|
|
||||||
// utility function that should be moved to another class:
|
// utility function that should be moved to another class:
|
||||||
bool get_registry_entry(HKEY base,
|
bool get_registry_entry(HKEY base,
|
||||||
@ -118,6 +118,24 @@ private:
|
|||||||
static void AILCALLBACK vfs_close_callback(U32 file_handle);
|
static void AILCALLBACK vfs_close_callback(U32 file_handle);
|
||||||
|
|
||||||
friend class MilesAudioSound;
|
friend class MilesAudioSound;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
static TypeHandle get_class_type() {
|
||||||
|
return _type_handle;
|
||||||
|
}
|
||||||
|
static void init_type() {
|
||||||
|
AudioManager::init_type();
|
||||||
|
register_type(_type_handle, "MilesAudioManager",
|
||||||
|
AudioManager::get_class_type());
|
||||||
|
}
|
||||||
|
virtual TypeHandle get_type() const {
|
||||||
|
return get_class_type();
|
||||||
|
}
|
||||||
|
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TypeHandle _type_handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
EXPCL_MILES_AUDIO PT(AudioManager) Create_AudioManager();
|
EXPCL_MILES_AUDIO PT(AudioManager) Create_AudioManager();
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
#include "milesAudioSound.h"
|
#include "milesAudioSound.h"
|
||||||
#include "milesAudioManager.h"
|
#include "milesAudioManager.h"
|
||||||
|
|
||||||
|
|
||||||
|
TypeHandle MilesAudioSound::_type_handle;
|
||||||
|
|
||||||
|
|
||||||
#define NEED_MILES_LENGTH_WORKAROUND
|
#define NEED_MILES_LENGTH_WORKAROUND
|
||||||
|
|
||||||
#if (((MSS_MAJOR_VERSION == 6) && (MSS_MINOR_VERSION >= 5)) || (MSS_MAJOR_VERSION >= 7))
|
#if (((MSS_MAJOR_VERSION == 6) && (MSS_MINOR_VERSION >= 5)) || (MSS_MAJOR_VERSION >= 7))
|
||||||
@ -73,6 +77,7 @@ namespace {
|
|||||||
void AILCALLBACK
|
void AILCALLBACK
|
||||||
pandaAudioAilCallback_Sequence(HSEQUENCE S) {
|
pandaAudioAilCallback_Sequence(HSEQUENCE S) {
|
||||||
assert(S);
|
assert(S);
|
||||||
|
AutoAilLock milesLock;
|
||||||
audio_debug("pandaAudioAilCallback_Sequence(HSEQUENCE="<<((void*)S)<<")");
|
audio_debug("pandaAudioAilCallback_Sequence(HSEQUENCE="<<((void*)S)<<")");
|
||||||
MilesAudioSound* sound = (MilesAudioSound*)AIL_sequence_user_data(
|
MilesAudioSound* sound = (MilesAudioSound*)AIL_sequence_user_data(
|
||||||
S, user_data_index);
|
S, user_data_index);
|
||||||
@ -92,6 +97,7 @@ namespace {
|
|||||||
void AILCALLBACK
|
void AILCALLBACK
|
||||||
pandaAudioAilCallback_Sample(HSAMPLE S) {
|
pandaAudioAilCallback_Sample(HSAMPLE S) {
|
||||||
assert(S);
|
assert(S);
|
||||||
|
AutoAilLock milesLock;
|
||||||
audio_debug("pandaAudioAilCallback_Sample(HSAMPLE="<<((void*)S)<<")");
|
audio_debug("pandaAudioAilCallback_Sample(HSAMPLE="<<((void*)S)<<")");
|
||||||
MilesAudioSound* sound = (MilesAudioSound*)AIL_sample_user_data(
|
MilesAudioSound* sound = (MilesAudioSound*)AIL_sample_user_data(
|
||||||
S, user_data_index);
|
S, user_data_index);
|
||||||
@ -118,7 +124,7 @@ namespace {
|
|||||||
if (!audio || !sound) {
|
if (!audio || !sound) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AIL_lock();
|
AutoAilLock milesLock;
|
||||||
if (audio->handle != NULL) {
|
if (audio->handle != NULL) {
|
||||||
switch (audio->type) {
|
switch (audio->type) {
|
||||||
case AIL_QUICK_XMIDI_TYPE:
|
case AIL_QUICK_XMIDI_TYPE:
|
||||||
@ -143,13 +149,12 @@ namespace {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AIL_unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::MilesAudioSound
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -169,7 +174,7 @@ MilesAudioSound(MilesAudioManager* manager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::~MilesAudioSound
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -182,7 +187,7 @@ MilesAudioSound::
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::play
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -202,7 +207,7 @@ play() {
|
|||||||
_manager->starting_sound(this);
|
_manager->starting_sound(this);
|
||||||
// Start playing:
|
// Start playing:
|
||||||
if (AIL_quick_play(_audio, _loop_count)) {
|
if (AIL_quick_play(_audio, _loop_count)) {
|
||||||
panda_AIL_quick_set_finished_callback(_audio, this);
|
//#*#panda_AIL_quick_set_finished_callback(_audio, this);
|
||||||
// assert(status()==PLAYING);
|
// assert(status()==PLAYING);
|
||||||
audio_debug(" started sound " << _file_name );
|
audio_debug(" started sound " << _file_name );
|
||||||
} else {
|
} else {
|
||||||
@ -216,14 +221,14 @@ play() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::stop
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void MilesAudioSound::
|
void MilesAudioSound::
|
||||||
stop() {
|
stop() {
|
||||||
miles_audio_debug("stop()");
|
miles_audio_debug("stop()");
|
||||||
_manager->stoping_sound(this);
|
_manager->stopping_sound(this);
|
||||||
// The _paused flag should not be cleared here. _paused is not like
|
// The _paused flag should not be cleared here. _paused is not like
|
||||||
// the Pause button on a cd/dvd player. It is used as a flag to say
|
// the Pause button on a cd/dvd player. It is used as a flag to say
|
||||||
// that it was looping when it was set inactive. There is no need to
|
// that it was looping when it was set inactive. There is no need to
|
||||||
@ -235,21 +240,21 @@ stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::finished
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void MilesAudioSound::
|
void MilesAudioSound::
|
||||||
finished() {
|
finished() {
|
||||||
miles_audio_debug("finished()");
|
miles_audio_debug("finished()");
|
||||||
_manager->stoping_sound(this);
|
_manager->stopping_sound(this);
|
||||||
if (!_finished_event.empty()) {
|
if (!_finished_event.empty()) {
|
||||||
throw_event(_finished_event);
|
throw_event(_finished_event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::set_loop
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -261,7 +266,7 @@ set_loop(bool loop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::get_loop
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -394,7 +399,7 @@ set_volume(float volume) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::get_volume
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -405,7 +410,7 @@ get_volume() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::set_balance
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -418,7 +423,7 @@ set_balance(float balance_right) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::get_balance
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -429,7 +434,7 @@ get_balance() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::length
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -476,7 +481,7 @@ length() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::set_active
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -508,7 +513,7 @@ set_active(bool active) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::get_active
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -519,7 +524,7 @@ get_active() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::set_finished_event
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -530,7 +535,7 @@ set_finished_event(const string& event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::get_finished_event
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -541,7 +546,7 @@ get_finished_event() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::get_name
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -552,7 +557,7 @@ get_name() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MilesAudioSound::
|
// Function: MilesAudioSound::status
|
||||||
// Access:
|
// Access:
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -27,6 +27,19 @@
|
|||||||
#include "milesAudioManager.h"
|
#include "milesAudioManager.h"
|
||||||
#include "mss.h"
|
#include "mss.h"
|
||||||
|
|
||||||
|
class AutoAilLock {
|
||||||
|
// This will lock and unlock the Miles AIL timer based
|
||||||
|
// on the current code block. (Auto in the class name
|
||||||
|
// is referring to "auto variable").
|
||||||
|
public:
|
||||||
|
AutoAilLock() {
|
||||||
|
AIL_lock();
|
||||||
|
}
|
||||||
|
~AutoAilLock() {
|
||||||
|
AIL_unlock();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class EXPCL_MILES_AUDIO MilesAudioSound : public AudioSound {
|
class EXPCL_MILES_AUDIO MilesAudioSound : public AudioSound {
|
||||||
public:
|
public:
|
||||||
~MilesAudioSound();
|
~MilesAudioSound();
|
||||||
@ -129,6 +142,24 @@ private:
|
|||||||
HAUDIO audio, string file_name, float length=0.0f);
|
HAUDIO audio, string file_name, float length=0.0f);
|
||||||
|
|
||||||
friend class MilesAudioManager;
|
friend class MilesAudioManager;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
static TypeHandle get_class_type() {
|
||||||
|
return _type_handle;
|
||||||
|
}
|
||||||
|
static void init_type() {
|
||||||
|
AudioSound::init_type();
|
||||||
|
register_type(_type_handle, "MilesAudioSound",
|
||||||
|
AudioSound::get_class_type());
|
||||||
|
}
|
||||||
|
virtual TypeHandle get_type() const {
|
||||||
|
return get_class_type();
|
||||||
|
}
|
||||||
|
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TypeHandle _type_handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "milesAudioSound.I"
|
#include "milesAudioSound.I"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user