X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Froute_time_axis.cc;h=94ed2a86f044abc8909cf70b6496e1293a8bc77f;hb=601a34521c2ce1d0167ed2f3c66f2fa6eeeb6b8e;hp=0e71f858a4bc84dfada011146fc1563edf37e4e2;hpb=63082821d87a8be61982adc551a35fd399f346a2;p=ardour.git diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 0e71f858a4..94ed2a86f0 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -59,6 +59,7 @@ #include "ardour_ui.h" #include "ardour_button.h" +#include "audio_streamview.h" #include "debug.h" #include "global_signals.h" #include "route_time_axis.h" @@ -100,9 +101,9 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan , parent_canvas (canvas) , no_redraw (false) , button_table (3, 3) - , route_group_button (_("G")) - , playlist_button (_("P")) - , automation_button (_("A")) + , route_group_button (S_("RTAV|G")) + , playlist_button (S_("RTAV|P")) + , automation_button (S_("RTAV|A")) , automation_action_menu (0) , plugins_submenu_item (0) , route_group_menu (0) @@ -112,6 +113,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan , gm (sess, true, 75, 14) , _ignore_set_layer_display (false) , gain_automation_item(NULL) + , trim_automation_item(NULL) , mute_automation_item(NULL) , pan_automation_item(NULL) { @@ -156,9 +158,6 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) set_gui_property ("visible", false); } - mute_changed (0); - update_solo_display (); - timestretch_rect = 0; no_redraw = false; @@ -323,8 +322,8 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) RouteTimeAxisView::~RouteTimeAxisView () { - CatchDeletion (this); - + cleanup_gui_properties (); + for (list::iterator i = processor_automation.begin(); i != processor_automation.end(); ++i) { delete *i; } @@ -338,6 +337,7 @@ RouteTimeAxisView::~RouteTimeAxisView () _automation_tracks.clear (); delete route_group_menu; + CatchDeletion (this); } void @@ -524,6 +524,15 @@ RouteTimeAxisView::build_automation_action_menu (bool for_selection) _main_automation_menu_map[Evoral::Parameter(GainAutomation)] = gain_automation_item; } + if (trim_track) { + items.push_back (CheckMenuElem (_("Trim"), sigc::mem_fun (*this, &RouteTimeAxisView::update_trim_track_visibility))); + trim_automation_item = dynamic_cast (&items.back ()); + trim_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) && + (trim_track && string_is_affirmative (trim_track->gui_property ("visible")))); + + _main_automation_menu_map[Evoral::Parameter(TrimAutomation)] = trim_automation_item; + } + if (mute_track) { items.push_back (CheckMenuElem (_("Mute"), sigc::mem_fun (*this, &RouteTimeAxisView::update_mute_track_visibility))); mute_automation_item = dynamic_cast (&items.back ()); @@ -791,7 +800,7 @@ RouteTimeAxisView::build_display_menu () i->set_active (normal == 0 && tape == 0 && non_layered != 0); i->set_inconsistent (non_layered != 0 && (normal != 0 || tape != 0)); - items.push_back (MenuElem (_("Mode"), *mode_menu)); + items.push_back (MenuElem (_("Record Mode"), *mode_menu)); } @@ -854,12 +863,8 @@ RouteTimeAxisView::build_display_menu () items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, true))); - if (!Profile->get_sae()) { - items.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), true))); - } else { - items.push_front (SeparatorElem()); - items.push_front (MenuElem (_("Delete"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), true))); - } + items.push_front (SeparatorElem()); + items.push_front (MenuElem (_("Remove"), sigc::mem_fun(_editor, &PublicEditor::remove_tracks))); } void @@ -917,8 +922,8 @@ 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 (ARDOUR_UI::config()->get_TimeStretchFill()); - timestretch_rect->set_outline_color (ARDOUR_UI::config()->get_TimeStretchOutline()); + timestretch_rect->set_fill_color (ArdourCanvas::HSV (ARDOUR_UI::config()->color ("time stretch fill")).mod (ARDOUR_UI::config()->modifier ("time stretch fill")).color()); + timestretch_rect->set_outline_color (ARDOUR_UI::config()->color ("time stretch outline")); } timestretch_rect->show (); @@ -962,7 +967,7 @@ RouteTimeAxisView::show_selection (TimeSelection& ts) } void -RouteTimeAxisView::set_height (uint32_t h) +RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m) { int gmlen = h - 9; bool height_changed = (height == 0) || (h != height); @@ -973,7 +978,7 @@ RouteTimeAxisView::set_height (uint32_t h) } gm.get_level_meter().setup_meters (gmlen, meter_width); - TimeAxisView::set_height (h); + TimeAxisView::set_height (h, m); if (_view) { _view->set_height ((double) current_height()); @@ -1295,15 +1300,22 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev) if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) { /* special case: select/deselect all tracks */ + + _editor.begin_reversible_selection_op (X_("Selection Click")); + if (_editor.get_selection().selected (this)) { _editor.get_selection().clear_tracks (); } else { _editor.select_all_tracks (); } + _editor.commit_reversible_selection_op (); + return; } + _editor.begin_reversible_selection_op (X_("Selection Click")); + switch (ArdourKeyboard::selection_type (ev->state)) { case Selection::Toggle: _editor.get_selection().toggle (this); @@ -1321,6 +1333,8 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev) _editor.get_selection().add (this); break; } + + _editor.commit_reversible_selection_op (); } void @@ -1329,6 +1343,10 @@ RouteTimeAxisView::set_selected_points (PointSelection& points) for (Children::iterator i = children.begin(); i != children.end(); ++i) { (*i)->set_selected_points (points); } + AudioStreamView* asv = dynamic_cast(_view); + if (asv) { + asv->set_selected_points (points); + } } void @@ -1343,7 +1361,7 @@ RouteTimeAxisView::set_selected_regionviews (RegionSelection& regions) * @param results List to add things to. */ void -RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list& results) +RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list& results, bool within) { double speed = 1.0; @@ -1355,14 +1373,14 @@ RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top framepos_t const end_adjusted = session_frame_to_track_frame(end, speed); if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) { - _view->get_selectables (start_adjusted, end_adjusted, top, bot, results); + _view->get_selectables (start_adjusted, end_adjusted, top, bot, results, within); } /* pick up visible automation tracks */ for (Children::iterator i = children.begin(); i != children.end(); ++i) { if (!(*i)->hidden()) { - (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results); + (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results, within); } } } @@ -1601,6 +1619,7 @@ RouteTimeAxisView::paste (framepos_t pos, const Selection& selection, PasteConte pos += _editor.get_paste_offset(pos, ctx.count, duration); pl->clear_changes (); + pl->clear_owned_changes (); if (Config->get_edit_mode() == Ripple) { std::pair extent = (*p)->get_extent_with_endspace(); framecnt_t amount = extent.second - extent.first; @@ -1815,11 +1834,11 @@ RouteTimeAxisView::color_handler () { //case cTimeStretchOutline: if (timestretch_rect) { - timestretch_rect->set_outline_color (ARDOUR_UI::config()->get_TimeStretchOutline()); + timestretch_rect->set_outline_color (ARDOUR_UI::config()->color ("time stretch outline")); } //case cTimeStretchFill: if (timestretch_rect) { - timestretch_rect->set_fill_color (ARDOUR_UI::config()->get_TimeStretchFill()); + timestretch_rect->set_fill_color (ARDOUR_UI::config()->color ("time stretch fill")); } reset_meter(); @@ -1893,6 +1912,22 @@ RouteTimeAxisView::update_gain_track_visibility () } } +void +RouteTimeAxisView::update_trim_track_visibility () +{ + bool const showit = trim_automation_item->get_active(); + + if (showit != string_is_affirmative (trim_track->gui_property ("visible"))) { + trim_track->set_marked_for_display (showit); + + /* now trigger a redisplay */ + + if (!no_redraw) { + _route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */ + } + } +} + void RouteTimeAxisView::update_mute_track_visibility () { @@ -2526,7 +2561,7 @@ RouteTimeAxisView::show_meter () void RouteTimeAxisView::reset_meter () { - if (Config->get_show_track_meters()) { + if (ARDOUR_UI::config()->get_show_track_meters()) { int meter_width = 3; if (_route && _route->shared_peak_meter()->input_streams().n_total() == 1) { meter_width = 6; @@ -2548,7 +2583,7 @@ RouteTimeAxisView::meter_changed () { ENSURE_GUI_THREAD (*this, &RouteTimeAxisView::meter_changed) reset_meter(); - if (_route && !no_redraw) { + if (_route && !no_redraw && ARDOUR_UI::config()->get_show_track_meters()) { request_redraw (); } // reset peak when meter point changes @@ -2691,19 +2726,19 @@ RouteTimeAxisView::set_button_names () if (Config->get_solo_control_is_listen_control()) { switch (Config->get_listen_position()) { case AfterFaderListen: - solo_button->set_text (_("A")); + solo_button->set_text (S_("AfterFader|A")); ARDOUR_UI::instance()->set_tip (*solo_button, _("After-fade listen (AFL)")); break; case PreFaderListen: - solo_button->set_text (_("P")); + solo_button->set_text (S_("PreFader|P")); ARDOUR_UI::instance()->set_tip (*solo_button, _("Pre-fade listen (PFL)")); break; } } else { - solo_button->set_text (_("S")); + solo_button->set_text (S_("Solo|S")); ARDOUR_UI::instance()->set_tip (*solo_button, _("Solo")); } - mute_button->set_text (_("M")); + mute_button->set_text (S_("Mute|M")); } Gtk::CheckMenuItem* @@ -2746,6 +2781,29 @@ RouteTimeAxisView::create_gain_automation_child (const Evoral::Parameter& param, add_automation_child (Evoral::Parameter(GainAutomation), gain_track, show); } +void +RouteTimeAxisView::create_trim_automation_child (const Evoral::Parameter& param, bool show) +{ + boost::shared_ptr c = _route->trim()->gain_control(); + if (!c || ! _route->trim()->active()) { + return; + } + + trim_track.reset (new AutomationTimeAxisView (_session, + _route, _route->trim(), c, param, + _editor, + *this, + false, + parent_canvas, + _route->trim()->describe_parameter(param))); + + if (_view) { + _view->foreach_regionview (sigc::mem_fun (*trim_track.get(), &TimeAxisView::add_ghost)); + } + + add_automation_child (Evoral::Parameter(TrimAutomation), trim_track, show); +} + void RouteTimeAxisView::create_mute_automation_child (const Evoral::Parameter& param, bool show) {