diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-06 20:43:17 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-06 20:43:17 +1000 |
| commit | 929d8fa40e371a2adbe1fe0f93f0ebf11bcb0981 (patch) | |
| tree | 965f95279a862cf5853eb6af8ac60938a784a685 /plugin/src/Caelestia/beattracker.hpp | |
| parent | plugin: fix cmake version (diff) | |
| download | caelestia-shell-929d8fa40e371a2adbe1fe0f93f0ebf11bcb0981.tar.gz caelestia-shell-929d8fa40e371a2adbe1fe0f93f0ebf11bcb0981.tar.bz2 caelestia-shell-929d8fa40e371a2adbe1fe0f93f0ebf11bcb0981.zip | |
plugin: async audio processing
Diffstat (limited to '')
| -rw-r--r-- | plugin/src/Caelestia/beattracker.hpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/plugin/src/Caelestia/beattracker.hpp b/plugin/src/Caelestia/beattracker.hpp index b4cb559..edb9c0c 100644 --- a/plugin/src/Caelestia/beattracker.hpp +++ b/plugin/src/Caelestia/beattracker.hpp @@ -7,6 +7,25 @@ namespace caelestia { +class BeatWorker : public AudioWorker { + Q_OBJECT + +public: + explicit BeatWorker(uint_t sampleRate = 44100, uint_t hopSize = 512, QObject* parent = nullptr); + ~BeatWorker(); + +signals: + void beat(smpl_t bpm); + +private: + aubio_tempo_t* m_tempo; + fvec_t* m_in; + fvec_t* m_out; + + void processData() override; + void consumeData() override; +}; + class BeatTracker : public AudioProvider { Q_OBJECT QML_ELEMENT @@ -16,7 +35,6 @@ class BeatTracker : public AudioProvider { public: explicit BeatTracker(uint_t sampleRate = 44100, uint_t hopSize = 512, QObject* parent = nullptr); - ~BeatTracker(); [[nodiscard]] smpl_t bpm() const; @@ -25,14 +43,9 @@ signals: void beat(smpl_t bpm); private: - aubio_tempo_t* m_tempo; - fvec_t* m_in; - fvec_t* m_out; - smpl_t m_bpm; - void processData() override; - void consumeData() override; + void updateBpm(smpl_t bpm); }; } // namespace caelestia |