Predefined key class for sf::SoundBuffer resources. More...
Static Public Member Functions | |
static SoundBufferKey | FromFile (const std::string &fileName, const std::string &tag="") |
Load sf::SoundBuffer from file name. | |
static SoundBufferKey | FromMemory (const void *data, std::size_t size, const std::string &tag="") |
Load sf::SoundBuffer from file in memory. | |
static SoundBufferKey | FromSamples (const sf::Int16 *samples, std::size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate, const std::string &tag="") |
Load sf::SoundBuffer from array of audio samples in memory. | |
Public Member Functions | |
MovedPtr< sf::SoundBuffer > | Load () const |
Loads the sound buffer as specified by the static functions. | |
void | Swap (SoundBufferKey &other) |
Exchanges the contents of *this with other. | |
Related Functions | |
bool | thor::Resources::operator< (const SoundBufferKey &lhs, const SoundBufferKey &rhs) |
Comparison operator for strict weak ordering. | |
void | thor::Resources::swap (SoundBufferKey &lhs, SoundBufferKey &rhs) |
Swaps two sf::SoundBuffer resource keys. |
Predefined key class for sf::SoundBuffer resources.
You can use this class to specifiy the access and loading of sf::SoundBuffer resources in a ResourceManager.
static SoundBufferKey thor::Resources::SoundBufferKey::FromFile | ( | const std::string & | fileName, |
const std::string & | tag = "" |
||
) | [static] |
Load sf::SoundBuffer from file name.
fileName | The name of the file from which you want to load the sf::SoundBuffer. |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
static SoundBufferKey thor::Resources::SoundBufferKey::FromMemory | ( | const void * | data, |
std::size_t | size, | ||
const std::string & | tag = "" |
||
) | [static] |
Load sf::SoundBuffer from file in memory.
data | Pointer to the file data in memory. |
size | Size of the data to load, in bytes. |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
static SoundBufferKey thor::Resources::SoundBufferKey::FromSamples | ( | const sf::Int16 * | samples, |
std::size_t | samplesCount, | ||
unsigned int | channelsCount, | ||
unsigned int | sampleRate, | ||
const std::string & | tag = "" |
||
) | [static] |
Load sf::SoundBuffer from array of audio samples in memory.
samples | Pointer to the samples array |
samplesCount | Number of samples in the array |
channelsCount | Number of channels (1 = mono, 2 = stereo, ...) |
sampleRate | Sample rate (number of samples to play per second) |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
MovedPtr<sf::SoundBuffer> thor::Resources::SoundBufferKey::Load | ( | ) | const |
Loads the sound buffer as specified by the static functions.
This function is mainly provided for ResourceManager, you don't need to call it directly.