// Tests for Master Sync.
// The following manual tests should probably be performed:
// * Quantize mode nudges tracks in sync, whether internal or deck master.
// * Flinging tracks with the waveform should work.
// * vinyl??
#include <string>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <QtDebug>
#include "preferences/usersettings.h"
#include "control/controlobject.h"
#include "engine/bpmcontrol.h"
#include "engine/sync/synccontrol.h"
#include "test/mockedenginebackendtest.h"
#include "test/mixxxtest.h"
#include "track/beatfactory.h"
#include "mixer/basetrackplayer.h"
#include "util/memory.h"
class EngineSyncTest : public MockedEngineBackendTest {
public:
std::string getMasterGroup() {
Syncable* pMasterSyncable = m_pEngineSync->getMasterSyncable();
if (pMasterSyncable) {
return pMasterSyncable->getGroup().toStdString();
}
return "";
}
void assertIsMaster(QString group) {
if (group == m_sInternalClockGroup) {
ASSERT_EQ(1,
ControlObject::getControl(ConfigKey(m_sInternalClockGroup,
"sync_master"))->get());
ASSERT_EQ(NULL, m_pEngineSync->getMaster());
ASSERT_EQ(m_sInternalClockGroup, getMasterGroup());
} else {
if (group == m_sGroup1) {
ASSERT_EQ(m_pChannel1, m_pEngineSync->getMaster());
} else if (group ==