aboutsummaryrefslogtreecommitdiffstats
path: root/src/FormatConverter.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2023-05-16 22:04:21 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2023-05-16 22:04:21 +0200
commit1d07999d373b0fb0b67de576aa4d7b10308b4150 (patch)
tree78f4556978a96e8084a4e54268de915a839d48ac /src/FormatConverter.h
parent829863ab82ca3743c64c76310af5eebcaab1fc84 (diff)
downloaddabmod-1d07999d373b0fb0b67de576aa4d7b10308b4150.tar.gz
dabmod-1d07999d373b0fb0b67de576aa4d7b10308b4150.tar.bz2
dabmod-1d07999d373b0fb0b67de576aa4d7b10308b4150.zip
Avoid undefined format conversion and measure clipping
Diffstat (limited to 'src/FormatConverter.h')
-rw-r--r--src/FormatConverter.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/FormatConverter.h b/src/FormatConverter.h
index ceb2e17..05511c0 100644
--- a/src/FormatConverter.h
+++ b/src/FormatConverter.h
@@ -34,22 +34,27 @@
#include "ModPlugin.h"
#include <complex>
+#include <atomic>
#include <string>
#include <cstdint>
class FormatConverter : public ModCodec
{
public:
+ static size_t get_format_size(const std::string& format);
+
// Allowed formats: s8, u8 and s16
FormatConverter(const std::string& format);
int process(Buffer* const dataIn, Buffer* dataOut);
const char* name();
- size_t get_format_size() const;
+ size_t get_num_clipped_samples() const;
private:
std::string m_format;
+
+ std::atomic<size_t> m_num_clipped_samples = 0;
};