mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-11 16:25:37 -04:00
Add method to check if two AudioSpecs are equal
This commit is contained in:
parent
7ebd613d01
commit
646380520f
@ -56,6 +56,8 @@ public:
|
||||
|
||||
void MergeChanges(const SDL_AudioSpec& obtained);
|
||||
const SDL_AudioSpec* Get() const;
|
||||
|
||||
bool IsSameFormat(const AudioSpec& other) const;
|
||||
};
|
||||
|
||||
class AudioDevice {
|
||||
|
@ -75,4 +75,8 @@ const SDL_AudioSpec* AudioSpec::Get() const {
|
||||
return static_cast<const SDL_AudioSpec*>(this);
|
||||
}
|
||||
|
||||
bool AudioSpec::IsSameFormat(const AudioSpec& other) const {
|
||||
return freq == other.freq && format == other.format && channels == other.channels;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user