allow sending OSC from inline display UIs
[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 #include "pbd/properties.h"
31
32 #include "ardour/session_handle.h"
33
34 #include "ardour_button.h"
35
36 namespace ARDOUR {
37         class VCA;
38         class Stripable;
39         class Session;
40 }
41
42 class ControlSlaveUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
43 {
44    public:
45         ControlSlaveUI (ARDOUR::Session*);
46         void set_stripable (boost::shared_ptr<ARDOUR::Stripable>);
47
48    private:
49         boost::shared_ptr<ARDOUR::Stripable> stripable;
50         PBD::ScopedConnectionList connections;
51         PBD::ScopedConnectionList master_connections;
52         ArdourButton  initial_button;
53
54         void master_property_changed (PBD::PropertyChange const &);
55         void update_vca_display ();
56         void vca_menu_toggle (Gtk::CheckMenuItem*, uint32_t n);
57         bool specific_vca_button_release (GdkEventButton* ev, uint32_t n);
58         bool vca_event_box_release (GdkEventButton* ev);
59         bool vca_button_release (GdkEventButton* ev, uint32_t n);
60         void add_vca_button (boost::shared_ptr<ARDOUR::VCA>);
61         void unassign_all ();
62 };
63
64 #endif /* __gtk2_ardour_control_slave_ui_h__ */