X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmixer_ui.cc;h=4d6f7119cc72b9ac5528a7ed7a1de675165aee5c;hb=d1b4599725abda6b8697151fd4a1bd3740ad2f2a;hp=badd96154a88025f4fbcf4ad1b305c6182d0055d;hpb=f0748535a5023d132eff03999a705a3e56c516db;p=ardour.git diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index badd96154a..4d6f7119cc 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -29,11 +29,9 @@ #include #include -#include #include #include -#include "ardour/audio_diskstream.h" #include "ardour/audio_track.h" #include "ardour/plugin_manager.h" #include "ardour/route_group.h" @@ -77,7 +75,7 @@ Mixer_UI::Mixer_UI () strip_redisplay_does_not_sync_order_keys = false; ignore_sync = false; - Route::SyncOrderKeys.connect (*this, ui_bind (&Mixer_UI::sync_order_keys, this, _1), gui_context()); + Route::SyncOrderKeys.connect (*this, invalidator (*this), ui_bind (&Mixer_UI::sync_order_keys, this, _1), gui_context()); scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); scroller_base.set_name ("MixerWindow"); @@ -254,7 +252,7 @@ Mixer_UI::Mixer_UI () auto_rebinding = FALSE; - MixerStrip::CatchDeletion.connect (*this, ui_bind (&Mixer_UI::remove_strip, this, _1), gui_context()); + MixerStrip::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&Mixer_UI::remove_strip, this, _1), gui_context()); MonitorSection::setup_knob_images (); @@ -321,29 +319,19 @@ Mixer_UI::add_strip (RouteList& routes) continue; } - if (route->is_control()) { + if (route->is_monitor()) { if (!_monitor_section) { _monitor_section = new MonitorSection (_session); - out_packer.pack_end (_monitor_section->pack_widget(), false, false); + out_packer.pack_end (_monitor_section->tearoff(), 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); - } - } + _monitor_section->tearoff().show_all (); + + XMLNode* mnode = ARDOUR_UI::instance()->tearoff_settings (X_("monitor-section")); + if (mnode) { + _monitor_section->tearoff().set_state (*mnode); } /* no regular strip shown for control out */ @@ -372,7 +360,7 @@ Mixer_UI::add_strip (RouteList& routes) route->set_order_key (N_("signal"), track_model->children().size()-1); } - route->PropertyChanged.connect (*this, ui_bind (&Mixer_UI::strip_property_changed, this, _1, strip), gui_context()); + route->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&Mixer_UI::strip_property_changed, this, _1, strip), gui_context()); strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed)); strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip)); @@ -521,10 +509,12 @@ Mixer_UI::set_session (Session* sess) initial_track_display (); - _session->RouteAdded.connect (_session_connections, ui_bind (&Mixer_UI::add_strip, this, _1), gui_context()); - _session->route_group_added.connect (_session_connections, ui_bind (&Mixer_UI::add_route_group, this, _1), gui_context()); - _session->route_group_removed.connect (_session_connections, boost::bind (&Mixer_UI::route_groups_changed, this), gui_context()); - _session->config.ParameterChanged.connect (_session_connections, ui_bind (&Mixer_UI::parameter_changed, this, _1), gui_context()); + _session->RouteAdded.connect (_session_connections, invalidator (*this), ui_bind (&Mixer_UI::add_strip, this, _1), gui_context()); + _session->route_group_added.connect (_session_connections, invalidator (*this), ui_bind (&Mixer_UI::add_route_group, this, _1), gui_context()); + _session->route_group_removed.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::route_groups_changed, this), gui_context()); + _session->config.ParameterChanged.connect (_session_connections, invalidator (*this), ui_bind (&Mixer_UI::parameter_changed, this, _1), gui_context()); + + Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&Mixer_UI::parameter_changed, this, _1), gui_context ()); route_groups_changed (); @@ -548,7 +538,9 @@ Mixer_UI::session_going_away () delete (*i); } - _monitor_section->pack_widget().hide (); + if (_monitor_section) { + _monitor_section->tearoff().hide_visible (); + } strips.clear (); @@ -614,10 +606,6 @@ Mixer_UI::fast_update_strips () for (list::iterator i = strips.begin(); i != strips.end(); ++i) { (*i)->fast_update (); } - - if (_monitor_section) { - _monitor_section->fast_update (); - } } } @@ -638,7 +626,7 @@ Mixer_UI::set_all_strips_visibility (bool yn) continue; } - if (strip->route()->is_master() || strip->route()->is_control()) { + if (strip->route()->is_master() || strip->route()->is_monitor()) { continue; } @@ -666,7 +654,7 @@ Mixer_UI::set_all_audio_visibility (int tracks, bool yn) continue; } - if (strip->route()->is_master() || strip->route()->is_control()) { + if (strip->route()->is_master() || strip->route()->is_monitor()) { continue; } @@ -789,7 +777,7 @@ Mixer_UI::redisplay_track_list () if (strip->packed()) { - if (strip->route()->is_master() || strip->route()->is_control()) { + if (strip->route()->is_master() || strip->route()->is_monitor()) { out_packer.reorder_child (*strip, -1); } else { strip_packer.reorder_child (*strip, -1); /* put at end */ @@ -797,7 +785,7 @@ Mixer_UI::redisplay_track_list () } else { - if (strip->route()->is_master() || strip->route()->is_control()) { + if (strip->route()->is_master() || strip->route()->is_monitor()) { out_packer.pack_start (*strip, false, false); } else { strip_packer.pack_start (*strip, false, false); @@ -810,7 +798,7 @@ Mixer_UI::redisplay_track_list () strip->set_marked_for_display (false); - if (strip->route()->is_master() || strip->route()->is_control()) { + if (strip->route()->is_master() || strip->route()->is_monitor()) { /* do nothing, these cannot be hidden */ } else { if (strip->packed()) { @@ -1008,7 +996,7 @@ Mixer_UI::track_display_button_press (GdkEventButton* ev) MixerStrip* strip = (*iter)[track_columns.strip]; if (strip) { - if (!strip->route()->is_master() && !strip->route()->is_control()) { + if (!strip->route()->is_master() && !strip->route()->is_monitor()) { bool visible = (*iter)[track_columns.visible]; (*iter)[track_columns.visible] = !visible; } @@ -1216,14 +1204,12 @@ Mixer_UI::remove_selected_route_group () } void -Mixer_UI::group_flags_changed (void* src, RouteGroup* group) +Mixer_UI::route_group_property_changed (RouteGroup* group, const PropertyChange& change) { if (in_group_row_change) { return; } - ENSURE_GUI_THREAD (*this, &Mixer_UI::group_flags_changed, src, group) - /* force an update of any mixer strips that are using this group, otherwise mix group names don't change in mixer strips */ @@ -1250,7 +1236,9 @@ Mixer_UI::group_flags_changed (void* src, RouteGroup* group) in_group_row_change = false; - _group_tabs->set_dirty (); + if (change.contains (Properties::name)) { + _group_tabs->set_dirty (); + } } void @@ -1324,7 +1312,7 @@ Mixer_UI::add_route_group (RouteGroup* group) focus = true; } - group->FlagsChanged.connect (*this, ui_bind (&Mixer_UI::group_flags_changed, this, _1, group), gui_context()); + group->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&Mixer_UI::route_group_property_changed, this, group, _1), gui_context()); if (focus) { TreeViewColumn* col = group_display.get_column (0); @@ -1626,6 +1614,11 @@ Mixer_UI::parameter_changed (string const & p) } else { _group_tabs->hide (); } + } else if (p == "default-narrow_ms") { + bool const s = Config->get_default_narrow_ms (); + for (list::iterator i = strips.begin(); i != strips.end(); ++i) { + (*i)->set_width_enum (s ? Narrow : Wide, this); + } } }