libSDL2pp
C++ bindings/wrapper for SDL2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL2pp::Music Class Reference

Music data More...

#include <SDL2pp/Music.hh>

Public Member Functions

 Music (Mix_Music *music)
 Construct from existing Mix_Music pointer.
 
 Music (const std::string &file)
 Load music file.
 
 Music (RWops &rwops)
 Load music using RWops.
 
 Music (RWops &rwops, Mix_MusicType type)
 Load music using RWops.
 
 ~Music ()
 Destructor.
 
 Music (Music &&other) noexcept
 Move constructor.
 
Musicoperator= (Music &&other) noexcept
 Move assignment operator.
 
 Music (const Music &other)=delete
 Deleted copy constructor.
 
Musicoperator= (const Music &other)=delete
 Deleted assignment operator.
 
Mix_Music * Get () const
 Get pointer to managed Mix_Music.
 
Mix_MusicType GetType () const
 Get the music encoding type.
 

Detailed Description

Music data

Constructor & Destructor Documentation

◆ Music() [1/6]

SDL2pp::Music::Music ( Mix_Music *  music)
explicit

Construct from existing Mix_Music pointer.

Parameters
[in]musicExisting Mix_Music to manage

◆ Music() [2/6]

SDL2pp::Music::Music ( const std::string &  file)
explicit

Load music file.

Parameters
[in]fileName of music file to use
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC55

◆ Music() [3/6]

SDL2pp::Music::Music ( RWops rwops)
explicit

Load music using RWops.

This uses undocumented SDL_Mixer function. Comment in SDL_mixer.h suggests it's only indended to work with Ogg and MikMod.

Parameters
[in]rwopsSDL2pp::RWops used to access music data
Exceptions
SDL2pp::Exception

◆ Music() [4/6]

SDL2pp::Music::Music ( RWops rwops,
Mix_MusicType  type 
)

Load music using RWops.

This uses undocumented SDL_Mixer function.

Parameters
[in]rwopsSDL2pp::RWops used to access music data
[in]typeMusic type to load
Exceptions
SDL2pp::Exception

◆ ~Music()

SDL2pp::Music::~Music ( )

◆ Music() [5/6]

SDL2pp::Music::Music ( Music &&  other)
noexcept

Move constructor.

Parameters
[in]otherSDL2pp::Music object to move data from

◆ Music() [6/6]

SDL2pp::Music::Music ( const Music other)
delete

Deleted copy constructor.

This class is not copyable

Member Function Documentation

◆ Get()

Mix_Music * SDL2pp::Music::Get ( ) const

Get pointer to managed Mix_Music.

Returns
Pointer to managed Mix_Music

◆ GetType()

Mix_MusicType SDL2pp::Music::GetType ( ) const

Get the music encoding type.

Returns
The type of music

◆ operator=() [1/2]

Music & SDL2pp::Music::operator= ( const Music other)
delete

Deleted assignment operator.

This class is not copyable

◆ operator=() [2/2]

Music & SDL2pp::Music::operator= ( Music &&  other)
noexcept

Move assignment operator.

Parameters
[in]otherSDL2pp::Music object to move data from
Returns
Reference to self

The documentation for this class was generated from the following files: