GameKit  0.0.1a
C++ gamedev tools
Public Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
gk::Sound Class Reference

#include <Sound.hpp>

Public Member Functions

 Sound ()=default
 
 Sound (const std::string &filename)
 
void openFromFile (const std::string &filename)
 
void play ()
 
void repeat (u16 delay)
 
void setChannel (int channel)
 
void setVolume (int volume)
 

Private Types

using Mix_ChunkPtr = std::unique_ptr< Mix_Chunk, decltype(&Mix_FreeChunk)>
 

Private Attributes

Mix_ChunkPtr m_sfx {nullptr, Mix_FreeChunk}
 
gk::Timer m_timer
 
int m_channel = -1
 
int m_volume = MIX_MAX_VOLUME
 

Static Private Attributes

static int s_lastUsedChannel = -1
 

Detailed Description

Definition at line 25 of file Sound.hpp.

Member Typedef Documentation

§ Mix_ChunkPtr

using gk::Sound::Mix_ChunkPtr = std::unique_ptr<Mix_Chunk, decltype(&Mix_FreeChunk)>
private

Definition at line 42 of file Sound.hpp.

Constructor & Destructor Documentation

§ Sound() [1/2]

gk::Sound::Sound ( )
default

§ Sound() [2/2]

gk::Sound::Sound ( const std::string &  filename)

Definition at line 21 of file Sound.cpp.

Member Function Documentation

§ openFromFile()

void gk::Sound::openFromFile ( const std::string &  filename)

Definition at line 25 of file Sound.cpp.

§ play()

void gk::Sound::play ( )

Definition at line 36 of file Sound.cpp.

§ repeat()

void gk::Sound::repeat ( u16  delay)

Definition at line 41 of file Sound.cpp.

§ setChannel()

void gk::Sound::setChannel ( int  channel)
inline

Definition at line 36 of file Sound.hpp.

§ setVolume()

void gk::Sound::setVolume ( int  volume)
inline

Definition at line 37 of file Sound.hpp.

Member Data Documentation

§ m_channel

int gk::Sound::m_channel = -1
private

Definition at line 48 of file Sound.hpp.

§ m_sfx

Mix_ChunkPtr gk::Sound::m_sfx {nullptr, Mix_FreeChunk}
private

Definition at line 44 of file Sound.hpp.

§ m_timer

gk::Timer gk::Sound::m_timer
private

Definition at line 46 of file Sound.hpp.

§ m_volume

int gk::Sound::m_volume = MIX_MAX_VOLUME
private

Definition at line 49 of file Sound.hpp.

§ s_lastUsedChannel

int gk::Sound::s_lastUsedChannel = -1
staticprivate

Definition at line 40 of file Sound.hpp.


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