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 *);
57 bool on_map (GdkEventAny *);
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 input_connection_columns;
75 ConnectionDisplayModelColumns output_connection_columns;
77 Glib::RefPtr<Gtk::ListStore> input_connection_model;
78 Glib::RefPtr<Gtk::ListStore> output_connection_model;
80 Gtk::TreeView input_connection_display;
81 Gtk::TreeView output_connection_display;
82 Gtk::ScrolledWindow input_scroller;
83 Gtk::ScrolledWindow output_scroller;
85 Gtk::Frame input_frame;
86 Gtk::Frame output_frame;
89 Gtk::VBox connection_box;
96 Gtk::VBox port_and_selector_box;
99 Gtk::Button new_input_connection_button;
100 Gtk::Button new_output_connection_button;
101 Gtk::Button delete_connection_button;
103 /* client/port selection */
105 Gtk::Notebook notebook;
106 Gtk::Button clear_client_button;
107 Gtk::Frame selector_frame;
108 Gtk::VBox selector_box;
109 Gtk::HBox selector_button_box;
111 /* connection displays */
114 Gtk::HBox port_button_box;
115 Gtk::VBox port_and_button_box;
116 Gtk::Frame port_frame;
117 Gtk::Button clear_button;
118 Gtk::Button add_port_button;
120 PBD::Lock port_display_lock;
121 slist<Gtk::ScrolledWindow *> port_displays;
123 Gtk::Button ok_button;
124 Gtk::Button cancel_button;
125 Gtk::Button rescan_button;
127 Gtk::Frame button_frame;
128 Gtk::HBox button_box;
130 void new_connection (bool for_input);
131 void delete_connection ();
133 void display_ports ();
134 void display_connection_state (bool for_input);
136 void add_connection (ARDOUR::Connection *);
137 void add_connection_and_select (ARDOUR::Connection *);
138 void proxy_add_connection_and_select (ARDOUR::Connection *);
139 void proxy_remove_connection (ARDOUR::Connection *);
140 void remove_connection (ARDOUR::Connection *);
141 void refill_connection_display ();
148 void port_selection_handler (gint row, gint col, GdkEvent*, Gtk::TreeView*);
151 void remove_port (int which_port);
153 void port_column_click (gint col, Gtk::TreeView* );
154 gint port_button_event (GdkEventButton *, Gtk::TreeView*);
155 gint connection_click (GdkEventButton *ev, Gtk::TreeView*);
156 void connection_selection_changed (Gtk::TreeView&, Glib::RefPtr<Gtk::ListStore>&);
158 sigc::connection config_connection;
159 sigc::connection connect_connection;
160 void configuration_changed (bool);
161 void connections_changed (int, bool);
164 #endif /* __ardour_gtk_connection_editor_h__ */