some more tools
This commit is contained in:
parent
f87ee668fc
commit
25a987f9c8
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<n; ++i, ++j);
|
||||
return (*i).first;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ private:
|
|||
AudioSound* ns_load_sound(Filename filename);
|
||||
void ns_release_sound(AudioSound* sound);
|
||||
void ns_release_all_sounds(void);
|
||||
string ns_get_nth_sound_name(int) const;
|
||||
|
||||
static AudioPool* get_ptr(void);
|
||||
|
||||
|
|
@ -37,6 +38,8 @@ PUBLISHED:
|
|||
INLINE static AudioSound* load_sound(const string& filename);
|
||||
INLINE static void release_sound(AudioSound* sound);
|
||||
INLINE static void release_all_sounds(void);
|
||||
INLINE static int get_num_loaded_sounds(void);
|
||||
INLINE static string get_nth_sound_name(int);
|
||||
static void register_sound_loader(const string&, SoundLoadFunc*);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue