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>
39 #include "ardour_dialog.h"
41 #include <pbd/lockmonitor.h>
48 class ConnectionEditor : public ArdourDialog {
53 void set_session (ARDOUR::Session *);
56 bool on_map (GdkEventAny *);
59 ARDOUR::Connection *current_connection;
63 Gtk::TreeView input_connection_display;
64 Gtk::TreeView output_connection_display;
65 Gtk::ScrolledWindow input_scroller;
66 Gtk::ScrolledWindow output_scroller;
68 Gtk::Frame input_frame;
69 Gtk::Frame output_frame;
72 Gtk::VBox connection_box;
79 Gtk::VBox port_and_selector_box;
82 Gtk::Button new_input_connection_button;
83 Gtk::Button new_output_connection_button;
84 Gtk::Button delete_connection_button;
86 /* client/port selection */
88 Gtk::Notebook notebook;
89 Gtk::Button clear_client_button;
90 Gtk::Frame selector_frame;
91 Gtk::VBox selector_box;
92 Gtk::HBox selector_button_box;
94 /* connection displays */
97 Gtk::HBox port_button_box;
98 Gtk::VBox port_and_button_box;
99 Gtk::Frame port_frame;
100 Gtk::Button clear_button;
101 Gtk::Button add_port_button;
103 PBD::Lock port_display_lock;
104 slist<Gtk::ScrolledWindow *> port_displays;
106 Gtk::Button ok_button;
107 Gtk::Button cancel_button;
108 Gtk::Button rescan_button;
110 Gtk::Frame button_frame;
111 Gtk::HBox button_box;
113 void new_connection (bool for_input);
114 void delete_connection ();
116 void display_ports ();
117 void display_connection_state (bool for_input);
119 void add_connection (ARDOUR::Connection *);
120 void add_connection_and_select (ARDOUR::Connection *);
121 void proxy_add_connection_and_select (ARDOUR::Connection *);
122 void proxy_remove_connection (ARDOUR::Connection *);
123 void remove_connection (ARDOUR::Connection *);
124 void refill_connection_display ();
131 void port_selection_handler (gint row, gint col, GdkEvent*, Gtk::TreeView*);
134 void remove_port (int which_port);
136 void port_column_click (gint col, Gtk::TreeView* );
137 gint port_button_event (GdkEventButton *, Gtk::TreeView*);
138 gint connection_click (GdkEventButton *ev, Gtk::TreeView*);
139 void connection_selected (gint, gint, GdkEvent *, bool);
141 sigc::connection config_connection;
142 sigc::connection connect_connection;
143 void configuration_changed (bool);
144 void connections_changed (int, bool);
147 #endif /* __ardour_gtk_connection_editor_h__ */