13void MidiOutWindows::registerAll(PluggingController& controller)
16 for (
auto i :
xrange(w32_midiOutGetVFNsNum())) {
17 controller.registerPluggable(std::make_unique<MidiOutWindows>(i));
22MidiOutWindows::MidiOutWindows(
unsigned num)
24 name = w32_midiOutGetVFN(num);
25 desc = w32_midiOutGetRDN(num);
28MidiOutWindows::~MidiOutWindows()
33void MidiOutWindows::plugHelper(Connector& , EmuTime::param )
35 devIdx = w32_midiOutOpen(name.c_str());
36 if (devIdx ==
unsigned(-1)) {
37 throw PlugException(
"Failed to open " + name);
41void MidiOutWindows::unplugHelper(EmuTime::param )
43 if (devIdx !=
unsigned(-1)) {
44 w32_midiOutClose(devIdx);
45 devIdx = unsigned(-1);
49std::string_view MidiOutWindows::getName()
const
54std::string_view MidiOutWindows::getDescription()
const
59void MidiOutWindows::recvMessage(
const std::vector<uint8_t>& message, EmuTime::param )
61 if (devIdx !=
unsigned(-1)) {
62 w32_midiOutMsg(message.size(), message.data(), devIdx);
66template<
typename Archive>
67void MidiOutWindows::serialize(Archive& ,
unsigned )
This file implemented 3 utility functions:
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
constexpr auto xrange(T e)