Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Audio class that represents a music. More...
Public Member Functions | |
Music (const Music &)=delete | |
Music (Music &&)=delete | |
~Music () | |
Destructs the object and calls Destroy. More... | |
bool | Create (SoundStream *soundStream) |
Creates a music with a sound stream. More... | |
void | Destroy () |
Destroys the current music and frees resources. More... | |
void | EnableLooping (bool loop) override |
Enables the looping of the music. More... | |
UInt32 | GetDuration () const override |
Gets the duration of the music. More... | |
AudioFormat | GetFormat () const |
Gets the format of the music. More... | |
UInt32 | GetPlayingOffset () const override |
Gets the current offset in the music. More... | |
UInt64 | GetSampleCount () const |
Gets the number of samples in the music. More... | |
UInt32 | GetSampleRate () const |
Gets the rates of sample in the music. More... | |
SoundStatus | GetStatus () const override |
Gets the status of the music. More... | |
bool | IsLooping () const override |
Checks whether the music is looping. More... | |
bool | OpenFromFile (const String &filePath, const MusicParams ¶ms=MusicParams()) |
Opens the music from a file. More... | |
bool | OpenFromMemory (const void *data, std::size_t size, const MusicParams ¶ms=MusicParams()) |
Opens the music from memory. More... | |
bool | OpenFromStream (Stream &stream, const MusicParams ¶ms=MusicParams()) |
Loads the music from stream. More... | |
void | Pause () override |
Pauses the music. More... | |
void | Play () override |
Plays the music. More... | |
void | SetPlayingOffset (UInt32 offset) |
Changes the playing offset of the music. More... | |
void | Stop () override |
Stops the music. More... | |
Music & | operator= (const Music &)=delete |
Music & | operator= (Music &&)=delete |
Public Member Functions inherited from Nz::Resource | |
Resource (const Resource &)=default | |
Resource (Resource &&) noexcept=default | |
const String & | GetFilePath () const |
Gets the file path associated with the resource. More... | |
void | SetFilePath (const String &filePath) |
Sets the file path associated with the resource. More... | |
Resource & | operator= (const Resource &)=default |
Resource & | operator= (Resource &&) noexcept=default |
Public Member Functions inherited from Nz::SoundEmitter | |
virtual | ~SoundEmitter () |
Destructs the object. | |
void | EnableSpatialization (bool spatialization) |
Enables spatialization. More... | |
float | GetAttenuation () const |
Gets the attenuation. More... | |
float | GetMinDistance () const |
Gets the minimum distance to hear. More... | |
float | GetPitch () const |
Gets the pitch. More... | |
Vector3f | GetPosition () const |
Gets the position of the emitter. More... | |
Vector3f | GetVelocity () const |
Gets the velocity of the emitter. More... | |
float | GetVolume () const |
Gets the volume of the emitter. More... | |
bool | IsSpatialized () const |
Checks whether the sound emitter has spatialization enabled. More... | |
void | SetAttenuation (float attenuation) |
Sets the attenuation. More... | |
void | SetMinDistance (float minDistance) |
Sets the minimum distance to hear. More... | |
void | SetPitch (float pitch) |
Sets the pitch. More... | |
void | SetPosition (const Vector3f &position) |
Sets the position of the emitter. More... | |
void | SetPosition (float x, float y, float z) |
Sets the position of the emitter. More... | |
void | SetVelocity (const Vector3f &velocity) |
Sets the velocity of the emitter. More... | |
void | SetVelocity (float velX, float velY, float velZ) |
Sets the velocity of the emitter. More... | |
void | SetVolume (float volume) |
Sets the volume of the emitter. More... | |
SoundEmitter & | operator= (const SoundEmitter &)=delete |
SoundEmitter & | operator= (SoundEmitter &&)=delete |
TODO. | |
Additional Inherited Members | |
Protected Member Functions inherited from Nz::SoundEmitter | |
SoundEmitter () | |
Constructs a SoundEmitter object. | |
SoundEmitter (const SoundEmitter &emitter) | |
Constructs a SoundEmitter object which is a copy of another. More... | |
SoundEmitter (SoundEmitter &&)=delete | |
SoundStatus | GetInternalStatus () const |
Gets the status of the sound emitter. More... | |
Protected Attributes inherited from Nz::SoundEmitter | |
unsigned int | m_source |
Nz::Music::~Music | ( | ) |
Destructs the object and calls Destroy.
bool Nz::Music::Create | ( | SoundStream * | soundStream | ) |
Creates a music with a sound stream.
soundStream | Sound stream which is the source for the music |
void Nz::Music::Destroy | ( | ) |
Destroys the current music and frees resources.
|
overridevirtual |
Enables the looping of the music.
loop | Should music loop |
Implements Nz::SoundEmitter.
|
overridevirtual |
Gets the duration of the music.
Implements Nz::SoundEmitter.
AudioFormat Nz::Music::GetFormat | ( | ) | const |
Gets the format of the music.
|
overridevirtual |
Gets the current offset in the music.
Implements Nz::SoundEmitter.
UInt64 Nz::Music::GetSampleCount | ( | ) | const |
Gets the number of samples in the music.
UInt32 Nz::Music::GetSampleRate | ( | ) | const |
Gets the rates of sample in the music.
|
overridevirtual |
Gets the status of the music.
Implements Nz::SoundEmitter.
|
overridevirtual |
Checks whether the music is looping.
Implements Nz::SoundEmitter.
bool Nz::Music::OpenFromFile | ( | const String & | filePath, |
const MusicParams & | params = MusicParams() |
||
) |
Opens the music from a file.
filePath | Path to the file |
params | Parameters for the music |
bool Nz::Music::OpenFromMemory | ( | const void * | data, |
std::size_t | size, | ||
const MusicParams & | params = MusicParams() |
||
) |
Opens the music from memory.
data | Raw memory |
size | Size of the memory |
params | Parameters for the music |
bool Nz::Music::OpenFromStream | ( | Stream & | stream, |
const MusicParams & | params = MusicParams() |
||
) |
Loads the music from stream.
stream | Stream to the music |
params | Parameters for the music |
|
overridevirtual |
Pauses the music.
Implements Nz::SoundEmitter.
|
overridevirtual |
Plays the music.
Plays/Resume the music. If the music is currently playing, resets the playing offset to the beginning offset. If the music is currently paused, resumes the playing. If the music is currently stopped, starts the playing at the previously set playing offset.
Implements Nz::SoundEmitter.
void Nz::Music::SetPlayingOffset | ( | UInt32 | offset | ) |
Changes the playing offset of the music.
If the music is not playing, this sets the playing offset for the next Play call
offset | The offset in milliseconds |
|
overridevirtual |