-rw-r--r-- | library/sound.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/library/sound.cpp b/library/sound.cpp index 1ff3b3f..c8704f9 100644 --- a/library/sound.cpp +++ b/library/sound.cpp @@ -108,3 +108,3 @@ public: { - loopsleft=0; + loopsleft=0; ms = WAVsoundDuration(filename); @@ -130,6 +130,6 @@ public: } - } + } play(); } - + bool isFinished ( ) const @@ -147,2 +147,5 @@ private: +/*! Opens a wave sound file \a name for playing + * Resource is used for finding the file + **/ Sound::Sound(const QString& name) @@ -154,2 +157,3 @@ Sound::Sound(const QString& name) +/*! Destroys the sound */ Sound::~Sound() @@ -161,2 +165,3 @@ Sound::~Sound() +/*! Play the sound once */ void Sound::play() @@ -168,2 +173,3 @@ void Sound::play() +/*! Play the sound, repeatedly until stop() is called */ void Sound::playLoop() @@ -176,2 +182,3 @@ void Sound::playLoop() +/*! Do not repeat the sound after it finishes. This will end a playLoop() */ void Sound::stop() @@ -192,2 +199,5 @@ bool Sound::isFinished() const +/*! Sounds the audible system alarm. This is used for applications such + as Calendar when it needs to alarm the user of an event. +*/ void Sound::soundAlarm() @@ -196,3 +206,16 @@ void Sound::soundAlarm() QCopEnvelope( "QPE/TaskBar", "soundAlarm()" ); -#endif +#endif } + + +/*! \class Sound + \brief The Sound class plays WAVE sound files and can invoke the audible alarm. + + The Sound class is constructed with the .wav music file name. The Sound + class retrieves the sound file from the shared Resource class. This class + ties together QSound and the available sound resources. + + To sound an audible system alarm, call the static method soundAlarm() + + \ingroup qtopiaemb +*/ |