13
0
livetrax/gtk2_ardour/canvas-program-change.cc
Hans Baier 5e7ae490c1 * first working prototype of changing program changes by scroll wheel (still some automation points issues)
git-svn-id: svn://localhost/ardour2/branches/3.0@4324 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-12-15 11:05:41 +00:00

51 lines
1.1 KiB
C++

#include "canvas-program-change.h"
#include <iostream>
#include "ardour_ui.h"
#include "midi_region_view.h"
using namespace Gnome::Canvas;
using namespace std;
CanvasProgramChange::CanvasProgramChange(
MidiRegionView& region,
Group& parent,
string& text,
double height,
double x,
double y)
: CanvasFlag(
region,
parent,
height,
ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get(),
ARDOUR_UI::config()->canvasvar_MidiProgramChangeFill.get(),
x,
y
)
{
set_text(text);
}
CanvasProgramChange::~CanvasProgramChange()
{
}
bool
CanvasProgramChange::on_event(GdkEvent* ev)
{
switch (ev->type) {
case GDK_SCROLL:
if (ev->scroll.direction == GDK_SCROLL_UP) {
_region.previous_program(*this);
return true;
} else if (ev->scroll.direction == GDK_SCROLL_DOWN) {
_region.next_program(*this);
return true;
}
default:
break;
}
return false;
}