Bomberman
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
RAY::Audio::Sound Class Reference

A manager for sound stream. More...

#include <Sound.hpp>

Inheritance diagram for RAY::Audio::Sound:
Collaboration diagram for RAY::Audio::Sound:

Public Member Functions

 Sound (const std::string &path, bool lonely=false)
 Load Sound stream from file. More...
 
 ~Sound ()=default
 Default destructor. More...
 
 Sound (const Sound &sound)=default
 A copy constructor constructor. More...
 
Soundoperator= (const Sound &sound)=default
 A Sound is assignable. More...
 
bool isPlaying (void) override
 Check if Sound is playing. More...
 
Soundplay (void) override
 Start Sound. More...
 
Soundstop (void) override
 Stop Sound playing. More...
 
Soundpause (void) override
 Pause Sound playing. More...
 
Soundresume (void) override
 Resume playing paused Sound. More...
 
SoundsetVolume (float volume) override
 Set volume for Sound (1.0 is max level) More...
 
SoundsetPitch (float pitch) override
 
- Public Member Functions inherited from RAY::Audio::IAudio
virtual ~IAudio ()=default
 

Private Attributes

std::shared_ptr<::Sound_sound
 

Static Private Attributes

static RAY::Cache<::Sound_soundsCache
 

Detailed Description

A manager for sound stream.

Constructor & Destructor Documentation

◆ Sound() [1/2]

RAY::Audio::Sound::Sound ( const std::string &  path,
bool  lonely = false 
)

Load Sound stream from file.

Parameters
lonelyshould be set to true if the entity's loaded data must be independant from others

◆ ~Sound()

RAY::Audio::Sound::~Sound ( )
default

Default destructor.

◆ Sound() [2/2]

RAY::Audio::Sound::Sound ( const Sound sound)
default

A copy constructor constructor.

Member Function Documentation

◆ isPlaying()

bool RAY::Audio::Sound::isPlaying ( void  )
overridevirtual

Check if Sound is playing.

Implements RAY::Audio::IAudio.

◆ operator=()

Sound& RAY::Audio::Sound::operator= ( const Sound sound)
default

A Sound is assignable.

◆ pause()

RAY::Audio::Sound & RAY::Audio::Sound::pause ( void  )
overridevirtual

Pause Sound playing.

Implements RAY::Audio::IAudio.

◆ play()

RAY::Audio::Sound & RAY::Audio::Sound::play ( void  )
overridevirtual

Start Sound.

Implements RAY::Audio::IAudio.

◆ resume()

RAY::Audio::Sound & RAY::Audio::Sound::resume ( void  )
overridevirtual

Resume playing paused Sound.

Implements RAY::Audio::IAudio.

◆ setPitch()

RAY::Audio::Sound & RAY::Audio::Sound::setPitch ( float  pitch)
overridevirtual

Implements RAY::Audio::IAudio.

◆ setVolume()

RAY::Audio::Sound & RAY::Audio::Sound::setVolume ( float  volume)
overridevirtual

Set volume for Sound (1.0 is max level)

Implements RAY::Audio::IAudio.

◆ stop()

RAY::Audio::Sound & RAY::Audio::Sound::stop ( void  )
overridevirtual

Stop Sound playing.

Implements RAY::Audio::IAudio.

Member Data Documentation

◆ _sound

std::shared_ptr<::Sound> RAY::Audio::Sound::_sound
private

◆ _soundsCache

RAY::Cache<::Sound > RAY::Audio::Sound::_soundsCache
staticprivate

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