diff options
author | RJ Ryan <rryan@mixxx.org> | 2016-01-15 10:10:21 -0800 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2016-01-15 11:03:29 -0800 |
commit | 7c6987648c649b632c05fae6385c8a6d377875f5 (patch) | |
tree | 73cc11383fbc992344305010ba72d7a31c1af47e /src/vinylcontrol/vinylcontrolmanager.cpp | |
parent | 0bb570394a0cec51861600145ab5f3077865e2cd (diff) |
Move menu logic and VC/Passthrough/Mic checking out of MixxxMainWindow.
Drops 1000+ lines from mixxx.h/mixxx.cpp -- now they're "only" 1400 lines!
Diffstat (limited to 'src/vinylcontrol/vinylcontrolmanager.cpp')
-rw-r--r-- | src/vinylcontrol/vinylcontrolmanager.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/vinylcontrol/vinylcontrolmanager.cpp b/src/vinylcontrol/vinylcontrolmanager.cpp index 1330d46bb1..f771881c1d 100644 --- a/src/vinylcontrol/vinylcontrolmanager.cpp +++ b/src/vinylcontrol/vinylcontrolmanager.cpp @@ -31,6 +31,9 @@ VinylControlManager::VinylControlManager(QObject* pParent, pSoundManager->registerInput( AudioInput(AudioInput::VINYLCONTROL, 0, 0, i), m_pProcessor); } + + connect(&m_vinylControlEnabledMapper, SIGNAL(mapped(int)), + this, SLOT(slotVinylControlEnabledChanged(int))); } VinylControlManager::~VinylControlManager() { @@ -56,6 +59,15 @@ void VinylControlManager::init() { slotNumDecksChanged(m_pNumDecks->get()); } +void VinylControlManager::toggleVinylControl(int deck) { + if (deck < 0 || deck >= m_pVcEnabled.size()) { + return; + } + + ControlObjectSlave* pEnabled = m_pVcEnabled[deck]; + pEnabled->set(!pEnabled->toBool()); +} + void VinylControlManager::slotNumDecksChanged(double dNumDecks) { int num_decks = static_cast<int>(dNumDecks); @@ -74,8 +86,10 @@ void VinylControlManager::slotNumDecksChanged(double dNumDecks) { for (int i = m_iNumConfiguredDecks; i < num_decks; ++i) { QString group = PlayerManager::groupForDeck(i); - m_pVcEnabled.push_back(new ControlObjectSlave(group, "vinylcontrol_enabled", this)); - m_pVcEnabled.back()->set(0); + ControlObjectSlave* pEnabled = new ControlObjectSlave(group, "vinylcontrol_enabled", this); + m_pVcEnabled.push_back(pEnabled); + pEnabled->connectValueChanged(&m_vinylControlEnabledMapper, SLOT(map())); + m_vinylControlEnabledMapper.setMapping(pEnabled, i); // Default cueing should be off. ControlObject::set(ConfigKey(group, "vinylcontrol_cueing"), @@ -92,6 +106,16 @@ void VinylControlManager::slotNumDecksChanged(double dNumDecks) { m_iNumConfiguredDecks = num_decks; } +void VinylControlManager::slotVinylControlEnabledChanged(int deck) { + if (deck < 0 || deck >= m_pVcEnabled.size()) { + DEBUG_ASSERT(false); + return; + } + + ControlObjectSlave* pEnabled = m_pVcEnabled.at(deck); + emit(vinylControlDeckEnabled(deck, pEnabled->toBool())); +} + void VinylControlManager::requestReloadConfig() { m_pProcessor->requestReloadConfig(); } |