diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-05-02 20:02:48 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-05-02 20:02:48 +0000 |
commit | 20157d04f8a5f8f7e24bd450f3a2961b4e251570 (patch) | |
tree | 547ba49d95bb6bea07239c60ccfe849ef406b872 /gtk2_ardour/time_axis_view.cc | |
parent | 88707bf3bbb9b2ac39fc1c5521a4c2ed9dc6eba4 (diff) |
many changes related to region zooming; proto-visual state undo/redo stack; fill-tracks command steals "f" (follow-playhead now on shift-f
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3306 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 7723e122f4..d90698db0e 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -921,11 +921,34 @@ TimeAxisView::get_parent_with_state () return parent->get_parent_with_state (); } -void + +XMLNode& +TimeAxisView::get_state () +{ + XMLNode* node = new XMLNode ("TAV-" + name()); + char buf[32]; + + snprintf (buf, sizeof(buf), "%u", height); + node->add_property ("height", buf); + snprintf (buf, sizeof(buf), "%f", height_scaling_factor); + node->add_property ("height_scaling_factor", buf); + node->add_property ("marked_for_display", (_marked_for_display ? "1" : "0")); + return *node; +} + +int TimeAxisView::set_state (const XMLNode& node) { const XMLProperty *prop; + if ((prop = node.property ("marked_for_display")) != 0) { + _marked_for_display = (prop->value() == "1"); + } + + if ((prop = node.property ("height_scaling_factor")) != 0) { + height_scaling_factor = atof (prop->value()); + } + if ((prop = node.property ("track_height")) != 0) { if (prop->value() == "largest") { @@ -947,12 +970,14 @@ TimeAxisView::set_state (const XMLNode& node) } else if ((prop = node.property ("height")) != 0) { - uint32_t h = atoi (prop->value()); - set_height (h); - + set_height (atoi (prop->value())); + } else { + set_height (hNormal); } + + return 0; } void |