Ardour  9.0-pre0-582-g084a23a80d
surfaces/push2/mix.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2018 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_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  class Line;
33 }
34 
35 namespace ArdourSurface {
36 
37 class Push2Knob;
38 class LevelMeter;
39 
40 class MixLayout : public Push2Layout
41 {
42  public:
43  MixLayout (Push2& p, ARDOUR::Session&, std::string const &);
45 
46  void render (ArdourCanvas::Rect const &, Cairo::RefPtr<Cairo::Context>) const;
47  void show ();
48 
49  void button_upper (uint32_t n);
50  void button_lower (uint32_t n);
51  void button_down ();
52  void button_up ();
53  void button_left ();
54  void button_right ();
57  void button_solo ();
58  void button_mute ();
59 
60  void strip_vpot (int, int);
61  void strip_vpot_touch (int, bool);
62 
63  void update_meters ();
64 
65  private:
68  std::vector<ArdourCanvas::Text*> _upper_text;
69  std::vector<ArdourCanvas::Text*> _lower_text;
70  std::vector<ArdourCanvas::Rectangle*> _upper_backgrounds;
71  std::vector<ArdourCanvas::Rectangle*> _lower_backgrounds;
72 
75 
78  };
79 
81 
82  /* stripables */
83 
84  int32_t _bank_start;
86  std::shared_ptr<ARDOUR::Stripable> _stripable[8];
88 
90  void stripable_property_change (PBD::PropertyChange const& what_changed, uint32_t which);
91 
92  void switch_bank (uint32_t base);
93 
94  enum VPotMode {
99  };
100 
101  std::shared_ptr<Push2::Button> _mode_button;
103 
104  void show_vpot_mode ();
105 
106  void solo_changed (uint32_t n);
107  void mute_changed (uint32_t n);
108  void solo_mute_changed (uint32_t n);
109  void show_selection (uint32_t n);
110  void hide_selection (uint32_t n);
111 };
112 
113 } /* namespace */
114 
115 #endif /* __ardour_push2_layout_h__ */
ArdourCanvas::Line * _upper_line
std::shared_ptr< ARDOUR::Stripable > _stripable[8]
PBD::ScopedConnectionList _session_connections
void solo_mute_changed(uint32_t n)
std::shared_ptr< Push2::Button > _mode_button
ArdourCanvas::Rectangle * _bg
void strip_vpot(int, int)
std::vector< ArdourCanvas::Rectangle * > _upper_backgrounds
void button_upper(uint32_t n)
PBD::ScopedConnectionList _stripable_connections
void stripable_property_change(PBD::PropertyChange const &what_changed, uint32_t which)
std::vector< ArdourCanvas::Text * > _upper_text
void hide_selection(uint32_t n)
void mute_changed(uint32_t n)
void button_lower(uint32_t n)
MixLayout(Push2 &p, ARDOUR::Session &, std::string const &)
std::vector< ArdourCanvas::Rectangle * > _lower_backgrounds
void show_selection(uint32_t n)
void solo_changed(uint32_t n)
void switch_bank(uint32_t base)
std::vector< ArdourCanvas::Text * > _lower_text
void render(ArdourCanvas::Rect const &, Cairo::RefPtr< Cairo::Context >) const
void strip_vpot_touch(int, bool)
GainMeter(Item *parent, Push2 &)