Voss Connection Detection  1
Detect a connector click using realtime code on Bela hardware
buffer.h
Go to the documentation of this file.
1 
4 #pragma once
5 #include <array>
6 #include <Bela.h>
7 #include "config.h"
8 #include "filter.h"
9 
10 
14 using std::array;
15 
16 typedef array<Channel, NUMBER_FILTERED_CHANNELS> FilteredData;
17 
18 
25 
30  us write_ptr = 0;
35  public:
36 
56  FilteredDataBuffer(const float& fs, bool half_offset=false);
58 
63 
71  void addFilteredFrame(const FilteredFrame&);
72 
79  bool full() const;
83  void clear();
84 
85 
86 };
filter.h
FilteredDataBuffer::addFilteredFrame
void addFilteredFrame(const FilteredFrame &)
Addd a new set of samples to the buffers.
Definition: buffer.cpp:23
FilteredDataBuffer::~FilteredDataBuffer
~FilteredDataBuffer()
Definition: buffer.cpp:21
FilteredDataBuffer::FilteredDataBuffer
FilteredDataBuffer(const float &fs, bool half_offset=false)
Initialize a RawDataBuffer, which is filled by the main loop.
Definition: buffer.cpp:7
FilteredDataBuffer::clear
void clear()
Clear the buffer, i.e. set the write pointer back to 0.
Definition: buffer.cpp:30
FilteredFrame
array< float, NUMBER_FILTERED_CHANNELS > FilteredFrame
An array containing data with length corresponding to a single processed frame. Its length correspond...
Definition: filter.h:102
FilteredDataBuffer::data
FilteredData data
Raw sample buffers containing the data.
Definition: buffer.h:62
FilteredDataBuffer::full
bool full() const
Check if buffer is full. A full buffer should be clear() - ed afterwards (prior to extracting the sta...
Definition: buffer.cpp:29
FilteredData
array< Channel, NUMBER_FILTERED_CHANNELS > FilteredData
Definition: buffer.h:16
us
unsigned int us
Used to much to not abbreviate.
Definition: config.h:38
config.h
Configuration parameters for connection detection.
FilteredDataBuffer
Class containing filtered data. It is responsible for aggregating signal samples at the full audio sa...
Definition: buffer.h:24
FilteredDataBuffer::timeStamp
us timeStamp
Storage for statistics data.
Definition: buffer.h:48