diff options
author | Max Kellermann <max@duempel.org> | 2013-08-03 21:00:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-03 21:37:56 +0200 |
commit | d1e7b4e38136f9342aad76c685a13adf0e69f869 (patch) | |
tree | 49643b937ddfe735511b566a71398da5a945d7aa /src/output/WinmmOutputPlugin.cxx | |
parent | 67f591a9ce60651da41afc499bd9a22e25314e35 (diff) | |
download | mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip |
audio_format: convert to C++
Diffstat (limited to '')
-rw-r--r-- | src/output/WinmmOutputPlugin.cxx | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/output/WinmmOutputPlugin.cxx b/src/output/WinmmOutputPlugin.cxx index 2418731a0..de6927bd2 100644 --- a/src/output/WinmmOutputPlugin.cxx +++ b/src/output/WinmmOutputPlugin.cxx @@ -142,7 +142,7 @@ winmm_output_finish(struct audio_output *ao) } static bool -winmm_output_open(struct audio_output *ao, struct audio_format *audio_format, +winmm_output_open(struct audio_output *ao, AudioFormat &audio_format, GError **error_r) { WinmmOutput *wo = (WinmmOutput *)ao; @@ -154,30 +154,32 @@ winmm_output_open(struct audio_output *ao, struct audio_format *audio_format, return false; } - switch (audio_format->format) { - case SAMPLE_FORMAT_S8: - case SAMPLE_FORMAT_S16: + switch (audio_format.format) { + case SampleFormat::S8: + case SampleFormat::S16: break; - case SAMPLE_FORMAT_S24_P32: - case SAMPLE_FORMAT_S32: - case SAMPLE_FORMAT_UNDEFINED: + case SampleFormat::S24_P32: + case SampleFormat::S32: + case SampleFormat::FLOAT: + case SampleFormat::DSD: + case SampleFormat::UNDEFINED: /* we havn't tested formats other than S16 */ - audio_format->format = SAMPLE_FORMAT_S16; + audio_format.format = SampleFormat::S16; break; } - if (audio_format->channels > 2) + if (audio_format.channels > 2) /* same here: more than stereo was not tested */ - audio_format->channels = 2; + audio_format.channels = 2; WAVEFORMATEX format; format.wFormatTag = WAVE_FORMAT_PCM; - format.nChannels = audio_format->channels; - format.nSamplesPerSec = audio_format->sample_rate; - format.nBlockAlign = audio_format_frame_size(audio_format); + format.nChannels = audio_format.channels; + format.nSamplesPerSec = audio_format.sample_rate; + format.nBlockAlign = audio_format.GetFrameSize(); format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; - format.wBitsPerSample = audio_format_sample_size(audio_format) * 8; + format.wBitsPerSample = audio_format.GetSampleSize() * 8; format.cbSize = 0; MMRESULT result = waveOutOpen(&wo->handle, wo->device_id, &format, |