capo-lite v2.1.0
Simple audio playback library
 
Loading...
Searching...
No Matches
stream_pipe.hpp
Go to the documentation of this file.
1#pragma once
2#include <capo/stream.hpp>
3#include <vector>
4
5namespace capo {
7class IStreamPipe : public IStream {
8 protected:
12 virtual void push_samples(std::vector<float>& out) = 0;
13
14 private:
15 [[nodiscard]] auto read_samples(std::span<float> out) -> std::size_t final;
16
17 auto drain_buffer(std::span<float> out) -> std::size_t;
18
19 std::vector<float> m_buffer{};
20 std::vector<float> m_staging{};
21};
22} // namespace capo
IStream wrapper that enables subtypes to push arbitrary number of samples.
Definition stream_pipe.hpp:7
virtual void push_samples(std::vector< float > &out)=0
Push desired number of samples at the end of out. Push nothing to indicate end of stream.
Interface for custom audio stream (data source). Supports streaming data of indefinite length....
Definition stream.hpp:12
Definition buffer.hpp:8