Ardour  8.7-15-gadf511264b
cuebox_ui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Paul Davis <paul@linuxaudiosystems.com>
3  * Author: Ben Loftis 2021 <ben@harrisonconsoles.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_cuebox_ui_h_
21 #define _gtk_ardour_cuebox_ui_h_
22 
23 #include <gtkmm/window.h>
24 #include <gtkmm/colorselection.h>
25 
26 #include "pbd/properties.h"
27 
28 #include "ardour/triggerbox.h"
29 
30 #include "canvas/canvas.h"
31 #include "canvas/rectangle.h"
32 
33 #include "fitted_canvas_widget.h"
34 
35 typedef std::list<ARDOUR::TriggerPtr > TriggerList;
36 
37 namespace ArdourCanvas
38 {
39  class Text;
40  class Polygon;
41  class Circle;
42 }
43 
44 class CueEntry : public ArdourCanvas::Rectangle, public sigc::trackable
45 {
46 public:
47  CueEntry (ArdourCanvas::Item* item, uint64_t cue_index);
49 
52 
53  void render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const;
54 
57 
58 private:
60  void ui_parameter_changed (std::string const& p);
62 
64 
66 
67  uint64_t _cue_idx;
68  double _poly_size;
69  double _poly_margin;
70  bool _grabbed;
71 };
72 
74 {
75 public:
78 
79  void trigger_cue_row (uint64_t n);
80 
82 
83 private:
84  bool event (GdkEvent*, uint64_t);
85  bool text_event (GdkEvent*, uint64_t);
86  void build ();
87 
88  void context_menu (uint64_t idx);
89  void get_slots (TriggerList &triggerlist, uint64_t idx);
90 
91  void clear_all_triggers(uint64_t idx);
92  void set_all_colors (uint64_t idx);
93  void set_all_follow_action (ARDOUR::FollowAction const &, uint64_t idx);
95  void set_all_quantization (Temporal::BBT_Offset const&, uint64_t idx);
96 
99 
100  typedef std::vector<ArdourCanvas::Rectangle*> Slots;
101 
103 };
104 
106 {
107 public:
108  CueBoxWidget (float w, float h);
109 
111 
112  void on_map ();
113  void on_unmap ();
114 
115 private:
117 };
118 
119 /* XXX probably for testing only */
120 
121 class CueBoxWindow : public Gtk::Window
122 {
123 public:
125 
128 };
129 
130 #endif
Declaration of the main canvas classes.
virtual void set_session(ARDOUR::Session *)
void _size_allocate(ArdourCanvas::Rect const &)
void get_slots(TriggerList &triggerlist, uint64_t idx)
void trigger_cue_row(uint64_t n)
bool text_event(GdkEvent *, uint64_t)
CueBoxUI(ArdourCanvas::Item *parent)
void set_all_quantization(Temporal::BBT_Offset const &, uint64_t idx)
void set_all_launch_style(ARDOUR::Trigger::LaunchStyle, uint64_t idx)
void set_all_colors(uint64_t idx)
Gtk::Menu * _context_menu
Definition: cuebox_ui.h:97
Gtk::ColorSelectionDialog _color_dialog
Definition: cuebox_ui.h:98
void set_all_follow_action(ARDOUR::FollowAction const &, uint64_t idx)
void build()
void clear_all_triggers(uint64_t idx)
Slots _slots
Definition: cuebox_ui.h:102
bool event(GdkEvent *, uint64_t)
void context_menu(uint64_t idx)
std::vector< ArdourCanvas::Rectangle * > Slots
Definition: cuebox_ui.h:100
void set_session(ARDOUR::Session *s)
Definition: cuebox_ui.h:110
CueBoxWidget(float w, float h)
void on_unmap()
This is a default handler for the signal signal_unmap().
CueBoxUI * ui
Definition: cuebox_ui.h:116
void on_map()
This is a default handler for the signal signal_map().
bool on_key_release_event(GdkEventKey *)
This is a default handler for the signal signal_key_release_event().
bool on_key_press_event(GdkEventKey *)
This is a default handler for the signal signal_key_press_event().
PBD::ScopedConnectionList _session_connections
Definition: cuebox_ui.h:65
double _poly_size
Definition: cuebox_ui.h:68
ArdourCanvas::Circle * name_button
Definition: cuebox_ui.h:50
void set_default_colors()
CueEntry(ArdourCanvas::Item *item, uint64_t cue_index)
uint64_t _cue_idx
Definition: cuebox_ui.h:67
void _size_allocate(ArdourCanvas::Rect const &)
void shape_play_button()
double _poly_margin
Definition: cuebox_ui.h:69
bool event_handler(GdkEvent *)
void render(ArdourCanvas::Rect const &area, Cairo::RefPtr< Cairo::Context > context) const
ArdourCanvas::Text * jump_text
Definition: cuebox_ui.h:51
void rec_state_changed()
bool _grabbed
Definition: cuebox_ui.h:70
void ui_parameter_changed(std::string const &p)
std::list< ARDOUR::TriggerPtr > TriggerList
Definition: cuebox_ui.h:35
void set_session(lua_State *L, Session *s)