-rw-r--r-- | library/sound.cpp | 3 |
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: | |||
156 | int ms; | 156 | int ms; |
157 | }; | 157 | }; |
158 | 158 | ||
159 | #endif | 159 | #endif |
160 | 160 | ||
161 | 161 | ||
162 | /* | 162 | /* |
163 | * @internal | 163 | * @internal |
164 | * Using sender() when the slot is called is unsafe! | 164 | * Using sender() when the slot is called is unsafe! |
165 | * | 165 | * |
166 | * @param snd instance | 166 | * @param snd instance |
167 | * @param obj The QObject to be called | 167 | * @param obj The QObject to be called |
168 | * @param slot connect SIGNAL(stopped()) to slot | 168 | * @param slot connect SIGNAL(stopped()) to slot |
169 | */ | 169 | */ |
170 | void register_qpe_sound_finished( Sound* snd, QObject* obj, const char* slot ) { | 170 | void register_qpe_sound_finished( Sound* snd, QObject* obj, const char* slot ) { |
171 | #ifndef QT_NO_SOUND | 171 | #ifndef QT_NO_SOUND |
172 | QObject::connect(snd->d, SIGNAL(stopped()), obj, slot ); | 172 | QObject::connect(snd->d, SIGNAL(stopped()), obj, slot ); |
173 | #endif | 173 | #endif |
174 | } | 174 | } |
175 | 175 | ||
176 | /*! Opens a wave sound file \a name for playing | 176 | /*! Opens a wave sound file \a name for playing |
177 | * Resource is used for finding the file | 177 | * Resource is used for finding the file |
178 | **/ | 178 | **/ |
179 | Sound::Sound(const QString& name) | 179 | Sound::Sound(const QString& name) |
180 | { | 180 | { |
181 | #ifndef QT_NO_SOUND | 181 | #ifndef QT_NO_SOUND |
182 | d = new SoundData(name); | 182 | d = new SoundData(name); |
183 | #endif | 183 | #endif |
184 | } | 184 | } |
185 | 185 | ||
186 | /*! Destroys the sound */ | 186 | /*! Destroys the sound */ |
187 | Sound::~Sound() | 187 | Sound::~Sound() |
188 | { | 188 | { |
189 | #ifndef QT_NO_SOUND | 189 | #ifndef QT_NO_SOUND |
190 | delete d; | 190 | delete d; |
191 | #endif | 191 | #endif |
192 | } | 192 | } |
193 | 193 | ||
194 | /*! Play the sound once */ | 194 | /*! Play the sound once */ |
195 | void Sound::play() | 195 | void Sound::play() |
196 | { | 196 | { |
197 | #ifndef QT_NO_SOUND | 197 | #ifndef QT_NO_SOUND |
198 | d->killTimers(); | 198 | d->killTimers(); |
199 | d->playLoop(1); | 199 | d->playLoop(1); |
200 | #endif | 200 | #endif |
201 | } | 201 | } |
202 | 202 | ||
203 | /*! Play the sound, repeatedly until stop() is called */ | 203 | /*! Play the sound, repeatedly until stop() is called */ |
204 | void Sound::playLoop() | 204 | void Sound::playLoop() |
205 | { | 205 | { |
206 | #ifndef QT_NO_SOUND | 206 | #ifndef QT_NO_SOUND |
207 | d->killTimers(); | 207 | d->killTimers(); |
208 | d->playLoop(); | 208 | d->playLoop(); |
209 | #endif | 209 | #endif |
210 | } | 210 | } |
211 | 211 | ||
212 | /*! Do not repeat the sound after it finishes. This will end a playLoop() */ | 212 | /*! Do not repeat the sound after it finishes. This will end a playLoop() */ |
213 | void Sound::stop() | 213 | void Sound::stop() |
214 | { | 214 | { |
215 | #ifndef QT_NO_SOUND | 215 | #ifndef QT_NO_SOUND |
216 | d->killTimers(); | 216 | d->killTimers(); |
217 | #endif | 217 | #endif |
218 | } | 218 | } |
219 | 219 | ||
220 | bool Sound::isFinished() const | 220 | bool Sound::isFinished() const |
221 | { | 221 | { |
222 | #ifndef QT_NO_SOUND | 222 | #ifndef QT_NO_SOUND |
223 | return d->isFinished(); | 223 | return d->isFinished(); |
224 | #else | 224 | #else |
225 | return true; | 225 | return true; |
226 | #endif | 226 | #endif |
227 | } | 227 | } |
228 | 228 | ||
229 | /*! Sounds the audible system alarm. This is used for applications such | 229 | /*! Sounds the audible system alarm. This is used for applications such |
230 | as Calendar when it needs to alarm the user of an event. | 230 | as Calendar when it needs to alarm the user of an event. |
231 | */ | 231 | */ |
232 | void Sound::soundAlarm() | 232 | void Sound::soundAlarm() |
233 | { | 233 | { |
234 | #ifndef QT_NO_COP | 234 | #ifndef QT_NO_COP |
235 | QCopEnvelope( "QPE/TaskBar", "soundAlarm()" ); | 235 | QCopEnvelope( "QPE/TaskBar", "soundAlarm()" ); |
236 | #endif | 236 | #endif |
237 | } | 237 | } |
238 | 238 | ||
239 | 239 | ||
240 | /*! \class Sound | 240 | /*! \class Sound |
241 | \brief The Sound class plays WAVE sound files and can invoke the audible alarm. | 241 | \brief The Sound class plays WAVE sound files and can invoke the audible alarm. |
242 | 242 | ||
243 | The Sound class is constructed with the .wav music file name. The Sound | 243 | The Sound class is constructed with the .wav music file name. The Sound |
244 | class retrieves the sound file from the shared Resource class. This class | 244 | class retrieves the sound file from the shared Resource class. This class |
245 | ties together QSound and the available sound resources. | 245 | ties together QSound and the available sound resources. |
246 | 246 | ||
247 | To sound an audible system alarm, call the static method soundAlarm() | 247 | To sound an audible system alarm, call the static method soundAlarm() |
248 | 248 | ||
249 | \ingroup qtopiaemb | 249 | \ingroup qtopiaemb |
250 | */ | 250 | */ |
251 | 251 | ||
252 | 252 | #ifndef QT_NO_SOUND | |
253 | #include "sound.moc" | 253 | #include "sound.moc" |
254 | #endif | ||