mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
add exclusive mode
This commit is contained in:
parent
d9f964c51c
commit
dd2b927420
@ -41,6 +41,7 @@ register_AudioManager_creator(Create_AudioManager_proc* proc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Factory method for getting a platform specific AudioManager:
|
// Factory method for getting a platform specific AudioManager:
|
||||||
PT(AudioManager) AudioManager::
|
PT(AudioManager) AudioManager::
|
||||||
create_AudioManager() {
|
create_AudioManager() {
|
||||||
@ -78,7 +79,13 @@ create_AudioManager() {
|
|||||||
if (!am->is_valid()) {
|
if (!am->is_valid()) {
|
||||||
am = create_NullAudioManger();
|
am = create_NullAudioManger();
|
||||||
}
|
}
|
||||||
|
am->_bExclusive = false;
|
||||||
return am;
|
return am;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AudioManager::
|
||||||
|
set_mutually_exclusive(bool bExclusive) {
|
||||||
|
_bExclusive = bExclusive;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,11 +36,8 @@ PUBLISHED:
|
|||||||
// my_sound = MySoundEffects.get_sound("neatSfx.mp3");
|
// my_sound = MySoundEffects.get_sound("neatSfx.mp3");
|
||||||
// my_music = MyMusicManager.get_sound("introTheme.mid");
|
// my_music = MyMusicManager.get_sound("introTheme.mid");
|
||||||
|
|
||||||
// bOneAtATime: if true, turn off any currently-playing sounds before playing
|
static PT(AudioManager) create_AudioManager();
|
||||||
// a new one (useful for midi songs)
|
|
||||||
static PT(AudioManager) create_AudioManager(/*bool bOneAtATime*/);
|
|
||||||
virtual ~AudioManager() {}
|
virtual ~AudioManager() {}
|
||||||
|
|
||||||
virtual bool is_valid() = 0;
|
virtual bool is_valid() = 0;
|
||||||
|
|
||||||
// Get a sound:
|
// Get a sound:
|
||||||
@ -56,6 +53,10 @@ static PT(AudioManager) create_AudioManager(/*bool bOneAtATime*/);
|
|||||||
virtual void set_cache_limit(int count) = 0;
|
virtual void set_cache_limit(int count) = 0;
|
||||||
virtual int get_cache_limit() = 0;
|
virtual int get_cache_limit() = 0;
|
||||||
|
|
||||||
|
// if set, turn off any currently-playing sounds before playing
|
||||||
|
// a new one (useful for midi songs)
|
||||||
|
void set_mutually_exclusive(bool bExclusive);
|
||||||
|
|
||||||
// Control volume:
|
// Control volume:
|
||||||
// FYI:
|
// FYI:
|
||||||
// If you start a sound with the volume off and turn the volume
|
// If you start a sound with the volume off and turn the volume
|
||||||
@ -81,6 +82,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
static Create_AudioManager_proc* _create_AudioManager;
|
static Create_AudioManager_proc* _create_AudioManager;
|
||||||
|
bool _bExclusive;
|
||||||
|
|
||||||
AudioManager() {
|
AudioManager() {
|
||||||
// intentionally blank.
|
// intentionally blank.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user