Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rekordbox RGB hotcue colors #2555

Merged
merged 5 commits into from
Mar 20, 2020
Merged
Changes from 2 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
59 changes: 5 additions & 54 deletions src/library/rekordbox/rekordboxfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ constexpr mixxx::RgbColor kTrackColorPurple(0x9808F8);
struct memory_cue_t {
double position;
QString comment;
int colorCode;
int colorRed;
int colorGreen;
int colorBlue;
Expand Down Expand Up @@ -793,7 +792,7 @@ void clearDeviceTables(QSqlDatabase& database, TreeItem* child) {
transaction.commit();
}

void setHotCue(TrackPointer track, double position, int id, QString label, int /*colorCode*/, int /*colorRed*/, int /*colorGreen*/, int /*colorBlue*/) {
void setHotCue(TrackPointer track, double position, int id, QString label, int colorRed, int colorGreen, int colorBlue) {
CuePointer pCue;
bool hotCueFound = false;

Expand All @@ -813,53 +812,7 @@ void setHotCue(TrackPointer track, double position, int id, QString label, int /
pCue->setStartPosition(position);
pCue->setHotCue(id);
pCue->setLabel(label);

/*
TODO(ehendrikd):
Update setting hotcue colors once proposed PR is merged
allowing custom hotcue colors/palette
See:
https://github.com/mixxxdj/mixxx/pull/2119
https://github.com/mixxxdj/mixxx/pull/2345

// Map 17 possible Rekordbox hotcue colors to closest Mixxx hotcue colors
switch (colorCode) {
case 38:
case 42:
pCue->setColor(Color::kPredefinedColorsSet.red);
break;
case 0:
case 14:
case 18:
case 22:
case 26:
pCue->setColor(Color::kPredefinedColorsSet.green);
break;
case 30:
case 32:
pCue->setColor(Color::kPredefinedColorsSet.yellow);
break;
case 1:
case 5:
case 62:
pCue->setColor(Color::kPredefinedColorsSet.blue);
break;
case 9:
pCue->setColor(Color::kPredefinedColorsSet.cyan);
break;
case 56:
case 60:
pCue->setColor(Color::kPredefinedColorsSet.magenta);
break;
case 45:
case 49:
pCue->setColor(Color::kPredefinedColorsSet.pink);
break;
default:
pCue->setColor(Color::kPredefinedColorsSet.noColor);
break;
}
*/
pCue->setColor(*mixxx::RgbColor::fromQColor(QColor(colorRed, colorGreen, colorBlue)));
}

void readAnalyze(TrackPointer track, double sampleRate, int timingOffset, bool ignoreBeatsAndLegacyCues, QString anlzPath) {
Expand Down Expand Up @@ -930,7 +883,6 @@ void readAnalyze(TrackPointer track, double sampleRate, int timingOffset, bool i
case rekordbox_anlz_t::CUE_ENTRY_TYPE_MEMORY_CUE: {
memory_cue_t memoryCue;
memoryCue.position = position;
memoryCue.colorCode = -1;
memoryCue.colorRed = -1;
memoryCue.colorGreen = -1;
memoryCue.colorBlue = -1;
Expand All @@ -955,7 +907,7 @@ void readAnalyze(TrackPointer track, double sampleRate, int timingOffset, bool i
if (hotCueIndex > lastHotCueIndex) {
lastHotCueIndex = hotCueIndex;
}
setHotCue(track, position, hotCueIndex, QString(), -1, -1, -1, -1);
setHotCue(track, position, hotCueIndex, QString(), -1, -1, -1);
} break;
}
}
Expand All @@ -978,7 +930,6 @@ void readAnalyze(TrackPointer track, double sampleRate, int timingOffset, bool i
memory_cue_t memoryCue;
memoryCue.position = position;
memoryCue.comment = toUnicode((*cueExtendedEntry)->comment());
memoryCue.colorCode = static_cast<int>((*cueExtendedEntry)->color_code());
memoryCue.colorRed = static_cast<int>((*cueExtendedEntry)->color_red());
memoryCue.colorGreen = static_cast<int>((*cueExtendedEntry)->color_green());
memoryCue.colorBlue = static_cast<int>((*cueExtendedEntry)->color_blue());
Expand All @@ -1003,7 +954,7 @@ void readAnalyze(TrackPointer track, double sampleRate, int timingOffset, bool i
if (hotCueIndex > lastHotCueIndex) {
lastHotCueIndex = hotCueIndex;
}
setHotCue(track, position, hotCueIndex, toUnicode((*cueExtendedEntry)->comment()), static_cast<int>((*cueExtendedEntry)->color_code()), static_cast<int>((*cueExtendedEntry)->color_red()), static_cast<int>((*cueExtendedEntry)->color_green()), static_cast<int>((*cueExtendedEntry)->color_blue()));
setHotCue(track, position, hotCueIndex, toUnicode((*cueExtendedEntry)->comment()), static_cast<int>((*cueExtendedEntry)->color_red()), static_cast<int>((*cueExtendedEntry)->color_green()), static_cast<int>((*cueExtendedEntry)->color_blue()));
} break;
}
}
Expand All @@ -1027,7 +978,7 @@ void readAnalyze(TrackPointer track, double sampleRate, int timingOffset, bool i
// Add remaining memory cues as hot cues (after actual found hotcues) as Mixxx can only have 1 cue
for (int memoryCueIndex = 1; memoryCueIndex < memoryCues.size(); memoryCueIndex++) {
memory_cue_t memoryCue = memoryCues[memoryCueIndex];
setHotCue(track, memoryCue.position, lastHotCueIndex + memoryCueIndex, memoryCue.comment, memoryCue.colorCode, memoryCue.colorRed, memoryCue.colorGreen, memoryCue.colorBlue);
setHotCue(track, memoryCue.position, lastHotCueIndex + memoryCueIndex, memoryCue.comment, memoryCue.colorRed, memoryCue.colorGreen, memoryCue.colorBlue);
}
}

Expand Down