ScummVM API documentation
winmm.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef BACKENDS_MIDI_WINMM_H
23#define BACKENDS_MIDI_WINMM_H
24
25#include "audio/musicplugin.h"
26#include "common/func.h"
27
28#include <windows.h>
29
34public:
36
37 const char *getName() const override;
38 const char *getId() const override;
39
43 MusicDevices getDevices() const override;
44
48 Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle dev = 0) const override;
49
54 bool checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const override;
55
64 static void startMidiWarmUpThread();
65
72
84 typedef bool (*MidiWarmUpWaitCallback)(const Common::Functor0<bool> &isComplete);
85
101
102private:
109 class MidiWarmUpCompletion : public Common::Functor0<bool> {
110 public:
116 bool isValid() const override { return true; }
117
124 bool operator()() const override { return isMidiWarmUpFinished(); }
125 };
126
128 static bool isMidiWarmUpFinished();
129
136 static unsigned __stdcall warmUpMidiThreadMain(void *arglist);
137
148 bool waitForMidiWarmUp() const;
149
151 static HANDLE _midiWarmUpThreadHandle;
152
154 static MidiWarmUpWaitCallback _midiWarmUpWaitCallback;
155
157 const DWORD _uiThreadId;
158};
159
160#endif
Definition: error.h:81
Definition: list.h:44
Definition: mididrv.h:313
uint32 DeviceHandle
Definition: mididrv.h:322
Definition: musicplugin.h:85
Definition: winmm.h:33
const char * getName() const override
MusicDevices getDevices() const override
bool(* MidiWarmUpWaitCallback)(const Common::Functor0< bool > &isComplete)
Definition: winmm.h:84
static void startMidiWarmUpThread()
static void cleanupMidiWarmUpThread()
static void setMidiWarmUpWaitCallback(MidiWarmUpWaitCallback callback)
const char * getId() const override
bool checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const override
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle dev=0) const override