diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc index e2316c0a11..1565af2a56 100644 --- a/gtk2_ardour/automation_streamview.cc +++ b/gtk2_ardour/automation_streamview.cc @@ -45,7 +45,6 @@ #include "selection.h" #include "ui_config.h" #include "velocity_region_view.h" -#include "velocity_time_axis.h" #include "pbd/i18n.h" @@ -102,19 +101,19 @@ AutomationStreamView::add_region_view_internal (std::shared_ptr region, if (rv->region() == region) { /* great. we already have an AutomationRegionView for this Region. use it again. */ - // VelocityRegionView* vrv = dynamic_cast(rv); + VelocityRegionView* vrv = dynamic_cast(rv); - // if (vrv->line()) { - // vrv->line()->set_list (list); - // } + if (vrv->line()) { + vrv->line()->set_list (list); + } rv->set_valid (true); - //display_region (vrv); + display_region (vrv); return 0; } } - region_view = new VelocityRegionView (_canvas_group, *(dynamic_cast(&_automation_view)), region, list, _samples_per_pixel, region_color); + region_view = new VelocityRegionView (_canvas_group, _automation_view, region, list, _samples_per_pixel, region_color); } else { diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 57d74abd70..064b98614a 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -100,7 +100,6 @@ #include "selection.h" #include "step_editor.h" #include "note_base.h" -#include "velocity_time_axis.h" #include "ardour/midi_track.h" @@ -1369,25 +1368,6 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool break; case MidiVelocityAutomation: - track.reset (new VelocityTimeAxisView (_session, - _route, - _route, - midi_track()->velocity_control(), - _editor, - *this, - true, - parent_canvas, - _route->describe_parameter (param))); - if (_view) { - _view->foreach_regionview (sigc::mem_fun (*track.get(), &TimeAxisView::add_ghost)); - } - - add_automation_child (param, track, show); - if (selected ()) { - reshow_selection (_editor.get_selection().time); - } - break; - case MidiCCAutomation: case MidiPgmChangeAutomation: case MidiPitchBenderAutomation: diff --git a/gtk2_ardour/velocity_region_view.cc b/gtk2_ardour/velocity_region_view.cc index 0643672486..6558a3beec 100644 --- a/gtk2_ardour/velocity_region_view.cc +++ b/gtk2_ardour/velocity_region_view.cc @@ -43,7 +43,7 @@ using namespace Temporal; VelocityRegionView::VelocityRegionView (ArdourCanvas::Container* parent, - VelocityTimeAxisView& time_axis, + AutomationTimeAxisView& time_axis, boost::shared_ptr region, boost::shared_ptr list, double spu, @@ -176,7 +176,7 @@ VelocityRegionView::add_automation_event (GdkEvent *, timepos_t const & w, doubl } assert(_line); - VelocityTimeAxisView* const view = velocity_view (); + AutomationTimeAxisView* const view = velocity_view (); /* compute vertical fractional position */ y = 1.0 - (y / _line->height()); @@ -230,7 +230,7 @@ VelocityRegionView::paste (timepos_t const & pos, { using namespace ARDOUR; - VelocityTimeAxisView* const view = velocity_view(); + AutomationTimeAxisView* const view = velocity_view(); boost::shared_ptr my_list = _line->the_list(); if (view->session()->transport_rolling() && my_list->automation_write()) { diff --git a/gtk2_ardour/velocity_region_view.h b/gtk2_ardour/velocity_region_view.h index 0240729392..876b14b77e 100644 --- a/gtk2_ardour/velocity_region_view.h +++ b/gtk2_ardour/velocity_region_view.h @@ -24,7 +24,7 @@ #include "ardour/types.h" #include "region_view.h" -#include "velocity_time_axis.h" +#include "automation_time_axis.h" #include "automation_line.h" #include "enums.h" @@ -39,7 +39,7 @@ class VelocityRegionView : public RegionView { public: VelocityRegionView(ArdourCanvas::Container*, - VelocityTimeAxisView&, + AutomationTimeAxisView&, boost::shared_ptr, boost::shared_ptr, double initial_samples_per_pixel, @@ -54,8 +54,10 @@ public: float times, boost::shared_ptr slist); - inline VelocityTimeAxisView* velocity_view() const - { return dynamic_cast(&trackview); } + inline AutomationTimeAxisView* velocity_view() const + { return dynamic_cast(&trackview); } + + boost::shared_ptr line() { return _line; } // We are a ghost. Meta ghosts? Crazy talk. virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; } diff --git a/gtk2_ardour/velocity_time_axis.cc b/gtk2_ardour/velocity_time_axis.cc deleted file mode 100644 index 5cea5b0edd..0000000000 --- a/gtk2_ardour/velocity_time_axis.cc +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2022 Paul Davis - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "velocity_time_axis.h" - -#include "pbd/i18n.h" - -using namespace std; -using namespace ARDOUR; - -VelocityTimeAxisView::VelocityTimeAxisView ( - Session* s, - boost::shared_ptr strip, - boost::shared_ptr a, - boost::shared_ptr c, - PublicEditor& e, - TimeAxisView& parent, - bool show_regions, - ArdourCanvas::Canvas& canvas, - const string & nom, - const string & nomparent - ) - - : AutomationTimeAxisView (s, strip, a, c, Evoral::Parameter (MidiVelocityAutomation), e, parent, show_regions, canvas, nom, nomparent) -{ -} - -VelocityTimeAxisView::~VelocityTimeAxisView() -{ -} - diff --git a/gtk2_ardour/velocity_time_axis.h b/gtk2_ardour/velocity_time_axis.h deleted file mode 100644 index 0519952577..0000000000 --- a/gtk2_ardour/velocity_time_axis.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2022 Paul Davis - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __ardour_gtk_velocity_time_axis_h__ -#define __ardour_gtk_velocity_time_axis_h__ - -#include "automation_time_axis.h" - -class VelocityTimeAxisView : public AutomationTimeAxisView -{ -public: - VelocityTimeAxisView (ARDOUR::Session*, - boost::shared_ptr, - boost::shared_ptr, - boost::shared_ptr, - PublicEditor&, - TimeAxisView& parent, - bool show_regions, - ArdourCanvas::Canvas& canvas, - const std::string & name = "", /* translatable */ - const std::string & plug_name = ""); - - ~VelocityTimeAxisView(); - -}; - -#endif /* __ardour_gtk_velocity_time_axis_h__ */ diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index d0a6b4f868..38a787ce20 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -343,7 +343,6 @@ gtk2_ardour_sources = [ 'transcode_ffmpeg.cc', 'transcode_video_dialog.cc', 'velocity_region_view.cc', - 'velocity_time_axis.cc', 'video_server_dialog.cc', 'utils_videotl.cc', 'export_video_dialog.cc'