Ardour  8.12
piano_roll_header.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 David Robillard <d@drobilla.net>
3  * Copyright (C) 2010-2012 Paul Davis <paul@linuxaudiosystems.com>
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 along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __ardour_piano_roll_header_h__
21 #define __ardour_piano_roll_header_h__
22 
23 #include "ardour/types.h"
24 
25 #include <gtkmm/drawingarea.h>
26 
27 namespace ARDOUR {
28  class MidiTrack;
29 }
30 
31 class MidiTimeAxisView;
32 class MidiStreamView;
33 class PublicEditor;
34 
36 public:
38 
46 
48 
50 
52  void set_note_highlight (uint8_t note);
53 
54  sigc::signal<void,uint8_t> SetNoteSelection;
55  sigc::signal<void,uint8_t> AddNoteSelection;
56  sigc::signal<void,uint8_t> ToggleNoteSelection;
57  sigc::signal<void,uint8_t> ExtendNoteSelection;
58 
59 private:
60  struct NoteName {
61  std::string name;
63  };
66  void set_min_page_size(double page_size);
67  void render_scroomer(Cairo::RefPtr<Cairo::Context>);
68  NoteName get_note_name (int note);
69 
71 
73 
74  enum ItemType {
82  WHITE_DGA
83  };
84 
85  void invalidate_note_range(int lowest, int highest);
86 
87  void get_path(int note, double x[], double y[]);
88 
89  void send_note_on(uint8_t note);
90  void send_note_off(uint8_t note);
91 
92  void reset_clicked_note(uint8_t, bool invalidate = true);
93 
95 
96  uint8_t _event[3];
97 
98  Glib::RefPtr<Pango::Layout> _layout;
99  Glib::RefPtr<Pango::Layout> _big_c_layout;
100  Glib::RefPtr<Pango::Layout> _midnam_layout;
101 
102  Pango::FontDescription _font_descript;
103  Pango::FontDescription _font_descript_big_c;
104  Pango::FontDescription _font_descript_midnam;
105  bool _active_notes[128];
107  uint8_t _clicked_note;
108  double _grab_y;
109  bool _dragging;
112  double _old_y;
113  double _fract;
114  double _fract_top;
123  bool entered;
124 
125  double _note_height;
127 
129  bool show_scroomer () const;
130 };
131 
132 #endif /* __ardour_piano_roll_header_h__ */
void get_path(int note, double x[], double y[])
bool on_enter_notify_event(GdkEventCrossing *)
This is a default handler for the signal signal_enter_notify_event().
sigc::signal< void, uint8_t > SetNoteSelection
Pango::FontDescription _font_descript
bool show_scroomer() const
void send_note_on(uint8_t note)
sigc::signal< void, uint8_t > AddNoteSelection
void set_note_highlight(uint8_t note)
MidiStreamView & _view
void on_size_request(Gtk::Requisition *)
This is a default handler for the signal signal_size_request().
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
scr_pos _scroomer_button_state
void reset_clicked_note(uint8_t, bool invalidate=true)
Pango::FontDescription _font_descript_big_c
void set_min_page_size(double page_size)
bool on_button_release_event(GdkEventButton *)
This is a default handler for the signal signal_button_release_event().
sigc::signal< void, uint8_t > ToggleNoteSelection
void send_note_off(uint8_t note)
void note_range_changed()
bool on_leave_notify_event(GdkEventCrossing *)
This is a default handler for the signal signal_leave_notify_event().
Gtk::Adjustment & _adj
bool on_expose_event(GdkEventExpose *)
This is a default handler for the signal signal_expose_event().
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
PublicEditor & editor() const
void invalidate_note_range(int lowest, int highest)
PianoRollHeader(MidiStreamView &)
void instrument_info_change()
Glib::RefPtr< Pango::Layout > _midnam_layout
Glib::RefPtr< Pango::Layout > _big_c_layout
Pango::FontDescription _font_descript_midnam
Glib::RefPtr< Pango::Layout > _layout
bool on_motion_notify_event(GdkEventMotion *)
This is a default handler for the signal signal_motion_notify_event().
NoteName get_note_name(int note)
void render_scroomer(Cairo::RefPtr< Cairo::Context >)
sigc::signal< void, uint8_t > ExtendNoteSelection
PianoRollHeader(const PianoRollHeader &)
NoteName note_names[128]
Representation of the interface of the Editor class.