no longer delete and recreate MonitorSection when it is removed/added to a Session
This commit is contained in:
@@ -570,7 +570,7 @@ Mixer_UI::add_stripables (StripableList& slist)
|
||||
if (mnode) {
|
||||
_monitor_section->tearoff().set_state (*mnode);
|
||||
}
|
||||
|
||||
|
||||
set_monitor_action_sensitivity(true);
|
||||
}
|
||||
|
||||
@@ -2660,9 +2660,9 @@ void
|
||||
Mixer_UI::monitor_section_going_away ()
|
||||
{
|
||||
/* Set sensitivity based on existence of the monitor bus */
|
||||
|
||||
|
||||
set_monitor_action_sensitivity(false);
|
||||
|
||||
|
||||
if (_monitor_section) {
|
||||
|
||||
XMLNode* ui_node = Config->extra_xml(X_("UI"));
|
||||
@@ -2684,8 +2684,6 @@ Mixer_UI::monitor_section_going_away ()
|
||||
monitor_section_detached ();
|
||||
out_packer.remove (_monitor_section->tearoff());
|
||||
_monitor_section->set_session (0);
|
||||
delete _monitor_section;
|
||||
_monitor_section = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,9 +60,6 @@ using namespace Gtkmm2ext;
|
||||
using namespace PBD;
|
||||
using namespace std;
|
||||
|
||||
Glib::RefPtr<ActionGroup> MonitorSection::monitor_actions;
|
||||
Gtkmm2ext::Bindings* MonitorSection::bindings = 0;
|
||||
|
||||
#define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
|
||||
|
||||
MonitorSection::MonitorSection (Session* s)
|
||||
@@ -96,15 +93,13 @@ MonitorSection::MonitorSection (Session* s)
|
||||
|
||||
Glib::RefPtr<Action> act;
|
||||
|
||||
if (!monitor_actions) {
|
||||
register_actions ();
|
||||
load_bindings ();
|
||||
}
|
||||
load_bindings ();
|
||||
register_actions ();
|
||||
set_data ("ardour-bindings", bindings);
|
||||
bindings->associate ();
|
||||
|
||||
channel_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
|
||||
|
||||
set_data ("ardour-bindings", bindings);
|
||||
|
||||
_plugin_selector = new PluginSelector (PluginManager::instance());
|
||||
insert_box = new ProcessorBox (_session, boost::bind (&MonitorSection::plugin_selector, this), _rr_selection, 0);
|
||||
insert_box->set_no_show_all ();
|
||||
@@ -622,6 +617,12 @@ MonitorSection::set_session (Session* s)
|
||||
|
||||
populate_buttons ();
|
||||
|
||||
/* some actions may have been left in the wrong state from a
|
||||
* previous monitor route that was then deleted
|
||||
*/
|
||||
ActionManager::set_sensitive (monitor_actions, true);
|
||||
ActionManager::set_sensitive (solo_actions, true);
|
||||
|
||||
} else {
|
||||
/* no session */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user