15 void MidiOutWindows::registerAll(PluggingController& controller)
18 for (
auto i :
xrange(w32_midiOutGetVFNsNum())) {
19 controller.registerPluggable(std::make_unique<MidiOutWindows>(i));
24 MidiOutWindows::MidiOutWindows(
unsigned num)
25 : devidx(unsigned(-1))
27 name = w32_midiOutGetVFN(num);
28 desc = w32_midiOutGetRDN(num);
31 MidiOutWindows::~MidiOutWindows()
36 void MidiOutWindows::plugHelper(
Connector& , EmuTime::param )
38 devidx = w32_midiOutOpen(name.c_str());
39 if (devidx ==
unsigned(-1)) {
40 throw PlugException(
"Failed to open " + name);
44 void MidiOutWindows::unplugHelper(EmuTime::param )
46 if (devidx !=
unsigned(-1)) {
47 w32_midiOutClose(devidx);
48 devidx = unsigned(-1);
57 std::string_view MidiOutWindows::getDescription()
const
62 void MidiOutWindows::recvMessage(
const std::vector<uint8_t>& message, EmuTime::param )
64 if (devidx !=
unsigned(-1)) {
65 w32_midiOutMsg(message.size(), message.data(), devidx);
69 template<
typename Archive>
string getName(KeyCode keyCode)
Translate key code to key name.
This file implemented 3 utility functions:
void serialize(Archive &ar, T &t, unsigned version)
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
constexpr auto xrange(T e)