summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Applications/Piano/AudioPlayerLoop.cpp8
-rw-r--r--Userland/Applications/SoundPlayer/PlaybackManager.h6
-rw-r--r--Userland/Applications/SoundPlayer/Player.h2
-rw-r--r--Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp2
-rw-r--r--Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h2
-rw-r--r--Userland/Applications/SoundPlayer/VisualizationWidget.h2
-rw-r--r--Userland/Libraries/LibAudio/Buffer.cpp8
-rw-r--r--Userland/Libraries/LibAudio/Buffer.h26
-rw-r--r--Userland/Libraries/LibAudio/ConnectionFromClient.cpp6
-rw-r--r--Userland/Libraries/LibAudio/ConnectionFromClient.h8
-rw-r--r--Userland/Libraries/LibAudio/FlacLoader.cpp4
-rw-r--r--Userland/Libraries/LibAudio/Loader.h2
-rw-r--r--Userland/Libraries/LibAudio/MP3Loader.cpp4
-rw-r--r--Userland/Libraries/LibAudio/Resampler.cpp4
-rw-r--r--Userland/Libraries/LibAudio/Resampler.h4
-rw-r--r--Userland/Libraries/LibAudio/WavLoader.cpp4
-rw-r--r--Userland/Libraries/LibAudio/WavLoader.h4
-rw-r--r--Userland/Services/AudioServer/ConnectionFromClient.cpp2
-rw-r--r--Userland/Services/AudioServer/ConnectionFromClient.h2
-rw-r--r--Userland/Services/AudioServer/Mixer.cpp2
-rw-r--r--Userland/Services/AudioServer/Mixer.h6
21 files changed, 54 insertions, 54 deletions
diff --git a/Userland/Applications/Piano/AudioPlayerLoop.cpp b/Userland/Applications/Piano/AudioPlayerLoop.cpp
index 387a9f9622..390dd21e0d 100644
--- a/Userland/Applications/Piano/AudioPlayerLoop.cpp
+++ b/Userland/Applications/Piano/AudioPlayerLoop.cpp
@@ -9,8 +9,8 @@
#include "TrackManager.h"
-// Converts Piano-internal data to an Audio::Buffer that AudioServer receives
-static NonnullRefPtr<Audio::Buffer> music_samples_to_buffer(Array<Sample, sample_count> samples)
+// Converts Piano-internal data to an Audio::LegacyBuffer that AudioServer receives
+static NonnullRefPtr<Audio::LegacyBuffer> music_samples_to_buffer(Array<Sample, sample_count> samples)
{
Vector<Audio::Sample, sample_count> frames;
frames.ensure_capacity(sample_count);
@@ -19,7 +19,7 @@ static NonnullRefPtr<Audio::Buffer> music_samples_to_buffer(Array<Sample, sample
frames.unchecked_append(frame);
}
// FIXME: Handle OOM better.
- return MUST(Audio::Buffer::create_with_samples(frames));
+ return MUST(Audio::LegacyBuffer::create_with_samples(frames));
}
AudioPlayerLoop::AudioPlayerLoop(TrackManager& track_manager, bool& need_to_write_wav, Audio::WavWriter& wav_writer)
@@ -42,7 +42,7 @@ AudioPlayerLoop::AudioPlayerLoop(TrackManager& track_manager, bool& need_to_writ
void AudioPlayerLoop::enqueue_audio()
{
m_track_manager.fill_buffer(m_buffer);
- NonnullRefPtr<Audio::Buffer> audio_buffer = music_samples_to_buffer(m_buffer);
+ NonnullRefPtr<Audio::LegacyBuffer> audio_buffer = music_samples_to_buffer(m_buffer);
// FIXME: Handle OOM better.
audio_buffer = MUST(Audio::resample_buffer(m_resampler.value(), *audio_buffer));
m_audio_client->async_enqueue(audio_buffer);
diff --git a/Userland/Applications/SoundPlayer/PlaybackManager.h b/Userland/Applications/SoundPlayer/PlaybackManager.h
index e4fa03eef6..b5c6862064 100644
--- a/Userland/Applications/SoundPlayer/PlaybackManager.h
+++ b/Userland/Applications/SoundPlayer/PlaybackManager.h
@@ -32,12 +32,12 @@ public:
int last_seek() const { return m_last_seek; }
bool is_paused() const { return m_paused; }
float total_length() const { return m_total_length; }
- RefPtr<Audio::Buffer> current_buffer() const { return m_current_buffer; }
+ RefPtr<Audio::LegacyBuffer> current_buffer() const { return m_current_buffer; }
NonnullRefPtr<Audio::ConnectionFromClient> connection() const { return m_connection; }
Function<void()> on_update;
- Function<void(Audio::Buffer&)> on_load_sample_buffer;
+ Function<void(Audio::LegacyBuffer&)> on_load_sample_buffer;
Function<void()> on_finished_playing;
private:
@@ -56,7 +56,7 @@ private:
size_t m_source_buffer_size_bytes { 0 };
RefPtr<Audio::Loader> m_loader { nullptr };
NonnullRefPtr<Audio::ConnectionFromClient> m_connection;
- RefPtr<Audio::Buffer> m_current_buffer;
+ RefPtr<Audio::LegacyBuffer> m_current_buffer;
Queue<i32, always_enqueued_buffer_count + 1> m_enqueued_buffers;
Optional<Audio::ResampleHelper<double>> m_resampler;
RefPtr<Core::Timer> m_timer;
diff --git a/Userland/Applications/SoundPlayer/Player.h b/Userland/Applications/SoundPlayer/Player.h
index 86c199cf9d..6980f62e7e 100644
--- a/Userland/Applications/SoundPlayer/Player.h
+++ b/Userland/Applications/SoundPlayer/Player.h
@@ -72,7 +72,7 @@ public:
virtual void volume_changed(double) = 0;
virtual void mute_changed(bool) = 0;
virtual void total_samples_changed(int) = 0;
- virtual void sound_buffer_played(RefPtr<Audio::Buffer>, [[maybe_unused]] int sample_rate, [[maybe_unused]] int samples_played) = 0;
+ virtual void sound_buffer_played(RefPtr<Audio::LegacyBuffer>, [[maybe_unused]] int sample_rate, [[maybe_unused]] int samples_played) = 0;
protected:
void done_initializing()
diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp
index 0eabca66bd..f01d6c0a31 100644
--- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp
+++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp
@@ -216,7 +216,7 @@ void SoundPlayerWidgetAdvancedView::total_samples_changed(int total_samples)
m_playback_progress_slider->set_page_step(total_samples / 10);
}
-void SoundPlayerWidgetAdvancedView::sound_buffer_played(RefPtr<Audio::Buffer> buffer, int sample_rate, int samples_played)
+void SoundPlayerWidgetAdvancedView::sound_buffer_played(RefPtr<Audio::LegacyBuffer> buffer, int sample_rate, int samples_played)
{
m_visualization->set_buffer(buffer);
m_visualization->set_samplerate(sample_rate);
diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h
index 628d4a2f72..0701620b49 100644
--- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h
+++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h
@@ -46,7 +46,7 @@ public:
virtual void volume_changed(double) override;
virtual void mute_changed(bool) override;
virtual void total_samples_changed(int) override;
- virtual void sound_buffer_played(RefPtr<Audio::Buffer>, int sample_rate, int samples_played) override;
+ virtual void sound_buffer_played(RefPtr<Audio::LegacyBuffer>, int sample_rate, int samples_played) override;
protected:
void keydown_event(GUI::KeyEvent&) override;
diff --git a/Userland/Applications/SoundPlayer/VisualizationWidget.h b/Userland/Applications/SoundPlayer/VisualizationWidget.h
index e11f233ab9..d38f8f937b 100644
--- a/Userland/Applications/SoundPlayer/VisualizationWidget.h
+++ b/Userland/Applications/SoundPlayer/VisualizationWidget.h
@@ -18,7 +18,7 @@ class VisualizationWidget : public GUI::Frame {
public:
virtual void render(GUI::PaintEvent&, FixedArray<double> const& samples) = 0;
- void set_buffer(RefPtr<Audio::Buffer> buffer)
+ void set_buffer(RefPtr<Audio::LegacyBuffer> buffer)
{
if (buffer.is_null())
return;
diff --git a/Userland/Libraries/LibAudio/Buffer.cpp b/Userland/Libraries/LibAudio/Buffer.cpp
index 1152a6ade3..b313b500fe 100644
--- a/Userland/Libraries/LibAudio/Buffer.cpp
+++ b/Userland/Libraries/LibAudio/Buffer.cpp
@@ -13,7 +13,7 @@
namespace Audio {
-i32 Buffer::allocate_id()
+i32 LegacyBuffer::allocate_id()
{
static Atomic<i32> next_id;
return next_id++;
@@ -97,13 +97,13 @@ static double read_norm_sample_8(InputMemoryStream& stream)
return double(sample) / NumericLimits<u8>::max();
}
-ErrorOr<NonnullRefPtr<Buffer>> Buffer::from_pcm_data(ReadonlyBytes data, int num_channels, PcmSampleFormat sample_format)
+ErrorOr<NonnullRefPtr<LegacyBuffer>> LegacyBuffer::from_pcm_data(ReadonlyBytes data, int num_channels, PcmSampleFormat sample_format)
{
InputMemoryStream stream { data };
return from_pcm_stream(stream, num_channels, sample_format, data.size() / (pcm_bits_per_sample(sample_format) / 8));
}
-ErrorOr<NonnullRefPtr<Buffer>> Buffer::from_pcm_stream(InputMemoryStream& stream, int num_channels, PcmSampleFormat sample_format, int num_samples)
+ErrorOr<NonnullRefPtr<LegacyBuffer>> LegacyBuffer::from_pcm_stream(InputMemoryStream& stream, int num_channels, PcmSampleFormat sample_format, int num_samples)
{
Vector<Sample> fdata;
fdata.ensure_capacity(num_samples);
@@ -133,7 +133,7 @@ ErrorOr<NonnullRefPtr<Buffer>> Buffer::from_pcm_stream(InputMemoryStream& stream
// don't belong.
VERIFY(!stream.handle_any_error());
- return Buffer::create_with_samples(move(fdata));
+ return LegacyBuffer::create_with_samples(move(fdata));
}
}
diff --git a/Userland/Libraries/LibAudio/Buffer.h b/Userland/Libraries/LibAudio/Buffer.h
index cb05a06219..bf53291f45 100644
--- a/Userland/Libraries/LibAudio/Buffer.h
+++ b/Userland/Libraries/LibAudio/Buffer.h
@@ -28,23 +28,23 @@ namespace Audio {
using namespace AK::Exponentials;
// A buffer of audio samples.
-class Buffer : public RefCounted<Buffer> {
+class LegacyBuffer : public RefCounted<LegacyBuffer> {
public:
- static ErrorOr<NonnullRefPtr<Buffer>> from_pcm_data(ReadonlyBytes data, int num_channels, PcmSampleFormat sample_format);
- static ErrorOr<NonnullRefPtr<Buffer>> from_pcm_stream(InputMemoryStream& stream, int num_channels, PcmSampleFormat sample_format, int num_samples);
+ static ErrorOr<NonnullRefPtr<LegacyBuffer>> from_pcm_data(ReadonlyBytes data, int num_channels, PcmSampleFormat sample_format);
+ static ErrorOr<NonnullRefPtr<LegacyBuffer>> from_pcm_stream(InputMemoryStream& stream, int num_channels, PcmSampleFormat sample_format, int num_samples);
template<ArrayLike<Sample> ArrayT>
- static ErrorOr<NonnullRefPtr<Buffer>> create_with_samples(ArrayT&& samples)
+ static ErrorOr<NonnullRefPtr<LegacyBuffer>> create_with_samples(ArrayT&& samples)
{
- return adopt_nonnull_ref_or_enomem(new (nothrow) Buffer(move(samples)));
+ return adopt_nonnull_ref_or_enomem(new (nothrow) LegacyBuffer(move(samples)));
}
- static ErrorOr<NonnullRefPtr<Buffer>> create_with_anonymous_buffer(Core::AnonymousBuffer buffer, i32 buffer_id, int sample_count)
+ static ErrorOr<NonnullRefPtr<LegacyBuffer>> create_with_anonymous_buffer(Core::AnonymousBuffer buffer, i32 buffer_id, int sample_count)
{
- return adopt_nonnull_ref_or_enomem(new (nothrow) Buffer(move(buffer), buffer_id, sample_count));
+ return adopt_nonnull_ref_or_enomem(new (nothrow) LegacyBuffer(move(buffer), buffer_id, sample_count));
}
- static NonnullRefPtr<Buffer> create_empty()
+ static NonnullRefPtr<LegacyBuffer> create_empty()
{
// If we can't allocate an empty buffer, things are in a very bad state.
- return MUST(adopt_nonnull_ref_or_enomem(new (nothrow) Buffer));
+ return MUST(adopt_nonnull_ref_or_enomem(new (nothrow) LegacyBuffer));
}
Sample const* samples() const { return (Sample const*)data(); }
@@ -64,7 +64,7 @@ public:
private:
template<ArrayLike<Sample> ArrayT>
- explicit Buffer(ArrayT&& samples)
+ explicit LegacyBuffer(ArrayT&& samples)
: m_buffer(Core::AnonymousBuffer::create_with_size(samples.size() * sizeof(Sample)).release_value())
, m_id(allocate_id())
, m_sample_count(samples.size())
@@ -72,7 +72,7 @@ private:
memcpy(m_buffer.data<void>(), samples.data(), samples.size() * sizeof(Sample));
}
- explicit Buffer(Core::AnonymousBuffer buffer, i32 buffer_id, int sample_count)
+ explicit LegacyBuffer(Core::AnonymousBuffer buffer, i32 buffer_id, int sample_count)
: m_buffer(move(buffer))
, m_id(buffer_id)
, m_sample_count(sample_count)
@@ -80,7 +80,7 @@ private:
}
// Empty Buffer representation, to avoid tiny anonymous buffers in EOF states
- Buffer() = default;
+ LegacyBuffer() = default;
static i32 allocate_id();
@@ -90,6 +90,6 @@ private:
};
// This only works for double resamplers, and therefore cannot be part of the class
-ErrorOr<NonnullRefPtr<Buffer>> resample_buffer(ResampleHelper<double>& resampler, Buffer const& to_resample);
+ErrorOr<NonnullRefPtr<LegacyBuffer>> resample_buffer(ResampleHelper<double>& resampler, LegacyBuffer const& to_resample);
}
diff --git a/Userland/Libraries/LibAudio/ConnectionFromClient.cpp b/Userland/Libraries/LibAudio/ConnectionFromClient.cpp
index ae5ee7210b..77d747f862 100644
--- a/Userland/Libraries/LibAudio/ConnectionFromClient.cpp
+++ b/Userland/Libraries/LibAudio/ConnectionFromClient.cpp
@@ -19,7 +19,7 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSock
{
}
-void ConnectionFromClient::enqueue(Buffer const& buffer)
+void ConnectionFromClient::enqueue(LegacyBuffer const& buffer)
{
for (;;) {
auto success = enqueue_buffer(buffer.anonymous_buffer(), buffer.id(), buffer.sample_count());
@@ -29,12 +29,12 @@ void ConnectionFromClient::enqueue(Buffer const& buffer)
}
}
-void ConnectionFromClient::async_enqueue(Buffer const& buffer)
+void ConnectionFromClient::async_enqueue(LegacyBuffer const& buffer)
{
async_enqueue_buffer(buffer.anonymous_buffer(), buffer.id(), buffer.sample_count());
}
-bool ConnectionFromClient::try_enqueue(Buffer const& buffer)
+bool ConnectionFromClient::try_enqueue(LegacyBuffer const& buffer)
{
return enqueue_buffer(buffer.anonymous_buffer(), buffer.id(), buffer.sample_count());
}
diff --git a/Userland/Libraries/LibAudio/ConnectionFromClient.h b/Userland/Libraries/LibAudio/ConnectionFromClient.h
index 7210353075..61ad818c42 100644
--- a/Userland/Libraries/LibAudio/ConnectionFromClient.h
+++ b/Userland/Libraries/LibAudio/ConnectionFromClient.h
@@ -12,16 +12,16 @@
namespace Audio {
-class Buffer;
+class LegacyBuffer;
class ConnectionFromClient final
: public IPC::ConnectionToServer<AudioClientEndpoint, AudioServerEndpoint>
, public AudioClientEndpoint {
IPC_CLIENT_CONNECTION(ConnectionFromClient, "/tmp/portal/audio")
public:
- void enqueue(Buffer const&);
- bool try_enqueue(Buffer const&);
- void async_enqueue(Buffer const&);
+ void enqueue(LegacyBuffer const&);
+ bool try_enqueue(LegacyBuffer const&);
+ void async_enqueue(LegacyBuffer const&);
Function<void(i32 buffer_id)> on_finish_playing_buffer;
Function<void(bool muted)> on_main_mix_muted_state_change;
diff --git a/Userland/Libraries/LibAudio/FlacLoader.cpp b/Userland/Libraries/LibAudio/FlacLoader.cpp
index cce821a5fb..3a504151ab 100644
--- a/Userland/Libraries/LibAudio/FlacLoader.cpp
+++ b/Userland/Libraries/LibAudio/FlacLoader.cpp
@@ -242,7 +242,7 @@ LoaderSamples FlacLoaderPlugin::get_more_samples(size_t max_bytes_to_read_from_i
{
ssize_t remaining_samples = static_cast<ssize_t>(m_total_samples - m_loaded_samples);
if (remaining_samples <= 0)
- return Buffer::create_empty();
+ return LegacyBuffer::create_empty();
// FIXME: samples_to_read is calculated wrong, because when seeking not all samples are loaded.
size_t samples_to_read = min(max_bytes_to_read_from_input, remaining_samples);
@@ -267,7 +267,7 @@ LoaderSamples FlacLoaderPlugin::get_more_samples(size_t max_bytes_to_read_from_i
}
m_loaded_samples += sample_index;
- auto maybe_buffer = Buffer::create_with_samples(move(samples));
+ auto maybe_buffer = LegacyBuffer::create_with_samples(move(samples));
if (maybe_buffer.is_error())
return LoaderError { LoaderError::Category::Internal, m_loaded_samples, "Couldn't allocate sample buffer" };
return maybe_buffer.release_value();
diff --git a/Userland/Libraries/LibAudio/Loader.h b/Userland/Libraries/LibAudio/Loader.h
index bca513c083..4d5b68cdd0 100644
--- a/Userland/Libraries/LibAudio/Loader.h
+++ b/Userland/Libraries/LibAudio/Loader.h
@@ -22,7 +22,7 @@ namespace Audio {
static constexpr StringView no_plugin_error = "No loader plugin available";
-using LoaderSamples = Result<NonnullRefPtr<Buffer>, LoaderError>;
+using LoaderSamples = Result<NonnullRefPtr<LegacyBuffer>, LoaderError>;
using MaybeLoaderError = Result<void, LoaderError>;
class LoaderPlugin {
diff --git a/Userland/Libraries/LibAudio/MP3Loader.cpp b/Userland/Libraries/LibAudio/MP3Loader.cpp
index 60b6ab95a7..ca0199f805 100644
--- a/Userland/Libraries/LibAudio/MP3Loader.cpp
+++ b/Userland/Libraries/LibAudio/MP3Loader.cpp
@@ -126,7 +126,7 @@ LoaderSamples MP3LoaderPlugin::get_more_samples(size_t max_bytes_to_read_from_in
auto maybe_frame = read_next_frame();
if (maybe_frame.is_error()) {
if (m_input_stream->unreliable_eof()) {
- return Buffer::create_empty();
+ return LegacyBuffer::create_empty();
}
return maybe_frame.release_error();
}
@@ -156,7 +156,7 @@ LoaderSamples MP3LoaderPlugin::get_more_samples(size_t max_bytes_to_read_from_in
}
m_loaded_samples += samples.size();
- auto maybe_buffer = Buffer::create_with_samples(move(samples));
+ auto maybe_buffer = LegacyBuffer::create_with_samples(move(samples));
if (maybe_buffer.is_error())
return LoaderError { LoaderError::Category::Internal, m_loaded_samples, "Couldn't allocate sample buffer" };
return maybe_buffer.release_value();
diff --git a/Userland/Libraries/LibAudio/Resampler.cpp b/Userland/Libraries/LibAudio/Resampler.cpp
index 35ed37c536..cfcd4589d1 100644
--- a/Userland/Libraries/LibAudio/Resampler.cpp
+++ b/Userland/Libraries/LibAudio/Resampler.cpp
@@ -10,7 +10,7 @@
namespace Audio {
-ErrorOr<NonnullRefPtr<Buffer>> resample_buffer(ResampleHelper<double>& resampler, Buffer const& to_resample)
+ErrorOr<NonnullRefPtr<LegacyBuffer>> resample_buffer(ResampleHelper<double>& resampler, LegacyBuffer const& to_resample)
{
Vector<Sample> resampled;
resampled.ensure_capacity(to_resample.sample_count() * ceil_div(resampler.source(), resampler.target()));
@@ -22,7 +22,7 @@ ErrorOr<NonnullRefPtr<Buffer>> resample_buffer(ResampleHelper<double>& resampler
resampled.append(sample);
}
- return Buffer::create_with_samples(move(resampled));
+ return LegacyBuffer::create_with_samples(move(resampled));
}
}
diff --git a/Userland/Libraries/LibAudio/Resampler.h b/Userland/Libraries/LibAudio/Resampler.h
index c7c7328df8..2b48dbf888 100644
--- a/Userland/Libraries/LibAudio/Resampler.h
+++ b/Userland/Libraries/LibAudio/Resampler.h
@@ -84,7 +84,7 @@ private:
SampleType m_last_sample_r {};
};
-class Buffer;
-ErrorOr<NonnullRefPtr<Buffer>> resample_buffer(ResampleHelper<double>& resampler, Buffer const& to_resample);
+class LegacyBuffer;
+ErrorOr<NonnullRefPtr<LegacyBuffer>> resample_buffer(ResampleHelper<double>& resampler, LegacyBuffer const& to_resample);
}
diff --git a/Userland/Libraries/LibAudio/WavLoader.cpp b/Userland/Libraries/LibAudio/WavLoader.cpp
index 6168cf5926..d5fa8ee57e 100644
--- a/Userland/Libraries/LibAudio/WavLoader.cpp
+++ b/Userland/Libraries/LibAudio/WavLoader.cpp
@@ -53,7 +53,7 @@ LoaderSamples WavLoaderPlugin::get_more_samples(size_t max_bytes_to_read_from_in
int remaining_samples = m_total_samples - m_loaded_samples;
if (remaining_samples <= 0)
- return Buffer::create_empty();
+ return LegacyBuffer::create_empty();
// One "sample" contains data from all channels.
// In the Wave spec, this is also called a block.
@@ -78,7 +78,7 @@ LoaderSamples WavLoaderPlugin::get_more_samples(size_t max_bytes_to_read_from_in
if (m_stream->handle_any_error())
return LoaderError { LoaderError::Category::IO, static_cast<size_t>(m_loaded_samples), "Stream read error" };
- auto buffer = Buffer::from_pcm_data(
+ auto buffer = LegacyBuffer::from_pcm_data(
sample_data.bytes(),
m_num_channels,
m_sample_format);
diff --git a/Userland/Libraries/LibAudio/WavLoader.h b/Userland/Libraries/LibAudio/WavLoader.h
index 50e97b5648..6faf3ccbbc 100644
--- a/Userland/Libraries/LibAudio/WavLoader.h
+++ b/Userland/Libraries/LibAudio/WavLoader.h
@@ -21,7 +21,7 @@
#include <LibCore/FileStream.h>
namespace Audio {
-class Buffer;
+class LegacyBuffer;
// defines for handling the WAV header data
#define WAVE_FORMAT_PCM 0x0001 // PCM
@@ -30,7 +30,7 @@ class Buffer;
#define WAVE_FORMAT_MULAW 0x0007 // 8-bit ITU-T G.711 ยต-law
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE // Determined by SubFormat
-// Parses a WAV file and produces an Audio::Buffer.
+// Parses a WAV file and produces an Audio::LegacyBuffer.
class WavLoaderPlugin : public LoaderPlugin {
public:
explicit WavLoaderPlugin(StringView path);
diff --git a/Userland/Services/AudioServer/ConnectionFromClient.cpp b/Userland/Services/AudioServer/ConnectionFromClient.cpp
index d8f97f4bf6..0f4b457561 100644
--- a/Userland/Services/AudioServer/ConnectionFromClient.cpp
+++ b/Userland/Services/AudioServer/ConnectionFromClient.cpp
@@ -94,7 +94,7 @@ Messages::AudioServer::EnqueueBufferResponse ConnectionFromClient::enqueue_buffe
return false;
// There's not a big allocation to worry about here.
- m_queue->enqueue(MUST(Audio::Buffer::create_with_anonymous_buffer(buffer, buffer_id, sample_count)));
+ m_queue->enqueue(MUST(Audio::LegacyBuffer::create_with_anonymous_buffer(buffer, buffer_id, sample_count)));
return true;
}
diff --git a/Userland/Services/AudioServer/ConnectionFromClient.h b/Userland/Services/AudioServer/ConnectionFromClient.h
index 1886d7859d..e744e75c3d 100644
--- a/Userland/Services/AudioServer/ConnectionFromClient.h
+++ b/Userland/Services/AudioServer/ConnectionFromClient.h
@@ -12,7 +12,7 @@
#include <LibIPC/ConnectionFromClient.h>
namespace Audio {
-class Buffer;
+class LegacyBuffer;
}
namespace AudioServer {
diff --git a/Userland/Services/AudioServer/Mixer.cpp b/Userland/Services/AudioServer/Mixer.cpp
index 98525d60ec..cd86c4ee0e 100644
--- a/Userland/Services/AudioServer/Mixer.cpp
+++ b/Userland/Services/AudioServer/Mixer.cpp
@@ -200,7 +200,7 @@ ClientAudioStream::ClientAudioStream(ConnectionFromClient& client)
{
}
-void ClientAudioStream::enqueue(NonnullRefPtr<Audio::Buffer>&& buffer)
+void ClientAudioStream::enqueue(NonnullRefPtr<Audio::LegacyBuffer>&& buffer)
{
m_remaining_samples += buffer->sample_count();
m_queue.enqueue(move(buffer));
diff --git a/Userland/Services/AudioServer/Mixer.h b/Userland/Services/AudioServer/Mixer.h
index c207f687d5..ca24a77050 100644
--- a/Userland/Services/AudioServer/Mixer.h
+++ b/Userland/Services/AudioServer/Mixer.h
@@ -38,7 +38,7 @@ public:
~ClientAudioStream() = default;
bool is_full() const { return m_queue.size() >= 3; }
- void enqueue(NonnullRefPtr<Audio::Buffer>&&);
+ void enqueue(NonnullRefPtr<Audio::LegacyBuffer>&&);
bool get_next_sample(Audio::Sample& sample)
{
@@ -97,8 +97,8 @@ public:
void set_muted(bool muted) { m_muted = muted; }
private:
- RefPtr<Audio::Buffer> m_current;
- Queue<NonnullRefPtr<Audio::Buffer>> m_queue;
+ RefPtr<Audio::LegacyBuffer> m_current;
+ Queue<NonnullRefPtr<Audio::LegacyBuffer>> m_queue;
int m_position { 0 };
int m_remaining_samples { 0 };
int m_played_samples { 0 };