aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/OSXOutputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-03 21:00:50 +0200
committerMax Kellermann <max@duempel.org>2013-08-03 21:37:56 +0200
commitd1e7b4e38136f9342aad76c685a13adf0e69f869 (patch)
tree49643b937ddfe735511b566a71398da5a945d7aa /src/output/OSXOutputPlugin.cxx
parent67f591a9ce60651da41afc499bd9a22e25314e35 (diff)
downloadmpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip
audio_format: convert to C++
Diffstat (limited to 'src/output/OSXOutputPlugin.cxx')
-rw-r--r--src/output/OSXOutputPlugin.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/output/OSXOutputPlugin.cxx b/src/output/OSXOutputPlugin.cxx
index cbd27413f..afe8e064d 100644
--- a/src/output/OSXOutputPlugin.cxx
+++ b/src/output/OSXOutputPlugin.cxx
@@ -316,30 +316,30 @@ osx_output_close(struct audio_output *ao)
}
static bool
-osx_output_open(struct audio_output *ao, struct audio_format *audio_format, GError **error)
+osx_output_open(struct audio_output *ao, AudioFormat &audio_format, GError **error)
{
OSXOutput *od = (OSXOutput *)ao;
AudioStreamBasicDescription stream_description;
- stream_description.mSampleRate = audio_format->sample_rate;
+ stream_description.mSampleRate = audio_format.sample_rate;
stream_description.mFormatID = kAudioFormatLinearPCM;
stream_description.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
- switch (audio_format->format) {
- case SAMPLE_FORMAT_S8:
+ switch (audio_format.format) {
+ case SampleFormat::S8:
stream_description.mBitsPerChannel = 8;
break;
- case SAMPLE_FORMAT_S16:
+ case SampleFormat::S16:
stream_description.mBitsPerChannel = 16;
break;
- case SAMPLE_FORMAT_S32:
+ case SampleFormat::S32:
stream_description.mBitsPerChannel = 32;
break;
default:
- audio_format->format = SAMPLE_FORMAT_S32;
+ audio_format.format = SampleFormat::S32;
stream_description.mBitsPerChannel = 32;
break;
}
@@ -348,11 +348,10 @@ osx_output_open(struct audio_output *ao, struct audio_format *audio_format, GErr
stream_description.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
#endif
- stream_description.mBytesPerPacket =
- audio_format_frame_size(audio_format);
+ stream_description.mBytesPerPacket = audio_format.GetFrameSize();
stream_description.mFramesPerPacket = 1;
stream_description.mBytesPerFrame = stream_description.mBytesPerPacket;
- stream_description.mChannelsPerFrame = audio_format->channels;
+ stream_description.mChannelsPerFrame = audio_format.channels;
ComponentResult result =
AudioUnitSetProperty(od->au, kAudioUnitProperty_StreamFormat,
@@ -374,8 +373,8 @@ osx_output_open(struct audio_output *ao, struct audio_format *audio_format, GErr
}
/* create a buffer of 1s */
- od->buffer = fifo_buffer_new(audio_format->sample_rate *
- audio_format_frame_size(audio_format));
+ od->buffer = fifo_buffer_new(audio_format.sample_rate *
+ audio_format.GetFrameSize());
status = AudioOutputUnitStart(od->au);
if (status != 0) {