Ardour  9.0-pre0-582-g084a23a80d
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 #include <gtkmm/menu.h>
26 
27 #include "pbd/properties.h"
28 
29 #include "ardour/triggerbox.h"
30 
31 #include "canvas/canvas.h"
32 #include "canvas/rectangle.h"
33 
34 #include "fitted_canvas_widget.h"
35 
36 typedef std::list<ARDOUR::TriggerPtr > TriggerList;
37 
38 namespace ArdourCanvas
39 {
40  class Text;
41  class Polygon;
42  class Circle;
43 }
44 
45 class CueEntry : public ArdourCanvas::Rectangle, public sigc::trackable
46 {
47 public:
48  CueEntry (ArdourCanvas::Item* item, uint64_t cue_index);
50 
53 
54  void render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const;
55 
58 
59 private:
61  void ui_parameter_changed (std::string const& p);
63 
65 
67 
68  uint64_t _cue_idx;
69  double _poly_size;
70  double _poly_margin;
71  bool _grabbed;
72 };
73 
75 {
76 public:
79 
80  void trigger_cue_row (uint64_t n);
81 
83 
84 private:
85  bool event (GdkEvent*, uint64_t);
86  bool text_event (GdkEvent*, uint64_t);
87  void build ();
88 
89  void context_menu (uint64_t idx);
90  void get_slots (TriggerList &triggerlist, uint64_t idx);
91 
92  void clear_all_triggers(uint64_t idx);
93  void set_all_colors (uint64_t idx);
94  void set_all_follow_action (ARDOUR::FollowAction const &, uint64_t idx);
96  void set_all_quantization (Temporal::BBT_Offset const&, uint64_t idx);
97 
100 
101  typedef std::vector<ArdourCanvas::Rectangle*> Slots;
102 
104 };
105 
107 {
108 public:
109  CueBoxWidget (float w, float h);
110 
113  if (s) {
114  ui->set_session(s);
115  }
116  }
117 
118  void on_map ();
119  void on_unmap ();
120 
121 private:
123 };
124 
125 /* XXX probably for testing only */
126 
127 class CueBoxWindow : public Gtk::Window
128 {
129 public:
131 
134 };
135 
136 #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:98
Gtk::ColorSelectionDialog _color_dialog
Definition: cuebox_ui.h:99
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:103
bool event(GdkEvent *, uint64_t)
void context_menu(uint64_t idx)
std::vector< ArdourCanvas::Rectangle * > Slots
Definition: cuebox_ui.h:101
void set_session(ARDOUR::Session *s)
Definition: cuebox_ui.h:111
CueBoxWidget(float w, float h)
void on_unmap()
This is a default handler for the signal signal_unmap().
CueBoxUI * ui
Definition: cuebox_ui.h:122
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:66
double _poly_size
Definition: cuebox_ui.h:69
ArdourCanvas::Circle * name_button
Definition: cuebox_ui.h:51
void set_default_colors()
CueEntry(ArdourCanvas::Item *item, uint64_t cue_index)
uint64_t _cue_idx
Definition: cuebox_ui.h:68
void _size_allocate(ArdourCanvas::Rect const &)
void shape_play_button()
double _poly_margin
Definition: cuebox_ui.h:70
bool event_handler(GdkEvent *)
void render(ArdourCanvas::Rect const &area, Cairo::RefPtr< Cairo::Context > context) const
ArdourCanvas::Text * jump_text
Definition: cuebox_ui.h:52
void rec_state_changed()
bool _grabbed
Definition: cuebox_ui.h:71
void ui_parameter_changed(std::string const &p)
std::list< ARDOUR::TriggerPtr > TriggerList
Definition: cuebox_ui.h:36
void set_session(lua_State *L, Session *s)