mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-10 05:57:41 +00:00
General: Make use of override where applicable
Continues the override modernizations, but now targeting boo.
This commit is contained in:
@@ -130,9 +130,9 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return {AudioChannelSet::Unknown, 48000.0};
|
||||
}
|
||||
|
||||
std::string getCurrentAudioOutput() const { return CFStringGetCStringPtr(m_devName.get(), kCFStringEncodingUTF8); }
|
||||
std::string getCurrentAudioOutput() const override { return CFStringGetCStringPtr(m_devName.get(), kCFStringEncodingUTF8); }
|
||||
|
||||
bool setCurrentAudioOutput(const char* name) {
|
||||
bool setCurrentAudioOutput(const char* name) override {
|
||||
m_devName = CFPointer<CFStringRef>::adopt(CFStringCreateWithCString(nullptr, name, kCFStringEncodingUTF8));
|
||||
_rebuildAudioQueue();
|
||||
return true;
|
||||
@@ -336,14 +336,14 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
MIDIIn(AQSAudioVoiceEngine* parent, bool virt, ReceiveFunctor&& receiver)
|
||||
: IMIDIIn(parent, virt, std::move(receiver)) {}
|
||||
|
||||
~MIDIIn() {
|
||||
~MIDIIn() override {
|
||||
if (m_midi)
|
||||
MIDIEndpointDispose(m_midi);
|
||||
if (m_midiPort)
|
||||
MIDIPortDispose(m_midiPort);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
CFPointer<CFStringRef> namestr;
|
||||
const char* nameCstr;
|
||||
if (MIDIObjectGetStringProperty(m_midi, kMIDIPropertyName, &namestr))
|
||||
@@ -362,14 +362,14 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
|
||||
MIDIOut(AQSAudioVoiceEngine* parent, bool virt) : IMIDIOut(parent, virt) {}
|
||||
|
||||
~MIDIOut() {
|
||||
~MIDIOut() override {
|
||||
if (m_midi)
|
||||
MIDIEndpointDispose(m_midi);
|
||||
if (m_midiPort)
|
||||
MIDIPortDispose(m_midiPort);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
CFPointer<CFStringRef> namestr;
|
||||
const char* nameCstr;
|
||||
if (MIDIObjectGetStringProperty(m_midi, kMIDIPropertyName, &namestr))
|
||||
@@ -381,7 +381,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return nameCstr;
|
||||
}
|
||||
|
||||
size_t send(const void* buf, size_t len) const {
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
union {
|
||||
MIDIPacketList head;
|
||||
Byte storage[512];
|
||||
@@ -408,7 +408,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
MIDIInOut(AQSAudioVoiceEngine* parent, bool virt, ReceiveFunctor&& receiver)
|
||||
: IMIDIInOut(parent, virt, std::move(receiver)) {}
|
||||
|
||||
~MIDIInOut() {
|
||||
~MIDIInOut() override {
|
||||
if (m_midiIn)
|
||||
MIDIEndpointDispose(m_midiIn);
|
||||
if (m_midiPortIn)
|
||||
@@ -419,7 +419,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
MIDIPortDispose(m_midiPortOut);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
CFPointer<CFStringRef> namestr;
|
||||
const char* nameCstr;
|
||||
if (MIDIObjectGetStringProperty(m_midiIn, kMIDIPropertyName, &namestr))
|
||||
@@ -431,7 +431,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return nameCstr;
|
||||
}
|
||||
|
||||
size_t send(const void* buf, size_t len) const {
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
union {
|
||||
MIDIPacketList head;
|
||||
Byte storage[512];
|
||||
@@ -452,7 +452,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
unsigned m_midiInCounter = 0;
|
||||
unsigned m_midiOutCounter = 0;
|
||||
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) override {
|
||||
if (!m_midiClient)
|
||||
return {};
|
||||
|
||||
@@ -477,7 +477,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() {
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() override {
|
||||
if (!m_midiClient)
|
||||
return {};
|
||||
|
||||
@@ -500,7 +500,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) override {
|
||||
if (!m_midiClient)
|
||||
return {};
|
||||
|
||||
@@ -537,7 +537,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) override {
|
||||
if (!m_midiClient)
|
||||
return {};
|
||||
|
||||
@@ -561,7 +561,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) {
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) override {
|
||||
if (!m_midiClient)
|
||||
return {};
|
||||
|
||||
@@ -584,7 +584,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) override {
|
||||
if (!m_midiClient)
|
||||
return {};
|
||||
|
||||
@@ -623,7 +623,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool useMIDILock() const { return true; }
|
||||
bool useMIDILock() const override { return true; }
|
||||
|
||||
static void SampleRateChanged(AQSAudioVoiceEngine* engine, AudioQueueRef inAQ, AudioQueuePropertyID inID) {
|
||||
engine->m_needsRebuild = true;
|
||||
@@ -841,14 +841,14 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
MIDIClientCreate(CFSTR("Boo MIDI"), nullptr, nullptr, &m_midiClient);
|
||||
}
|
||||
|
||||
~AQSAudioVoiceEngine() {
|
||||
~AQSAudioVoiceEngine() override {
|
||||
m_cbRunning = false;
|
||||
AudioQueueDispose(m_queue, true);
|
||||
if (m_midiClient)
|
||||
MIDIClientDispose(m_midiClient);
|
||||
}
|
||||
|
||||
void pumpAndMixVoices() {
|
||||
void pumpAndMixVoices() override {
|
||||
while (CFRunLoopRunInMode(m_runLoopMode.get(), 0, true) == kCFRunLoopRunHandledSource) {}
|
||||
if (m_needsRebuild) {
|
||||
_rebuildAudioQueue();
|
||||
|
||||
@@ -80,16 +80,16 @@ class AudioSubmix : public ListNode<AudioSubmix, BaseAudioVoiceEngine*, IAudioSu
|
||||
public:
|
||||
static AudioSubmix*& _getHeadPtr(BaseAudioVoiceEngine* head);
|
||||
static std::unique_lock<std::recursive_mutex> _getHeadLock(BaseAudioVoiceEngine* head);
|
||||
std::unique_lock<std::recursive_mutex> destructorLock();
|
||||
std::unique_lock<std::recursive_mutex> destructorLock() override;
|
||||
|
||||
AudioSubmix(BaseAudioVoiceEngine& root, IAudioSubmixCallback* cb, int busId, bool mainOut);
|
||||
~AudioSubmix();
|
||||
~AudioSubmix() override;
|
||||
|
||||
void resetSendLevels();
|
||||
void setSendLevel(IAudioSubmix* submix, float level, bool slew);
|
||||
void resetSendLevels() override;
|
||||
void setSendLevel(IAudioSubmix* submix, float level, bool slew) override;
|
||||
const AudioVoiceEngineMixInfo& mixInfo() const;
|
||||
double getSampleRate() const;
|
||||
SubmixFormat getSampleFormat() const;
|
||||
double getSampleRate() const override;
|
||||
SubmixFormat getSampleFormat() const override;
|
||||
};
|
||||
|
||||
template <>
|
||||
|
||||
@@ -64,13 +64,13 @@ protected:
|
||||
public:
|
||||
static AudioVoice*& _getHeadPtr(BaseAudioVoiceEngine* head);
|
||||
static std::unique_lock<std::recursive_mutex> _getHeadLock(BaseAudioVoiceEngine* head);
|
||||
std::unique_lock<std::recursive_mutex> destructorLock();
|
||||
std::unique_lock<std::recursive_mutex> destructorLock() override;
|
||||
|
||||
~AudioVoice();
|
||||
void resetSampleRate(double sampleRate);
|
||||
void setPitchRatio(double ratio, bool slew);
|
||||
void start();
|
||||
void stop();
|
||||
~AudioVoice() override;
|
||||
void resetSampleRate(double sampleRate) override;
|
||||
void setPitchRatio(double ratio, bool slew) override;
|
||||
void start() override;
|
||||
void stop() override;
|
||||
double getSampleRateIn() const { return m_sampleRateIn; }
|
||||
double getSampleRateOut() const { return m_sampleRateOut; }
|
||||
};
|
||||
@@ -91,7 +91,7 @@ inline size_t AudioVoice::pumpAndMix<float>(size_t frames) {
|
||||
class AudioVoiceMono : public AudioVoice {
|
||||
std::unordered_map<IAudioSubmix*, AudioMatrixMono> m_sendMatrices;
|
||||
bool m_silentOut = false;
|
||||
void _resetSampleRate(double sampleRate);
|
||||
void _resetSampleRate(double sampleRate) override;
|
||||
|
||||
static size_t SRCCallback(AudioVoiceMono* ctx, int16_t** data, size_t requestedLen);
|
||||
|
||||
@@ -99,21 +99,21 @@ class AudioVoiceMono : public AudioVoice {
|
||||
|
||||
template <typename T>
|
||||
size_t _pumpAndMix(size_t frames);
|
||||
size_t pumpAndMix16(size_t frames) { return _pumpAndMix<int16_t>(frames); }
|
||||
size_t pumpAndMix32(size_t frames) { return _pumpAndMix<int32_t>(frames); }
|
||||
size_t pumpAndMixFlt(size_t frames) { return _pumpAndMix<float>(frames); }
|
||||
size_t pumpAndMix16(size_t frames) override { return _pumpAndMix<int16_t>(frames); }
|
||||
size_t pumpAndMix32(size_t frames) override { return _pumpAndMix<int32_t>(frames); }
|
||||
size_t pumpAndMixFlt(size_t frames) override { return _pumpAndMix<float>(frames); }
|
||||
|
||||
public:
|
||||
AudioVoiceMono(BaseAudioVoiceEngine& root, IAudioVoiceCallback* cb, double sampleRate, bool dynamicRate);
|
||||
void resetChannelLevels();
|
||||
void setMonoChannelLevels(IAudioSubmix* submix, const float coefs[8], bool slew);
|
||||
void setStereoChannelLevels(IAudioSubmix* submix, const float coefs[8][2], bool slew);
|
||||
void resetChannelLevels() override;
|
||||
void setMonoChannelLevels(IAudioSubmix* submix, const float coefs[8], bool slew) override;
|
||||
void setStereoChannelLevels(IAudioSubmix* submix, const float coefs[8][2], bool slew) override;
|
||||
};
|
||||
|
||||
class AudioVoiceStereo : public AudioVoice {
|
||||
std::unordered_map<IAudioSubmix*, AudioMatrixStereo> m_sendMatrices;
|
||||
bool m_silentOut = false;
|
||||
void _resetSampleRate(double sampleRate);
|
||||
void _resetSampleRate(double sampleRate) override;
|
||||
|
||||
static size_t SRCCallback(AudioVoiceStereo* ctx, int16_t** data, size_t requestedLen);
|
||||
|
||||
@@ -121,15 +121,15 @@ class AudioVoiceStereo : public AudioVoice {
|
||||
|
||||
template <typename T>
|
||||
size_t _pumpAndMix(size_t frames);
|
||||
size_t pumpAndMix16(size_t frames) { return _pumpAndMix<int16_t>(frames); }
|
||||
size_t pumpAndMix32(size_t frames) { return _pumpAndMix<int32_t>(frames); }
|
||||
size_t pumpAndMixFlt(size_t frames) { return _pumpAndMix<float>(frames); }
|
||||
size_t pumpAndMix16(size_t frames) override { return _pumpAndMix<int16_t>(frames); }
|
||||
size_t pumpAndMix32(size_t frames) override { return _pumpAndMix<int32_t>(frames); }
|
||||
size_t pumpAndMixFlt(size_t frames) override { return _pumpAndMix<float>(frames); }
|
||||
|
||||
public:
|
||||
AudioVoiceStereo(BaseAudioVoiceEngine& root, IAudioVoiceCallback* cb, double sampleRate, bool dynamicRate);
|
||||
void resetChannelLevels();
|
||||
void setMonoChannelLevels(IAudioSubmix* submix, const float coefs[8], bool slew);
|
||||
void setStereoChannelLevels(IAudioSubmix* submix, const float coefs[8][2], bool slew);
|
||||
void resetChannelLevels() override;
|
||||
void setMonoChannelLevels(IAudioSubmix* submix, const float coefs[8], bool slew) override;
|
||||
void setStereoChannelLevels(IAudioSubmix* submix, const float coefs[8][2], bool slew) override;
|
||||
};
|
||||
|
||||
} // namespace boo
|
||||
|
||||
@@ -57,22 +57,24 @@ protected:
|
||||
|
||||
public:
|
||||
BaseAudioVoiceEngine() : m_mainSubmix(std::make_unique<AudioSubmix>(*this, nullptr, -1, false)) {}
|
||||
~BaseAudioVoiceEngine();
|
||||
ObjToken<IAudioVoice> allocateNewMonoVoice(double sampleRate, IAudioVoiceCallback* cb, bool dynamicPitch = false);
|
||||
~BaseAudioVoiceEngine() override;
|
||||
ObjToken<IAudioVoice> allocateNewMonoVoice(double sampleRate, IAudioVoiceCallback* cb,
|
||||
bool dynamicPitch = false) override;
|
||||
|
||||
ObjToken<IAudioVoice> allocateNewStereoVoice(double sampleRate, IAudioVoiceCallback* cb, bool dynamicPitch = false);
|
||||
ObjToken<IAudioVoice> allocateNewStereoVoice(double sampleRate, IAudioVoiceCallback* cb,
|
||||
bool dynamicPitch = false) override;
|
||||
|
||||
ObjToken<IAudioSubmix> allocateNewSubmix(bool mainOut, IAudioSubmixCallback* cb, int busId);
|
||||
ObjToken<IAudioSubmix> allocateNewSubmix(bool mainOut, IAudioSubmixCallback* cb, int busId) override;
|
||||
|
||||
void setCallbackInterface(IAudioVoiceEngineCallback* cb);
|
||||
void setCallbackInterface(IAudioVoiceEngineCallback* cb) override;
|
||||
|
||||
void setVolume(float vol);
|
||||
bool enableLtRt(bool enable);
|
||||
void setVolume(float vol) override;
|
||||
bool enableLtRt(bool enable) override;
|
||||
const AudioVoiceEngineMixInfo& mixInfo() const;
|
||||
const AudioVoiceEngineMixInfo& clientMixInfo() const;
|
||||
AudioChannelSet getAvailableSet() { return clientMixInfo().m_channels; }
|
||||
void pumpAndMixVoices() {}
|
||||
size_t get5MsFrames() const { return m_5msFrames; }
|
||||
AudioChannelSet getAvailableSet() override { return clientMixInfo().m_channels; }
|
||||
void pumpAndMixVoices() override {}
|
||||
size_t get5MsFrames() const override { return m_5msFrames; }
|
||||
};
|
||||
|
||||
template <>
|
||||
|
||||
@@ -25,12 +25,12 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
}
|
||||
}
|
||||
|
||||
~LinuxMidi() {
|
||||
~LinuxMidi() override {
|
||||
for (auto& p : m_openHandles)
|
||||
p.second->_disown();
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIInputs() const {
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIInputs() const override {
|
||||
std::vector<std::pair<std::string, std::string>> ret;
|
||||
int status;
|
||||
int card = -1; /* use -1 to prime the pump of iterating through card list */
|
||||
@@ -83,7 +83,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool supportsVirtualMIDIIn() const { return true; }
|
||||
bool supportsVirtualMIDIIn() const override { return true; }
|
||||
|
||||
static void MIDIFreeProc(void* midiStatus) { snd_rawmidi_status_free((snd_rawmidi_status_t*)midiStatus); }
|
||||
|
||||
@@ -126,7 +126,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
, m_midi(midi)
|
||||
, m_midiThread(std::bind(MIDIReceiveProc, m_midi, m_receiver)) {}
|
||||
|
||||
~MIDIIn() {
|
||||
~MIDIIn() override {
|
||||
if (m_parent)
|
||||
static_cast<LinuxMidi*>(m_parent)->_removeOpenHandle(this);
|
||||
pthread_cancel(m_midiThread.native_handle());
|
||||
@@ -135,7 +135,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
snd_rawmidi_close(m_midi);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
snd_rawmidi_info_t* info;
|
||||
snd_rawmidi_info_alloca(&info);
|
||||
snd_rawmidi_info(m_midi, info);
|
||||
@@ -148,13 +148,13 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
snd_rawmidi_t* m_midi;
|
||||
MIDIOut(LinuxMidi* parent, snd_rawmidi_t* midi, bool virt) : IMIDIOut(parent, virt), m_midi(midi) {}
|
||||
|
||||
~MIDIOut() {
|
||||
~MIDIOut() override {
|
||||
if (m_parent)
|
||||
static_cast<LinuxMidi*>(m_parent)->_removeOpenHandle(this);
|
||||
snd_rawmidi_close(m_midi);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
snd_rawmidi_info_t* info;
|
||||
snd_rawmidi_info_alloca(&info);
|
||||
snd_rawmidi_info(m_midi, info);
|
||||
@@ -162,7 +162,9 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t send(const void* buf, size_t len) const { return size_t(std::max(0l, snd_rawmidi_write(m_midi, buf, len))); }
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
return size_t(std::max(0l, snd_rawmidi_write(m_midi, buf, len)));
|
||||
}
|
||||
};
|
||||
|
||||
struct MIDIInOut : public IMIDIInOut {
|
||||
@@ -176,7 +178,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
, m_midiOut(midiOut)
|
||||
, m_midiThread(std::bind(MIDIReceiveProc, m_midiIn, m_receiver)) {}
|
||||
|
||||
~MIDIInOut() {
|
||||
~MIDIInOut() override {
|
||||
if (m_parent)
|
||||
static_cast<LinuxMidi*>(m_parent)->_removeOpenHandle(this);
|
||||
pthread_cancel(m_midiThread.native_handle());
|
||||
@@ -186,7 +188,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
snd_rawmidi_close(m_midiOut);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
snd_rawmidi_info_t* info;
|
||||
snd_rawmidi_info_alloca(&info);
|
||||
snd_rawmidi_info(m_midiIn, info);
|
||||
@@ -194,12 +196,12 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t send(const void* buf, size_t len) const {
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
return size_t(std::max(0l, snd_rawmidi_write(m_midiOut, buf, len)));
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) override {
|
||||
int status;
|
||||
snd_rawmidi_t* midi;
|
||||
status = snd_rawmidi_open(&midi, nullptr, "virtual", 0);
|
||||
@@ -208,7 +210,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return std::make_unique<MIDIIn>(nullptr, midi, true, std::move(receiver));
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() {
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() override {
|
||||
int status;
|
||||
snd_rawmidi_t* midi;
|
||||
status = snd_rawmidi_open(nullptr, &midi, "virtual", 0);
|
||||
@@ -217,7 +219,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return std::make_unique<MIDIOut>(nullptr, midi, true);
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) override {
|
||||
int status;
|
||||
snd_rawmidi_t* midiIn;
|
||||
snd_rawmidi_t* midiOut;
|
||||
@@ -227,7 +229,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return std::make_unique<MIDIInOut>(nullptr, midiIn, midiOut, true, std::move(receiver));
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) override {
|
||||
snd_rawmidi_t* midi;
|
||||
int status = snd_rawmidi_open(&midi, nullptr, name, 0);
|
||||
if (status)
|
||||
@@ -237,7 +239,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) {
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) override {
|
||||
snd_rawmidi_t* midi;
|
||||
int status = snd_rawmidi_open(nullptr, &midi, name, 0);
|
||||
if (status)
|
||||
@@ -247,7 +249,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) override {
|
||||
snd_rawmidi_t* midiIn;
|
||||
snd_rawmidi_t* midiOut;
|
||||
int status = snd_rawmidi_open(&midiIn, &midiOut, name, 0);
|
||||
@@ -258,7 +260,7 @@ struct LinuxMidi : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool useMIDILock() const { return true; }
|
||||
bool useMIDILock() const override { return true; }
|
||||
};
|
||||
|
||||
} // namespace boo
|
||||
|
||||
@@ -154,7 +154,7 @@ struct PulseAudioVoiceEngine : LinuxMidi {
|
||||
m_mainloop = nullptr;
|
||||
}
|
||||
|
||||
~PulseAudioVoiceEngine() {
|
||||
~PulseAudioVoiceEngine() override {
|
||||
if (m_stream) {
|
||||
pa_stream_disconnect(m_stream);
|
||||
pa_stream_unref(m_stream);
|
||||
@@ -279,14 +279,14 @@ struct PulseAudioVoiceEngine : LinuxMidi {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string getCurrentAudioOutput() const { return m_sinkName; }
|
||||
std::string getCurrentAudioOutput() const override { return m_sinkName; }
|
||||
|
||||
bool m_sinkOk = false;
|
||||
static void _checkAudioSinkReply(pa_context* c, const pa_sink_info* i, int eol, PulseAudioVoiceEngine* userdata) {
|
||||
if (i)
|
||||
userdata->m_sinkOk = true;
|
||||
}
|
||||
bool setCurrentAudioOutput(const char* name) {
|
||||
bool setCurrentAudioOutput(const char* name) override {
|
||||
m_sinkOk = false;
|
||||
pa_operation* op;
|
||||
op = pa_context_get_sink_info_by_name(m_ctx, name, pa_sink_info_cb_t(_checkAudioSinkReply), this);
|
||||
@@ -308,7 +308,7 @@ struct PulseAudioVoiceEngine : LinuxMidi {
|
||||
}
|
||||
}
|
||||
|
||||
void pumpAndMixVoices() {
|
||||
void pumpAndMixVoices() override {
|
||||
if (!m_stream) {
|
||||
/* Dummy pump mode - use failsafe defaults for 1/60sec of samples */
|
||||
m_mixInfo.m_sampleRate = 32000.0;
|
||||
|
||||
@@ -70,11 +70,11 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
|
||||
// IUnknown methods -- AddRef, Release, and QueryInterface
|
||||
|
||||
ULONG STDMETHODCALLTYPE AddRef() {
|
||||
ULONG STDMETHODCALLTYPE AddRef() override {
|
||||
return InterlockedIncrement(&_cRef);
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE Release() {
|
||||
ULONG STDMETHODCALLTYPE Release() override {
|
||||
ULONG ulRef = InterlockedDecrement(&_cRef);
|
||||
if (0 == ulRef) {
|
||||
delete this;
|
||||
@@ -82,7 +82,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ulRef;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, VOID** ppvInterface) {
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, VOID** ppvInterface) override {
|
||||
if (IID_IUnknown == riid) {
|
||||
AddRef();
|
||||
*ppvInterface = (IUnknown*)this;
|
||||
@@ -98,18 +98,20 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
|
||||
// Callback methods for device-event notifications.
|
||||
|
||||
HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId) {
|
||||
HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId) override {
|
||||
m_parent.m_rebuild = true;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId) { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId) override { return S_OK; }
|
||||
|
||||
HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId) { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId) override { return S_OK; }
|
||||
|
||||
HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) override { return S_OK; }
|
||||
|
||||
HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) override {
|
||||
return S_OK;
|
||||
}
|
||||
} m_notificationClient;
|
||||
#endif
|
||||
|
||||
@@ -386,7 +388,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
_resetSampleRate();
|
||||
}
|
||||
|
||||
void pumpAndMixVoices() {
|
||||
void pumpAndMixVoices() override {
|
||||
#if WINDOWS_STORE
|
||||
if (!m_ready)
|
||||
return;
|
||||
@@ -463,9 +465,9 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
}
|
||||
}
|
||||
|
||||
std::string getCurrentAudioOutput() const { return m_sinkName; }
|
||||
std::string getCurrentAudioOutput() const override { return m_sinkName; }
|
||||
|
||||
bool setCurrentAudioOutput(const char* name) {
|
||||
bool setCurrentAudioOutput(const char* name) override {
|
||||
ComPtr<IMMDevice> newDevice;
|
||||
if (FAILED(m_enumerator->GetDevice(MBSTWCS(name).c_str(), &newDevice))) {
|
||||
Log.report(logvisor::Error, fmt("unable to obtain audio device {}"), name);
|
||||
@@ -477,7 +479,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> enumerateAudioOutputs() const {
|
||||
std::vector<std::pair<std::string, std::string>> enumerateAudioOutputs() const override {
|
||||
std::vector<std::pair<std::string, std::string>> ret;
|
||||
|
||||
ComPtr<IMMDeviceCollection> collection;
|
||||
@@ -507,7 +509,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
}
|
||||
|
||||
#if !WINDOWS_STORE
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIInputs() const {
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIInputs() const override {
|
||||
std::vector<std::pair<std::string, std::string>> ret;
|
||||
|
||||
UINT numInDevices = midiInGetNumDevs();
|
||||
@@ -547,7 +549,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool supportsVirtualMIDIIn() const {
|
||||
bool supportsVirtualMIDIIn() const override {
|
||||
#ifdef TE_VIRTUAL_MIDI
|
||||
WORD major, minor, release, build;
|
||||
return virtualMIDIGetDriverVersionPROC &&
|
||||
@@ -588,9 +590,9 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
|
||||
VMIDIIn(WASAPIAudioVoiceEngine* parent, ReceiveFunctor&& receiver) : IMIDIIn(parent, true, std::move(receiver)) {}
|
||||
|
||||
~VMIDIIn() { virtualMIDIClosePortPROC(m_midi); }
|
||||
~VMIDIIn() override { virtualMIDIClosePortPROC(m_midi); }
|
||||
|
||||
std::string description() const { return "Virtual MIDI-In"; }
|
||||
std::string description() const override { return "Virtual MIDI-In"; }
|
||||
};
|
||||
|
||||
struct VMIDIOut : public IMIDIOut {
|
||||
@@ -598,11 +600,11 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
|
||||
VMIDIOut(WASAPIAudioVoiceEngine* parent) : IMIDIOut(parent, true) {}
|
||||
|
||||
~VMIDIOut() { virtualMIDIClosePortPROC(m_midi); }
|
||||
~VMIDIOut() override { virtualMIDIClosePortPROC(m_midi); }
|
||||
|
||||
std::string description() const { return "Virtual MIDI-Out"; }
|
||||
std::string description() const override { return "Virtual MIDI-Out"; }
|
||||
|
||||
size_t send(const void* buf, size_t len) const {
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
return virtualMIDISendDataPROC(m_midi, (LPBYTE)buf, len) ? len : 0;
|
||||
}
|
||||
};
|
||||
@@ -613,11 +615,11 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
VMIDIInOut(WASAPIAudioVoiceEngine* parent, ReceiveFunctor&& receiver)
|
||||
: IMIDIInOut(parent, true, std::move(receiver)) {}
|
||||
|
||||
~VMIDIInOut() { virtualMIDIClosePortPROC(m_midi); }
|
||||
~VMIDIInOut() override { virtualMIDIClosePortPROC(m_midi); }
|
||||
|
||||
std::string description() const { return "Virtual MIDI-In/Out"; }
|
||||
std::string description() const override { return "Virtual MIDI-In/Out"; }
|
||||
|
||||
size_t send(const void* buf, size_t len) const {
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
return virtualMIDISendDataPROC(m_midi, (LPBYTE)buf, len) ? len : 0;
|
||||
}
|
||||
};
|
||||
@@ -628,9 +630,9 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
|
||||
MIDIIn(WASAPIAudioVoiceEngine* parent, ReceiveFunctor&& receiver) : IMIDIIn(parent, false, std::move(receiver)) {}
|
||||
|
||||
~MIDIIn() { midiInClose(m_midi); }
|
||||
~MIDIIn() override { midiInClose(m_midi); }
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
UINT id = 0;
|
||||
midiInGetID(m_midi, &id);
|
||||
MIDIINCAPS caps;
|
||||
@@ -664,13 +666,13 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
midiStreamOpen(&m_strm, &id, 1, NULL, NULL, CALLBACK_NULL);
|
||||
}
|
||||
|
||||
~MIDIOut() {
|
||||
~MIDIOut() override {
|
||||
midiStreamClose(m_strm);
|
||||
midiOutUnprepareHeader(m_midi, &m_hdr, sizeof(m_hdr));
|
||||
midiOutClose(m_midi);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
UINT id = 0;
|
||||
midiOutGetID(m_midi, &id);
|
||||
MIDIOUTCAPS caps;
|
||||
@@ -684,7 +686,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t send(const void* buf, size_t len) const {
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
memcpy(const_cast<MIDIOut*>(this)->m_buf, buf, std::min(len, size_t(512)));
|
||||
const_cast<MIDIOut*>(this)->m_hdr.dwBytesRecorded = len;
|
||||
midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr));
|
||||
@@ -713,14 +715,14 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
midiStreamOpen(&m_strm, &id, 1, NULL, NULL, CALLBACK_NULL);
|
||||
}
|
||||
|
||||
~MIDIInOut() {
|
||||
~MIDIInOut() override {
|
||||
midiInClose(m_midiIn);
|
||||
midiStreamClose(m_strm);
|
||||
midiOutUnprepareHeader(m_midiOut, &m_hdr, sizeof(m_hdr));
|
||||
midiOutClose(m_midiOut);
|
||||
}
|
||||
|
||||
std::string description() const {
|
||||
std::string description() const override {
|
||||
UINT id = 0;
|
||||
midiOutGetID(m_midiOut, &id);
|
||||
MIDIOUTCAPS caps;
|
||||
@@ -734,7 +736,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t send(const void* buf, size_t len) const {
|
||||
size_t send(const void* buf, size_t len) const override {
|
||||
memcpy(const_cast<uint8_t*>(m_buf), buf, std::min(len, size_t(512)));
|
||||
const_cast<MIDIHDR&>(m_hdr).dwBytesRecorded = len;
|
||||
midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr));
|
||||
@@ -742,7 +744,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) override {
|
||||
#ifdef TE_VIRTUAL_MIDI
|
||||
if (!virtualMIDICreatePortEx2PROC)
|
||||
return {};
|
||||
@@ -764,7 +766,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() {
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() override {
|
||||
#ifdef TE_VIRTUAL_MIDI
|
||||
if (!virtualMIDICreatePortEx2PROC)
|
||||
return {};
|
||||
@@ -785,7 +787,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) override {
|
||||
#ifdef TE_VIRTUAL_MIDI
|
||||
if (!virtualMIDICreatePortEx2PROC)
|
||||
return {};
|
||||
@@ -807,7 +809,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) override {
|
||||
if (strncmp(name, "in", 2))
|
||||
return {};
|
||||
long id = strtol(name + 2, nullptr, 10);
|
||||
@@ -824,7 +826,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) {
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) override {
|
||||
if (strncmp(name, "out", 3))
|
||||
return {};
|
||||
long id = strtol(name + 3, nullptr, 10);
|
||||
@@ -840,7 +842,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) override {
|
||||
const char* in = strstr(name, "in");
|
||||
const char* out = strstr(name, "out");
|
||||
|
||||
@@ -866,21 +868,21 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool useMIDILock() const { return true; }
|
||||
bool useMIDILock() const override { return true; }
|
||||
#else
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIDevices() const { return {}; }
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIDevices() const override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) { return {}; }
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() { return {}; }
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) { return {}; }
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) { return {}; }
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) { return {}; }
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) { return {}; }
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) override { return {}; }
|
||||
|
||||
bool useMIDILock() const { return false; }
|
||||
#endif
|
||||
|
||||
@@ -11,15 +11,17 @@ struct WAVOutVoiceEngine : BaseAudioVoiceEngine {
|
||||
|
||||
AudioChannelSet _getAvailableSet() { return AudioChannelSet::Stereo; }
|
||||
|
||||
std::string getCurrentAudioOutput() const { return "wavout"; }
|
||||
std::string getCurrentAudioOutput() const override { return "wavout"; }
|
||||
|
||||
bool setCurrentAudioOutput(const char* name) { return false; }
|
||||
bool setCurrentAudioOutput(const char* name) override { return false; }
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> enumerateAudioOutputs() const { return {{"wavout", "WAVOut"}}; }
|
||||
std::vector<std::pair<std::string, std::string>> enumerateAudioOutputs() const override {
|
||||
return {{"wavout", "WAVOut"}};
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIInputs() const { return {}; }
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIInputs() const override { return {}; }
|
||||
|
||||
bool supportsVirtualMIDIIn() const { return false; }
|
||||
bool supportsVirtualMIDIIn() const override { return false; }
|
||||
|
||||
ReceiveFunctor* m_midiReceiver = nullptr;
|
||||
|
||||
@@ -27,26 +29,26 @@ struct WAVOutVoiceEngine : BaseAudioVoiceEngine {
|
||||
MIDIIn(WAVOutVoiceEngine* parent, bool virt, ReceiveFunctor&& receiver)
|
||||
: IMIDIIn(parent, virt, std::move(receiver)) {}
|
||||
|
||||
std::string description() const { return "WAVOut MIDI"; }
|
||||
std::string description() const override { return "WAVOut MIDI"; }
|
||||
};
|
||||
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) {
|
||||
std::unique_ptr<IMIDIIn> newVirtualMIDIIn(ReceiveFunctor&& receiver) override {
|
||||
std::unique_ptr<IMIDIIn> ret = std::make_unique<MIDIIn>(nullptr, true, std::move(receiver));
|
||||
m_midiReceiver = &ret->m_receiver;
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() { return {}; }
|
||||
std::unique_ptr<IMIDIOut> newVirtualMIDIOut() override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) { return {}; }
|
||||
std::unique_ptr<IMIDIInOut> newVirtualMIDIInOut(ReceiveFunctor&& receiver) override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) { return {}; }
|
||||
std::unique_ptr<IMIDIIn> newRealMIDIIn(const char* name, ReceiveFunctor&& receiver) override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) { return {}; }
|
||||
std::unique_ptr<IMIDIOut> newRealMIDIOut(const char* name) override { return {}; }
|
||||
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) { return {}; }
|
||||
std::unique_ptr<IMIDIInOut> newRealMIDIInOut(const char* name, ReceiveFunctor&& receiver) override { return {}; }
|
||||
|
||||
bool useMIDILock() const { return false; }
|
||||
bool useMIDILock() const override { return false; }
|
||||
|
||||
FILE* m_fp = nullptr;
|
||||
size_t m_bytesWritten = 0;
|
||||
@@ -207,7 +209,7 @@ struct WAVOutVoiceEngine : BaseAudioVoiceEngine {
|
||||
fclose(m_fp);
|
||||
}
|
||||
|
||||
~WAVOutVoiceEngine() { finishWav(); }
|
||||
~WAVOutVoiceEngine() override { finishWav(); }
|
||||
|
||||
void _buildAudioRenderClient() {
|
||||
m_5msFrames = m_mixInfo.m_sampleRate * 5 / 1000;
|
||||
@@ -221,7 +223,7 @@ struct WAVOutVoiceEngine : BaseAudioVoiceEngine {
|
||||
_resetSampleRate();
|
||||
}
|
||||
|
||||
void pumpAndMixVoices() {
|
||||
void pumpAndMixVoices() override {
|
||||
size_t frameSz = 4 * m_mixInfo.m_channelMap.m_channelCount;
|
||||
_pumpAndMixVoices(m_5msFrames, m_interleavedBuf.data());
|
||||
fwrite(m_interleavedBuf.data(), 1, m_5msFrames * frameSz, m_fp);
|
||||
|
||||
Reference in New Issue
Block a user