mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
region gain line freehand draw: ensure drawn line is above waveform
This commit is contained in:
parent
cda1f12845
commit
764ed125a4
4 changed files with 13 additions and 9 deletions
|
|
@ -278,6 +278,7 @@ AudioRegionView::init (bool wfd)
|
||||||
setup_waveform_visibility ();
|
setup_waveform_visibility ();
|
||||||
|
|
||||||
get_canvas_frame()->set_data ("linemerger", (LineMerger*) this);
|
get_canvas_frame()->set_data ("linemerger", (LineMerger*) this);
|
||||||
|
gain_line->canvas_group().raise_to_top ();
|
||||||
|
|
||||||
/* XXX sync mark drag? */
|
/* XXX sync mark drag? */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7265,8 +7265,9 @@ LollipopDrag::setup_pointer_offset ()
|
||||||
/********/
|
/********/
|
||||||
|
|
||||||
template<typename OrderedPointList, typename OrderedPoint>
|
template<typename OrderedPointList, typename OrderedPoint>
|
||||||
FreehandLineDrag<OrderedPointList,OrderedPoint>::FreehandLineDrag (Editor* editor, ArdourCanvas::Rectangle& r, Temporal::TimeDomain time_domain)
|
FreehandLineDrag<OrderedPointList,OrderedPoint>::FreehandLineDrag (Editor* editor, ArdourCanvas::Item* p, ArdourCanvas::Rectangle& r, Temporal::TimeDomain time_domain)
|
||||||
: Drag (editor, &r, time_domain)
|
: Drag (editor, &r, time_domain)
|
||||||
|
, parent (p)
|
||||||
, base_rect (r)
|
, base_rect (r)
|
||||||
, dragging_line (nullptr)
|
, dragging_line (nullptr)
|
||||||
, direction (0)
|
, direction (0)
|
||||||
|
|
@ -7288,10 +7289,11 @@ void
|
||||||
FreehandLineDrag<OrderedPointList,OrderedPoint>::motion (GdkEvent* ev, bool first_move)
|
FreehandLineDrag<OrderedPointList,OrderedPoint>::motion (GdkEvent* ev, bool first_move)
|
||||||
{
|
{
|
||||||
if (first_move) {
|
if (first_move) {
|
||||||
dragging_line = new ArdourCanvas::PolyLine (item());
|
dragging_line = new ArdourCanvas::PolyLine (parent ? parent : item());
|
||||||
dragging_line->set_ignore_events (true);
|
dragging_line->set_ignore_events (true);
|
||||||
dragging_line->set_outline_width (2.0);
|
dragging_line->set_outline_width (2.0);
|
||||||
dragging_line->set_outline_color (UIConfiguration::instance().color ("automation line"));
|
dragging_line->set_outline_color (UIConfiguration::instance().color ("automation line"));
|
||||||
|
dragging_line->raise_to_top ();
|
||||||
|
|
||||||
/* for freehand drawing, we only support left->right direction, for now. */
|
/* for freehand drawing, we only support left->right direction, for now. */
|
||||||
direction = 1;
|
direction = 1;
|
||||||
|
|
@ -7447,8 +7449,8 @@ FreehandLineDrag<OrderedPointList,OrderedPoint>::mid_drag_key_event (GdkEventKey
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
|
|
||||||
AutomationDrawDrag::AutomationDrawDrag (Editor* editor, ArdourCanvas::Rectangle& r, Temporal::TimeDomain time_domain)
|
AutomationDrawDrag::AutomationDrawDrag (Editor* editor, ArdourCanvas::Item* p, ArdourCanvas::Rectangle& r, Temporal::TimeDomain time_domain)
|
||||||
: FreehandLineDrag<Evoral::ControlList::OrderedPoints,Evoral::ControlList::OrderedPoint> (editor, r, time_domain)
|
: FreehandLineDrag<Evoral::ControlList::OrderedPoints,Evoral::ControlList::OrderedPoint> (editor, p, r, time_domain)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Drags, "New AutomationDrawDrag\n");
|
DEBUG_TRACE (DEBUG::Drags, "New AutomationDrawDrag\n");
|
||||||
}
|
}
|
||||||
|
|
@ -7487,7 +7489,7 @@ AutomationDrawDrag::finished (GdkEvent* event, bool motion_occured)
|
||||||
/*****************/
|
/*****************/
|
||||||
|
|
||||||
VelocityLineDrag::VelocityLineDrag (Editor* editor, ArdourCanvas::Rectangle& r, Temporal::TimeDomain time_domain)
|
VelocityLineDrag::VelocityLineDrag (Editor* editor, ArdourCanvas::Rectangle& r, Temporal::TimeDomain time_domain)
|
||||||
: FreehandLineDrag<Evoral::ControlList::OrderedPoints,Evoral::ControlList::OrderedPoint> (editor, r, time_domain)
|
: FreehandLineDrag<Evoral::ControlList::OrderedPoints,Evoral::ControlList::OrderedPoint> (editor, nullptr, r, time_domain)
|
||||||
, grv (static_cast<VelocityGhostRegion*> (r.get_data ("ghostregionview")))
|
, grv (static_cast<VelocityGhostRegion*> (r.get_data ("ghostregionview")))
|
||||||
, drag_did_change (false)
|
, drag_did_change (false)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1587,7 +1587,7 @@ template<typename OrderedPointList, typename OrderedPoint>
|
||||||
class FreehandLineDrag : public Drag
|
class FreehandLineDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FreehandLineDrag (Editor*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
FreehandLineDrag (Editor*, ArdourCanvas::Item*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
||||||
~FreehandLineDrag ();
|
~FreehandLineDrag ();
|
||||||
|
|
||||||
void motion (GdkEvent*, bool);
|
void motion (GdkEvent*, bool);
|
||||||
|
|
@ -1596,6 +1596,7 @@ class FreehandLineDrag : public Drag
|
||||||
virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
|
virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
ArdourCanvas::Item* parent; /* we do not own this. If null, use base_rect as the parent */
|
||||||
ArdourCanvas::Rectangle& base_rect; /* we do not own this */
|
ArdourCanvas::Rectangle& base_rect; /* we do not own this */
|
||||||
ArdourCanvas::PolyLine* dragging_line;
|
ArdourCanvas::PolyLine* dragging_line;
|
||||||
int direction;
|
int direction;
|
||||||
|
|
@ -1610,7 +1611,7 @@ class FreehandLineDrag : public Drag
|
||||||
class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
|
class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AutomationDrawDrag (Editor*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
AutomationDrawDrag (Editor*, ArdourCanvas::Item*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
||||||
~AutomationDrawDrag ();
|
~AutomationDrawDrag ();
|
||||||
|
|
||||||
void finished (GdkEvent*, bool);
|
void finished (GdkEvent*, bool);
|
||||||
|
|
|
||||||
|
|
@ -1362,7 +1362,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
{
|
{
|
||||||
AutomationTimeAxisView* atv = static_cast<AutomationTimeAxisView*> (item->get_data ("trackview"));
|
AutomationTimeAxisView* atv = static_cast<AutomationTimeAxisView*> (item->get_data ("trackview"));
|
||||||
if (atv) {
|
if (atv) {
|
||||||
_drags->set (new AutomationDrawDrag (this, atv->base_item(), Temporal::AudioTime), event);
|
_drags->set (new AutomationDrawDrag (this, nullptr, atv->base_item(), Temporal::AudioTime), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1389,7 +1389,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
RegionView* rv;
|
RegionView* rv;
|
||||||
if ((rv = dynamic_cast<RegionView*> (clicked_regionview))) {
|
if ((rv = dynamic_cast<RegionView*> (clicked_regionview))) {
|
||||||
ArdourCanvas::Rectangle* r = dynamic_cast<ArdourCanvas::Rectangle*> (rv->get_canvas_frame());
|
ArdourCanvas::Rectangle* r = dynamic_cast<ArdourCanvas::Rectangle*> (rv->get_canvas_frame());
|
||||||
_drags->set (new AutomationDrawDrag (this, *r, Temporal::AudioTime), event);
|
_drags->set (new AutomationDrawDrag (this, rv->get_canvas_group(), *r, Temporal::AudioTime), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue