From 967d81b78230ddb093820e775d73bc403c85f2f2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Nov 2017 23:05:48 +0100 Subject: [PATCH] AudioFormat: add method MatchMask() --- src/AudioFormat.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AudioFormat.hxx b/src/AudioFormat.hxx index 77e710f55..4de0ad1c7 100644 --- a/src/AudioFormat.hxx +++ b/src/AudioFormat.hxx @@ -133,6 +133,11 @@ struct AudioFormat { return result; } + gcc_pure + bool MatchMask(AudioFormat mask) const noexcept { + return WithMask(mask) == *this; + } + /** * Returns the size of each (mono) sample in bytes. */