26 #include "canvas/text.h"
43 0xd32d2dff, 0xd36b2dff, 0xd3972dff, 0xd3d12dff,
44 0xa0d32dff, 0x7dd32dff, 0x2dd45eff, 0x2dd3c4ff,
45 0x2da5d3ff, 0x2d6fd3ff, 0x432dd3ff, 0x662dd3ff,
46 0x832dd3ff, 0xa92dd3ff, 0xd32dbfff, 0xd32d67ff
55 , _with_events (with_events)
58 , _mouse_x_fraction (-1.0)
59 , _mouse_y_fraction (-1.0)
74 _item->set_data (
"notebase",
this);
98 _text->set_ignore_events (
true);
100 _text->set_alignment (Pango::ALIGN_CENTER);
103 _text->set_x_position ((
x0() +
x1()) / 2);
104 _text->set_y_position ((
y0() +
y1()) / 2);
105 ostringstream velo(ios::ate);
106 velo << int(
_note->velocity());
107 _text->set (velo.str ());
109 _text->raise_to_top();
123 if ( (selection & (1 <<
_note->channel())) == 0 ) {
156 #define SCALE_USHORT_TO_UINT8_T(x) ((x) / 257)
165 const uint8_t min_opacity = 15;
166 uint8_t opacity = std::max(min_opacity, uint8_t(
_note->velocity() +
_note->velocity()));
192 bool set_cursor =
false;
195 case GDK_MOTION_NOTIFY:
200 case GDK_ENTER_NOTIFY:
205 case GDK_BUTTON_PRESS:
206 case GDK_BUTTON_RELEASE:
216 boost::optional<ArdourCanvas::Rect> bbox =
_item->bounding_box ();
219 _item->canvas_to_item (ix, iy);
224 ix = ix - bbox.get().x0;
225 iy = iy - bbox.get().y0;
232 xf = ix / bbox.get().width ();
233 yf = iy / bbox.get().height ();
263 case GDK_ENTER_NOTIFY:
268 case GDK_LEAVE_NOTIFY:
273 case GDK_MOTION_NOTIFY:
277 case GDK_BUTTON_PRESS:
281 case GDK_BUTTON_RELEASE:
302 return (
x1() -
x0()) > 10;
void note_mouse_position(float xfraction, float yfraction, bool can_set_cursor=true)
ArdourCanvas::Color color(const std::string &, bool *failed=0) const
virtual ArdourCanvas::Coord x1() const =0
TimeAxisView & get_time_axis_view() const
static const uint32_t midi_channel_colors[16]
hue circle divided into 16 equal-looking parts, courtesy Thorsten Wilms
void on_channel_selection_change(uint16_t selection)
PublicEditor & editor() const
void note_left(NoteBase *ev)
static uint32_t calculate_outline(uint32_t color, bool selected=false)
calculate outline colors from fill colors of notes
static PBD::Signal1< void, NoteBase * > NoteBaseDeleted
virtual ArdourCanvas::Coord x0() const =0
virtual ArdourCanvas::Coord y1() const =0
virtual ArdourCanvas::Coord y0() const =0
uint32_t get_region_color() const
NoteBase(MidiRegionView ®ion, bool, const boost::shared_ptr< NoteType > note=boost::shared_ptr< NoteType >())
virtual void set_outline_color(uint32_t c)=0
Representation of the interface of the Editor class.
void note_entered(NoteBase *ev)
virtual bool canvas_note_event(GdkEvent *event, ArdourCanvas::Item *)=0
#define UINT_RGBA_CHANGE_A(x, a)
MidiStreamView * midi_stream_view() const
void note_selected(NoteBase *ev, bool add, bool extend=false)
ArdourCanvas::Item * item() const
ARDOUR::ColorMode color_mode() const
static uint32_t meter_style_fill_color(uint8_t vel, bool selected)
void set_selected(bool yn)
virtual void set_fill_color(uint32_t c)=0
ArdourCanvas::Item * _item
ArdourCanvas::Text * _text
bool event_handler(GdkEvent *)
bool mouse_near_ends() const
virtual bool internal_editing() const =0
void change_channel(uint8_t channel)
static UIConfiguration * config()
#define UINT_INTERPOLATE(c1, c2, t)
const boost::shared_ptr< NoteType > _note
void on_channel_change(uint8_t channel)
virtual bool big_enough_to_trim() const
void set_item(ArdourCanvas::Item *)
void set_mouse_fractions(GdkEvent *)
LIBARDOUR_API PBD::PropertyDescriptor< bool > color