13void MidiOutWindows::registerAll(PluggingController& controller)
16 for (
auto i :
xrange(w32_midiOutGetVFNsNum())) {
17 controller.registerPluggable(std::make_unique<MidiOutWindows>(i));
22MidiOutWindows::MidiOutWindows(
unsigned num)
23 : devIdx(unsigned(-1))
25 name = w32_midiOutGetVFN(num);
26 desc = w32_midiOutGetRDN(num);
29MidiOutWindows::~MidiOutWindows()
34void MidiOutWindows::plugHelper(Connector& , EmuTime::param )
36 devIdx = w32_midiOutOpen(name.c_str());
37 if (devIdx ==
unsigned(-1)) {
38 throw PlugException(
"Failed to open " + name);
42void MidiOutWindows::unplugHelper(EmuTime::param )
44 if (devIdx !=
unsigned(-1)) {
45 w32_midiOutClose(devIdx);
46 devIdx = unsigned(-1);
50std::string_view MidiOutWindows::getName()
const
55std::string_view MidiOutWindows::getDescription()
const
60void MidiOutWindows::recvMessage(
const std::vector<uint8_t>& message, EmuTime::param )
62 if (devIdx !=
unsigned(-1)) {
63 w32_midiOutMsg(message.size(), message.data(), devIdx);
67template<
typename Archive>
68void MidiOutWindows::serialize(Archive& ,
unsigned )
This file implemented 3 utility functions:
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
constexpr auto xrange(T e)