20 #include <QMediaPlayer> 65 static void playSound(
const string& filename);
85 GSound(
const string& filename);
99 static QMediaPlayer* _qmediaPlayer;
101 static void initialize();
static long getDuration()
Returns the duration of the sound clip that is currently playing.
Definition: gsound.cpp:26
static void stop()
Stops playing the sound, if it is playing.
Definition: gsound.cpp:64
static void pause()
Pauses playing the sound, if it is playing.
Definition: gsound.cpp:46
static void setVolume(int volume)
Sets the overall audio volume from 0 (silence) to 100 (full volume).
Definition: gsound.cpp:69
virtual ~GSound()
Frees the memory associated with the sound.
Definition: gsound.cpp:80
This class encapsulates a sound file.
Definition: gsound.h:41
static void playSound(string filename)
Starts playing the sound if not playing, or unpauses if paused.
Definition: gsound.cpp:51
static int getVolume()
Returns the overall audio volume from 0 (silence) to 100 (full volume).
Definition: gsound.cpp:31
GSound(string filename)
Creates a Sound object by reading in the contents of the specified file or URL.
Definition: gsound.cpp:75
void play()
Starts playing the sound.
Definition: gsound.cpp:84