diff --git a/src/plugins/wasapi/qwasapiaudioinput.cpp b/src/plugins/wasapi/qwasapiaudioinput.cpp index 22a77df38fab7cce465753ea7b47466f379f9694..561584e83868f534ff491bff6c45d6bdb67249d2 100644 --- a/src/plugins/wasapi/qwasapiaudioinput.cpp +++ b/src/plugins/wasapi/qwasapiaudioinput.cpp @@ -143,9 +143,7 @@ qint64 WasapiInputDevicePrivate::writeData(const char* data, qint64 len) QWasapiAudioInput::QWasapiAudioInput(const QByteArray &device) : m_deviceName(device) -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 , m_volumeCache(qreal(1.)) -#endif , m_currentState(QAudio::StoppedState) , m_currentError(QAudio::NoError) , m_bufferFrames(0) @@ -165,7 +163,6 @@ QWasapiAudioInput::~QWasapiAudioInput() void QWasapiAudioInput::setVolume(qreal vol) { qCDebug(lcMmAudioInput) << __FUNCTION__ << vol; -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 // Volume is only supported MSVC2015 and beyond m_volumeCache = vol; if (m_volumeControl) { quint32 channelCount; @@ -175,17 +172,12 @@ void QWasapiAudioInput::setVolume(qreal vol) RETURN_VOID_IF_FAILED("Could not set audio volume."); } } -#endif // defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 } qreal QWasapiAudioInput::volume() const { qCDebug(lcMmAudioInput) << __FUNCTION__; -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 // Volume is only supported MSVC2015 and beyond return m_volumeCache; -#else - return qreal(1.0); -#endif } void QWasapiAudioInput::process() @@ -317,11 +309,9 @@ bool QWasapiAudioInput::initStart(bool pull) hr = m_interface->m_client->GetService(IID_PPV_ARGS(&m_capture)); EMIT_RETURN_FALSE_IF_FAILED("Could not acquire render service.", QAudio::OpenError) -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 // Volume is only supported MSVC2015 and beyond for WinRT hr = m_interface->m_client->GetService(IID_PPV_ARGS(&m_volumeControl)); if (FAILED(hr)) qCDebug(lcMmAudioInput) << "Could not acquire volume control."; -#endif // defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 hr = m_interface->m_client->GetBufferSize(&m_bufferFrames); EMIT_RETURN_FALSE_IF_FAILED("Could not access buffer size.", QAudio::OpenError) diff --git a/src/plugins/wasapi/qwasapiaudioinput.h b/src/plugins/wasapi/qwasapiaudioinput.h index 3fd7315c1e4b6e228045ed83b590cdd108edabd2..34ede06b716d07ddbbf2810d1b8ee3d15562fb51 100644 --- a/src/plugins/wasapi/qwasapiaudioinput.h +++ b/src/plugins/wasapi/qwasapiaudioinput.h @@ -97,10 +97,8 @@ private: QByteArray m_deviceName; Microsoft::WRL::ComPtr<AudioInterface> m_interface; Microsoft::WRL::ComPtr<IAudioCaptureClient> m_capture; -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 Microsoft::WRL::ComPtr<IAudioStreamVolume> m_volumeControl; qreal m_volumeCache; -#endif QMutex m_mutex; QAudio::State m_currentState; QAudio::Error m_currentError; diff --git a/src/plugins/wasapi/qwasapiaudiooutput.cpp b/src/plugins/wasapi/qwasapiaudiooutput.cpp index 1b0f64451d030e33d328cad66b96652fe802a157..79548011c8778384d7107735167424fdbfb194d1 100644 --- a/src/plugins/wasapi/qwasapiaudiooutput.cpp +++ b/src/plugins/wasapi/qwasapiaudiooutput.cpp @@ -157,9 +157,7 @@ qint64 WasapiOutputDevicePrivate::writeData(const char* data, qint64 len) QWasapiAudioOutput::QWasapiAudioOutput(const QByteArray &device) : m_deviceName(device) -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 , m_volumeCache(qreal(1.)) -#endif , m_currentState(QAudio::StoppedState) , m_currentError(QAudio::NoError) , m_interval(1000) @@ -180,7 +178,6 @@ QWasapiAudioOutput::~QWasapiAudioOutput() void QWasapiAudioOutput::setVolume(qreal vol) { qCDebug(lcMmAudioOutput) << __FUNCTION__ << vol; -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 // Volume is only supported MSVC2015 and beyond for WinRT m_volumeCache = vol; if (m_volumeControl) { quint32 channelCount; @@ -190,17 +187,12 @@ void QWasapiAudioOutput::setVolume(qreal vol) RETURN_VOID_IF_FAILED("Could not set audio volume."); } } -#endif // defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 } qreal QWasapiAudioOutput::volume() const { qCDebug(lcMmAudioOutput) << __FUNCTION__; -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 // Volume is only supported MSVC2015 and beyond for WinRT return m_volumeCache; -#else - return qreal(1.0); -#endif } void QWasapiAudioOutput::process() @@ -316,11 +308,9 @@ bool QWasapiAudioOutput::initStart(bool pull) hr = m_interface->m_client->GetService(IID_PPV_ARGS(&m_renderer)); EMIT_RETURN_FALSE_IF_FAILED("Could not acquire render service.", QAudio::OpenError) -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 // Volume is only supported MSVC2015 and beyond hr = m_interface->m_client->GetService(IID_PPV_ARGS(&m_volumeControl)); if (FAILED(hr)) qCDebug(lcMmAudioOutput) << "Could not acquire volume control."; -#endif // defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 hr = m_interface->m_client->GetBufferSize(&m_bufferFrames); EMIT_RETURN_FALSE_IF_FAILED("Could not access buffer size.", QAudio::OpenError) diff --git a/src/plugins/wasapi/qwasapiaudiooutput.h b/src/plugins/wasapi/qwasapiaudiooutput.h index 118731af9a003cd1450b591149029e9f56e9abf0..02974071bae4e04b57d50fd198b4dbe071f08076 100644 --- a/src/plugins/wasapi/qwasapiaudiooutput.h +++ b/src/plugins/wasapi/qwasapiaudiooutput.h @@ -98,10 +98,8 @@ private: QByteArray m_deviceName; Microsoft::WRL::ComPtr<AudioInterface> m_interface; Microsoft::WRL::ComPtr<IAudioRenderClient> m_renderer; -#if defined(CLASSIC_APP_BUILD) || _MSC_VER >= 1900 Microsoft::WRL::ComPtr<IAudioStreamVolume> m_volumeControl; qreal m_volumeCache; -#endif QMutex m_mutex; QAudio::State m_currentState; QAudio::Error m_currentError; diff --git a/src/plugins/wasapi/wasapi.pro b/src/plugins/wasapi/wasapi.pro index 11dfd8abe02da63b9a3d7729d3c66c04c5c3b380..63409ce72fc68cd91349d315f2f82f44d16bf7fe 100644 --- a/src/plugins/wasapi/wasapi.pro +++ b/src/plugins/wasapi/wasapi.pro @@ -20,10 +20,7 @@ OTHER_FILES += \ LIBS += Mmdevapi.lib -win32-* { - DEFINES += CLASSIC_APP_BUILD - LIBS += runtimeobject.lib -} +win32-*: LIBS += runtimeobject.lib PLUGIN_TYPE = audio PLUGIN_CLASS_NAME = QWasapiPlugin