mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
Put Reader, Writer inside "stream" namespace.
This commit is contained in:
parent
01320d9806
commit
a5793b8b9d
@ -75,7 +75,7 @@ StreamOutput::~StreamOutput() {
|
||||
Thread* CaptureThread::thread = nullptr;
|
||||
|
||||
CaptureThread::CaptureThread(
|
||||
std::unique_ptr<Writer> writer,
|
||||
std::unique_ptr<stream::Writer> writer,
|
||||
size_t write_size,
|
||||
size_t buffer_count,
|
||||
std::function<void()> success_callback,
|
||||
|
@ -36,7 +36,7 @@
|
||||
class CaptureThread {
|
||||
public:
|
||||
CaptureThread(
|
||||
std::unique_ptr<Writer> writer,
|
||||
std::unique_ptr<stream::Writer> writer,
|
||||
size_t write_size,
|
||||
size_t buffer_count,
|
||||
std::function<void()> success_callback,
|
||||
@ -54,7 +54,7 @@ private:
|
||||
static constexpr auto event_mask_loop_wake = EVENT_MASK(0);
|
||||
|
||||
CaptureConfig config;
|
||||
std::unique_ptr<Writer> writer;
|
||||
std::unique_ptr<stream::Writer> writer;
|
||||
std::function<void()> success_callback;
|
||||
std::function<void(File::Error)> error_callback;
|
||||
static Thread* thread;
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "file.hpp"
|
||||
|
||||
namespace stream {
|
||||
|
||||
class Reader {
|
||||
public:
|
||||
virtual File::Result<File::Size> read(void* const buffer, const File::Size bytes) = 0;
|
||||
@ -34,3 +36,5 @@ public:
|
||||
virtual File::Result<File::Size> write(const void* const buffer, const File::Size bytes) = 0;
|
||||
virtual ~Writer() = default;
|
||||
};
|
||||
|
||||
} /* namespace stream */
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class FileWriter : public Writer {
|
||||
class FileWriter : public stream::Writer {
|
||||
public:
|
||||
FileWriter() = default;
|
||||
|
||||
|
@ -117,7 +117,7 @@ void RecordView::start() {
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_ptr<Writer> writer;
|
||||
std::unique_ptr<stream::Writer> writer;
|
||||
switch(file_type) {
|
||||
case FileType::WAV:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user