new files
[ardour.git] / gtk2_ardour / control_slave_ui.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 __gtk2_ardour_control_slave_ui_h__
20 #define __gtk2_ardour_control_slave_ui_h__
21
22 #include <stdint.h>
23
24 #include <boost/shared_ptr.hpp>
25
26 #include <gtkmm/box.h>
27 #include <gtkmm/checkmenuitem.h>
28
29 #include "pbd/signals.h"
30
31 #include "ardour/session_handle.h"
32
33 #include "ardour_button.h"
34
35 namespace ARDOUR {
36         class VCA;
37         class Stripable;
38         class Session;
39 }
40
41 class ControlSlaveUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
42 {
43    public:
44         ControlSlaveUI (ARDOUR::Session*);
45         void set_stripable (boost::shared_ptr<ARDOUR::Stripable>);
46
47    private:
48         boost::shared_ptr<ARDOUR::Stripable> stripable;
49         PBD::ScopedConnectionList connections;
50         ArdourButton  initial_button;
51
52         void update_vca_display ();
53         void vca_menu_toggle (Gtk::CheckMenuItem*, uint32_t n);
54         bool specific_vca_button_release (GdkEventButton* ev, uint32_t n);
55         bool vca_event_box_release (GdkEventButton* ev);
56         bool vca_button_release (GdkEventButton* ev, uint32_t n);
57         void add_vca_button (boost::shared_ptr<ARDOUR::VCA>);
58         void unassign_all ();
59 };
60
61 #endif /* __gtk2_ardour_control_slave_ui_h__ */