X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Froute_ui.cc;h=385279ac30e4123fdcea1d2a8caf298faca3362b;hb=70d246fbe30d24197781384fa4825f32fb0f4235;hp=334492fab3d144f2e57acc2ae2931dbe370cde88;hpb=4e2d805c9d60c493dbdd0683d14377f4cdc1960f;p=ardour.git diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 334492fab3..385279ac30 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -62,7 +62,7 @@ using namespace Gtkmm2ext; using namespace ARDOUR; using namespace PBD; -uint32_t RouteUI::_max_invert_buttons = 4; +uint32_t RouteUI::_max_invert_buttons = 3; RouteUI::RouteUI (ARDOUR::Session* sess) : AxisView(sess) @@ -587,7 +587,7 @@ RouteUI::build_record_menu () using namespace Menu_Helpers; MenuList& items = record_menu->items(); - items.push_back (CheckMenuElem (_("Step Edit"), sigc::mem_fun (*this, &RouteUI::toggle_step_edit))); + items.push_back (CheckMenuElem (_("Step Entry"), sigc::mem_fun (*this, &RouteUI::toggle_step_edit))); step_edit_item = dynamic_cast (&items.back()); if (_route->record_enabled()) { @@ -659,24 +659,51 @@ RouteUI::build_sends_menu () sends_menu->set_name ("ArdourContextMenu"); MenuList& items = sends_menu->items(); - items.push_back (MenuElem(_("Assign all tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader))); - items.push_back (MenuElem(_("Assign all tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader))); - items.push_back (MenuElem(_("Assign selected tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader))); - items.push_back (MenuElem(_("Assign selected tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader))); - items.push_back (MenuElem(_("Copy track gains to sends"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_from_track))); + items.push_back ( + MenuElem(_("Assign all tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader, false)) + ); + + items.push_back ( + MenuElem(_("Assign all tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader, true)) + ); + + items.push_back ( + MenuElem(_("Assign all tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader, false)) + ); + + items.push_back ( + MenuElem(_("Assign all tracks and buses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader, true)) + ); + + items.push_back ( + MenuElem(_("Assign selected tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader, false)) + ); + + items.push_back ( + MenuElem(_("Assign selected tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader, true))); + + items.push_back ( + MenuElem(_("Assign selected tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader, false)) + ); + + items.push_back ( + MenuElem(_("Assign selected tracks and buses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader, true)) + ); + + items.push_back (MenuElem(_("Copy track/bus gains to sends"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_from_track))); items.push_back (MenuElem(_("Set sends gain to -inf"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_to_zero))); items.push_back (MenuElem(_("Set sends gain to 0dB"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_to_unity))); } void -RouteUI::create_sends (Placement p) +RouteUI::create_sends (Placement p, bool include_buses) { - _session->globally_add_internal_sends (_route, p); + _session->globally_add_internal_sends (_route, p, include_buses); } void -RouteUI::create_selected_sends (Placement p) +RouteUI::create_selected_sends (Placement p, bool include_buses) { boost::shared_ptr rlist (new RouteList); TrackSelection& selected_tracks (ARDOUR_UI::instance()->the_editor().get_selection().tracks); @@ -686,7 +713,7 @@ RouteUI::create_selected_sends (Placement p) RouteUI* rui; if ((rtv = dynamic_cast(*i)) != 0) { if ((rui = dynamic_cast(rtv)) != 0) { - if (boost::dynamic_pointer_cast(rui->route())) { + if (include_buses || boost::dynamic_pointer_cast(rui->route())) { rlist->push_back (rui->route()); } } @@ -984,7 +1011,7 @@ RouteUI::update_mute_display () --_i_am_the_modifier; } - mute_button->set_visual_state (mute_visual_state (_session, _route)); + mute_button->set_visual_state (mute_visual_state (_session, _route)); } void @@ -1204,7 +1231,7 @@ RouteUI::solo_isolate_button_release (GdkEventButton* ev) } bool -RouteUI::solo_safe_button_release (GdkEventButton* ev) +RouteUI::solo_safe_button_release (GdkEventButton*) { _route->set_solo_safe (!(solo_safe_led->visual_state() > 0), this); return true; @@ -1266,6 +1293,35 @@ RouteUI::ensure_xml_node () if ((xml_node = _route->extra_xml ("GUI")) == 0) { xml_node = new XMLNode ("GUI"); _route->add_extra_xml (*xml_node); + } else { + /* the Route has one; it may have been loaded */ + if (Stateful::loading_state_version != 0 && Stateful::loading_state_version < 3000) { + /* the GUI extra XML is in 2.X format; we must convert it to the new + format to avoid problems later + */ + + XMLNode* new_xml_node = new XMLNode (X_("GUI")); + XMLPropertyList old_gui_props = xml_node->properties (); + for (XMLPropertyIterator i = old_gui_props.begin(); i != old_gui_props.end(); ++i) { + new_xml_node->add_property ((*i)->name().c_str (), (*i)->value().c_str ()); + } + + XMLNodeList old_children = xml_node->children (); + for (XMLNodeConstIterator i = old_children.begin(); i != old_children.end(); ++i) { + XMLNode* new_child = new XMLNode (AutomationTimeAxisView::state_node_name); + new_child->add_property (X_("automation-id"), (*i)->name()); + + XMLPropertyList old_props = (*i)->properties (); + for (XMLPropertyIterator j = old_props.begin(); j != old_props.end(); ++j) { + new_child->add_property ((*j)->name().c_str (), (*j)->value().c_str ()); + } + + new_xml_node->add_child_nocopy (*new_child); + } + + _route->add_extra_xml (*new_xml_node); + xml_node = new_xml_node; + } } } } @@ -1281,10 +1337,12 @@ RouteUI::get_automation_child_xml_node (Evoral::Parameter param) const string sym = ARDOUR::EventTypeMap::instance().to_symbol(param); for (iter = kids.begin(); iter != kids.end(); ++iter) { + if ((*iter)->name() == AutomationTimeAxisView::state_node_name) { XMLProperty* type = (*iter)->property("automation-id"); - if (type && type->value() == sym) + if (type && type->value() == sym) { return *iter; + } } } @@ -1340,9 +1398,9 @@ edit your ardour.rc file to set the\n\ string prompt; if (is_track()) { - prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n(this cannot be undone)"), _route->name()); + prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n\n(This action cannot be undone, and the session file will be overwritten)"), _route->name()); } else { - prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n(this cannot be undone)"), _route->name()); + prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n\nYou may also lose the playlist used by this track.\n\n(This action cannot be undone, and the session file will be overwritten)"), _route->name()); } choices.push_back (_("No, do nothing.")); @@ -1386,10 +1444,9 @@ RouteUI::route_rename () name_prompter.show_all (); switch (name_prompter.run ()) { - case Gtk::RESPONSE_ACCEPT: - name_prompter.get_result (result); - if (result.length()) { + name_prompter.get_result (result); + if (result.length()) { _route->set_name (result); } break; @@ -1414,7 +1471,7 @@ RouteUI::toggle_route_active () if (route_active_menu_item) { if (route_active_menu_item->get_active() != (yn = _route->active())) { - _route->set_active (!yn); + _route->set_active (!yn, this); } } } @@ -1540,7 +1597,7 @@ void RouteUI::save_as_template () { sys::path path; - Glib::ustring safe_name; + std::string safe_name; string name; path = ARDOUR::user_route_template_directory (); @@ -1554,6 +1611,7 @@ RouteUI::save_as_template () p.set_title (_("Save As Template")); p.set_prompt (_("Template name:")); + p.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); switch (p.run()) { case RESPONSE_ACCEPT: break; @@ -1587,9 +1645,7 @@ RouteUI::parameter_changed (string const & p) { if (p == "disable-disarm-during-roll") { check_rec_enable_sensitivity (); - } else if (p == "solo-control-is-listen-control") { - set_button_names (); - } else if (p == "listen-position") { + } else if (p == "use-monitor-bus" || p == "solo-control-is-listen-control" || p == "listen-position") { set_button_names (); } } @@ -1766,3 +1822,11 @@ RouteUI::invert_menu_toggled (uint32_t c) _route->set_phase_invert (c, !_route->phase_invert (c)); } + +void +RouteUI::set_invert_sensitive (bool yn) +{ + for (list::iterator b = _invert_buttons.begin(); b != _invert_buttons.end(); ++b) { + (*b)->set_sensitive (yn); + } +}