X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmixer_strip.cc;h=400e865a2ea2c87413060710113100946349c336;hb=49a9fa20a56c6f5607e7bcf209985a67972c3f31;hp=1b8ce06dda1626b74fe83500ce2c4729c789da93;hpb=d0176c23e384a2bb963dcc75a8300caf2852d3d7;p=ardour.git diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 1b8ce06dda..400e865a2e 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -102,6 +102,14 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, bool in_mixer) { init (); + + if (!_mixer_owned) { + /* the editor mixer strip: don't destroy it every time + the underlying route goes away. + */ + + self_destruct = false; + } } MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr rt, bool in_mixer) @@ -134,6 +142,7 @@ MixerStrip::init () group_menu = 0; _marked_for_display = false; route_ops_menu = 0; + rename_menu_item = 0; ignore_comment_edit = false; ignore_toggle = false; ignore_speed_adjustment = false; @@ -195,11 +204,13 @@ MixerStrip::init () name_button.add (name_label); name_button.set_name ("MixerNameButton"); Gtkmm2ext::set_size_request_to_display_given_text (name_button, "longest label", 2, 2); - name_label.set_name ("MixerNameButtonLabel"); + ARDOUR_UI::instance()->set_tip (&group_button, _("Mix group"), ""); group_button.add (group_label); group_button.set_name ("MixerGroupButton"); + Gtkmm2ext::set_size_request_to_display_given_text (group_button, "Group", 2, 2); + group_label.set_name ("MixerGroupButtonLabel"); comment_button.set_name ("MixerCommentButton"); @@ -366,6 +377,7 @@ MixerStrip::set_route (boost::shared_ptr rt) #endif /* VARISPEED_IN_MIXER_STRIP */ button_table.attach (*rec_enable_button, 0, 2, 2, 3); + rec_enable_button->set_sensitive (_session.writable()); rec_enable_button->show(); } @@ -388,6 +400,9 @@ MixerStrip::set_route (boost::shared_ptr rt) meter_point_label.set_text (_("post")); break; } + + delete route_ops_menu; + route_ops_menu = 0; ARDOUR_UI::instance()->tooltips().set_tip (comment_button, _route->comment().empty() ? _("Click to Add/Edit Comments"): @@ -994,7 +1009,7 @@ MixerStrip::mix_group_changed (void *ignored) RouteGroup *rg = _route->mix_group(); if (rg) { - group_label.set_text (rg->name()); + group_label.set_text (PBD::short_version (rg->name(), 5)); } else { switch (_width) { case Wide: @@ -1038,12 +1053,14 @@ void MixerStrip::build_route_ops_menu () { using namespace Menu_Helpers; - route_ops_menu = manage (new Menu); + route_ops_menu = new Menu; route_ops_menu->set_name ("ArdourContextMenu"); MenuList& items = route_ops_menu->items(); + items.push_back (MenuElem (_("Save As Template"), mem_fun(*this, &RouteUI::save_as_template))); items.push_back (MenuElem (_("Rename"), mem_fun(*this, &RouteUI::route_rename))); + rename_menu_item = &items.back(); items.push_back (SeparatorElem()); items.push_back (CheckMenuElem (_("Active"), mem_fun (*this, &RouteUI::toggle_route_active))); route_active_menu_item = dynamic_cast (&items.back()); @@ -1056,11 +1073,10 @@ MixerStrip::build_route_ops_menu () denormal_menu_item = dynamic_cast (&items.back()); denormal_menu_item->set_active (_route->denormal_protection()); - build_remote_control_menu (); - - items.push_back (SeparatorElem()); if (!Profile->get_sae()) { - items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu)); + build_remote_control_menu (); + items.push_back (SeparatorElem()); + items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu)); } items.push_back (SeparatorElem()); @@ -1070,13 +1086,10 @@ MixerStrip::build_route_ops_menu () gint MixerStrip::name_button_button_press (GdkEventButton* ev) { - if (ev->button == 1) { + if (ev->button == 1 || ev->button == 3) { list_route_operations (); - - Menu_Helpers::MenuList& items = route_ops_menu->items(); /* do not allow rename if the track is record-enabled */ - static_cast (&items.front())->set_sensitive (!_route->record_enabled()); - + rename_menu_item->set_sensitive (!_route->record_enabled()); route_ops_menu->popup (1, ev->time); } return FALSE; @@ -1175,16 +1188,16 @@ MixerStrip::width_clicked () void MixerStrip::hide_clicked () { - // LAME fix to reset the button status for when it is redisplayed (part 1) - hide_button.set_sensitive(false); - + // LAME fix to reset the button status for when it is redisplayed (part 1) + hide_button.set_sensitive(false); + if (_embedded) { - Hiding(); /* EMIT_SIGNAL */ + Hiding(); /* EMIT_SIGNAL */ } else { _mixer.hide_strip (this); } - // (part 2) + // (part 2) hide_button.set_sensitive(true); }