a slew of unconnected mostly minor tweaks to get Push2 support back to where it was...
[ardour.git] / libs / surfaces / push2 / mix.h
1 /*
2     Copyright (C) 2016 Paul Davis
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
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #ifndef __ardour_push2_mix_layout_h__
20 #define __ardour_push2_mix_layout_h__
21
22 #include "layout.h"
23 #include "push2.h"
24
25 namespace ARDOUR {
26         class Stripable;
27 }
28
29 namespace ArdourCanvas {
30         class Rectangle;
31         class Text;
32 }
33
34 namespace ArdourSurface {
35
36 class Push2Knob;
37
38 class MixLayout : public Push2Layout
39 {
40    public:
41         MixLayout (Push2& p, ARDOUR::Session&);
42         ~MixLayout ();
43
44         void render (ArdourCanvas::Rect const &, Cairo::RefPtr<Cairo::Context>) const;
45         void show ();
46
47         void button_upper (uint32_t n);
48         void button_lower (uint32_t n);
49         void button_left ();
50         void button_right ();
51         void button_select_press ();
52         void button_select_release ();
53         void button_solo ();
54         void button_mute ();
55
56         void strip_vpot (int, int);
57         void strip_vpot_touch (int, bool);
58
59   private:
60         std::vector<ArdourCanvas::Text*> upper_text;
61         std::vector<ArdourCanvas::Text*> lower_text;
62         std::vector<ArdourCanvas::Rectangle*> backgrounds;
63         ArdourCanvas::Rectangle* selection_bg;
64         Push2Knob* knobs[8];
65
66         /* stripables */
67
68         int32_t bank_start;
69         PBD::ScopedConnectionList stripable_connections;
70         boost::shared_ptr<ARDOUR::Stripable> stripable[8];
71
72         PBD::ScopedConnectionList session_connections;
73         void stripables_added ();
74
75         void stripable_property_change (PBD::PropertyChange const& what_changed, uint32_t which);
76
77         void switch_bank (uint32_t base);
78
79         enum VPotMode {
80                 Volume,
81                 PanAzimuth,
82                 PanWidth,
83                 Send1, Send2, Send3, Send4, Send5
84         };
85
86         Push2::Button* mode_button;
87         VPotMode vpot_mode;
88         void show_vpot_mode ();
89
90         void solo_changed (uint32_t n);
91         void mute_changed (uint32_t n);
92         void solo_mute_changed (uint32_t n);
93         void show_selection (uint32_t n);
94         void hide_selection (uint32_t n);
95 };
96
97 } /* namespace */
98
99 #endif /* __ardour_push2_layout_h__ */