Hide/Remove to apply to the track selection.
git-svn-id: svn://localhost/ardour2/branches/3.0@9090 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8f45604f27
commit
eabe5b31f8
@ -5026,16 +5026,28 @@ Editor::timeaxisview_deleted (TimeAxisView *tv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::hide_track_in_display (TimeAxisView* tv, bool /*temponly*/)
|
Editor::hide_track_in_display (TimeAxisView* tv, bool apply_to_selection)
|
||||||
{
|
{
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
|
if (apply_to_selection) {
|
||||||
|
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ) {
|
||||||
|
|
||||||
if (rtv && current_mixer_strip && (rtv->route() == current_mixer_strip->route())) {
|
TrackSelection::iterator j = i;
|
||||||
// this will hide the mixer strip
|
++j;
|
||||||
set_selected_mixer_strip (*tv);
|
|
||||||
|
hide_track_in_display (*i, false);
|
||||||
|
|
||||||
|
i = j;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
|
||||||
|
|
||||||
|
if (rtv && current_mixer_strip && (rtv->route() == current_mixer_strip->route())) {
|
||||||
|
// this will hide the mixer strip
|
||||||
|
set_selected_mixer_strip (*tv);
|
||||||
|
}
|
||||||
|
|
||||||
|
_routes->hide_track_in_display (*tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
_routes->hide_track_in_display (*tv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -326,7 +326,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||||||
void show_editor_list (bool yn);
|
void show_editor_list (bool yn);
|
||||||
void set_selected_mixer_strip (TimeAxisView&);
|
void set_selected_mixer_strip (TimeAxisView&);
|
||||||
void mixer_strip_width_changed ();
|
void mixer_strip_width_changed ();
|
||||||
void hide_track_in_display (TimeAxisView* tv, bool temporary = false);
|
void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false);
|
||||||
|
|
||||||
/* nudge is initiated by transport controls owned by ARDOUR_UI */
|
/* nudge is initiated by transport controls owned by ARDOUR_UI */
|
||||||
|
|
||||||
|
@ -1545,7 +1545,7 @@ Editor::temporal_zoom_region (bool both_axes)
|
|||||||
|
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
if (find (tracks.begin(), tracks.end(), (*i)) == tracks.end()) {
|
if (find (tracks.begin(), tracks.end(), (*i)) == tracks.end()) {
|
||||||
hide_track_in_display (*i, true);
|
hide_track_in_display (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1365,7 +1365,7 @@ MixerStrip::build_route_ops_menu ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
items.push_back (SeparatorElem());
|
items.push_back (SeparatorElem());
|
||||||
items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &RouteUI::remove_this_route)));
|
items.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -233,7 +233,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
|
|||||||
virtual void select_all_tracks () = 0;
|
virtual void select_all_tracks () = 0;
|
||||||
virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
||||||
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
|
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
|
||||||
virtual void hide_track_in_display (TimeAxisView* tv, bool temporary = false) = 0;
|
virtual void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false) = 0;
|
||||||
|
|
||||||
virtual void set_stationary_playhead (bool yn) = 0;
|
virtual void set_stationary_playhead (bool yn) = 0;
|
||||||
virtual void toggle_stationary_playhead () = 0;
|
virtual void toggle_stationary_playhead () = 0;
|
||||||
|
@ -649,12 +649,12 @@ RouteTimeAxisView::build_display_menu ()
|
|||||||
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), click_sets_active, true));
|
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), click_sets_active, true));
|
||||||
|
|
||||||
items.push_back (SeparatorElem());
|
items.push_back (SeparatorElem());
|
||||||
items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, false)));
|
items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, true)));
|
||||||
if (!Profile->get_sae()) {
|
if (!Profile->get_sae()) {
|
||||||
items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &RouteUI::remove_this_route)));
|
items.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), true)));
|
||||||
} else {
|
} else {
|
||||||
items.push_front (SeparatorElem());
|
items.push_front (SeparatorElem());
|
||||||
items.push_front (MenuElem (_("Delete"), sigc::mem_fun(*this, &RouteUI::remove_this_route)));
|
items.push_front (MenuElem (_("Delete"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), true)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1373,15 +1373,18 @@ RouteUI::set_color_from_route ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteUI::remove_this_route ()
|
RouteUI::remove_this_route (bool apply_to_selection)
|
||||||
{
|
{
|
||||||
if ((route()->is_master() || route()->is_monitor()) &&
|
if (apply_to_selection) {
|
||||||
!Config->get_allow_special_bus_removal()) {
|
ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (boost::bind (&RouteUI::remove_this_route, _1, false));
|
||||||
MessageDialog msg (_("That would be bad news ...."),
|
} else {
|
||||||
false,
|
if ((route()->is_master() || route()->is_monitor()) &&
|
||||||
Gtk::MESSAGE_INFO,
|
!Config->get_allow_special_bus_removal()) {
|
||||||
|
MessageDialog msg (_("That would be bad news ...."),
|
||||||
|
false,
|
||||||
|
Gtk::MESSAGE_INFO,
|
||||||
Gtk::BUTTONS_OK);
|
Gtk::BUTTONS_OK);
|
||||||
msg.set_secondary_text (string_compose (_(
|
msg.set_secondary_text (string_compose (_(
|
||||||
"Removing the master or monitor bus is such a bad idea\n\
|
"Removing the master or monitor bus is such a bad idea\n\
|
||||||
that %1 is not going to allow it.\n\
|
that %1 is not going to allow it.\n\
|
||||||
\n\
|
\n\
|
||||||
@ -1389,34 +1392,35 @@ If you really want to do this sort of thing\n\
|
|||||||
edit your ardour.rc file to set the\n\
|
edit your ardour.rc file to set the\n\
|
||||||
\"allow-special-bus-removal\" option to be \"yes\""), PROGRAM_NAME));
|
\"allow-special-bus-removal\" option to be \"yes\""), PROGRAM_NAME));
|
||||||
|
|
||||||
msg.present ();
|
msg.present ();
|
||||||
msg.run ();
|
msg.run ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> choices;
|
vector<string> choices;
|
||||||
string prompt;
|
string prompt;
|
||||||
|
|
||||||
if (is_track()) {
|
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\n(This action cannot be undone, and the session file will be overwritten)"), _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 {
|
} else {
|
||||||
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());
|
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."));
|
choices.push_back (_("No, do nothing."));
|
||||||
choices.push_back (_("Yes, remove it."));
|
choices.push_back (_("Yes, remove it."));
|
||||||
|
|
||||||
string title;
|
string title;
|
||||||
if (is_track()) {
|
if (is_track()) {
|
||||||
title = _("Remove track");
|
title = _("Remove track");
|
||||||
} else {
|
} else {
|
||||||
title = _("Remove bus");
|
title = _("Remove bus");
|
||||||
}
|
}
|
||||||
|
|
||||||
Choice prompter (title, prompt, choices);
|
Choice prompter (title, prompt, choices);
|
||||||
|
|
||||||
if (prompter.run () == 1) {
|
if (prompter.run () == 1) {
|
||||||
Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (&RouteUI::idle_remove_this_route), this));
|
Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (&RouteUI::idle_remove_this_route), this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ class RouteUI : public virtual AxisView
|
|||||||
|
|
||||||
int set_color_from_route ();
|
int set_color_from_route ();
|
||||||
|
|
||||||
void remove_this_route ();
|
void remove_this_route (bool apply_to_selection = false);
|
||||||
static gint idle_remove_this_route (RouteUI *);
|
static gint idle_remove_this_route (RouteUI *);
|
||||||
|
|
||||||
void route_rename();
|
void route_rename();
|
||||||
|
Loading…
Reference in New Issue
Block a user