From f0748535a5023d132eff03999a705a3e56c516db Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 19 Mar 2010 02:49:01 +0000 Subject: save tearoff state; restore monitor section state reasonably well; fixup access control to parts of editor.h (needs more work); extend CrossThread just a little git-svn-id: svn://localhost/ardour2/branches/3.0@6774 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/mixer_ui.cc | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) (limited to 'gtk2_ardour/mixer_ui.cc') diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index c98d0028e9..badd96154a 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "ardour/audio_diskstream.h" @@ -67,7 +68,7 @@ Mixer_UI::Mixer_UI () { _strip_width = Config->get_default_narrow_ms() ? Narrow : Wide; track_menu = 0; - monitor_section = 0; + _monitor_section = 0; route_group_context_menu = 0; no_track_list_redisplay = false; in_group_row_change = false; @@ -321,14 +322,35 @@ Mixer_UI::add_strip (RouteList& routes) } if (route->is_control()) { - monitor_section = new MonitorSection (_session); - out_packer.pack_end (monitor_section->pack_widget(), false, false); - monitor_section->pack_widget().show_all (); - /* no regular strip */ + if (!_monitor_section) { + _monitor_section = new MonitorSection (_session); + out_packer.pack_end (_monitor_section->pack_widget(), false, false); + } else { + _monitor_section->set_session (_session); + } + + _monitor_section->pack_widget().show_all (); + + XMLNode* ui_node = Config->extra_xml(X_("UI")); + + if (ui_node) { + cerr << "Got UI node\n"; + XMLNode* tearoff_node = ui_node->child (X_("Tearoffs")); + if (tearoff_node) { + cerr << "Got tearoff node\n"; + XMLNode* mnode = tearoff_node->child (X_("monitor-section")); + if (mnode) { + cerr << "got mndeo\n"; + _monitor_section->tearoff()->set_tornoff_state (*mnode); + } + } + } + + /* no regular strip shown for control out */ + continue; } - strip = new MixerStrip (*this, _session, route); strips.push_back (strip); @@ -521,14 +543,13 @@ Mixer_UI::session_going_away () group_model->clear (); _selection.clear (); track_model->clear (); - - delete monitor_section; - monitor_section = 0; for (list::iterator i = strips.begin(); i != strips.end(); ++i) { delete (*i); } + _monitor_section->pack_widget().hide (); + strips.clear (); WindowTitle title(Glib::get_application_name()); @@ -594,8 +615,8 @@ Mixer_UI::fast_update_strips () (*i)->fast_update (); } - if (monitor_section) { - monitor_section->fast_update (); + if (_monitor_section) { + _monitor_section->fast_update (); } } } -- cgit v1.2.3