#include <winmm.h>
Public Types | |
| typedef bool(* | MidiWarmUpWaitCallback) (const Common::Functor0< bool > &isComplete) |
Public Member Functions | |
| const char * | getName () const override |
| const char * | getId () const override |
| MusicDevices | getDevices () const override |
| Common::Error | createInstance (MidiDriver **mididriver, MidiDriver::DeviceHandle dev=0) const override |
| bool | checkDevice (MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const override |
| virtual const char * | getId () const =0 |
| virtual MusicDevices | getDevices () const =0 |
| virtual bool | checkDevice (MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const |
| virtual Common::Error | createInstance (MidiDriver **mididriver, MidiDriver::DeviceHandle=0) const =0 |
| virtual const char * | getName () const =0 |
Static Public Member Functions | |
| static void | startMidiWarmUpThread () |
| static void | cleanupMidiWarmUpThread () |
| static void | setMidiWarmUpWaitCallback (MidiWarmUpWaitCallback callback) |
Enumerate WinMM devices and create Windows MIDI drivers.
| typedef bool(* WindowsMusicPlugin::MidiWarmUpWaitCallback) (const Common::Functor0< bool > &isComplete) |
Wait for background MIDI warm-up through a modal dialog when the GUI is active. A modal dialog will handle UI events, keeping the process responsive.
| isComplete | A functor immediately returns whether the warm-up has been finished. |
|
overridevirtual |
Returns the name of the plugin.
Implements PluginObject.
|
overridevirtual |
Returns a unique string identifier which will be used to save the selected MIDI driver to the config file.
Implements MusicPluginObject.
|
overridevirtual |
Enumerate available MIDI devices with WinMM.
Implements MusicPluginObject.
|
overridevirtual |
Create a driver for the selected device, or the default device when no match exists.
Implements MusicPluginObject.
|
overridevirtual |
Checks whether a device can actually be used. Always return trues on Windows MIDI backend.
Reimplemented from MusicPluginObject.
|
static |
Start background WinMM warm-up thread.
Must be called on backend init after SDL audio init. Windows MIDI Services init can block concurrent MME audo init, one of the possible audio backend on Windows.
|
static |
Clear the warm-up thread result and resources.
Should only be called on platform teardown.
|
static |
Register the function that displays progress dialog while MIDI warm-up is running. The main purpose of that dialog is to prevent UI thread hang by first WinMM API call.
WinMM APIs may be called while the warm-up thread is still running. In that case, the plugin invokes this callback on the UI thread to spawn the dialog. The dialog polls isComplete while processing UI events.
The Windows backend registers GUI::MidiDeviceScanDialog::waitForCompletion() as a callback.
| callback | Function that spawns a progress dialog. |