* Added CanvasSysEx class for displaying SysExes
git-svn-id: svn://localhost/ardour2/branches/3.0@4544 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
0800b59f61
commit
f93ca1349c
@ -130,6 +130,7 @@ canvas-note-event.cc
|
||||
canvas-note.cc
|
||||
canvas-flag.cc
|
||||
canvas-program-change.cc
|
||||
canvas-sysex.cc
|
||||
canvas-simpleline.c
|
||||
canvas-simplerect.c
|
||||
canvas-waveview.c
|
||||
|
@ -66,6 +66,8 @@
|
||||
<Option name="midi note velocity text" value="000000ff"/>
|
||||
<Option name="midi program change fill" value="0000ffa0"/>
|
||||
<Option name="midi program change outline" value="a7a7d4ff"/>
|
||||
<Option name="midi sysex fill" value="f1e139a0"/>
|
||||
<Option name="midi sysex outline" value="a7a7d4ff"/>
|
||||
<Option name="midi select rect fill" value="8888ff88"/>
|
||||
<Option name="midi select rect outline" value="5555ffff"/>
|
||||
<Option name="midi track base" value="b3cca35f"/>
|
||||
|
64
gtk2_ardour/canvas-sysex.cc
Normal file
64
gtk2_ardour/canvas-sysex.cc
Normal file
@ -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>;
|
37
gtk2_ardour/canvas-sysex.h
Normal file
37
gtk2_ardour/canvas-sysex.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef CANVAS_SYSEX_H_
|
||||
#define CANVAS_SYSEX_H_
|
||||
|
||||
#include "canvas-flag.h"
|
||||
#include <evoral/MIDIEvent.hpp>
|
||||
|
||||
class MidiRegionView;
|
||||
|
||||
namespace Gnome {
|
||||
namespace Canvas {
|
||||
|
||||
template<typename Time>
|
||||
class CanvasSysEx : public CanvasFlag
|
||||
{
|
||||
public:
|
||||
CanvasSysEx(
|
||||
MidiRegionView& region,
|
||||
Group& parent,
|
||||
string& text,
|
||||
double height,
|
||||
double x,
|
||||
double y,
|
||||
boost::shared_ptr<Evoral::MIDIEvent<Time> > event
|
||||
);
|
||||
|
||||
virtual ~CanvasSysEx();
|
||||
|
||||
virtual bool on_event(GdkEvent* ev);
|
||||
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
} // namespace Canvas
|
||||
} // namespace Gnome
|
||||
|
||||
#endif /*CANVAS_SYSEX_H_*/
|
@ -64,6 +64,8 @@ CANVAS_VARIABLE(canvasvar_MidiNoteSelected, "midi note selected")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteVelocityText, "midi note velocity text")
|
||||
CANVAS_VARIABLE(canvasvar_MidiProgramChangeFill, "midi program change fill")
|
||||
CANVAS_VARIABLE(canvasvar_MidiProgramChangeOutline, "midi program change outline")
|
||||
CANVAS_VARIABLE(canvasvar_MidiSysExFill, "midi sysex fill")
|
||||
CANVAS_VARIABLE(canvasvar_MidiSysExOutline, "midi sysex outline")
|
||||
CANVAS_VARIABLE(canvasvar_MidiSelectRectFill, "midi select rect fill")
|
||||
CANVAS_VARIABLE(canvasvar_MidiSelectRectOutline, "midi select rect outline")
|
||||
CANVAS_VARIABLE(canvasvar_MidiTrackBase, "midi track base")
|
||||
|
Loading…
Reference in New Issue
Block a user