ardour
sys_ex.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Paul Davis
3  Author: Hans Baier
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 
20 #include <iostream>
21 #include "canvas/flag.h"
22 #include "ardour_ui.h"
23 #include "sys_ex.h"
24 
25 using namespace std;
26 
28  MidiRegionView& region,
29  ArdourCanvas::Container* parent,
30  string& text,
31  double height,
32  double x,
33  double y)
34 {
35  _flag = new ArdourCanvas::Flag (
36  parent,
37  height,
38  ARDOUR_UI::config()->color ("midi sysex outline"),
39  ARDOUR_UI::config()->color_mod ("midi sysex fill", "midi sysex fill"),
40  ArdourCanvas::Duple (x, y)
41  );
42 
43  _flag->set_text (text);
44 }
45 
47 {
48 }
49 
50 bool
51 SysEx::event_handler (GdkEvent* ev)
52 {
53  switch (ev->type) {
54  case GDK_BUTTON_PRESS:
55  if (ev->button.button == 3) {
56  return true;
57  }
58  break;
59 
60  case GDK_SCROLL:
61  if (ev->scroll.direction == GDK_SCROLL_UP) {
62  return true;
63  } else if (ev->scroll.direction == GDK_SCROLL_DOWN) {
64  return true;
65  }
66  break;
67 
68  default:
69  break;
70  }
71 
72  return false;
73 }
74 
75 void
77 {
78  _flag->hide ();
79 }
80 
81 void
83 {
84  _flag->show ();
85 }
void show()
Definition: sys_ex.cc:82
Definition: Beats.hpp:239
~SysEx()
Definition: sys_ex.cc:46
SysEx(MidiRegionView &region, ArdourCanvas::Container *parent, std::string &text, double height, double x, double y)
Definition: sys_ex.cc:27
void hide()
Definition: sys_ex.cc:76
static UIConfiguration * config()
Definition: ardour_ui.h:188
bool event_handler(GdkEvent *ev)
Definition: sys_ex.cc:51
LIBARDOUR_API PBD::PropertyDescriptor< bool > color
Definition: route_group.cc:50