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