fix compilation, rename PercussiveCreateDrag -> HitCreateDrag
This commit is contained in:
parent
71c0c872b7
commit
eef18c47fd
|
@ -6333,19 +6333,19 @@ NoteCreateDrag::aborted (bool)
|
|||
|
||||
}
|
||||
|
||||
PercussiveCreateDrag::PercussiveCreateDrag (Editor* e, ArdourCanvas::Item* i, MidiRegionView* rv)
|
||||
HitCreateDrag::HitCreateDrag (Editor* e, ArdourCanvas::Item* i, MidiRegionView* rv)
|
||||
: Drag (e, i)
|
||||
, _region_view (rv)
|
||||
, _y (0.0)
|
||||
{
|
||||
}
|
||||
|
||||
PercussiveCreateDrag::~PercussiveCreateDrag ()
|
||||
HitCreateDrag::~HitCreateDrag ()
|
||||
{
|
||||
}
|
||||
|
||||
framecnt_t
|
||||
PercussiveCreateDrag::grid_frames (framepos_t t) const
|
||||
HitCreateDrag::grid_frames (framepos_t t) const
|
||||
{
|
||||
bool success;
|
||||
Evoral::Beats grid_beats = _editor->get_grid_type_as_beats (success, t);
|
||||
|
@ -6360,7 +6360,7 @@ PercussiveCreateDrag::grid_frames (framepos_t t) const
|
|||
}
|
||||
|
||||
void
|
||||
PercussiveCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||
HitCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||
{
|
||||
Drag::start_grab (event, cursor);
|
||||
|
||||
|
@ -6385,7 +6385,7 @@ PercussiveCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
|||
}
|
||||
|
||||
void
|
||||
PercussiveCreateDrag::motion (GdkEvent* event, bool)
|
||||
HitCreateDrag::motion (GdkEvent* event, bool)
|
||||
{
|
||||
TempoMap& map (_editor->session()->tempo_map());
|
||||
|
||||
|
@ -6413,13 +6413,13 @@ PercussiveCreateDrag::motion (GdkEvent* event, bool)
|
|||
}
|
||||
|
||||
void
|
||||
PercussiveCreateDrag::finished (GdkEvent* /* ev */, bool /* had_movement */)
|
||||
HitCreateDrag::finished (GdkEvent* /* ev */, bool /* had_movement */)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
double
|
||||
PercussiveCreateDrag::y_to_region (double y) const
|
||||
HitCreateDrag::y_to_region (double y) const
|
||||
{
|
||||
double x = 0;
|
||||
_region_view->get_canvas_group()->canvas_to_item (x, y);
|
||||
|
@ -6427,7 +6427,7 @@ PercussiveCreateDrag::y_to_region (double y) const
|
|||
}
|
||||
|
||||
void
|
||||
PercussiveCreateDrag::aborted (bool)
|
||||
HitCreateDrag::aborted (bool)
|
||||
{
|
||||
// umm..
|
||||
}
|
||||
|
|
|
@ -601,6 +601,38 @@ private:
|
|||
framepos_t _note[2];
|
||||
};
|
||||
|
||||
class HitCreateDrag : public Drag
|
||||
{
|
||||
public:
|
||||
HitCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
|
||||
~HitCreateDrag ();
|
||||
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
void motion (GdkEvent *, bool);
|
||||
void finished (GdkEvent *, bool);
|
||||
void aborted (bool);
|
||||
|
||||
bool active (Editing::MouseMode mode) {
|
||||
return mode == Editing::MouseDraw || mode == Editing::MouseContent;
|
||||
}
|
||||
|
||||
bool y_movement_matters () const {
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
double y_to_region (double) const;
|
||||
ARDOUR::framecnt_t grid_frames (framepos_t) const;
|
||||
|
||||
/** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
|
||||
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (0, 0);
|
||||
}
|
||||
|
||||
MidiRegionView* _region_view;
|
||||
double _y;
|
||||
};
|
||||
|
||||
/** Drag to move MIDI patch changes */
|
||||
class PatchChangeDrag : public Drag
|
||||
{
|
||||
|
|
|
@ -501,7 +501,7 @@ MidiRegionView::button_press (GdkEventButton* ev)
|
|||
if (m == MouseDraw || (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
|
||||
|
||||
if (midi_view()->note_mode() == Percussive) {
|
||||
editor->drags()->set (new PercussiveCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
|
||||
editor->drags()->set (new HitCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
|
||||
} else {
|
||||
editor->drags()->set (new NoteCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue