mirror of
https://github.com/dguglielmi/sunny-overlay.git
synced 2025-12-06 09:32:37 +01:00
538 lines
22 KiB
Diff
538 lines
22 KiB
Diff
From 0783a13514f35e679059076c9cabed708baa844a Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Tue, 22 May 2018 02:29:42 +0200
|
|
Subject: [PATCH 1/8] fix beatsync control syncing phase, an old regression
|
|
since 2.0
|
|
|
|
---
|
|
src/engine/enginebuffer.cpp | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/engine/enginebuffer.cpp b/src/engine/enginebuffer.cpp
|
|
index 1218f017b6..42087bc248 100644
|
|
--- a/src/engine/enginebuffer.cpp
|
|
+++ b/src/engine/enginebuffer.cpp
|
|
@@ -658,7 +658,7 @@ void EngineBuffer::slotControlPlayRequest(double v) {
|
|
bool verifiedPlay = updateIndicatorsAndModifyPlay(v > 0.0);
|
|
|
|
if (!oldPlay && verifiedPlay) {
|
|
- if (m_pQuantize->get() > 0.0
|
|
+ if (m_pQuantize->toBool()
|
|
#ifdef __VINYLCONTROL__
|
|
&& m_pVinylControlControl && !m_pVinylControlControl->isEnabled()
|
|
#endif
|
|
@@ -900,7 +900,7 @@ void EngineBuffer::process(CSAMPLE* pOutput, const int iBufferSize) {
|
|
// we need to sync phase or we'll be totally out of whack and the sync
|
|
// adjuster will kick in and push the track back in to sync with the
|
|
// master.
|
|
- if (m_scratching_old && !is_scratching && m_pQuantize->get() > 0.0
|
|
+ if (m_scratching_old && !is_scratching && m_pQuantize->toBool()
|
|
&& m_pSyncControl->getSyncMode() == SYNC_FOLLOWER && !paused) {
|
|
// TODO() The resulting seek is processed in the following callback
|
|
// That is to late
|
|
@@ -1179,7 +1179,7 @@ void EngineBuffer::processSeek(bool paused) {
|
|
return;
|
|
}
|
|
|
|
- if ((seekType & SEEK_PHASE) && !paused && m_pQuantize->toBool()) {
|
|
+ if (!paused && ((seekType & SEEK_PHASE) || m_pQuantize->toBool())) {
|
|
position = m_pBpmControl->getNearestPositionInPhase(position, true, true);
|
|
}
|
|
if (position != m_filepos_play) {
|
|
|
|
From c65d450f9962ea834a55d6aec6749b2f7524cb90 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Tue, 22 May 2018 02:37:31 +0200
|
|
Subject: [PATCH 2/8] Added beatsync to right click on sync in Shade and Deere,
|
|
fixes bug #1772526
|
|
|
|
---
|
|
res/skins/Deere/deck_tempo_column.xml | 3 ++-
|
|
res/skins/Shade/deck.xml | 2 +-
|
|
2 files changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/res/skins/Deere/deck_tempo_column.xml b/res/skins/Deere/deck_tempo_column.xml
|
|
index 7d7e76ea19..d7de70df24 100644
|
|
--- a/res/skins/Deere/deck_tempo_column.xml
|
|
+++ b/res/skins/Deere/deck_tempo_column.xml
|
|
@@ -15,7 +15,7 @@
|
|
<ObjectName>TempoControlButtons</ObjectName>
|
|
<Layout>vertical</Layout>
|
|
<Children>
|
|
- <Template src="skin:left_2state_button.xml">
|
|
+ <Template src="skin:left_right_2state_button.xml">
|
|
<SetVariable name="TooltipId">sync_enabled</SetVariable>
|
|
<SetVariable name="ObjectName">DeckSync</SetVariable>
|
|
<SetVariable name="MinimumSize">-1,18</SetVariable>
|
|
@@ -28,6 +28,7 @@
|
|
<SetVariable name="state_1_pressed"></SetVariable>
|
|
<SetVariable name="state_1_unpressed"></SetVariable>
|
|
<SetVariable name="left_connection_control"><Variable name="group"/>,sync_enabled</SetVariable>
|
|
+ <SetVariable name="right_connection_control"><Variable name="group"/>,beatsync</SetVariable>
|
|
</Template>
|
|
|
|
<WidgetGroup>
|
|
diff --git a/res/skins/Shade/deck.xml b/res/skins/Shade/deck.xml
|
|
index ad3cabd6d2..494901128a 100644
|
|
--- a/res/skins/Shade/deck.xml
|
|
+++ b/res/skins/Shade/deck.xml
|
|
@@ -450,7 +450,7 @@
|
|
<ButtonState>LeftButton</ButtonState>
|
|
</Connection>
|
|
<Connection>
|
|
- <ConfigKey>[Channel<Variable name="channum"/>],beatsync_tempo</ConfigKey>
|
|
+ <ConfigKey>[Channel<Variable name="channum"/>],beatsync</ConfigKey>
|
|
<ButtonState>RightButton</ButtonState>
|
|
</Connection>
|
|
</PushButton>
|
|
|
|
From ef28e682392d61ccf44189dba8807e7b0926eff4 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Wed, 30 May 2018 20:39:59 +0200
|
|
Subject: [PATCH 3/8] Restore quantize dependency of sync_enable lost in a
|
|
previous commit
|
|
|
|
---
|
|
src/engine/sync/enginesync.cpp | 5 ++---
|
|
src/engine/sync/internalclock.cpp | 2 +-
|
|
src/engine/sync/internalclock.h | 2 +-
|
|
src/engine/sync/syncable.h | 2 +-
|
|
src/engine/sync/synccontrol.cpp | 14 +++++++++++---
|
|
src/engine/sync/synccontrol.h | 3 ++-
|
|
6 files changed, 18 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/src/engine/sync/enginesync.cpp b/src/engine/sync/enginesync.cpp
|
|
index 955ef7c52a..9b0436e95e 100644
|
|
--- a/src/engine/sync/enginesync.cpp
|
|
+++ b/src/engine/sync/enginesync.cpp
|
|
@@ -165,9 +165,8 @@ void EngineSync::requestEnableSync(Syncable* pSyncable, bool bEnabled) {
|
|
foundPlayingDeck = true;
|
|
}
|
|
activateFollower(pSyncable);
|
|
- if (foundPlayingDeck && pSyncable->isPlaying()) {
|
|
- // Users also expect phase to be aligned when they press the sync button.
|
|
- pSyncable->requestSyncPhase();
|
|
+ if (foundPlayingDeck) {
|
|
+ pSyncable->requestSync();
|
|
}
|
|
} else {
|
|
// Already disabled? Do nothing.
|
|
diff --git a/src/engine/sync/internalclock.cpp b/src/engine/sync/internalclock.cpp
|
|
index 0b013d7bc3..2629ed79fe 100644
|
|
--- a/src/engine/sync/internalclock.cpp
|
|
+++ b/src/engine/sync/internalclock.cpp
|
|
@@ -54,7 +54,7 @@ void InternalClock::notifyOnlyPlayingSyncable() {
|
|
// No action necessary.
|
|
}
|
|
|
|
-void InternalClock::requestSyncPhase() {
|
|
+void InternalClock::requestSync() {
|
|
// TODO(owilliams): This should probably be how we reset the internal beat distance.
|
|
}
|
|
|
|
diff --git a/src/engine/sync/internalclock.h b/src/engine/sync/internalclock.h
|
|
index b3d7f3fa7a..407497f5b1 100644
|
|
--- a/src/engine/sync/internalclock.h
|
|
+++ b/src/engine/sync/internalclock.h
|
|
@@ -29,7 +29,7 @@ class InternalClock : public QObject, public Clock, public Syncable {
|
|
|
|
void notifySyncModeChanged(SyncMode mode);
|
|
void notifyOnlyPlayingSyncable();
|
|
- void requestSyncPhase();
|
|
+ void requestSync();
|
|
SyncMode getSyncMode() const {
|
|
return m_mode;
|
|
}
|
|
diff --git a/src/engine/sync/syncable.h b/src/engine/sync/syncable.h
|
|
index 033f8b268c..7139082841 100644
|
|
--- a/src/engine/sync/syncable.h
|
|
+++ b/src/engine/sync/syncable.h
|
|
@@ -37,7 +37,7 @@ class Syncable {
|
|
virtual void notifyOnlyPlayingSyncable() = 0;
|
|
|
|
// Notify a Syncable that they should sync phase.
|
|
- virtual void requestSyncPhase() = 0;
|
|
+ virtual void requestSync() = 0;
|
|
|
|
// Must NEVER return a mode that was not set directly via
|
|
// notifySyncModeChanged.
|
|
diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp
|
|
index a516e6e5cc..89fded5706 100644
|
|
--- a/src/engine/sync/synccontrol.cpp
|
|
+++ b/src/engine/sync/synccontrol.cpp
|
|
@@ -72,6 +72,8 @@ SyncControl::SyncControl(const QString& group, UserSettingsPointer pConfig,
|
|
m_pEjectButton->connectValueChanged(
|
|
SLOT(slotEjectPushed(double)), Qt::DirectConnection);
|
|
|
|
+ m_pQuantize = new ControlProxy(group, "quantize", this);
|
|
+
|
|
// BPMControl and RateControl will be initialized later.
|
|
}
|
|
|
|
@@ -161,12 +163,18 @@ void SyncControl::notifyOnlyPlayingSyncable() {
|
|
m_pBpmControl->resetSyncAdjustment();
|
|
}
|
|
|
|
-void SyncControl::requestSyncPhase() {
|
|
- m_pChannel->getEngineBuffer()->requestSyncPhase();
|
|
+void SyncControl::requestSync() {
|
|
+ if (isPlaying() && m_pQuantize->toBool()) {
|
|
+ // only sync phase if the deck is playing and if quantize is enabled.
|
|
+ // this way the it is up to the user to decide if a seek is desired or not.
|
|
+ // This is helpfull if the beatgrid of the track doe not fit at the current
|
|
+ // payposition
|
|
+ m_pChannel->getEngineBuffer()->requestSyncPhase();
|
|
+ }
|
|
}
|
|
|
|
bool SyncControl::isPlaying() const {
|
|
- return m_pPlayButton->get() > 0.0;
|
|
+ return m_pPlayButton->toBool();
|
|
}
|
|
|
|
double SyncControl::getBeatDistance() const {
|
|
diff --git a/src/engine/sync/synccontrol.h b/src/engine/sync/synccontrol.h
|
|
index 7af10a3048..d5020cde64 100644
|
|
--- a/src/engine/sync/synccontrol.h
|
|
+++ b/src/engine/sync/synccontrol.h
|
|
@@ -31,7 +31,7 @@ class SyncControl : public EngineControl, public Syncable {
|
|
SyncMode getSyncMode() const;
|
|
void notifySyncModeChanged(SyncMode mode);
|
|
void notifyOnlyPlayingSyncable();
|
|
- void requestSyncPhase();
|
|
+ void requestSync();
|
|
bool isPlaying() const;
|
|
|
|
double getBeatDistance() const;
|
|
@@ -136,6 +136,7 @@ class SyncControl : public EngineControl, public Syncable {
|
|
ControlProxy* m_pPassthroughEnabled;
|
|
ControlProxy* m_pEjectButton;
|
|
ControlProxy* m_pSyncPhaseButton;
|
|
+ ControlProxy* m_pQuantize;
|
|
};
|
|
|
|
|
|
|
|
From 6ab15f8f999df41ea98f2247bef7e9296df796d6 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Wed, 30 May 2018 23:11:28 +0200
|
|
Subject: [PATCH 4/8] Added the test SyncPhaseToIfQuantize
|
|
|
|
---
|
|
src/test/enginesynctest.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++
|
|
1 file changed, 49 insertions(+)
|
|
|
|
diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp
|
|
index 1f6c1ad504..e8b08e59b9 100644
|
|
--- a/src/test/enginesynctest.cpp
|
|
+++ b/src/test/enginesynctest.cpp
|
|
@@ -1429,3 +1429,52 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) {
|
|
EXPECT_EQ(0.0,
|
|
ControlObject::getControl(ConfigKey(m_sGroup1, "local_bpm"))->get());
|
|
}
|
|
+
|
|
+TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) {
|
|
+ auto pButtonSyncEnabled1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
|
|
+ auto pFileBpm1 = std::make_unique<ControlProxy>(m_sGroup1, "file_bpm");
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->set(0.2);
|
|
+ pFileBpm1->set(130.0);
|
|
+ BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 130, 0.0);
|
|
+ m_pTrack1->setBeats(pBeats1);
|
|
+
|
|
+ auto pButtonSyncEnabled2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
|
|
+ auto pFileBpm2 = std::make_unique<ControlProxy>(m_sGroup2, "file_bpm");
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup2, "beat_distance"))->set(0.8);
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup2, "rate"))->set(getRateSliderValue(1.0));
|
|
+ BeatsPointer pBeats2 = BeatFactory::makeBeatGrid(*m_pTrack2, 100, 0.0);
|
|
+ m_pTrack2->setBeats(pBeats2);
|
|
+ pFileBpm2->set(100.0);
|
|
+
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup1, "play"))->set(1.0);
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup2, "play"))->set(1.0);
|
|
+ ProcessBuffer();
|
|
+
|
|
+ // first test without quantisation
|
|
+ pButtonSyncEnabled1->set(1.0);
|
|
+ ProcessBuffer();
|
|
+ // 0.02 where set after testing both cases.
|
|
+ EXPECT_LT(0.02, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get());
|
|
+ pButtonSyncEnabled1->set(0.0);
|
|
+
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(1.0);
|
|
+ ProcessBuffer();
|
|
+
|
|
+ pButtonSyncEnabled1->set(1.0);
|
|
+ ProcessBuffer();
|
|
+
|
|
+ // 0.07 where set by after testing both cases.
|
|
+ EXPECT_LT(0.07, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get());
|
|
+ pButtonSyncEnabled1->set(0.0);
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(0.0);
|
|
+ ProcessBuffer();
|
|
+
|
|
+ ControlObject::getControl(ConfigKey(m_sGroup1, "beatsync_phase"))->set(1.0);
|
|
+ ProcessBuffer();
|
|
+
|
|
+ // 0.1162 where set by after testing both cases.
|
|
+ EXPECT_LT(0.1162, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get());
|
|
+}
|
|
+
|
|
+
|
|
+
|
|
|
|
From 4853ddc7db9b26cb04ecafbaeac7adf37aadf190 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Thu, 31 May 2018 21:48:29 +0200
|
|
Subject: [PATCH 5/8] Restore quantize dependency of beatsync lost in a
|
|
previous commit
|
|
|
|
---
|
|
src/controllers/controlpickermenu.cpp | 1 +
|
|
src/engine/bpmcontrol.cpp | 11 ++++++++---
|
|
2 files changed, 9 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp
|
|
index 674a3e0639..fbab5f67ab 100644
|
|
--- a/src/controllers/controlpickermenu.cpp
|
|
+++ b/src/controllers/controlpickermenu.cpp
|
|
@@ -115,6 +115,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
|
|
tr("Sync mode 3-state toggle (OFF, FOLLOWER, MASTER)"), syncMenu);
|
|
addDeckAndSamplerControl("beatsync", tr("Beat Sync One-Shot"),
|
|
tr("One-time beat sync (tempo and phase)"), syncMenu);
|
|
+ // TODO: phase depends on quantize
|
|
addDeckAndSamplerControl("beatsync_tempo", tr("Sync Tempo One-Shot"),
|
|
tr("One-time beat sync (tempo only)"), syncMenu);
|
|
addDeckAndSamplerControl("beatsync_phase", tr("Sync Phase One-Shot"),
|
|
diff --git a/src/engine/bpmcontrol.cpp b/src/engine/bpmcontrol.cpp
|
|
index 06dbaf9af5..eec368e449 100644
|
|
--- a/src/engine/bpmcontrol.cpp
|
|
+++ b/src/engine/bpmcontrol.cpp
|
|
@@ -234,10 +234,15 @@ void BpmControl::slotControlBeatSyncTempo(double v) {
|
|
|
|
void BpmControl::slotControlBeatSync(double v) {
|
|
if (!v) return;
|
|
+ if (!syncTempo()) {
|
|
+ // syncTempo failed, nothing else to do
|
|
+ return;
|
|
+ }
|
|
|
|
- // If the player is playing, and adjusting its tempo succeeded, adjust its
|
|
- // phase so that it plays in sync.
|
|
- if (syncTempo() && m_pPlayButton->get() > 0) {
|
|
+ // Also sync phase if quantize is enabled.
|
|
+ // this is used from controller scripts, where the latching behaviour of
|
|
+ // the sync_enable CO cannot be used
|
|
+ if (m_pPlayButton->toBool() && m_pQuantize->toBool()) {
|
|
getEngineBuffer()->requestSyncPhase();
|
|
}
|
|
}
|
|
|
|
From 8d82ec8a01893f693deef7c71fffcb8004a68340 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Fri, 1 Jun 2018 10:19:58 +0200
|
|
Subject: [PATCH 6/8] extend test for beatsync
|
|
|
|
---
|
|
src/test/enginesynctest.cpp | 49 ++++++++++++++++++++++++++++++++-------------
|
|
1 file changed, 35 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp
|
|
index e8b08e59b9..dac5d6e5bc 100644
|
|
--- a/src/test/enginesynctest.cpp
|
|
+++ b/src/test/enginesynctest.cpp
|
|
@@ -1432,48 +1432,69 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) {
|
|
|
|
TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) {
|
|
auto pButtonSyncEnabled1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
|
|
+ auto pButtonBeatsync1 = std::make_unique<ControlProxy>(m_sGroup1, "beatsync");
|
|
+ auto pButtonBeatsyncPhase1 = std::make_unique<ControlProxy>(m_sGroup1, "beatsync_phase");
|
|
+
|
|
auto pFileBpm1 = std::make_unique<ControlProxy>(m_sGroup1, "file_bpm");
|
|
- ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->set(0.2);
|
|
+ ControlObject::set(ConfigKey(m_sGroup1, "beat_distance"), 0.2);
|
|
pFileBpm1->set(130.0);
|
|
BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 130, 0.0);
|
|
m_pTrack1->setBeats(pBeats1);
|
|
|
|
auto pButtonSyncEnabled2 = std::make_unique<ControlProxy>(m_sGroup2, "sync_enabled");
|
|
auto pFileBpm2 = std::make_unique<ControlProxy>(m_sGroup2, "file_bpm");
|
|
- ControlObject::getControl(ConfigKey(m_sGroup2, "beat_distance"))->set(0.8);
|
|
- ControlObject::getControl(ConfigKey(m_sGroup2, "rate"))->set(getRateSliderValue(1.0));
|
|
+ ControlObject::set(ConfigKey(m_sGroup2, "beat_distance"), 0.8);
|
|
+ ControlObject::set(ConfigKey(m_sGroup2, "rate"), getRateSliderValue(1.0));
|
|
BeatsPointer pBeats2 = BeatFactory::makeBeatGrid(*m_pTrack2, 100, 0.0);
|
|
m_pTrack2->setBeats(pBeats2);
|
|
pFileBpm2->set(100.0);
|
|
|
|
- ControlObject::getControl(ConfigKey(m_sGroup1, "play"))->set(1.0);
|
|
- ControlObject::getControl(ConfigKey(m_sGroup2, "play"))->set(1.0);
|
|
+ ControlObject::set(ConfigKey(m_sGroup1, "play"), 1.0);
|
|
+ ControlObject::set(ConfigKey(m_sGroup2, "play"), 1.0);
|
|
ProcessBuffer();
|
|
|
|
// first test without quantisation
|
|
pButtonSyncEnabled1->set(1.0);
|
|
ProcessBuffer();
|
|
- // 0.02 where set after testing both cases.
|
|
- EXPECT_LT(0.02, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get());
|
|
+ ASSERT_DOUBLE_EQ(0.025155996658969195, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance")));
|
|
pButtonSyncEnabled1->set(0.0);
|
|
|
|
- ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(1.0);
|
|
+ ControlObject::set(ConfigKey(m_sGroup1, "quantize"), 1.0);
|
|
ProcessBuffer();
|
|
|
|
pButtonSyncEnabled1->set(1.0);
|
|
ProcessBuffer();
|
|
|
|
- // 0.07 where set by after testing both cases.
|
|
- EXPECT_LT(0.07, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get());
|
|
+ ASSERT_DOUBLE_EQ(0.077604743399185772, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance")));
|
|
pButtonSyncEnabled1->set(0.0);
|
|
- ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(0.0);
|
|
+ ControlObject::set(ConfigKey(m_sGroup1, "quantize"), 0.0);
|
|
+ ProcessBuffer();
|
|
+
|
|
+ pButtonBeatsyncPhase1->set(1.0);
|
|
ProcessBuffer();
|
|
|
|
- ControlObject::getControl(ConfigKey(m_sGroup1, "beatsync_phase"))->set(1.0);
|
|
+ // 0.11632139450713055 in case "beatsync_phase" fails
|
|
+ ASSERT_DOUBLE_EQ(0.11610813658949772, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance")));
|
|
+
|
|
+
|
|
+ ControlObject::set(ConfigKey(m_sGroup1, "beat_distance"), 0.2);
|
|
+ ControlObject::set(ConfigKey(m_sGroup1, "rate"), 1.0);
|
|
+ ProcessBuffer();
|
|
+ pButtonBeatsync1->set(1.0);
|
|
ProcessBuffer();
|
|
|
|
- // 0.1162 where set by after testing both cases.
|
|
- EXPECT_LT(0.1162, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get());
|
|
+ // 0.15480806100370784 in case quantize is enabled
|
|
+ ASSERT_DOUBLE_EQ(0.16263690384739582, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance")));
|
|
+
|
|
+ ProcessBuffer();
|
|
+
|
|
+ ControlObject::set(ConfigKey(m_sGroup1, "quantize"), 1.0);
|
|
+ pButtonBeatsync1->set(1.0);
|
|
+ ProcessBuffer();
|
|
+
|
|
+ // 0.19933910991038406 in case quantize is disabled
|
|
+ ASSERT_DOUBLE_EQ(0.19350798541791794, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance")));
|
|
+
|
|
}
|
|
|
|
|
|
|
|
From f2437fcd27671d3c87bc0eedac7e90aca476a368 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Fri, 1 Jun 2018 10:39:43 +0200
|
|
Subject: [PATCH 7/8] Change right click sync to beatsync_phase, for the case
|
|
permanent adjustment via quantize is not deired.
|
|
|
|
---
|
|
res/skins/Deere/deck_tempo_column.xml | 2 +-
|
|
res/skins/LateNight/deck.xml | 2 +-
|
|
res/skins/Shade/deck.xml | 2 +-
|
|
res/skins/Tango/rate_pitch_key.xml | 2 +-
|
|
4 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/res/skins/Deere/deck_tempo_column.xml b/res/skins/Deere/deck_tempo_column.xml
|
|
index d7de70df24..0ecda823ea 100644
|
|
--- a/res/skins/Deere/deck_tempo_column.xml
|
|
+++ b/res/skins/Deere/deck_tempo_column.xml
|
|
@@ -28,7 +28,7 @@
|
|
<SetVariable name="state_1_pressed"></SetVariable>
|
|
<SetVariable name="state_1_unpressed"></SetVariable>
|
|
<SetVariable name="left_connection_control"><Variable name="group"/>,sync_enabled</SetVariable>
|
|
- <SetVariable name="right_connection_control"><Variable name="group"/>,beatsync</SetVariable>
|
|
+ <SetVariable name="right_connection_control"><Variable name="group"/>,beatsync_phase</SetVariable>
|
|
</Template>
|
|
|
|
<WidgetGroup>
|
|
diff --git a/res/skins/LateNight/deck.xml b/res/skins/LateNight/deck.xml
|
|
index 245b7d6509..7791f9cabd 100644
|
|
--- a/res/skins/LateNight/deck.xml
|
|
+++ b/res/skins/LateNight/deck.xml
|
|
@@ -281,7 +281,7 @@
|
|
<ButtonState>LeftButton</ButtonState>
|
|
</Connection>
|
|
<Connection>
|
|
- <ConfigKey><Variable name="group"/>,beatsync</ConfigKey>
|
|
+ <ConfigKey><Variable name="group"/>,beatsync_phase</ConfigKey>
|
|
<ButtonState>RightButton</ButtonState>
|
|
</Connection>
|
|
</PushButton>
|
|
diff --git a/res/skins/Shade/deck.xml b/res/skins/Shade/deck.xml
|
|
index 494901128a..368ab2c7c6 100644
|
|
--- a/res/skins/Shade/deck.xml
|
|
+++ b/res/skins/Shade/deck.xml
|
|
@@ -450,7 +450,7 @@
|
|
<ButtonState>LeftButton</ButtonState>
|
|
</Connection>
|
|
<Connection>
|
|
- <ConfigKey>[Channel<Variable name="channum"/>],beatsync</ConfigKey>
|
|
+ <ConfigKey>[Channel<Variable name="channum"/>],beatsync_phase</ConfigKey>
|
|
<ButtonState>RightButton</ButtonState>
|
|
</Connection>
|
|
</PushButton>
|
|
diff --git a/res/skins/Tango/rate_pitch_key.xml b/res/skins/Tango/rate_pitch_key.xml
|
|
index 7af6103531..9da83e13fa 100644
|
|
--- a/res/skins/Tango/rate_pitch_key.xml
|
|
+++ b/res/skins/Tango/rate_pitch_key.xml
|
|
@@ -113,7 +113,7 @@ Variables:
|
|
<SetVariable name="ObjectName">SyncButtonOverlay</SetVariable>
|
|
<SetVariable name="Size">50f,18min</SetVariable>
|
|
<SetVariable name="ConfigKey"><Variable name="group"/>,sync_enabled</SetVariable>
|
|
- <SetVariable name="ConfigKeyRight"><Variable name="group"/>,rate_set_default</SetVariable>
|
|
+ <SetVariable name="ConfigKeyRight"><Variable name="group"/>,beatsync_phase</SetVariable>
|
|
</Template>
|
|
<Number>
|
|
<ObjectName>BpmLabel</ObjectName>
|
|
|
|
From 55715f11b36b5616c114b1ff9a9174b34af36d4c Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
|
|
Date: Fri, 8 Jun 2018 18:04:40 +0200
|
|
Subject: [PATCH 8/8] fix typos
|
|
|
|
---
|
|
src/engine/sync/synccontrol.cpp | 4 ++--
|
|
src/test/enginesynctest.cpp | 4 +---
|
|
2 files changed, 3 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp
|
|
index 89fded5706..dc98717b14 100644
|
|
--- a/src/engine/sync/synccontrol.cpp
|
|
+++ b/src/engine/sync/synccontrol.cpp
|
|
@@ -167,8 +167,8 @@ void SyncControl::requestSync() {
|
|
if (isPlaying() && m_pQuantize->toBool()) {
|
|
// only sync phase if the deck is playing and if quantize is enabled.
|
|
// this way the it is up to the user to decide if a seek is desired or not.
|
|
- // This is helpfull if the beatgrid of the track doe not fit at the current
|
|
- // payposition
|
|
+ // This is helpful if the beatgrid of the track doe not fit at the current
|
|
+ // playposition
|
|
m_pChannel->getEngineBuffer()->requestSyncPhase();
|
|
}
|
|
}
|
|
diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp
|
|
index dac5d6e5bc..ca5b6db8a5 100644
|
|
--- a/src/test/enginesynctest.cpp
|
|
+++ b/src/test/enginesynctest.cpp
|
|
@@ -1430,7 +1430,7 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) {
|
|
ControlObject::getControl(ConfigKey(m_sGroup1, "local_bpm"))->get());
|
|
}
|
|
|
|
-TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) {
|
|
+TEST_F(EngineSyncTest, QuantizeImpliesSyncPhase) {
|
|
auto pButtonSyncEnabled1 = std::make_unique<ControlProxy>(m_sGroup1, "sync_enabled");
|
|
auto pButtonBeatsync1 = std::make_unique<ControlProxy>(m_sGroup1, "beatsync");
|
|
auto pButtonBeatsyncPhase1 = std::make_unique<ControlProxy>(m_sGroup1, "beatsync_phase");
|
|
@@ -1497,5 +1497,3 @@ TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) {
|
|
|
|
}
|
|
|
|
-
|
|
-
|