remove Id: lines from many/all headers and some more source files
[ardour.git] / gtk2_ardour / route_params_ui.h
1 /*
2     Copyright (C) 2000 Paul Davis 
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __ardour_route_params_ui_h__
21 #define __ardour_route_params_ui_h__
22
23 #include <list>
24
25 #include <gtkmm/box.h>
26 #include <gtkmm/button.h>
27 #include <gtkmm/eventbox.h>
28 #include <gtkmm/frame.h>
29 #include <gtkmm/label.h>
30 #include <gtkmm/paned.h>
31 #include <gtkmm/scrolledwindow.h>
32 #include <gtkmm/togglebutton.h>
33 #include <gtkmm/treeview.h>
34
35 #include <pbd/stateful.h>
36
37 #include <ardour/ardour.h>
38 #include <ardour/io.h>
39 #include <ardour/redirect.h>
40
41 #include "io_selector.h"
42 #include "ardour_dialog.h"
43 #include "redirect_box.h"
44 #include "route_redirect_selection.h"
45
46 namespace ARDOUR {
47         class Route;
48         class Send;
49         class Insert;
50         class Session;
51         class PortInsert;
52         class Connection;
53         class Plugin;
54 }
55
56 class PluginSelector;
57
58 class RouteParams_UI : public ArdourDialog
59 {
60   public:
61         RouteParams_UI (ARDOUR::AudioEngine&);
62         ~RouteParams_UI();
63
64         void set_session (ARDOUR::Session *);
65         void session_gone ();
66         PluginSelector&  plugin_selector() { return *_plugin_selector; }
67
68   private:
69         ARDOUR::AudioEngine&     engine;
70
71         Gtk::HBox                global_hpacker;
72         Gtk::VBox                global_vpacker;
73         Gtk::ScrolledWindow      scroller;
74         Gtk::EventBox            scroller_base;
75         Gtk::HBox                scroller_hpacker;
76         Gtk::VBox                mixer_scroller_vpacker;
77
78         Gtk::VBox                list_vpacker;
79         Gtk::Label               route_list_button_label;
80         Gtk::Button              route_list_button;
81         Gtk::ScrolledWindow      route_select_scroller;
82
83         Gtk::Notebook            notebook;
84         Gtk::Frame               input_frame;
85         Gtk::Frame               output_frame;
86         Gtk::HPaned              pre_redir_hpane;
87         Gtk::HPaned              post_redir_hpane;
88         
89         Gtk::Frame               route_select_frame;
90
91         Gtk::HBox                route_hpacker;
92         Gtk::VBox                route_vpacker;
93
94         RedirectBox              * pre_redirect_box;
95         RedirectBox              * post_redirect_box;
96         
97         Gtk::HPaned              list_hpane;
98
99         Gtk::HPaned              right_hpane;
100         
101         Gtk::Frame               route_choice_frame;
102
103         Gtk::Frame               route_param_frame;
104
105         Gtk::VBox                choice_vpacker;
106         
107
108         Gtk::ToggleButton input_button;
109         Gtk::ToggleButton output_button;
110         Gtk::Label  track_input_label;
111         
112         Gtk::Label  title_label;
113         
114         Gtk::Container * _active_pre_view;
115         Gtk::Container * _active_post_view;
116         IOSelector     * _input_iosel;
117         IOSelector     * _output_iosel;
118         
119         PluginSelector    *_plugin_selector;
120         RouteRedirectSelection  _rr_selection;
121
122         boost::shared_ptr<ARDOUR::Route> _route;
123         sigc::connection            _route_conn;
124         sigc::connection            _route_ds_conn;
125
126         boost::shared_ptr<ARDOUR::Redirect> _pre_redirect;
127         sigc::connection            _pre_plugin_conn;
128
129         boost::shared_ptr<ARDOUR::Redirect> _post_redirect;
130         sigc::connection            _post_plugin_conn;
131         
132         
133         enum ConfigView {
134                 NO_CONFIG_VIEW = 0,
135                 INPUT_CONFIG_VIEW,
136                 OUTPUT_CONFIG_VIEW,
137                 PLUGIN_CONFIG_VIEW,             
138                 PORTINSERT_CONFIG_VIEW,
139                 SEND_CONFIG_VIEW
140         };
141         
142         ConfigView _current_view;
143
144
145         /* treeview */
146         struct RouteDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
147                 RouteDisplayModelColumns() {
148                         add(text);
149                         add(route);
150                 }
151                 Gtk::TreeModelColumn<Glib::ustring> text;
152                 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
153         };
154
155         RouteDisplayModelColumns route_display_columns ;
156         Gtk::TreeView route_display;
157         Glib::RefPtr<Gtk::ListStore> route_display_model;
158
159         
160         void add_routes (ARDOUR::Session::RouteList&);
161
162         void route_name_changed (void *src, boost::shared_ptr<ARDOUR::Route> route);
163         void route_removed (boost::shared_ptr<ARDOUR::Route> route);
164
165
166         void route_selected();
167         //void route_unselected (gint row, gint col, GdkEvent *ev);
168
169         void setup_io_frames();
170         void cleanup_io_frames();
171         void cleanup_pre_view(bool stopupdate = true);
172         void cleanup_post_view(bool stopupdate = true);
173
174         
175         
176         void redirects_changed (void *src);
177         
178         void setup_redirect_boxes();
179         void cleanup_redirect_boxes();
180
181         void redirect_selected (boost::shared_ptr<ARDOUR::Redirect>, ARDOUR::Placement);
182         
183         void plugin_going_away (ARDOUR::Placement);
184         void redirect_going_away (boost::shared_ptr<ARDOUR::Redirect>);
185
186         gint edit_input_configuration (GdkEventButton *ev);
187         gint edit_output_configuration (GdkEventButton *ev);
188         
189         void update_routeinfo (ARDOUR::Route * route);
190         
191         Gtk::Menu *track_menu;
192         void show_track_menu();
193         
194         void update_title ();
195         //void unselect_all_redirects ();
196
197         sigc::connection update_connection;
198         void update_views ();
199
200         void start_updating ();
201         void stop_updating ();
202 };
203
204
205 #endif /* __ardour_route_params_ui_h__ */