This commit is contained in:
2022-07-15 04:32:36 +02:00
parent b621d1266c
commit be949ea8a3
7 changed files with 89 additions and 37 deletions

View File

@@ -37,13 +37,54 @@ AudioDevice::~AudioDevice()
if (volumeInterface)
{
volumeInterface->Release();
volumeInterface = nullptr;
}
if (meterInterface)
{
meterInterface->Release();
meterInterface = nullptr;
}
if (device)
{
device->Release();
device = nullptr;
}
}
AudioData::AudioData()
{
}
AudioData::AudioData(AudioData&& other) noexcept
: playbackDevices(std::move(other.playbackDevices)), recordingDevices(std::move(other.recordingDevices)),
deviceEnumerator(other.deviceEnumerator), audioNotificationListener(other.audioNotificationListener)
{
other.deviceEnumerator = nullptr;
other.audioNotificationListener = nullptr;
}
AudioData& AudioData::operator=(AudioData&& other) noexcept
{
playbackDevices = std::move(other.playbackDevices);
recordingDevices = std::move(other.recordingDevices);
deviceEnumerator = other.deviceEnumerator;
audioNotificationListener = other.audioNotificationListener;
other.deviceEnumerator = nullptr;
other.audioNotificationListener = nullptr;
return *this;
}
AudioData::~AudioData()
{
if (deviceEnumerator)
{
deviceEnumerator->Release();
deviceEnumerator = nullptr;
}
if (audioNotificationListener)
{
audioNotificationListener->Release();
audioNotificationListener = nullptr;
}
}