show timecode info in selected audio clocks

git-svn-id: svn://localhost/ardour2/trunk@1144 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-11-20 15:15:18 +00:00
parent ec588a28ba
commit 5eea44c6cd
3 changed files with 43 additions and 2 deletions

View 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

View 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

View 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;