Merge libs/ardour and gtk2_ardour with 2.0-ongoing R2837.
[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, _route, *_plugin_selector, _rr_selection);
233                 post_insert_box = new ProcessorBox(PostFader, *session, _route, *_plugin_selector, _rr_selection);
234
235                 pre_redir_hpane.pack1 (*pre_insert_box);
236                 post_redir_hpane.pack1 (*post_insert_box);
237
238                 pre_insert_box->InsertSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader));
239                 pre_insert_box->InsertUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader));
240                 post_insert_box->InsertSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader));
241                 post_insert_box->InsertUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader));
242
243                 pre_redir_hpane.show_all();
244                 post_redir_hpane.show_all();
245         }
246         
247 }
248
249 void
250 RouteParams_UI::cleanup_processor_boxes()
251 {
252         if (pre_insert_box) {
253                 pre_redir_hpane.remove(*pre_insert_box);
254                 delete pre_insert_box;
255                 pre_insert_box = 0;
256         }
257
258         if (post_insert_box) {
259                 post_redir_hpane.remove(*post_insert_box);
260                 delete post_insert_box;
261                 post_insert_box = 0;
262         }
263 }
264
265 void
266 RouteParams_UI::refresh_latency ()
267 {
268         if (latency_widget) {
269                 latency_widget->refresh();
270
271                 char buf[128];
272                 snprintf (buf, sizeof (buf), _("Playback delay: %u samples"), _route->initial_delay());
273                 delay_label.set_text (buf);
274         }
275 }
276
277 void
278 RouteParams_UI::cleanup_latency_frame ()
279 {
280         if (latency_widget) {
281                 latency_frame.remove ();
282                 latency_packer.remove (*latency_widget);
283                 latency_packer.remove (latency_button_box);
284                 latency_packer.remove (delay_label);
285                 delete latency_widget;
286                 latency_widget = 0;
287                 latency_conn.disconnect ();
288                 delay_conn.disconnect ();
289                 latency_apply_conn.disconnect ();
290         }
291 }
292
293 void
294 RouteParams_UI::setup_latency_frame ()
295 {
296         latency_widget = new LatencyGUI (*(_route.get()), session->frame_rate(), session->engine().frames_per_cycle());
297
298         char buf[128];
299         snprintf (buf, sizeof (buf), _("Playback delay: %u samples"), _route->initial_delay());
300         delay_label.set_text (buf);
301
302         latency_packer.pack_start (*latency_widget, false, false);
303         latency_packer.pack_start (latency_button_box, false, false);
304         latency_packer.pack_start (delay_label);
305
306         latency_apply_conn = latency_apply_button.signal_clicked().connect (mem_fun (*latency_widget, &LatencyGUI::finish));
307         latency_conn = _route->signal_latency_changed.connect (mem_fun (*this, &RouteParams_UI::refresh_latency));
308         delay_conn = _route->initial_delay_changed.connect (mem_fun (*this, &RouteParams_UI::refresh_latency));
309         
310         latency_frame.add (latency_packer);
311         latency_frame.show_all ();
312 }
313
314 void
315 RouteParams_UI::setup_io_frames()
316 {
317         cleanup_io_frames();
318         
319         // input
320         _input_iosel = new IOSelector (*session, _route, true);
321         _input_iosel->redisplay ();
322         input_frame.add (*_input_iosel);
323         input_frame.show_all();
324         
325         // output
326         _output_iosel = new IOSelector (*session, _route, false);
327         _output_iosel->redisplay ();
328         output_frame.add (*_output_iosel);
329         output_frame.show_all();
330 }
331
332 void
333 RouteParams_UI::cleanup_io_frames()
334 {
335         if (_input_iosel) {
336                 _input_iosel->Finished (IOSelector::Cancelled);
337                 input_frame.remove();
338                 delete _input_iosel;
339                 _input_iosel = 0;
340         }
341
342         if (_output_iosel) {
343                 _output_iosel->Finished (IOSelector::Cancelled);
344
345                 output_frame.remove();
346                 delete _output_iosel;
347                 _output_iosel = 0;
348         }
349 }
350
351 void
352 RouteParams_UI::cleanup_pre_view (bool stopupdate)
353 {
354         if (_active_pre_view) {
355                 GenericPluginUI *   plugui = 0;
356                 
357                 if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_pre_view)) != 0) {
358                           plugui->stop_updating (0);
359                 }
360
361                 _pre_plugin_conn.disconnect();
362                 pre_redir_hpane.remove(*_active_pre_view);
363                 delete _active_pre_view;
364                 _active_pre_view = 0;
365         }
366 }
367
368 void
369 RouteParams_UI::cleanup_post_view (bool stopupdate)
370 {
371         if (_active_post_view) {
372                 GenericPluginUI *   plugui = 0;
373                 
374                 if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_post_view)) != 0) {
375                           plugui->stop_updating (0);
376                 }
377                 _post_plugin_conn.disconnect();
378                 post_redir_hpane.remove(*_active_post_view);
379                 delete _active_post_view;
380                 _active_post_view = 0;
381         }
382 }
383
384
385 void
386 RouteParams_UI::route_removed (boost::shared_ptr<Route> route)
387 {
388         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
389
390         TreeModel::Children rows = route_display_model->children();
391         TreeModel::Children::iterator ri;
392
393         for(TreeModel::Children::iterator iter = rows.begin(); iter != rows.end(); ++iter) {
394                 boost::shared_ptr<Route> r =(*iter)[route_display_columns.route];
395
396                 if (r == route) {
397                         route_display_model->erase(iter);
398                         break;
399                 }
400         }
401
402         if (route == _route) {
403                 cleanup_io_frames();
404                 cleanup_pre_view();
405                 cleanup_post_view();
406                 cleanup_processor_boxes();
407                 
408                 _route.reset ((Route*) 0);
409                 _pre_processor.reset ((Processor*) 0);
410                 _post_processor.reset ((Processor*) 0);
411                 update_title();
412         }
413 }
414
415 void
416 RouteParams_UI::set_session (Session *sess)
417 {
418         ArdourDialog::set_session (sess);
419
420         route_display_model->clear();
421
422         if (session) {
423                 boost::shared_ptr<Session::RouteList> r = session->get_routes();
424                 add_routes (*r);
425                 session->GoingAway.connect (mem_fun(*this, &ArdourDialog::session_gone));
426                 session->RouteAdded.connect (mem_fun(*this, &RouteParams_UI::add_routes));
427                 start_updating ();
428         } else {
429                 stop_updating ();
430         }
431
432         //route_select_list.thaw ();
433
434         _plugin_selector->set_session (session);
435 }       
436
437
438 void
439 RouteParams_UI::session_gone ()
440 {
441         ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::session_gone));
442
443         route_display_model->clear();
444
445         cleanup_io_frames();
446         cleanup_pre_view();
447         cleanup_post_view();
448         cleanup_processor_boxes();
449         cleanup_latency_frame ();
450
451         _route.reset ((Route*) 0);
452         _pre_processor.reset ((Processor*) 0);
453         _post_processor.reset ((Processor*) 0);
454         update_title();
455
456         ArdourDialog::session_gone();
457
458 }
459
460 void
461 RouteParams_UI::route_selected()
462 {
463         Glib::RefPtr<TreeSelection> selection = route_display.get_selection();
464         TreeModel::iterator iter = selection->get_selected(); // only used with Gtk::SELECTION_SINGLE
465
466         if(iter) {
467                 //If anything is selected
468                 boost::shared_ptr<Route> route = (*iter)[route_display_columns.route] ;
469
470                 if (_route == route) {
471                         // do nothing
472                         return;
473                 }
474
475                 // remove event binding from previously selected
476                 if (_route) {
477                         _route_conn.disconnect();
478                         _route_ds_conn.disconnect();
479                         cleanup_processor_boxes();
480                         cleanup_pre_view();
481                         cleanup_post_view();
482                         cleanup_io_frames();
483                         cleanup_latency_frame ();
484                 }
485
486                 // update the other panes with the correct info
487                 _route = route;
488                 //update_routeinfo (route);
489
490                 setup_io_frames();
491                 setup_processor_boxes();
492                 setup_latency_frame ();
493
494                 // bind to redirects changed event for this route
495                 _route_conn = route->processors_changed.connect (mem_fun(*this, &RouteParams_UI::processors_changed));
496
497                 track_input_label.set_text (_route->name());
498
499                 update_title();
500
501         } else {
502                 // no selection
503                 if (_route) {
504                         _route_conn.disconnect();
505
506                         // remove from view
507                         cleanup_io_frames();
508                         cleanup_pre_view();
509                         cleanup_post_view();
510                         cleanup_processor_boxes();
511                         cleanup_latency_frame ();
512
513                         _route.reset ((Route*) 0);
514                         _pre_processor.reset ((Processor*) 0);
515                         _post_processor.reset ((Processor *) 0);
516                         track_input_label.set_text(_("NO TRACK"));
517                         update_title();
518                 }
519         }
520 }
521
522 void
523 RouteParams_UI::processors_changed ()
524 {
525         ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::processors_changed));
526         cleanup_pre_view();
527         cleanup_post_view();
528         
529         _pre_processor.reset ((Processor*) 0);
530         _post_processor.reset ((Processor*) 0);
531
532         //update_title();
533 }
534
535 void
536 RouteParams_UI::show_track_menu()
537 {
538         using namespace Menu_Helpers;
539         
540         if (track_menu == 0) {
541                 track_menu = new Menu;
542                 track_menu->set_name ("ArdourContextMenu");
543                 track_menu->items().push_back 
544                                 (MenuElem (_("Add Track/Bus"), 
545                                            bind (mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::add_route), (Gtk::Window*) 0)));
546         }
547         track_menu->popup (1, gtk_get_current_event_time());
548 }
549
550 void
551 RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> insert, ARDOUR::Placement place)
552 {
553         if ((place == PreFader && _pre_processor == insert)
554             || (place == PostFader && _post_processor == insert)){
555                 return;
556         }
557         
558         boost::shared_ptr<Send> send;
559         boost::shared_ptr<PluginInsert> plugin_insert;
560         boost::shared_ptr<PortInsert> port_insert;
561         
562         if ((send = boost::dynamic_pointer_cast<Send> (insert)) != 0) {
563
564                 SendUI *send_ui = new SendUI (send, *session);
565
566                 if (place == PreFader) {
567                         cleanup_pre_view();
568                         _pre_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
569                         _active_pre_view = send_ui;
570                         
571                         pre_redir_hpane.add2 (*_active_pre_view);
572                         pre_redir_hpane.show_all();
573                 }
574                 else {
575                         cleanup_post_view();
576                         _post_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
577                         _active_post_view = send_ui;
578                         
579                         post_redir_hpane.add2 (*_active_post_view);
580                         post_redir_hpane.show_all();
581                 }
582         } else if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {                         
583
584                 GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true);
585
586                 if (place == PreFader) {
587                         cleanup_pre_view();
588                         _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
589                         plugin_ui->start_updating (0);
590                         _active_pre_view = plugin_ui;
591                         pre_redir_hpane.pack2 (*_active_pre_view);
592                         pre_redir_hpane.show_all();
593                 }
594                 else {
595                         cleanup_post_view();
596                         _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
597                         plugin_ui->start_updating (0);
598                         _active_post_view = plugin_ui;
599                         post_redir_hpane.pack2 (*_active_post_view);
600                         post_redir_hpane.show_all();
601                 }
602
603         } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) {
604
605                 PortInsertUI *portinsert_ui = new PortInsertUI (*session, port_insert);
606                                 
607                 if (place == PreFader) {
608                         cleanup_pre_view();
609                         _pre_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
610                         _active_pre_view = portinsert_ui;
611                         pre_redir_hpane.pack2 (*_active_pre_view);
612                         portinsert_ui->redisplay();
613                         pre_redir_hpane.show_all();
614                 }
615                 else {
616                         cleanup_post_view();
617                         _post_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
618                         _active_post_view = portinsert_ui;
619                         post_redir_hpane.pack2 (*_active_post_view);
620                         portinsert_ui->redisplay();
621                         post_redir_hpane.show_all();
622                 }
623         }
624                                 
625         if (place == PreFader) {
626                 _pre_processor = insert;
627         } else {
628                 _post_processor = insert;
629         }
630         
631         update_title();
632                 
633 }
634
635 void
636 RouteParams_UI::plugin_going_away (Placement place)
637 {
638         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), place));
639         
640         // delete the current view without calling finish
641
642         if (place == PreFader) {
643                 cleanup_pre_view (false);
644                 _pre_processor.reset ((Processor*) 0);
645         }
646         else {
647                 cleanup_post_view (false);
648                 _post_processor.reset ((Processor*) 0);
649         }
650 }
651
652 void
653 RouteParams_UI::redirect_going_away (boost::shared_ptr<ARDOUR::Processor> insert)
654
655 {
656         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert));
657         
658         printf ("redirect going away\n");
659         // delete the current view without calling finish
660         if (insert == _pre_processor) {
661                 cleanup_pre_view (false);
662                 _pre_processor.reset ((Processor*) 0);
663         } else if (insert == _post_processor) {
664                 cleanup_post_view (false);
665                 _post_processor.reset ((Processor*) 0);
666         }
667 }
668
669
670 void
671 RouteParams_UI::update_title ()
672 {
673         WindowTitle title(Glib::get_application_name());
674         title += _("Track/Bus Inspector");
675
676         if (_route) {
677
678                 //              title += ": ";
679
680                 //              if (_redirect && (_current_view == PLUGIN_CONFIG_VIEW || _current_view == SEND_CONFIG_VIEW)) {
681                 //                      title += _redirect->name();
682                 //              }
683                 //              else if (_current_view == INPUT_CONFIG_VIEW) {
684                 //                      title += _("INPUT");
685                 //              }
686                 //              else if (_current_view == OUTPUT_CONFIG_VIEW) {
687                 //                      title += _("OUTPUT");
688                 //              }
689
690                 title_label.set_text(_route->name());
691
692                 title += _route->name();
693
694                 set_title(title.get_string());
695         }
696         else {
697                 title_label.set_text(_("No Route Selected"));
698                 title += _("No Route Selected");
699                 set_title(title.get_string());
700         }       
701 }
702
703 void
704 RouteParams_UI::start_updating ()
705 {
706         update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect 
707                 (mem_fun(*this, &RouteParams_UI::update_views));
708 }
709
710 void
711 RouteParams_UI::stop_updating ()
712 {
713         update_connection.disconnect();
714 }
715
716 void
717 RouteParams_UI::update_views ()
718 {
719         SendUI *sui;
720         // TODO: only do it if correct tab is showing
721         
722         if ((sui = dynamic_cast<SendUI*> (_active_pre_view)) != 0) {
723                 sui->update ();
724         }
725         if ((sui = dynamic_cast<SendUI*> (_active_post_view)) != 0) {
726                 sui->update ();
727         }
728
729 }