#include <soundclipmanager.h>


Public Member Functions | |
| SoundClipManager () | |
| virtual | ~SoundClipManager () |
| virtual SoundClipPtr | create (IResourceLoader *loader=0) |
| virtual SoundClipPtr | create (const std::string &name, IResourceLoader *loader=0) |
| virtual SoundClipPtr | load (const std::string &name, IResourceLoader *loader=0) |
| virtual SoundClipPtr | add (SoundClip *res) |
| virtual bool | exists (const std::string &name) |
| virtual bool | exists (ResourceHandle handle) |
| virtual void | reload (const std::string &name) |
| virtual void | reload (ResourceHandle handle) |
| virtual void | reloadAll () |
| virtual void | loadUnreferenced () |
| virtual void | free (const std::string &name) |
| virtual void | free (ResourceHandle handle) |
| virtual void | freeAll () |
| virtual void | freeUnreferenced () |
| virtual void | remove (SoundClipPtr &resource) |
| virtual void | remove (const std::string &name) |
| virtual void | remove (ResourceHandle handle) |
| virtual void | removeAll () |
| virtual void | removeUnreferenced () |
| virtual SoundClipPtr | get (const std::string &name) |
| virtual SoundClipPtr | get (ResourceHandle handle) |
| virtual ResourceHandle | getResourceHandle (const std::string &name) |
An interface for managing images.
Definition at line 54 of file soundclipmanager.h.
| FIFE::SoundClipManager::SoundClipManager | ( | ) | [inline] |
Default constructor.
Definition at line 59 of file soundclipmanager.h.
| FIFE::SoundClipManager::~SoundClipManager | ( | ) | [virtual] |
Destructor.
Definition at line 39 of file soundclipmanager.cpp.
| SoundClipPtr FIFE::SoundClipManager::add | ( | SoundClip * | res | ) | [virtual] |
Add an Image to the manager
This function will create a SoundClipPtr and add the SoundClip to the manager. The manager assumes ownership of the SoundClip so DO NOT delete it.
| res | A pointer to the SoundClip |
Definition at line 126 of file soundclipmanager.cpp.
References exists().
Referenced by create().

| SoundClipPtr FIFE::SoundClipManager::create | ( | IResourceLoader * | loader = 0 |
) | [virtual] |
Creates a blank SoundClip but does not load it immediately
| loader | A pointer to the custom resource loader. The default is NULL. If this parameter is present the resource will use the loader to load instead of the default built in functions. |
Definition at line 88 of file soundclipmanager.cpp.
References add().
Referenced by load().

| SoundClipPtr FIFE::SoundClipManager::create | ( | const std::string & | name, | |
| IResourceLoader * | loader = 0 | |||
| ) | [virtual] |
Creates a blank SoundClip but does not load it immediately
| name | The resource name. Typically a filename. | |
| loader | A pointer to the custom resource loader. The default is NULL. If this parameter is present the resource will use the loader to load instead of the default built in functions. |
Definition at line 93 of file soundclipmanager.cpp.
| bool FIFE::SoundClipManager::exists | ( | const std::string & | name | ) | [virtual] |
Checks to see if a SoundClip exists
This function will search the manager for SoundClips that match the parameter
| name | The name of the SoundClip |
Definition at line 145 of file soundclipmanager.cpp.
Referenced by add(), and create().

| bool FIFE::SoundClipManager::exists | ( | ResourceHandle | handle | ) | [virtual] |
Checks to see if an SoundClip exists
This function will search the manager for SoundClips that match the parameter
| handle | The handle of the SoundClip |
Definition at line 154 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::free | ( | ResourceHandle | handle | ) | [virtual] |
Frees a SoundClip from memory
The SoundClip is not deleted but it's data is freed. This calls the SoundClip::free() function and it is up to the resource to properly free it's memory. The manager keeps a reference to the SoundClip in case its required in the future.
| handle | The handle of the SoundClip |
Definition at line 231 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::free | ( | const std::string & | name | ) | [virtual] |
Frees a SoundClip from memory
The SoundClip is not deleted but it's data is freed. This calls the SoundClip::free() function and it is up to the resource to properly free it's memory. The manager keeps a reference to the SoundClip in case its required in the future.
| name | The name of the SoundClip |
Definition at line 218 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::freeAll | ( | ) | [virtual] |
Frees all SoundClips
This calls the SoundClip::free() function for every Image the manager is managing. It does not remove them from the manager.
Definition at line 243 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::freeUnreferenced | ( | ) | [virtual] |
Frees all unreferenced SoundClip
This calls the SoundClip::free() function for SoundClips that have no external references to them. It does not remove them from the manager.
Definition at line 259 of file soundclipmanager.cpp.
| SoundClipPtr FIFE::SoundClipManager::get | ( | const std::string & | name | ) | [virtual] |
Gets a shared pointer to the SoundClip
If the SoundClip is not defined it will attempt to create and load the SoundClip based on the name (it assumes the name is a filename)
| name | The name of the SoundClip |
Definition at line 363 of file soundclipmanager.cpp.
References load().
| SoundClipPtr FIFE::SoundClipManager::get | ( | ResourceHandle | handle | ) | [virtual] |
Gets a shared pointer to the SoundClip
If the resource is not defined it returns an empty (or invalid) SoundClipPtr and makes an entry in the log.
| handle | The handle of the resource |
Definition at line 379 of file soundclipmanager.cpp.
| ResourceHandle FIFE::SoundClipManager::getResourceHandle | ( | const std::string & | name | ) | [virtual] |
Gets a SoundClip handle by name
Returns the SoundClip handle associated with the name
| name | The name of the SoundClip |
Definition at line 394 of file soundclipmanager.cpp.
| SoundClipPtr FIFE::SoundClipManager::load | ( | const std::string & | name, | |
| IResourceLoader * | loader = 0 | |||
| ) | [virtual] |
Creates a blank resource and loads it from disk
This function will create the SoundClip if necessary and load the clip from disk. If the SoundClip is not defined it will call SoundClipManager::create() before loading.
| name | The resource name. Typically a filename. | |
| loader | A pointer to the custom resource loader. The default is NULL. If this parameter is present the resource will use the loader to load instead of the default built in functions. |
Definition at line 103 of file soundclipmanager.cpp.
References create().
Referenced by get().

| void FIFE::SoundClipManager::loadUnreferenced | ( | ) | [virtual] |
Loads all unreferenced SoundClips
All SoundClips that have no external references will be loaded into memory.
Definition at line 204 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::reload | ( | ResourceHandle | handle | ) | [virtual] |
Reloads a resource
This function will reload a SoundClip if it is managed by the manager. If not it creates an entry in the log specifying that the SoundClip could not be found. It will load the SoundClip if it is not already loaded.
| handle | The handle of the resource |
Definition at line 177 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::reload | ( | const std::string & | name | ) | [virtual] |
Reloads a SoundClip
This function will reload a SoundClip if it is managed by the manager. If not it creates an entry in the log specifying that the SoundClip could not be found. It will load the SoundClip if it is not already loaded.
| name | The name of the resource |
Definition at line 163 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::reloadAll | ( | ) | [virtual] |
Reloads all SoundClips
This function will reload all SoundClips managed by the manager. It will load a SoundClip if it is not already loaded.
Definition at line 192 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::remove | ( | ResourceHandle | handle | ) | [virtual] |
Removes a SoundClip from the manager
This removes all references to the SoundClip from the manager. It does not however guarantee that the resource's destructor is called. If the client has any left over references to the resource it will not be freed.
| handle | The handle of the SoundClip |
Definition at line 313 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::remove | ( | const std::string & | name | ) | [virtual] |
Removes an SoundClip from the manager
This removes all references to the SoundClip from the manager. It does not however guarantee that the resource's destructor is called. If the client has any left over references to the resource it will not be freed.
| name | The name of the SoundClip |
Definition at line 291 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::remove | ( | SoundClipPtr & | resource | ) | [virtual] |
Removes a SoundClip from the manager
This removes all references to the SoundClip from the manager. It does not however guarantee that the resource's destructor is called. If the client has any left over references to the resource it will not be freed.
| resource | A SoundClipPtr to the image to be removed from the manager |
Definition at line 274 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::removeAll | ( | ) | [virtual] |
Removes all SoundClips from the manager
This effectively removes all references to all SoundClips from the manager. If there are left over shared pointers to any resources they will not be deleted.
Definition at line 336 of file soundclipmanager.cpp.
| void FIFE::SoundClipManager::removeUnreferenced | ( | ) | [virtual] |
Removes all unreferenced SoundClips
This effectively removes all SoundClips that dont have an external reference. The resources will be deleted.
Definition at line 348 of file soundclipmanager.cpp.
1.7.1