# HG changeset patch # User Chris Cannam # Date 1396471804 -3600 # Node ID 6a8d922f991d5e96b97f79ca0e4f20fd66e03462 # Parent d0fd7630d32f38e816a9147acf7295f812bee1e1 A lot of work on saving and reloading sessions: save flexinote layer type and hybrid spectrogram normalisation, etc diff -r d0fd7630d32f -r 6a8d922f991d layer/LayerFactory.cpp --- a/layer/LayerFactory.cpp Wed Apr 02 18:22:41 2014 +0100 +++ b/layer/LayerFactory.cpp Wed Apr 02 21:50:04 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(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 FlexiNotes; if (dynamic_cast(layer)) return Notes; if (dynamic_cast(layer)) return Regions; if (dynamic_cast(layer)) return Text; @@ -235,7 +235,7 @@ case TimeInstants: return "instants"; case TimeValues: return "values"; 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"; @@ -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); diff -r d0fd7630d32f -r 6a8d922f991d layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Wed Apr 02 18:22:41 2014 +0100 +++ b/layer/SpectrogramLayer.cpp Wed Apr 02 21:50:04 2014 +0100 @@ -3647,18 +3647,21 @@ "colourScheme=\"%4\" " "colourRotation=\"%5\" " "frequencyScale=\"%6\" " - "binDisplay=\"%7\" " - "normalizeColumns=\"%8\" " - "normalizeVisibleArea=\"%9\"") + "binDisplay=\"%7\" ") .arg(m_minFrequency) .arg(m_maxFrequency) .arg(m_colourScale) .arg(m_colourMap) .arg(m_colourRotation) .arg(m_frequencyScale) - .arg(m_binDisplay) + .arg(m_binDisplay); + + s += QString("normalizeColumns=\"%1\" " + "normalizeVisibleArea=\"%2\" " + "normalizeHybrid=\"%3\" ") .arg(m_normalizeColumns ? "true" : "false") - .arg(m_normalizeVisibleArea ? "true" : "false"); + .arg(m_normalizeVisibleArea ? "true" : "false") + .arg(m_normalizeHybrid ? "true" : "false"); Layer::toXml(stream, indent, extraAttributes + " " + s); } @@ -3731,5 +3734,9 @@ bool normalizeVisibleArea = (attributes.value("normalizeVisibleArea").trimmed() == "true"); setNormalizeVisibleArea(normalizeVisibleArea); + + bool normalizeHybrid = + (attributes.value("normalizeHybrid").trimmed() == "true"); + setNormalizeHybrid(normalizeHybrid); }