summaryrefslogtreecommitdiff
path: root/Detector/Detector.hpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
committerChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
commitf647d78463c1250ce9c99af664615fafccf5e959 (patch)
tree5b00428cef68aef1c9d407e2d4535687422419b6 /Detector/Detector.hpp
parent0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff)
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'Detector/Detector.hpp')
-rw-r--r--[-rwxr-xr-x]Detector/Detector.hpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/Detector/Detector.hpp b/Detector/Detector.hpp
index 82eca323..53723d43 100755..100644
--- a/Detector/Detector.hpp
+++ b/Detector/Detector.hpp
@@ -1,58 +1,58 @@
-#ifndef DETECTOR_HPP__
-#define DETECTOR_HPP__
-#include "Audio/AudioDevice.hpp"
-#include <QScopedArrayPointer>
-
-//
-// output device that distributes data in predefined chunks via a signal
-//
-// the underlying device for this abstraction is just the buffer that
-// stores samples throughout a receiving period
-//
-class Detector : public AudioDevice
-{
- Q_OBJECT;
-
-public:
- //
- // if the data buffer were not global storage and fixed size then we
- // might want maximum size passed as constructor arguments
- //
- // we down sample by a factor of 4
- //
- // the samplesPerFFT argument is the number after down sampling
- //
- Detector (unsigned frameRate, double periodLengthInSeconds, unsigned downSampleFactor = 4u,
- QObject * parent = 0);
-
- void setTRPeriod(double p) {m_period=p;}
- bool reset () override;
-
- Q_SIGNAL void framesWritten (qint64) const;
- Q_SLOT void setBlockSize (unsigned);
-
-protected:
- qint64 readData (char * /* data */, qint64 /* maxSize */) override
- {
- return -1; // we don't produce data
- }
-
- qint64 writeData (char const * data, qint64 maxSize) override;
-
-private:
- void clear (); // discard buffer contents
-
- unsigned m_frameRate;
- double m_period;
- unsigned m_downSampleFactor;
- qint32 m_samplesPerFFT; // after any down sampling
- static size_t const max_buffer_size {7 * 512};
- QScopedArrayPointer<short> m_buffer; // de-interleaved sample buffer
- // big enough for all the
- // samples for one increment of
- // data (a signals worth) at
- // the input sample rate
- unsigned m_bufferPos;
-};
-
-#endif
+#ifndef DETECTOR_HPP__
+#define DETECTOR_HPP__
+#include "Audio/AudioDevice.hpp"
+#include <QScopedArrayPointer>
+
+//
+// output device that distributes data in predefined chunks via a signal
+//
+// the underlying device for this abstraction is just the buffer that
+// stores samples throughout a receiving period
+//
+class Detector : public AudioDevice
+{
+ Q_OBJECT;
+
+public:
+ //
+ // if the data buffer were not global storage and fixed size then we
+ // might want maximum size passed as constructor arguments
+ //
+ // we down sample by a factor of 4
+ //
+ // the samplesPerFFT argument is the number after down sampling
+ //
+ Detector (unsigned frameRate, double periodLengthInSeconds, unsigned downSampleFactor = 4u,
+ QObject * parent = 0);
+
+ void setTRPeriod(double p) {m_period=p;}
+ bool reset () override;
+
+ Q_SIGNAL void framesWritten (qint64) const;
+ Q_SLOT void setBlockSize (unsigned);
+
+protected:
+ qint64 readData (char * /* data */, qint64 /* maxSize */) override
+ {
+ return -1; // we don't produce data
+ }
+
+ qint64 writeData (char const * data, qint64 maxSize) override;
+
+private:
+ void clear (); // discard buffer contents
+
+ unsigned m_frameRate;
+ double m_period;
+ unsigned m_downSampleFactor;
+ qint32 m_samplesPerFFT; // after any down sampling
+ static size_t const max_buffer_size {7 * 512};
+ QScopedArrayPointer<short> m_buffer; // de-interleaved sample buffer
+ // big enough for all the
+ // samples for one increment of
+ // data (a signals worth) at
+ // the input sample rate
+ unsigned m_bufferPos;
+};
+
+#endif