comparison main/MainWindow.cpp @ 208:0b4d563d7469

* Remove alignment button altogether if no Match plugin installed. Then it won't annoy people who really don't want it; they can get rid of it easily enough.
author Chris Cannam
date Thu, 01 Nov 2007 17:24:38 +0000
parents bb7faed0b2be
children 55a4719c8e7d
comparison
equal deleted inserted replaced
207:bb7faed0b2be 208:0b4d563d7469
1608 connect(m_viewManager, SIGNAL(playSoloModeChanged(bool)), 1608 connect(m_viewManager, SIGNAL(playSoloModeChanged(bool)),
1609 m_soloAction, SLOT(setChecked(bool))); 1609 m_soloAction, SLOT(setChecked(bool)));
1610 connect(m_soloAction, SIGNAL(triggered()), this, SLOT(playSoloToggled())); 1610 connect(m_soloAction, SIGNAL(triggered()), this, SLOT(playSoloToggled()));
1611 connect(this, SIGNAL(canChangeSolo(bool)), m_soloAction, SLOT(setEnabled(bool))); 1611 connect(this, SIGNAL(canChangeSolo(bool)), m_soloAction, SLOT(setEnabled(bool)));
1612 1612
1613 QAction *alAction = toolbar->addAction(il.load("align"), 1613 QAction *alAction = 0;
1614 tr("Align File Timelines")); 1614 if (Document::canAlign()) {
1615 alAction->setCheckable(true); 1615 alAction = toolbar->addAction(il.load("align"),
1616 alAction->setChecked(m_viewManager->getAlignMode()); 1616 tr("Align File Timelines"));
1617 //!!! alAction->setStatusTip(tr("Align audio files as //!!!??? what? 1617 alAction->setCheckable(true);
1618 connect(m_viewManager, SIGNAL(alignModeChanged(bool)), 1618 alAction->setChecked(m_viewManager->getAlignMode());
1619 alAction, SLOT(setChecked(bool))); 1619 alAction->setStatusTip(tr("Treat multiple audio files as versions of the same work, and align their timelines"));
1620 connect(alAction, SIGNAL(triggered()), this, SLOT(alignToggled())); 1620 connect(m_viewManager, SIGNAL(alignModeChanged(bool)),
1621 connect(this, SIGNAL(canAlign(bool)), alAction, SLOT(setEnabled(bool))); 1621 alAction, SLOT(setChecked(bool)));
1622 connect(alAction, SIGNAL(triggered()), this, SLOT(alignToggled()));
1623 connect(this, SIGNAL(canAlign(bool)), alAction, SLOT(setEnabled(bool)));
1624 }
1622 1625
1623 m_keyReference->registerShortcut(playAction); 1626 m_keyReference->registerShortcut(playAction);
1624 m_keyReference->registerShortcut(psAction); 1627 m_keyReference->registerShortcut(psAction);
1625 m_keyReference->registerShortcut(plAction); 1628 m_keyReference->registerShortcut(plAction);
1626 m_keyReference->registerShortcut(m_soloAction); 1629 m_keyReference->registerShortcut(m_soloAction);
1627 m_keyReference->registerShortcut(alAction); 1630 if (alAction) m_keyReference->registerShortcut(alAction);
1628 m_keyReference->registerShortcut(m_rwdAction); 1631 m_keyReference->registerShortcut(m_rwdAction);
1629 m_keyReference->registerShortcut(m_ffwdAction); 1632 m_keyReference->registerShortcut(m_ffwdAction);
1630 m_keyReference->registerShortcut(rwdStartAction); 1633 m_keyReference->registerShortcut(rwdStartAction);
1631 m_keyReference->registerShortcut(ffwdEndAction); 1634 m_keyReference->registerShortcut(ffwdEndAction);
1632 1635
1633 menu->addAction(playAction); 1636 menu->addAction(playAction);
1634 menu->addAction(psAction); 1637 menu->addAction(psAction);
1635 menu->addAction(plAction); 1638 menu->addAction(plAction);
1636 menu->addAction(m_soloAction); 1639 menu->addAction(m_soloAction);
1637 menu->addAction(alAction); 1640 if (alAction) menu->addAction(alAction);
1638 menu->addSeparator(); 1641 menu->addSeparator();
1639 menu->addAction(m_rwdAction); 1642 menu->addAction(m_rwdAction);
1640 menu->addAction(m_ffwdAction); 1643 menu->addAction(m_ffwdAction);
1641 menu->addSeparator(); 1644 menu->addSeparator();
1642 menu->addAction(rwdStartAction); 1645 menu->addAction(rwdStartAction);
1645 1648
1646 m_rightButtonPlaybackMenu->addAction(playAction); 1649 m_rightButtonPlaybackMenu->addAction(playAction);
1647 m_rightButtonPlaybackMenu->addAction(psAction); 1650 m_rightButtonPlaybackMenu->addAction(psAction);
1648 m_rightButtonPlaybackMenu->addAction(plAction); 1651 m_rightButtonPlaybackMenu->addAction(plAction);
1649 m_rightButtonPlaybackMenu->addAction(m_soloAction); 1652 m_rightButtonPlaybackMenu->addAction(m_soloAction);
1650 m_rightButtonPlaybackMenu->addAction(alAction); 1653 if (alAction) m_rightButtonPlaybackMenu->addAction(alAction);
1651 m_rightButtonPlaybackMenu->addSeparator(); 1654 m_rightButtonPlaybackMenu->addSeparator();
1652 m_rightButtonPlaybackMenu->addAction(m_rwdAction); 1655 m_rightButtonPlaybackMenu->addAction(m_rwdAction);
1653 m_rightButtonPlaybackMenu->addAction(m_ffwdAction); 1656 m_rightButtonPlaybackMenu->addAction(m_ffwdAction);
1654 m_rightButtonPlaybackMenu->addSeparator(); 1657 m_rightButtonPlaybackMenu->addSeparator();
1655 m_rightButtonPlaybackMenu->addAction(rwdStartAction); 1658 m_rightButtonPlaybackMenu->addAction(rwdStartAction);
2928 m_viewManager->setAlignMode(!m_viewManager->getAlignMode()); 2931 m_viewManager->setAlignMode(!m_viewManager->getAlignMode());
2929 } 2932 }
2930 2933
2931 if (m_viewManager->getAlignMode()) { 2934 if (m_viewManager->getAlignMode()) {
2932 m_prevSolo = m_soloAction->isChecked(); 2935 m_prevSolo = m_soloAction->isChecked();
2933 m_soloAction->setChecked(true); 2936 if (!m_soloAction->isChecked()) {
2934 m_viewManager->setPlaySoloMode(true); 2937 m_soloAction->setChecked(true);
2938 MainWindowBase::playSoloToggled();
2939 }
2935 m_soloModified = false; 2940 m_soloModified = false;
2936 emit canChangeSolo(false); 2941 emit canChangeSolo(false);
2937 m_document->alignModels(); 2942 m_document->alignModels();
2938 m_document->setAutoAlignment(true); 2943 m_document->setAutoAlignment(true);
2939 } else { 2944 } else {
2940 if (!m_soloModified) { 2945 if (!m_soloModified) {
2941 m_soloAction->setChecked(m_prevSolo); 2946 if (m_soloAction->isChecked() != m_prevSolo) {
2942 m_viewManager->setPlaySoloMode(m_prevSolo); 2947 m_soloAction->setChecked(m_prevSolo);
2948 MainWindowBase::playSoloToggled();
2949 }
2943 } 2950 }
2944 emit canChangeSolo(true); 2951 emit canChangeSolo(true);
2945 m_document->setAutoAlignment(false); 2952 m_document->setAutoAlignment(false);
2946 } 2953 }
2947 2954