show timecode info in selected audio clocks
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 20 Nov 2006 15:15:18 +0000 (15:15 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 20 Nov 2006 15:15:18 +0000 (15:15 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1144 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui_options.cc
gtk2_ardour/audio_clock.cc
gtk2_ardour/audio_clock.h

index 707d3109f7275d5ec2dfb3c24eb9cdb243839854..ea1c1c13f41ca4f1da106e74cbe91e9539a398c2 100644 (file)
@@ -840,6 +840,14 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
                map_meter_falloff ();
        } else if (PARAM_IS ("verify-remove-last-capture")) {
                ActionManager::map_some_state ("options", "VerifyRemoveLastCapture", &Configuration::get_verify_remove_last_capture);
+       } else if (PARAM_IS ("video-pullup") || PARAM_IS ("smpte-frames-per-second")) {
+               if (session) {
+                       primary_clock.set (session->audible_frame(), true);
+                       secondary_clock.set (session->audible_frame(), true);
+               } else {
+                       primary_clock.set (0, true);
+                       secondary_clock.set (0, true);
+               }
        }
 
 #undef PARAM_IS
index 4ec8c1b89f99881a61db96f8235a8d5817fc2437..270da7ab119795e75e5a10cc25cc067aea360cca 100644 (file)
@@ -58,7 +58,7 @@ const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = {
        10   /* Audio Frame */
 };
 
-AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool with_tempo_and_meter
+AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool with_extras
        : is_duration (duration),
          editable (allow_edit),
          colon1 (":"),
@@ -110,7 +110,19 @@ AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool
        bbt_packer.pack_start (b2, false, false);
        bbt_packer.pack_start (ticks_ebox, false, false);
 
-       if (with_tempo_and_meter) {
+       if (with_extras) {
+
+               framerate_label = manage (new Label);
+               pullup_label = manage (new Label);
+
+               framerate_label->set_name ("BBTMeterLabel");
+               pullup_label->set_name ("BBTTempoLabel");
+
+               rate_pullup_box.pack_start (*framerate_label, true, true);
+               rate_pullup_box.pack_start (*pullup_label, true, true);
+
+               smpte_packer.pack_start (rate_pullup_box, false,false, 5);
+
                meter_label = manage (new Label);
                tempo_label = manage (new Label);
 
@@ -122,6 +134,8 @@ AudioClock::AudioClock (const string& name, bool allow_edit, bool duration, bool
 
                bbt_packer.pack_start (tempo_meter_box, false, false, 5);
        } else {
+               framerate_label = 0;
+               pullup_label = 0;
                meter_label = 0;
                tempo_label = 0;
        }
@@ -467,6 +481,20 @@ AudioClock::set_smpte (nframes_t when, bool force)
                frames_label.set_text (buf);
                last_frames = smpte.frames;
        }
+
+       if (framerate_label) {
+               sprintf (buf, "%-5.2f", Config->get_smpte_frames_per_second());
+               framerate_label->set_text (buf);
+
+               float x = Config->get_video_pullup();
+
+               if (x == 0.0) {
+                       pullup_label->set_text (_("none"));
+               } else {
+                       sprintf (buf, "%-6.4f", x);
+                       pullup_label->set_text (buf);
+               }
+       }
 }
 
 void
index e0431ba16ed55ecc591cc2764368e1c4e5871241..147058ef4d5ca359c3cac6130ac04ed8369a54f1 100644 (file)
@@ -112,6 +112,11 @@ class AudioClock : public Gtk::HBox
        Gtk::Label  frames_label;
        Gtk::Label  colon1, colon2, colon3;
 
+       Gtk::Label*  framerate_label;
+       Gtk::Label*  pullup_label;
+
+       Gtk::VBox   rate_pullup_box;
+
        Gtk::Label  ms_hours_label;
        Gtk::Label  ms_minutes_label;
        Gtk::Label  ms_seconds_label;