2 Copyright (C) 2002-2007 Paul Davis
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.
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.
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.
20 #ifndef __ardour_ui_io_selector_h__
21 #define __ardour_ui_io_selector_h__
23 #include "ardour_dialog.h"
24 #include "port_matrix.h"
30 class IOSelector : public PortMatrix
33 IOSelector (ARDOUR::Session&, boost::shared_ptr<ARDOUR::IO>);
35 void set_state (ARDOUR::BundleChannel c[2], bool);
36 PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
38 void add_channel (boost::shared_ptr<ARDOUR::Bundle>);
39 bool can_remove_channels (int d) const {
42 void remove_channel (ARDOUR::BundleChannel);
43 bool can_rename_channels (int d) const {
47 uint32_t n_io_ports () const;
48 boost::shared_ptr<ARDOUR::IO> const io () { return _io; }
49 void setup_ports (int);
50 bool list_is_global (int) const;
52 bool find_inputs_for_io_outputs () const {
53 return _find_inputs_for_io_outputs;
69 boost::shared_ptr<ARDOUR::IO> _io;
70 boost::shared_ptr<PortGroup> _port_group;
71 bool _find_inputs_for_io_outputs;
74 class IOSelectorWindow : public ArdourDialog
77 IOSelectorWindow (ARDOUR::Session&, boost::shared_ptr<ARDOUR::IO>, bool can_cancel = false);
79 IOSelector& selector() { return _selector; }
87 /* overall operation buttons */
89 Gtk::Button add_button;
90 Gtk::Button disconnect_button;
91 Gtk::Button ok_button;
92 Gtk::Button cancel_button;
93 Gtk::Button rescan_button;
99 void ports_changed ();
100 void io_name_changed (void *src);
104 class PortInsertUI : public Gtk::VBox
107 PortInsertUI (ARDOUR::Session&, boost::shared_ptr<ARDOUR::PortInsert>);
110 void finished (IOSelector::Result);
113 IOSelector input_selector;
114 IOSelector output_selector;
117 class PortInsertWindow : public ArdourDialog
120 PortInsertWindow (ARDOUR::Session&, boost::shared_ptr<ARDOUR::PortInsert>, bool can_cancel = false);
126 PortInsertUI _portinsertui;
129 Gtk::Button ok_button;
130 Gtk::Button cancel_button;
131 Gtk::Button rescan_button;
132 Gtk::Frame button_frame;
137 void plugin_going_away ();
138 sigc::connection going_away_connection;