mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
create nonfunctional clip boundary drags when appropriate
This commit is contained in:
parent
3feaf2046c
commit
465f39e5bf
6 changed files with 55 additions and 2 deletions
|
|
@ -253,6 +253,8 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
|
|||
virtual bool canvas_velocity_base_event (GdkEvent* event, ArdourCanvas::Item*) = 0;
|
||||
virtual bool canvas_velocity_event (GdkEvent* event, ArdourCanvas::Item*) = 0;
|
||||
virtual bool canvas_control_point_event (GdkEvent* event, ArdourCanvas::Item*, ControlPoint*) = 0;
|
||||
virtual bool canvas_cue_start_event (GdkEvent* event, ArdourCanvas::Item*) { return true; }
|
||||
virtual bool canvas_cue_end_event (GdkEvent* event, ArdourCanvas::Item*) { return true; }
|
||||
|
||||
Temporal::Beats get_grid_type_as_beats (bool& success, Temporal::timepos_t const & position) const;
|
||||
Temporal::Beats get_draw_length_as_beats (bool& success, Temporal::timepos_t const & position) const;
|
||||
|
|
|
|||
|
|
@ -7546,6 +7546,7 @@ ClipStartDrag::ClipStartDrag (EditingContext& ec, ArdourCanvas::Rectangle& r, Te
|
|||
, dragging_rect (&r)
|
||||
, original_start (os)
|
||||
{
|
||||
std::cerr << "CSD!\n";
|
||||
}
|
||||
|
||||
ClipStartDrag::~ClipStartDrag ()
|
||||
|
|
@ -7568,11 +7569,13 @@ ClipStartDrag::end_grab (GdkEvent* ev)
|
|||
void
|
||||
ClipStartDrag::motion (GdkEvent*, bool)
|
||||
{
|
||||
std::cerr << "clip start drag\n";
|
||||
}
|
||||
|
||||
void
|
||||
ClipStartDrag::finished (GdkEvent*, bool)
|
||||
{
|
||||
std::cerr << "clip start drag ALL DONE\n";
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -495,6 +495,17 @@ MidiCueEditor::canvas_velocity_event (GdkEvent* event, ArdourCanvas::Item* item)
|
|||
return typed_event (item, event, VelocityItem);
|
||||
}
|
||||
|
||||
bool
|
||||
MidiCueEditor::canvas_cue_start_event (GdkEvent* event, ArdourCanvas::Item* item)
|
||||
{
|
||||
return typed_event (item, event, ClipStartItem);
|
||||
}
|
||||
|
||||
bool
|
||||
MidiCueEditor::canvas_cue_end_event (GdkEvent* event, ArdourCanvas::Item* item)
|
||||
{
|
||||
return typed_event (item, event, ClipEndItem);
|
||||
}
|
||||
|
||||
Gtk::Widget&
|
||||
MidiCueEditor::viewport()
|
||||
|
|
@ -641,6 +652,24 @@ MidiCueEditor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event
|
|||
return true;
|
||||
}
|
||||
|
||||
case ClipStartItem: {
|
||||
ArdourCanvas::Rectangle* r = dynamic_cast<ArdourCanvas::Rectangle*> (item);
|
||||
if (r) {
|
||||
_drags->set (new ClipStartDrag (*this, *r, timepos_t (BeatTime)), event);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
case ClipEndItem: {
|
||||
ArdourCanvas::Rectangle* r = dynamic_cast<ArdourCanvas::Rectangle*> (item);
|
||||
if (r) {
|
||||
_drags->set (new ClipEndDrag (*this, *r, timepos_t (BeatTime)), event);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -1849,4 +1878,3 @@ MidiCueEditor::automation_button_click (Evoral::ParameterType type, int id, Sele
|
|||
view->update_automation_display (Evoral::Parameter (type, 0, id), op);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ class MidiCueEditor : public CueEditor
|
|||
bool canvas_velocity_base_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_velocity_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_control_point_event (GdkEvent* event, ArdourCanvas::Item*, ControlPoint*);
|
||||
bool canvas_cue_start_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_cue_end_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
|
||||
int32_t get_grid_beat_divisions (Editing::GridType gt) const { return 1; }
|
||||
int32_t get_grid_music_divisions (Editing::GridType gt, uint32_t event_state) const { return 1; }
|
||||
|
|
|
|||
|
|
@ -207,11 +207,19 @@ MidiView::show_start (bool yn)
|
|||
_start_boundary_rect = new ArdourCanvas::Rectangle (_note_group->parent());
|
||||
_start_boundary_rect->set_fill_color (0x00ff0043);
|
||||
_start_boundary_rect->set_outline_color (0x00ff00ff);
|
||||
|
||||
_start_boundary_rect->Event.connect (sigc::mem_fun (*this, &MidiView::start_boundary_event));
|
||||
}
|
||||
|
||||
size_start_rect ();
|
||||
}
|
||||
|
||||
bool
|
||||
MidiView::start_boundary_event (GdkEvent* ev)
|
||||
{
|
||||
return _editing_context.typed_event (_start_boundary_rect, ev, ClipStartItem);
|
||||
}
|
||||
|
||||
void
|
||||
MidiView::size_start_rect ()
|
||||
{
|
||||
|
|
@ -245,12 +253,19 @@ MidiView::show_end (bool yn)
|
|||
_end_boundary_rect = new ArdourCanvas::Rectangle (_note_group->parent());
|
||||
_end_boundary_rect->set_fill_color (0xff000043);
|
||||
_end_boundary_rect->set_outline_color (0xff0000ff);
|
||||
|
||||
_end_boundary_rect->Event.connect (sigc::mem_fun (*this, &MidiView::end_boundary_event));
|
||||
}
|
||||
|
||||
|
||||
size_end_rect ();
|
||||
}
|
||||
|
||||
bool
|
||||
MidiView::end_boundary_event (GdkEvent* ev)
|
||||
{
|
||||
return _editing_context.typed_event (_end_boundary_rect, ev, ClipEndItem);
|
||||
}
|
||||
|
||||
void
|
||||
MidiView::size_end_rect ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -655,6 +655,9 @@ class MidiView : public virtual sigc::trackable, public LineMerger
|
|||
|
||||
void size_start_rect ();
|
||||
void size_end_rect ();
|
||||
bool start_boundary_event (GdkEvent*);
|
||||
bool end_boundary_event (GdkEvent*);
|
||||
|
||||
virtual void add_control_points_to_selection (Temporal::timepos_t const &, Temporal::timepos_t const &, double y0, double y1) {}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue