filter/Filter: add "noexcept"
This commit is contained in:
parent
3bb9c704de
commit
e387d94ff1
|
@ -30,25 +30,25 @@ class Filter {
|
|||
protected:
|
||||
AudioFormat out_audio_format;
|
||||
|
||||
explicit Filter(AudioFormat _out_audio_format)
|
||||
explicit Filter(AudioFormat _out_audio_format) noexcept
|
||||
:out_audio_format(_out_audio_format) {
|
||||
assert(out_audio_format.IsValid());
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~Filter() {}
|
||||
virtual ~Filter() noexcept {}
|
||||
|
||||
/**
|
||||
* Returns the #AudioFormat produced by FilterPCM().
|
||||
*/
|
||||
const AudioFormat &GetOutAudioFormat() const {
|
||||
const AudioFormat &GetOutAudioFormat() const noexcept {
|
||||
return out_audio_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the filter's state, e.g. drop/flush buffers.
|
||||
*/
|
||||
virtual void Reset() {
|
||||
virtual void Reset() noexcept {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
:Filter(_filter->GetOutAudioFormat()),
|
||||
filter(std::move(_filter)), convert(std::move(_convert)) {}
|
||||
|
||||
void Reset() override {
|
||||
void Reset() noexcept override {
|
||||
filter->Reset();
|
||||
|
||||
if (convert)
|
||||
|
|
|
@ -36,7 +36,8 @@ class ChainFilter final : public Filter {
|
|||
const char *name;
|
||||
std::unique_ptr<Filter> filter;
|
||||
|
||||
Child(const char *_name, std::unique_ptr<Filter> _filter)
|
||||
Child(const char *_name,
|
||||
std::unique_ptr<Filter> _filter) noexcept
|
||||
:name(_name), filter(std::move(_filter)) {}
|
||||
};
|
||||
|
||||
|
@ -46,7 +47,8 @@ public:
|
|||
explicit ChainFilter(AudioFormat _audio_format)
|
||||
:Filter(_audio_format) {}
|
||||
|
||||
void Append(const char *name, std::unique_ptr<Filter> filter) {
|
||||
void Append(const char *name,
|
||||
std::unique_ptr<Filter> filter) noexcept {
|
||||
assert(out_audio_format.IsValid());
|
||||
out_audio_format = filter->GetOutAudioFormat();
|
||||
assert(out_audio_format.IsValid());
|
||||
|
@ -55,7 +57,7 @@ public:
|
|||
}
|
||||
|
||||
/* virtual methods from class Filter */
|
||||
void Reset() override;
|
||||
void Reset() noexcept override;
|
||||
ConstBuffer<void> FilterPCM(ConstBuffer<void> src) override;
|
||||
};
|
||||
|
||||
|
@ -114,7 +116,7 @@ PreparedChainFilter::Open(AudioFormat &in_audio_format)
|
|||
}
|
||||
|
||||
void
|
||||
ChainFilter::Reset()
|
||||
ChainFilter::Reset() noexcept
|
||||
{
|
||||
for (auto &child : children)
|
||||
child.filter->Reset();
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
void Set(const AudioFormat &_out_audio_format);
|
||||
|
||||
void Reset() override {
|
||||
void Reset() noexcept override {
|
||||
state.Reset();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue