Ardour  8.7-14-g57a6773833
cues.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2017 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __ardour_push2_clip_view_h__
20 #define __ardour_push2_clip_view_h__
21 
22 #include <vector>
23 
24 #include "ardour/triggerbox.h"
25 
26 #include "layout.h"
27 #include "push2.h"
28 
29 namespace ARDOUR {
30  class Route;
31  class AutomationControl;
32 }
33 
34 namespace ArdourCanvas {
35  struct Rect;
36 
37  class Rectangle;
38  class Text;
39  class Line;
40  class Arc;
41  class FollowActionIcon;
42 }
43 
44 namespace ArdourSurface {
45 
46 class Push2Knob;
47 class LevelMeter;
48 
49 class CueLayout : public Push2Layout
50 {
51  public:
52  /* Possible knob functions */
53  enum KnobFunction {
58  };
59 
60  CueLayout (Push2& p, ARDOUR::Session&, std::string const &);
62 
63  void render (ArdourCanvas::Rect const &, Cairo::RefPtr<Cairo::Context>) const;
64 
65  void show ();
66  void hide ();
67  void button_upper (uint32_t n);
68  void button_lower (uint32_t n);
69  void button_left ();
70  void button_right ();
71  void button_up();
72  void button_down ();
73  void button_rhs (int);
81 
82  void strip_vpot (int, int);
83  void strip_vpot_touch (int, bool);
84 
85  void pad_press (int x, int y, int velocity);
86  void pad_release (int x, int y);
87 
88  /* override to use for clip progress */
89  void update_meters();
90 
91  private:
94  std::vector<ArdourCanvas::Text*> _upper_text;
95  std::vector<ArdourCanvas::Rectangle*> _upper_backgrounds;
96  std::vector<ArdourCanvas::Text*> _lower_text;
97  std::vector<ArdourCanvas::Text*> _clip_label_text;
99  uint32_t track_base;
100  uint32_t scene_base;
103 
105  std::shared_ptr<ARDOUR::Route> _route[8];
108 
109  void routes_added ();
110  void route_property_change (PBD::PropertyChange const& what_changed, uint32_t which);
111  void triggerbox_property_change (PBD::PropertyChange const& what_changed, uint32_t which);
112  void trigger_property_change (PBD::PropertyChange const& what_changed, uint32_t col, uint32_t row);
113 
116 
117  std::shared_ptr<ARDOUR::AutomationControl> _controllables[8];
118 
120 
123  void set_pad_color_from_trigger_state (int col, std::shared_ptr<Push2::Pad>, ARDOUR::TriggerPtr);
124  void show_running_boxen (bool);
125  void draw_follow_icon (ARDOUR::TriggerPtr, Cairo::RefPtr<Cairo::Context> context, ARDOUR::FollowAction const & icon, float size) const;
126 };
127 
128 } /* namespace */
129 
130 #endif /* __ardour_push2_clip_view_h__ */
std::shared_ptr< ARDOUR::AutomationControl > _controllables[8]
Definition: cues.h:117
uint32_t scene_base
Definition: cues.h:100
void draw_follow_icon(ARDOUR::TriggerPtr, Cairo::RefPtr< Cairo::Context > context, ARDOUR::FollowAction const &icon, float size) const
CueLayout(Push2 &p, ARDOUR::Session &, std::string const &)
void button_upper(uint32_t n)
void triggerbox_property_change(PBD::PropertyChange const &what_changed, uint32_t which)
void trigger_property_change(PBD::PropertyChange const &what_changed, uint32_t col, uint32_t row)
std::shared_ptr< ARDOUR::Route > _route[8]
Definition: cues.h:105
void pad_release(int x, int y)
void strip_vpot_touch(int, bool)
PBD::ScopedConnectionList _route_connections
Definition: cues.h:104
void route_property_change(PBD::PropertyChange const &what_changed, uint32_t which)
ArdourCanvas::Arc * _progress[8]
Definition: cues.h:114
void button_lower(uint32_t n)
KnobFunction _knob_function
Definition: cues.h:101
ArdourCanvas::FollowActionIcon * follow_action_icon[8]
Definition: cues.h:115
PBD::ScopedConnection _trig_connections[64]
Definition: cues.h:107
void render(ArdourCanvas::Rect const &, Cairo::RefPtr< Cairo::Context >) const
ArdourCanvas::Line * _upper_line
Definition: cues.h:93
std::vector< ArdourCanvas::Rectangle * > _upper_backgrounds
Definition: cues.h:95
uint32_t track_base
Definition: cues.h:99
ArdourCanvas::Rectangle * _bg
Definition: cues.h:92
void strip_vpot(int, int)
std::vector< ArdourCanvas::Text * > _clip_label_text
Definition: cues.h:97
std::vector< ArdourCanvas::Text * > _lower_text
Definition: cues.h:96
uint8_t _selection_color
Definition: cues.h:98
void set_pad_color_from_trigger_state(int col, std::shared_ptr< Push2::Pad >, ARDOUR::TriggerPtr)
PBD::ScopedConnectionList _session_connections
Definition: cues.h:106
void pad_press(int x, int y, int velocity)
std::vector< ArdourCanvas::Text * > _upper_text
Definition: cues.h:94
std::shared_ptr< Trigger > TriggerPtr
Definition: triggerbox.h:80