summaryrefslogtreecommitdiff
authoreilers <eilers>2004-08-29 12:38:28 (UTC)
committer eilers <eilers>2004-08-29 12:38:28 (UTC)
commit496157cb35b8f90e73770fc43c9a63534baebf33 (patch) (side-by-side diff)
tree2322a2e34278cc9649b4522cd2c1cd4398a56a01
parent2bc77ab7c6dd7310f95e70d46f4bfc55a84f32cf (diff)
downloadopie-496157cb35b8f90e73770fc43c9a63534baebf33.zip
opie-496157cb35b8f90e73770fc43c9a63534baebf33.tar.gz
opie-496157cb35b8f90e73770fc43c9a63534baebf33.tar.bz2
Added #ifndef QT_NO_SOUND to compile correctly if sound is disabled..
(Important for MAC)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/sound.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/sound.cpp b/library/sound.cpp
index d1e2388..42f7698 100644
--- a/library/sound.cpp
+++ b/library/sound.cpp
@@ -156,98 +156,99 @@ private:
int ms;
};
#endif
/*
* @internal
* Using sender() when the slot is called is unsafe!
*
* @param snd instance
* @param obj The QObject to be called
* @param slot connect SIGNAL(stopped()) to slot
*/
void register_qpe_sound_finished( Sound* snd, QObject* obj, const char* slot ) {
#ifndef QT_NO_SOUND
QObject::connect(snd->d, SIGNAL(stopped()), obj, slot );
#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
d = new SoundData(name);
#endif
}
/*! Destroys the sound */
Sound::~Sound()
{
#ifndef QT_NO_SOUND
delete d;
#endif
}
/*! Play the sound once */
void Sound::play()
{
#ifndef QT_NO_SOUND
d->killTimers();
d->playLoop(1);
#endif
}
/*! Play the sound, repeatedly until stop() is called */
void Sound::playLoop()
{
#ifndef QT_NO_SOUND
d->killTimers();
d->playLoop();
#endif
}
/*! Do not repeat the sound after it finishes. This will end a playLoop() */
void Sound::stop()
{
#ifndef QT_NO_SOUND
d->killTimers();
#endif
}
bool Sound::isFinished() const
{
#ifndef QT_NO_SOUND
return d->isFinished();
#else
return true;
#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
}
/*! \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
*/
-
+#ifndef QT_NO_SOUND
#include "sound.moc"
+#endif