diff --git a/panda/src/audio/audio_pool.I b/panda/src/audio/audio_pool.I index bdebf89869..ba00cf557e 100644 --- a/panda/src/audio/audio_pool.I +++ b/panda/src/audio/audio_pool.I @@ -78,3 +78,22 @@ INLINE void AudioPool::release_all_sounds(void) { // in the universe and it constructs itself. //////////////////////////////////////////////////////////////////// INLINE AudioPool::AudioPool(void) {} + +//////////////////////////////////////////////////////////////////// +// Function: AudioPool::get_num_loaded_sounds +// Access: Public, static +// Description: return the number of sounds the audiopool thinks +// are loaded at the moment +//////////////////////////////////////////////////////////////////// +INLINE int AudioPool::get_num_loaded_sounds(void) { + return get_ptr()->_sounds.size(); +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioPool::get_nth_sound_name +// Access: Public, static +// Description: return the name of the nth loaded sound +//////////////////////////////////////////////////////////////////// +INLINE string AudioPool::get_nth_sound_name(int n) { + return get_ptr()->ns_get_nth_sound_name(n); +} diff --git a/panda/src/audio/audio_pool.cxx b/panda/src/audio/audio_pool.cxx index 35308db82e..c6b90fc4e4 100644 --- a/panda/src/audio/audio_pool.cxx +++ b/panda/src/audio/audio_pool.cxx @@ -151,3 +151,15 @@ void AudioPool::register_sound_loader(const string& ext, } (*_sound_loaders)[ext] = func; } + +//////////////////////////////////////////////////////////////////// +// Function: AudioPool::ns_get_nth_sound_name +// Access: Public +// Description: return the name of the nth loaded sound +//////////////////////////////////////////////////////////////////// +string AudioPool::ns_get_nth_sound_name(int n) const { + SoundMap::const_iterator i; + int j; + for (i=_sounds.begin(), j=0; j