summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-12-28 18:19:40 +0000
committerCarl Hetherington <carl@carlh.net>2010-12-28 18:19:40 +0000
commitf8ebb4582d4d881fbda75a6bc9cd9c50f5c921f3 (patch)
tree90608a3cb424866b2a164c354d1665a7b0a9d79a /gtk2_ardour/editor_drag.cc
parent390f18c1152f2007b790a77c873b50ef48209f44 (diff)
Unify program change and bank handling so that they are manipulated together.
git-svn-id: svn://localhost/ardour2/branches/3.0@8346 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 67367e8b65..07fe0ff09a 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -4093,17 +4093,17 @@ DraggingView::DraggingView (RegionView* v, RegionDrag* parent)
initial_end = v->region()->position () + v->region()->length ();
}
-ProgramChangeDrag::ProgramChangeDrag (Editor* e, CanvasProgramChange* i, MidiRegionView* r)
+PatchChangeDrag::PatchChangeDrag (Editor* e, CanvasPatchChange* i, MidiRegionView* r)
: Drag (e, i)
, _region_view (r)
- , _program_change (i)
+ , _patch_change (i)
, _cumulative_dx (0)
{
- DEBUG_TRACE (DEBUG::Drags, "New ProgramChangeDrag\n");
+ DEBUG_TRACE (DEBUG::Drags, "New PatchChangeDrag\n");
}
void
-ProgramChangeDrag::motion (GdkEvent* ev, bool)
+PatchChangeDrag::motion (GdkEvent* ev, bool)
{
framepos_t f = adjusted_current_frame (ev);
boost::shared_ptr<Region> r = _region_view->region ();
@@ -4112,12 +4112,12 @@ ProgramChangeDrag::motion (GdkEvent* ev, bool)
framecnt_t const dxf = f - grab_frame();
double const dxu = _editor->frame_to_unit (dxf);
- _program_change->move (dxu - _cumulative_dx, 0);
+ _patch_change->move (dxu - _cumulative_dx, 0);
_cumulative_dx = dxu;
}
void
-ProgramChangeDrag::finished (GdkEvent* ev, bool movement_occurred)
+PatchChangeDrag::finished (GdkEvent* ev, bool movement_occurred)
{
if (!movement_occurred) {
return;
@@ -4129,22 +4129,22 @@ ProgramChangeDrag::finished (GdkEvent* ev, bool movement_occurred)
f = max (f, r->position ());
f = min (f, r->last_frame ());
- _region_view->move_program_change (
- MidiRegionView::PCEvent (_program_change->event_time(), _program_change->program(), _program_change->channel()),
+ _region_view->move_patch_change (
+ *_patch_change,
_region_view->frames_to_beats (f - r->position() - r->start())
);
}
void
-ProgramChangeDrag::aborted ()
+PatchChangeDrag::aborted ()
{
- _program_change->move (-_cumulative_dx, 0);
+ _patch_change->move (-_cumulative_dx, 0);
}
void
-ProgramChangeDrag::setup_pointer_frame_offset ()
+PatchChangeDrag::setup_pointer_frame_offset ()
{
boost::shared_ptr<Region> region = _region_view->region ();
- _pointer_frame_offset = raw_grab_frame() - _region_view->beats_to_frames (_program_change->event_time()) - region->position() + region->start();
+ _pointer_frame_offset = raw_grab_frame() - _region_view->beats_to_frames (_patch_change->patch()->time()) - region->position() + region->start();
}