625605447ce846270983f518efaf84762402e0ea
[ardour.git] / gtk2_ardour / ardour_ui_options.cc
1 /*
2     Copyright (C) 2005 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 #ifdef WAF_BUILD
21 #include "gtk2ardour-config.h"
22 #endif
23
24 #include "pbd/convert.h"
25 #include "pbd/stacktrace.h"
26 #include "pbd/unwind.h"
27
28 #include "ardour/rc_configuration.h"
29 #include "ardour/session.h"
30 #include "ardour/transport_master_manager.h"
31
32 #include "gtkmm2ext/utils.h"
33 #include "waveview/wave_view.h"
34
35 #include "audio_clock.h"
36 #include "ardour_ui.h"
37 #include "actions.h"
38 #include "gui_thread.h"
39 #include "public_editor.h"
40 #include "main_clock.h"
41
42 #include "pbd/i18n.h"
43
44 using namespace Gtk;
45 using namespace Gtkmm2ext;
46 using namespace ARDOUR;
47 using namespace PBD;
48 using namespace ArdourWidgets;
49
50 void
51 ARDOUR_UI::toggle_external_sync()
52 {
53         if (_session) {
54                 if (_session->config.get_video_pullup() != 0.0f && (TransportMasterManager::instance().current()->type() == Engine)) {
55                         MessageDialog msg (_("It is not possible to use JACK as the the sync source\n when the pull up/down setting is non-zero."));
56                         msg.run ();
57                         return;
58                 }
59
60                 ActionManager::toggle_config_state_foo ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::set_external_sync), sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
61
62                 /* activating a slave is a session-property.
63                  * The slave type is a RC property.
64                  * When the slave is active is must not be reconfigured.
65                  * This is a UI limitation, imposed by audio-clock and
66                  * status displays which combine RC-config & session-properties.
67                  *
68                  * Notify RCOptionEditor by emitting a signal if the active
69                  * status changed:
70                  */
71                 Config->ParameterChanged("sync-source");
72         }
73 }
74
75 void
76 ARDOUR_UI::toggle_time_master ()
77 {
78         ActionManager::toggle_config_state_foo ("Transport", "ToggleTimeMaster", sigc::mem_fun (_session->config, &SessionConfiguration::set_jack_time_master), sigc::mem_fun (_session->config, &SessionConfiguration::get_jack_time_master));
79 }
80
81 void
82 ARDOUR_UI::toggle_send_mtc ()
83 {
84         ActionManager::toggle_config_state ("Options", "SendMTC", &RCConfiguration::set_send_mtc, &RCConfiguration::get_send_mtc);
85 }
86
87 void
88 ARDOUR_UI::toggle_send_mmc ()
89 {
90         ActionManager::toggle_config_state ("Options", "SendMMC", &RCConfiguration::set_send_mmc, &RCConfiguration::get_send_mmc);
91 }
92
93 void
94 ARDOUR_UI::toggle_send_midi_clock ()
95 {
96         ActionManager::toggle_config_state ("Options", "SendMidiClock", &RCConfiguration::set_send_midi_clock, &RCConfiguration::get_send_midi_clock);
97 }
98
99 void
100 ARDOUR_UI::toggle_use_mmc ()
101 {
102         ActionManager::toggle_config_state ("Options", "UseMMC", &RCConfiguration::set_mmc_control, &RCConfiguration::get_mmc_control);
103 }
104
105 void
106 ARDOUR_UI::toggle_auto_input ()
107 {
108         ActionManager::toggle_config_state_foo ("Transport", "ToggleAutoInput", sigc::mem_fun (_session->config, &SessionConfiguration::set_auto_input), sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_input));
109 }
110
111 void
112 ARDOUR_UI::toggle_auto_play ()
113 {
114         ActionManager::toggle_config_state_foo ("Transport", "ToggleAutoPlay", sigc::mem_fun (_session->config, &SessionConfiguration::set_auto_play), sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_play));
115 }
116
117 void
118 ARDOUR_UI::toggle_auto_return ()
119 {
120         ActionManager::toggle_config_state_foo ("Transport", "ToggleAutoReturn", sigc::mem_fun (_session->config, &SessionConfiguration::set_auto_return), sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_return));
121 }
122
123 void
124 ARDOUR_UI::toggle_click ()
125 {
126         ActionManager::toggle_config_state ("Transport", "ToggleClick", &RCConfiguration::set_clicking, &RCConfiguration::get_clicking);
127 }
128
129 void
130 ARDOUR_UI::toggle_session_monitoring_in ()
131 {
132         Glib::RefPtr<Action> act = global_actions.find_action (X_("Transport"), X_("SessionMonitorIn"));
133         if (!act) {
134                 return;
135         }
136         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
137         if (!tact) {
138                 return;
139         }
140
141         if (tact->get_active() && _session->config.get_session_monitoring () == MonitorInput) {
142                 return;
143         }
144         if (!tact->get_active() && _session->config.get_session_monitoring () != MonitorInput) {
145                 return;
146         }
147
148         if (tact->get_active()) {
149                 _session->config.set_session_monitoring (MonitorInput);
150         } else {
151                 _session->config.set_session_monitoring (MonitorAuto);
152         }
153 }
154
155 void
156 ARDOUR_UI::toggle_session_monitoring_disk ()
157 {
158         Glib::RefPtr<Action> act = global_actions.find_action (X_("Transport"), X_("SessionMonitorDisk"));
159         if (!act) {
160                 return;
161         }
162         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
163         if (!tact) {
164                 return;
165         }
166         if (tact->get_active() && _session->config.get_session_monitoring () == MonitorDisk) {
167                 return;
168         }
169         if (!tact->get_active() && _session->config.get_session_monitoring () != MonitorDisk) {
170                 return;
171         }
172
173         if (tact->get_active()) {
174                 _session->config.set_session_monitoring (MonitorDisk);
175         } else {
176                 _session->config.set_session_monitoring (MonitorAuto);
177         }
178 }
179
180 void
181 ARDOUR_UI::unset_dual_punch ()
182 {
183         Glib::RefPtr<Action> action = global_actions.find_action ("Transport", "TogglePunch");
184
185         if (action) {
186                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
187                 if (tact) {
188                         ignore_dual_punch = true;
189                         tact->set_active (false);
190                         ignore_dual_punch = false;
191                 }
192         }
193 }
194
195 void
196 ARDOUR_UI::toggle_punch ()
197 {
198         if (ignore_dual_punch) {
199                 return;
200         }
201
202         Glib::RefPtr<Action> action = global_actions.find_action ("Transport", "TogglePunch");
203
204         if (action) {
205
206                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
207
208                 if (!tact) {
209                         return;
210                 }
211
212                 /* drive the other two actions from this one */
213
214                 Glib::RefPtr<Action> in_action = global_actions.find_action ("Transport", "TogglePunchIn");
215                 Glib::RefPtr<Action> out_action = global_actions.find_action ("Transport", "TogglePunchOut");
216
217                 if (in_action && out_action) {
218                         Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action);
219                         Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action);
220                         tiact->set_active (tact->get_active());
221                         toact->set_active (tact->get_active());
222                 }
223         }
224 }
225
226 void
227 ARDOUR_UI::toggle_punch_in ()
228 {
229         Glib::RefPtr<Action> act = global_actions.find_action (X_("Transport"), X_("TogglePunchIn"));
230         if (!act) {
231                 return;
232         }
233
234         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
235         if (!tact) {
236                 return;
237         }
238
239         if (tact->get_active() != _session->config.get_punch_in()) {
240                 _session->config.set_punch_in (tact->get_active ());
241         }
242
243         if (tact->get_active()) {
244                 /* if punch-in is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
245                    to avoid confusing the user */
246                 show_loop_punch_ruler_and_disallow_hide ();
247         }
248
249         reenable_hide_loop_punch_ruler_if_appropriate ();
250 }
251
252 void
253 ARDOUR_UI::toggle_punch_out ()
254 {
255         Glib::RefPtr<Action> act = global_actions.find_action (X_("Transport"), X_("TogglePunchOut"));
256         if (!act) {
257                 return;
258         }
259
260         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
261         if (!tact) {
262                 return;
263         }
264
265         if (tact->get_active() != _session->config.get_punch_out()) {
266                 _session->config.set_punch_out (tact->get_active ());
267         }
268
269         if (tact->get_active()) {
270                 /* if punch-out is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
271                    to avoid confusing the user */
272                 show_loop_punch_ruler_and_disallow_hide ();
273         }
274
275         reenable_hide_loop_punch_ruler_if_appropriate ();
276 }
277
278 void
279 ARDOUR_UI::show_loop_punch_ruler_and_disallow_hide ()
280 {
281         Glib::RefPtr<Action> act = editor->find_action (X_("Rulers"), "toggle-loop-punch-ruler");
282         if (!act) {
283                 return;
284         }
285
286         act->set_sensitive (false);
287
288         Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
289         if (!tact) {
290                 return;
291         }
292
293         if (!tact->get_active()) {
294                 tact->set_active ();
295         }
296 }
297
298 /* This is a bit of a silly name for a method */
299 void
300 ARDOUR_UI::reenable_hide_loop_punch_ruler_if_appropriate ()
301 {
302         if (!_session->config.get_punch_in() && !_session->config.get_punch_out()) {
303                 /* if punch in/out are now both off, reallow hiding of the loop/punch ruler */
304                 Glib::RefPtr<Action> act = editor->find_action (X_("Rulers"), "toggle-loop-punch-ruler");
305                 if (act) {
306                         act->set_sensitive (true);
307                 }
308         }
309 }
310
311 void
312 ARDOUR_UI::toggle_video_sync()
313 {
314         Glib::RefPtr<Action> act = global_actions.find_action ("Transport", "ToggleVideoSync");
315         if (act) {
316                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
317                 _session->config.set_use_video_sync (tact->get_active());
318         }
319 }
320
321 void
322 ARDOUR_UI::toggle_editing_space()
323 {
324         Glib::RefPtr<Action> act = global_actions.find_action ("Common", "ToggleMaximalEditor");
325
326         if (act) {
327                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
328                 if (tact->get_active()) {
329                         maximise_editing_space ();
330                 } else {
331                         restore_editing_space ();
332                 }
333         }
334 }
335
336 void
337 ARDOUR_UI::setup_session_options ()
338 {
339         _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
340         boost::function<void (std::string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
341         _session->config.map_parameters (pc);
342 }
343
344 void
345 ARDOUR_UI::parameter_changed (std::string p)
346 {
347         if (p == "external-sync") {
348
349                 /* session parameter */
350
351                 ActionManager::map_some_state ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
352
353                 if (!_session->config.get_external_sync()) {
354                         sync_button.set_text (S_("SyncSource|Int."));
355                         global_actions.find_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
356                         global_actions.find_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
357                         global_actions.find_action ("Transport", "ToggleFollowEdits")->set_sensitive (true);
358                 } else {
359                         /* XXX we need to make sure that auto-play is off as well as insensitive */
360                         global_actions.find_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
361                         global_actions.find_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
362                         global_actions.find_action ("Transport", "ToggleFollowEdits")->set_sensitive (false);
363                 }
364
365         } else if (p == "sync-source") {
366
367                 /* app parameter (RC config) */
368
369                 if (_session) {
370                         if (!_session->config.get_external_sync()) {
371                                 sync_button.set_text (S_("SyncSource|Int."));
372                         } else {
373                                 sync_button.set_text (TransportMasterManager::instance().current()->display_name());
374                         }
375                 } else {
376                         /* changing sync source without a session is unlikely/impossible , except during startup */
377                         sync_button.set_text (TransportMasterManager::instance().current()->display_name());
378                 }
379
380         } else if (p == "follow-edits") {
381
382                 ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &UIConfiguration::get_follow_edits);
383
384         } else if (p == "send-mtc") {
385
386                 ActionManager::map_some_state ("Options", "SendMTC", &RCConfiguration::get_send_mtc);
387
388         } else if (p == "send-mmc") {
389
390                 ActionManager::map_some_state ("Options", "SendMMC", &RCConfiguration::get_send_mmc);
391
392         } else if (p == "mmc-control") {
393                 ActionManager::map_some_state ("Options", "UseMMC", &RCConfiguration::get_mmc_control);
394         } else if (p == "auto-play") {
395                 ActionManager::map_some_state ("Transport", "ToggleAutoPlay", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_play));
396         } else if (p == "auto-return") {
397                 ActionManager::map_some_state ("Transport", "ToggleAutoReturn", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_return));
398         } else if (p == "auto-input") {
399                 ActionManager::map_some_state ("Transport", "ToggleAutoInput", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_input));
400         } else if (p == "session-monitoring") {
401                 Glib::RefPtr<Action> iact = global_actions.find_action (X_("Transport"), X_("SessionMonitorIn"));
402                 Glib::RefPtr<Action> dact = global_actions.find_action (X_("Transport"), X_("SessionMonitorDisk"));
403                 if (iact && dact) {
404                         Glib::RefPtr<ToggleAction> tdact = Glib::RefPtr<ToggleAction>::cast_dynamic(dact);
405                         Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(iact);
406                         if (tdact && tiact) {
407                                 switch (_session->config.get_session_monitoring ()) {
408                                         case MonitorDisk:
409                                                 tdact->set_active (true);
410                                                 tiact->set_active (false);
411                                                 break;
412                                         case MonitorInput:
413                                                 tiact->set_active (true);
414                                                 tdact->set_active (false);
415                                                 break;
416                                         default:
417                                                 tdact->set_active (false);
418                                                 tiact->set_active (false);
419                                                 break;
420                                 }
421                         }
422                 }
423         } else if (p == "punch-out") {
424                 ActionManager::map_some_state ("Transport", "TogglePunchOut", sigc::mem_fun (_session->config, &SessionConfiguration::get_punch_out));
425                 if (!_session->config.get_punch_out()) {
426                         unset_dual_punch ();
427                 }
428         } else if (p == "punch-in") {
429                 ActionManager::map_some_state ("Transport", "TogglePunchIn", sigc::mem_fun (_session->config, &SessionConfiguration::get_punch_in));
430                 if (!_session->config.get_punch_in()) {
431                         unset_dual_punch ();
432                 }
433         } else if (p == "clicking") {
434                 ActionManager::map_some_state ("Transport", "ToggleClick", &RCConfiguration::get_clicking);
435         } else if (p == "use-video-sync") {
436                 ActionManager::map_some_state ("Transport",  "ToggleVideoSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_use_video_sync));
437         } else if (p == "sync-source") {
438
439                 synchronize_sync_source_and_video_pullup ();
440                 set_fps_timeout_connection ();
441
442         } else if (p == "show-track-meters") {
443                 if (editor) editor->toggle_meter_updating();
444         } else if (p == "primary-clock-delta-mode") {
445                 if (UIConfiguration::instance().get_primary_clock_delta_mode() != NoDelta) {
446                         primary_clock->set_is_duration (true);
447                         primary_clock->set_editable (false);
448                         primary_clock->set_widget_name ("transport delta");
449                 } else {
450                         primary_clock->set_is_duration (false);
451                         primary_clock->set_editable (true);
452                         primary_clock->set_widget_name ("transport");
453                 }
454         } else if (p == "secondary-clock-delta-mode") {
455                 if (UIConfiguration::instance().get_secondary_clock_delta_mode() != NoDelta) {
456                         secondary_clock->set_is_duration (true);
457                         secondary_clock->set_editable (false);
458                         secondary_clock->set_widget_name ("secondary delta");
459                 } else {
460                         secondary_clock->set_is_duration (false);
461                         secondary_clock->set_editable (true);
462                         secondary_clock->set_widget_name ("secondary");
463                 }
464         } else if (p == "super-rapid-clock-update") {
465                 if (_session) {
466                         stop_clocking ();
467                         start_clocking ();
468                 }
469         } else if (p == "use-tooltips") {
470                 /* this doesn't really belong here but it has to go somewhere */
471                 if (UIConfiguration::instance().get_use_tooltips()) {
472                         Gtkmm2ext::enable_tooltips ();
473                 } else {
474                         Gtkmm2ext::disable_tooltips ();
475                 }
476         } else if (p == "waveform-gradient-depth") {
477                 ArdourWaveView::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
478         } else if (p == "show-mini-timeline") {
479                 repack_transport_hbox ();
480         } else if (p == "show-dsp-load-info") {
481                 repack_transport_hbox ();
482         } else if (p == "show-disk-space-info") {
483                 repack_transport_hbox ();
484         } else if (p == "show-toolbar-recpunch") {
485                 repack_transport_hbox ();
486         } else if (p == "show-toolbar-monitoring") {
487                 repack_transport_hbox ();
488         } else if (p == "show-toolbar-selclock") {
489                 repack_transport_hbox ();
490         } else if (p == "show-editor-meter") {
491                 repack_transport_hbox ();
492         } else if (p == "show-secondary-clock") {
493                 update_clock_visibility ();
494         } else if (p == "waveform-scale") {
495                 ArdourWaveView::WaveView::set_global_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
496         } else if (p == "widget-prelight") {
497                 CairoWidget::set_widget_prelight (UIConfiguration::instance().get_widget_prelight());
498         } else if (p == "waveform-shape") {
499                 ArdourWaveView::WaveView::set_global_shape (UIConfiguration::instance().get_waveform_shape() == Rectified
500                                 ? ArdourWaveView::WaveView::Rectified : ArdourWaveView::WaveView::Normal);
501         } else if (p == "show-waveform-clipping") {
502                 ArdourWaveView::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
503         } else if (p == "waveform-cache-size") {
504                 /* GUI option has units of megabytes; image cache uses units of bytes */
505                 ArdourWaveView::WaveView::set_image_cache_size (UIConfiguration::instance().get_waveform_cache_size() * 1048576);
506         } else if (p == "use-wm-visibility") {
507                 VisibilityTracker::set_use_window_manager_visibility (UIConfiguration::instance().get_use_wm_visibility());
508         } else if (p == "action-table-columns") {
509                 const uint32_t cols = UIConfiguration::instance().get_action_table_columns ();
510                 for (int i = 0; i < MAX_LUA_ACTION_SCRIPTS; ++i) {
511                         const int col = i / 2;
512                         if (cols & (1<<col)) {
513                                 action_script_call_btn[i].show();
514                         } else {
515                                 action_script_call_btn[i].hide();
516                         }
517                 }
518         } else if (p == "layered-record-mode") {
519                 layered_button.set_active (_session->config.get_layered_record_mode ());
520         } else if (p == "flat-buttons") {
521                 bool flat = UIConfiguration::instance().get_flat_buttons();
522                 if (ArdourButton::flat_buttons () != flat) {
523                         ArdourButton::set_flat_buttons (flat);
524                         /* force a redraw */
525                         gtk_rc_reset_styles (gtk_settings_get_default());
526                 }
527         } else if (p == "boxy-buttons") {
528                 bool boxy = UIConfiguration::instance().get_boxy_buttons();
529                 if (ArdourButton::boxy_buttons () != boxy) {
530                         ArdourButton::set_boxy_buttons (boxy);
531                         /* force a redraw */
532                         gtk_rc_reset_styles (gtk_settings_get_default());
533                 }
534         } else if ( (p == "snap-to-region-sync") || (p == "snap-to-region-start") || (p == "snap-to-region-end") ) {
535                 if (editor) editor->mark_region_boundary_cache_dirty();
536         }
537
538 }
539
540 void
541 ARDOUR_UI::session_parameter_changed (std::string p)
542 {
543         if (p == "native-file-data-format" || p == "native-file-header-format") {
544                 update_format ();
545         } else if (p == "timecode-format") {
546                 set_fps_timeout_connection ();
547         } else if (p == "video-pullup" || p == "timecode-format") {
548                 set_fps_timeout_connection ();
549
550                 synchronize_sync_source_and_video_pullup ();
551                 reset_main_clocks ();
552                 editor->queue_visual_videotimeline_update();
553         } else if (p == "track-name-number") {
554                 /* DisplaySuspender triggers _route->redisplay() when going out of scope
555                  * which eventually calls reset_controls_layout_width() and re-sets the
556                  * track-header width.
557                  * see also RouteTimeAxisView::update_track_number_visibility()
558                  */
559                 DisplaySuspender ds;
560         }
561 }
562
563 void
564 ARDOUR_UI::reset_main_clocks ()
565 {
566         ENSURE_GUI_THREAD (*this, &ARDOUR_UI::reset_main_clocks)
567
568         if (_session) {
569                 primary_clock->set (_session->audible_sample(), true);
570                 secondary_clock->set (_session->audible_sample(), true);
571         } else {
572                 primary_clock->set (0, true);
573                 secondary_clock->set (0, true);
574         }
575 }
576
577 void
578 ARDOUR_UI::synchronize_sync_source_and_video_pullup ()
579 {
580         Glib::RefPtr<Action> act = global_actions.find_action (X_("Transport"), X_("ToggleExternalSync"));
581
582         if (!act) {
583                 return;
584         }
585
586         if (!_session) {
587                 goto just_label;
588         }
589
590         if (_session->config.get_video_pullup() == 0.0f) {
591                 /* with no video pull up/down, any sync source is OK */
592                 act->set_sensitive (true);
593         } else {
594                 /* can't sync to JACK if video pullup != 0.0 */
595                 if (TransportMasterManager::instance().current()->type() == Engine) {
596                         act->set_sensitive (false);
597                 } else {
598                         act->set_sensitive (true);
599                 }
600         }
601
602         /* XXX should really be able to set the video pull up
603            action to insensitive/sensitive, but there is no action.
604            FIXME
605         */
606
607   just_label:
608         if (act->get_sensitive ()) {
609                 set_tip (sync_button, _("Enable/Disable external positional sync"));
610         } else {
611                 set_tip (sync_button, _("Sync to JACK is not possible: video pull up/down is set"));
612         }
613
614 }