changeset 781:052cbaad991e

Merge from branch tonioni
author Chris Cannam
date Tue, 03 Jun 2014 10:59:48 +0100
parents 6d95d87f1654 (current diff) bf0b419fdaac (diff)
children ddae586bc47b
files
diffstat 3 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp	Fri May 23 11:17:52 2014 +0100
+++ b/layer/FlexiNoteLayer.cpp	Tue Jun 03 10:59:48 2014 +0100
@@ -1351,11 +1351,14 @@
             continue;
         }
 
+        cerr << "snapSelectedNotesToPitchTrack: making new note" << endl;
         FlexiNote newNote(note);
 
         command->deletePoint(note);
 
-
+        if (updateNoteValue(v, newNote)) {
+            command->addPoint(newNote);
+        }
     }
     
     finish(command);
--- a/layer/LayerFactory.cpp	Fri May 23 11:17:52 2014 +0100
+++ b/layer/LayerFactory.cpp	Tue Jun 03 10:59:48 2014 +0100
@@ -197,7 +197,7 @@
     LayerTypeSet types;
     types.insert(TimeInstants);
     types.insert(TimeValues);
-    types.insert(FlexiNotes);
+	types.insert(FlexiNotes);
     types.insert(Notes);
     types.insert(Regions);
     types.insert(Text);
@@ -214,7 +214,7 @@
     if (dynamic_cast<const TimeRulerLayer *>(layer)) return TimeRuler;
     if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants;
     if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues;
-    if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes;
+	if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes;
     if (dynamic_cast<const NoteLayer *>(layer)) return Notes;
     if (dynamic_cast<const RegionLayer *>(layer)) return Regions;
     if (dynamic_cast<const TextLayer *>(layer)) return Text;
@@ -235,7 +235,7 @@
     case TimeInstants: return "instants";
     case TimeValues: return "values";
     case Notes: return "notes";
-    case FlexiNotes: return "flexinotes";
+    case FlexiNotes: return "flexible notes";
     case Regions: return "regions";
     case Text: return "text";
     case Image: return "image";
@@ -349,7 +349,7 @@
 	return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1);
     } else if (layerType == TimeValues) {
 	return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true);
-    } else if (layerType == FlexiNotes) {
+	} else if (layerType == FlexiNotes) {
 	return new FlexiNoteModel(baseModel->getSampleRate(), 1, true);
     } else if (layerType == Notes) {
 	return new NoteModel(baseModel->getSampleRate(), 1, true);
--- a/widgets/PropertyBox.cpp	Fri May 23 11:17:52 2014 +0100
+++ b/widgets/PropertyBox.cpp	Tue Jun 03 10:59:48 2014 +0100
@@ -768,7 +768,13 @@
     dialog->setLabelText(tr("Set playback clip:"));
 
     QComboBox *cb = dialog->findChild<QComboBox *>();
-    if (cb) cb->setCurrentText(clip);
+    if (cb) {
+        for (int i = 0; i < cb->count(); ++i) {
+            if (cb->itemText(i) == clip) {
+                cb->setCurrentIndex(i);
+            }
+        }
+    }
 
     connect(dialog, SIGNAL(textValueChanged(QString)), 
             this, SLOT(playClipChanged(QString)));