#include "pbd/stacktrace.h"
#include "pbd/unwind.h"
-#include <gtkmm2ext/utils.h>
-
#include "ardour/rc_configuration.h"
#include "ardour/session.h"
+#include "ardour/transport_master_manager.h"
-#include "canvas/wave_view.h"
+#include "gtkmm2ext/utils.h"
+#include "waveview/wave_view.h"
#include "audio_clock.h"
#include "ardour_ui.h"
using namespace Gtkmm2ext;
using namespace ARDOUR;
using namespace PBD;
+using namespace ArdourWidgets;
void
ARDOUR_UI::toggle_external_sync()
{
if (_session) {
- if (_session->config.get_video_pullup() != 0.0f) {
- if (Config->get_sync_source() == Engine) {
- MessageDialog msg (
- _("It is not possible to use JACK as the the sync source\n\
-when the pull up/down setting is non-zero."));
- msg.run ();
- return;
- }
+ if (_session->config.get_video_pullup() != 0.0f && (TransportMasterManager::instance().current()->type() == Engine)) {
+ MessageDialog msg (_("It is not possible to use JACK as the the sync source\n when the pull up/down setting is non-zero."));
+ msg.run ();
+ return;
}
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));
* This is a UI limitation, imposed by audio-clock and
* status displays which combine RC-config & session-properties.
*
- * Notficy RCOptionEditor by emitting a signal if the active
+ * Notify RCOptionEditor by emitting a signal if the active
* status changed:
*/
Config->ParameterChanged("sync-source");
{
if (p == "external-sync") {
+ /* session parameter */
+
ActionManager::map_some_state ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
if (!_session->config.get_external_sync()) {
sync_button.set_text (S_("SyncSource|Int."));
- auto_loop_button.set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (true);
} else {
- sync_button.set_text (sync_source_to_string (Config->get_sync_source(), true));
- if (_session && _session->locations()->auto_loop_location()) {
- // disable looping with external sync.
- // This is not necessary because session-transport ignores the loop-state,
- // but makes it clear to the user that it's disabled.
- _session->request_play_loop (false, false);
- }
- auto_loop_button.set_sensitive (false);
/* XXX we need to make sure that auto-play is off as well as insensitive */
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (false);
}
+ } else if (p == "sync-source") {
+
+ /* app parameter (RC config) */
+
+ if (_session) {
+ if (!_session->config.get_external_sync()) {
+ sync_button.set_text (S_("SyncSource|Int."));
+ } else {
+ sync_button.set_text (TransportMasterManager::instance().current()->display_name());
+ }
+ } else {
+ /* changing sync source without a session is unlikely/impossible , except during startup */
+ sync_button.set_text (TransportMasterManager::instance().current()->display_name());
+ }
+
} else if (p == "follow-edits") {
ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &UIConfiguration::get_follow_edits);
} else if (p == "show-track-meters") {
if (editor) editor->toggle_meter_updating();
- } else if (p == "primary-clock-delta-edit-cursor") {
- if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor()) {
+ } else if (p == "primary-clock-delta-mode") {
+ if (UIConfiguration::instance().get_primary_clock_delta_mode() != NoDelta) {
primary_clock->set_is_duration (true);
primary_clock->set_editable (false);
primary_clock->set_widget_name ("transport delta");
primary_clock->set_editable (true);
primary_clock->set_widget_name ("transport");
}
- } else if (p == "secondary-clock-delta-edit-cursor") {
- if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor()) {
+ } else if (p == "secondary-clock-delta-mode") {
+ if (UIConfiguration::instance().get_secondary_clock_delta_mode() != NoDelta) {
secondary_clock->set_is_duration (true);
secondary_clock->set_editable (false);
secondary_clock->set_widget_name ("secondary delta");
Gtkmm2ext::disable_tooltips ();
}
} else if (p == "waveform-gradient-depth") {
- ArdourCanvas::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
+ ArdourWaveView::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
} else if (p == "show-mini-timeline") {
repack_transport_hbox ();
+ } else if (p == "show-dsp-load-info") {
+ repack_transport_hbox ();
+ } else if (p == "show-disk-space-info") {
+ repack_transport_hbox ();
} else if (p == "show-toolbar-recpunch") {
repack_transport_hbox ();
} else if (p == "show-toolbar-monitoring") {
} else if (p == "show-secondary-clock") {
update_clock_visibility ();
} else if (p == "waveform-scale") {
- ArdourCanvas::WaveView::set_global_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
+ ArdourWaveView::WaveView::set_global_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
} else if (p == "widget-prelight") {
CairoWidget::set_widget_prelight (UIConfiguration::instance().get_widget_prelight());
} else if (p == "waveform-shape") {
- ArdourCanvas::WaveView::set_global_shape (UIConfiguration::instance().get_waveform_shape() == Rectified
- ? ArdourCanvas::WaveView::Rectified : ArdourCanvas::WaveView::Normal);
+ ArdourWaveView::WaveView::set_global_shape (UIConfiguration::instance().get_waveform_shape() == Rectified
+ ? ArdourWaveView::WaveView::Rectified : ArdourWaveView::WaveView::Normal);
} else if (p == "show-waveform-clipping") {
- ArdourCanvas::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
+ ArdourWaveView::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
} else if (p == "waveform-cache-size") {
/* GUI option has units of megabytes; image cache uses units of bytes */
- ArdourCanvas::WaveView::set_image_cache_size (UIConfiguration::instance().get_waveform_cache_size() * 1048576);
+ ArdourWaveView::WaveView::set_image_cache_size (UIConfiguration::instance().get_waveform_cache_size() * 1048576);
} else if (p == "use-wm-visibility") {
VisibilityTracker::set_use_window_manager_visibility (UIConfiguration::instance().get_use_wm_visibility());
} else if (p == "action-table-columns") {
const uint32_t cols = UIConfiguration::instance().get_action_table_columns ();
- for (int i = 0; i < 9; ++i) {
+ for (int i = 0; i < MAX_LUA_ACTION_SCRIPTS; ++i) {
const int col = i / 2;
if (cols & (1<<col)) {
action_script_call_btn[i].show();
}
} else if (p == "layered-record-mode") {
layered_button.set_active (_session->config.get_layered_record_mode ());
- } else if (p == "show-waveform-clipping") {
- ArdourCanvas::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
- } else if (p == "waveform-gradient-depth") {
- ArdourCanvas::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
} else if (p == "flat-buttons") {
bool flat = UIConfiguration::instance().get_flat_buttons();
if (ArdourButton::flat_buttons () != flat) {
/* force a redraw */
gtk_rc_reset_styles (gtk_settings_get_default());
}
+ } else if (p == "boxy-buttons") {
+ bool boxy = UIConfiguration::instance().get_boxy_buttons();
+ if (ArdourButton::boxy_buttons () != boxy) {
+ ArdourButton::set_boxy_buttons (boxy);
+ /* force a redraw */
+ gtk_rc_reset_styles (gtk_settings_get_default());
+ }
+ } else if ( (p == "snap-to-region-sync") || (p == "snap-to-region-start") || (p == "snap-to-region-end") ) {
+ if (editor) editor->mark_region_boundary_cache_dirty();
}
+
}
void
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::reset_main_clocks)
if (_session) {
- primary_clock->set (_session->audible_frame(), true);
- secondary_clock->set (_session->audible_frame(), true);
+ primary_clock->set (_session->audible_sample(), true);
+ secondary_clock->set (_session->audible_sample(), true);
} else {
primary_clock->set (0, true);
secondary_clock->set (0, true);
act->set_sensitive (true);
} else {
/* can't sync to JACK if video pullup != 0.0 */
- if (Config->get_sync_source() == Engine) {
+ if (TransportMasterManager::instance().current()->type() == Engine) {
act->set_sensitive (false);
} else {
act->set_sensitive (true);
}
}
-