AudioFormat: add method WithMask(), shortcut for ApplyMask()

This commit is contained in:
Max Kellermann
2016-12-13 20:55:48 +01:00
parent 8cb160b1f8
commit 6c818bb37a
4 changed files with 11 additions and 6 deletions

View File

@@ -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.
*/