Zachary Hall
f7f9fce3cb
Some checks failed
Build / build-gentoo (push) Failing after 1m10s
Build / download-system-deps (push) Successful in 3m44s
Build / get-source-code (push) Successful in 7m3s
Build / build-appimage (push) Successful in 3m28s
Build / build-android (push) Failing after 2m54s
Build / build-windows (push) Failing after 6m34s
75 lines
2 KiB
C++
75 lines
2 KiB
C++
#pragma once
|
|
|
|
#include <QSlider>
|
|
#include <QWidget>
|
|
#include <QPushButton>
|
|
#include <QLineEdit>
|
|
#include <QBoxLayout>
|
|
#include <QLabel>
|
|
#include <util.hpp>
|
|
class LooperSlider : public QWidget {
|
|
Q_OBJECT;
|
|
QSlider *slider;
|
|
QPushButton *btn;
|
|
QLineEdit *text;
|
|
bool show_button_text;
|
|
bool show_button_icon;
|
|
QLabel *text_label;
|
|
QLabel *min_label_view;
|
|
QLabel *max_label_view;
|
|
QBoxLayout *limits_view;
|
|
QBoxLayout *root_layout;
|
|
bool limits_visible = false;
|
|
bool settings_changed = false;
|
|
QBoxLayout *text_layout_view;
|
|
bool pressed = false;
|
|
LooperLogScaler *scaler;
|
|
void UpdateLogScaler();
|
|
void UpdateSlider(bool update_value = false);
|
|
bool textChanged = false;
|
|
bool text_editor_visible = false;
|
|
bool slider_visible = false;
|
|
bool text_label_visible = false;
|
|
bool limits_actually_visible = false;
|
|
double value;
|
|
double tick;
|
|
double min;
|
|
double max;
|
|
bool text_edit_mode = false;
|
|
bool logarithmic;
|
|
int slider_changed = 0;
|
|
const char *label = NULL;
|
|
const char *min_label = NULL;
|
|
const char *max_label = NULL;
|
|
void set_min(double min);
|
|
void set_max(double max);
|
|
void set_tick(double value);
|
|
void set_logarithmic(bool logarithmic);
|
|
public:
|
|
void SetMin(double min);
|
|
double Min();
|
|
void SetMax(double max);
|
|
double Max();
|
|
void SetLimits(double min, double max);
|
|
void SetMinLabel(const char *label);
|
|
void SetMaxLabel(const char *label);
|
|
const char *MinLabel();
|
|
const char *MaxLabel();
|
|
void SetLimitLabels(const char *min, const char *max);
|
|
void SetValue(double value);
|
|
double Value();
|
|
void SetLogarithmic(bool logarithmic);
|
|
bool IsLogarithmic();
|
|
void SetLabel(const char *label);
|
|
const char *Label();
|
|
double Tick();
|
|
bool ShowButtonText();
|
|
bool ShowButtonIcon();
|
|
void SetShowButtonText(bool enable);
|
|
void SetShowButtonIcon(bool enable);
|
|
void SetTick(double value);
|
|
explicit LooperSlider(const char *name, const char *label, double min, double max, double tick = 0.0001, bool logarithmic = false);
|
|
~LooperSlider();
|
|
Q_SIGNALS:
|
|
void changed(double value);
|
|
};
|