summaryrefslogtreecommitdiff
path: root/muse2/muse/functions.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-05-16 11:34:53 +0000
committerFlorian Jung <flo@windfisch.org>2011-05-16 11:34:53 +0000
commit4e1ca61b03bab50d5e71e6da433503ac3b4470c0 (patch)
tree4c002df0f12f916b8a30a5e115ea8fbd80c15480 /muse2/muse/functions.cpp
parentc7d22c133d2d9a5e8494d0285af10da6a6dff9d9 (diff)
fixed saving window state
dialogs now also save and restore their state templates were updated and have now sane defaults for toolbars etc.
Diffstat (limited to 'muse2/muse/functions.cpp')
-rw-r--r--muse2/muse/functions.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/muse2/muse/functions.cpp b/muse2/muse/functions.cpp
index 65369b98..e14f32b8 100644
--- a/muse2/muse/functions.cpp
+++ b/muse2/muse/functions.cpp
@@ -436,3 +436,70 @@ void delete_overlaps(const set<Part*>& parts, int range)
if (undo_started) song->endUndo(SC_EVENT_MODIFIED);
}
}
+
+
+
+void read_function_dialog_config(Xml& xml)
+{
+ if (erase_dialog==NULL)
+ {
+ cout << "ERROR: THIS SHOULD NEVER HAPPEN: read_function_dialog_config() called, but\n"
+ " dialogs are still uninitalized (NULL)!"<<endl;
+ return;
+ }
+
+ for (;;)
+ {
+ Xml::Token token = xml.parse();
+ if (token == Xml::Error || token == Xml::End)
+ break;
+
+ const QString& tag = xml.s1();
+ switch (token)
+ {
+ case Xml::TagStart:
+ if (tag == "mod_len")
+ gatetime_dialog->read_configuration(xml);
+ else if (tag == "mod_velo")
+ velocity_dialog->read_configuration(xml);
+ else if (tag == "quantize")
+ quantize_dialog->read_configuration(xml);
+ else if (tag == "erase")
+ erase_dialog->read_configuration(xml);
+ else if (tag == "del_overlaps")
+ del_overlaps_dialog->read_configuration(xml);
+ else if (tag == "setlen")
+ set_notelen_dialog->read_configuration(xml);
+ else if (tag == "move")
+ move_notes_dialog->read_configuration(xml);
+ else if (tag == "transpose")
+ transpose_dialog->read_configuration(xml);
+ else
+ xml.unknown("function_dialogs");
+ break;
+
+ case Xml::TagEnd:
+ if (tag == "dialogs")
+ return;
+
+ default:
+ break;
+ }
+ }
+}
+
+void write_function_dialog_config(int level, Xml& xml)
+{
+ xml.tag(level++, "dialogs");
+
+ gatetime_dialog->write_configuration(level, xml);
+ velocity_dialog->write_configuration(level, xml);
+ quantize_dialog->write_configuration(level, xml);
+ erase_dialog->write_configuration(level, xml);
+ del_overlaps_dialog->write_configuration(level, xml);
+ set_notelen_dialog->write_configuration(level, xml);
+ move_notes_dialog->write_configuration(level, xml);
+ transpose_dialog->write_configuration(level, xml);
+
+ xml.tag(level, "/dialogs");
+}