Fragment of audio data.
More...
#include <SDL2pp/Chunk.hh>
|
| Chunk (Mix_Chunk *chunk) |
| Construct from existing Mix_Chunk structure.
|
|
| Chunk (const std::string &file) |
| Load file for use as a sample.
|
|
| Chunk (RWops &rwops) |
| Load sample using RWops.
|
|
| ~Chunk () |
| Destructor.
|
|
| Chunk (Chunk &&other) noexcept |
| Move constructor.
|
|
Chunk & | operator= (Chunk &&other) noexcept |
| Move assignment operator.
|
|
| Chunk (const Chunk &other)=delete |
| Deleted copy constructor.
|
|
Chunk & | operator= (const Chunk &other)=delete |
| Deleted assignment operator.
|
|
Mix_Chunk * | Get () const |
| Get pointer to managed Mix_Chunk structure.
|
|
int | SetVolume (int volume) |
| Set volume of a chunk.
|
|
int | GetVolume () const |
| Get volume of a chunk.
|
|
◆ Chunk() [1/5]
SDL2pp::Chunk::Chunk |
( |
Mix_Chunk * |
chunk | ) |
|
|
explicit |
Construct from existing Mix_Chunk structure.
- Parameters
-
[in] | chunk | Existing Mix_Chunk to manage |
◆ Chunk() [2/5]
SDL2pp::Chunk::Chunk |
( |
const std::string & |
file | ) |
|
|
explicit |
◆ Chunk() [3/5]
SDL2pp::Chunk::Chunk |
( |
RWops & |
rwops | ) |
|
|
explicit |
◆ ~Chunk()
SDL2pp::Chunk::~Chunk |
( |
| ) |
|
Destructor.
- See also
- https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC24
- Note
- Despite what Mix_FreeChunk() documentation (and even comment in function implementation) says, right after the named comment there's a code which stops playback of any channel which plays the chunk being freed. Thus, it is safe to destroy Chunk before destroying Mixer, even if it still plays the chunk.
◆ Chunk() [4/5]
SDL2pp::Chunk::Chunk |
( |
Chunk && |
other | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
◆ Chunk() [5/5]
SDL2pp::Chunk::Chunk |
( |
const Chunk & |
other | ) |
|
|
delete |
Deleted copy constructor.
This class is not copyable
◆ Get()
Mix_Chunk * SDL2pp::Chunk::Get |
( |
| ) |
const |
Get pointer to managed Mix_Chunk structure.
- Returns
- Pointer to managed Mix_Chunk structure
◆ GetVolume()
int SDL2pp::Chunk::GetVolume |
( |
| ) |
const |
◆ operator=() [1/2]
Chunk & SDL2pp::Chunk::operator= |
( |
Chunk && |
other | ) |
|
|
noexcept |
Move assignment operator.
- Parameters
-
- Returns
- Reference to self
◆ operator=() [2/2]
Chunk & SDL2pp::Chunk::operator= |
( |
const Chunk & |
other | ) |
|
|
delete |
Deleted assignment operator.
This class is not copyable
◆ SetVolume()
int SDL2pp::Chunk::SetVolume |
( |
int |
volume | ) |
|
The documentation for this class was generated from the following files: