Ardour  9.0-pre0-386-g96ef4d20f2
trigger_master.h
Go to the documentation of this file.
1 /*
2  * Author Ben Loftis <ben@harrisonconsoles.com>
3  * Copyright (C) 2021 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 _gtk_ardour_trigger_master_h_
21 #define _gtk_ardour_trigger_master_h_
22 
23 #include <gtkmm/colorselection.h>
24 
25 #include "pbd/properties.h"
26 
27 #include "ardour/triggerbox.h"
28 
29 #include "canvas/canvas.h"
30 #include "canvas/rectangle.h"
31 #include "canvas/table.h"
32 
33 namespace Gtk
34 {
35  class FileChooserDialog;
36  class Menu;
37 }
38 
39 namespace Temporal
40 {
41  struct BBT_Offset;
42 }
43 
44 namespace ArdourCanvas
45 {
46  class Text;
47  class Polygon;
48 }
49 
51 {
52 public:
54 
55  void render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const;
56  void set_fraction (float);
57 
58 private:
59  float _fraction;
60 };
61 
62 class TriggerMaster : public ArdourCanvas::Rectangle, public sigc::trackable
63 {
64 public:
67 
68  void set_triggerbox (std::shared_ptr<ARDOUR::TriggerBox>);
69 
70  void render (ArdourCanvas::Rect const&, Cairo::RefPtr<Cairo::Context>) const;
71 
73 
74  std::string play_text;
75  std::string loop_text;
76 
77  void maybe_update ();
80 
81 private:
82  void context_menu ();
83 
89 
90  void prop_change (PBD::PropertyChange const& change);
92  void ui_parameter_changed (std::string const& p);
95 
96  std::shared_ptr<ARDOUR::TriggerBox> _triggerbox;
97 
99 
103 
104  double _poly_size;
105  double _poly_margin;
106 
109  sigc::connection _update_connection;
110 };
111 
112 typedef std::list<std::shared_ptr<ARDOUR::TriggerBox> > TriggerBoxList;
113 
115 {
116 public:
119 
120  void render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const;
121 
122  void _size_allocate (ArdourCanvas::Rect const& alloc);
123 
125 
126  void maybe_update ();
128 
129 private:
130  void context_menu ();
131 
132  void get_boxen (TriggerBoxList &boxlist);
137 
138  void ui_parameter_changed (std::string const& p);
141 
143 
144  double _poly_size;
145  double _poly_margin;
146 };
147 
148 #endif
Declaration of the main canvas classes.
Canvas * canvas() const
void set_all_launch_style(ARDOUR::Trigger::LaunchStyle)
void _size_allocate(ArdourCanvas::Rect const &alloc)
Gtk::Menu * _context_menu
void clear_all_triggers()
ArdourCanvas::Polygon * stop_shape
void set_all_quantization(Temporal::BBT_Offset const &)
double _poly_size
void ui_parameter_changed(std::string const &p)
void get_boxen(TriggerBoxList &boxlist)
void shape_stop_button()
CueMaster(ArdourCanvas::Item *canvas)
void maybe_update()
bool event_handler(GdkEvent *)
void render(ArdourCanvas::Rect const &area, Cairo::RefPtr< Cairo::Context > context) const
double _poly_margin
void context_menu()
void set_default_colors()
void set_all_follow_action(ARDOUR::FollowAction const &)
Loopster(ArdourCanvas::Item *canvas)
void set_fraction(float)
void render(ArdourCanvas::Rect const &area, Cairo::RefPtr< Cairo::Context > context) const
float _fraction
std::string loop_text
void clear_all_triggers()
void owner_prop_change(PBD::PropertyChange const &)
Gtk::ColorSelectionDialog _color_dialog
void set_triggerbox(std::shared_ptr< ARDOUR::TriggerBox >)
void render(ArdourCanvas::Rect const &, Cairo::RefPtr< Cairo::Context >) const
void ui_parameter_changed(std::string const &p)
void set_default_colors()
void selection_change()
Loopster * _loopster
void context_menu()
void maybe_update()
TriggerMaster(ArdourCanvas::Item *canvas)
void set_all_colors()
std::string play_text
void set_all_quantization(Temporal::BBT_Offset const &)
void _size_allocate(ArdourCanvas::Rect const &)
sigc::connection _update_connection
PBD::ScopedConnection _trigger_prop_connection
bool event_handler(GdkEvent *)
void shape_stop_button()
PBD::ScopedConnection _owner_prop_connection
void set_all_launch_style(ARDOUR::Trigger::LaunchStyle)
Gtk::Menu * _context_menu
std::shared_ptr< ARDOUR::TriggerBox > _triggerbox
void prop_change(PBD::PropertyChange const &change)
void set_all_follow_action(ARDOUR::FollowAction const &)
bool _ignore_menu_action
Definition: ardour_ui.h:187
std::list< std::shared_ptr< ARDOUR::TriggerBox > > TriggerBoxList