X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Froute_time_axis.cc;h=0f7ef1b8f79ff72d904032fb781d6030a73814ea;hb=720292696a94c96d764e74b5e84fce09a1b3621c;hp=e4c48caf04b83bf87cb5c4e4ab7193ad763b3b40;hpb=b5e9451bc7be12acc5d81c55cdaa6545837f3181;p=ardour.git diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index e4c48caf04..0f7ef1b8f7 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -28,6 +28,10 @@ #include +#include +#include +#include + #include "pbd/error.h" #include "pbd/stl_delete.h" #include "pbd/whitespace.h" @@ -35,13 +39,7 @@ #include "pbd/enumwriter.h" #include "pbd/stateful_diff_command.h" -#include "gtkmm/menu.h" -#include "gtkmm/menuitem.h" -#include "gtkmm2ext/gtk_ui.h" -#include "gtkmm2ext/utils.h" - -#include "widgets/ardour_button.h" -#include "widgets/tooltips.h" +#include "evoral/Parameter.hpp" #include "ardour/amp.h" #include "ardour/meter.h" @@ -53,11 +51,17 @@ #include "ardour/route_group.h" #include "ardour/session.h" #include "ardour/session_playlists.h" - -#include "evoral/Parameter.hpp" +#include "ardour/track.h" #include "canvas/debug.h" +#include "gtkmm2ext/gtk_ui.h" +#include "gtkmm2ext/utils.h" + +#include "widgets/ardour_button.h" +#include "widgets/prompter.h" +#include "widgets/tooltips.h" + #include "ardour_ui.h" #include "audio_streamview.h" #include "debug.h" @@ -71,7 +75,6 @@ #include "paste_context.h" #include "playlist_selector.h" #include "point_selection.h" -#include "prompter.h" #include "public_editor.h" #include "region_view.h" #include "rgb_macros.h" @@ -81,8 +84,6 @@ #include "utils.h" #include "route_group_menu.h" -#include "ardour/track.h" - #include "pbd/i18n.h" using namespace ARDOUR; @@ -787,57 +788,6 @@ RouteTimeAxisView::build_display_menu () /* show nothing */ } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - Menu* mode_menu = manage (new Menu); - MenuList& mode_items = mode_menu->items (); - mode_menu->set_name ("ArdourContextMenu"); - - RadioMenuItem::Group mode_group; - - int normal = 0; - int tape = 0; - int non_layered = 0; - - for (TrackSelection::const_iterator t = s.begin(); t != s.end(); ++t) { - RouteTimeAxisView* r = dynamic_cast (*t); - if (!r || !r->is_track ()) { - continue; - } - - switch (r->track()->mode()) { - case Normal: - ++normal; - break; - case Destructive: - ++tape; - break; - case NonLayered: - ++non_layered; - break; - } - } - - mode_items.push_back (RadioMenuElem (mode_group, _("Normal Mode"))); - i = dynamic_cast (&mode_items.back ()); - i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Normal, true)); - i->set_active (normal != 0 && tape == 0 && non_layered == 0); - i->set_inconsistent (normal != 0 && (tape != 0 || non_layered != 0)); - - mode_items.push_back (RadioMenuElem (mode_group, _("Tape Mode"))); - i = dynamic_cast (&mode_items.back ()); - i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Destructive, true)); - i->set_active (normal == 0 && tape != 0 && non_layered == 0); - i->set_inconsistent (tape != 0 && (normal != 0 || non_layered != 0)); - - mode_items.push_back (RadioMenuElem (mode_group, _("Non-Layered Mode"))); - i = dynamic_cast (&mode_items.back ()); - i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::NonLayered, true)); - i->set_active (normal == 0 && tape == 0 && non_layered != 0); - i->set_inconsistent (non_layered != 0 && (normal != 0 || tape != 0)); - - items.push_back (MenuElem (_("Record Mode"), *mode_menu)); -#endif - items.push_back (SeparatorElem()); build_playlist_menu (); @@ -907,32 +857,6 @@ RouteTimeAxisView::build_display_menu () items.push_back (MenuElem (_("Remove"), sigc::mem_fun(_editor, &PublicEditor::remove_tracks))); } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX -void -RouteTimeAxisView::set_track_mode (TrackMode mode, bool apply_to_selection) -{ - if (apply_to_selection) { - _editor.get_selection().tracks.foreach_route_time_axis (boost::bind (&RouteTimeAxisView::set_track_mode, _1, mode, false)); - } else { - - bool needs_bounce = false; - - if (!track()->can_use_mode (mode, needs_bounce)) { - - if (!needs_bounce) { - /* cannot be done */ - return; - } else { - cerr << "would bounce this one\n"; - return; - } - } - - track()->set_mode (mode); - } -} -#endif - void RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end, int layers, int layer) { @@ -964,7 +888,7 @@ RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end, int layer if (timestretch_rect == 0) { timestretch_rect = new ArdourCanvas::Rectangle (canvas_display ()); - timestretch_rect->set_fill_color (ArdourCanvas::HSV (UIConfiguration::instance().color ("time stretch fill")).mod (UIConfiguration::instance().modifier ("time stretch fill")).color()); + timestretch_rect->set_fill_color (Gtkmm2ext::HSV (UIConfiguration::instance().color ("time stretch fill")).mod (UIConfiguration::instance().modifier ("time stretch fill")).color()); timestretch_rect->set_outline_color (UIConfiguration::instance().color ("time stretch outline")); } @@ -1124,7 +1048,7 @@ RouteTimeAxisView::set_align_choice (RadioMenuItem* mitem, AlignChoice choice, b void RouteTimeAxisView::rename_current_playlist () { - ArdourPrompter prompter (true); + Prompter prompter (true); string name; boost::shared_ptr tr = track(); @@ -1225,7 +1149,7 @@ RouteTimeAxisView::use_new_playlist (bool prompt, vectorvalue()); - RouteTimeAxisView* v = _editor.get_route_view_by_route_id (id); + StripableTimeAxisView* v = _editor.get_stripable_time_axis_by_id (id); if (v) { add_underlay(v->view(), false);