diff options
author | Max Kellermann <max@musicpd.org> | 2016-12-13 20:55:48 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-12-13 20:57:46 +0100 |
commit | 6c818bb37a55ca44cb6241a29a836332191b476c (patch) | |
tree | b1ab99c8facf39c4e4ed1fab5c45a7d62b326356 /src/AudioFormat.hxx | |
parent | 8cb160b1f844b5eb847367a5d9059a037cabaa52 (diff) |
AudioFormat: add method WithMask(), shortcut for ApplyMask()
Diffstat (limited to 'src/AudioFormat.hxx')
-rw-r--r-- | src/AudioFormat.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/AudioFormat.hxx b/src/AudioFormat.hxx index 891056338..37d806af1 100644 --- a/src/AudioFormat.hxx +++ b/src/AudioFormat.hxx @@ -159,6 +159,13 @@ struct AudioFormat { void ApplyMask(AudioFormat mask); + gcc_pure + AudioFormat WithMask(AudioFormat mask) const { + AudioFormat result = *this; + result.ApplyMask(mask); + return result; + } + /** * Returns the size of each (mono) sample in bytes. */ |