X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Feditor_routes.cc;h=e80838cb55d1656d4532daad4336fcb6026f870e;hb=696837ec7a86046ce43dc61fedd4b6de560fc06d;hp=ed0464395967e2ac19241bd90ba37f3e0bbc5887;hpb=14b0ca31bcb62e5b7e9e77634ef9cd2e8cf65800;p=ardour.git diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index ed04643959..e80838cb55 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -24,7 +24,6 @@ #include #include -#include "ardour/diskstream.h" #include "ardour/session.h" #include "editor.h" @@ -123,7 +122,7 @@ EditorRoutes::EditorRoutes (Editor* e) solo_iso_renderer->set_pixbuf (1, ::get_icon("solo-isolated")); solo_iso_renderer->signal_changed().connect (sigc::mem_fun (*this, &EditorRoutes::on_tv_solo_isolate_toggled)); - TreeViewColumn* solo_isolate_state_column = manage (new TreeViewColumn("I", *solo_iso_renderer)); + TreeViewColumn* solo_isolate_state_column = manage (new TreeViewColumn("SI", *solo_iso_renderer)); solo_isolate_state_column->add_attribute(solo_iso_renderer->property_state(), _columns.solo_isolate_state); solo_isolate_state_column->set_sizing(TREE_VIEW_COLUMN_FIXED); @@ -131,10 +130,25 @@ EditorRoutes::EditorRoutes (Editor* e) solo_isolate_state_column->set_expand(false); solo_isolate_state_column->set_fixed_width(15); + // Solo safe toggle + CellRendererPixbufMulti* solo_safe_renderer = manage (new CellRendererPixbufMulti ()); + + solo_safe_renderer->set_pixbuf (0, ::get_icon("act-disabled")); + solo_safe_renderer->set_pixbuf (1, ::get_icon("solo-enabled")); + solo_safe_renderer->signal_changed().connect (sigc::mem_fun (*this, &EditorRoutes::on_tv_solo_safe_toggled)); + + TreeViewColumn* solo_safe_state_column = manage (new TreeViewColumn(_("SS"), *solo_safe_renderer)); + solo_safe_state_column->add_attribute(solo_safe_renderer->property_state(), _columns.solo_safe_state); + solo_safe_state_column->set_sizing(TREE_VIEW_COLUMN_FIXED); + solo_safe_state_column->set_alignment(ALIGN_CENTER); + solo_safe_state_column->set_expand(false); + solo_safe_state_column->set_fixed_width(22); + _display.append_column (*rec_state_column); _display.append_column (*mute_state_column); _display.append_column (*solo_state_column); _display.append_column (*solo_isolate_state_column); + _display.append_column (*solo_safe_state_column); _display.append_column (_("Name"), _columns.text); _display.append_column (_("V"), _columns.visible); @@ -147,11 +161,11 @@ EditorRoutes::EditorRoutes (Editor* e) _display.set_size_request (100, -1); _display.add_object_drag (_columns.route.index(), "routes"); - CellRendererText* name_cell = dynamic_cast (_display.get_column_cell_renderer (4)); + CellRendererText* name_cell = dynamic_cast (_display.get_column_cell_renderer (5)); assert (name_cell); - TreeViewColumn* name_column = _display.get_column (4); + TreeViewColumn* name_column = _display.get_column (5); assert (name_column); @@ -164,13 +178,13 @@ EditorRoutes::EditorRoutes (Editor* e) name_cell->signal_edited().connect (sigc::mem_fun (*this, &EditorRoutes::name_edit)); // Set the visible column cell renderer to radio toggle - CellRendererToggle* visible_cell = dynamic_cast (_display.get_column_cell_renderer (5)); + CellRendererToggle* visible_cell = dynamic_cast (_display.get_column_cell_renderer (6)); visible_cell->property_activatable() = true; visible_cell->property_radio() = false; visible_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRoutes::visible_changed)); - TreeViewColumn* visible_col = dynamic_cast (_display.get_column (5)); + TreeViewColumn* visible_col = dynamic_cast (_display.get_column (6)); visible_col->set_expand(false); visible_col->set_sizing(TREE_VIEW_COLUMN_FIXED); visible_col->set_fixed_width(30); @@ -258,6 +272,20 @@ EditorRoutes::on_tv_solo_isolate_toggled (Glib::ustring const & path_string) } } +void +EditorRoutes::on_tv_solo_safe_toggled (Glib::ustring const & path_string) +{ + // Get the model row that has been toggled. + Gtk::TreeModel::Row row = *_model->get_iter (Gtk::TreeModel::Path (path_string)); + + TimeAxisView *tv = row[_columns.tv]; + AudioTimeAxisView *atv = dynamic_cast (tv); + + if (atv != 0) { + atv->route()->set_solo_safe (!atv->route()->solo_safe(), this); + } +} + void EditorRoutes::build_menu () { @@ -410,6 +438,7 @@ EditorRoutes::routes_added (list routes) row[_columns.mute_state] = (*x)->route()->muted(); row[_columns.solo_state] = (*x)->route()->soloed(); row[_columns.solo_isolate_state] = (*x)->route()->solo_isolated(); + row[_columns.solo_safe_state] = (*x)->route()->solo_safe(); row[_columns.name_editable] = true; _ignore_reorder = true; @@ -428,18 +457,20 @@ EditorRoutes::routes_added (list routes) if ((*x)->is_track()) { boost::shared_ptr t = boost::dynamic_pointer_cast ((*x)->route()); - t->diskstream()->RecordEnableChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_rec_display, this), gui_context()); + t->RecordEnableChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_rec_display, this), gui_context()); } (*x)->route()->mute_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_mute_display, this), gui_context()); - (*x)->route()->solo_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_display, this), gui_context()); + (*x)->route()->solo_changed.connect (*this, MISSING_INVALIDATOR, ui_bind (&EditorRoutes::update_solo_display, this, _1), gui_context()); (*x)->route()->solo_isolated_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_isolate_display, this), gui_context()); + (*x)->route()->solo_safe_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_safe_display, this), gui_context()); } update_rec_display (); update_mute_display (); - update_solo_display (); + update_solo_display (true); update_solo_isolate_display (); + update_solo_safe_display (); resume_redisplay (); _redisplay_does_not_sync_order_keys = false; } @@ -542,6 +573,8 @@ EditorRoutes::hide_track_in_display (TimeAxisView& tv) break; } } + + redisplay (); } void @@ -556,6 +589,8 @@ EditorRoutes::show_track_in_display (TimeAxisView& tv) break; } } + + redisplay (); } void @@ -995,7 +1030,7 @@ EditorRoutes::update_mute_display () } void -EditorRoutes::update_solo_display () +EditorRoutes::update_solo_display (bool /* selfsoloed */) { TreeModel::Children rows = _model->children(); TreeModel::Children::iterator i; @@ -1018,6 +1053,18 @@ EditorRoutes::update_solo_isolate_display () } } +void +EditorRoutes::update_solo_safe_display () +{ + TreeModel::Children rows = _model->children(); + TreeModel::Children::iterator i; + + for (i = rows.begin(); i != rows.end(); ++i) { + boost::shared_ptr route = (*i)[_columns.route]; + (*i)[_columns.solo_safe_state] = RouteUI::solo_safe_visual_state (route) > 0 ? 1 : 0; + } +} + list EditorRoutes::views () const { @@ -1055,7 +1102,6 @@ EditorRoutes::name_edit (Glib::ustring const & path, Glib::ustring const & new_t void EditorRoutes::solo_changed_so_update_mute () { - ENSURE_GUI_THREAD (*this, &EditorRoutes::solo_changed_so_update_mute) update_mute_display (); }