summaryrefslogtreecommitdiff
path: root/src/CheckAudioFormat.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/CheckAudioFormat.cxx
parent67f591a9ce60651da41afc499bd9a22e25314e35 (diff)
audio_format: convert to C++
Diffstat (limited to 'src/CheckAudioFormat.cxx')
-rw-r--r--src/CheckAudioFormat.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/CheckAudioFormat.cxx b/src/CheckAudioFormat.cxx
index 6d484be19..fabffd56c 100644
--- a/src/CheckAudioFormat.cxx
+++ b/src/CheckAudioFormat.cxx
@@ -18,7 +18,7 @@
*/
#include "CheckAudioFormat.hxx"
-#include "audio_format.h"
+#include "AudioFormat.hxx"
#include <assert.h>
@@ -35,11 +35,12 @@ audio_check_sample_rate(unsigned long sample_rate, GError **error_r)
}
bool
-audio_check_sample_format(enum sample_format sample_format, GError **error_r)
+audio_check_sample_format(SampleFormat sample_format, GError **error_r)
{
if (!audio_valid_sample_format(sample_format)) {
g_set_error(error_r, audio_format_quark(), 0,
- "Invalid sample format: %u", sample_format);
+ "Invalid sample format: %u",
+ unsigned(sample_format));
return false;
}
@@ -59,15 +60,15 @@ audio_check_channel_count(unsigned channels, GError **error_r)
}
bool
-audio_format_init_checked(struct audio_format *af, unsigned long sample_rate,
- enum sample_format sample_format, unsigned channels,
+audio_format_init_checked(AudioFormat &af, unsigned long sample_rate,
+ SampleFormat sample_format, unsigned channels,
GError **error_r)
{
if (audio_check_sample_rate(sample_rate, error_r) &&
audio_check_sample_format(sample_format, error_r) &&
audio_check_channel_count(channels, error_r)) {
- audio_format_init(af, sample_rate, sample_format, channels);
- assert(audio_format_valid(af));
+ af = AudioFormat(sample_rate, sample_format, channels);
+ assert(af.IsValid());
return true;
} else
return false;