mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:37:34 +00:00
LibAudio+Userland: Remove Audio::LegacyBuffer
The file is now renamed to Queue.h, and the Resampler APIs with LegacyBuffer are also removed. These changes look large because nobody actually needs Buffer.h (or Queue.h). It was mostly transitive dependencies on the massive list of includes in that header, which are now almost all gone. Instead, we include common things like Sample.h directly, which should give faster compile times as very few files actually need Queue.h.
This commit is contained in:
parent
f14a71eb34
commit
ab49fcfb7c
27 changed files with 39 additions and 297 deletions
21
Userland/Libraries/LibAudio/Queue.h
Normal file
21
Userland/Libraries/LibAudio/Queue.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibAudio/Sample.h>
|
||||
#include <LibCore/SharedCircularQueue.h>
|
||||
|
||||
namespace Audio {
|
||||
|
||||
static constexpr size_t AUDIO_BUFFERS_COUNT = 128;
|
||||
// The audio buffer size is specifically chosen to be about 1/1000th of a second (1ms).
|
||||
// This has the biggest impact on latency and performance.
|
||||
// The currently chosen value was not put here with much thought and a better choice is surely possible.
|
||||
static constexpr size_t AUDIO_BUFFER_SIZE = 50;
|
||||
using AudioQueue = Core::SharedSingleProducerCircularQueue<Array<Sample, AUDIO_BUFFER_SIZE>, AUDIO_BUFFERS_COUNT>;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue