bpmdetect 0.8.11
Automatic BPM detection tool
Loading...
Searching...
No Matches
bpmdetectui.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
3#pragma once
4#include <cstdint>
5
6#include <DistrhoUI.hpp>
7
8#include "parameters.h"
9
10START_NAMESPACE_DISTRHO
11
19class BpmDetectUi : public UI {
20public:
21 BpmDetectUi();
22
23protected:
25 void parameterChanged(uint32_t index, float value) override;
27 void onNanoDisplay() override;
29 bool onMouse(const MouseEvent &event) override;
31 bool onMotion(const MotionEvent &event) override;
32
33private:
34 // Bounds of the reset button for the current window size.
35 Rectangle<float> resetButtonBounds() const;
36 // Bounds of the project page link for the current window size.
37 Rectangle<float> linkBounds() const;
38 // Bounds of a slider track. The index must be kParameterMinimumBpm or kParameterMaximumBpm.
39 Rectangle<float> sliderTrackBounds(uint32_t index) const;
40 // Applies a horizontal position within a slider track as the parameter value.
41 void applySliderPosition(uint32_t index, float x);
42 // Draws one slider row with its label and value.
43 void drawSlider(uint32_t index, const char *label, float value);
44
45 float detectedBpm_ = 0.f;
46 float minimumBpm_ = kDefaultMinimumBpm;
47 float maximumBpm_ = kDefaultMaximumBpm;
48 // Parameter being dragged, or kParameterCount when no drag is active.
49 uint32_t draggedParameter_ = kParameterCount;
50};
51
52END_NAMESPACE_DISTRHO
void parameterChanged(uint32_t index, float value) override
Definition bpmdetectui.cpp:58
bool onMouse(const MouseEvent &event) override
Definition bpmdetectui.cpp:189
void onNanoDisplay() override
Definition bpmdetectui.cpp:140
bool onMotion(const MotionEvent &event) override
Definition bpmdetectui.cpp:223