Ardour
9.0-pre0-582-g084a23a80d
patch_change.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2013-2014 Paul Davis <paul@linuxaudiosystems.com>
3
* Copyright (C) 2014 David Robillard <d@drobilla.net>
4
* Copyright (C) 2016-2017 Nick Mainsbridge <mainsbridge@gmail.com>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
*/
20
21
#ifndef __PATCH_CHANGE_H__
22
#define __PATCH_CHANGE_H__
23
24
#include "
canvas/flag.h
"
25
26
#include <
gtkmm/menu.h
>
27
28
#include "
midi_view.h
"
29
#include "
patch_change_dialog.h
"
30
31
class
MidiRegionView
;
32
33
namespace
MIDI
{
34
namespace
Name {
35
struct
PatchPrimaryKey;
36
}
37
}
38
39
class
PatchChange
40
{
41
public
:
42
PatchChange
(
MidiView
&
region
,
43
ArdourCanvas::Item
* parent,
44
double
height
,
45
double
x,
46
double
y,
47
ARDOUR::InstrumentInfo
&
info
,
48
ARDOUR::MidiModel::PatchChangePtr
patch
,
49
Gtkmm2ext::Color
outline_color,
50
Gtkmm2ext::Color
fill_color);
51
52
~PatchChange
();
53
54
void
initialize_popup_menus
();
55
56
void
on_patch_menu_selected
(
const
MIDI::Name::PatchPrimaryKey
& key);
57
58
void
move
(
ArdourCanvas::Duple
);
59
void
set_height
(
ArdourCanvas::Distance
);
60
void
hide
();
61
void
show
();
62
63
void
update_name
();
64
65
double
width
()
const
{
return
_flag
->
width
(); }
66
ARDOUR::MidiModel::PatchChangePtr
patch
()
const
{
return
_patch
; }
67
ArdourCanvas::Item
*
canvas_item
()
const
{
return
_flag
; }
68
ArdourCanvas::Item
&
item
()
const
{
return
*
_flag
; }
69
70
private
:
71
bool
event_handler
(
GdkEvent
*);
72
73
MidiView
&
_region
;
74
ARDOUR::InstrumentInfo
&
_info
;
75
ARDOUR::MidiModel::PatchChangePtr
_patch
;
76
Gtk::Menu
_popup
;
77
bool
_popup_initialized
;
78
ArdourCanvas::Flag
*
_flag
;
79
};
80
81
#endif
/* __PATCH_CHANGE_H__ */
ARDOUR::InstrumentInfo
Definition:
instrument_info.h:48
ArdourCanvas::Flag
Definition:
flag.h:37
ArdourCanvas::Flag::width
double width() const
ArdourCanvas::Item
Definition:
canvas/canvas/item.h:57
Evoral::Sequence< Temporal::Beats >::PatchChangePtr
std::shared_ptr< PatchChange< Temporal::Beats > > PatchChangePtr
Definition:
Sequence.h:205
Gtk::Menu
Definition:
tk/ytkmm/ytkmm/gtkmm/menu.h:59
MidiRegionView
Definition:
midi_region_view.h:74
MidiView
Definition:
midi_view.h:80
PatchChange
Definition:
patch_change.h:40
PatchChange::patch
ARDOUR::MidiModel::PatchChangePtr patch() const
Definition:
patch_change.h:66
PatchChange::_info
ARDOUR::InstrumentInfo & _info
Definition:
patch_change.h:74
PatchChange::~PatchChange
~PatchChange()
PatchChange::canvas_item
ArdourCanvas::Item * canvas_item() const
Definition:
patch_change.h:67
PatchChange::hide
void hide()
PatchChange::PatchChange
PatchChange(MidiView ®ion, ArdourCanvas::Item *parent, double height, double x, double y, ARDOUR::InstrumentInfo &info, ARDOUR::MidiModel::PatchChangePtr patch, Gtkmm2ext::Color outline_color, Gtkmm2ext::Color fill_color)
PatchChange::item
ArdourCanvas::Item & item() const
Definition:
patch_change.h:68
PatchChange::show
void show()
PatchChange::on_patch_menu_selected
void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey &key)
PatchChange::update_name
void update_name()
PatchChange::_patch
ARDOUR::MidiModel::PatchChangePtr _patch
Definition:
patch_change.h:75
PatchChange::_flag
ArdourCanvas::Flag * _flag
Definition:
patch_change.h:78
PatchChange::initialize_popup_menus
void initialize_popup_menus()
PatchChange::_region
MidiView & _region
Definition:
patch_change.h:73
PatchChange::_popup_initialized
bool _popup_initialized
Definition:
patch_change.h:77
PatchChange::move
void move(ArdourCanvas::Duple)
PatchChange::_popup
Gtk::Menu _popup
Definition:
patch_change.h:76
PatchChange::width
double width() const
Definition:
patch_change.h:65
PatchChange::set_height
void set_height(ArdourCanvas::Distance)
PatchChange::event_handler
bool event_handler(GdkEvent *)
flag.h
midi_view.h
ARDOUR::Properties::region
PBD::PropertyDescriptor< bool > region
ArdourCanvas::Distance
double Distance
Definition:
canvas/canvas/types.h:44
Gtkmm2ext::Color
uint32_t Color
Definition:
colors.h:33
MIDI
Definition:
midi_region_view.h:50
PBD::info
Transmitter info
patch_change_dialog.h
ArdourCanvas::Duple
Definition:
canvas/canvas/types.h:65
MIDI::Name::PatchPrimaryKey
Definition:
midnam_patch.h:47
menu.h
_GdkEvent
Definition:
gdkevents.h:517
height
gint height
Definition:
xcursors.h:1
gtk2_ardour
patch_change.h
Generated on Wed Dec 25 2024 05:44:44 for Ardour by
1.9.1