Raylib C++  1.0.0
Encapsulates the raylib library
Public Member Functions | List of all members
raylib::audio::RlMusic Class Reference

Encapulation of the raylib Music. More...

#include <RlMusic.hpp>

Inheritance diagram for raylib::audio::RlMusic:
Inheritance graph
Collaboration diagram for raylib::audio::RlMusic:
Collaboration graph

Public Member Functions

 RlMusic (const std::string &fileName)
 Construct a new RlMusic object from a file. More...
 
 RlMusic (const std::string &fileType, unsigned char *data, const int &dataSize)
 Construct a new RlMusic object from data. More...
 
 ~RlMusic ()
 Destroy the RlMusic object. More...
 
void play ()
 Play the music stream. More...
 
bool isPlaying ()
 Check if the music stream is playing. More...
 
void update ()
 Updates buffers for music streaming. More...
 
void stop ()
 Stop the music stream playing. More...
 
void pause ()
 Pause the music stream playing. More...
 
void resume ()
 Resume the music stream playing. More...
 
void seek (const float &position)
 Seek the music stream to a position in seconds (set the current playing position) More...
 
void setVolume (const float &volume)
 Set the volume of the music stream (1.0 is max level) More...
 
const float & getVolume () const
 Get the volume of the music stream. More...
 
void setPitch (const float &pitch)
 Set pitch for a music (1.0 is base level) More...
 
float getTimeLength ()
 Get music time length (in seconds) More...
 
float getTimePlayed ()
 Get current music time played (in seconds) More...
 
const bool & isLooping () const
 Check if the music stream is looping. More...
 
void setLooping (const bool &loop)
 Set if the music stream is looped. More...
 

Detailed Description

Encapulation of the raylib Music.

Constructor & Destructor Documentation

◆ RlMusic() [1/2]

raylib::audio::RlMusic::RlMusic ( const std::string &  fileName)
explicit

Construct a new RlMusic object from a file.

Parameters
fileNamethe file name

◆ RlMusic() [2/2]

raylib::audio::RlMusic::RlMusic ( const std::string &  fileType,
unsigned char *  data,
const int &  dataSize 
)
explicit

Construct a new RlMusic object from data.

Parameters
fileTypethe file type
datathe data
dataSizethe data size

◆ ~RlMusic()

raylib::audio::RlMusic::~RlMusic ( )

Destroy the RlMusic object.

Member Function Documentation

◆ getTimeLength()

float raylib::audio::RlMusic::getTimeLength ( )

Get music time length (in seconds)

Returns
the time length

◆ getTimePlayed()

float raylib::audio::RlMusic::getTimePlayed ( )

Get current music time played (in seconds)

Returns
the time played

◆ getVolume()

const float & raylib::audio::RlMusic::getVolume ( ) const

Get the volume of the music stream.

Returns
the volume

◆ isLooping()

const bool & raylib::audio::RlMusic::isLooping ( ) const

Check if the music stream is looping.

Returns
true if the music stream is looping

◆ isPlaying()

bool raylib::audio::RlMusic::isPlaying ( )

Check if the music stream is playing.

Returns
true if the music stream is playing

◆ pause()

void raylib::audio::RlMusic::pause ( )

Pause the music stream playing.

◆ play()

void raylib::audio::RlMusic::play ( )

Play the music stream.

Here is the caller graph for this function:

◆ resume()

void raylib::audio::RlMusic::resume ( )

Resume the music stream playing.

◆ seek()

void raylib::audio::RlMusic::seek ( const float &  position)

Seek the music stream to a position in seconds (set the current playing position)

Parameters
positionthe position

◆ setLooping()

void raylib::audio::RlMusic::setLooping ( const bool &  loop)

Set if the music stream is looped.

Parameters
loopif the music stream is looped

◆ setPitch()

void raylib::audio::RlMusic::setPitch ( const float &  pitch)

Set pitch for a music (1.0 is base level)

Parameters
pitchthe pitch

◆ setVolume()

void raylib::audio::RlMusic::setVolume ( const float &  volume)

Set the volume of the music stream (1.0 is max level)

Parameters
volumethe volume
Here is the caller graph for this function:

◆ stop()

void raylib::audio::RlMusic::stop ( )

Stop the music stream playing.

◆ update()

void raylib::audio::RlMusic::update ( )

Updates buffers for music streaming.


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