diff options
author | Max Kellermann <max@musicpd.org> | 2016-11-10 11:45:17 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-11-10 12:55:08 +0100 |
commit | cfd51db2292aa9ff0b33d2a7ac50a78cafec6015 (patch) | |
tree | 4026d81758898f259622d5cce49f8b052237eaff /src/CheckAudioFormat.hxx | |
parent | 12f11c97ae9e5b1b6367e4a5c49713fdd4984b89 (diff) |
CheckAudioFormat: migrate from class Error to C++ exceptions
Diffstat (limited to 'src/CheckAudioFormat.hxx')
-rw-r--r-- | src/CheckAudioFormat.hxx | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/CheckAudioFormat.hxx b/src/CheckAudioFormat.hxx index b155b0760..05cd5ad08 100644 --- a/src/CheckAudioFormat.hxx +++ b/src/CheckAudioFormat.hxx @@ -22,25 +22,23 @@ #include "AudioFormat.hxx" -class Error; +void +CheckSampleRate(unsigned long sample_rate); -extern const class Domain audio_format_domain; +void +CheckSampleFormat(SampleFormat sample_format); -bool -audio_check_sample_rate(unsigned long sample_rate, Error &error); - -bool -audio_check_sample_format(SampleFormat sample_format, Error &error); - -bool -audio_check_channel_count(unsigned sample_format, Error &error); +void +CheckChannelCount(unsigned sample_format); /** - * Wrapper for audio_format_init(), which checks all attributes. + * Check #AudioFormat attributes and construct an #AudioFormat + * instance. + * + * Throws #std::runtime_error on error. */ -bool -audio_format_init_checked(AudioFormat &af, unsigned long sample_rate, - SampleFormat sample_format, unsigned channels, - Error &error); +AudioFormat +CheckAudioFormat(unsigned long sample_rate, + SampleFormat sample_format, unsigned channels); #endif |