mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:57:46 +00:00
LibAudio: Add a formatter for Audio::Sample
Useful for debugging.
This commit is contained in:
parent
50cf4e6e64
commit
ae0ca35541
1 changed files with 13 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <AK/Math.h>
|
||||
|
||||
namespace Audio {
|
||||
|
@ -146,3 +147,15 @@ struct Sample {
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Formatter<Audio::Sample> : Formatter<FormatString> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Audio::Sample const& value)
|
||||
{
|
||||
return Formatter<FormatString>::format(builder, "[{}, {}]", value.left, value.right);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue