diff options
author | Hans Baier <hansfbaier@googlemail.com> | 2009-02-13 08:29:12 +0000 |
---|---|---|
committer | Hans Baier <hansfbaier@googlemail.com> | 2009-02-13 08:29:12 +0000 |
commit | f93ca1349ce3d56ecd9b90c1b6e88971d46d9952 (patch) | |
tree | 777a2eb2217b551a640f6f57ed1a4ae506861baa /gtk2_ardour/canvas-sysex.cc | |
parent | 0800b59f6179850b73bd9af0e09659c63e2ad0a5 (diff) |
* Added CanvasSysEx class for displaying SysExes
git-svn-id: svn://localhost/ardour2/branches/3.0@4544 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas-sysex.cc')
-rw-r--r-- | gtk2_ardour/canvas-sysex.cc | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/gtk2_ardour/canvas-sysex.cc b/gtk2_ardour/canvas-sysex.cc new file mode 100644 index 0000000000..f054379743 --- /dev/null +++ b/gtk2_ardour/canvas-sysex.cc @@ -0,0 +1,64 @@ +#include <iostream> + +#include "ardour_ui.h" + +#include "canvas-sysex.h" + +using namespace Gnome::Canvas; +using namespace std; + +template<typename Time> +CanvasSysEx<Time>::CanvasSysEx( + MidiRegionView& region, + Group& parent, + string& text, + double height, + double x, + double y, + boost::shared_ptr<Evoral::MIDIEvent<Time> > event + ) + : CanvasFlag( + region, + parent, + height, + ARDOUR_UI::config()->canvasvar_MidiSysExOutline.get(), + ARDOUR_UI::config()->canvasvar_MidiSysExFill.get(), + x, + y + ) +{ + set_text(text); +} + +template<typename Time> +CanvasSysEx<Time>::~CanvasSysEx() +{ +} + +template<typename Time> +bool +CanvasSysEx<Time>::on_event(GdkEvent* ev) +{ + switch (ev->type) { + case GDK_BUTTON_PRESS: + if (ev->button.button == 3) { + return true; + } + break; + + case GDK_SCROLL: + if (ev->scroll.direction == GDK_SCROLL_UP) { + return true; + } else if (ev->scroll.direction == GDK_SCROLL_DOWN) { + return true; + } + break; + + default: + break; + } + + return false; +} + +template class CanvasSysEx<nframes_t>; |