Ardour
9.0-pre0-582-g084a23a80d
prh.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 <pangomm/layout.h>
23
#include <glibmm/refptr.h>
24
25
#include "
ardour/types.h
"
26
27
#include "
canvas/rectangle.h
"
28
29
#include <
gtkmm/adjustment.h
>
30
31
namespace
ARDOUR
{
32
class
MidiTrack;
33
}
34
35
class
MidiView
;
36
class
MidiViewBackground
;
37
class
EditingContext
;
38
39
namespace
ArdourCanvas
{
40
41
class
PianoRollHeader
:
public
ArdourCanvas::Rectangle
{
42
public
:
43
PianoRollHeader
(
ArdourCanvas::Item
*
parent
,
MidiViewBackground
&);
44
45
void
size_request
(
double
& w,
double
& h)
const
;
46
void
render
(
ArdourCanvas::Rect
const
& area, Cairo::RefPtr<Cairo::Context>)
const
;
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
void
set_view
(
MidiView
*);
59
60
private
:
61
MidiViewBackground
&
_midi_context
;
62
Gtk::Adjustment
&
_adj
;
63
MidiView
*
_view
;
64
65
uint8_t
_event
[3];
66
67
mutable
Glib::RefPtr<Pango::Layout>
_layout
;
68
mutable
Glib::RefPtr<Pango::Layout>
_big_c_layout
;
69
mutable
Glib::RefPtr<Pango::Layout>
_midnam_layout
;
70
mutable
Pango::FontDescription
_font_descript
;
71
Pango::FontDescription
_font_descript_big_c
;
72
mutable
Pango::FontDescription
_font_descript_midnam
;
73
bool
_active_notes
[128];
74
uint8_t
_highlighted_note
;
75
uint8_t
_clicked_note
;
76
double
_grab_y
;
77
bool
_dragging
;
78
mutable
double
_scroomer_size
;
79
bool
_scroomer_drag
;
80
double
_old_y
;
81
double
_fract
;
82
double
_fract_top
;
83
double
_min_page_size
;
84
enum
scr_pos
{
TOP
,
BOTTOM
,
MOVE
,
NONE
};
85
scr_pos
_scroomer_state
;
86
scr_pos
_scroomer_button_state
;
87
double
_saved_top_val
;
88
double
_saved_bottom_val
;
89
mutable
bool
_mini_map_display
;
90
bool
entered
;
91
92
// void on_size_request(Gtk::Requisition*);
93
94
struct
NoteName
{
95
std::string
name
;
96
bool
from_midnam
;
97
};
98
NoteName
note_names
[128];
99
bool
have_note_names
;
100
PBD::ScopedConnection
height_connection
;
101
102
void
set_min_page_size
(
double
page_size);
103
void
render_scroomer
(Cairo::RefPtr<Cairo::Context>)
const
;
104
NoteName
get_note_name
(
int
note);
105
106
bool
event_handler
(
GdkEvent
*);
107
bool
motion_handler
(
GdkEventMotion
*);
108
bool
button_press_handler
(
GdkEventButton
*);
109
bool
button_release_handler
(
GdkEventButton
*);
110
bool
scroll_handler
(
GdkEventScroll
*);
111
bool
enter_handler
(
GdkEventCrossing
*);
112
bool
leave_handler
(
GdkEventCrossing
*);
113
114
enum
ItemType
{
115
BLACK_SEPARATOR
,
116
BLACK_MIDDLE_SEPARATOR
,
117
BLACK
,
118
WHITE_SEPARATOR
,
119
WHITE_RECT
,
120
WHITE_CF
,
121
WHITE_EB
,
122
WHITE_DGA
123
};
124
125
void
invalidate_note_range
(
int
lowest,
int
highest);
126
void
get_path
(
int
note,
double
x[],
double
y[])
const
;
127
void
send_note_on
(uint8_t note);
128
void
send_note_off
(uint8_t note);
129
void
reset_clicked_note
(uint8_t,
bool
invalidate =
true
);
130
bool
show_scroomer
()
const
;
131
void
resize
();
132
};
133
134
}
135
adjustment.h
types.h
rectangle.h
ArdourCanvas::Item
Definition:
canvas/canvas/item.h:57
ArdourCanvas::Item::parent
Item * parent() const
Definition:
canvas/canvas/item.h:114
ArdourCanvas::PianoRollHeader
Definition:
prh.h:41
ArdourCanvas::PianoRollHeader::height_connection
PBD::ScopedConnection height_connection
Definition:
prh.h:100
ArdourCanvas::PianoRollHeader::_clicked_note
uint8_t _clicked_note
Definition:
prh.h:75
ArdourCanvas::PianoRollHeader::have_note_names
bool have_note_names
Definition:
prh.h:99
ArdourCanvas::PianoRollHeader::_grab_y
double _grab_y
Definition:
prh.h:76
ArdourCanvas::PianoRollHeader::event_handler
bool event_handler(GdkEvent *)
ArdourCanvas::PianoRollHeader::_scroomer_drag
bool _scroomer_drag
Definition:
prh.h:79
ArdourCanvas::PianoRollHeader::get_note_name
NoteName get_note_name(int note)
ArdourCanvas::PianoRollHeader::get_path
void get_path(int note, double x[], double y[]) const
ArdourCanvas::PianoRollHeader::_view
MidiView * _view
Definition:
prh.h:63
ArdourCanvas::PianoRollHeader::send_note_off
void send_note_off(uint8_t note)
ArdourCanvas::PianoRollHeader::size_request
void size_request(double &w, double &h) const
ArdourCanvas::PianoRollHeader::_scroomer_button_state
scr_pos _scroomer_button_state
Definition:
prh.h:86
ArdourCanvas::PianoRollHeader::_midnam_layout
Glib::RefPtr< Pango::Layout > _midnam_layout
Definition:
prh.h:69
ArdourCanvas::PianoRollHeader::note_range_changed
void note_range_changed()
ArdourCanvas::PianoRollHeader::instrument_info_change
void instrument_info_change()
ArdourCanvas::PianoRollHeader::_midi_context
MidiViewBackground & _midi_context
Definition:
prh.h:61
ArdourCanvas::PianoRollHeader::_mini_map_display
bool _mini_map_display
Definition:
prh.h:89
ArdourCanvas::PianoRollHeader::_font_descript
Pango::FontDescription _font_descript
Definition:
prh.h:70
ArdourCanvas::PianoRollHeader::_adj
Gtk::Adjustment & _adj
Definition:
prh.h:62
ArdourCanvas::PianoRollHeader::show_scroomer
bool show_scroomer() const
ArdourCanvas::PianoRollHeader::_font_descript_midnam
Pango::FontDescription _font_descript_midnam
Definition:
prh.h:72
ArdourCanvas::PianoRollHeader::_min_page_size
double _min_page_size
Definition:
prh.h:83
ArdourCanvas::PianoRollHeader::ExtendNoteSelection
sigc::signal< void, uint8_t > ExtendNoteSelection
Definition:
prh.h:56
ArdourCanvas::PianoRollHeader::_fract_top
double _fract_top
Definition:
prh.h:82
ArdourCanvas::PianoRollHeader::resize
void resize()
ArdourCanvas::PianoRollHeader::ItemType
ItemType
Definition:
prh.h:114
ArdourCanvas::PianoRollHeader::WHITE_DGA
@ WHITE_DGA
Definition:
prh.h:122
ArdourCanvas::PianoRollHeader::BLACK_MIDDLE_SEPARATOR
@ BLACK_MIDDLE_SEPARATOR
Definition:
prh.h:116
ArdourCanvas::PianoRollHeader::WHITE_EB
@ WHITE_EB
Definition:
prh.h:121
ArdourCanvas::PianoRollHeader::WHITE_CF
@ WHITE_CF
Definition:
prh.h:120
ArdourCanvas::PianoRollHeader::BLACK
@ BLACK
Definition:
prh.h:117
ArdourCanvas::PianoRollHeader::WHITE_RECT
@ WHITE_RECT
Definition:
prh.h:119
ArdourCanvas::PianoRollHeader::BLACK_SEPARATOR
@ BLACK_SEPARATOR
Definition:
prh.h:115
ArdourCanvas::PianoRollHeader::WHITE_SEPARATOR
@ WHITE_SEPARATOR
Definition:
prh.h:118
ArdourCanvas::PianoRollHeader::scroll_handler
bool scroll_handler(GdkEventScroll *)
ArdourCanvas::PianoRollHeader::reset_clicked_note
void reset_clicked_note(uint8_t, bool invalidate=true)
ArdourCanvas::PianoRollHeader::_dragging
bool _dragging
Definition:
prh.h:77
ArdourCanvas::PianoRollHeader::entered
bool entered
Definition:
prh.h:90
ArdourCanvas::PianoRollHeader::_scroomer_state
scr_pos _scroomer_state
Definition:
prh.h:85
ArdourCanvas::PianoRollHeader::_fract
double _fract
Definition:
prh.h:81
ArdourCanvas::PianoRollHeader::_saved_bottom_val
double _saved_bottom_val
Definition:
prh.h:88
ArdourCanvas::PianoRollHeader::_scroomer_size
double _scroomer_size
Definition:
prh.h:78
ArdourCanvas::PianoRollHeader::_big_c_layout
Glib::RefPtr< Pango::Layout > _big_c_layout
Definition:
prh.h:68
ArdourCanvas::PianoRollHeader::_layout
Glib::RefPtr< Pango::Layout > _layout
Definition:
prh.h:67
ArdourCanvas::PianoRollHeader::enter_handler
bool enter_handler(GdkEventCrossing *)
ArdourCanvas::PianoRollHeader::SetNoteSelection
sigc::signal< void, uint8_t > SetNoteSelection
Definition:
prh.h:53
ArdourCanvas::PianoRollHeader::_old_y
double _old_y
Definition:
prh.h:80
ArdourCanvas::PianoRollHeader::render
void render(ArdourCanvas::Rect const &area, Cairo::RefPtr< Cairo::Context >) const
ArdourCanvas::PianoRollHeader::set_view
void set_view(MidiView *)
ArdourCanvas::PianoRollHeader::_font_descript_big_c
Pango::FontDescription _font_descript_big_c
Definition:
prh.h:71
ArdourCanvas::PianoRollHeader::set_note_highlight
void set_note_highlight(uint8_t note)
ArdourCanvas::PianoRollHeader::motion_handler
bool motion_handler(GdkEventMotion *)
ArdourCanvas::PianoRollHeader::leave_handler
bool leave_handler(GdkEventCrossing *)
ArdourCanvas::PianoRollHeader::invalidate_note_range
void invalidate_note_range(int lowest, int highest)
ArdourCanvas::PianoRollHeader::_saved_top_val
double _saved_top_val
Definition:
prh.h:87
ArdourCanvas::PianoRollHeader::_active_notes
bool _active_notes[128]
Definition:
prh.h:73
ArdourCanvas::PianoRollHeader::AddNoteSelection
sigc::signal< void, uint8_t > AddNoteSelection
Definition:
prh.h:54
ArdourCanvas::PianoRollHeader::PianoRollHeader
PianoRollHeader(ArdourCanvas::Item *parent, MidiViewBackground &)
ArdourCanvas::PianoRollHeader::send_note_on
void send_note_on(uint8_t note)
ArdourCanvas::PianoRollHeader::button_release_handler
bool button_release_handler(GdkEventButton *)
ArdourCanvas::PianoRollHeader::_highlighted_note
uint8_t _highlighted_note
Definition:
prh.h:74
ArdourCanvas::PianoRollHeader::set_min_page_size
void set_min_page_size(double page_size)
ArdourCanvas::PianoRollHeader::note_names
NoteName note_names[128]
Definition:
prh.h:98
ArdourCanvas::PianoRollHeader::scr_pos
scr_pos
Definition:
prh.h:84
ArdourCanvas::PianoRollHeader::MOVE
@ MOVE
Definition:
prh.h:84
ArdourCanvas::PianoRollHeader::BOTTOM
@ BOTTOM
Definition:
prh.h:84
ArdourCanvas::PianoRollHeader::TOP
@ TOP
Definition:
prh.h:84
ArdourCanvas::PianoRollHeader::NONE
@ NONE
Definition:
prh.h:84
ArdourCanvas::PianoRollHeader::button_press_handler
bool button_press_handler(GdkEventButton *)
ArdourCanvas::PianoRollHeader::_event
uint8_t _event[3]
Definition:
prh.h:65
ArdourCanvas::PianoRollHeader::render_scroomer
void render_scroomer(Cairo::RefPtr< Cairo::Context >) const
ArdourCanvas::PianoRollHeader::ToggleNoteSelection
sigc::signal< void, uint8_t > ToggleNoteSelection
Definition:
prh.h:55
ArdourCanvas::Rectangle
Definition:
canvas/canvas/rectangle.h:31
EditingContext
Definition:
editing_context.h:76
Gtk::Adjustment
Definition:
adjustment.h:63
MidiViewBackground
Definition:
midi_view_background.h:50
MidiView
Definition:
midi_view.h:80
PBD::ScopedConnection
Definition:
signals.h:236
ARDOUR
Definition:
analysis_window.h:44
ArdourCanvas
Definition:
audio_clip_editor.h:56
ArdourCanvas::PianoRollHeader::NoteName
Definition:
prh.h:94
ArdourCanvas::PianoRollHeader::NoteName::name
std::string name
Definition:
prh.h:95
ArdourCanvas::PianoRollHeader::NoteName::from_midnam
bool from_midnam
Definition:
prh.h:96
ArdourCanvas::Rect
Definition:
canvas/canvas/types.h:112
_GdkEventButton
Definition:
gdkevents.h:321
_GdkEventCrossing
Definition:
gdkevents.h:383
_GdkEventMotion
Definition:
gdkevents.h:306
_GdkEventScroll
Definition:
gdkevents.h:351
_GdkEvent
Definition:
gdkevents.h:517
gtk2_ardour
prh.h
Generated on Wed Dec 25 2024 05:44:45 for Ardour by
1.9.1