1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibAudio: Put all classes in the Audio namespace and remove leading A

This commit is contained in:
Andreas Kling 2020-02-06 10:40:02 +01:00
parent 0bce5f7403
commit 92f77864de
20 changed files with 127 additions and 103 deletions

View file

@ -26,27 +26,28 @@
#pragma once
#include <AK/String.h>
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <LibCore/CFile.h>
#include <LibAudio/ABuffer.h>
class ABuffer;
#include <LibCore/CFile.h>
namespace AK {
class ByteBuffer;
}
// Parses a WAV file and produces an ABuffer instance from it
class AWavLoader {
namespace Audio {
class Buffer;
// Parses a WAV file and produces an Audio::Buffer.
class WavLoader {
public:
explicit AWavLoader(const StringView& path);
explicit WavLoader(const StringView& path);
bool has_error() const { return !m_error_string.is_null(); }
const char* error_string() { return m_error_string.characters(); }
RefPtr<ABuffer> get_more_samples(size_t max_bytes_to_read_from_input = 128 * KB);
RefPtr<Buffer> get_more_samples(size_t max_bytes_to_read_from_input = 128 * KB);
void reset();
void seek(const int position);
@ -62,7 +63,7 @@ private:
bool parse_header();
RefPtr<Core::File> m_file;
String m_error_string;
OwnPtr<AResampleHelper> m_resampler;
OwnPtr<ResampleHelper> m_resampler;
u32 m_sample_rate { 0 };
u16 m_num_channels { 0 };
@ -71,3 +72,5 @@ private:
int m_loaded_samples { 0 };
int m_total_samples { 0 };
};
}