Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ void CueControl::hotcueSet(HotcueControl* pControl, double v) {
// TODO(XXX) deal with spurious signals
attachCue(pCue, hotcue);

if (getConfig()->getValue(ConfigKey("[Controls]", "AutoHotcueColors"), false)) {
const QList<PredefinedColorPointer> predefinedColors = Color::kPredefinedColorsSet.allColors;
pCue->setColor(predefinedColors.at((hotcue % (predefinedColors.count() - 1)) + 1));
};

// If quantize is enabled and we are not playing, jump to the cue point
// since it's not necessarily where we currently are. TODO(XXX) is this
// potentially invalid for vinyl control?
Expand Down
14 changes: 14 additions & 0 deletions src/preferences/dialog/dlgprefdeck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ DlgPrefDeck::DlgPrefDeck(QWidget * parent, MixxxMainWindow * mixxx,
connect(checkBoxSeekToCue, SIGNAL(toggled(bool)),
this, SLOT(slotJumpToCueOnTrackLoadCheckbox(bool)));

// Automatically assign a color to new hot cues
m_bAssignHotcueColors = m_pConfig->getValue(ConfigKey("[Controls]", "AutoHotcueColors"), false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about enabling this feature by default to let users notice. But on the other hand that might confuse and distract existing users. Let's be conservative and let users discover it for themselves.

checkBoxAssignHotcueColors->setChecked(m_bAssignHotcueColors);
connect(checkBoxAssignHotcueColors, SIGNAL(toggled(bool)),
this, SLOT(slotAssignHotcueColorsCheckbox(bool)));

m_bRateInverted = m_pConfig->getValue(ConfigKey("[Controls]", "RateDir"), false);
setRateDirectionForAllDecks(m_bRateInverted);
checkBoxInvertSpeedSlider->setChecked(m_bRateInverted);
Expand Down Expand Up @@ -335,6 +341,9 @@ void DlgPrefDeck::slotUpdate() {
checkBoxSeekToCue->setChecked(!m_pConfig->getValue(
ConfigKey("[Controls]", "CueRecall"), false));

checkBoxAssignHotcueColors->setChecked(m_pConfig->getValue(
ConfigKey("[Controls]", "AutoHotcueColors"), false));

double deck1RateRange = m_rateRangeControls[0]->get();
int index = ComboBoxRateRange->findData(static_cast<int>(deck1RateRange * 100));
if (index == -1) {
Expand Down Expand Up @@ -490,6 +499,10 @@ void DlgPrefDeck::slotJumpToCueOnTrackLoadCheckbox(bool checked) {
m_bJumpToCueOnTrackLoad = checked;
}

void DlgPrefDeck::slotAssignHotcueColorsCheckbox(bool checked) {
m_bAssignHotcueColors = checked;
}

void DlgPrefDeck::slotSetTrackTimeDisplay(QAbstractButton* b) {
if (b == radioButtonRemaining) {
m_timeDisplayMode = TrackTime::DisplayMode::REMAINING;
Expand Down Expand Up @@ -567,6 +580,7 @@ void DlgPrefDeck::slotApply() {
!m_bDisallowTrackLoadToPlayingDeck);

m_pConfig->setValue(ConfigKey("[Controls]", "CueRecall"), !m_bJumpToCueOnTrackLoad);
m_pConfig->setValue(ConfigKey("[Controls]", "AutoHotcueColors"), m_bAssignHotcueColors);

// Set rate range
setRateRangeForAllDecks(m_iRateRangePercent);
Expand Down
2 changes: 2 additions & 0 deletions src/preferences/dialog/dlgprefdeck.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class DlgPrefDeck : public DlgPreferencePage, public Ui::DlgPrefDeckDlg {
void slotDisallowTrackLoadToPlayingDeckCheckbox(bool);
void slotCueModeCombobox(int);
void slotJumpToCueOnTrackLoadCheckbox(bool);
void slotAssignHotcueColorsCheckbox(bool);
void slotRateRampingModeLinearButton(bool);
void slotRateRampSensitivitySlider(int);

Expand Down Expand Up @@ -117,6 +118,7 @@ class DlgPrefDeck : public DlgPreferencePage, public Ui::DlgPrefDeckDlg {

bool m_bDisallowTrackLoadToPlayingDeck;
bool m_bJumpToCueOnTrackLoad;
bool m_bAssignHotcueColors;

int m_iRateRangePercent;
bool m_bRateInverted;
Expand Down
25 changes: 23 additions & 2 deletions src/preferences/dialog/dlgprefdeckdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelAutoHotcueColors">
<property name="text">
<string>Auto hot cue colors</string>
</property>
<property name="buddy">
<cstring>checkBoxAssignHotcueColors</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelPositionDisplay">
<property name="enabled">
Expand All @@ -52,7 +62,7 @@
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="checkBoxDisallowLoadToPlayingDeck">
<property name="text">
<string>Do not load tracks into playing decks</string>
Expand All @@ -70,6 +80,17 @@
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="checkBoxAssignHotcueColors">
<property name="toolTip">
<string>Automatically assigns a predefined color to a newly created hot cue point, based on
its index.</string>
</property>
<property name="text">
<string>Assign predefined colors to newly created hot cue points</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand Down Expand Up @@ -142,7 +163,7 @@ CUP mode:
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="labelPlayingTrackProtection">
<property name="text">
<string>Playing track protection</string>
Expand Down