Skip to content

Commit

Permalink
Merge pull request #12733 from ronso0/hotcue-color-co
Browse files Browse the repository at this point in the history
(fix) hotcue_X_color control: color not stored in cue
  • Loading branch information
daschuer authored Feb 6, 2024
2 parents 2562466 + d4adf53 commit 62a378e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
19 changes: 5 additions & 14 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2477,11 +2477,6 @@ HotcueControl::HotcueControl(const QString& group, int hotcueIndex)
this,
&HotcueControl::slotHotcueColorChangeRequest,
Qt::DirectConnection);
connect(m_hotcueColor.get(),
&ControlObject::valueChanged,
this,
&HotcueControl::slotHotcueColorChanged,
Qt::DirectConnection);

m_hotcueSet = std::make_unique<ControlPushButton>(keyForControl(QStringLiteral("set")));
connect(m_hotcueSet.get(),
Expand Down Expand Up @@ -2649,16 +2644,12 @@ void HotcueControl::slotHotcueEndPositionChanged(double newEndPosition) {
emit hotcueEndPositionChanged(this, newEndPosition);
}

void HotcueControl::slotHotcueColorChangeRequest(double color) {
if (color < 0 || color > 0xFFFFFF) {
qWarning() << "slotHotcueColorChanged got invalid value:" << color;
void HotcueControl::slotHotcueColorChangeRequest(double newColor) {
if (newColor < 0 || newColor > 0xFFFFFF) {
qWarning() << "slotHotcueColorChangeRequest got invalid value:" << newColor;
return;
}
// qDebug() << "HotcueControl::slotHotcueColorChangeRequest" << color;
m_hotcueColor->setAndConfirm(color);
}

void HotcueControl::slotHotcueColorChanged(double newColor) {
// qDebug() << "HotcueControl::slotHotcueColorChangeRequest" << newColor;
if (!m_pCue) {
return;
}
Expand All @@ -2669,7 +2660,7 @@ void HotcueControl::slotHotcueColorChanged(double newColor) {
}

m_pCue->setColor(*color);
emit hotcueColorChanged(this, newColor);
m_hotcueColor->setAndConfirm(newColor);
}

mixxx::audio::FramePos HotcueControl::getPosition() const {
Expand Down
2 changes: 0 additions & 2 deletions src/engine/controls/cuecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class HotcueControl : public QObject {
void slotHotcueEndPositionChanged(double newPosition);
void slotHotcuePositionChanged(double newPosition);
void slotHotcueColorChangeRequest(double newColor);
void slotHotcueColorChanged(double newColor);

signals:
void hotcueSet(HotcueControl* pHotcue, double v, HotcueSetMode mode);
Expand All @@ -152,7 +151,6 @@ class HotcueControl : public QObject {
void hotcueClear(HotcueControl* pHotcue, double v);
void hotcuePositionChanged(HotcueControl* pHotcue, double newPosition);
void hotcueEndPositionChanged(HotcueControl* pHotcue, double newEndPosition);
void hotcueColorChanged(HotcueControl* pHotcue, double newColor);
void hotcuePlay(double v);

private:
Expand Down

0 comments on commit 62a378e

Please sign in to comment.