# HG changeset patch # User matthiasm # Date 1364328848 0 # Node ID 49afde2dd7048a9ed3fe2e9544fc8f21d2911a88 # Parent 765bb3774c4fa198d97f6d973f47c7f3875eb6b1 put the FlexiNote layer before the note layer to see what happens -- not much diff -r 765bb3774c4f -r 49afde2dd704 layer/FlexiNoteLayer.cpp --- a/layer/FlexiNoteLayer.cpp Tue Mar 26 17:00:45 2013 +0000 +++ b/layer/FlexiNoteLayer.cpp Tue Mar 26 20:14:08 2013 +0000 @@ -45,11 +45,10 @@ m_originalPoint(0, 0.0, 0, 1.f, tr("New Point")), m_editingPoint(0, 0.0, 0, 1.f, tr("New Point")), m_editingCommand(0), - m_verticalScale(AutoAlignScale), - m_scaleMinimum(0), - m_scaleMaximum(0) + m_verticalScale(MIDIRangeScale), + m_scaleMinimum(34), + m_scaleMaximum(77) { - } void @@ -213,11 +212,14 @@ bool FlexiNoteLayer::getDisplayExtents(float &min, float &max) const { - if (!m_model || shouldAutoAlign()) return false; + if (!m_model || shouldAutoAlign()) { + std::cerr << "No model or shouldAutoAlign()" << std::endl; + return false; + } if (m_verticalScale == MIDIRangeScale) { min = Pitch::getFrequencyForPitch(0); - max = Pitch::getFrequencyForPitch(127); + max = Pitch::getFrequencyForPitch(70); return true; } @@ -631,7 +633,7 @@ if (m_verticalScale == MIDIRangeScale) { min = Pitch::getFrequencyForPitch(0); - max = Pitch::getFrequencyForPitch(127); + max = Pitch::getFrequencyForPitch(70); } else if (shouldConvertMIDIToHz()) { min = Pitch::getFrequencyForPitch(lrintf(min)); max = Pitch::getFrequencyForPitch(lrintf(max + 1)); diff -r 765bb3774c4f -r 49afde2dd704 layer/LayerFactory.cpp --- a/layer/LayerFactory.cpp Tue Mar 26 17:00:45 2013 +0000 +++ b/layer/LayerFactory.cpp Tue Mar 26 20:14:08 2013 +0000 @@ -161,11 +161,13 @@ } if (dynamic_cast(model)) { + types.insert(FlexiNotes); types.insert(Notes); } if (dynamic_cast(model)) { types.insert(FlexiNotes); + types.insert(Notes); } if (dynamic_cast(model)) { @@ -196,8 +198,8 @@ LayerTypeSet types; types.insert(TimeInstants); types.insert(TimeValues); + types.insert(FlexiNotes); types.insert(Notes); - types.insert(FlexiNotes); types.insert(Regions); types.insert(Text); types.insert(Image); @@ -213,8 +215,8 @@ if (dynamic_cast(layer)) return TimeRuler; if (dynamic_cast(layer)) return TimeInstants; if (dynamic_cast(layer)) return TimeValues; + if (dynamic_cast(layer)) return FlexiNotes; if (dynamic_cast(layer)) return Notes; - if (dynamic_cast(layer)) return FlexiNotes; if (dynamic_cast(layer)) return Regions; if (dynamic_cast(layer)) return Text; if (dynamic_cast(layer)) return Image; @@ -257,7 +259,7 @@ case TimeInstants: return "timeinstants"; case TimeValues: return "timevalues"; case Notes: return "notes"; - case FlexiNotes: return "flexible notes"; + case FlexiNotes: return "flexinotes"; case Regions: return "regions"; case Text: return "text"; case Image: return "image"; @@ -278,7 +280,7 @@ if (name == "timeruler") return TimeRuler; if (name == "timeinstants") return TimeInstants; if (name == "timevalues") return TimeValues; - if (name == "flexible notes") return FlexiNotes; + if (name == "flexinotes") return FlexiNotes; if (name == "regions") return Regions; if (name == "text") return Text; if (name == "image") return Image; @@ -347,10 +349,10 @@ return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1); } else if (layerType == TimeValues) { return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true); + } else if (layerType == FlexiNotes) { + return new FlexiNoteModel(baseModel->getSampleRate(), 1, true); } else if (layerType == Notes) { return new NoteModel(baseModel->getSampleRate(), 1, true); - } else if (layerType == FlexiNotes) { - return new NoteModel(baseModel->getSampleRate(), 1, true); } else if (layerType == Regions) { return new RegionModel(baseModel->getSampleRate(), 1, true); } else if (layerType == Text) { @@ -418,14 +420,14 @@ layer = new TimeValueLayer; break; + case FlexiNotes: + layer = new FlexiNoteLayer; + break; + case Notes: layer = new NoteLayer; break; - case FlexiNotes: - layer = new FlexiNoteLayer; - break; - case Regions: layer = new RegionLayer; break;