New matrix-based editor for connections and bundles, based on thorwil's design.
[ardour.git] / gtk2_ardour / route_params_ui.cc
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 #include <algorithm>
21 #define __STDC_FORMAT_MACROS
22 #include <inttypes.h>
23
24 #include <glibmm/thread.h>
25 #include <gtkmm2ext/utils.h>
26 #include <gtkmm2ext/stop_signal.h>
27 #include <gtkmm2ext/window_title.h>
28
29 #include <ardour/session.h>
30 #include <ardour/session_route.h>
31 #include <ardour/audio_diskstream.h>
32 #include <ardour/plugin.h>
33 #include <ardour/plugin_manager.h>
34 #include <ardour/ardour.h>
35 #include <ardour/session.h>
36 #include <ardour/route.h>
37 #include <ardour/audio_track.h>
38 #include <ardour/send.h>
39 #include <ardour/plugin_insert.h>
40 #include <ardour/port_insert.h>
41
42 #include "route_params_ui.h"
43 #include "keyboard.h"
44 #include "mixer_strip.h"
45 #include "plugin_selector.h"
46 #include "ardour_ui.h"
47 #include "plugin_ui.h"
48 #include "io_selector.h"
49 #include "send_ui.h"
50 #include "utils.h"
51 #include "gui_thread.h"
52
53 #include "i18n.h"
54
55 using namespace ARDOUR;
56 using namespace PBD;
57 using namespace Gtk;
58 using namespace Gtkmm2ext;
59 using namespace sigc;
60
61 RouteParams_UI::RouteParams_UI ()
62         : ArdourDialog ("track/bus inspector"),
63           latency_apply_button (Stock::APPLY),
64           track_menu(0)
65         
66 {
67         pre_insert_box = 0;
68         post_insert_box = 0;
69         _input_iosel = 0;
70         _output_iosel = 0;
71         _active_pre_view = 0;
72         _active_post_view = 0;
73         latency_widget = 0;
74
75         using namespace Notebook_Helpers;
76
77         input_frame.set_shadow_type(Gtk::SHADOW_NONE);
78         output_frame.set_shadow_type(Gtk::SHADOW_NONE);
79         latency_frame.set_shadow_type (Gtk::SHADOW_NONE);
80
81         notebook.set_show_tabs (true);
82         notebook.set_show_border (true);
83         notebook.set_name ("RouteParamNotebook");
84
85         // create the tree model
86         route_display_model = ListStore::create(route_display_columns);
87
88         // setup the treeview
89         route_display.set_model(route_display_model);
90         route_display.append_column(_("Tracks/Busses"), route_display_columns.text);
91         route_display.set_name(X_("RouteParamsListDisplay"));
92         route_display.get_selection()->set_mode(Gtk::SELECTION_SINGLE); // default
93         route_display.set_reorderable(false);
94         route_display.set_size_request(75, -1);
95         route_display.set_headers_visible(true);
96         route_display.set_headers_clickable(true);
97
98         route_select_scroller.add(route_display);
99         route_select_scroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
100
101         route_select_frame.set_name("RouteSelectBaseFrame");
102         route_select_frame.set_shadow_type (Gtk::SHADOW_IN);
103         route_select_frame.add(route_select_scroller);
104
105         list_vpacker.pack_start (route_select_frame, true, true);
106         
107         notebook.pages().push_back (TabElem (input_frame, _("Inputs")));
108         notebook.pages().push_back (TabElem (output_frame, _("Outputs")));
109         notebook.pages().push_back (TabElem (pre_redir_hpane, _("Pre-fader Redirects")));
110         notebook.pages().push_back (TabElem (post_redir_hpane, _("Post-fader Redirects")));
111         notebook.pages().push_back (TabElem (latency_frame, _("Latency")));
112
113         notebook.set_name ("InspectorNotebook");
114         
115         title_label.set_name ("RouteParamsTitleLabel");
116         update_title();
117         
118         latency_packer.set_spacing (18);
119         latency_button_box.pack_start (latency_apply_button);
120         delay_label.set_alignment (0, 0.5);
121
122         // changeable area
123         route_param_frame.set_name("RouteParamsBaseFrame");
124         route_param_frame.set_shadow_type (Gtk::SHADOW_IN);
125         
126         
127         route_hpacker.pack_start (notebook, true, true);
128         
129         route_vpacker.pack_start (title_label, false, false);
130         route_vpacker.pack_start (route_hpacker, true, true);
131
132         
133         list_hpane.pack1 (list_vpacker);
134         list_hpane.add2 (route_vpacker);
135
136         list_hpane.set_position(110);
137
138         pre_redir_hpane.set_position(110);
139         post_redir_hpane.set_position(110);
140         
141         //global_vpacker.pack_start (list_hpane, true, true);
142         //get_vbox()->pack_start (global_vpacker);
143         get_vbox()->pack_start (list_hpane);
144         
145         
146         set_name ("RouteParamsWindow");
147         set_default_size (620,370);
148         set_wmclass (X_("ardour_route_parameters"), "Ardour");
149
150         WindowTitle title(Glib::get_application_name());
151         title += _("Track/Bus Inspector"); 
152         set_title (title.get_string());
153
154
155         // events
156         route_display.get_selection()->signal_changed().connect(mem_fun(*this, &RouteParams_UI::route_selected));
157         route_display.get_column(0)->signal_clicked().connect(mem_fun(*this, &RouteParams_UI::show_track_menu));
158
159         add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK);
160         
161         _plugin_selector = new PluginSelector (PluginManager::the_manager());
162         _plugin_selector->signal_delete_event().connect (bind (ptr_fun (just_hide_it), 
163                                                      static_cast<Window *> (_plugin_selector)));
164
165
166         signal_delete_event().connect(bind(ptr_fun(just_hide_it), static_cast<Gtk::Window *>(this)));
167 }
168
169 RouteParams_UI::~RouteParams_UI ()
170 {
171 }
172
173 void
174 RouteParams_UI::add_routes (Session::RouteList& routes)
175 {
176         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::add_routes), routes));
177         
178         for (Session::RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
179                 boost::shared_ptr<Route> route = (*x);
180
181                 if (route->is_hidden()) {
182                         return;
183                 }
184                 
185                 TreeModel::Row row = *(route_display_model->append());
186                 row[route_display_columns.text] = route->name();
187                 row[route_display_columns.route] = route;
188                 
189                 //route_select_list.rows().back().select ();
190                 
191                 route->NameChanged.connect (bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route));
192                 route->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
193         }
194 }
195
196
197 void
198 RouteParams_UI::route_name_changed (boost::shared_ptr<Route> route)
199 {
200         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route));
201
202         bool found = false ;
203         TreeModel::Children rows = route_display_model->children();
204         for(TreeModel::Children::iterator iter = rows.begin(); iter != rows.end(); ++iter) {
205                 boost::shared_ptr<Route> r =(*iter)[route_display_columns.route];
206                 if (r == route) {
207                         (*iter)[route_display_columns.text] = route->name() ;
208                         found = true ;
209                         break;
210                 }
211         }
212
213         if(!found) {
214                 error << _("route display list item for renamed route not found!") << endmsg;
215         }
216
217         if (route == _route) {
218                 track_input_label.set_text (route->name());
219                 update_title();
220         }
221 }
222
223 void
224 RouteParams_UI::setup_processor_boxes()
225 {
226         if (session && _route) {
227
228                 // just in case... shouldn't need this
229                 cleanup_processor_boxes();
230                 
231                 // construct new redirect boxes
232                 pre_insert_box = new ProcessorBox(PreFader, *session, *_plugin_selector, _rr_selection);
233                 post_insert_box = new ProcessorBox(PostFader, *session, *_plugin_selector, _rr_selection);
234   
235                 pre_insert_box->set_route (_route);
236                 post_insert_box->set_route (_route);
237
238                 pre_redir_hpane.pack1 (*pre_insert_box);
239                 post_redir_hpane.pack1 (*post_insert_box);
240
241                 pre_insert_box->ProcessorSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader));
242                 pre_insert_box->ProcessorUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader));
243                 post_insert_box->ProcessorSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader));
244                 post_insert_box->ProcessorUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader));
245
246                 pre_redir_hpane.show_all();
247                 post_redir_hpane.show_all();
248         }
249         
250 }
251
252 void
253 RouteParams_UI::cleanup_processor_boxes()
254 {
255         if (pre_insert_box) {
256                 pre_redir_hpane.remove(*pre_insert_box);
257                 delete pre_insert_box;
258                 pre_insert_box = 0;
259         }
260
261         if (post_insert_box) {
262                 post_redir_hpane.remove(*post_insert_box);
263                 delete post_insert_box;
264                 post_insert_box = 0;
265         }
266 }
267
268 void
269 RouteParams_UI::refresh_latency ()
270 {
271         if (latency_widget) {
272                 latency_widget->refresh();
273
274                 char buf[128];
275                 snprintf (buf, sizeof (buf), _("Playback delay: %u samples"), _route->initial_delay());
276                 delay_label.set_text (buf);
277         }
278 }
279
280 void
281 RouteParams_UI::cleanup_latency_frame ()
282 {
283         if (latency_widget) {
284                 latency_frame.remove ();
285                 latency_packer.remove (*latency_widget);
286                 latency_packer.remove (latency_button_box);
287                 latency_packer.remove (delay_label);
288                 delete latency_widget;
289                 latency_widget = 0;
290                 latency_conn.disconnect ();
291                 delay_conn.disconnect ();
292                 latency_apply_conn.disconnect ();
293         }
294 }
295
296 void
297 RouteParams_UI::setup_latency_frame ()
298 {
299         latency_widget = new LatencyGUI (*(_route.get()), session->frame_rate(), session->engine().frames_per_cycle());
300
301         char buf[128];
302         snprintf (buf, sizeof (buf), _("Playback delay: %u samples"), _route->initial_delay());
303         delay_label.set_text (buf);
304
305         latency_packer.pack_start (*latency_widget, false, false);
306         latency_packer.pack_start (latency_button_box, false, false);
307         latency_packer.pack_start (delay_label);
308
309         latency_apply_conn = latency_apply_button.signal_clicked().connect (mem_fun (*latency_widget, &LatencyGUI::finish));
310         latency_conn = _route->signal_latency_changed.connect (mem_fun (*this, &RouteParams_UI::refresh_latency));
311         delay_conn = _route->initial_delay_changed.connect (mem_fun (*this, &RouteParams_UI::refresh_latency));
312         
313         latency_frame.add (latency_packer);
314         latency_frame.show_all ();
315 }
316
317 void
318 RouteParams_UI::setup_io_frames()
319 {
320         cleanup_io_frames();
321         
322         // input
323         _input_iosel = new IOSelector (*session, _route, false);
324         _input_iosel->setup ();
325         input_frame.add (*_input_iosel);
326         input_frame.show_all();
327         
328         // output
329         _output_iosel = new IOSelector (*session, _route, true);
330         _output_iosel->setup ();
331         output_frame.add (*_output_iosel);
332         output_frame.show_all();
333 }
334
335 void
336 RouteParams_UI::cleanup_io_frames()
337 {
338         if (_input_iosel) {
339                 _input_iosel->Finished (IOSelector::Cancelled);
340                 input_frame.remove();
341                 delete _input_iosel;
342                 _input_iosel = 0;
343         }
344
345         if (_output_iosel) {
346                 _output_iosel->Finished (IOSelector::Cancelled);
347
348                 output_frame.remove();
349                 delete _output_iosel;
350                 _output_iosel = 0;
351         }
352 }
353
354 void
355 RouteParams_UI::cleanup_pre_view (bool stopupdate)
356 {
357         if (_active_pre_view) {
358                 GenericPluginUI *   plugui = 0;
359                 
360                 if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_pre_view)) != 0) {
361                           plugui->stop_updating (0);
362                 }
363
364                 _pre_plugin_conn.disconnect();
365                 pre_redir_hpane.remove(*_active_pre_view);
366                 delete _active_pre_view;
367                 _active_pre_view = 0;
368         }
369 }
370
371 void
372 RouteParams_UI::cleanup_post_view (bool stopupdate)
373 {
374         if (_active_post_view) {
375                 GenericPluginUI *   plugui = 0;
376                 
377                 if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_post_view)) != 0) {
378                           plugui->stop_updating (0);
379                 }
380                 _post_plugin_conn.disconnect();
381                 post_redir_hpane.remove(*_active_post_view);
382                 delete _active_post_view;
383                 _active_post_view = 0;
384         }
385 }
386
387
388 void
389 RouteParams_UI::route_removed (boost::shared_ptr<Route> route)
390 {
391         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
392
393         TreeModel::Children rows = route_display_model->children();
394         TreeModel::Children::iterator ri;
395
396         for(TreeModel::Children::iterator iter = rows.begin(); iter != rows.end(); ++iter) {
397                 boost::shared_ptr<Route> r =(*iter)[route_display_columns.route];
398
399                 if (r == route) {
400                         route_display_model->erase(iter);
401                         break;
402                 }
403         }
404
405         if (route == _route) {
406                 cleanup_io_frames();
407                 cleanup_pre_view();
408                 cleanup_post_view();
409                 cleanup_processor_boxes();
410                 
411                 _route.reset ((Route*) 0);
412                 _pre_processor.reset ((Processor*) 0);
413                 _post_processor.reset ((Processor*) 0);
414                 update_title();
415         }
416 }
417
418 void
419 RouteParams_UI::set_session (Session *sess)
420 {
421         ArdourDialog::set_session (sess);
422
423         route_display_model->clear();
424
425         if (session) {
426                 boost::shared_ptr<Session::RouteList> r = session->get_routes();
427                 add_routes (*r);
428                 session->GoingAway.connect (mem_fun(*this, &ArdourDialog::session_gone));
429                 session->RouteAdded.connect (mem_fun(*this, &RouteParams_UI::add_routes));
430                 start_updating ();
431         } else {
432                 stop_updating ();
433         }
434
435         //route_select_list.thaw ();
436
437         _plugin_selector->set_session (session);
438 }       
439
440
441 void
442 RouteParams_UI::session_gone ()
443 {
444         ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::session_gone));
445
446         route_display_model->clear();
447
448         cleanup_io_frames();
449         cleanup_pre_view();
450         cleanup_post_view();
451         cleanup_processor_boxes();
452         cleanup_latency_frame ();
453
454         _route.reset ((Route*) 0);
455         _pre_processor.reset ((Processor*) 0);
456         _post_processor.reset ((Processor*) 0);
457         update_title();
458
459         ArdourDialog::session_gone();
460
461 }
462
463 void
464 RouteParams_UI::route_selected()
465 {
466         Glib::RefPtr<TreeSelection> selection = route_display.get_selection();
467         TreeModel::iterator iter = selection->get_selected(); // only used with Gtk::SELECTION_SINGLE
468
469         if(iter) {
470                 //If anything is selected
471                 boost::shared_ptr<Route> route = (*iter)[route_display_columns.route] ;
472
473                 if (_route == route) {
474                         // do nothing
475                         return;
476                 }
477
478                 // remove event binding from previously selected
479                 if (_route) {
480                         _route_conn.disconnect();
481                         _route_ds_conn.disconnect();
482                         cleanup_processor_boxes();
483                         cleanup_pre_view();
484                         cleanup_post_view();
485                         cleanup_io_frames();
486                         cleanup_latency_frame ();
487                 }
488
489                 // update the other panes with the correct info
490                 _route = route;
491                 //update_routeinfo (route);
492
493                 setup_io_frames();
494                 setup_processor_boxes();
495                 setup_latency_frame ();
496
497                 // bind to redirects changed event for this route
498                 _route_conn = route->processors_changed.connect (mem_fun(*this, &RouteParams_UI::processors_changed));
499
500                 track_input_label.set_text (_route->name());
501
502                 update_title();
503
504         } else {
505                 // no selection
506                 if (_route) {
507                         _route_conn.disconnect();
508
509                         // remove from view
510                         cleanup_io_frames();
511                         cleanup_pre_view();
512                         cleanup_post_view();
513                         cleanup_processor_boxes();
514                         cleanup_latency_frame ();
515
516                         _route.reset ((Route*) 0);
517                         _pre_processor.reset ((Processor*) 0);
518                         _post_processor.reset ((Processor *) 0);
519                         track_input_label.set_text(_("NO TRACK"));
520                         update_title();
521                 }
522         }
523 }
524
525 void
526 RouteParams_UI::processors_changed ()
527 {
528         ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::processors_changed));
529         cleanup_pre_view();
530         cleanup_post_view();
531         
532         _pre_processor.reset ((Processor*) 0);
533         _post_processor.reset ((Processor*) 0);
534
535         //update_title();
536 }
537
538 void
539 RouteParams_UI::show_track_menu()
540 {
541         using namespace Menu_Helpers;
542         
543         if (track_menu == 0) {
544                 track_menu = new Menu;
545                 track_menu->set_name ("ArdourContextMenu");
546                 track_menu->items().push_back 
547                                 (MenuElem (_("Add Track/Bus"), 
548                                            bind (mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::add_route), (Gtk::Window*) 0)));
549         }
550         track_menu->popup (1, gtk_get_current_event_time());
551 }
552
553 void
554 RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> insert, ARDOUR::Placement place)
555 {
556         if ((place == PreFader && _pre_processor == insert)
557             || (place == PostFader && _post_processor == insert)){
558                 return;
559         }
560         
561         boost::shared_ptr<Send> send;
562         boost::shared_ptr<PluginInsert> plugin_insert;
563         boost::shared_ptr<PortInsert> port_insert;
564         
565         if ((send = boost::dynamic_pointer_cast<Send> (insert)) != 0) {
566
567                 SendUI *send_ui = new SendUI (send, *session);
568
569                 if (place == PreFader) {
570                         cleanup_pre_view();
571                         _pre_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
572                         _active_pre_view = send_ui;
573                         
574                         pre_redir_hpane.add2 (*_active_pre_view);
575                         pre_redir_hpane.show_all();
576                 }
577                 else {
578                         cleanup_post_view();
579                         _post_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
580                         _active_post_view = send_ui;
581                         
582                         post_redir_hpane.add2 (*_active_post_view);
583                         post_redir_hpane.show_all();
584                 }
585         } else if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {                         
586
587                 GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true);
588
589                 if (place == PreFader) {
590                         cleanup_pre_view();
591                         _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
592                         plugin_ui->start_updating (0);
593                         _active_pre_view = plugin_ui;
594                         pre_redir_hpane.pack2 (*_active_pre_view);
595                         pre_redir_hpane.show_all();
596                 }
597                 else {
598                         cleanup_post_view();
599                         _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
600                         plugin_ui->start_updating (0);
601                         _active_post_view = plugin_ui;
602                         post_redir_hpane.pack2 (*_active_post_view);
603                         post_redir_hpane.show_all();
604                 }
605
606         } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) {
607
608                 PortInsertUI *portinsert_ui = new PortInsertUI (*session, port_insert);
609                                 
610                 if (place == PreFader) {
611                         cleanup_pre_view();
612                         _pre_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
613                         _active_pre_view = portinsert_ui;
614                         pre_redir_hpane.pack2 (*_active_pre_view);
615                         portinsert_ui->redisplay();
616                         pre_redir_hpane.show_all();
617                 }
618                 else {
619                         cleanup_post_view();
620                         _post_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
621                         _active_post_view = portinsert_ui;
622                         post_redir_hpane.pack2 (*_active_post_view);
623                         portinsert_ui->redisplay();
624                         post_redir_hpane.show_all();
625                 }
626         }
627                                 
628         if (place == PreFader) {
629                 _pre_processor = insert;
630         } else {
631                 _post_processor = insert;
632         }
633         
634         update_title();
635                 
636 }
637
638 void
639 RouteParams_UI::plugin_going_away (Placement place)
640 {
641         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), place));
642         
643         // delete the current view without calling finish
644
645         if (place == PreFader) {
646                 cleanup_pre_view (false);
647                 _pre_processor.reset ((Processor*) 0);
648         }
649         else {
650                 cleanup_post_view (false);
651                 _post_processor.reset ((Processor*) 0);
652         }
653 }
654
655 void
656 RouteParams_UI::redirect_going_away (boost::shared_ptr<ARDOUR::Processor> insert)
657
658 {
659         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
660         
661         printf ("redirect going away\n");
662         // delete the current view without calling finish
663         if (insert == _pre_processor) {
664                 cleanup_pre_view (false);
665                 _pre_processor.reset ((Processor*) 0);
666         } else if (insert == _post_processor) {
667                 cleanup_post_view (false);
668                 _post_processor.reset ((Processor*) 0);
669         }
670 }
671
672
673 void
674 RouteParams_UI::update_title ()
675 {
676         WindowTitle title(Glib::get_application_name());
677         title += _("Track/Bus Inspector");
678
679         if (_route) {
680
681                 //              title += ": ";
682
683                 //              if (_redirect && (_current_view == PLUGIN_CONFIG_VIEW || _current_view == SEND_CONFIG_VIEW)) {
684                 //                      title += _redirect->name();
685                 //              }
686                 //              else if (_current_view == INPUT_CONFIG_VIEW) {
687                 //                      title += _("INPUT");
688                 //              }
689                 //              else if (_current_view == OUTPUT_CONFIG_VIEW) {
690                 //                      title += _("OUTPUT");
691                 //              }
692
693                 title_label.set_text(_route->name());
694
695                 title += _route->name();
696
697                 set_title(title.get_string());
698         }
699         else {
700                 title_label.set_text(_("No Route Selected"));
701                 title += _("No Route Selected");
702                 set_title(title.get_string());
703         }       
704 }
705
706 void
707 RouteParams_UI::start_updating ()
708 {
709         update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect 
710                 (mem_fun(*this, &RouteParams_UI::update_views));
711 }
712
713 void
714 RouteParams_UI::stop_updating ()
715 {
716         update_connection.disconnect();
717 }
718
719 void
720 RouteParams_UI::update_views ()
721 {
722         SendUI *sui;
723         // TODO: only do it if correct tab is showing
724         
725         if ((sui = dynamic_cast<SendUI*> (_active_pre_view)) != 0) {
726                 sui->update ();
727         }
728         if ((sui = dynamic_cast<SendUI*> (_active_post_view)) != 0) {
729                 sui->update ();
730         }
731
732 }