summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/analyzer/analyzersilence.cpp12
-rw-r--r--src/engine/controls/cuecontrol.cpp40
-rw-r--r--src/engine/controls/vinylcontrolcontrol.cpp2
-rw-r--r--src/library/dao/cuedao.cpp6
-rw-r--r--src/library/dlgtrackinfo.cpp12
-rw-r--r--src/mixer/basetrackplayer.cpp6
-rw-r--r--src/test/analyzersilence_test.cpp28
-rw-r--r--src/test/cuecontrol_test.cpp42
-rw-r--r--src/track/cue.cpp8
-rw-r--r--src/track/cue.h26
-rw-r--r--src/track/track.cpp16
-rw-r--r--src/track/track.h4
-rw-r--r--src/widget/wtracktableview.cpp6
13 files changed, 104 insertions, 104 deletions
diff --git a/src/analyzer/analyzersilence.cpp b/src/analyzer/analyzersilence.cpp
index c2be74261e..3128426676 100644
--- a/src/analyzer/analyzersilence.cpp
+++ b/src/analyzer/analyzersilence.cpp
@@ -37,12 +37,12 @@ bool AnalyzerSilence::isDisabledOrLoadStoredSuccess(TrackPointer tio) const {
return false;
}
- CuePointer pIntroCue = tio->findCueByType(Cue::INTRO);
+ CuePointer pIntroCue = tio->findCueByType(Cue::Type::Intro);
if (!pIntroCue || pIntroCue->getSource() != Cue::MANUAL) {
return false;
}
- CuePointer pOutroCue = tio->findCueByType(Cue::OUTRO);
+ CuePointer pOutroCue = tio->findCueByType(Cue::Type::Outro);
if (!pOutroCue || pOutroCue->getSource() != Cue::MANUAL) {
return false;
}
@@ -97,10 +97,10 @@ void AnalyzerSilence::finalize(TrackPointer tio) {
tio->setCuePoint(CuePosition(mixxx::kAnalysisChannels * m_iSignalStart, Cue::AUTOMATIC));
}
- CuePointer pIntroCue = tio->findCueByType(Cue::INTRO);
+ CuePointer pIntroCue = tio->findCueByType(Cue::Type::Intro);
if (!pIntroCue) {
pIntroCue = tio->createAndAddCue();
- pIntroCue->setType(Cue::INTRO);
+ pIntroCue->setType(Cue::Type::Intro);
pIntroCue->setSource(Cue::AUTOMATIC);
pIntroCue->setPosition(mixxx::kAnalysisChannels * m_iSignalStart);
pIntroCue->setLength(0.0);
@@ -109,10 +109,10 @@ void AnalyzerSilence::finalize(TrackPointer tio) {
pIntroCue->setLength(0.0);
}
- CuePointer pOutroCue = tio->findCueByType(Cue::OUTRO);
+ CuePointer pOutroCue = tio->findCueByType(Cue::Type::Outro);
if (!pOutroCue) {
pOutroCue = tio->createAndAddCue();
- pOutroCue->setType(Cue::OUTRO);
+ pOutroCue->setType(Cue::Type::Outro);
pOutroCue->setSource(Cue::AUTOMATIC);
pOutroCue->setPosition(-1.0);
pOutroCue->setLength(mixxx::kAnalysisChannels * m_iSignalEnd);
diff --git a/src/engine/controls/cuecontrol.cpp b/src/engine/controls/cuecontrol.cpp
index c60ff7e025..4f7dbadc39 100644
--- a/src/engine/controls/cuecontrol.cpp
+++ b/src/engine/controls/cuecontrol.cpp
@@ -387,16 +387,16 @@ void CueControl::loadCuesFromTrack() {
return;
for (const CuePointer& pCue: m_pLoadedTrack->getCuePoints()) {
- if (pCue->getType() == Cue::LOAD) {
- DEBUG_ASSERT(!pLoadCue); // There should be only one LOAD cue
+ if (pCue->getType() == Cue::Type::MainCue) {
+ DEBUG_ASSERT(!pLoadCue); // There should be only one MainCue cue
pLoadCue = pCue;
- } else if (pCue->getType() == Cue::INTRO) {
- DEBUG_ASSERT(!pIntroCue); // There should be only one INTRO cue
+ } else if (pCue->getType() == Cue::Type::Intro) {
+ DEBUG_ASSERT(!pIntroCue); // There should be only one Intro cue
pIntroCue = pCue;
- } else if (pCue->getType() == Cue::OUTRO) {
- DEBUG_ASSERT(!pOutroCue); // There should be only one OUTRO cue
+ } else if (pCue->getType() == Cue::Type::Outro) {
+ DEBUG_ASSERT(!pOutroCue); // There should be only one Outro cue
pOutroCue = pCue;
- } else if (pCue->getType() == Cue::CUE && pCue->getHotCue() != -1) {
+ } else if (pCue->getType() == Cue::Type::Hotcue && pCue->getHotCue() != -1) {
int hotcue = pCue->getHotCue();
HotcueControl* pControl = m_hotcueControls.value(hotcue, NULL);
@@ -545,7 +545,7 @@ void CueControl::hotcueSet(HotcueControl* pControl, double v) {
pCue->setPosition(cuePosition);
pCue->setHotCue(hotcue);
pCue->setLabel("");
- pCue->setType(Cue::CUE);
+ pCue->setType(Cue::Type::Hotcue);
pCue->setSource(Cue::MANUAL);
// TODO(XXX) deal with spurious signals
attachCue(pCue, hotcue);
@@ -1103,10 +1103,10 @@ void CueControl::introStartSet(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::INTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Intro);
if (!pCue) {
pCue = pLoadedTrack->createAndAddCue();
- pCue->setType(Cue::INTRO);
+ pCue->setType(Cue::Type::Intro);
}
pCue->setSource(Cue::MANUAL);
pCue->setPosition(position);
@@ -1125,7 +1125,7 @@ void CueControl::introStartClear(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::INTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Intro);
if (introEnd != -1.0) {
pCue->setPosition(-1.0);
pCue->setLength(introEnd);
@@ -1182,10 +1182,10 @@ void CueControl::introEndSet(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::INTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Intro);
if (!pCue) {
pCue = pLoadedTrack->createAndAddCue();
- pCue->setType(Cue::INTRO);
+ pCue->setType(Cue::Type::Intro);
}
pCue->setSource(Cue::MANUAL);
if (introStart != -1.0) {
@@ -1209,7 +1209,7 @@ void CueControl::introEndClear(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::INTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Intro);
if (introStart != -1.0) {
pCue->setPosition(introStart);
pCue->setLength(0.0);
@@ -1266,10 +1266,10 @@ void CueControl::outroStartSet(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::OUTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Outro);
if (!pCue) {
pCue = pLoadedTrack->createAndAddCue();
- pCue->setType(Cue::OUTRO);
+ pCue->setType(Cue::Type::Outro);
}
pCue->setSource(Cue::MANUAL);
pCue->setPosition(position);
@@ -1288,7 +1288,7 @@ void CueControl::outroStartClear(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::OUTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Outro);
if (outroEnd != -1.0) {
pCue->setPosition(-1.0);
pCue->setLength(outroEnd);
@@ -1345,10 +1345,10 @@ void CueControl::outroEndSet(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::OUTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Outro);
if (!pCue) {
pCue = pLoadedTrack->createAndAddCue();
- pCue->setType(Cue::OUTRO);
+ pCue->setType(Cue::Type::Outro);
}
pCue->setSource(Cue::MANUAL);
if (outroStart != -1.0) {
@@ -1372,7 +1372,7 @@ void CueControl::outroEndClear(double v) {
lock.unlock();
if (pLoadedTrack) {
- CuePointer pCue = pLoadedTrack->findCueByType(Cue::OUTRO);
+ CuePointer pCue = pLoadedTrack->findCueByType(Cue::Type::Outro);
if (outroStart != -1.0) {
pCue->setPosition(outroStart);
pCue->setLength(0.0);
diff --git a/src/engine/controls/vinylcontrolcontrol.cpp b/src/engine/controls/vinylcontrolcontrol.cpp
index 96174348c3..b5784787fe 100644
--- a/src/engine/controls/vinylcontrolcontrol.cpp
+++ b/src/engine/controls/vinylcontrolcontrol.cpp
@@ -123,7 +123,7 @@ void VinylControlControl::slotControlVinylSeek(double fractionalPos) {
QListIterator<CuePointer> it(cuePoints);
while (it.hasNext()) {
CuePointer pCue(it.next());
- if (pCue->getType() != Cue::CUE || pCue->getHotCue() == -1) {
+ if (pCue->getType() != Cue::Type::Hotcue || pCue->getHotCue() == -1) {
continue;
}
diff --git a/src/library/dao/cuedao.cpp b/src/library/dao/cuedao.cpp
index 526ae19f6c..40c6813165 100644
--- a/src/library/dao/cuedao.cpp
+++ b/src/library/dao/cuedao.cpp
@@ -56,7 +56,7 @@ CuePointer CueDAO::cueFromRow(const QSqlQuery& query) const {
QString label = record.value(record.indexOf("label")).toString();
int iColorId = record.value(record.indexOf("color")).toInt();
PredefinedColorPointer color = Color::kPredefinedColorsSet.predefinedColorFromId(iColorId);
- CuePointer pCue(new Cue(id, trackId, (Cue::CueSource)source, (Cue::CueType)type, position, length, hotcue, label, color));
+ CuePointer pCue(new Cue(id, trackId, (Cue::CueSource)source, (Cue::Type)type, position, length, hotcue, label, color));
m_cues[id] = pCue;
return pCue;
}
@@ -144,7 +144,7 @@ bool CueDAO::saveCue(Cue* cue) {
query.prepare("INSERT INTO " CUE_TABLE " (track_id, source, type, position, length, hotcue, label, color) VALUES (:track_id, :source, :type, :position, :length, :hotcue, :label, :color)");
query.bindValue(":track_id", cue->getTrackId().toVariant());
query.bindValue(":source", cue->getSource());
- query.bindValue(":type", cue->getType());
+ query.bindValue(":type", static_cast<int>(cue->getType()));
query.bindValue(":position", cue->getPosition());
query.bindValue(":length", cue->getLength());
query.bindValue(":hotcue", cue->getHotCue());
@@ -174,7 +174,7 @@ bool CueDAO::saveCue(Cue* cue) {
query.bindValue(":id", cue->getId());
query.bindValue(":track_id", cue->getTrackId().toVariant());
query.bindValue(":source", cue->getSource());
- query.bindValue(":type", cue->getType());
+ query.bindValue(":type", static_cast<int>(cue->getType()));
query.bindValue(":position", cue->getPosition());
query.bindValue(":length", cue->getLength());
query.bindValue(":hotcue", cue->getHotCue());
diff --git a/src/library/dlgtrackinfo.cpp b/src/library/dlgtrackinfo.cpp
index 2edc68bdec..ccdd3d6a5d 100644
--- a/src/library/dlgtrackinfo.cpp
+++ b/src/library/dlgtrackinfo.cpp
@@ -277,8 +277,8 @@ void DlgTrackInfo::populateCues(TrackPointer pTrack) {
QListIterator<CuePointer> it(cuePoints);
while (it.hasNext()) {
CuePointer pCue = it.next();
- Cue::CueType type = pCue->getType();
- if (type == Cue::CUE || type == Cue::INTRO || type == Cue::OUTRO) {
+ Cue::Type type = pCue->getType();
+ if (type == Cue::Type::Hotcue || type == Cue::Type::Intro || type == Cue::Type::Outro) {
listPoints.push_back(pCue);
}
}
@@ -325,16 +325,16 @@ void DlgTrackInfo::populateCues(TrackPointer pTrack) {
// Decode cue type to display text
QString cueType;
switch (pCue->getType()) {
- case Cue::CUE:
+ case Cue::Type::Hotcue:
cueType = "Hotcue";
break;
- case Cue::INTRO:
+ case Cue::Type::Intro:
cueType = "Intro";
break;
- case Cue::OUTRO:
+ case Cue::Type::Outro:
cueType = "Outro";
break;
- default:
+ default:
break;
}
diff --git a/src/mixer/basetrackplayer.cpp b/src/mixer/basetrackplayer.cpp
index d01243771d..12beeecf88 100644
--- a/src/mixer/basetrackplayer.cpp
+++ b/src/mixer/basetrackplayer.cpp
@@ -181,7 +181,7 @@ void BaseTrackPlayerImpl::loadTrack(TrackPointer pTrack) {
QListIterator<CuePointer> it(trackCues);
while (it.hasNext()) {
CuePointer pCue(it.next());
- if (pCue->getType() == Cue::LOOP) {
+ if (pCue->getType() == Cue::Type::Loop) {
double loopStart = pCue->getPosition();
double loopEnd = loopStart + pCue->getLength();
if (loopStart != kNoTrigger && loopEnd != kNoTrigger && loopStart <= loopEnd) {
@@ -220,14 +220,14 @@ TrackPointer BaseTrackPlayerImpl::unloadTrack() {
QListIterator<CuePointer> it(cuePoints);
while (it.hasNext()) {
CuePointer pCue(it.next());
- if (pCue->getType() == Cue::LOOP) {
+ if (pCue->getType() == Cue::Type::Loop) {
pLoopCue = pCue;
}
}
if (!pLoopCue) {
pLoopCue = m_pLoadedTrack->createAndAddCue();
pLoopCue->setSource(Cue::MANUAL);
- pLoopCue->setType(Cue::LOOP);
+ pLoopCue->setType(Cue::Type::Loop);
}
pLoopCue->setPosition(loopStart);
pLoopCue->setLength(loopEnd - loopStart);
diff --git a/src/test/analyzersilence_test.cpp b/src/test/analyzersilence_test.cpp
index 5580d98d2c..32433ba47a 100644
--- a/src/test/analyzersilence_test.cpp
+++ b/src/test/analyzersilence_test.cpp
@@ -54,12 +54,12 @@ TEST_F(AnalyzerSilenceTest, SilenceTrack) {
EXPECT_DOUBLE_EQ(0.0, cue.getPosition());
EXPECT_EQ(Cue::AUTOMATIC, cue.getSource());
- CuePointer pIntroCue = pTrack->findCueByType(Cue::INTRO);
+ CuePointer pIntroCue = pTrack->findCueByType(Cue::Type::Intro);
EXPECT_DOUBLE_EQ(0.0, pIntroCue->getPosition());
EXPECT_DOUBLE_EQ(0.0, pIntroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pIntroCue->getSource());
- CuePointer pOutroCue = pTrack->findCueByType(Cue::OUTRO);
+ CuePointer pOutroCue = pTrack->findCueByType(Cue::Type::Outro);
EXPECT_DOUBLE_EQ(-1.0, pOutroCue->getPosition());
EXPECT_DOUBLE_EQ(nTrackSampleDataLength, pOutroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pOutroCue->getSource());
@@ -78,12 +78,12 @@ TEST_F(AnalyzerSilenceTest, EndToEndToneTrack) {
EXPECT_DOUBLE_EQ(0.0, cue.getPosition());
EXPECT_EQ(Cue::AUTOMATIC, cue.getSource());
- CuePointer pIntroCue = pTrack->findCueByType(Cue::INTRO);
+ CuePointer pIntroCue = pTrack->findCueByType(Cue::Type::Intro);
EXPECT_DOUBLE_EQ(0.0, pIntroCue->getPosition());
EXPECT_DOUBLE_EQ(0.0, pIntroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pIntroCue->getSource());
- CuePointer pOutroCue = pTrack->findCueByType(Cue::OUTRO);
+ CuePointer pOutroCue = pTrack->findCueByType(Cue::Type::Outro);
EXPECT_DOUBLE_EQ(-1.0, pOutroCue->getPosition());
EXPECT_DOUBLE_EQ(nTrackSampleDataLength, pOutroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pOutroCue->getSource());
@@ -112,12 +112,12 @@ TEST_F(AnalyzerSilenceTest, ToneTrackWithSilence) {
EXPECT_DOUBLE_EQ(nTrackSampleDataLength / 4, cue.getPosition());
EXPECT_EQ(Cue::AUTOMATIC, cue.getSource());
- CuePointer pIntroCue = pTrack->findCueByType(Cue::INTRO);
+ CuePointer pIntroCue = pTrack->findCueByType(Cue::Type::Intro);
EXPECT_DOUBLE_EQ(nTrackSampleDataLength / 4, pIntroCue->getPosition());
EXPECT_DOUBLE_EQ(0.0, pIntroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pIntroCue->getSource());
- CuePointer pOutroCue = pTrack->findCueByType(Cue::OUTRO);
+ CuePointer pOutroCue = pTrack->findCueByType(Cue::Type::Outro);
EXPECT_DOUBLE_EQ(-1.0, pOutroCue->getPosition());
EXPECT_DOUBLE_EQ(3 * nTrackSampleDataLength / 4, pOutroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pOutroCue->getSource());
@@ -158,12 +158,12 @@ TEST_F(AnalyzerSilenceTest, ToneTrackWithSilenceInTheMiddle) {
EXPECT_DOUBLE_EQ(oneFifthOfTrackLength, cue.getPosition());
EXPECT_EQ(Cue::AUTOMATIC, cue.getSource());
- CuePointer pIntroCue = pTrack->findCueByType(Cue::INTRO);
+ CuePointer pIntroCue = pTrack->findCueByType(Cue::Type::Intro);
EXPECT_DOUBLE_EQ(oneFifthOfTrackLength, pIntroCue->getPosition());
EXPECT_DOUBLE_EQ(0.0, pIntroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pIntroCue->getSource());
- CuePointer pOutroCue = pTrack->findCueByType(Cue::OUTRO);
+ CuePointer pOutroCue = pTrack->findCueByType(Cue::Type::Outro);
EXPECT_DOUBLE_EQ(-1.0, pOutroCue->getPosition());
EXPECT_DOUBLE_EQ(4 * oneFifthOfTrackLength, pOutroCue->getLength());
EXPECT_EQ(Cue::AUTOMATIC, pOutroCue->getSource());
@@ -175,13 +175,13 @@ TEST_F(AnalyzerSilenceTest, UpdateNonUserAdjustedCues) {
pTrack->setCuePoint(CuePosition(100, Cue::AUTOMATIC)); // Arbitrary value
CuePointer pIntroCue = pTrack->createAndAddCue();
- pIntroCue->setType(Cue::INTRO);
+ pIntroCue->setType(Cue::Type::Intro);
pIntroCue->setSource(Cue::AUTOMATIC);
pIntroCue->setPosition(1000); // Arbitrary value
pIntroCue->setLength(0.0);
CuePointer pOutroCue = pTrack->createAndAddCue();
- pOutroCue->setType(Cue::OUTRO);
+ pOutroCue->setType(Cue::Type::Outro);
pOutroCue->setSource(Cue::AUTOMATIC);
pOutroCue->setPosition(-1.0);
pOutroCue->setLength(9000); // Arbitrary value
@@ -216,13 +216,13 @@ TEST_F(AnalyzerSilenceTest, UpdateNonUserAdjustedRangeCues) {
int thirdTrackLength = nTrackSampleDataLength / 3;
CuePointer pIntroCue = pTrack->createAndAddCue();
- pIntroCue->setType(Cue::INTRO);
+ pIntroCue->setType(Cue::Type::Intro);
pIntroCue->setSource(Cue::AUTOMATIC);
pIntroCue->setPosition(1500.0); // Arbitrary value
pIntroCue->setLength(1000.0); // Arbitrary value
CuePointer pOutroCue = pTrack->createAndAddCue();
- pOutroCue->setType(Cue::OUTRO);
+ pOutroCue->setType(Cue::Type::Outro);
pOutroCue->setSource(Cue::AUTOMATIC);
pOutroCue->setPosition(9000.0); // Arbitrary value
pOutroCue->setLength(1000.0); // Arbitrary value
@@ -263,13 +263,13 @@ TEST_F(AnalyzerSilenceTest, RespectUserEdits) {
pTrack->setCuePoint(CuePosition(kManualCuePosition, Cue::MANUAL));
CuePointer pIntroCue = pTrack->createAndAddCue();
- pIntroCue->setType(Cue::INTRO);
+ pIntroCue->setType(Cue::Type::Intro);
pIntroCue->setSource(Cue::MANUAL);
pIntroCue->setPosition(kManualIntroPosition);
pIntroCue->setLength(0.0);
CuePointer pOutroCue = pTrack->createAndAddCue();
- pOutroCue->setType(Cue::OUTRO);
+ pOutroCue->setType(Cue::Type::Outro);
pOutroCue->setSource(Cue::MANUAL);
pOutroCue->setPosition(-1.0);
pOutroCue->setLength(kManualOutroPosition);
diff --git a/src/test/cuecontrol_test.cpp b/src/test/cuecontrol_test.cpp
index 5e4587c06f..ceac483a49 100644
--- a/src/test/cuecontrol_test.cpp
+++ b/src/test/cuecontrol_test.cpp
@@ -79,12 +79,12 @@ TEST_F(CueControlTest, LoadUnloadTrack) {
TrackPointer pTrack = createTestTrack();
pTrack->setCuePoint(CuePosition(100.0, Cue::MANUAL));
auto pIntro = pTrack->createAndAddCue();
- pIntro->setType(Cue::INTRO);
+ pIntro->setType(Cue::Type::Intro);
pIntro->setSource(Cue::MANUAL);
pIntro->setPosition(150.0);
pIntro->setLength(50.0);
auto pOutro = pTrack->createAndAddCue();
- pOutro->setType(Cue::OUTRO);
+ pOutro->setType(Cue::Type::Outro);
pOutro->setSource(Cue::MANUAL);
pOutro->setPosition(250.0);
pOutro->setLength(50.0);
@@ -118,12 +118,12 @@ TEST_F(CueControlTest, LoadTrackWithDetectedCues) {
TrackPointer pTrack = createTestTrack();
pTrack->setCuePoint(CuePosition(100.0, Cue::AUTOMATIC));
auto pIntro = pTrack->createAndAddCue();
- pIntro->setType(Cue::INTRO);
+ pIntro->setType(Cue::Type::Intro);
pIntro->setSource(Cue::AUTOMATIC);
pIntro->setPosition(100.0);
pIntro->setLength(0.0);
auto pOutro = pTrack->createAndAddCue();
- pOutro->setType(Cue::OUTRO);
+ pOutro->setType(Cue::Type::Outro);
pOutro->setSource(Cue::AUTOMATIC);
pOutro->setPosition(-1.0);
pOutro->setLength(200.0);
@@ -144,12 +144,12 @@ TEST_F(CueControlTest, LoadTrackWithDetectedCues) {
TEST_F(CueControlTest, LoadTrackWithIntroEndAndOutroStart) {
TrackPointer pTrack = createTestTrack();
auto pIntro = pTrack->createAndAddCue();
- pIntro->setType(Cue::INTRO);
+ pIntro->setType(Cue::Type::Intro);
pIntro->setSource(Cue::MANUAL);
pIntro->setPosition(-1.0);
pIntro->setLength(150.0);
auto pOutro = pTrack->createAndAddCue();
- pOutro->setType(Cue::OUTRO);
+ pOutro->setType(Cue::Type::Outro);
pOutro->setSource(Cue::MANUAL);
pOutro->setPosition(250.0);
pOutro->setLength(0.0);
@@ -182,13 +182,13 @@ TEST_F(CueControlTest, LoadAutodetectedCues_QuantizeEnabled) {
pTrack->setCuePoint(CuePosition(1.9 * beatLength, Cue::AUTOMATIC));
auto pIntro = pTrack->createAndAddCue();
- pIntro->setType(Cue::INTRO);
+ pIntro->setType(Cue::Type::Intro);
pIntro->setSource(Cue::AUTOMATIC);
pIntro->setPosition(2.1 * beatLength);
pIntro->setLength(1.2 * beatLength);
auto pOutro = pTrack->createAndAddCue();
- pOutro->setType(Cue::OUTRO);
+ pOutro->setType(Cue::Type::Outro);
pOutro->setSource(Cue::AUTOMATIC);
pOutro->setPosition(11.1 * beatLength);
pOutro->setLength(4.4 * beatLength);
@@ -212,13 +212,13 @@ TEST_F(CueControlTest, LoadAutodetectedCues_QuantizeEnabledNoBeats) {
pTrack->setCuePoint(CuePosition(100.0, Cue::AUTOMATIC));
auto pIntro = pTrack->createAndAddCue();
- pIntro->setType(Cue::INTRO);
+ pIntro->setType(Cue::Type::Intro);
pIntro->setSource(Cue::AUTOMATIC);
pIntro->setPosition(250.0);
pIntro->setLength(150.0);
auto pOutro = pTrack->createAndAddCue();
- pOutro->setType(Cue::OUTRO);
+ pOutro->setType(Cue::Type::Outro);
pOutro->setSource(Cue::AUTOMATIC);
pOutro->setPosition(550.0);
pOutro->setLength(250.0);
@@ -242,13 +242,13 @@ TEST_F(CueControlTest, LoadAutodetectedCues_QuantizeDisabled) {
pTrack->setCuePoint(CuePosition(240.0, Cue::AUTOMATIC));
auto pIntro = pTrack->createAndAddCue();
- pIntro->setType(Cue::INTRO);
+ pIntro->setType(Cue::Type::Intro);
pIntro->setSource(Cue::AUTOMATIC);
pIntro->setPosition(210.0);
pIntro->setLength(120.0);
auto pOutro = pTrack->createAndAddCue();
- pOutro->setType(Cue::OUTRO);
+ pOutro->setType(Cue::Type::Outro);
pOutro->setSource(Cue::AUTOMATIC);
pOutro->setPosition(770.0);
pOutro->setLength(220.0);
@@ -376,7 +376,7 @@ TEST_F(CueControlTest, SeekOnLoadIntroCue) {
TrackPointer pTrack = createTestTrack();
auto pIntro = pTrack->createAndAddCue();
- pIntro->setType(Cue::INTRO);
+ pIntro->setType(Cue::Type::Intro);
pIntro->setSource(Cue::MANUAL);
pIntro->setPosition(200.0);
@@ -405,7 +405,7 @@ TEST_F(CueControlTest, IntroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(-1.0, m_pIntroEndPosition->get());
EXPECT_FALSE(m_pIntroEndEnabled->toBool());
- CuePointer pCue = pTrack->findCueByType(Cue::INTRO);
+ CuePointer pCue = pTrack->findCueByType(Cue::Type::Intro);
EXPECT_NE(nullptr, pCue);
if (pCue != nullptr) {
EXPECT_DOUBLE_EQ(100.0, pCue->getPosition());
@@ -422,7 +422,7 @@ TEST_F(CueControlTest, IntroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(500.0, m_pIntroEndPosition->get());
EXPECT_TRUE(m_pIntroEndEnabled->toBool());
- pCue = pTrack->findCueByType(Cue::INTRO);
+ pCue = pTrack->findCueByType(Cue::Type::Intro);
EXPECT_NE(nullptr, pCue);
if (pCue != nullptr) {
EXPECT_DOUBLE_EQ(100.0, pCue->getPosition());
@@ -438,7 +438,7 @@ TEST_F(CueControlTest, IntroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(500.0, m_pIntroEndPosition->get());
EXPECT_TRUE(m_pIntroEndEnabled->toBool());
- pCue = pTrack->findCueByType(Cue::INTRO);
+ pCue = pTrack->findCueByType(Cue::Type::Intro);
EXPECT_NE(nullptr, pCue);
if (pCue != nullptr) {
EXPECT_DOUBLE_EQ(-1.0, pCue->getPosition());
@@ -454,7 +454,7 @@ TEST_F(CueControlTest, IntroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(-1.0, m_pIntroEndPosition->get());
EXPECT_FALSE(m_pIntroEndEnabled->toBool());
- EXPECT_EQ(nullptr, pTrack->findCueByType(Cue::INTRO));
+ EXPECT_EQ(nullptr, pTrack->findCueByType(Cue::Type::Intro));
}
TEST_F(CueControlTest, OutroCue_SetStartEnd_ClearStartEnd) {
@@ -469,7 +469,7 @@ TEST_F(CueControlTest, OutroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(-1.0, m_pOutroEndPosition->get());
EXPECT_FALSE(m_pOutroEndEnabled->toBool());
- CuePointer pCue = pTrack->findCueByType(Cue::OUTRO);
+ CuePointer pCue = pTrack->findCueByType(Cue::Type::Outro);
EXPECT_NE(nullptr, pCue);
if (pCue != nullptr) {
EXPECT_DOUBLE_EQ(750.0, pCue->getPosition());
@@ -486,7 +486,7 @@ TEST_F(CueControlTest, OutroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(1000.0, m_pOutroEndPosition->get());
EXPECT_TRUE(m_pOutroEndEnabled->toBool());
- pCue = pTrack->findCueByType(Cue::OUTRO);
+ pCue = pTrack->findCueByType(Cue::Type::Outro);
EXPECT_NE(nullptr, pCue);
if (pCue != nullptr) {
EXPECT_DOUBLE_EQ(750.0, pCue->getPosition());
@@ -502,7 +502,7 @@ TEST_F(CueControlTest, OutroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(1000.0, m_pOutroEndPosition->get());
EXPECT_TRUE(m_pOutroEndEnabled->toBool());
- pCue = pTrack->findCueByType(Cue::OUTRO);
+ pCue = pTrack->findCueByType(Cue::Type::Outro);
EXPECT_NE(nullptr, pCue);
if (pCue != nullptr) {
EXPECT_DOUBLE_EQ(-1.0, pCue->getPosition());
@@ -518,5 +518,5 @@ TEST_F(CueControlTest, OutroCue_SetStartEnd_ClearStartEnd) {
EXPECT_DOUBLE_EQ(-1.0, m_pOutroEndPosition->get());
EXPECT_FALSE(m_pOutroEndEnabled->toBool());
- EXPECT_EQ(nullptr, pTrack->findCueByType(Cue::OUTRO));
+ EXPECT_EQ(nullptr, pTrack->findCueByType(Cue::Type::Outro));
}
diff --git a/src/track/cue.cpp b/src/track/cue.cpp
index 1d27df21c6..3110634c85 100644
--- a/src/track/cue.cpp
+++ b/src/track/cue.cpp
@@ -24,7 +24,7 @@ Cue::Cue(TrackId trackId)
m_iId(-1),
m_trackId(trackId),
m_source(UNKNOWN),
- m_type(INVALID),
+ m_type(Cue::Type::Invalid),
m_samplePosition(-1.0),
m_length(0.0),
m_iHotCue(-1),
@@ -33,7 +33,7 @@ Cue::Cue(TrackId trackId)
DEBUG_ASSERT(!m_label.isNull());
}
-Cue::Cue(int id, TrackId trackId, Cue::CueSource source, Cue::CueType type, double position, double length,
+Cue::Cue(int id, TrackId trackId, Cue::CueSource source, Cue::Type type, double position, double length,
int hotCue, QString label, PredefinedColorPointer color)
: m_bDirty(false),
m_iId(id),
@@ -87,12 +87,12 @@ void Cue::setSource(CueSource source) {
emit(updated());
}
-Cue::CueType Cue::getType() const {
+Cue::Type Cue::getType() const {
QMutexLocker lock(&m_mutex);
return m_type;
}
-void Cue::setType(Cue::CueType type) {
+void Cue::setType(Cue::Type type) {
QMutexLocker lock(&m_mutex);
m_type = type;
m_bDirty = true;
diff --git a/src/track/cue.h b/src/track/cue.h
index 6843dab197..df7603f091 100644
--- a/src/track/cue.h
+++ b/src/track/cue.h
@@ -23,15 +23,15 @@ class Cue : public QObject {
MANUAL = 2,
};
- enum CueType {
- INVALID = 0,
- CUE = 1, // hot cue
- LOAD = 2, // the cue
- BEAT = 3,
- LOOP = 4,
- JUMP = 5,
- INTRO = 6,
- OUTRO = 7,
+ enum class Type {
+ Invalid = 0,
+ Hotcue = 1,
+ MainCue = 2,
+ Beat = 3, // unused (what is this for?)
+ Loop = 4,
+ Jump = 5,
+ Intro = 6,
+ Outro = 7,
};
~Cue() override = default;
@@ -43,8 +43,8 @@ class Cue : public QObject {
CueSource getSource() const;
void setSource(CueSource source);
- CueType getType() const;
- void setType(CueType type);
+ Cue::Type getType() const;
+ void setType(Cue::Type type);
double getPosition() const;
void setPosition(double samplePosition);
@@ -68,7 +68,7 @@ class Cue : public QObject {
private:
explicit Cue(TrackId trackId);
- Cue(int id, TrackId trackId, CueSource source, CueType type, double position, double length,
+ Cue(int id, TrackId trackId, CueSource source, Cue::Type type, double position, double length,
int hotCue, QString label, PredefinedColorPointer color);
void setDirty(bool dirty);
void setId(int id);
@@ -80,7 +80,7 @@ class Cue : public QObject {
int m_iId;
TrackId m_trackId;
CueSource m_source;
- CueType m_type;
+ Cue::Type m_type;
double m_samplePosition;
double m_length;
int m_iHotCue;
diff --git a/src/track/track.cpp b/src/track/track.cpp
index 5e8559e033..d5e21e7137 100644
--- a/src/track/track.cpp
+++ b/src/track/track.cpp
@@ -732,13 +732,13 @@ void Track::setCuePoint(CuePosition cue) {
}
// Store the cue point in a load cue
- CuePointer pLoadCue = findCueByType(Cue::LOAD);
+ CuePointer pLoadCue = findCueByType(Cue::Type::MainCue);
Cue::CueSource source = cue.getSource();
double position = cue.getPosition();
if (position != 0.0 && position != -1.0) {
if (!pLoadCue) {
pLoadCue = CuePointer(new Cue(m_record.getId()));
- pLoadCue->setType(Cue::LOAD);
+ pLoadCue->setType(Cue::Type::MainCue);
connect(pLoadCue.get(), SIGNAL(updated()),
this, SLOT(slotCueUpdated()));
m_cuePoints.push_back(pLoadCue);
@@ -775,10 +775,10 @@ CuePointer Track::createAndAddCue() {
return pCue;
}
-CuePointer Track::findCueByType(Cue::CueType type) const {
+CuePointer Track::findCueByType(Cue::Type type) const {
// This method cannot be used for hotcues because there can be
// multiple hotcues and this function returns only a single CuePointer.
- DEBUG_ASSERT(type != Cue::CUE);
+ DEBUG_ASSERT(type != Cue::Type::Hotcue);
QMutexLocker lock(&m_qMutex);
for (const CuePointer& pCue: m_cuePoints) {
if (pCue->getType() == type) {
@@ -796,20 +796,20 @@ void Track::removeCue(const CuePointer& pCue) {
QMutexLocker lock(&m_qMutex);
disconnect(pCue.get(), 0, this, 0);
m_cuePoints.removeOne(pCue);
- if (pCue->getType() == Cue::LOAD) {
+ if (pCue->getType() == Cue::Type::MainCue) {
m_record.setCuePoint(CuePosition());
}
markDirtyAndUnlock(&lock);
emit(cuesUpdated());
}
-void Track::removeCuesOfType(Cue::CueType type) {
+void Track::removeCuesOfType(Cue::Type type) {
QMutexLocker lock(&m_qMutex);
bool dirty = false;
QMutableListIterator<CuePointer> it(m_cuePoints);
while (it.hasNext()) {
CuePointer pCue = it.next();
- // FIXME: Why does this only work for the CUE CueType?
+ // FIXME: Why does this only work for the Hotcue Type?
if (pCue->getType() == type) {
disconnect(pCue.get(), 0, this, 0);
it.remove();
@@ -843,7 +843,7 @@ void Track::setCuePoints(const QList<CuePointer>& cuePoints) {
connect(pCue.get(), SIGNAL(updated()),
this, SLOT(slotCueUpdated()));
// update main cue point
- if (pCue->getType() == Cue::LOAD) {
+ if (pCue->getType() == Cue::Type::MainCue) {
m_record.setCuePoint(CuePosition(pCue->getPosition(), pCue->getSource()));
}
}
diff --git a/src/track/track.h b/src/track/track.h
index cfdc2d3a4e..21e1149acd 100644
--- a/src/track/track.h
+++ b/src/track/track.h
@@ -250,9 +250,9 @@ class Track : public QObject {
// Calls for managing the track's cue points
CuePointer createAndAddCue();
- CuePointer findCueByType(Cue::CueType type) const; // NOTE: Cannot be used for hotcues.
+ CuePointer findCueByType(Cue::Type type) const; // NOTE: Cannot be used for hotcues.
void removeCue(const CuePointer& pCue);
- void removeCuesOfType(Cue::CueType);
+ void removeCuesOfType(Cue::Type);
QList<CuePointer> getCuePoints() const;
void setCuePoints(const QList<CuePointer>& cuePoints);
diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp
index 85024eb684..dab0f17d8d 100644
--- a/src/widget/wtracktableview.cpp
+++ b/src/widget/wtracktableview.cpp
@@ -1844,7 +1844,7 @@ void WTrackTableView::slotClearMainCue() {
for (const QModelIndex& index : indices) {
TrackPointer pTrack = trackModel->getTrack(index);
if (pTrack) {
- pTrack->removeCuesOfType(Cue::LOAD);
+ pTrack->removeCuesOfType(Cue::Type::MainCue);
}
}
}
@@ -1860,7 +1860,7 @@ void WTrackTableView::slotClearHotCues() {
for (const QModelIndex& index : indices) {
TrackPointer pTrack = trackModel->getTrack(index);
if (pTrack) {
- pTrack->removeCuesOfType(Cue::CUE);
+ pTrack->removeCuesOfType(Cue::Type::Hotcue);
}
}
}
@@ -1876,7 +1876,7 @@ void WTrackTableView::slotClearLoop() {
for (const QModelIndex& index : indices) {
TrackPointer pTrack = trackModel->getTrack(index);
if (pTrack) {
- pTrack->removeCuesOfType(Cue::LOOP);
+ pTrack->removeCuesOfType(Cue::Type::Loop);
}
}
}