80 mutex = CreateMutex(0, 0, 0);
87 WaitForSingleObject(mtx, INFINITE);
98 : sound(snd),
server(srv), filename(fn), loops(lp)
115 int loops = info->
loops;
123 WaitForSingleObject(mutex, INFINITE);
127 int flags = SND_FILENAME|SND_ASYNC;
131 PlaySound((
wchar_t*)filename.
utf16(), 0, flags);
132 if (sound && loops == 1)
142 for (
int l = 0;
l < loops && server->
current; ++
l) {
143 PlaySound((
wchar_t*)filename.
utf16(), 0, SND_FILENAME | SND_SYNC);
146 server->
decLoop(guarded_sound);
160 if (WaitForSingleObject(
mutex, 0) == WAIT_TIMEOUT)
169 WaitForSingleObject(
event, INFINITE);
203 #include "qsound_win.moc" 205 #endif // QT_NO_SOUND
QAuServerWindows(QObject *parent)
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
QAuServerWindows * server
The QString class provides a Unicode character string.
int decLoop(QSound *)
Decrements the QSound::loopRemaining() value for sound s, returning the result.
The QObject class is the base class of all Qt objects.
The QPointer class is a template class that provides guarded pointers to QObject. ...
#define QT_BEGIN_NAMESPACE
This macro expands to.
void play(const QString &filename, int loop)
DWORD WINAPI SoundPlayProc(LPVOID param)
#define FALSE
Synonym for false.
static QAuServer & server()
void playHelper(const QString &filename, int loop, QSound *snd)
QObject * parent() const
Returns a pointer to the parent object.
QString fileName() const
Returns the filename associated with this QSound object.
QAuServer * qt_new_audio_server()
The QSound class provides access to the platform audio facilities.
SoundInfo(const QString &fn, int lp, QSound *snd, QAuServerWindows *srv)
int loops() const
Returns the number of times the sound will play.
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.