summaryrefslogtreecommitdiff
path: root/library/sound.cpp
authoreilers <eilers>2003-08-08 14:45:49 (UTC)
committer eilers <eilers>2003-08-08 14:45:49 (UTC)
commit14d394e6c107b037a09a31a92605034fe50f7813 (patch) (side-by-side diff)
tree800699cf4dc9681c3eb023340634dd6a15fd04c8 /library/sound.cpp
parentdbc6ea35f5535a1f69deb7ebbafc0f721721dbf2 (diff)
downloadopie-14d394e6c107b037a09a31a92605034fe50f7813.zip
opie-14d394e6c107b037a09a31a92605034fe50f7813.tar.gz
opie-14d394e6c107b037a09a31a92605034fe50f7813.tar.bz2
Merged branches from BRANCH_1_0
Diffstat (limited to 'library/sound.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/sound.cpp31
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
@@ -106,7 +106,7 @@ public:
QSound ( Resource::findSound ( name )),
filename ( Resource::findSound ( name ))
{
- loopsleft=0;
+ loopsleft=0;
ms = WAVsoundDuration(filename);
}
@@ -128,10 +128,10 @@ public:
loopsleft = 0;
return;
}
- }
+ }
play();
}
-
+
bool isFinished ( ) const
{
return ( loopsleft == 0 );
@@ -145,6 +145,9 @@ private:
#endif
+/*! Opens a wave sound file \a name for playing
+ * Resource is used for finding the file
+ **/
Sound::Sound(const QString& name)
{
#ifndef QT_NO_SOUND
@@ -152,6 +155,7 @@ Sound::Sound(const QString& name)
#endif
}
+/*! Destroys the sound */
Sound::~Sound()
{
#ifndef QT_NO_SOUND
@@ -159,6 +163,7 @@ Sound::~Sound()
#endif
}
+/*! Play the sound once */
void Sound::play()
{
#ifndef QT_NO_SOUND
@@ -166,6 +171,7 @@ void Sound::play()
#endif
}
+/*! Play the sound, repeatedly until stop() is called */
void Sound::playLoop()
{
#ifndef QT_NO_SOUND
@@ -174,6 +180,7 @@ void Sound::playLoop()
#endif
}
+/*! Do not repeat the sound after it finishes. This will end a playLoop() */
void Sound::stop()
{
#ifndef QT_NO_SOUND
@@ -190,9 +197,25 @@ bool Sound::isFinished() const
#endif
}
+/*! 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()
{
#ifndef QT_NO_COP
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
+*/