comparison src/Analyser.cpp @ 45:f4ee3c11eba9

toggle button for boundary constraints and note recalculation
author gyorgyf
date Thu, 20 Jun 2013 10:58:40 +0100
parents 66ba56e708c0
children 0909a7bda224
comparison
equal deleted inserted replaced
44:66ba56e708c0 45:f4ee3c11eba9
36 { 36 {
37 } 37 }
38 38
39 Analyser::~Analyser() 39 Analyser::~Analyser()
40 { 40 {
41 if (m_flexiNoteLayer) delete m_flexiNoteLayer;
41 } 42 }
42 43
43 void 44 void
44 Analyser::newFileLoaded(Document *doc, WaveFileModel *model, 45 Analyser::newFileLoaded(Document *doc, WaveFileModel *model,
45 PaneStack *paneStack, Pane *pane) 46 PaneStack *paneStack, Pane *pane)
46 { 47 {
47 m_document = doc; 48 m_document = doc;
48 m_fileModel = model; 49 m_fileModel = model;
49 m_pane = pane; 50 m_pane = pane;
50 51
51 TransformId f0 = "vamp:yintony:yintony:notepitchtrack"; 52 // TransformId f0 = "vamp:yintony:yintony:notepitchtrack";
52 TransformId notes = "vamp:yintony:yintony:notes"; 53 // TransformId notes = "vamp:yintony:yintony:notes";
53 54
54 // TransformId f0 = "vamp:cepstral-pitchtracker:cepstral-pitchtracker:f0"; 55 TransformId f0 = "vamp:cepstral-pitchtracker:cepstral-pitchtracker:f0";
55 // TransformId notes = "vamp:cepstral-pitchtracker:cepstral-pitchtracker:notes"; 56 TransformId notes = "vamp:cepstral-pitchtracker:cepstral-pitchtracker:notes";
56 57
57 // We don't want a waveform in the main pane. We must have a 58 // We don't want a waveform in the main pane. We must have a
58 // main-model layer of some sort, but the layers created by 59 // main-model layer of some sort, but the layers created by
59 // transforms are derived layers, so we'll create a time ruler for 60 // transforms are derived layers, so we'll create a time ruler for
60 // the main-model layer. It could subsequently be hidden if we 61 // the main-model layer. It could subsequently be hidden if we
82 layer = addLayerForNotes(notes); 83 layer = addLayerForNotes(notes);
83 84
84 if (layer) { 85 if (layer) {
85 FlexiNoteLayer *nl = qobject_cast<FlexiNoteLayer *>(layer); 86 FlexiNoteLayer *nl = qobject_cast<FlexiNoteLayer *>(layer);
86 if (nl) { 87 if (nl) {
88 m_flexiNoteLayer = nl;
87 nl->setBaseColour(ColourDatabase::getInstance()-> 89 nl->setBaseColour(ColourDatabase::getInstance()->
88 getColourIndex(QString("Bright Blue"))); 90 getColourIndex(QString("Bright Blue")));
89 nl->setVerticalScale(FlexiNoteLayer::AutoAlignScale); 91 nl->setVerticalScale(FlexiNoteLayer::AutoAlignScale);
90 // nl->setDisplayExtents(80.f,600.f); // temporary values: better get the real extents of the data form the model 92 // nl->setDisplayExtents(80.f,600.f); // temporary values: better get the real extents of the data form the model
91 } 93 }
162 } 164 }
163 165
164 return layer; 166 return layer;
165 } 167 }
166 168
169 void
170 Analyser::setIntelligentActions(bool on)
171 {
172 std::cerr << "toggle setIntelligentActions " << on << std::endl;
173 m_flexiNoteLayer->setIntelligentActions(on);
174 }