From 20157d04f8a5f8f7e24bd450f3a2961b4e251570 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 2 May 2008 20:02:48 +0000 Subject: 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 --- gtk2_ardour/time_axis_view.cc | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'gtk2_ardour/time_axis_view.cc') 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 -- cgit v1.2.3