2 Copyright (C) 2002 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__
25 using __gnu_cxx::slist
;
32 #include <glibmm/thread.h>
34 #include <gtkmm/box.h>
35 #include <gtkmm/frame.h>
36 #include <gtkmm/button.h>
37 #include <gtkmm/scrolledwindow.h>
38 #include <gtkmm/notebook.h>
39 #include <gtkmm/treeview.h>
40 #include <gtkmm/liststore.h>
42 #include <ardour_dialog.h>
53 class IOSelector
: public Gtk::VBox
{
55 IOSelector (ARDOUR::Session
&, boost::shared_ptr
<ARDOUR::IO
>, bool for_input
);
65 sigc::signal
<void,Result
> Finished
;
68 ARDOUR::Session
& session
;
71 boost::shared_ptr
<ARDOUR::IO
> io
;
73 ARDOUR::Port
*selected_port
;
74 sigc::connection page_selection_connection
;
77 Gtk::HBox port_and_selector_box
;
81 struct PortDisplayModelColumns
: public Gtk::TreeModel::ColumnRecord
{
83 PortDisplayModelColumns() {
88 Gtk::TreeModelColumn
<Glib::ustring
> displayed_name
;
89 Gtk::TreeModelColumn
<Glib::ustring
> full_name
;
92 PortDisplayModelColumns port_display_columns
;
94 /* client/port selection */
96 Gtk::Notebook notebook
;
97 Gtk::Frame selector_frame
;
98 Gtk::VBox selector_box
;
99 Gtk::HBox selector_button_box
;
104 Gtk::HBox port_button_box
;
105 Gtk::VBox port_and_button_box
;
106 Gtk::Frame port_frame
;
107 Gtk::Button add_port_button
;
108 Gtk::Button remove_port_button
;
109 Gtk::Button clear_connections_button
;
110 Gtk::ScrolledWindow port_display_scroller
;
112 Glib::Mutex port_display_lock
;
113 slist
<Gtk::TreeView
*> port_displays
;
114 void display_ports ();
117 void clear_connections ();
119 bool port_selection_changed(GdkEventButton
*, Gtk::TreeView
*);
121 void ports_changed (ARDOUR::IOChange
, void *);
122 void name_changed (void*);
126 void set_button_sensitivity ();
128 gint
connection_button_release (GdkEventButton
*, Gtk::TreeView
*);
130 void select_treeview(Gtk::TreeView
*);
131 void select_next_treeview ();
134 class IOSelectorWindow
: public ArdourDialog
137 IOSelectorWindow (ARDOUR::Session
&, boost::shared_ptr
<ARDOUR::IO
>, bool for_input
, bool can_cancel
=false);
138 ~IOSelectorWindow ();
140 IOSelector
& selector() { return _selector
; }
146 IOSelector _selector
;
148 /* overall operation buttons */
150 Gtk::Button ok_button
;
151 Gtk::Button cancel_button
;
152 Gtk::Button rescan_button
;
153 Gtk::HBox button_box
;
161 class PortInsertUI
: public Gtk::VBox
164 PortInsertUI (ARDOUR::Session
&, boost::shared_ptr
<ARDOUR::PortInsert
>);
167 void finished (IOSelector::Result
);
172 IOSelector input_selector
;
173 IOSelector output_selector
;
177 class PortInsertWindow
: public ArdourDialog
180 PortInsertWindow (ARDOUR::Session
&, boost::shared_ptr
<ARDOUR::PortInsert
>, bool can_cancel
=false);
187 PortInsertUI _portinsertui
;
190 Gtk::Button ok_button
;
191 Gtk::Button cancel_button
;
192 Gtk::Button rescan_button
;
193 Gtk::Frame button_frame
;
194 Gtk::HBox button_box
;
200 void plugin_going_away ();
201 sigc::connection going_away_connection
;
205 #endif /* __ardour_ui_io_selector_h__ */