diff options
author | miniak <milan.burda@gmail.com> | 2009-07-01 09:49:54 (GMT) |
---|---|---|
committer | Marius Storm-Olsen <marius@trolltech.com> | 2009-07-01 09:51:14 (GMT) |
commit | 55137901012db28857fe7638e63c78743e277c56 (patch) | |
tree | 2361eb3eea67287bb22b9e3fb0690733ab76625f /src/gui/kernel/qsound_win.cpp | |
parent | cfadf08a6c06ce319f6144e724f45e4923e72778 (diff) | |
download | Qt-55137901012db28857fe7638e63c78743e277c56.zip Qt-55137901012db28857fe7638e63c78743e277c56.tar.gz Qt-55137901012db28857fe7638e63c78743e277c56.tar.bz2 |
src/gui: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT support
Also - Make winPeekMessage() & winPostMessage() obsolete
- FlashWindowEx, IsValidLanguageGroup functions no longer resolved
dynamically (available on >= Windows 2000)
- LoadIcon/LoadCursor -> LoadImage w/LR_SHARED for system
icons/cursors
- qsystemtrayicon_win: use Shell_NotifyIconGetRect if available
(Windows 7)
Merge-request: 604
Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'src/gui/kernel/qsound_win.cpp')
-rw-r--r-- | src/gui/kernel/qsound_win.cpp | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/src/gui/kernel/qsound_win.cpp b/src/gui/kernel/qsound_win.cpp index 7330d4b..82854ae 100644 --- a/src/gui/kernel/qsound_win.cpp +++ b/src/gui/kernel/qsound_win.cpp @@ -77,13 +77,8 @@ public: QAuServerWindows::QAuServerWindows(QObject* parent) : QAuServer(parent), current(0) { - QT_WA({ - mutex = CreateMutexW(0, 0, 0); - event = CreateEventW(0, FALSE, FALSE, 0); - } , { - mutex = CreateMutexA(0, 0, 0); - event = CreateEventA(0, FALSE, FALSE, 0); - }); + mutex = CreateMutex(0, 0, 0); + event = CreateEvent(0, FALSE, FALSE, 0); } QAuServerWindows::~QAuServerWindows() @@ -133,13 +128,9 @@ DWORD WINAPI SoundPlayProc(LPVOID param) if (loops == -1) flags |= SND_LOOP; - QT_WA({ - PlaySoundW((TCHAR*)filename.utf16(), 0, flags); - } , { - PlaySoundA(QFile::encodeName(filename).data(), 0, flags); - }); - if (sound && loops == 1) - server->decLoop(sound); + PlaySound((wchar_t*)filename.utf16(), 0, flags); + if (sound && loops == 1) + server->decLoop(sound); // GUI thread continues, but we are done as well. SetEvent(event); @@ -148,18 +139,13 @@ DWORD WINAPI SoundPlayProc(LPVOID param) QPointer<QSound> guarded_sound = sound; SetEvent(event); - for (int l = 0; l < loops && server->current; ++l) { - QT_WA( { - PlaySoundW( (TCHAR*)filename.utf16(), 0, SND_FILENAME|SND_SYNC ); - } , { - PlaySoundA( QFile::encodeName(filename).data(), 0, - SND_FILENAME|SND_SYNC ); - } ); - - if (guarded_sound) - server->decLoop(guarded_sound); - } - server->current = 0; + for (int l = 0; l < loops && server->current; ++l) { + PlaySound((wchar_t*)filename.utf16(), 0, SND_FILENAME | SND_SYNC); + + if (guarded_sound) + server->decLoop(guarded_sound); + } + server->current = 0; } ReleaseMutex(mutex); @@ -169,7 +155,7 @@ DWORD WINAPI SoundPlayProc(LPVOID param) void QAuServerWindows::playHelper(const QString &filename, int loop, QSound *snd) { if (loop == 0) - return; + return; // busy? if (WaitForSingleObject(mutex, 0) == WAIT_TIMEOUT) return; |