* MIDI control lanes: Set Interpolationtype according to Parameter
[ardour.git] / gtk2_ardour / io_selector.h
1 /*
2     Copyright (C) 2002-2007 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
20 #ifndef __ardour_ui_io_selector_h__
21 #define __ardour_ui_io_selector_h__
22
23 #include "ardour_dialog.h"
24 #include "port_matrix.h"
25
26 namespace ARDOUR {
27         class PortInsert;
28 }
29
30 class IOSelector : public PortMatrix {
31   public:
32         IOSelector (ARDOUR::Session&, boost::shared_ptr<ARDOUR::IO>, bool);
33         ~IOSelector ();
34
35         void set_state (
36                 boost::shared_ptr<ARDOUR::Bundle>,
37                 uint32_t,
38                 boost::shared_ptr<ARDOUR::Bundle>,
39                 uint32_t,
40                 bool,
41                 uint32_t
42                 );
43         
44         State get_state (
45                 boost::shared_ptr<ARDOUR::Bundle>,
46                 uint32_t,
47                 boost::shared_ptr<ARDOUR::Bundle>,
48                 uint32_t
49                 ) const;
50
51         void add_channel (boost::shared_ptr<ARDOUR::Bundle>);
52         void remove_channel (boost::shared_ptr<ARDOUR::Bundle>, uint32_t);
53         bool can_rename_channels () const {
54                 return false;
55         }
56         
57         uint32_t n_rows () const;
58         uint32_t maximum_rows () const;
59         uint32_t minimum_rows () const;
60         boost::shared_ptr<ARDOUR::IO> const io () { return _io; }
61         void setup ();
62
63   private:
64         ARDOUR::Session& _session;
65         boost::shared_ptr<ARDOUR::IO> _io;
66         PortGroup* _port_group;
67         
68         void ports_changed ();
69 };
70
71 class IOSelectorWindow : public ArdourDialog
72 {
73   public:
74         IOSelectorWindow (ARDOUR::Session&, boost::shared_ptr<ARDOUR::IO>, bool for_input, bool can_cancel = false);
75
76         IOSelector& selector() { return _selector; }
77
78   protected:
79         void on_map ();
80         
81   private:
82         IOSelector _selector;
83
84         /* overall operation buttons */
85
86         Gtk::Button add_button;
87         Gtk::Button disconnect_button;
88         Gtk::Button ok_button;
89         Gtk::Button cancel_button;
90         Gtk::Button rescan_button;
91
92         void cancel ();
93         void accept ();
94
95         void ports_changed ();
96         void io_name_changed (void *src);
97 };
98
99
100 class PortInsertUI : public Gtk::VBox
101 {
102   public: 
103         PortInsertUI (ARDOUR::Session&, boost::shared_ptr<ARDOUR::PortInsert>);
104         
105         void redisplay ();
106         void finished (IOSelector::Result);
107
108   private:
109         IOSelector input_selector;
110         IOSelector output_selector;
111 };
112
113 class PortInsertWindow : public ArdourDialog
114 {
115   public: 
116         PortInsertWindow (ARDOUR::Session&, boost::shared_ptr<ARDOUR::PortInsert>, bool can_cancel = false);
117         
118   protected:
119         void on_map ();
120         
121   private:
122         PortInsertUI _portinsertui;
123         Gtk::VBox vbox;
124         
125         Gtk::Button ok_button;
126         Gtk::Button cancel_button;
127         Gtk::Button rescan_button;
128         Gtk::Frame button_frame;
129         
130         void cancel ();
131         void accept ();
132
133         void plugin_going_away ();
134         sigc::connection going_away_connection;
135 };
136
137
138 #endif