region gain and MIDI CC freehand line drawing

This involved a significant change in event handling for automation region views,
but it brings it into line with how it works for other things. On button press
we initiate a drag, then if no motion occurs, the Drag returns false during
finalization, and only then do we continue through Editor::button_release_handler()
to eventually end up in ::add_automation_event().

Although it is a substantial change, the fact that it now works the same
way for audio regions, automation regions and automation tracks seems
like a definite plus.
This commit is contained in:
Paul Davis 2023-09-30 11:09:01 -06:00
parent 6b64ebdb27
commit 18819a48a9
11 changed files with 270 additions and 46 deletions

View file

@ -27,6 +27,7 @@
#include "automation_time_axis.h"
#include "automation_line.h"
#include "enums.h"
#include "line_merger.h"
namespace ARDOUR {
class AutomationList;
@ -35,7 +36,7 @@ namespace ARDOUR {
class TimeAxisView;
class AutomationRegionView : public RegionView
class AutomationRegionView : public RegionView, public LineMerger
{
public:
AutomationRegionView(ArdourCanvas::Container*,
@ -72,12 +73,17 @@ public:
void tempo_map_changed ();
MergeableLine* make_merger ();
void add_automation_event (GdkEvent* event);
Temporal::timepos_t drawn_time_filter (Temporal::timepos_t const &);
protected:
void create_line(std::shared_ptr<ARDOUR::AutomationList> list);
bool set_position(Temporal::timepos_t const & pos, void* src, double* ignored);
void region_resized (const PBD::PropertyChange&);
bool canvas_group_event(GdkEvent* ev);
void add_automation_event (GdkEvent* event, Temporal::timepos_t const & when, double y, bool with_guard_points);
void add_automation_event (Temporal::timepos_t const & when, double y, bool with_guard_points);
void mouse_mode_changed ();
void entered();
void exited();