1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 05:37:44 +00:00

Everywhere: rename 'Sample' type to 'Frame'

Because it's what it really is. A frame is composed of 1 or more samples, in
the case of SerenityOS 2 (stereo). This will make it less confusing for
future mantainability.
This commit is contained in:
Cesar Torres 2021-03-19 22:15:54 +01:00 committed by Andreas Kling
parent f4bd095aa3
commit 0d5e1e9df1
7 changed files with 36 additions and 36 deletions

View file

@ -86,8 +86,8 @@ void Mixer::mix()
active_mix_queues.remove_all_matching([&](auto& entry) { return !entry->client(); });
Audio::Sample mixed_buffer[1024];
auto mixed_buffer_length = (int)(sizeof(mixed_buffer) / sizeof(Audio::Sample));
Audio::Frame mixed_buffer[1024];
auto mixed_buffer_length = (int)(sizeof(mixed_buffer) / sizeof(Audio::Frame));
// Mix the buffers together into the output
for (auto& queue : active_mix_queues) {
@ -98,7 +98,7 @@ void Mixer::mix()
for (int i = 0; i < mixed_buffer_length; ++i) {
auto& mixed_sample = mixed_buffer[i];
Audio::Sample sample;
Audio::Frame sample;
if (!queue->get_next_sample(sample))
break;
mixed_sample += sample;

View file

@ -51,7 +51,7 @@ public:
bool is_full() const { return m_queue.size() >= 3; }
void enqueue(NonnullRefPtr<Audio::Buffer>&&);
bool get_next_sample(Audio::Sample& sample)
bool get_next_sample(Audio::Frame& sample)
{
if (m_paused)
return false;