From ea6717f04124540d07daec32ba8b8bead96f63b7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 18 Dec 2022 16:43:29 -0700 Subject: [PATCH] empty, useless velocity lane for MIDI tracks --- gtk2_ardour/automation_time_axis.cc | 43 +++++++++++++++++------------ gtk2_ardour/automation_time_axis.h | 3 ++ gtk2_ardour/midi_time_axis.cc | 25 +++++++++++++++-- gtk2_ardour/wscript | 1 + 4 files changed, 52 insertions(+), 20 deletions(-) diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 9ceb6e1f4a..b5b0520191 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -287,6 +287,31 @@ AutomationTimeAxisView::AutomationTimeAxisView ( controls_ebox.set_name (controls_base_unselected_name); time_axis_frame.set_name (controls_base_unselected_name); + add_contents (show_regions); + + /* make sure labels etc. are correct */ + + automation_state_changed (); + UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler)); + + _stripable->DropReferences.connect ( + _stripable_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::route_going_away, this), gui_context () + ); +} + +AutomationTimeAxisView::~AutomationTimeAxisView () +{ + if (_stripable) { + cleanup_gui_properties (); + } + delete _view; + CatchDeletion (this); +} + +void +AutomationTimeAxisView::add_contents (bool show_regions) +{ + /* ask for notifications of any new RegionViews */ if (show_regions) { @@ -314,24 +339,6 @@ AutomationTimeAxisView::AutomationTimeAxisView ( line->queue_reset (); add_line (line); } - - /* make sure labels etc. are correct */ - - automation_state_changed (); - UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler)); - - _stripable->DropReferences.connect ( - _stripable_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::route_going_away, this), gui_context () - ); -} - -AutomationTimeAxisView::~AutomationTimeAxisView () -{ - if (_stripable) { - cleanup_gui_properties (); - } - delete _view; - CatchDeletion (this); } void diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index 9f5f04a92b..150b306b18 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -201,6 +201,7 @@ protected: void automation_state_changed (); void set_interpolation (ARDOUR::AutomationList::InterpolationStyle); + void interpolation_changed (ARDOUR::AutomationList::InterpolationStyle); PBD::ScopedConnectionList _list_connections; @@ -217,6 +218,8 @@ protected: std::string automation_state_off_string () const; + virtual void add_contents (bool show_regions); + private: int set_state_2X (const XMLNode &, int); }; diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 86d50ac4ce..57d74abd70 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -73,6 +73,7 @@ #include "ardour/source.h" #include "ardour/track.h" #include "ardour/types.h" +#include "ardour/velocity_control.h" #include "ardour_message.h" #include "automation_line.h" @@ -99,6 +100,7 @@ #include "selection.h" #include "step_editor.h" #include "note_base.h" +#include "velocity_time_axis.h" #include "ardour/midi_track.h" @@ -1366,6 +1368,26 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool /* handled elsewhere */ 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: @@ -1398,8 +1420,7 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool _route->describe_parameter(param))); if (_view) { - _view->foreach_regionview ( - sigc::mem_fun (*track.get(), &TimeAxisView::add_ghost)); + _view->foreach_regionview (sigc::mem_fun (*track.get(), &TimeAxisView::add_ghost)); } add_automation_child (param, track, show); diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index a86aedb760..fc8efd0b7b 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -342,6 +342,7 @@ gtk2_ardour_sources = [ 'video_monitor.cc', 'transcode_ffmpeg.cc', 'transcode_video_dialog.cc', + 'velocity_time_axis.cc', 'video_server_dialog.cc', 'utils_videotl.cc', 'export_video_dialog.cc'