From e098a23fcc1c3d27236e6a4c20d3a870c24ab789 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 20 Nov 2006 21:40:11 +0000 Subject: [PATCH] deeper fixes for 80/100 subframes choice git-svn-id: svn://localhost/ardour2/trunk@1146 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/editor_actions.cc | 1 + gtk2_ardour/editor_rulers.cc | 2 +- libs/surfaces/control_protocol/smpte.cc | 7 ++++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 278b9c30eb..768a27e5b5 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -108,7 +108,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile) /* big clock */ - big_clock ("BigClockDisplay", true), + big_clock ("BigClockDisplay", true, false, true), /* transport */ diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 9dfd87259b..3cb14dd9db 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -1098,6 +1098,7 @@ Editor::parameter_changed (const char* parameter_name) edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode())); } else if (PARAM_IS ("subframes_per_frame")) { update_subframes_per_frame (); + update_just_smpte (); } #undef PARAM_IS diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 68db74adfb..d42ebf1e7f 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -853,7 +853,7 @@ Editor::metric_get_smpte (GtkCustomRulerMark **marks, gdouble lower, gdouble upp if (range < (2 * session->frames_per_smpte_frame())) { /* 0 - 2 frames */ show_bits = true; mark_modulo = 20; - nmarks = 1 + 160; + nmarks = 1 + (2 * Config->get_subframes_per_frame()); } else if (range <= (fr / 4)) { /* 2 frames - 0.250 second */ show_frames = true; mark_modulo = 1; diff --git a/libs/surfaces/control_protocol/smpte.cc b/libs/surfaces/control_protocol/smpte.cc index 55d0660c59..9b99d05160 100644 --- a/libs/surfaces/control_protocol/smpte.cc +++ b/libs/surfaces/control_protocol/smpte.cc @@ -20,6 +20,7 @@ #define SMPTE_IS_ZERO( sm ) (!(sm).frames && !(sm).seconds && !(sm).minutes && !(sm).hours && !(sm.subframes)) #include +#include namespace SMPTE { @@ -38,7 +39,7 @@ increment( Time& smpte ) if (smpte.negative) { if (SMPTE_IS_AROUND_ZERO(smpte) && smpte.subframes) { // We have a zero transition involving only subframes - smpte.subframes = 80 - smpte.subframes; + smpte.subframes = ARDOUR::Config->get_subframes_per_frame() - smpte.subframes; smpte.negative = false; return SECONDS; } @@ -121,7 +122,7 @@ decrement( Time& smpte ) return wrap; } else if (SMPTE_IS_AROUND_ZERO(smpte) && smpte.subframes) { // We have a zero transition involving only subframes - smpte.subframes = 80 - smpte.subframes; + smpte.subframes = ARDOUR::Config->get_subframes_per_frame() - smpte.subframes; smpte.negative = true; return SECONDS; } @@ -212,7 +213,7 @@ increment_subframes( Time& smpte ) } smpte.subframes++; - if (smpte.subframes >= 80) { + if (smpte.subframes >= ARDOUR::Config->get_subframes_per_frame()) { smpte.subframes = 0; increment( smpte ); return FRAMES;