scaffold new classes
This commit is contained in:
27
src/synth/Scope.hpp
Normal file
27
src/synth/Scope.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
|
||||
class ScopeBuffer {
|
||||
|
||||
public:
|
||||
|
||||
ScopeBuffer(size_t size);
|
||||
~ScopeBuffer() = default;
|
||||
|
||||
void push(float sample);
|
||||
void read(std::vector<float>& out);
|
||||
|
||||
private:
|
||||
|
||||
std::vector<float> buffer_;
|
||||
std::atomic<size_t> writeIndex_{0};
|
||||
|
||||
size_t trigger_ = 0;
|
||||
uint32_t wavelgnth = 400;
|
||||
|
||||
bool spinLock_ = false;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user