21 #include <cairomm/context.h>
49 Cairo::RefPtr<Cairo::Context> cc = get_window()->create_cairo_context();
50 GdkRectangle comp_rect, clip_rect;
53 int height = get_height();
55 double y2note = (double) 127 / height;
56 double note2y = (double) height / 127;
57 double note_width = 0.8 * get_width();
59 double black_shift = 0.1 * note2y;
60 double colors[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
65 comp_rect.width = get_width();
67 for (
int i = first_comp; i <= last_comp; ++i) {
71 if (gdk_rectangle_intersect(&comp_rect, &ev->area, &clip_rect)) {
74 cc->rectangle(clip_rect.x, clip_rect.y, clip_rect.width, clip_rect.height);
75 cc->set_source_rgb (colors[3], colors[4], colors[5]);
79 cc->set_source_rgb(colors[0], colors[1], colors[2]);
80 cc->set_line_width(note_height);
82 lnote = 127 - (int) floor((
double) (clip_rect.y + clip_rect.height) * y2note) - 1;
83 hnote = 127 - (int) floor((
double) clip_rect.y * y2note) + 1;
85 for (
int note = lnote; note < hnote + 1; ++note) {
86 double y = height - note * note2y;
108 cc->set_line_width(1.4 * note2y);
110 cc->line_to(note_width, y);
116 cc->rectangle(comp_rect.x + 0.5f, comp_rect.y + 0.5f, comp_rect.width - 1.0f, comp_rect.height - 1.0f);
117 cc->set_line_width(1.0
f);
118 cc->set_source_rgb (1.0
f, 1.0
f, 1.0
f);
void set_min_page_size(double page_size)
void set_comp_rect(GdkRectangle &, Component) const
bool on_expose_event(GdkEventExpose *)
void get_colors(double color[], Component comp)
Component point_in(double point) const
static double note_height(TimeAxisView &trackview, MidiStreamView *mv)
void on_size_request(Gtk::Requisition *)
MidiScroomer(Gtk::Adjustment &)
LIBARDOUR_API PBD::PropertyDescriptor< bool > color