mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 23:09:26 -05: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;
|
Thread* CaptureThread::thread = nullptr;
|
||||||
|
|
||||||
CaptureThread::CaptureThread(
|
CaptureThread::CaptureThread(
|
||||||
std::unique_ptr<Writer> writer,
|
std::unique_ptr<stream::Writer> writer,
|
||||||
size_t write_size,
|
size_t write_size,
|
||||||
size_t buffer_count,
|
size_t buffer_count,
|
||||||
std::function<void()> success_callback,
|
std::function<void()> success_callback,
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
class CaptureThread {
|
class CaptureThread {
|
||||||
public:
|
public:
|
||||||
CaptureThread(
|
CaptureThread(
|
||||||
std::unique_ptr<Writer> writer,
|
std::unique_ptr<stream::Writer> writer,
|
||||||
size_t write_size,
|
size_t write_size,
|
||||||
size_t buffer_count,
|
size_t buffer_count,
|
||||||
std::function<void()> success_callback,
|
std::function<void()> success_callback,
|
||||||
@ -54,7 +54,7 @@ private:
|
|||||||
static constexpr auto event_mask_loop_wake = EVENT_MASK(0);
|
static constexpr auto event_mask_loop_wake = EVENT_MASK(0);
|
||||||
|
|
||||||
CaptureConfig config;
|
CaptureConfig config;
|
||||||
std::unique_ptr<Writer> writer;
|
std::unique_ptr<stream::Writer> writer;
|
||||||
std::function<void()> success_callback;
|
std::function<void()> success_callback;
|
||||||
std::function<void(File::Error)> error_callback;
|
std::function<void(File::Error)> error_callback;
|
||||||
static Thread* thread;
|
static Thread* thread;
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
|
|
||||||
|
namespace stream {
|
||||||
|
|
||||||
class Reader {
|
class Reader {
|
||||||
public:
|
public:
|
||||||
virtual File::Result<File::Size> read(void* const buffer, const File::Size bytes) = 0;
|
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 File::Result<File::Size> write(const void* const buffer, const File::Size bytes) = 0;
|
||||||
virtual ~Writer() = default;
|
virtual ~Writer() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} /* namespace stream */
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class FileWriter : public Writer {
|
class FileWriter : public stream::Writer {
|
||||||
public:
|
public:
|
||||||
FileWriter() = default;
|
FileWriter() = default;
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ void RecordView::start() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Writer> writer;
|
std::unique_ptr<stream::Writer> writer;
|
||||||
switch(file_type) {
|
switch(file_type) {
|
||||||
case FileType::WAV:
|
case FileType::WAV:
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user