diff --git a/lib/audiodev/WASAPI.cpp b/lib/audiodev/WASAPI.cpp index 2b9a319..81a57b3 100644 --- a/lib/audiodev/WASAPI.cpp +++ b/lib/audiodev/WASAPI.cpp @@ -551,8 +551,8 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine size_t send(const void* buf, size_t len) const { - memcpy(((MIDIOut*)this)->m_buf, buf, std::min(len, size_t(512))); - ((MIDIOut*)this)->m_hdr.dwBytesRecorded = len; + memcpy(const_cast(this)->m_buf, buf, std::min(len, size_t(512))); + const_cast(this)->m_hdr.dwBytesRecorded = len; midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr)); return len; } @@ -609,8 +609,8 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine size_t send(const void* buf, size_t len) const { - memcpy(((MIDIOut*)this)->m_buf, buf, std::min(len, size_t(512))); - ((MIDIOut*)this)->m_hdr.dwBytesRecorded = len; + memcpy(const_cast(this)->m_buf, buf, std::min(len, size_t(512))); + const_cast(this)->m_hdr.dwBytesRecorded = len; midiStreamOut(m_strm, LPMIDIHDR(&m_hdr), sizeof(m_hdr)); return len; }