Mercurial > hg > tony
changeset 47:0909a7bda224
instrument is now "click" -- some other minor changes I don't remember
author | matthiasm |
---|---|
date | Thu, 20 Jun 2013 13:47:36 +0100 |
parents | a2050445818c (current diff) f4ee3c11eba9 (diff) |
children | 3d096cecb44f |
files | .hgsubstate src/Analyser.cpp |
diffstat | 5 files changed, 41 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate Thu Jun 20 11:07:57 2013 +0100 +++ b/.hgsubstate Thu Jun 20 13:47:36 2013 +0100 @@ -1,3 +1,3 @@ cba1e2a3d14bdaa7ca167d8c1ff9727359a560d3 svapp -9089d0546efafd97f0db0ac0d78ca28e795a0d17 svcore -65b966394650c7b59ad454e530e7940587f5a84b svgui +5e9ff92ca05e1c0d5f807a1f8f79a352e29ba5d7 svcore +8663a831838f566c315c84547d59e662f176afe1 svgui
--- a/src/Analyser.cpp Thu Jun 20 11:07:57 2013 +0100 +++ b/src/Analyser.cpp Thu Jun 20 13:47:36 2013 +0100 @@ -38,6 +38,7 @@ Analyser::~Analyser() { + if (m_flexiNoteLayer) delete m_flexiNoteLayer; } void @@ -84,6 +85,7 @@ if (layer) { FlexiNoteLayer *nl = qobject_cast<FlexiNoteLayer *>(layer); if (nl) { + m_flexiNoteLayer = nl; nl->setBaseColour(ColourDatabase::getInstance()-> getColourIndex(QString("Bright Blue"))); nl->setVerticalScale(FlexiNoteLayer::AutoAlignScale); @@ -164,3 +166,9 @@ return layer; } +void +Analyser::setIntelligentActions(bool on) +{ + std::cerr << "toggle setIntelligentActions " << on << std::endl; + m_flexiNoteLayer->setIntelligentActions(on); +}
--- a/src/Analyser.h Thu Jun 20 11:07:57 2013 +0100 +++ b/src/Analyser.h Thu Jun 20 13:47:36 2013 +0100 @@ -20,7 +20,7 @@ #include "transform/Transform.h" #include "layer/LayerFactory.h" // GF: added so we can access the FlexiNotes enum value. - +#include "layer/FlexiNoteLayer.h" class WaveFileModel; class Pane; @@ -39,11 +39,14 @@ void newFileLoaded(Document *newDocument, WaveFileModel *model, PaneStack *paneStack, Pane *pane); + + void setIntelligentActions(bool); protected: Document *m_document; WaveFileModel *m_fileModel; Pane *m_pane; + FlexiNoteLayer *m_flexiNoteLayer; Layer *addLayerFor(TransformId); Layer *addLayerForNotes(TransformId);
--- a/src/MainWindow.cpp Thu Jun 20 11:07:57 2013 +0100 +++ b/src/MainWindow.cpp Thu Jun 20 13:47:36 2013 +0100 @@ -84,8 +84,9 @@ MainWindowBase(withAudioOutput, withOSCSupport, false), m_overview(0), m_mainMenusCreated(false), + m_intelligentActionOn(true), //GF: !!! temporary m_playbackMenu(0), - m_recentFilesMenu(0), + m_recentFilesMenu(0), m_rightButtonMenu(0), m_rightButtonPlaybackMenu(0), m_deleteSelectedAction(0), @@ -594,6 +595,12 @@ connect(m_editSelectAction, SIGNAL(triggered()), this, SLOT(selectNoteEditMode())); // connect(this, SIGNAL(canPlay(bool)), test, SLOT(setEnabled(bool))); menu->addAction(m_editSelectAction); + + m_toggleIntelligenceAction = toolbar->addAction(il.load("notes"), tr("EditMode")); + // m_toggleIntelligenceAction->setShortcut(tr("Home")); + m_toggleIntelligenceAction->setStatusTip(tr("Toggle note edit boundary constraints and automation")); + m_toggleIntelligenceAction->setEnabled(true); + connect(m_toggleIntelligenceAction, SIGNAL(triggered()), this, SLOT(toggleNoteEditIntelligence())); Pane::registerShortcuts(*m_keyReference); } @@ -609,7 +616,21 @@ std::cerr << "NoteEdit mode selected" << std::endl; m_viewManager->setToolMode(ViewManager::NoteEditMode); m_editSelectAction->setIcon(il.load("navigate")); - m_editSelectAction->setStatusTip(tr("Navigate")); + } +} + +void +MainWindow::toggleNoteEditIntelligence() +{ + IconLoader il; + if (m_intelligentActionOn == true) { + m_toggleIntelligenceAction->setIcon(il.load("values")); + m_intelligentActionOn = false; + m_analyser->setIntelligentActions(false); + } else { + m_toggleIntelligenceAction->setIcon(il.load("notes")); + m_intelligentActionOn = true; + m_analyser->setIntelligentActions(true); } }
--- a/src/MainWindow.h Thu Jun 20 11:07:57 2013 +0100 +++ b/src/MainWindow.h Thu Jun 20 13:47:36 2013 +0100 @@ -100,6 +100,7 @@ // GF: function for switching to NoteEditMode (perhaps temporary, as we may want this to be triggered in some other way...) virtual void selectNoteEditMode(); + virtual void toggleNoteEditIntelligence(); protected: @@ -122,6 +123,9 @@ QAction *m_ffwdAction; QAction *m_rwdAction; QAction *m_editSelectAction; + QAction *m_toggleIntelligenceAction; + bool m_intelligentActionOn; // GF: !!! temporary + KeyReference *m_keyReference;