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.
21 #ifndef __ardour_gtk_connection_editor_h__
22 #define __ardour_gtk_connection_editor_h__
26 using __gnu_cxx::slist;
31 #include <gtkmm/box.h>
32 #include <gtkmm/window.h>
33 #include <gtkmm/scrolledwindow.h>
34 #include <gtkmm/button.h>
35 #include <gtkmm/frame.h>
36 #include <gtkmm/notebook.h>
37 #include <gtkmm/treeview.h>
38 #include <gtkmm/liststore.h>
40 #include "ardour_dialog.h"
42 #include <pbd/lockmonitor.h>
49 class ConnectionEditor : public ArdourDialog {
54 void set_session (ARDOUR::Session *);
60 ARDOUR::Connection *current_connection;
65 struct ConnectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
66 ConnectionDisplayModelColumns() {
70 Gtk::TreeModelColumn<Glib::ustring> name;
71 Gtk::TreeModelColumn<ARDOUR::Connection*> connection;
74 ConnectionDisplayModelColumns connection_columns;
76 Glib::RefPtr<Gtk::ListStore> input_connection_model;
77 Glib::RefPtr<Gtk::ListStore> output_connection_model;
79 Gtk::TreeView input_connection_display;
80 Gtk::TreeView output_connection_display;
81 Gtk::ScrolledWindow input_scroller;
82 Gtk::ScrolledWindow output_scroller;
84 Gtk::Frame input_frame;
85 Gtk::Frame output_frame;
88 Gtk::VBox connection_box;
95 Gtk::VBox port_and_selector_box;
98 Gtk::Button new_input_connection_button;
99 Gtk::Button new_output_connection_button;
100 Gtk::Button delete_connection_button;
102 /* client/port selection */
104 Gtk::Notebook notebook;
105 Gtk::Button clear_client_button;
106 Gtk::Frame selector_frame;
107 Gtk::VBox selector_box;
108 Gtk::HBox selector_button_box;
110 /* connection displays */
113 Gtk::HBox port_button_box;
114 Gtk::VBox port_and_button_box;
115 Gtk::Frame port_frame;
116 Gtk::Button clear_button;
117 Gtk::Button add_port_button;
119 PBD::Lock port_display_lock;
120 slist<Gtk::ScrolledWindow *> port_displays;
122 Gtk::Button ok_button;
123 Gtk::Button cancel_button;
124 Gtk::Button rescan_button;
126 Gtk::Frame button_frame;
127 Gtk::HBox button_box;
129 void new_connection (bool for_input);
130 void delete_connection ();
132 void display_ports ();
133 void display_connection_state (bool for_input);
135 void add_connection (ARDOUR::Connection *);
136 void add_connection_and_select (ARDOUR::Connection *);
137 void proxy_add_connection_and_select (ARDOUR::Connection *);
138 void proxy_remove_connection (ARDOUR::Connection *);
139 void remove_connection (ARDOUR::Connection *);
140 void refill_connection_display ();
147 void selection_changed (Gtk::TreeView* display);
150 void remove_port (int which_port);
152 void port_column_click (gint col, Gtk::TreeView* );
153 gint port_button_event (GdkEventButton *, Gtk::TreeView*);
154 gint connection_click (GdkEventButton *ev, Gtk::TreeView*);
155 void connection_selection_changed (Gtk::TreeView&, Glib::RefPtr<Gtk::ListStore>&);
157 sigc::connection config_connection;
158 sigc::connection connect_connection;
159 void configuration_changed (bool);
160 void connections_changed (int, bool);
163 #endif /* __ardour_gtk_connection_editor_h__ */