fix meter marker drags by not using a fake marker till first move, and swapping the grabbed item to the copy when we do
git-svn-id: svn://localhost/ardour2/branches/3.0@10999 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
88d49cdb57
commit
b6d1fb0707
|
@ -1845,7 +1845,6 @@ MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
|
|||
_copy (c)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Drags, "New MeterMarkerDrag\n");
|
||||
|
||||
_marker = reinterpret_cast<MeterMarker*> (_item->get_data ("marker"));
|
||||
assert (_marker);
|
||||
}
|
||||
|
@ -1853,6 +1852,21 @@ MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
|
|||
void
|
||||
MeterMarkerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||
{
|
||||
Drag::start_grab (event, cursor);
|
||||
show_verbose_cursor_time (adjusted_current_frame(event));
|
||||
}
|
||||
|
||||
void
|
||||
MeterMarkerDrag::setup_pointer_frame_offset ()
|
||||
{
|
||||
_pointer_frame_offset = raw_grab_frame() - _marker->meter().frame();
|
||||
}
|
||||
|
||||
void
|
||||
MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
|
||||
{
|
||||
if (first_move) {
|
||||
|
||||
// create a dummy marker for visual representation of moving the
|
||||
// section, because whether its a copy or not, we're going to
|
||||
// leave or lose the original marker (leave if its a copy; lose if its
|
||||
|
@ -1875,31 +1889,18 @@ MeterMarkerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
|||
*new MeterSection (_marker->meter())
|
||||
);
|
||||
|
||||
_item = &_marker->the_item ();
|
||||
/* use the new marker for the grab */
|
||||
swap_grab (&_marker->the_item(), 0, GDK_CURRENT_TIME);
|
||||
|
||||
if (!_copy) {
|
||||
TempoMap& map (_editor->session()->tempo_map());
|
||||
/* remove the section while we drag it */
|
||||
map.remove_meter (section);
|
||||
}
|
||||
|
||||
Drag::start_grab (event, cursor);
|
||||
show_verbose_cursor_time (adjusted_current_frame(event));
|
||||
}
|
||||
|
||||
void
|
||||
MeterMarkerDrag::setup_pointer_frame_offset ()
|
||||
{
|
||||
_pointer_frame_offset = raw_grab_frame() - _marker->meter().frame();
|
||||
}
|
||||
|
||||
void
|
||||
MeterMarkerDrag::motion (GdkEvent* event, bool)
|
||||
{
|
||||
framepos_t const pf = adjusted_current_frame (event);
|
||||
|
||||
_marker->set_position (pf);
|
||||
|
||||
show_verbose_cursor_time (pf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user