mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -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:
|
||||
PT(AudioManager) AudioManager::
|
||||
create_AudioManager() {
|
||||
@ -78,7 +79,13 @@ create_AudioManager() {
|
||||
if (!am->is_valid()) {
|
||||
am = create_NullAudioManger();
|
||||
}
|
||||
am->_bExclusive = false;
|
||||
return am;
|
||||
}
|
||||
|
||||
void AudioManager::
|
||||
set_mutually_exclusive(bool bExclusive) {
|
||||
_bExclusive = bExclusive;
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,11 +36,8 @@ PUBLISHED:
|
||||
// my_sound = MySoundEffects.get_sound("neatSfx.mp3");
|
||||
// my_music = MyMusicManager.get_sound("introTheme.mid");
|
||||
|
||||
// bOneAtATime: if true, turn off any currently-playing sounds before playing
|
||||
// a new one (useful for midi songs)
|
||||
static PT(AudioManager) create_AudioManager(/*bool bOneAtATime*/);
|
||||
static PT(AudioManager) create_AudioManager();
|
||||
virtual ~AudioManager() {}
|
||||
|
||||
virtual bool is_valid() = 0;
|
||||
|
||||
// Get a sound:
|
||||
@ -56,6 +53,10 @@ static PT(AudioManager) create_AudioManager(/*bool bOneAtATime*/);
|
||||
virtual void set_cache_limit(int count) = 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:
|
||||
// FYI:
|
||||
// If you start a sound with the volume off and turn the volume
|
||||
@ -81,6 +82,7 @@ public:
|
||||
|
||||
protected:
|
||||
static Create_AudioManager_proc* _create_AudioManager;
|
||||
bool _bExclusive;
|
||||
|
||||
AudioManager() {
|
||||
// intentionally blank.
|
||||
|
Loading…
x
Reference in New Issue
Block a user