mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibAudio: Add a formatter for Audio::Sample
Useful for debugging.
This commit is contained in:
parent
50cf4e6e64
commit
ae0ca35541
Notes:
sideshowbarker
2024-07-17 11:28:23 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/ae0ca35541 Pull-request: https://github.com/SerenityOS/serenity/pull/13820 Reviewed-by: https://github.com/kennethmyhra ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
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
Reference in a new issue