mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-18 06:31:52 +00:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
@@ -29,35 +29,35 @@
|
||||
#include <cstddef>
|
||||
|
||||
class AudioStatsCollector {
|
||||
public:
|
||||
template<typename Callback>
|
||||
void feed(const buffer_f32_t& src, Callback callback) {
|
||||
if( feed(src) ) {
|
||||
callback(statistics);
|
||||
}
|
||||
}
|
||||
public:
|
||||
template <typename Callback>
|
||||
void feed(const buffer_f32_t& src, Callback callback) {
|
||||
if (feed(src)) {
|
||||
callback(statistics);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
void mute(const size_t sample_count, const size_t sampling_rate, Callback callback) {
|
||||
if( mute(sample_count, sampling_rate) ) {
|
||||
callback(statistics);
|
||||
}
|
||||
}
|
||||
template <typename Callback>
|
||||
void mute(const size_t sample_count, const size_t sampling_rate, Callback callback) {
|
||||
if (mute(sample_count, sampling_rate)) {
|
||||
callback(statistics);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr float update_interval { 0.1f };
|
||||
float squared_sum { 0 };
|
||||
float max_squared { 0 };
|
||||
size_t count { 0 };
|
||||
private:
|
||||
static constexpr float update_interval{0.1f};
|
||||
float squared_sum{0};
|
||||
float max_squared{0};
|
||||
size_t count{0};
|
||||
|
||||
AudioStatistics statistics { };
|
||||
AudioStatistics statistics{};
|
||||
|
||||
void consume_audio_buffer(const buffer_f32_t& src);
|
||||
void consume_audio_buffer(const buffer_f32_t& src);
|
||||
|
||||
bool update_stats(const size_t sample_count, const size_t sampling_rate);
|
||||
bool update_stats(const size_t sample_count, const size_t sampling_rate);
|
||||
|
||||
bool feed(const buffer_f32_t& src);
|
||||
bool mute(const size_t sample_count, const size_t sampling_rate);
|
||||
bool feed(const buffer_f32_t& src);
|
||||
bool mute(const size_t sample_count, const size_t sampling_rate);
|
||||
};
|
||||
|
||||
#endif/*__AUDIO_STATS_COLLECTOR_H__*/
|
||||
#endif /*__AUDIO_STATS_COLLECTOR_H__*/
|
||||
|
Reference in New Issue
Block a user