Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/sanear.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Marsev <alex.marsev@gmail.com>2014-12-27 00:30:54 +0300
committerAlex Marsev <alex.marsev@gmail.com>2014-12-27 00:48:59 +0300
commitf802e340cd4f9856c1d69f72e1c05e58da56d272 (patch)
treeb271658bffa08f9ae15e7df95bac8a48929e4d65 /src
parentae2231600ef50c704c8708e2a5147b7eaeba490e (diff)
Cosmetics
Diffstat (limited to 'src')
-rw-r--r--src/AudioRenderer.cpp10
-rw-r--r--src/DeviceManager.cpp34
-rw-r--r--src/DeviceManager.h2
-rw-r--r--src/MyFilter.cpp4
-rw-r--r--src/MyPropertyPage.cpp18
-rw-r--r--src/MyPropertyPage.h2
6 files changed, 35 insertions, 35 deletions
diff --git a/src/AudioRenderer.cpp b/src/AudioRenderer.cpp
index c77fa32..43b32e4 100644
--- a/src/AudioRenderer.cpp
+++ b/src/AudioRenderer.cpp
@@ -256,7 +256,7 @@ namespace SaneAudioRenderer
const auto previous = actual;
actual = llMulDiv(deviceClockPosition, OneSecond, deviceClockFrequency, 0);
- target = llMulDiv(m_pushedFrames, OneSecond, m_device.format->nSamplesPerSec, 0);
+ target = llMulDiv(m_pushedFrames, OneSecond, m_device.waveFormat->nSamplesPerSec, 0);
if (actual == target)
return true;
@@ -603,9 +603,9 @@ namespace SaneAudioRenderer
const auto inRate = m_inputFormat->nSamplesPerSec;
const auto inChannels = m_inputFormat->nChannels;
const auto inMask = DspMatrix::GetChannelMask(*m_inputFormat);
- const auto outRate = m_device.format->nSamplesPerSec;
- const auto outChannels = m_device.format->nChannels;
- const auto outMask = DspMatrix::GetChannelMask(*m_device.format);
+ const auto outRate = m_device.waveFormat->nSamplesPerSec;
+ const auto outChannels = m_device.waveFormat->nChannels;
+ const auto outMask = DspMatrix::GetChannelMask(*m_device.waveFormat);
m_dspMatrix.Initialize(inChannels, inMask, outChannels, outMask);
m_dspRate.Initialize(m_externalClock, inRate, outRate, outChannels);
@@ -656,7 +656,7 @@ namespace SaneAudioRenderer
// Write frames to the device buffer.
BYTE* deviceBuffer;
ThrowIfFailed(m_device.audioRenderClient->GetBuffer(doFrames, &deviceBuffer));
- assert(frameSize == (m_device.format->wBitsPerSample / 8 * m_device.format->nChannels));
+ assert(frameSize == (m_device.waveFormat->wBitsPerSample / 8 * m_device.waveFormat->nChannels));
memcpy(deviceBuffer, chunk.GetConstData() + doneFrames * frameSize, doFrames * frameSize);
ThrowIfFailed(m_device.audioRenderClient->ReleaseBuffer(doFrames, 0));
diff --git a/src/DeviceManager.cpp b/src/DeviceManager.cpp
index e498299..0a9d71b 100644
--- a/src/DeviceManager.cpp
+++ b/src/DeviceManager.cpp
@@ -24,8 +24,8 @@ namespace SaneAudioRenderer
return ret;
}
- WAVEFORMATEXTENSIBLE BuildFormat(GUID formatGuid, uint32_t formatBits, WORD formatExtProps,
- uint32_t rate, uint32_t channelCount, DWORD channelMask)
+ WAVEFORMATEXTENSIBLE BuildWaveFormatExt(GUID formatGuid, uint32_t formatBits, WORD formatExtProps,
+ uint32_t rate, uint32_t channelCount, DWORD channelMask)
{
WAVEFORMATEXTENSIBLE ret;
ret.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
@@ -260,7 +260,7 @@ namespace SaneAudioRenderer
return 1;
m_device.dspFormat = DspFormat::Unknown;
- m_device.format = m_createDeviceFormat;
+ m_device.waveFormat = m_createDeviceFormat;
}
else if (m_device.exclusive)
{
@@ -271,17 +271,17 @@ namespace SaneAudioRenderer
auto mixMask = DspMatrix::GetChannelMask(*mixFormat);
auto priorities = make_array(
- BuildFormat(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, inputRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 32, 32, inputRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 24, 24, inputRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 32, 24, inputRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 16, 16, inputRate, mixChannels, mixMask),
-
- BuildFormat(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, mixRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 32, 32, mixRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 24, 24, mixRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 32, 24, mixRate, mixChannels, mixMask),
- BuildFormat(KSDATAFORMAT_SUBTYPE_PCM, 16, 16, mixRate, mixChannels, mixMask)
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, inputRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 32, 32, inputRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 24, 24, inputRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 32, 24, inputRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 16, 16, inputRate, mixChannels, mixMask),
+
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, mixRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 32, 32, mixRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 24, 24, mixRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 32, 24, mixRate, mixChannels, mixMask),
+ BuildWaveFormatExt(KSDATAFORMAT_SUBTYPE_PCM, 16, 16, mixRate, mixChannels, mixMask)
);
for (const auto& f : priorities)
@@ -291,7 +291,7 @@ namespace SaneAudioRenderer
if (SUCCEEDED(m_device.audioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, &f.Format, nullptr)))
{
m_device.dspFormat = DspFormatFromWaveFormat(f.Format);
- m_device.format = CopyWaveFormat(f.Format);
+ m_device.waveFormat = CopyWaveFormat(f.Format);
break;
}
}
@@ -300,12 +300,12 @@ namespace SaneAudioRenderer
{
// Shared.
m_device.dspFormat = DspFormat::Float;
- m_device.format = mixFormat;
+ m_device.waveFormat = mixFormat;
}
ThrowIfFailed(m_device.audioClient->Initialize(m_device.exclusive ? AUDCLNT_SHAREMODE_EXCLUSIVE : AUDCLNT_SHAREMODE_SHARED,
0, MILLISECONDS_TO_100NS_UNITS(m_device.bufferDuration),
- 0, &(*m_device.format), nullptr));
+ 0, &(*m_device.waveFormat), nullptr));
ThrowIfFailed(m_device.audioClient->GetService(IID_PPV_ARGS(&m_device.audioRenderClient)));
diff --git a/src/DeviceManager.h b/src/DeviceManager.h
index fad38d6..a98ae2a 100644
--- a/src/DeviceManager.h
+++ b/src/DeviceManager.h
@@ -12,7 +12,7 @@ namespace SaneAudioRenderer
std::shared_ptr<const std::wstring> endpointName;
UINT32 settingsSerial;
IAudioClientPtr audioClient;
- SharedWaveFormat format;
+ SharedWaveFormat waveFormat;
uint32_t bufferDuration;
IAudioRenderClientPtr audioRenderClient;
IAudioClockPtr audioClock;
diff --git a/src/MyFilter.cpp b/src/MyFilter.cpp
index 7f5462f..6c20739 100644
--- a/src/MyFilter.cpp
+++ b/src/MyFilter.cpp
@@ -147,9 +147,9 @@ namespace SaneAudioRenderer
CAutoLock rendererLock(m_renderer.get());
auto inputFormat = m_renderer->GetInputFormat();
- auto deviceFormat = m_renderer->GetDeviceFormat();
+ auto audioDevice = m_renderer->GetDeviceFormat();
- pPage = new MyPropertyPage(inputFormat, deviceFormat.get(),
+ pPage = new MyPropertyPage(inputFormat, audioDevice.get(),
m_renderer->GetActiveProcessors(), m_renderer->OnExternalClock());
}
catch (std::bad_alloc&)
diff --git a/src/MyPropertyPage.cpp b/src/MyPropertyPage.cpp
index 0b4404c..1f2ae2b 100644
--- a/src/MyPropertyPage.cpp
+++ b/src/MyPropertyPage.cpp
@@ -120,17 +120,17 @@ namespace SaneAudioRenderer
}
}
- MyPropertyPage::MyPropertyPage(SharedWaveFormat inputFormat, const AudioDevice* pDeviceFormat,
+ MyPropertyPage::MyPropertyPage(SharedWaveFormat inputFormat, const AudioDevice* pAudioDevice,
std::vector<std::wstring> processors, bool externalClock)
: CUnknown(L"SaneAudioRenderer::MyPropertyPage", nullptr)
{
- std::wstring adapterField = (pDeviceFormat && pDeviceFormat->adapterName) ? *pDeviceFormat->adapterName : L"-";
+ std::wstring adapterField = (pAudioDevice && pAudioDevice->adapterName) ? *pAudioDevice->adapterName : L"-";
- std::wstring endpointField = (pDeviceFormat && pDeviceFormat->endpointName) ? *pDeviceFormat->endpointName : L"-";
+ std::wstring endpointField = (pAudioDevice && pAudioDevice->endpointName) ? *pAudioDevice->endpointName : L"-";
- std::wstring exclusiveField = (pDeviceFormat ? (pDeviceFormat->exclusive ? L"Yes" : L"No") : L"-");
+ std::wstring exclusiveField = (pAudioDevice ? (pAudioDevice->exclusive ? L"Yes" : L"No") : L"-");
- std::wstring bufferField = (pDeviceFormat ? std::to_wstring(pDeviceFormat->bufferDuration) + L"ms" : L"-");
+ std::wstring bufferField = (pAudioDevice ? std::to_wstring(pAudioDevice->bufferDuration) + L"ms" : L"-");
std::wstring bitstreamingField = (inputFormat ? (DspFormatFromWaveFormat(*inputFormat) ==
DspFormat::Unknown ? L"Yes" : L"No") : L"-");
@@ -139,18 +139,18 @@ namespace SaneAudioRenderer
std::wstring channelsInputField = (inputFormat ? std::to_wstring(inputFormat->nChannels) +
L" (" + GetHexString(DspMatrix::GetChannelMask(*inputFormat)) + L")" : L"-");
- std::wstring channelsDeviceField = (pDeviceFormat ? std::to_wstring(pDeviceFormat->format->nChannels) +
- L" (" + GetHexString(DspMatrix::GetChannelMask(*pDeviceFormat->format)) + L")" : L"-");
+ std::wstring channelsDeviceField = (pAudioDevice ? std::to_wstring(pAudioDevice->waveFormat->nChannels) +
+ L" (" + GetHexString(DspMatrix::GetChannelMask(*pAudioDevice->waveFormat)) + L")" : L"-");
std::wstring channelsField = (channelsInputField == channelsDeviceField) ?
channelsInputField : channelsInputField + L" -> " + channelsDeviceField;
std::wstring formatInputField = (inputFormat ? GetFormatString(*inputFormat) : L"-");
- std::wstring formatDeviceField = (pDeviceFormat ? GetFormatString(*pDeviceFormat->format) : L"-");
+ std::wstring formatDeviceField = (pAudioDevice ? GetFormatString(*pAudioDevice->waveFormat) : L"-");
std::wstring formatField = (formatInputField == formatDeviceField) ?
formatInputField : formatInputField + L" -> " + formatDeviceField;
std::wstring rateInputField = (inputFormat ? std::to_wstring(inputFormat->nSamplesPerSec) : L"-");
- std::wstring rateDeviceField = (pDeviceFormat ? std::to_wstring(pDeviceFormat->format->nSamplesPerSec) : L"-");
+ std::wstring rateDeviceField = (pAudioDevice ? std::to_wstring(pAudioDevice->waveFormat->nSamplesPerSec) : L"-");
std::wstring rateField = (rateInputField == rateDeviceField) ?
rateInputField : rateInputField + L" -> " + rateDeviceField;
diff --git a/src/MyPropertyPage.h b/src/MyPropertyPage.h
index ec7e518..73f885e 100644
--- a/src/MyPropertyPage.h
+++ b/src/MyPropertyPage.h
@@ -11,7 +11,7 @@ namespace SaneAudioRenderer
{
public:
- MyPropertyPage(SharedWaveFormat inputFormat, const AudioDevice* pDeviceFormat,
+ MyPropertyPage(SharedWaveFormat inputFormat, const AudioDevice* pAudioDevice,
std::vector<std::wstring> processors, bool externalClock);
MyPropertyPage(const MyPropertyPage&) = delete;
MyPropertyPage& operator=(const MyPropertyPage&) = delete;