diff options
-rw-r--r-- | src/widget/whotcuebutton.cpp | 43 | ||||
-rw-r--r-- | src/widget/whotcuebutton.h | 5 |
2 files changed, 48 insertions, 0 deletions
diff --git a/src/widget/whotcuebutton.cpp b/src/widget/whotcuebutton.cpp index 65c780242c..2f213c5955 100644 --- a/src/widget/whotcuebutton.cpp +++ b/src/widget/whotcuebutton.cpp @@ -44,6 +44,13 @@ void WHotcueButton::setup(const QDomNode& node, const SkinContext& context) { m_pCoColor->connectValueChanged(this, &WHotcueButton::slotColorChanged); slotColorChanged(m_pCoColor->get()); + m_pCoType = make_parented<ControlProxy>( + createConfigKey(QStringLiteral("type")), + this, + ControlFlag::NoAssertIfMissing); + m_pCoType->connectValueChanged(this, &WHotcueButton::slotTypeChanged); + slotTypeChanged(m_pCoType->get()); + auto pLeftConnection = new ControlParameterWidgetConnection( this, createConfigKey(QStringLiteral("activate")), @@ -133,6 +140,42 @@ void WHotcueButton::slotColorChanged(double color) { restyleAndRepaint(); } +void WHotcueButton::slotTypeChanged(double type) { + switch (static_cast<mixxx::CueType>(type)) { + case mixxx::CueType::Invalid: + m_type = QStringLiteral(""); + break; + case mixxx::CueType::HotCue: + m_type = QStringLiteral("hotcue"); + break; + case mixxx::CueType::MainCue: + m_type = QStringLiteral("maincue"); + break; + case mixxx::CueType::Beat: + m_type = QStringLiteral("beat"); + break; + case mixxx::CueType::Loop: + m_type = QStringLiteral("loop"); + break; + case mixxx::CueType::Jump: + m_type = QStringLiteral("jump"); + break; + case mixxx::CueType::Intro: + m_type = QStringLiteral("intro"); + break; + case mixxx::CueType::Outro: + m_type = QStringLiteral("outro"); + break; + case mixxx::CueType::AudibleSound: + m_type = QStringLiteral("audiblesound"); + break; + default: + DEBUG_ASSERT(!"Unknown cue type!"); + m_type = QStringLiteral(""); + } + restyleAndRepaint(); +} + void WHotcueButton::restyleAndRepaint() { if (readDisplayValue()) { // Adjust properties for Qss file diff --git a/src/widget/whotcuebutton.h b/src/widget/whotcuebutton.h index 0229958f80..ef2734c11d 100644 --- a/src/widget/whotcuebutton.h +++ b/src/widget/whotcuebutton.h @@ -2,6 +2,7 @@ #include <QDomNode> #include <QMouseEvent> +#include <QString> #include <QWidget> #include "skin/skincontext.h" @@ -18,6 +19,7 @@ class WHotcueButton : public WPushButton { Q_PROPERTY(bool light MEMBER m_isCueColorLight); Q_PROPERTY(bool dark MEMBER m_isCueColorDark); + Q_PROPERTY(QString type MEMBER m_type); protected: void mousePressEvent(QMouseEvent* e) override; @@ -25,6 +27,7 @@ class WHotcueButton : public WPushButton { private slots: void slotColorChanged(double color); + void slotTypeChanged(double type); private: ConfigKey createConfigKey(const QString& name); @@ -34,8 +37,10 @@ class WHotcueButton : public WPushButton { int m_hotcue; bool m_hoverCueColor; parented_ptr<ControlProxy> m_pCoColor; + parented_ptr<ControlProxy> m_pCoType; parented_ptr<WCueMenuPopup> m_pCueMenuPopup; bool m_cueColorDimmed; bool m_isCueColorLight; bool m_isCueColorDark; + QString m_type; }; |