Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
93c0451
added color column to properties dlg but UI and DB dont update
Oct 2, 2018
e0d73a0
fixed functionality broken by previous commit.
Oct 4, 2018
29df355
woverview waveformsmarks will now reflect their hotcue color
Oct 6, 2018
68efc42
markproperties.m_textColor is now the same color as the mark itself; …
Oct 6, 2018
92d381d
followed daschauers request to VERIFY_OR_DEBUG_ASSERT in a case
Oct 13, 2018
d8057bd
followed uklotzde change requests in widget/woverview
Oct 13, 2018
d4e0735
fixed redundant blank line (codefactor complained)
Oct 14, 2018
2c253ff
fixed inverted VERIFY_OR_DEBUG Statement
Oct 14, 2018
f57e682
Added R/W ControlObject for the HotcueColor
Oct 14, 2018
b0270ba
contrastLineColor of Markers now adapt to MarkerColor Brightness
Oct 18, 2018
9833f67
Removed Comment in cuecontrol.cpp
Oct 19, 2018
d52f107
the marker number color is now set by the skin again, not the m_color
Oct 19, 2018
c8c4150
moved brightness function to color.h; rendermark textColor adapts now
Oct 19, 2018
e58b361
Color is now settable via ComboBox in trackpropertie cuepoints table.
Oct 20, 2018
2372bdf
added more utility functions to util/color.h
Oct 20, 2018
3088c1e
minor changes for performance and codefactor
Oct 21, 2018
20ff8dc
Let skins override cue colors
ferranlala Dec 2, 2018
1b460cf
Add example, revert before merge.
ferranlala Dec 3, 2018
ca30b3b
Improve color methods efficiency
ferranlala Dec 28, 2018
b194d21
Rename Color::defaultRepresentation() to makeDefaultRepresentation()
ferranlala Dec 28, 2018
54798f3
Let skins override cue colors on overview
ferranlala Dec 28, 2018
3b324f8
Append "Cue" to the skin node name for waveform cue color overrides
ferranlala Dec 28, 2018
b6a7dd2
Revert "Add example, revert before merge."
ferranlala Dec 28, 2018
9afc8d4
Fix WOverview cue colors not being mapped after skin reload
ferranlala Dec 29, 2018
19480bd
Convert color lists to static const vars
ferranlala Dec 30, 2018
f950c25
Reduce the number of runtime copies of ColorsRepresentation
ferranlala Dec 30, 2018
f951a94
Move setupCueColorsRepresentation() to SkinContext
ferranlala Dec 30, 2018
c49961f
Added JS utility object for dealing with hotcue colors from MixxxControl
Jan 1, 2019
5c84796
Merge branch 'master' into Enable-Setting-hotcue-color-via-controlobject
ferranlala Jan 25, 2019
9437cd6
Reduce number of colors
ferranlala Jan 27, 2019
bc1b43d
use QstringLiteral to to fix FormatKiloSeconds on windows where the u…
daschuer Jan 29, 2019
181fbe9
Improve waveform marks visibility
ferranlala Jan 25, 2019
60e5a09
Refactor color.h
ferranlala Jan 30, 2019
e2caa1e
Represent cue colors by id instead of color code in CO and DB
ferranlala Jan 30, 2019
7308ba0
Rename invalid color to noColor
ferranlala Jan 30, 2019
4bc2549
Remove some cpp files
ferranlala Jan 30, 2019
84bb670
Improve code comments
ferranlala Jan 30, 2019
9e2deea
Merge branch 'master' into Enable-Setting-hotcue-color-via-controlobject
ferranlala Jan 31, 2019
7938f0d
Use skin provided DefaultMark color when a hotcue has noColor
ferranlala Jan 31, 2019
86337ab
Remove m_iBrightness field from PredefinedColor
ferranlala Jan 31, 2019
85a6605
Add missing include
ferranlala Jan 31, 2019
85bbcf9
Rename all the things
ferranlala Jan 31, 2019
a4b947f
Fix hotcue color CO
ferranlala Jan 31, 2019
36e3670
Remove predefinedColorNames list from PredefinedColorSet
ferranlala Jan 31, 2019
614183d
Rename PredefinedColorSet to PredefinedColorsSet
ferranlala Jan 31, 2019
bfca628
Add default cue color in PredefinedColorsMap
ferranlala Feb 1, 2019
dd29a4b
Improve code comments
ferranlala Feb 2, 2019
ce5bb15
Improve code comments
ferranlala Feb 2, 2019
4ed4d8f
Rename hotcue color CO to "hotcue_color_id"
ferranlala Feb 2, 2019
65b7219
Add const
ferranlala Feb 2, 2019
f1c84ea
Use normal for loop
ferranlala Feb 2, 2019
e1db34d
Don't show THE CUE in track preferences hotcue list
ferranlala Feb 2, 2019
979137e
Replace \ by / because it is not allowed in URLs and encoded to %5C
daschuer Feb 3, 2019
c1f7cb9
fix also pls playlist by replacing '\' with '/'
daschuer Feb 3, 2019
af3ed43
Avoid utf8 roundtrip while encoding URLs
daschuer Feb 3, 2019
080ab06
log a warning if a playlist file is not found
daschuer Feb 3, 2019
551ea46
Merge branch 'master' into Enable-Setting-hotcue-color-via-controlobject
ferranlala Feb 6, 2019
02df2ce
use QFile::exists() directly
daschuer Feb 5, 2019
f2c57af
introduce playlistEntrytoLocalFile()
daschuer Feb 6, 2019
efdf321
Added playlisttest
daschuer Feb 6, 2019
df3a40c
Make Color::chooseContrastColor(QColor) work for dark colors, not onl…
ferranlala Feb 6, 2019
dcdfbf9
Rename PredefinedColorsMap to PredefinedColorsRepresentation
ferranlala Feb 6, 2019
7ef5e98
trigger double load clone from PlayerManager instead of BaseTrackPlayer
iamcodemaker Feb 10, 2019
3e10c98
Make selected color visible in track preferences cue list
ferranlala Feb 10, 2019
d3e5a5f
Correct size of cue color column in track preferences
ferranlala Feb 10, 2019
6f83fe7
Revert "Added JS utility object for dealing with hotcue colors from M…
ferranlala Feb 10, 2019
56983ba
Verify integrity of temporary file before writing any metadata
uklotzde Feb 10, 2019
b2a8009
Safely cancel any temporary file operations
uklotzde Feb 10, 2019
3bd1f6d
Abort exporting of track metadata early
uklotzde Feb 10, 2019
46916ba
resolve merge conflicts in Hercules-DJ-Console-Mk4-scripts.js
Be-ing Feb 10, 2019
21713cd
Merge pull request #2024 from iamcodemaker/seeing-double
Be-ing Feb 10, 2019
13dc290
Fix compiler warnings
uklotzde Feb 10, 2019
398b291
Improve error handling for corrupt MP3 files
uklotzde Feb 10, 2019
8e5b594
Make test conditional because Windows has no root folder
daschuer Feb 10, 2019
346b725
Merge pull request #2026 from uklotzde/dev_compiler_warnings
daschuer Feb 10, 2019
24e6220
Fix typo in DurationUtilTest, and added a TODO why rounding fails.
daschuer Jan 29, 2019
9d71f3f
Merge pull request #2022 from daschuer/lp1814469
daschuer Feb 10, 2019
8c288a8
Improve function naming and reword log message
uklotzde Feb 11, 2019
71ff4bc
Merge branch 'master' into Enable-Setting-hotcue-color-via-controlobject
Feb 11, 2019
4c47b3a
Add JS api for cue colors
Feb 12, 2019
e2aa34d
Merge pull request #2025 from uklotzde/2.1_lp1815305_export_metadata
Pegasus-RPG Feb 13, 2019
8ba4f5e
Merge branch '2.1' of git@github.com:mixxxdj/mixxx.git into 2.2
uklotzde Feb 13, 2019
b701577
Merge branch '2.2' of git@github.com:mixxxdj/mixxx.git
uklotzde Feb 13, 2019
b55604e
Add comment
Feb 13, 2019
a625424
Merge branch 'master' into Enable-Setting-hotcue-color-via-controlobject
Feb 13, 2019
4c2f240
Merge pull request #2016 from ferranpujolcamins/Enable-Setting-hotcue…
daschuer Feb 13, 2019
24459e6
Prefix the QStringLiteral initalizer with u. This is required on msvs…
daschuer Feb 13, 2019
ded9d78
make skin preview consider color scheme
ronso0 Jan 26, 2019
6dd9402
help comment
ronso0 Jan 26, 2019
6d45509
move updateSchemes into skin scanner loop
ronso0 Jan 26, 2019
33766df
fix pixmap loading
ronso0 Jan 28, 2019
b95615d
add fake preview images
ronso0 Jan 28, 2019
2ad937a
add real preview images
ronso0 Jan 29, 2019
42d7d4e
align left edge of preview image with comboboxes
ronso0 Jan 30, 2019
39e1a4b
move color scheme selector directly below skin selector
ronso0 Jan 26, 2019
92a5dd7
initialize empty QPixmap, then load preview images...
ronso0 Jan 28, 2019
d419b19
add comments, fix indentation
ronso0 Jan 28, 2019
3975281
fix preview for skins without color schemes
ronso0 Jan 29, 2019
f1ae93f
unify preview images
ronso0 Jan 29, 2019
0821085
Merge pull request #2015 from daschuer/DurationUtilTest
uklotzde Feb 14, 2019
54ad4c5
Pull latest translations from https://www.transifex.com/mixxx-dj-soft…
daschuer Feb 14, 2019
30da0ec
Merge pull request #2008 from ronso0/pref-colorscheme-preview
daschuer Feb 14, 2019
15e11e2
Reduce scope of foundConfigScheme;
daschuer Feb 14, 2019
ba3cdd9
Merge branch '2.1' of git@github.com:mixxxdj/mixxx.git into 2.2
uklotzde Feb 16, 2019
8efa8ae
Merge branch '2.2' of git@github.com:mixxxdj/mixxx.git
uklotzde Feb 16, 2019
5bf7750
Fix Beats class hierarchy
uklotzde Feb 19, 2019
8e3979e
Fix compilation for Qt versions before 5.11
uklotzde Feb 19, 2019
ce98cd4
Merge pull request #2034 from uklotzde/beats_classes
daschuer Feb 20, 2019
76f9b1f
Merge remote-tracking branch 'upstream/master' into qopenglwidget
daschuer Feb 21, 2019
66cf489
start, implement star_up/down controls & functions
ronso0 Feb 23, 2019
0dba444
add comments how star polygons are drawn
ronso0 Feb 23, 2019
4de038f
Fix and improve the OpenGL status info
daschuer Feb 23, 2019
bd90b75
Merge branch 'star-co' of https://github.com/ronso0/mixxx into qopeng…
daschuer Feb 24, 2019
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
2 changes: 2 additions & 0 deletions build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ def sources(self, build):
"src/controllers/midi/midioutputhandler.cpp",
"src/controllers/softtakeover.cpp",
"src/controllers/keyboard/keyboardeventfilter.cpp",
"src/controllers/colorjsproxy.cpp",

"src/main.cpp",
"src/mixxx.cpp",
Expand Down Expand Up @@ -1225,6 +1226,7 @@ def sources(self, build):
"src/util/widgetrendertimer.cpp",
"src/util/workerthread.cpp",
"src/util/workerthreadscheduler.cpp",
"src/util/color/predefinedcolor.cpp"
]

proto_args = {
Expand Down
44 changes: 0 additions & 44 deletions res/controllers/Hercules-DJ-Console-Mk4-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,8 @@ HerculesMk4.pfl = function (midino, control, value, status, group) {


HerculesMk4.pitchbend = function (midino, control, value, status, group) {
<<<<<<< HEAD
// Pitch - : set pitch sensitivity
// Pitch +: set jog fast position
=======
// Pitch - : set pitch sensivity
// Pitch +: set jog fast position
>>>>>>> upstream/2.2

//ignore when releasing the button
if(value==0x00) return;
Expand All @@ -240,16 +235,6 @@ HerculesMk4.pitchbend = function (midino, control, value, status, group) {

HerculesMk4.jogFastPosition[HerculesMk4.deck(group)]=newValue;

<<<<<<< HEAD
if(newValue==1){
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,11), 0x7f);
}else{
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,11), 0x00);
}
}
else { // Pitchbend -
HerculesMk4.sensitivityPitch[HerculesMk4.deck(group)]=HerculesMk4.toglePitchSensitivity(group,HerculesMk4.sensitivityPitch[HerculesMk4.deck(group)]);
=======
if(newValue==1){
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,11), 0x7f);
}else{
Expand All @@ -258,34 +243,12 @@ HerculesMk4.pitchbend = function (midino, control, value, status, group) {
}
else { // Pitchbend -
HerculesMk4.sensivityPitch[HerculesMk4.deck(group)]=HerculesMk4.toglePitchSensivity(group,HerculesMk4.sensivityPitch[HerculesMk4.deck(group)]);
>>>>>>> upstream/2.2

}

};


HerculesMk4.toglePitchSensitivity=function (group,sensitivity) {

<<<<<<< HEAD
sensitivity=sensitivity+2;

if(sensitivity>5){
sensitivity=1;
}



if(sensitivity==1){
//pitch very fine
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,10), 0x00); // minus led off
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,58), 0x7F); // Blink minus led

} else if (sensitivity==3){
//pitch fine
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,58), 0x00); // Blink minus led off
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,10), 0x7F); // minus led
=======
sensivity=sensivity+2;

if(sensivity>5){
Expand All @@ -303,20 +266,13 @@ HerculesMk4.toglePitchSensitivity=function (group,sensitivity) {
//pitch fine
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,58), 0x00); // Blink minus led off
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,10), 0x7F); // minus led
>>>>>>> upstream/2.2

} else {
//pitch coarse
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,58), 0x00); // Blink minus led off
midi.sendShortMsg(0x90, HerculesMk4.selectLed(group,10), 0x00); // minus led off
}

<<<<<<< HEAD
return sensitivity;
=======
return sensivity;
>>>>>>> upstream/2.2

}

HerculesMk4.cue = function (midino, control, value, status, group) {
Expand Down
Binary file removed res/skins/Shade/preferences_preview_screenshot.png
Binary file not shown.
Binary file added res/skins/Shade/skin_preview_Classic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/skin_preview_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Shade/skin_preview_SummerSunset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/skins/Tango/skin_preview_ClubTwist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/controllers/colorjsproxy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "controllers/colorjsproxy.h"

ColorJSProxy::ColorJSProxy(QScriptEngine* pScriptEngine)
: m_pScriptEngine(pScriptEngine),
m_predefinedColorsList(makePredefinedColorsList(pScriptEngine)){};

ColorJSProxy::~ColorJSProxy() {};

QScriptValue ColorJSProxy::predefinedColorFromId(int iId) {
PredefinedColorPointer color(Color::predefinedColorSet.predefinedColorFromId(iId));
return jsColorFrom(color);
};

Q_INVOKABLE QScriptValue ColorJSProxy::predefinedColorsList() {
return m_predefinedColorsList;
}

QScriptValue ColorJSProxy::jsColorFrom(PredefinedColorPointer predefinedColor) {
QScriptValue jsColor = m_pScriptEngine->newObject();
jsColor.setProperty("red", predefinedColor->m_defaultRgba.red());
jsColor.setProperty("green", predefinedColor->m_defaultRgba.green());
jsColor.setProperty("blue", predefinedColor->m_defaultRgba.blue());
jsColor.setProperty("alpha", predefinedColor->m_defaultRgba.alpha());
jsColor.setProperty("id", predefinedColor->m_iId);
return jsColor;
}

QScriptValue ColorJSProxy::makePredefinedColorsList(QScriptEngine* pScriptEngine) {
int numColors = Color::predefinedColorSet.allColors.length();
QScriptValue colorList = pScriptEngine->newArray(numColors);
for (int i = 0; i < numColors; ++i) {
PredefinedColorPointer color = Color::predefinedColorSet.allColors.at(i);
colorList.setProperty(i, jsColorFrom(color));
}
return colorList;
}
27 changes: 27 additions & 0 deletions src/controllers/colorjsproxy.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef COLORJSPROXY_H
#define COLORJSPROXY_H

#include <QObject>
#include <QScriptEngine>
#include <QScriptValue>

#include "util/color/color.h"

class ColorJSProxy: public QObject {
Q_OBJECT
public:
ColorJSProxy(QScriptEngine* pScriptEngine);

virtual ~ColorJSProxy();

Q_INVOKABLE QScriptValue predefinedColorFromId(int iId);
Q_INVOKABLE QScriptValue predefinedColorsList();

private:
QScriptValue jsColorFrom(PredefinedColorPointer predefinedColor);
QScriptValue makePredefinedColorsList(QScriptEngine* pScriptEngine);
QScriptEngine* m_pScriptEngine;
QScriptValue m_predefinedColorsList;
};

#endif /* COLORJSPROXY_H */
4 changes: 4 additions & 0 deletions src/controllers/controllerengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ void ControllerEngine::gracefulShutdown() {
++it;
}

m_pColorJSProxy.reset();
delete m_pBaClass;
m_pBaClass = nullptr;
}
Expand Down Expand Up @@ -212,6 +213,9 @@ void ControllerEngine::initializeScriptEngine() {
engineGlobalObject.setProperty("midi", m_pEngine->newQObject(m_pController));
}

m_pColorJSProxy = std::make_unique<ColorJSProxy>(m_pEngine);
engineGlobalObject.setProperty("color", m_pEngine->newQObject(m_pColorJSProxy.get()));

m_pBaClass = new ByteArrayClass(m_pEngine);
engineGlobalObject.setProperty("ByteArray", m_pBaClass->constructor());
}
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/controllerengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
#include "bytearrayclass.h"
#include "preferences/usersettings.h"
#include "controllers/controllerpreset.h"
#include "controllers/colorjsproxy.h"
#include "controllers/softtakeover.h"
#include "util/alphabetafilter.h"
#include "util/duration.h"
#include "util/memory.h"

// Forward declaration(s)
class Controller;
Expand Down Expand Up @@ -204,6 +206,7 @@ class ControllerEngine : public QObject {
QHash<int, TimerInfo> m_timers;
SoftTakeoverCtrl m_st;
ByteArrayClass* m_pBaClass;
std::unique_ptr<ColorJSProxy> m_pColorJSProxy;
// 256 (default) available virtual decks is enough I would think.
// If more are needed at run-time, these will move to the heap automatically
QVarLengthArray<int> m_intervalAccumulator;
Expand Down
14 changes: 14 additions & 0 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,20 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
addDeckControl("waveform_zoom", tr("Waveform Zoom"), tr("Waveform zoom"), guiMenu);
addDeckControl("waveform_zoom_down", tr("Waveform Zoom In"), tr("Zoom waveform in"), guiMenu);
addDeckControl("waveform_zoom_up", tr("Waveform Zoom Out"), tr("Zoom waveform out"), guiMenu);

// Controls to change a deck's star rating
QString starsUpTitle = tr("Star Rating Up");
QString starsUpDescription = tr("Increase the track rating by one star");
QString starsDownTitle = tr("Star Rating Down");
QString starsDownDescription = tr("Decrease the track rating by one star");
for (int i = 1; i <= iNumDecks; ++i) {
addControl(QString("[Deck%1]").arg(i), "stars_up",
QString("%1: %2").arg(m_deckStr.arg(i), starsUpTitle),
QString("%1: %2").arg(m_deckStr.arg(i), starsUpDescription), guiMenu);
addControl(QString("[Deck%1]").arg(i), "stars_down",
QString("%1: %2").arg(m_deckStr.arg(i), starsDownTitle),
QString("%1: %2").arg(m_deckStr.arg(i), starsDownDescription), guiMenu);
}
}

ControlPickerMenu::~ControlPickerMenu() {
Expand Down
1 change: 0 additions & 1 deletion src/effects/builtin/balanceeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace {
const double kMaxCornerHz = 500;
const double kMinCornerHz = 16;
const unsigned int kStartupSamplerate = 44100;
} // anonymous namespace

// static
Expand Down
1 change: 0 additions & 1 deletion src/effects/builtin/moogladder4filtereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

static const double kMinCorner = 0.0003; // 13 Hz @ 44100
static const double kMaxCorner = 0.5; // 22050 Hz @ 44100
static const unsigned int kStartupSamplerate = 44100;

// static
QString MoogLadder4FilterEffect::getId() {
Expand Down
20 changes: 20 additions & 0 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "control/controlindicator.h"
#include "vinylcontrol/defs_vinylcontrol.h"
#include "util/sample.h"
#include "util/color/color.h"

// TODO: Convert these doubles to a standard enum
// and convert elseif logic to switch statements
Expand Down Expand Up @@ -297,6 +298,7 @@ void CueControl::trackCuesUpdated() {
} else {
// If the old hotcue is the same, then we only need to update
pControl->setPosition(pCue->getPosition());
pControl->setColor(pCue->getColor());
}
// Add the hotcue to the list of active hotcues
active_hotcues.insert(hotcue);
Expand Down Expand Up @@ -1036,6 +1038,12 @@ HotcueControl::HotcueControl(QString group, int i)
m_hotcueEnabled = new ControlObject(keyForControl(i, "enabled"));
m_hotcueEnabled->setReadOnly();

// The id of the predefined color assigned to this color.
m_hotcueColor = new ControlObject(keyForControl(i, "color_id"));
connect(m_hotcueColor, SIGNAL(valueChanged(double)),
this, SLOT(slotHotcueColorChanged(double)),
Qt::DirectConnection);

m_hotcueSet = new ControlPushButton(keyForControl(i, "set"));
connect(m_hotcueSet, &ControlObject::valueChanged,
this, &HotcueControl::slotHotcueSet,
Expand Down Expand Up @@ -1075,6 +1083,7 @@ HotcueControl::HotcueControl(QString group, int i)
HotcueControl::~HotcueControl() {
delete m_hotcuePosition;
delete m_hotcueEnabled;
delete m_hotcueColor;
delete m_hotcueSet;
delete m_hotcueGoto;
delete m_hotcueGotoAndPlay;
Expand Down Expand Up @@ -1117,6 +1126,11 @@ void HotcueControl::slotHotcuePositionChanged(double newPosition) {
emit(hotcuePositionChanged(this, newPosition));
}

void HotcueControl::slotHotcueColorChanged(double newColorId) {
m_pCue->setColor(Color::predefinedColorSet.predefinedColorFromId(newColorId));
emit(hotcueColorChanged(this, newColorId));
}

double HotcueControl::getPosition() const {
return m_hotcuePosition->get();
}
Expand All @@ -1127,7 +1141,13 @@ void HotcueControl::setCue(CuePointer pCue) {
// because we have a null check for valid data else where in the code
m_pCue = pCue;
}
PredefinedColorPointer HotcueControl::getColor() const {
return Color::predefinedColorSet.predefinedColorFromId(m_hotcueColor->get());
}

void HotcueControl::setColor(PredefinedColorPointer newColor) {
m_hotcueColor->set(static_cast<double>(newColor->m_iId));
}
void HotcueControl::resetCue() {
// clear pCue first because we have a null check for valid data else where
// in the code
Expand Down
5 changes: 5 additions & 0 deletions src/engine/controls/cuecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class HotcueControl : public QObject {
void setCue(CuePointer pCue);
void resetCue();
void setPosition(double position);
void setColor(PredefinedColorPointer newColor);
PredefinedColorPointer getColor() const;

// Used for caching the preview state of this hotcue control.
inline bool isPreviewing() {
Expand All @@ -54,6 +56,7 @@ class HotcueControl : public QObject {
void slotHotcueActivatePreview(double v);
void slotHotcueClear(double v);
void slotHotcuePositionChanged(double newPosition);
void slotHotcueColorChanged(double newColorId);

signals:
void hotcueSet(HotcueControl* pHotcue, double v);
Expand All @@ -64,6 +67,7 @@ class HotcueControl : public QObject {
void hotcueActivatePreview(HotcueControl* pHotcue, double v);
void hotcueClear(HotcueControl* pHotcue, double v);
void hotcuePositionChanged(HotcueControl* pHotcue, double newPosition);
void hotcueColorChanged(HotcueControl* pHotcue, double newColorId);
void hotcuePlay(double v);

private:
Expand All @@ -76,6 +80,7 @@ class HotcueControl : public QObject {
// Hotcue state controls
ControlObject* m_hotcuePosition;
ControlObject* m_hotcueEnabled;
ControlObject* m_hotcueColor;
// Hotcue button controls
ControlObject* m_hotcueSet;
ControlObject* m_hotcueGoto;
Expand Down
10 changes: 5 additions & 5 deletions src/library/dao/cue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "library/dao/cue.h"
#include "util/assert.h"
#include "util/color/color.h"

namespace {
const QColor kDefaultColor = QColor("#FF0000");
const QString kDefaultLabel = ""; // empty string, not null
}

Expand All @@ -25,13 +25,13 @@ Cue::Cue(TrackId trackId)
m_length(0.0),
m_iHotCue(-1),
m_label(kDefaultLabel),
m_color(kDefaultColor) {
m_color(Color::predefinedColorSet.noColor) {
DEBUG_ASSERT(!m_label.isNull());
}


Cue::Cue(int id, TrackId trackId, Cue::CueType type, double position, double length,
int hotCue, QString label, QColor color)
int hotCue, QString label, PredefinedColorPointer color)
: m_bDirty(false),
m_iId(id),
m_trackId(trackId),
Expand Down Expand Up @@ -138,12 +138,12 @@ void Cue::setLabel(const QString label) {
emit(updated());
}

QColor Cue::getColor() const {
PredefinedColorPointer Cue::getColor() const {
QMutexLocker lock(&m_mutex);
return m_color;
}

void Cue::setColor(const QColor color) {
void Cue::setColor(const PredefinedColorPointer color) {
QMutexLocker lock(&m_mutex);
m_color = color;
m_bDirty = true;
Expand Down
Loading