summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-05-13 18:17:55 +0200
committerUwe Klotz <uklotz@mixxx.org>2020-05-13 18:17:55 +0200
commit14d12aa33947072aac1beaab648816e21f844c7c (patch)
tree0f2ed62f175ed8c8439dd682f0198011b4c11878
parentc2da82004f5785b1b23895b333e19a4dbf2f035e (diff)
parentd7b5e1b71631b960cffa6506a2d5746c05aa7bdf (diff)
Merge branch '2.3' of git@github.com:mixxxdj/mixxx.git
-rw-r--r--CHANGELOG.md1
-rw-r--r--[-rwxr-xr-x]build/debian/rules11
-rw-r--r--build/features.py9
-rw-r--r--build/wix/Localization/po/nl-NL.po101
-rw-r--r--lib/libshout/SConscript6
-rw-r--r--src/controllers/midi/midicontroller.cpp10
-rw-r--r--src/engine/controls/bpmcontrol.cpp103
-rw-r--r--src/engine/enginebuffer.h1
-rw-r--r--src/library/rekordbox/rekordboxfeature.cpp8
-rw-r--r--src/test/enginesynctest.cpp808
-rw-r--r--src/track/beatmap.cpp3
11 files changed, 657 insertions, 404 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fddae7eab6..e1eae15966 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -89,6 +89,7 @@
* Add controller mapping for Stanton DJC.4 #2607
* Fix broadcasting via broadcast/recording input lp:1876222 #2743
* Only apply ducking gain in manual ducking mode when talkover is enabed lp:1394968 lp:1737113 lp:1662536 #2759
+* Ignore MIDI Clock Messages (0xF8) because they are not usable in Mixxx and inhibited the screensaver #2786
## [2.2.3](https://launchpad.net/mixxx/+milestone/2.2.3) (2019-11-24)
diff --git a/build/debian/rules b/build/debian/rules
index 343d719415..7191d81a7b 100755..100644
--- a/build/debian/rules
+++ b/build/debian/rules
@@ -6,15 +6,18 @@
# Build flags are passed in from the SConscript. The following line is replaced
# via exact-string matching so do not change it!
MIXXX_SCONS_FLAGS = ""
+MIXXX_BUILD_FOLDER = "linux_build"
# If ARCH is set to a different architecture when running pbuilder, pbuilder
# will be set to create an environment to build packages for the architecture
# specified in ARCH.
ifneq (,$(findstring i386,$(ARCH)))
- MIXXX_SCONS_FLAGS += machine=x86
+ MIXXX_SCONS_FLAGS += machine=x86
+ MIXXX_BUILD_FOLDER = "lin32_build"
endif
ifneq (,$(findstring amd64,$(ARCH)))
- MIXXX_SCONS_FLAGS += machine=x86_64
+ MIXXX_SCONS_FLAGS += machine=x86_64
+ MIXXX_BUILD_FOLDER = "lin64_build"
endif
# parallel builds for scons
@@ -49,9 +52,9 @@ endif
override_dh_auto_clean:
scons $(MIXXX_SCONS_FLAGS) -c || true
- rm -rf .sconf_temp/ cache/ linux_build/
+ rm -rf .sconf_temp/ cache/ $(MIXXX_BUILD_FOLDER)/
dh_clean .sconsign.dblite cachecustom.py \
- config.log src/build.h build/*.pyc mixxx.1
+ config.log src/build.h build/*.pyc mixxx.1 lib/*/lib/*.a
dh_auto_clean
override_dh_auto_install:
diff --git a/build/features.py b/build/features.py
index 8946de8b79..33b9e13d20 100644
--- a/build/features.py
+++ b/build/features.py
@@ -728,6 +728,7 @@ class LiveBroadcasting(Feature):
# Clone our main environment so we don't change any settings in the
# Mixxx environment
libshout_env = build.env.Clone()
+ libshout_env['LIB_OUTPUT'] = '#lib/libshout/lib'
if build.toolchain_is_gnu:
libshout_env.Append(CCFLAGS='-pthread')
@@ -739,10 +740,14 @@ class LiveBroadcasting(Feature):
env = libshout_env
SCons.Export('env')
SCons.Export('build')
- env.SConscript(env.File('SConscript', libshout_dir))
+ env.SConscript(
+ env.File('SConscript', libshout_dir),
+ variant_dir="lib/libshout2",
+ duplicate=0,
+ exports=['build'])
build.env.Append(CPPPATH="#lib/libshout/include")
- build.env.Append(LIBPATH=libshout_dir)
+ build.env.Append(LIBPATH='#lib/libshout/lib')
build.env.Append(LIBS=['shout_mixxx', 'ogg', 'vorbis', 'theora', 'speex', 'ssl', 'crypto'])
depends.Qt.uic(build)('src/preferences/dialog/dlgprefbroadcastdlg.ui')
diff --git a/build/wix/Localization/po/nl-NL.po b/build/wix/Localization/po/nl-NL.po
index e61ba58b0d..87b267a701 100644
--- a/build/wix/Localization/po/nl-NL.po
+++ b/build/wix/Localization/po/nl-NL.po
@@ -1,6 +1,7 @@
#
# Translators:
# Henk Gordebeke <scheidsinfo@ziggo.nl>, 2017
+# Mario Moens <marimo.it4u@gmail.com>, 2020
# Raf Van De Meirssche <raf@rafke.be>, 2016
# Raf Van De Meirssche <raf@rafke.be>, 2016
# S.Brandt <s.brandt@mixxx.org>, 2018
@@ -9,8 +10,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Mixxx DJ Windows installer\n"
-"PO-Revision-Date: 2019-04-17 21:53+0000\n"
-"Last-Translator: S.Brandt <s.brandt@mixxx.org>\n"
+"PO-Revision-Date: 2020-05-05 13:41+0000\n"
+"Last-Translator: Mario Moens <marimo.it4u@gmail.com>\n"
"Language-Team: Dutch (Netherlands) (http://www.transifex.com/mixxx-dj-software/mixxxdj-windows-installer/language/nl_NL/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -166,23 +167,23 @@ msgstr "Hulpbestanden die Mixxx toelaten om te werken met andere talen dan Ameri
#. Bootstrapper
msgctxt "Caption"
msgid "[WixBundleName] Setup"
-msgstr ""
+msgstr "[WixBundleName] Setup"
msgctxt "Title"
msgid "[WixBundleName]"
-msgstr ""
+msgstr "[WixBundleName]"
msgctxt "ConfirmCancelMessage"
msgid "Are you sure you want to cancel?"
-msgstr ""
+msgstr "Weet je zeker dat je dit wilt annuleren?"
msgctxt "ExecuteUpgradeRelatedBundleMessage"
msgid "Previous version"
-msgstr ""
+msgstr "Vorige versie"
msgctxt "HelpHeader"
msgid "Setup Help"
-msgstr ""
+msgstr "Setup Help"
msgctxt "HelpText"
msgid ""
@@ -196,178 +197,178 @@ msgid ""
" /norestart - suppress any attempts to restart. By default user interface will prompt before restart.\n"
"\n"
" /log log.txt - logs to a specific file. By default a log file is created in %TEMP%."
-msgstr ""
+msgstr "/installeren | /herstellen | /verwijderen | /layout [directory] - installeert, repareert, verwijdert of\n maakt een complete lokale kopie van de bundel in de directory.\n Installeren is de standaard.\n\n /passief | /stil - geeft een minimale gebruikersinterface weer zonder prompts of geeft geen gebruikersinterface weer\n en geen prompts. Standaard worden de gebruikersinterface en alle prompts weergegeven.\n\n /norestart - onderdruk pogingen om opnieuw op te starten. Standaard vraagt de gebruikersinterface om opnieuw op te starten.\n\n /log log.txt - logt in op een specifiek bestand. Standaard wordt een logbestand gemaakt in% TEMP%."
msgctxt "HelpCloseButton"
msgid "&Close"
-msgstr ""
+msgstr "&Sluiten"
msgctxt "InstallHeader"
msgid "Welcome"
-msgstr ""
+msgstr "Welkom"
msgctxt "InstallMessage"
msgid ""
"Setup will install Mixxx on your computer.\n"
"It will first install required third party libraries, then Mixxx itself.\n"
"Click Install to continue or Close to exit."
-msgstr ""
+msgstr "Setup installeert Mixxx op uw computer.\nHet zal eerst de vereiste bibliotheken van derden installeren en vervolgens Mixxx zelf.\nKlik op Installeren om door te gaan of op Sluiten om af te sluiten."
msgctxt "InstallVersion"
msgid "Version [WixBundleVersion]"
-msgstr ""
+msgstr "[WixBundleVersion] Versie"
msgctxt "InstallOptionsButton"
msgid "&Options"
-msgstr ""
+msgstr "&Opties"
msgctxt "InstallInstallButton"
msgid "&Install"
-msgstr ""
+msgstr "&Installeer"
msgctxt "InstallCloseButton"
msgid "&Close"
-msgstr ""
+msgstr "&Sluiten"
msgctxt "OptionsHeader"
msgid "Setup Options"
-msgstr ""
+msgstr "Setup Opties"
msgctxt "OptionsLocationLabel"
msgid "Install location:"
-msgstr ""
+msgstr "Installatielocatie:"
msgctxt "OptionsBrowseButton"
msgid "&Browse"
-msgstr ""
+msgstr "&Bladeren"
msgctxt "OptionsOkButton"
msgid "&OK"
-msgstr ""
+msgstr "&OK"
msgctxt "OptionsCancelButton"
msgid "&Cancel"
-msgstr ""
+msgstr "&Anulleren"
msgctxt "FilesInUseHeader"
msgid "Files In Use"
-msgstr ""
+msgstr "Bestanden in gebruik"
msgctxt "FilesInUseLabel"
msgid "The following applications are using files that need to be updated:"
-msgstr ""
+msgstr "De volgende toepassingen maken gebruik van bestanden die moeten worden bijgewerkt:"
msgctxt "FilesInUseCloseRadioButton"
msgid "Close the &applications and attempt to restart them."
-msgstr ""
+msgstr "Sluit de &applicaties en probeer ze opnieuw op te starten."
msgctxt "FilesInUseDontCloseRadioButton"
msgid "&Do not close applications. A reboot will be required."
-msgstr ""
+msgstr "&Sluit applicaties niet. Opnieuw opstarten is vereist."
msgctxt "FilesInUseOkButton"
msgid "&OK"
-msgstr ""
+msgstr "&OK"
msgctxt "FilesInUseCancelButton"
msgid "&Cancel"
-msgstr ""
+msgstr "&Anulleren"
msgctxt "ProgressHeader"
msgid "Setup Progress"
-msgstr ""
+msgstr "Setup Voortgang"
msgctxt "ProgressLabel"
msgid "Processing:"
-msgstr ""
+msgstr "Verwerken:"
msgctxt "OverallProgressPackageText"
msgid "Initializing..."
-msgstr ""
+msgstr "Initialiseren..."
msgctxt "ProgressCancelButton"
msgid "&Cancel"
-msgstr ""
+msgstr "&Anulleren"
msgctxt "ModifyHeader"
msgid "Modify Setup"
-msgstr ""
+msgstr "Setup wijzigen"
msgctxt "ModifyRepairButton"
msgid "&Repair"
-msgstr ""
+msgstr "&Herstellen"
msgctxt "ModifyUninstallButton"
msgid "&Uninstall"
-msgstr ""
+msgstr "&Verwijderen"
msgctxt "ModifyCloseButton"
msgid "&Close"
-msgstr ""
+msgstr "&Sluten"
msgctxt "SuccessHeader"
msgid "Setup Successful"
-msgstr ""
+msgstr "Setup succesvol"
msgctxt "SuccessInstallHeader"
msgid "Mixxx installation has been successful"
-msgstr ""
+msgstr "Mixxx-installatie is geslaagd"
msgctxt "SuccessRepairHeader"
msgid "Mixxx repair has been successful"
-msgstr ""
+msgstr "Mixxx-herstel is geslaagd"
msgctxt "SuccessUninstallHeader"
msgid "Mixxx uninstall has been successful"
-msgstr ""
+msgstr "Mixxx verwijderen is geslaagd"
msgctxt "SuccessLaunchButton"
msgid "&Launch"
-msgstr ""
+msgstr "&Opstarten"
msgctxt "SuccessRestartText"
msgid "You must restart your computer before you can use the software."
-msgstr ""
+msgstr "U moet uw computer opnieuw opstarten voordat u de software kunt gebruiken."
msgctxt "SuccessRestartButton"
msgid "&Restart"
-msgstr ""
+msgstr "&Herstarten"
msgctxt "SuccessCloseButton"
msgid "&Close"
-msgstr ""
+msgstr "&Sluten"
msgctxt "FailureHeader"
msgid "Setup Failed"
-msgstr ""
+msgstr "Installatie mislukt"
msgctxt "FailureInstallHeader"
msgid "Mixxx installation failed"
-msgstr ""
+msgstr "Mixxx-installatie mislukt"
msgctxt "FailureRepairHeader"
msgid "Mixxx repair failed"
-msgstr ""
+msgstr "Mixxx-herstel mislukt"
msgctxt "FailureUninstallHeader"
msgid "Mixxx uninstall failed"
-msgstr ""
+msgstr "Mixxx verwijderen is mislukt"
msgctxt "FailureHyperlinkLogText"
msgid ""
"One or more issues caused the setup to fail. Please fix the issues and then "
"retry setup. For more information see the <a href=\"#\">log file</a>."
-msgstr ""
+msgstr "Door een of meer problemen is de installatie mislukt. Los de problemen op en probeer het opnieuw. Zie het <a href=\"#\">logbestand</a> voor meer informatie."
msgctxt "FailureRestartText"
msgid ""
"You must restart your computer to complete the rollback of the software."
-msgstr ""
+msgstr "U moet uw computer opnieuw opstarten om het terugdraaien van de software te voltooien."
msgctxt "FailureRestartButton"
msgid "&Restart"
-msgstr ""
+msgstr "&Herstarten"
msgctxt "FailureCloseButton"
msgid "&Close"
-msgstr ""
+msgstr "&Sluten"
diff --git a/lib/libshout/SConscript b/lib/libshout/SConscript
index 7502884e09..9d415a2d39 100644
--- a/lib/libshout/SConscript
+++ b/lib/libshout/SConscript
@@ -32,4 +32,8 @@ env.Append(CPPDEFINES='HAVE_CONFIG_H')
env.Append(CPPPATH='src/common')
env.Append(CPPPATH='include')
-env.StaticLibrary(target='libshout_mixxx', source=libshout_sources)
+libshout_mixxx = env.StaticLibrary(target='libshout_mixxx', source=libshout_sources)
+
+# Install the libraries if needed.
+if 'LIB_OUTPUT' in env.Dictionary():
+ env.Install('$LIB_OUTPUT', source=[libshout_mixxx])
diff --git a/src/controllers/midi/midicontroller.cpp b/src/controllers/midi/midicontroller.cpp
index 7f6c8ea5d6..6fc17d82a9 100644
--- a/src/controllers/midi/midicontroller.cpp
+++ b/src/controllers/midi/midicontroller.cpp
@@ -201,6 +201,16 @@ void MidiController::receive(unsigned char status, unsigned char control,
unsigned char channel = MidiUtils::channelFromStatus(status);
unsigned char opCode = MidiUtils::opCodeFromStatus(status);
+ // Ignore MIDI beat clock messages (0xF8) until we have proper MIDI sync in
+ // Mixxx. These messages are not suitable to use in JS anyway, as they are
+ // sent at 24 ppqn (i.e. one message every 20.83 ms for a 120 BPM track)
+ // and require real-time code. Currently, they are only spam on the
+ // console, inhibit the screen saver unintentionally, could potentially
+ // slow down Mixxx or interfere with the learning wizard.
+ if (status == 0xF8) {
+ return;
+ }
+
controllerDebug(MidiUtils::formatMidiMessage(getName(), status, control, value,
channel, opCode, timestamp));
MidiKey mappingKey(status, control);
diff --git a/src/engine/controls/bpmcontrol.cpp b/src/engine/controls/bpmcontrol.cpp
index 4d0ceb153f..0d1bde3af0 100644
--- a/src/engine/controls/bpmcontrol.cpp
+++ b/src/engine/controls/bpmcontrol.cpp
@@ -434,7 +434,8 @@ double BpmControl::calcSyncAdjustment(bool userTweakingSync) {
kLogger.trace() << m_group << "****************";
kLogger.trace() << "master beat distance:" << syncTargetBeatDistance;
kLogger.trace() << "my beat distance:" << thisBeatDistance;
- kLogger.trace() << "error :" << (shortest_distance - m_dUserOffset.getValue());
+ kLogger.trace() << "error :"
+ << (shortest_distance - m_dUserOffset.getValue());
kLogger.trace() << "user offset :" << m_dUserOffset.getValue();
}
@@ -730,43 +731,11 @@ double BpmControl::getBeatMatchPosition(
if (!m_pBeats) {
return dThisPosition;
}
-
- // Get the current position of this deck.
- double dThisPrevBeat = m_pPrevBeat->get();
- double dThisNextBeat = m_pNextBeat->get();
- double dThisBeatLength;
- if (dThisPosition > dThisNextBeat || dThisPosition < dThisPrevBeat) {
- if (kLogger.traceEnabled()) {
- kLogger.trace() << "BpmControl::getNearestPositionInPhase out of date"
- << dThisPosition << dThisNextBeat << dThisPrevBeat;
- }
- // This happens if dThisPosition is the target position of a requested
- // seek command
- if (!getBeatContext(
- m_pBeats,
- dThisPosition,
- &dThisPrevBeat,
- &dThisNextBeat,
- &dThisBeatLength,
- nullptr)) {
- return dThisPosition;
- }
- } else {
- if (!getBeatContextNoLookup(
- dThisPosition,
- dThisPrevBeat,
- dThisNextBeat,
- &dThisBeatLength,
- nullptr)) {
- return dThisPosition;
- }
+ // Explicit master buffer is always in sync!
+ if (getSyncMode() == SYNC_MASTER_EXPLICIT) {
+ return dThisPosition;
}
- double dOtherPrevBeat;
- double dOtherNextBeat;
- double dOtherBeatLength;
- double dOtherBeatFraction;
-
EngineBuffer* pOtherEngineBuffer = nullptr;
// explicit master always syncs to itself, so set to null
if (getSyncMode() != SYNC_MASTER_EXPLICIT) {
@@ -783,6 +752,44 @@ double BpmControl::getBeatMatchPosition(
return dThisPosition;
}
+ // Get the current position of this deck.
+ double dThisPrevBeat = m_pPrevBeat->get();
+ double dThisNextBeat = m_pNextBeat->get();
+ double dThisBeatLength = -1;
+
+ // Look up the next beat and beat length for the new position
+ if (dThisNextBeat == -1 ||
+ dThisPosition > dThisNextBeat ||
+ (dThisPrevBeat != -1 && dThisPosition < dThisPrevBeat)) {
+ if (kLogger.traceEnabled()) {
+ kLogger.trace() << "BpmControl::getNearestPositionInPhase out of date"
+ << dThisPosition << dThisNextBeat << dThisPrevBeat;
+ }
+ // This happens if dThisPosition is the target position of a requested
+ // seek command
+ getBeatContext(
+ m_pBeats,
+ dThisPosition,
+ &dThisPrevBeat,
+ &dThisNextBeat,
+ &dThisBeatLength,
+ nullptr);
+ // now we either have a useful next beat or there is none
+ if (dThisNextBeat == -1) {
+ // We can't match the next beat, give up.
+ return dThisPosition;
+ }
+ } else {
+ // We are between the previous and next beats so we can try a standard
+ // lookup of the beat length.
+ getBeatContextNoLookup(
+ dThisPosition,
+ dThisPrevBeat,
+ dThisNextBeat,
+ &dThisBeatLength,
+ nullptr);
+ }
+
TrackPointer otherTrack = pOtherEngineBuffer->getLoadedTrack();
mixxx::BeatsPointer otherBeats = otherTrack ? otherTrack->getBeats() : mixxx::BeatsPointer();
@@ -793,6 +800,10 @@ double BpmControl::getBeatMatchPosition(
double dOtherPosition = pOtherEngineBuffer->getExactPlayPos();
+ double dOtherPrevBeat = -1;
+ double dOtherNextBeat = -1;
+ double dOtherBeatLength = -1;
+ double dOtherBeatFraction = -1;
if (!BpmControl::getBeatContext(
otherBeats,
dOtherPosition,
@@ -803,6 +814,11 @@ double BpmControl::getBeatMatchPosition(
return dThisPosition;
}
+ if (dOtherBeatLength == -1 || dOtherBeatFraction == -1) {
+ // the other Track has no usable beat info, do not seek.
+ return dThisPosition;
+ }
+
double dThisSampleRate = m_pBeats->getSampleRate();
double dThisRateRatio = m_pRateRatio->get();
@@ -825,12 +841,14 @@ double BpmControl::getBeatMatchPosition(
double seekMatch = (thisDivSec - otherDivSec) *
dThisSampleRate * dThisRateRatio;
- if (dThisBeatLength / 2 < seekMatch) {
- // seek to previous beat, because of shorter distance
- seekMatch -= dThisBeatLength;
- } else if (dThisBeatLength / 2 < -seekMatch) {
- // seek to beat after next, because of shorter distance
- seekMatch += dThisBeatLength;
+ if (dThisBeatLength > 0) {
+ if (dThisBeatLength / 2 < seekMatch) {
+ // seek to previous beat, because of shorter distance
+ seekMatch -= dThisBeatLength;
+ } else if (dThisBeatLength / 2 < -seekMatch) {
+ // seek to beat after next, because of shorter distance
+ seekMatch += dThisBeatLength;
+ }
}
double dNewPlaypos = dThisPosition + seekMatch;
@@ -875,7 +893,6 @@ double BpmControl::getBeatMatchPosition(
// loops are catching
}
}
-
return dNewPlaypos;
}
diff --git a/src/engine/enginebuffer.h b/src/engine/enginebuffer.h
index d89262cf67..f0a8fb9909 100644
--- a/src/engine/enginebuffer.h
+++ b/src/engine/enginebuffer.h
@@ -265,6 +265,7 @@ class EngineBuffer : public EngineObject {
FRIEND_TEST(EngineSyncTest, HalfDoubleBpmTest);
FRIEND_TEST(EngineSyncTest, HalfDoubleThenPlay);
FRIEND_TEST(EngineSyncTest, UserTweakBeatDistance);
+ FRIEND_TEST(EngineSyncTest, BeatMapQantizePlay);
FRIEND_TEST(EngineBufferTest, ScalerNoTransport);
EngineSync* m_pEngineSync;
SyncControl* m_pSyncControl;
diff --git a/src/library/rekordbox/rekordboxfeature.cpp b/src/library/rekordbox/rekordboxfeature.cpp
index 53a8b2d837..fa310b88e9 100644
--- a/src/library/rekordbox/rekordboxfeature.cpp
+++ b/src/library/rekordbox/rekordboxfeature.cpp
@@ -1287,12 +1287,12 @@ QString RekordboxFeature::formatRootViewHtml() const {
QStringList items;
items
- << tr("Playlists")
<< tr("Folders")
- << tr("First memory cue")
- << tr("First memory loop")
+ << tr("Playlists")
+ << tr("Beatgrids")
<< tr("Hot cues")
- << tr("Beatgrids");
+ << tr("Memory cues")
+ << tr("Loops (after first not usable in Mixxx 2.3 yet)");
QString html;
QString refreshLink = tr("Check for attached Rekordbox devices (refresh)");
diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp
index 1781783163..470f4a976c 100644
--- a/src/test/enginesynctest.cpp
+++ b/src/test/enginesynctest.cpp
@@ -58,12 +58,19 @@ class EngineSyncTest : public MockedEngineBackendTest {
void assertSyncOff(QString group) {
if (group == m_sInternalClockGroup) {
ASSERT_EQ(0,
- ControlObject::getControl(ConfigKey(m_sInternalClockGroup,
- "sync_master"))->get());
+ ControlObject::getControl(
+ ConfigKey(m_sInternalClockGroup, "sync_master"))
+ ->get());
} else {
- ASSERT_EQ(SYNC_NONE, ControlObject::getControl(ConfigKey(group, "sync_mode"))->get());
- ASSERT_EQ(0, ControlObject::getControl(ConfigKey(group, "sync_enabled"))->get());
- ASSERT_EQ(0, ControlObject::getControl(ConfigKey(group, "sync_master"))->get());
+ ASSERT_EQ(SYNC_NONE,
+ ControlObject::getControl(ConfigKey(group, "sync_mode"))
+ ->get());
+ ASSERT_EQ(0,
+ ControlObject::getControl(ConfigKey(group, "sync_enabled"))
+ ->get());
+ ASSERT_EQ(0,
+ ControlObject::getControl(ConfigKey(group, "sync_master"))
+ ->get());
}
}
@@ -129,22 +136,26 @@ class EngineSyncTest : public MockedEngineBackendTest {
TEST_F(EngineSyncTest, ControlObjectsExist) {
// This isn't exhaustive, but certain COs have a habit of not being set up properly.
- ASSERT_TRUE(ControlObject::getControl(ConfigKey(m_sGroup1, "file_bpm")) != NULL);
+ ASSERT_TRUE(ControlObject::getControl(ConfigKey(m_sGroup1, "file_bpm")) !=
+ NULL);
}
TEST_F(EngineSyncTest, SetMasterSuccess) {
// If we set the first channel to master, EngineSync should get that message.
- auto pButtonMasterSync1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonMasterSync1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
pButtonMasterSync1->slotSet(SYNC_MASTER_EXPLICIT);
ProcessBuffer();
// No tracks are playing and we have no beats, SYNC_MASTER_EXPLICIT state is in stand-by
- EXPECT_FLOAT_EQ(0.0, ControlObject::getControl(ConfigKey(m_sGroup1, "bpm"))->get());
+ EXPECT_FLOAT_EQ(
+ 0.0, ControlObject::getControl(ConfigKey(m_sGroup1, "bpm"))->get());
// The master sync should now be channel 1.
ASSERT_TRUE(isExplicitMaster(m_sGroup1));
- auto pButtonMasterSync2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
+ auto pButtonMasterSync2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
pButtonMasterSync2->set(SYNC_FOLLOWER);
ProcessBuffer();
@@ -183,14 +194,16 @@ TEST_F(EngineSyncTest, ExplicitMasterPersists) {
mixxx::BeatsPointer pBeats2 = BeatFactory::makeBeatGrid(*m_pTrack2, 124, 0.0);
m_pTrack2->setBeats(pBeats2);
- auto pButtonMasterSync1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonMasterSync1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
ControlObject::getControl(ConfigKey(m_sGroup1, "play"))->set(1.0);
pButtonMasterSync1->slotSet(SYNC_MASTER_EXPLICIT);
ProcessBuffer();
// The master sync should now be channel 1.
ASSERT_TRUE(isExplicitMaster(m_sGroup1));
- auto pButtonMasterSync2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
+ auto pButtonMasterSync2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
ControlObject::getControl(ConfigKey(m_sGroup2, "play"))->set(1.0);
pButtonMasterSync2->set(1.0);
ProcessBuffer();
@@ -215,11 +228,14 @@ TEST_F(EngineSyncTest, SetMasterWhilePlaying) {
mixxx::BeatsPointer pBeats3 = BeatFactory::makeBeatGrid(*m_pTrack3, 128, 0.0);
m_pTrack3->setBeats(pBeats3);
- auto pButtonMasterSync1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonMasterSync1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
pButtonMasterSync1->set(SYNC_MASTER_EXPLICIT);
- auto pButtonMasterSync2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
+ auto pButtonMasterSync2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
pButtonMasterSync2->slotSet(SYNC_FOLLOWER);
- auto pButtonMasterSync3 = std::make_unique<ControlProxy>(m_sGroup3, "sync_mode");
+ auto pButtonMasterSync3 =
+ std::make_unique<ControlProxy>(m_sGroup3, "sync_mode");
pButtonMasterSync3->slotSet(SYNC_FOLLOWER);
ControlObject::getControl(ConfigKey(m_sGroup1, "play"))->set(1.0);
@@ -241,7 +257,8 @@ TEST_F(EngineSyncTest, SetEnabledBecomesMaster) {
// If we set the first channel with a valid tempo to follower, it should be master.
mixxx::BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 80, 0.0);
m_pTrack1->setBeats(pBeats1);
- auto pButtonMasterSync1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonMasterSync1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
pButtonMasterSync1->slotSet(SYNC_FOLLOWER);
ProcessBuffer();
@@ -250,11 +267,14 @@ TEST_F(EngineSyncTest, SetEnabledBecomesMaster) {
}
TEST_F(EngineSyncTest, DisableInternalMasterWhilePlaying) {
- auto pButtonMasterSync = std::make_unique<ControlProxy>(m_sInternalClockGroup, "sync_master");
+ auto pButtonMasterSync = std::make_unique<ControlProxy>(
+ m_sInternalClockGroup, "sync_master");
pButtonMasterSync->slotSet(1.0);
- auto pButtonSyncMode1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonSyncMode1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
pButtonSyncMode1->slotSet(SYNC_FOLLOWER);
- auto pButtonSyncMode2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
+ auto pButtonSyncMode2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
pButtonSyncMode2->slotSet(SYNC_FOLLOWER);
ProcessBuffer();
@@ -283,12 +303,14 @@ TEST_F(EngineSyncTest, DisableSyncOnMaster) {
// Channel 1 follower, channel 2 master.
mixxx::BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 130, 0.0);
m_pTrack1->setBeats(pBeats1);
- auto pButtonSyncMode1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonSyncMode1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
pButtonSyncMode1->slotSet(SYNC_FOLLOWER);
mixxx::BeatsPointer pBeats2 = BeatFactory::makeBeatGrid(*m_pTrack2, 130, 0.0);
m_pTrack2->setBeats(pBeats2);
- auto pButtonSyncMaster2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_master");
+ auto pButtonSyncMaster2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_master");
pButtonSyncMaster2->slotSet(1.0);
// TODO(owilliams): explicit master is disabled, so regular master sync is
@@ -298,7 +320,8 @@ TEST_F(EngineSyncTest, DisableSyncOnMaster) {
ASSERT_TRUE(isSoftMaster(m_sInternalClockGroup));
// Unset enabled on channel2, it should work.
- auto pButtonSyncEnabled2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
+ auto pButtonSyncEnabled2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
pButtonSyncEnabled2->slotSet(0.0);
ASSERT_TRUE(isSoftMaster(m_sGroup1));
@@ -308,22 +331,26 @@ TEST_F(EngineSyncTest, DisableSyncOnMaster) {
TEST_F(EngineSyncTest, InternalMasterSetFollowerSliderMoves) {
// If internal is master, and we turn on a follower, the slider should move.
- auto pButtonMasterSyncInternal = std::make_unique<ControlProxy>(m_sInternalClockGroup, "sync_master");
+ auto pButtonMasterSyncInternal = std::make_unique<ControlProxy>(
+ m_sInternalClockGroup, "sync_master");
pButtonMasterSyncInternal->slotSet(1);
- auto pMasterSyncSlider = std::make_unique<ControlProxy>(m_sInternalClockGroup, "bpm");
+ auto pMasterSyncSlider =
+ std::make_unique<ControlProxy>(m_sInternalClockGroup, "bpm");
pMasterSyncSlider->set(100.0);
// Set the file bpm of channel 1 to 80 bpm.
mixxx::BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 80, 0.0);
m_pTrack1->setBeats(pBeats1);
- auto pButtonMasterSync1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonMasterSync1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
pButtonMasterSync1->slotSet(SYNC_FOLLOWER);
ProcessBuffer();
EXPECT_FLOAT_EQ(getRateSliderValue(1.25),
- ControlObject::getControl(ConfigKey(m_sGroup1, "rate"))->get());
- EXPECT_FLOAT_EQ(100.0, ControlObject::getControl(ConfigKey(m_sGroup1, "bpm"))->get());
+ ControlObject::getControl(ConfigKey(m_sGroup1, "rate"))->get());
+ EXPECT_FLOAT_EQ(100.0,
+ ControlObject::getControl(ConfigKey(m_sGroup1, "bpm"))->get());
}
TEST_F(EngineSyncTest, AnySyncDeckSliderStays) {
@@ -332,29 +359,37 @@ TEST_F(EngineSyncTest, AnySyncDeckSliderStays) {
mixxx::BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 80, 0.0);
m_pTrack1->setBeats(pBeats1);
- auto pButtonSyncEnabled1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
+ auto pButtonSyncEnabled1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
pButtonSyncEnabled1->set(1.0);
// After setting up the first deck, the internal BPM should be 80.
EXPECT_FLOAT_EQ(80.0,
- ControlObject::getControl(ConfigKey(m_sInternalClockGroup, "bpm"))->get());
+ ControlObject::getControl(ConfigKey(m_sInternalClockGroup, "bpm"))
+ ->get());
mixxx::BeatsPointer pBeats2 = BeatFactory::makeBeatGrid(*m_pTrack2, 100, 0.0);
m_pTrack2->setBeats(pBeats2);
- auto pButtonSyncEnabled2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
+ auto pButtonSyncEnabled2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
pButtonSyncEnabled2->set(1.0);
// After the second one, though, the internal BPM should still be 80.
EXPECT_FLOAT_EQ(80.0,
- ControlObject::getControl(ConfigKey(m_sInternalClockGroup, "bpm"))->get());
+ ControlObject::getControl(ConfigKey(m_sInternalClockGroup, "bpm"))
+ ->get());
}
TEST_F(EngineSyncTest, InternalClockFollowsFirstPlayingDeck) {
// Same as above, except we use the midi lights to change state.
- auto pButtonMasterSync1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
- auto pButtonMasterSync2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
- auto pButtonSyncEnabled1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
- auto pButtonSyncEnabled2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
+ auto pButtonMasterSync1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonMasterSync2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
+ auto pButtonSyncEnabled1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
+ auto pButtonSyncEnabled2 =
+ std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
// Set up decks so they can be playing, and start deck 1.
mixxx::BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 100, 0.0);
@@ -374,7 +409,7 @@ TEST_F(EngineSyncTest, InternalClockFollowsFirstPlayingDeck) {
// The master sync should now be deck 1.
ASSERT_TRUE(isSoftMaster(m_sGroup1));
EXPECT_FLOAT_EQ(100.0,
- ControlObject::get(ConfigKey(m_sInternalClockGroup, "bpm")));
+ ControlObject::get(ConfigKey(m_sInternalClockGroup, "bpm")));
// Set channel 2 to be enabled.
pButtonSyncEnabled2->set(1);
@@ -387,7 +422,7 @@ TEST_F(EngineSyncTest, InternalClockFollowsFirstPlayingDeck) {
// The rate should not have changed -- deck 1 still matches deck 2.
EXPECT_FLOAT_EQ(getRateSliderValue(1.0),
- ControlObject::getControl(ConfigKey(m_sGroup1, "rate"))->get());
+ ControlObject::getControl(ConfigKey(m_sGroup1, "rate"))->get());
// Reset channel 2 rate, set channel 2 to play, and process a buffer.
ControlObject::set(ConfigKey(m_sGroup2, "rate"), getRateSliderValue(1.0));
@@ -407,19 +442,24 @@ TEST_F(EngineSyncTest, InternalClockFollowsFirstPlayingDeck) {
ASSERT_TRUE(isFollower(m_sInternalClockGroup));
// Rate should now match channel 2.
- EXPECT_FLOAT_EQ(130.0,
- ControlObject::get(ConfigKey(m_sInternalClockGroup, "bpm")));
+ EXPECT_FLOAT_EQ(
+ 130.0, ControlObject::get(ConfigKey(m_sInternalClockGroup, "bpm")));
}
-
TEST_F(EngineSyncTest, SetExplicitMasterByLights) {
// Same as above, except we use the midi lights to change state.
- auto pButtonMasterSync1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
- auto pButtonMasterSync2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_mode");
- auto pButtonSyncEnabled1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
- auto pButtonSyncEnabled2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
- auto pButtonSyncMaster1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_master");
- auto pButtonSyncMaster2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_master");
+ auto pButtonMasterSync1 =
+ std::make_unique<ControlProxy>(m_sGroup1, "sync_mode");
+ auto pButtonMasterSync2 =