Skip silent sources on session-archive -- fixes #7699
[ardour.git] / gtk2_ardour / note.cc
1 /*
2     Copyright (C) 2007 Paul Davis
3     Author: Dave Robillard
4     Author: Hans Baier
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #include "evoral/Note.hpp"
22
23 #include "canvas/note.h"
24 #include "canvas/debug.h"
25
26 #include "note.h"
27 #include "public_editor.h"
28
29 using namespace ARDOUR;
30 using ArdourCanvas::Coord;
31 using ArdourCanvas::Duple;
32
33 Note::Note (
34         MidiRegionView& region, ArdourCanvas::Item* parent, const boost::shared_ptr<NoteType> note, bool with_events)
35         : NoteBase (region, with_events, note)
36         , _note (new ArdourCanvas::Note (parent))
37 {
38         CANVAS_DEBUG_NAME (_note, "note");
39         set_item (_note);
40 }
41
42 Note::~Note ()
43 {
44         delete _note;
45 }
46
47 void
48 Note::move_event (double dx, double dy)
49 {
50         _note->set (_note->get().translate (Duple (dx, dy)));
51 }
52
53 Coord
54 Note::x0 () const
55 {
56         return _note->x0 ();
57 }
58
59 Coord
60 Note::x1 () const
61 {
62         return _note->x1 ();
63 }
64
65 Coord
66 Note::y0 () const
67 {
68         return _note->y0 ();
69 }
70
71 Coord
72 Note::y1 () const
73 {
74         return _note->y1 ();
75 }
76
77 void
78 Note::set_outline_color (uint32_t color)
79 {
80         _note->set_outline_color (color);
81 }
82
83 void
84 Note::set_fill_color (uint32_t color)
85 {
86         _note->set_fill_color (color);
87 }
88
89 void
90 Note::show ()
91 {
92         _note->show ();
93 }
94
95 void
96 Note::hide ()
97 {
98         _note->hide ();
99 }
100
101 void
102 Note::set (ArdourCanvas::Rect rect)
103 {
104         _note->set (rect);
105 }
106
107 void
108 Note::set_x0 (Coord x0)
109 {
110         _note->set_x0 (x0);
111 }
112
113 void
114 Note::set_y0 (Coord y0)
115 {
116         _note->set_y0 (y0);
117 }
118
119 void
120 Note::set_x1 (Coord x1)
121 {
122         _note->set_x1 (x1);
123 }
124
125 void
126 Note::set_y1 (Coord y1)
127 {
128         _note->set_y1 (y1);
129 }
130
131 void
132 Note::set_outline_what (ArdourCanvas::Rectangle::What what)
133 {
134         _note->set_outline_what (what);
135 }
136
137 void
138 Note::set_outline_all ()
139 {
140         _note->set_outline_all ();
141 }
142
143 void
144 Note::set_ignore_events (bool ignore)
145 {
146         _note->set_ignore_events (ignore);
147 }
148
149 void
150 Note::set_velocity (double fract)
151 {
152         _note->set_velocity (fract);
153 }
154