Ardour
9.0-pre0-582-g084a23a80d
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
#pragma once
21
22
#include "
ardour/types.h
"
23
24
#include <
gtkmm/drawingarea.h
>
25
26
namespace
ARDOUR
{
27
class
MidiTrack;
28
}
29
30
class
MidiTimeAxisView
;
31
class
MidiStreamView
;
32
class
PublicEditor
;
33
34
class
PianoRollHeader
:
public
Gtk::DrawingArea
{
35
public
:
36
PianoRollHeader
(
MidiStreamView
&);
37
38
bool
on_expose_event
(
GdkEventExpose
*);
39
bool
on_motion_notify_event
(
GdkEventMotion
*);
40
bool
on_button_press_event
(
GdkEventButton
*);
41
bool
on_button_release_event
(
GdkEventButton
*);
42
bool
on_scroll_event
(
GdkEventScroll
*);
43
bool
on_enter_notify_event
(
GdkEventCrossing
*);
44
bool
on_leave_notify_event
(
GdkEventCrossing
*);
45
46
void
on_size_request
(
Gtk::Requisition
*);
47
48
void
instrument_info_change
();
49
50
void
note_range_changed
();
51
void
set_note_highlight
(uint8_t note);
52
53
sigc::signal<void,uint8_t>
SetNoteSelection
;
54
sigc::signal<void,uint8_t>
AddNoteSelection
;
55
sigc::signal<void,uint8_t>
ToggleNoteSelection
;
56
sigc::signal<void,uint8_t>
ExtendNoteSelection
;
57
58
private
:
59
struct
NoteName
{
60
std::string
name
;
61
bool
from_midnam
;
62
};
63
NoteName
note_names
[128];
64
bool
have_note_names
;
65
void
set_min_page_size
(
double
page_size);
66
void
render_scroomer
(Cairo::RefPtr<Cairo::Context>);
67
NoteName
get_note_name
(
int
note);
68
69
Gtk::Adjustment
&
_adj
;
70
71
PianoRollHeader
(
const
PianoRollHeader
&);
72
73
enum
ItemType
{
74
BLACK_SEPARATOR
,
75
BLACK_MIDDLE_SEPARATOR
,
76
BLACK
,
77
WHITE_SEPARATOR
,
78
WHITE_RECT
,
79
WHITE_CF
,
80
WHITE_EB
,
81
WHITE_DGA
82
};
83
84
void
invalidate_note_range
(
int
lowest,
int
highest);
85
86
void
get_path
(
int
note,
double
x[],
double
y[]);
87
88
void
send_note_on
(uint8_t note);
89
void
send_note_off
(uint8_t note);
90
91
void
reset_clicked_note
(uint8_t,
bool
invalidate =
true
);
92
93
MidiStreamView
&
_view
;
94
95
uint8_t
_event
[3];
96
97
Glib::RefPtr<Pango::Layout>
_layout
;
98
Glib::RefPtr<Pango::Layout>
_big_c_layout
;
99
Glib::RefPtr<Pango::Layout>
_midnam_layout
;
100
101
Pango::FontDescription
_font_descript
;
102
Pango::FontDescription
_font_descript_big_c
;
103
Pango::FontDescription
_font_descript_midnam
;
104
bool
_active_notes
[128];
105
uint8_t
_highlighted_note
;
106
uint8_t
_clicked_note
;
107
double
_grab_y
;
108
bool
_dragging
;
109
double
_scroomer_size
;
110
bool
_scroomer_drag
;
111
double
_old_y
;
112
double
_fract
;
113
double
_fract_top
;
114
double
_raw_note_height
;
115
double
_min_page_size
;
116
enum
scr_pos
{
TOP
,
BOTTOM
,
MOVE
,
NONE
};
117
scr_pos
_scroomer_state
;
118
scr_pos
_scroomer_button_state
;
119
double
_saved_top_val
;
120
double
_saved_bottom_val
;
121
bool
_mini_map_display
;
122
bool
entered
;
123
124
double
_note_height
;
125
double
_old_av_note_height
;
126
127
PublicEditor
&
editor
()
const
;
128
bool
show_scroomer
()
const
;
129
};
130
types.h
Gtk::Adjustment
Definition:
adjustment.h:63
Gtk::DrawingArea
Definition:
drawingarea.h:51
MidiStreamView
Definition:
midi_streamview.h:61
MidiTimeAxisView
Definition:
midi_time_axis.h:77
PianoRollHeader
Definition:
piano_roll_header.h:34
PianoRollHeader::get_path
void get_path(int note, double x[], double y[])
PianoRollHeader::_clicked_note
uint8_t _clicked_note
Definition:
piano_roll_header.h:106
PianoRollHeader::on_enter_notify_event
bool on_enter_notify_event(GdkEventCrossing *)
This is a default handler for the signal signal_enter_notify_event().
PianoRollHeader::SetNoteSelection
sigc::signal< void, uint8_t > SetNoteSelection
Definition:
piano_roll_header.h:53
PianoRollHeader::_font_descript
Pango::FontDescription _font_descript
Definition:
piano_roll_header.h:101
PianoRollHeader::show_scroomer
bool show_scroomer() const
PianoRollHeader::send_note_on
void send_note_on(uint8_t note)
PianoRollHeader::AddNoteSelection
sigc::signal< void, uint8_t > AddNoteSelection
Definition:
piano_roll_header.h:54
PianoRollHeader::_old_av_note_height
double _old_av_note_height
Definition:
piano_roll_header.h:125
PianoRollHeader::have_note_names
bool have_note_names
Definition:
piano_roll_header.h:64
PianoRollHeader::set_note_highlight
void set_note_highlight(uint8_t note)
PianoRollHeader::_view
MidiStreamView & _view
Definition:
piano_roll_header.h:93
PianoRollHeader::entered
bool entered
Definition:
piano_roll_header.h:122
PianoRollHeader::on_size_request
void on_size_request(Gtk::Requisition *)
This is a default handler for the signal signal_size_request().
PianoRollHeader::on_scroll_event
bool on_scroll_event(GdkEventScroll *)
This is a default handler for the signal signal_scroll_event().
PianoRollHeader::_scroomer_button_state
scr_pos _scroomer_button_state
Definition:
piano_roll_header.h:118
PianoRollHeader::reset_clicked_note
void reset_clicked_note(uint8_t, bool invalidate=true)
PianoRollHeader::_font_descript_big_c
Pango::FontDescription _font_descript_big_c
Definition:
piano_roll_header.h:102
PianoRollHeader::_note_height
double _note_height
Definition:
piano_roll_header.h:124
PianoRollHeader::set_min_page_size
void set_min_page_size(double page_size)
PianoRollHeader::_scroomer_size
double _scroomer_size
Definition:
piano_roll_header.h:109
PianoRollHeader::_saved_top_val
double _saved_top_val
Definition:
piano_roll_header.h:119
PianoRollHeader::on_button_release_event
bool on_button_release_event(GdkEventButton *)
This is a default handler for the signal signal_button_release_event().
PianoRollHeader::_event
uint8_t _event[3]
Definition:
piano_roll_header.h:95
PianoRollHeader::ToggleNoteSelection
sigc::signal< void, uint8_t > ToggleNoteSelection
Definition:
piano_roll_header.h:55
PianoRollHeader::_saved_bottom_val
double _saved_bottom_val
Definition:
piano_roll_header.h:120
PianoRollHeader::send_note_off
void send_note_off(uint8_t note)
PianoRollHeader::note_range_changed
void note_range_changed()
PianoRollHeader::_active_notes
bool _active_notes[128]
Definition:
piano_roll_header.h:104
PianoRollHeader::on_leave_notify_event
bool on_leave_notify_event(GdkEventCrossing *)
This is a default handler for the signal signal_leave_notify_event().
PianoRollHeader::_adj
Gtk::Adjustment & _adj
Definition:
piano_roll_header.h:69
PianoRollHeader::on_expose_event
bool on_expose_event(GdkEventExpose *)
This is a default handler for the signal signal_expose_event().
PianoRollHeader::on_button_press_event
bool on_button_press_event(GdkEventButton *)
This is a default handler for the signal signal_button_press_event().
PianoRollHeader::editor
PublicEditor & editor() const
PianoRollHeader::invalidate_note_range
void invalidate_note_range(int lowest, int highest)
PianoRollHeader::PianoRollHeader
PianoRollHeader(MidiStreamView &)
PianoRollHeader::_scroomer_state
scr_pos _scroomer_state
Definition:
piano_roll_header.h:117
PianoRollHeader::instrument_info_change
void instrument_info_change()
PianoRollHeader::_midnam_layout
Glib::RefPtr< Pango::Layout > _midnam_layout
Definition:
piano_roll_header.h:99
PianoRollHeader::_fract_top
double _fract_top
Definition:
piano_roll_header.h:113
PianoRollHeader::_fract
double _fract
Definition:
piano_roll_header.h:112
PianoRollHeader::_big_c_layout
Glib::RefPtr< Pango::Layout > _big_c_layout
Definition:
piano_roll_header.h:98
PianoRollHeader::ItemType
ItemType
Definition:
piano_roll_header.h:73
PianoRollHeader::BLACK_SEPARATOR
@ BLACK_SEPARATOR
Definition:
piano_roll_header.h:74
PianoRollHeader::WHITE_CF
@ WHITE_CF
Definition:
piano_roll_header.h:79
PianoRollHeader::BLACK_MIDDLE_SEPARATOR
@ BLACK_MIDDLE_SEPARATOR
Definition:
piano_roll_header.h:75
PianoRollHeader::WHITE_RECT
@ WHITE_RECT
Definition:
piano_roll_header.h:78
PianoRollHeader::WHITE_DGA
@ WHITE_DGA
Definition:
piano_roll_header.h:81
PianoRollHeader::WHITE_EB
@ WHITE_EB
Definition:
piano_roll_header.h:80
PianoRollHeader::BLACK
@ BLACK
Definition:
piano_roll_header.h:76
PianoRollHeader::WHITE_SEPARATOR
@ WHITE_SEPARATOR
Definition:
piano_roll_header.h:77
PianoRollHeader::_font_descript_midnam
Pango::FontDescription _font_descript_midnam
Definition:
piano_roll_header.h:103
PianoRollHeader::scr_pos
scr_pos
Definition:
piano_roll_header.h:116
PianoRollHeader::NONE
@ NONE
Definition:
piano_roll_header.h:116
PianoRollHeader::MOVE
@ MOVE
Definition:
piano_roll_header.h:116
PianoRollHeader::TOP
@ TOP
Definition:
piano_roll_header.h:116
PianoRollHeader::BOTTOM
@ BOTTOM
Definition:
piano_roll_header.h:116
PianoRollHeader::_layout
Glib::RefPtr< Pango::Layout > _layout
Definition:
piano_roll_header.h:97
PianoRollHeader::_grab_y
double _grab_y
Definition:
piano_roll_header.h:107
PianoRollHeader::on_motion_notify_event
bool on_motion_notify_event(GdkEventMotion *)
This is a default handler for the signal signal_motion_notify_event().
PianoRollHeader::_dragging
bool _dragging
Definition:
piano_roll_header.h:108
PianoRollHeader::get_note_name
NoteName get_note_name(int note)
PianoRollHeader::_scroomer_drag
bool _scroomer_drag
Definition:
piano_roll_header.h:110
PianoRollHeader::_raw_note_height
double _raw_note_height
Definition:
piano_roll_header.h:114
PianoRollHeader::_old_y
double _old_y
Definition:
piano_roll_header.h:111
PianoRollHeader::render_scroomer
void render_scroomer(Cairo::RefPtr< Cairo::Context >)
PianoRollHeader::_min_page_size
double _min_page_size
Definition:
piano_roll_header.h:115
PianoRollHeader::ExtendNoteSelection
sigc::signal< void, uint8_t > ExtendNoteSelection
Definition:
piano_roll_header.h:56
PianoRollHeader::_mini_map_display
bool _mini_map_display
Definition:
piano_roll_header.h:121
PianoRollHeader::_highlighted_note
uint8_t _highlighted_note
Definition:
piano_roll_header.h:105
PianoRollHeader::PianoRollHeader
PianoRollHeader(const PianoRollHeader &)
PianoRollHeader::note_names
NoteName note_names[128]
Definition:
piano_roll_header.h:63
PublicEditor
Representation of the interface of the Editor class.
Definition:
public_editor.h:127
drawingarea.h
ARDOUR
Definition:
analysis_window.h:44
PianoRollHeader::NoteName
Definition:
piano_roll_header.h:59
PianoRollHeader::NoteName::name
std::string name
Definition:
piano_roll_header.h:60
PianoRollHeader::NoteName::from_midnam
bool from_midnam
Definition:
piano_roll_header.h:61
_GdkEventButton
Definition:
gdkevents.h:321
_GdkEventCrossing
Definition:
gdkevents.h:383
_GdkEventExpose
Definition:
gdkevents.h:281
_GdkEventMotion
Definition:
gdkevents.h:306
_GdkEventScroll
Definition:
gdkevents.h:351
_GtkRequisition
Definition:
gtkwidget.h:520
gtk2_ardour
piano_roll_header.h
Generated on Wed Dec 25 2024 05:44:44 for Ardour by
1.9.1