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 /test/run_convert.cxx | |
parent | 67f591a9ce60651da41afc499bd9a22e25314e35 (diff) |
audio_format: convert to C++
Diffstat (limited to 'test/run_convert.cxx')
-rw-r--r-- | test/run_convert.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/run_convert.cxx b/test/run_convert.cxx index 2b0214912..ce7df42c3 100644 --- a/test/run_convert.cxx +++ b/test/run_convert.cxx @@ -25,7 +25,7 @@ #include "config.h" #include "AudioParser.hxx" -#include "audio_format.h" +#include "AudioFormat.hxx" #include "pcm/PcmConvert.hxx" #include "conf.h" #include "util/fifo_buffer.h" @@ -57,7 +57,7 @@ config_get_string(gcc_unused enum ConfigOption option, int main(int argc, char **argv) { GError *error = NULL; - struct audio_format in_audio_format, out_audio_format; + AudioFormat in_audio_format, out_audio_format; const void *output; ssize_t nbytes; size_t length; @@ -69,15 +69,15 @@ int main(int argc, char **argv) g_log_set_default_handler(my_log_func, NULL); - if (!audio_format_parse(&in_audio_format, argv[1], + if (!audio_format_parse(in_audio_format, argv[1], false, &error)) { g_printerr("Failed to parse audio format: %s\n", error->message); return 1; } - struct audio_format out_audio_format_mask; - if (!audio_format_parse(&out_audio_format_mask, argv[2], + AudioFormat out_audio_format_mask; + if (!audio_format_parse(out_audio_format_mask, argv[2], true, &error)) { g_printerr("Failed to parse audio format: %s\n", error->message); @@ -85,9 +85,9 @@ int main(int argc, char **argv) } out_audio_format = in_audio_format; - audio_format_mask_apply(&out_audio_format, &out_audio_format_mask); + out_audio_format.ApplyMask(out_audio_format_mask); - const size_t in_frame_size = audio_format_frame_size(&in_audio_format); + const size_t in_frame_size = in_audio_format.GetFrameSize(); PcmConvert state; @@ -112,8 +112,8 @@ int main(int argc, char **argv) fifo_buffer_consume(buffer, length); - output = state.Convert(&in_audio_format, src, length, - &out_audio_format, &length, &error); + output = state.Convert(in_audio_format, src, length, + out_audio_format, &length, &error); if (output == NULL) { g_printerr("Failed to convert: %s\n", error->message); return 2; |