</menu>
<menu name='SnapTo' action='SnapTo'>
<menuitem action='snap-to-cd-frame'/>
- <menuitem action='snap-to-smpte-frame'/>
- <menuitem action='snap-to-smpte-seconds'/>
- <menuitem action='snap-to-smpte-minutes'/>
+ <menuitem action='snap-to-timecode-frame'/>
+ <menuitem action='snap-to-timecode-seconds'/>
+ <menuitem action='snap-to-timecode-minutes'/>
<menuitem action='snap-to-seconds'/>
<menuitem action='snap-to-minutes'/>
<menuitem action='snap-to-thirtyseconds'/>
primary_clock.set_mode (AudioClock::BBT);
secondary_clock.set_mode (AudioClock::MinSec);
} else {
- primary_clock.set_mode (AudioClock::SMPTE);
+ primary_clock.set_mode (AudioClock::Timecode);
secondary_clock.set_mode (AudioClock::BBT);
}
shuttle_units_button.set_label(_("ST"));
break;
}
- } else if (p == "video-pullup" || p == "smpte-format") {
+ } else if (p == "video-pullup" || p == "timecode-format") {
if (session) {
primary_clock.set (session->audible_frame(), true);
secondary_clock.set (session->audible_frame(), true);
vector<AudioClock*> AudioClock::clocks;
const uint32_t AudioClock::field_length[(int) AudioClock::AudioFrames+1] = {
- 2, /* SMPTE_Hours */
- 2, /* SMPTE_Minutes */
- 2, /* SMPTE_Seconds */
- 2, /* SMPTE_Frames */
+ 2, /* Timecode_Hours */
+ 2, /* Timecode_Minutes */
+ 2, /* Timecode_Seconds */
+ 2, /* Timecode_Frames */
2, /* MS_Hours */
2, /* MS_Minutes */
5, /* MS_Seconds */
if (with_info) {
frames_upper_info_label = manage (new Label);
frames_lower_info_label = manage (new Label);
- smpte_upper_info_label = manage (new Label);
- smpte_lower_info_label = manage (new Label);
+ timecode_upper_info_label = manage (new Label);
+ timecode_lower_info_label = manage (new Label);
bbt_upper_info_label = manage (new Label);
bbt_lower_info_label = manage (new Label);
frames_upper_info_label->set_name ("AudioClockFramesUpperInfo");
frames_lower_info_label->set_name ("AudioClockFramesLowerInfo");
- smpte_upper_info_label->set_name ("AudioClockSMPTEUpperInfo");
- smpte_lower_info_label->set_name ("AudioClockSMPTELowerInfo");
+ timecode_upper_info_label->set_name ("AudioClockTimecodeUpperInfo");
+ timecode_lower_info_label->set_name ("AudioClockTimecodeLowerInfo");
bbt_upper_info_label->set_name ("AudioClockBBTUpperInfo");
bbt_lower_info_label->set_name ("AudioClockBBTLowerInfo");
- Gtkmm2ext::set_size_request_to_display_given_text(*smpte_upper_info_label, "23.98",0,0);
- Gtkmm2ext::set_size_request_to_display_given_text(*smpte_lower_info_label, "NDF",0,0);
+ Gtkmm2ext::set_size_request_to_display_given_text(*timecode_upper_info_label, "23.98",0,0);
+ Gtkmm2ext::set_size_request_to_display_given_text(*timecode_lower_info_label, "NDF",0,0);
Gtkmm2ext::set_size_request_to_display_given_text(*bbt_upper_info_label, "88|88",0,0);
Gtkmm2ext::set_size_request_to_display_given_text(*bbt_lower_info_label, "888.88",0,0);
frames_info_box.pack_start (*frames_upper_info_label, true, true);
frames_info_box.pack_start (*frames_lower_info_label, true, true);
- smpte_info_box.pack_start (*smpte_upper_info_label, true, true);
- smpte_info_box.pack_start (*smpte_lower_info_label, true, true);
+ timecode_info_box.pack_start (*timecode_upper_info_label, true, true);
+ timecode_info_box.pack_start (*timecode_lower_info_label, true, true);
bbt_info_box.pack_start (*bbt_upper_info_label, true, true);
bbt_info_box.pack_start (*bbt_lower_info_label, true, true);
} else {
frames_upper_info_label = 0;
frames_lower_info_label = 0;
- smpte_upper_info_label = 0;
- smpte_lower_info_label = 0;
+ timecode_upper_info_label = 0;
+ timecode_lower_info_label = 0;
bbt_upper_info_label = 0;
bbt_lower_info_label = 0;
}
ms_minutes_ebox.add (ms_minutes_label);
ms_seconds_ebox.add (ms_seconds_label);
- smpte_packer.set_homogeneous (false);
- smpte_packer.set_border_width (2);
- smpte_packer.pack_start (hours_ebox, false, false);
- smpte_packer.pack_start (colon1, false, false);
- smpte_packer.pack_start (minutes_ebox, false, false);
- smpte_packer.pack_start (colon2, false, false);
- smpte_packer.pack_start (seconds_ebox, false, false);
- smpte_packer.pack_start (colon3, false, false);
- smpte_packer.pack_start (frames_ebox, false, false);
+ timecode_packer.set_homogeneous (false);
+ timecode_packer.set_border_width (2);
+ timecode_packer.pack_start (hours_ebox, false, false);
+ timecode_packer.pack_start (colon1, false, false);
+ timecode_packer.pack_start (minutes_ebox, false, false);
+ timecode_packer.pack_start (colon2, false, false);
+ timecode_packer.pack_start (seconds_ebox, false, false);
+ timecode_packer.pack_start (colon3, false, false);
+ timecode_packer.pack_start (frames_ebox, false, false);
if (with_info) {
- smpte_packer.pack_start (smpte_info_box, false, false, 5);
+ timecode_packer.pack_start (timecode_info_box, false, false, 5);
}
- smpte_packer_hbox.pack_start (smpte_packer, true, false);
+ timecode_packer_hbox.pack_start (timecode_packer, true, false);
bbt_packer.set_homogeneous (false);
bbt_packer.set_border_width (2);
set_widget_name (widget_name);
_mode = BBT; /* lie to force mode switch */
- set_mode (SMPTE);
+ set_mode (Timecode);
pack_start (clock_frame, true, true);
*/
clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
- clock_base.signal_button_release_event().connect (bind (mem_fun (*this, &AudioClock::field_button_release_event), SMPTE_Hours));
+ clock_base.signal_button_release_event().connect (bind (mem_fun (*this, &AudioClock::field_button_release_event), Timecode_Hours));
- Session::SMPTEOffsetChanged.connect (mem_fun (*this, &AudioClock::smpte_offset_changed));
+ Session::TimecodeOffsetChanged.connect (mem_fun (*this, &AudioClock::timecode_offset_changed));
if (editable) {
setup_events ();
ms_minutes_ebox.set_flags (Gtk::CAN_FOCUS);
ms_seconds_ebox.set_flags (Gtk::CAN_FOCUS);
- hours_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Hours));
- minutes_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Minutes));
- seconds_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Seconds));
- frames_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), SMPTE_Frames));
+ hours_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Timecode_Hours));
+ minutes_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Timecode_Minutes));
+ seconds_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Timecode_Seconds));
+ frames_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Timecode_Frames));
audio_frames_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), AudioFrames));
bars_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Bars));
beats_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), Beats));
ms_minutes_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), MS_Minutes));
ms_seconds_ebox.signal_motion_notify_event().connect (bind (mem_fun(*this, &AudioClock::field_motion_notify_event), MS_Seconds));
- hours_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Hours));
- minutes_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Minutes));
- seconds_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Seconds));
- frames_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), SMPTE_Frames));
+ hours_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Timecode_Hours));
+ minutes_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Timecode_Minutes));
+ seconds_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Timecode_Seconds));
+ frames_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Timecode_Frames));
audio_frames_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), AudioFrames));
bars_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Bars));
beats_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), Beats));
ms_minutes_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), MS_Minutes));
ms_seconds_ebox.signal_button_press_event().connect (bind (mem_fun(*this, &AudioClock::field_button_press_event), MS_Seconds));
- hours_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Hours));
- minutes_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Minutes));
- seconds_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Seconds));
- frames_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), SMPTE_Frames));
+ hours_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Timecode_Hours));
+ minutes_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Timecode_Minutes));
+ seconds_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Timecode_Seconds));
+ frames_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Timecode_Frames));
audio_frames_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), AudioFrames));
bars_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Bars));
beats_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), Beats));
ms_minutes_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), MS_Minutes));
ms_seconds_ebox.signal_button_release_event().connect (bind (mem_fun(*this, &AudioClock::field_button_release_event), MS_Seconds));
- hours_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Hours));
- minutes_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Minutes));
- seconds_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Seconds));
- frames_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), SMPTE_Frames));
+ hours_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Timecode_Hours));
+ minutes_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Timecode_Minutes));
+ seconds_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Timecode_Seconds));
+ frames_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Timecode_Frames));
audio_frames_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), AudioFrames));
bars_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Bars));
beats_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), Beats));
ms_minutes_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), MS_Minutes));
ms_seconds_ebox.signal_scroll_event().connect (bind (mem_fun(*this, &AudioClock::field_button_scroll_event), MS_Seconds));
- hours_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Hours));
- minutes_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Minutes));
- seconds_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Seconds));
- frames_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), SMPTE_Frames));
+ hours_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Timecode_Hours));
+ minutes_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Timecode_Minutes));
+ seconds_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Timecode_Seconds));
+ frames_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Timecode_Frames));
audio_frames_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), AudioFrames));
bars_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Bars));
beats_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), Beats));
ms_minutes_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), MS_Minutes));
ms_seconds_ebox.signal_key_press_event().connect (bind (mem_fun(*this, &AudioClock::field_key_press_event), MS_Seconds));
- hours_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Hours));
- minutes_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Minutes));
- seconds_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Seconds));
- frames_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), SMPTE_Frames));
+ hours_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Timecode_Hours));
+ minutes_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Timecode_Minutes));
+ seconds_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Timecode_Seconds));
+ frames_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Timecode_Frames));
audio_frames_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), AudioFrames));
bars_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Bars));
beats_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), Beats));
ms_minutes_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), MS_Minutes));
ms_seconds_ebox.signal_key_release_event().connect (bind (mem_fun(*this, &AudioClock::field_key_release_event), MS_Seconds));
- hours_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Hours));
- minutes_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Minutes));
- seconds_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Seconds));
- frames_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), SMPTE_Frames));
+ hours_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Timecode_Hours));
+ minutes_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Timecode_Minutes));
+ seconds_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Timecode_Seconds));
+ frames_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Timecode_Frames));
audio_frames_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), AudioFrames));
bars_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Bars));
beats_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), Beats));
ms_minutes_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), MS_Minutes));
ms_seconds_ebox.signal_focus_in_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_in_event), MS_Seconds));
- hours_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Hours));
- minutes_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Minutes));
- seconds_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Seconds));
- frames_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), SMPTE_Frames));
+ hours_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Timecode_Hours));
+ minutes_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Timecode_Minutes));
+ seconds_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Timecode_Seconds));
+ frames_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Timecode_Frames));
audio_frames_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), AudioFrames));
bars_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Bars));
beats_ebox.signal_focus_out_event().connect (bind (mem_fun(*this, &AudioClock::field_focus_out_event), Beats));
}
switch (_mode) {
- case SMPTE:
- set_smpte (when, force);
+ case Timecode:
+ set_timecode (when, force);
break;
case BBT:
}
void
-AudioClock::smpte_offset_changed ()
+AudioClock::timecode_offset_changed ()
{
nframes_t current;
switch (_mode) {
- case SMPTE:
+ case Timecode:
if (is_duration) {
current = current_duration();
} else {
}
void
-AudioClock::set_smpte (nframes_t when, bool force)
+AudioClock::set_timecode (nframes_t when, bool force)
{
char buf[32];
- SMPTE::Time smpte;
+ Timecode::Time timecode;
if (is_duration) {
- session->smpte_duration (when, smpte);
+ session->timecode_duration (when, timecode);
} else {
- session->smpte_time (when, smpte);
+ session->timecode_time (when, timecode);
}
- if (force || smpte.hours != last_hrs || smpte.negative != last_negative) {
- if (smpte.negative) {
- sprintf (buf, "-%02" PRIu32, smpte.hours);
+ if (force || timecode.hours != last_hrs || timecode.negative != last_negative) {
+ if (timecode.negative) {
+ sprintf (buf, "-%02" PRIu32, timecode.hours);
} else {
- sprintf (buf, " %02" PRIu32, smpte.hours);
+ sprintf (buf, " %02" PRIu32, timecode.hours);
}
hours_label.set_text (buf);
- last_hrs = smpte.hours;
- last_negative = smpte.negative;
+ last_hrs = timecode.hours;
+ last_negative = timecode.negative;
}
- if (force || smpte.minutes != last_mins) {
- sprintf (buf, "%02" PRIu32, smpte.minutes);
+ if (force || timecode.minutes != last_mins) {
+ sprintf (buf, "%02" PRIu32, timecode.minutes);
minutes_label.set_text (buf);
- last_mins = smpte.minutes;
+ last_mins = timecode.minutes;
}
- if (force || smpte.seconds != last_secs) {
- sprintf (buf, "%02" PRIu32, smpte.seconds);
+ if (force || timecode.seconds != last_secs) {
+ sprintf (buf, "%02" PRIu32, timecode.seconds);
seconds_label.set_text (buf);
- last_secs = smpte.seconds;
+ last_secs = timecode.seconds;
}
- if (force || smpte.frames != last_frames) {
- sprintf (buf, "%02" PRIu32, smpte.frames);
+ if (force || timecode.frames != last_frames) {
+ sprintf (buf, "%02" PRIu32, timecode.frames);
frames_label.set_text (buf);
- last_frames = smpte.frames;
+ last_frames = timecode.frames;
}
- if (smpte_upper_info_label) {
- double smpte_frames = session->smpte_frames_per_second();
+ if (timecode_upper_info_label) {
+ double timecode_frames = session->timecode_frames_per_second();
- if ( fmod(smpte_frames, 1.0) == 0.0) {
- sprintf (buf, "%u", int (smpte_frames));
+ if ( fmod(timecode_frames, 1.0) == 0.0) {
+ sprintf (buf, "%u", int (timecode_frames));
} else {
- sprintf (buf, "%.2f", smpte_frames);
+ sprintf (buf, "%.2f", timecode_frames);
}
- if (smpte_upper_info_label->get_text() != buf) {
- smpte_upper_info_label->set_text (buf);
+ if (timecode_upper_info_label->get_text() != buf) {
+ timecode_upper_info_label->set_text (buf);
}
- if ((fabs(smpte_frames - 29.97) < 0.0001) || smpte_frames == 30) {
- if (session->smpte_drop_frames()) {
+ if ((fabs(timecode_frames - 29.97) < 0.0001) || timecode_frames == 30) {
+ if (session->timecode_drop_frames()) {
sprintf (buf, "DF");
} else {
sprintf (buf, "NDF");
buf[0] = '\0';
}
- if (smpte_lower_info_label->get_text() != buf) {
- smpte_lower_info_label->set_text (buf);
+ if (timecode_lower_info_label->get_text() != buf) {
+ timecode_lower_info_label->set_text (buf);
}
}
}
AudioClock::focus ()
{
switch (_mode) {
- case SMPTE:
+ case Timecode:
hours_ebox.grab_focus ();
break;
bool move_on = false;
switch (field) {
- case SMPTE_Hours:
+ case Timecode_Hours:
label = &hours_label;
break;
- case SMPTE_Minutes:
+ case Timecode_Minutes:
label = &minutes_label;
break;
- case SMPTE_Seconds:
+ case Timecode_Seconds:
label = &seconds_label;
break;
- case SMPTE_Frames:
+ case Timecode_Frames:
label = &frames_label;
break;
if (key_entry_state) {
switch (field) {
- case SMPTE_Hours:
- case SMPTE_Minutes:
- case SMPTE_Seconds:
- case SMPTE_Frames:
- // Check SMPTE fields for sanity (may also adjust fields)
- smpte_sanitize_display();
+ case Timecode_Hours:
+ case Timecode_Minutes:
+ case Timecode_Seconds:
+ case Timecode_Frames:
+ // Check Timecode fields for sanity (may also adjust fields)
+ timecode_sanitize_display();
break;
case Bars:
case Beats:
switch (field) {
- /* SMPTE */
+ /* Timecode */
- case SMPTE_Hours:
+ case Timecode_Hours:
minutes_ebox.grab_focus ();
break;
- case SMPTE_Minutes:
+ case Timecode_Minutes:
seconds_ebox.grab_focus ();
break;
- case SMPTE_Seconds:
+ case Timecode_Seconds:
frames_ebox.grab_focus ();
break;
- case SMPTE_Frames:
+ case Timecode_Frames:
clock_base.grab_focus ();
break;
Keyboard::magic_widget_grab_focus ();
switch (field) {
- case SMPTE_Hours:
+ case Timecode_Hours:
hours_ebox.set_flags (Gtk::HAS_FOCUS);
hours_ebox.set_state (Gtk::STATE_ACTIVE);
break;
- case SMPTE_Minutes:
+ case Timecode_Minutes:
minutes_ebox.set_flags (Gtk::HAS_FOCUS);
minutes_ebox.set_state (Gtk::STATE_ACTIVE);
break;
- case SMPTE_Seconds:
+ case Timecode_Seconds:
seconds_ebox.set_flags (Gtk::HAS_FOCUS);
seconds_ebox.set_state (Gtk::STATE_ACTIVE);
break;
- case SMPTE_Frames:
+ case Timecode_Frames:
frames_ebox.set_flags (Gtk::HAS_FOCUS);
frames_ebox.set_state (Gtk::STATE_ACTIVE);
break;
{
switch (field) {
- case SMPTE_Hours:
+ case Timecode_Hours:
hours_ebox.unset_flags (Gtk::HAS_FOCUS);
hours_ebox.set_state (Gtk::STATE_NORMAL);
break;
- case SMPTE_Minutes:
+ case Timecode_Minutes:
minutes_ebox.unset_flags (Gtk::HAS_FOCUS);
minutes_ebox.set_state (Gtk::STATE_NORMAL);
break;
- case SMPTE_Seconds:
+ case Timecode_Seconds:
seconds_ebox.unset_flags (Gtk::HAS_FOCUS);
seconds_ebox.set_state (Gtk::STATE_NORMAL);
break;
- case SMPTE_Frames:
+ case Timecode_Frames:
frames_ebox.unset_flags (Gtk::HAS_FOCUS);
frames_ebox.set_state (Gtk::STATE_NORMAL);
break;
switch (ev->button) {
case 1:
switch (field) {
- case SMPTE_Hours:
+ case Timecode_Hours:
hours_ebox.grab_focus();
break;
- case SMPTE_Minutes:
+ case Timecode_Minutes:
minutes_ebox.grab_focus();
break;
- case SMPTE_Seconds:
+ case Timecode_Seconds:
seconds_ebox.grab_focus();
break;
- case SMPTE_Frames:
+ case Timecode_Frames:
frames_ebox.grab_focus();
break;
nframes_t frames = 0;
BBT_Time bbt;
switch (field) {
- case SMPTE_Hours:
+ case Timecode_Hours:
frames = (nframes_t) floor (3600.0 * session->frame_rate());
break;
- case SMPTE_Minutes:
+ case Timecode_Minutes:
frames = (nframes_t) floor (60.0 * session->frame_rate());
break;
- case SMPTE_Seconds:
+ case Timecode_Seconds:
frames = session->frame_rate();
break;
- case SMPTE_Frames:
- frames = (nframes_t) floor (session->frame_rate() / session->smpte_frames_per_second());
+ case Timecode_Frames:
+ frames = (nframes_t) floor (session->frame_rate() / session->timecode_frames_per_second());
break;
case AudioFrames:
nframes_t ret = 0;
switch (_mode) {
- case SMPTE:
- ret = smpte_frame_from_display ();
+ case Timecode:
+ ret = timecode_frame_from_display ();
break;
case BBT:
ret = bbt_frame_from_display (pos);
nframes_t ret = 0;
switch (_mode) {
- case SMPTE:
- ret = smpte_frame_from_display ();
+ case Timecode:
+ ret = timecode_frame_from_display ();
break;
case BBT:
ret = bbt_frame_duration_from_display (pos);
}
void
-AudioClock::smpte_sanitize_display()
+AudioClock::timecode_sanitize_display()
{
- // Check SMPTE fields for sanity, possibly adjusting values
+ // Check Timecode fields for sanity, possibly adjusting values
if (atoi(minutes_label.get_text()) > 59) {
minutes_label.set_text("59");
}
seconds_label.set_text("59");
}
- switch ((long)rint(session->smpte_frames_per_second())) {
+ switch ((long)rint(session->timecode_frames_per_second())) {
case 24:
if (atoi(frames_label.get_text()) > 23) {
frames_label.set_text("23");
break;
}
- if (session->smpte_drop_frames()) {
+ if (session->timecode_drop_frames()) {
if ((atoi(minutes_label.get_text()) % 10) && (atoi(seconds_label.get_text()) == 0) && (atoi(frames_label.get_text()) < 2)) {
frames_label.set_text("02");
}
}
nframes_t
-AudioClock::smpte_frame_from_display () const
+AudioClock::timecode_frame_from_display () const
{
if (session == 0) {
return 0;
}
- SMPTE::Time smpte;
+ Timecode::Time timecode;
nframes_t sample;
- smpte.hours = atoi (hours_label.get_text());
- smpte.minutes = atoi (minutes_label.get_text());
- smpte.seconds = atoi (seconds_label.get_text());
- smpte.frames = atoi (frames_label.get_text());
- smpte.rate = session->smpte_frames_per_second();
- smpte.drop= session->smpte_drop_frames();
+ timecode.hours = atoi (hours_label.get_text());
+ timecode.minutes = atoi (minutes_label.get_text());
+ timecode.seconds = atoi (seconds_label.get_text());
+ timecode.frames = atoi (frames_label.get_text());
+ timecode.rate = session->timecode_frames_per_second();
+ timecode.drop= session->timecode_drop_frames();
- session->smpte_to_sample( smpte, sample, false /* use_offset */, false /* use_subframes */ );
+ session->timecode_to_sample( timecode, sample, false /* use_offset */, false /* use_subframes */ );
#if 0
-#define SMPTE_SAMPLE_TEST_1
-#define SMPTE_SAMPLE_TEST_2
-#define SMPTE_SAMPLE_TEST_3
-#define SMPTE_SAMPLE_TEST_4
-#define SMPTE_SAMPLE_TEST_5
-#define SMPTE_SAMPLE_TEST_6
-#define SMPTE_SAMPLE_TEST_7
-
- // Testcode for smpte<->sample conversions (P.S.)
- SMPTE::Time smpte1;
+#define Timecode_SAMPLE_TEST_1
+#define Timecode_SAMPLE_TEST_2
+#define Timecode_SAMPLE_TEST_3
+#define Timecode_SAMPLE_TEST_4
+#define Timecode_SAMPLE_TEST_5
+#define Timecode_SAMPLE_TEST_6
+#define Timecode_SAMPLE_TEST_7
+
+ // Testcode for timecode<->sample conversions (P.S.)
+ Timecode::Time timecode1;
nframes_t sample1;
nframes_t oldsample = 0;
- SMPTE::Time smpte2;
+ Timecode::Time timecode2;
nframes_t sample_increment;
- sample_increment = (long)rint(session->frame_rate() / session->smpte_frames_per_second);
+ sample_increment = (long)rint(session->frame_rate() / session->timecode_frames_per_second);
-#ifdef SMPTE_SAMPLE_TEST_1
+#ifdef Timecode_SAMPLE_TEST_1
// Test 1: use_offset = false, use_subframes = false
cout << "use_offset = false, use_subframes = false" << endl;
for (int i = 0; i < 108003; i++) {
- session->smpte_to_sample( smpte1, sample1, false /* use_offset */, false /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, false /* use_offset */, false /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, false /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, false /* use_offset */, false /* use_subframes */ );
if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
- cout << "smpte1: " << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ cout << "timecode1: " << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte1: " << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode1: " << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_increment( smpte1 );
+ session->timecode_increment( timecode1 );
}
cout << "sample_increment: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
#endif
-#ifdef SMPTE_SAMPLE_TEST_2
+#ifdef Timecode_SAMPLE_TEST_2
// Test 2: use_offset = true, use_subframes = false
cout << "use_offset = true, use_subframes = false" << endl;
- smpte1.hours = 0;
- smpte1.minutes = 0;
- smpte1.seconds = 0;
- smpte1.frames = 0;
- smpte1.subframes = 0;
+ timecode1.hours = 0;
+ timecode1.minutes = 0;
+ timecode1.seconds = 0;
+ timecode1.frames = 0;
+ timecode1.subframes = 0;
sample1 = oldsample = 0;
- session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode1, true /* use_offset */, false /* use_subframes */ );
cout << "Starting at sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << endl;
for (int i = 0; i < 108003; i++) {
- session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, true /* use_offset */, false /* use_subframes */ );
-// cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+// cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
// cout << "sample: " << sample1 << endl;
// cout << "sample: " << sample1 << " -> ";
-// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+// cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_increment( smpte1 );
+ session->timecode_increment( timecode1 );
}
cout << "sample_increment: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
#endif
-#ifdef SMPTE_SAMPLE_TEST_3
+#ifdef Timecode_SAMPLE_TEST_3
// Test 3: use_offset = true, use_subframes = false, decrement
cout << "use_offset = true, use_subframes = false, decrement" << endl;
- session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode1, true /* use_offset */, false /* use_subframes */ );
cout << "Starting at sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << endl;
for (int i = 0; i < 108003; i++) {
- session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, true /* use_offset */, false /* use_subframes */ );
-// cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+// cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
// cout << "sample: " << sample1 << endl;
// cout << "sample: " << sample1 << " -> ";
-// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+// cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
if ((i > 0) && ( ((oldsample - sample1) != sample_increment) && ((oldsample - sample1) != (sample_increment + 1)) && ((oldsample - sample1) != (sample_increment - 1)))) {
cout << "ERROR: sample increment not right: " << (oldsample - sample1) << " != " << sample_increment << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_decrement( smpte1 );
+ session->timecode_decrement( timecode1 );
}
cout << "sample_decrement: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
#endif
-#ifdef SMPTE_SAMPLE_TEST_4
+#ifdef Timecode_SAMPLE_TEST_4
// Test 4: use_offset = true, use_subframes = true
cout << "use_offset = true, use_subframes = true" << endl;
for (long sub = 5; sub < 80; sub += 5) {
- smpte1.hours = 0;
- smpte1.minutes = 0;
- smpte1.seconds = 0;
- smpte1.frames = 0;
- smpte1.subframes = 0;
+ timecode1.hours = 0;
+ timecode1.minutes = 0;
+ timecode1.seconds = 0;
+ timecode1.frames = 0;
+ timecode1.subframes = 0;
sample1 = oldsample = (sample_increment * sub) / 80;
- session->sample_to_smpte( sample1, smpte1, true /* use_offset */, true /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode1, true /* use_offset */, true /* use_subframes */ );
cout << "starting at sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << endl;
for (int i = 0; i < 108003; i++) {
- session->smpte_to_sample( smpte1, sample1, true /* use_offset */, true /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, true /* use_offset */, true /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, true /* use_offset */, true /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, true /* use_offset */, true /* use_subframes */ );
if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1)))) {
cout << "ERROR: sample increment not right: " << (sample1 - oldsample) << " != " << sample_increment << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
//break;
}
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames || smpte2.subframes != smpte1.subframes) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames || timecode2.subframes != timecode1.subframes) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_increment( smpte1 );
+ session->timecode_increment( timecode1 );
}
cout << "sample_increment: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
for (int i = 0; i < 108003; i++) {
- session->smpte_to_sample( smpte1, sample1, true /* use_offset */, true /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, true /* use_offset */, true /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, true /* use_offset */, true /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, true /* use_offset */, true /* use_subframes */ );
if ((i > 0) && ( ((oldsample - sample1) != sample_increment) && ((oldsample - sample1) != (sample_increment + 1)) && ((oldsample - sample1) != (sample_increment - 1)))) {
cout << "ERROR: sample increment not right: " << (oldsample - sample1) << " != " << sample_increment << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
//break;
}
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames || smpte2.subframes != smpte1.subframes) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte1: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames || timecode2.subframes != timecode1.subframes) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode1: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte2: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode2: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_decrement( smpte1 );
+ session->timecode_decrement( timecode1 );
}
cout << "sample_decrement: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
}
#endif
-#ifdef SMPTE_SAMPLE_TEST_5
+#ifdef Timecode_SAMPLE_TEST_5
// Test 5: use_offset = true, use_subframes = false, increment seconds
cout << "use_offset = true, use_subframes = false, increment seconds" << endl;
- smpte1.hours = 0;
- smpte1.minutes = 0;
- smpte1.seconds = 0;
- smpte1.frames = 0;
- smpte1.subframes = 0;
+ timecode1.hours = 0;
+ timecode1.minutes = 0;
+ timecode1.seconds = 0;
+ timecode1.frames = 0;
+ timecode1.subframes = 0;
sample1 = oldsample = 0;
sample_increment = session->frame_rate();
- session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode1, true /* use_offset */, false /* use_subframes */ );
cout << "Starting at sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << endl;
for (int i = 0; i < 3600; i++) {
- session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, true /* use_offset */, false /* use_subframes */ );
-// cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+// cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
// cout << "sample: " << sample1 << endl;
// cout << "sample: " << sample1 << " -> ";
-// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+// cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
// if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
// {
// break;
// }
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_increment_seconds( smpte1 );
+ session->timecode_increment_seconds( timecode1 );
}
cout << "sample_increment: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
#endif
-#ifdef SMPTE_SAMPLE_TEST_6
+#ifdef Timecode_SAMPLE_TEST_6
// Test 6: use_offset = true, use_subframes = false, increment minutes
cout << "use_offset = true, use_subframes = false, increment minutes" << endl;
- smpte1.hours = 0;
- smpte1.minutes = 0;
- smpte1.seconds = 0;
- smpte1.frames = 0;
- smpte1.subframes = 0;
+ timecode1.hours = 0;
+ timecode1.minutes = 0;
+ timecode1.seconds = 0;
+ timecode1.frames = 0;
+ timecode1.subframes = 0;
sample1 = oldsample = 0;
sample_increment = session->frame_rate() * 60;
- session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode1, true /* use_offset */, false /* use_subframes */ );
cout << "Starting at sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << endl;
for (int i = 0; i < 60; i++) {
- session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, true /* use_offset */, false /* use_subframes */ );
-// cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+// cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
// cout << "sample: " << sample1 << endl;
// cout << "sample: " << sample1 << " -> ";
-// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+// cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
// if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
// {
// break;
// }
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_increment_minutes( smpte1 );
+ session->timecode_increment_minutes( timecode1 );
}
cout << "sample_increment: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
#endif
-#ifdef SMPTE_SAMPLE_TEST_7
+#ifdef Timecode_SAMPLE_TEST_7
// Test 7: use_offset = true, use_subframes = false, increment hours
cout << "use_offset = true, use_subframes = false, increment hours" << endl;
- smpte1.hours = 0;
- smpte1.minutes = 0;
- smpte1.seconds = 0;
- smpte1.frames = 0;
- smpte1.subframes = 0;
+ timecode1.hours = 0;
+ timecode1.minutes = 0;
+ timecode1.seconds = 0;
+ timecode1.frames = 0;
+ timecode1.subframes = 0;
sample1 = oldsample = 0;
sample_increment = session->frame_rate() * 60 * 60;
- session->sample_to_smpte( sample1, smpte1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode1, true /* use_offset */, false /* use_subframes */ );
cout << "Starting at sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << endl;
for (int i = 0; i < 10; i++) {
- session->smpte_to_sample( smpte1, sample1, true /* use_offset */, false /* use_subframes */ );
- session->sample_to_smpte( sample1, smpte2, true /* use_offset */, false /* use_subframes */ );
+ session->timecode_to_sample( timecode1, sample1, true /* use_offset */, false /* use_subframes */ );
+ session->sample_to_timecode( sample1, timecode2, true /* use_offset */, false /* use_subframes */ );
-// cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+// cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
// cout << "sample: " << sample1 << endl;
// cout << "sample: " << sample1 << " -> ";
-// cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+// cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
// if ((i > 0) && ( ((sample1 - oldsample) != sample_increment) && ((sample1 - oldsample) != (sample_increment + 1)) && ((sample1 - oldsample) != (sample_increment - 1))))
// {
// break;
// }
- if (smpte2.hours != smpte1.hours || smpte2.minutes != smpte1.minutes || smpte2.seconds != smpte2.seconds || smpte2.frames != smpte1.frames) {
- cout << "ERROR: smpte2 not equal smpte1" << endl;
- cout << "smpte: " << (smpte1.negative ? "-" : "") << smpte1.hours << ":" << smpte1.minutes << ":" << smpte1.seconds << ":" << smpte1.frames << "::" << smpte1.subframes << " -> ";
+ if (timecode2.hours != timecode1.hours || timecode2.minutes != timecode1.minutes || timecode2.seconds != timecode2.seconds || timecode2.frames != timecode1.frames) {
+ cout << "ERROR: timecode2 not equal timecode1" << endl;
+ cout << "timecode: " << (timecode1.negative ? "-" : "") << timecode1.hours << ":" << timecode1.minutes << ":" << timecode1.seconds << ":" << timecode1.frames << "::" << timecode1.subframes << " -> ";
cout << "sample: " << sample1 << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
break;
}
oldsample = sample1;
- session->smpte_increment_hours( smpte1 );
+ session->timecode_increment_hours( timecode1 );
}
cout << "sample_increment: " << sample_increment << endl;
cout << "sample: " << sample1 << " -> ";
- cout << "smpte: " << (smpte2.negative ? "-" : "") << smpte2.hours << ":" << smpte2.minutes << ":" << smpte2.seconds << ":" << smpte2.frames << "::" << smpte2.subframes << endl;
+ cout << "timecode: " << (timecode2.negative ? "-" : "") << timecode2.hours << ":" << timecode2.minutes << ":" << timecode2.seconds << ":" << timecode2.frames << "::" << timecode2.subframes << endl;
#endif
#endif
ops_menu->set_name ("ArdourContextMenu");
if (!Profile->get_sae()) {
- ops_items.push_back (MenuElem (_("Timecode"), bind (mem_fun(*this, &AudioClock::set_mode), SMPTE)));
+ ops_items.push_back (MenuElem (_("Timecode"), bind (mem_fun(*this, &AudioClock::set_mode), Timecode)));
}
ops_items.push_back (MenuElem (_("Bars:Beats"), bind (mem_fun(*this, &AudioClock::set_mode), BBT)));
ops_items.push_back (MenuElem (_("Minutes:Seconds"), bind (mem_fun(*this, &AudioClock::set_mode), MinSec)));
_mode = m;
switch (_mode) {
- case SMPTE:
- clock_base.add (smpte_packer_hbox);
+ case Timecode:
+ clock_base.add (timecode_packer_hbox);
break;
case BBT:
/* note that in some fonts, "88" is narrower than "00", hence the 2 pixel padding */
switch (_mode) {
- case SMPTE:
+ case Timecode:
Gtkmm2ext::set_size_request_to_display_given_text (hours_label, "-00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (minutes_label, "00", 5, 5);
Gtkmm2ext::set_size_request_to_display_given_text (seconds_label, "00", 5, 5);
{
public:
enum Mode {
- SMPTE,
+ Timecode,
BBT,
MinSec,
Frames,
Gtk::Menu *ops_menu;
- Gtk::HBox smpte_packer_hbox;
- Gtk::HBox smpte_packer;
+ Gtk::HBox timecode_packer_hbox;
+ Gtk::HBox timecode_packer;
Gtk::HBox minsec_packer_hbox;
Gtk::HBox minsec_packer;
Gtk::HBox frames_packer;
enum Field {
- SMPTE_Hours,
- SMPTE_Minutes,
- SMPTE_Seconds,
- SMPTE_Frames,
+ Timecode_Hours,
+ Timecode_Minutes,
+ Timecode_Seconds,
+ Timecode_Frames,
MS_Hours,
MS_Minutes,
MS_Seconds,
Gtk::Label* frames_upper_info_label;
Gtk::Label* frames_lower_info_label;
- Gtk::Label* smpte_upper_info_label;
- Gtk::Label* smpte_lower_info_label;
+ Gtk::Label* timecode_upper_info_label;
+ Gtk::Label* timecode_lower_info_label;
Gtk::Label* bbt_upper_info_label;
Gtk::Label* bbt_lower_info_label;
Gtk::VBox frames_info_box;
- Gtk::VBox smpte_info_box;
+ Gtk::VBox timecode_info_box;
Gtk::VBox bbt_info_box;
Gtk::EventBox clock_base;
bool field_focus_out_event (GdkEventFocus *, Field);
bool drop_focus_handler (GdkEventFocus*);
- void set_smpte (nframes_t, bool);
+ void set_timecode (nframes_t, bool);
void set_bbt (nframes_t, bool);
void set_minsec (nframes_t, bool);
void set_frames (nframes_t, bool);
nframes_t get_frames (Field,nframes_t pos = 0,int dir=1);
- void smpte_sanitize_display();
- nframes_t smpte_frame_from_display () const;
+ void timecode_sanitize_display();
+ nframes_t timecode_frame_from_display () const;
nframes_t bbt_frame_from_display (nframes_t) const;
nframes_t bbt_frame_duration_from_display (nframes_t) const;
nframes_t minsec_frame_from_display () const;
void build_ops_menu ();
void setup_events ();
- void smpte_offset_changed ();
+ void timecode_offset_changed ();
void set_size_requests ();
static const uint32_t field_length[(int)AudioFrames+1];
/* Changing this order will break the menu */
SNAPTYPE(SnapToCDFrame)
-SNAPTYPE(SnapToSMPTEFrame)
-SNAPTYPE(SnapToSMPTESeconds)
-SNAPTYPE(SnapToSMPTEMinutes)
+SNAPTYPE(SnapToTimecodeFrame)
+SNAPTYPE(SnapToTimecodeSeconds)
+SNAPTYPE(SnapToTimecodeMinutes)
SNAPTYPE(SnapToSeconds)
SNAPTYPE(SnapToMinutes)
SNAPTYPE(SnapToAThirtysecondBeat)
static const gchar *_snap_type_strings[] = {
N_("CD Frames"),
- N_("SMPTE Frames"),
- N_("SMPTE Seconds"),
- N_("SMPTE Minutes"),
+ N_("Timecode Frames"),
+ N_("Timecode Seconds"),
+ N_("Timecode Minutes"),
N_("Seconds"),
N_("Minutes"),
N_("Beats/32"),
/* time display buttons */
: minsec_label (_("Mins:Secs"))
, bbt_label (_("Bars:Beats"))
- , smpte_label (_("Timecode"))
+ , timecode_label (_("Timecode"))
, frame_label (_("Samples"))
, tempo_label (_("Tempo"))
, meter_label (_("Meter"))
minsec_label.set_padding (5,0);
minsec_label.hide ();
minsec_label.set_no_show_all();
- smpte_label.set_name ("EditorTimeButton");
- smpte_label.set_size_request (-1, (int)timebar_height);
- smpte_label.set_alignment (1.0, 0.5);
- smpte_label.set_padding (5,0);
- smpte_label.hide ();
- smpte_label.set_no_show_all();
+ timecode_label.set_name ("EditorTimeButton");
+ timecode_label.set_size_request (-1, (int)timebar_height);
+ timecode_label.set_alignment (1.0, 0.5);
+ timecode_label.set_padding (5,0);
+ timecode_label.hide ();
+ timecode_label.set_no_show_all();
frame_label.set_name ("EditorTimeButton");
frame_label.set_size_request (-1, (int)timebar_height);
frame_label.set_alignment (1.0, 0.5);
session_connections.push_back (session->StateSaved.connect (mem_fun(*this, &Editor::update_title_s)));
session_connections.push_back (session->AskAboutPlaylistDeletion.connect (mem_fun(*this, &Editor::playlist_deletion_dialog)));
- session_connections.push_back (session->SMPTEOffsetChanged.connect (mem_fun(*this, &Editor::update_just_smpte)));
+ session_connections.push_back (session->TimecodeOffsetChanged.connect (mem_fun(*this, &Editor::update_just_timecode)));
session_connections.push_back (session->tempo_map().StateChanged.connect (mem_fun(*this, &Editor::tempo_map_changed)));
nudge_clock.set (pos, true, 0, AudioClock::BBT);
} else {
- nudge_clock.set (session->frame_rate() * 5, true, 0, AudioClock::SMPTE); // default of 5 seconds
+ nudge_clock.set (session->frame_rate() * 5, true, 0, AudioClock::Timecode); // default of 5 seconds
}
playhead_cursor->canvas_item.show ();
}
void
-Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark)
+Editor::timecode_snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark)
{
- nframes64_t before;
- nframes64_t after;
-
- const nframes64_t one_second = session->frame_rate();
- const nframes64_t one_minute = session->frame_rate() * 60;
- const nframes64_t one_smpte_second = (nframes64_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame());
- nframes64_t one_smpte_minute = (nframes64_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame() * 60);
- nframes64_t presnap = start;
+ const nframes64_t one_timecode_second = (nframes64_t)(rint(session->timecode_frames_per_second()) * session->frames_per_timecode_frame());
+ nframes64_t one_timecode_minute = (nframes64_t)(rint(session->timecode_frames_per_second()) * session->frames_per_timecode_frame() * 60);
switch (snap_type) {
- case SnapToCDFrame:
- if (((direction == 0) && (start % (one_second/75) > (one_second/75) / 2)) || (direction > 0)) {
- start = (nframes64_t) ceil ((double) start / (one_second / 75)) * (one_second / 75);
+ case SnapToTimecodeFrame:
+ if (((direction == 0) && (fmod((double)start, (double)session->frames_per_timecode_frame()) > (session->frames_per_timecode_frame() / 2))) || (direction > 0)) {
+ start = (nframes64_t) (ceil ((double) start / session->frames_per_timecode_frame()) * session->frames_per_timecode_frame());
} else {
- start = (nframes64_t) floor ((double) start / (one_second / 75)) * (one_second / 75);
- }
- break;
-
- case SnapToSMPTEFrame:
- if (((direction == 0) && (fmod((double)start, (double)session->frames_per_smpte_frame()) > (session->frames_per_smpte_frame() / 2))) || (direction > 0)) {
- start = (nframes64_t) (ceil ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame());
- } else {
- start = (nframes64_t) (floor ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame());
+ start = (nframes64_t) (floor ((double) start / session->frames_per_timecode_frame()) * session->frames_per_timecode_frame());
}
break;
- case SnapToSMPTESeconds:
- if (session->smpte_offset_negative())
+ case SnapToTimecodeSeconds:
+ if (session->timecode_offset_negative())
{
- start += session->smpte_offset ();
+ start += session->timecode_offset ();
} else {
- start -= session->smpte_offset ();
+ start -= session->timecode_offset ();
}
- if (((direction == 0) && (start % one_smpte_second > one_smpte_second / 2)) || direction > 0) {
- start = (nframes64_t) ceil ((double) start / one_smpte_second) * one_smpte_second;
+ if (((direction == 0) && (start % one_timecode_second > one_timecode_second / 2)) || direction > 0) {
+ start = (nframes64_t) ceil ((double) start / one_timecode_second) * one_timecode_second;
} else {
- start = (nframes64_t) floor ((double) start / one_smpte_second) * one_smpte_second;
+ start = (nframes64_t) floor ((double) start / one_timecode_second) * one_timecode_second;
}
- if (session->smpte_offset_negative())
+ if (session->timecode_offset_negative())
{
- start -= session->smpte_offset ();
+ start -= session->timecode_offset ();
} else {
- start += session->smpte_offset ();
+ start += session->timecode_offset ();
}
break;
- case SnapToSMPTEMinutes:
- if (session->smpte_offset_negative())
+ case SnapToTimecodeMinutes:
+ if (session->timecode_offset_negative())
{
- start += session->smpte_offset ();
+ start += session->timecode_offset ();
} else {
- start -= session->smpte_offset ();
+ start -= session->timecode_offset ();
}
- if (((direction == 0) && (start % one_smpte_minute > one_smpte_minute / 2)) || direction > 0) {
- start = (nframes64_t) ceil ((double) start / one_smpte_minute) * one_smpte_minute;
+ if (((direction == 0) && (start % one_timecode_minute > one_timecode_minute / 2)) || direction > 0) {
+ start = (nframes64_t) ceil ((double) start / one_timecode_minute) * one_timecode_minute;
} else {
- start = (nframes64_t) floor ((double) start / one_smpte_minute) * one_smpte_minute;
+ start = (nframes64_t) floor ((double) start / one_timecode_minute) * one_timecode_minute;
}
- if (session->smpte_offset_negative())
+ if (session->timecode_offset_negative())
{
- start -= session->smpte_offset ();
+ start -= session->timecode_offset ();
+ } else {
+ start += session->timecode_offset ();
+ }
+ break;
+ default:
+ fatal << "Editor::smpte_snap_to_internal() called with non-timecode snap type!" << endmsg;
+ /*NOTREACHED*/
+ }
+}
+
+void
+Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark)
+{
+ const nframes64_t one_second = session->frame_rate();
+ const nframes64_t one_minute = session->frame_rate() * 60;
+ nframes64_t presnap = start;
+ nframes64_t before;
+ nframes64_t after;
+
+ switch (snap_type) {
+ case SnapToTimecodeFrame:
+ case SnapToTimecodeSeconds:
+ case SnapToTimecodeMinutes:
+ return timecode_snap_to_internal (start, direction, for_mark);
+
+ case SnapToCDFrame:
+ if (((direction == 0) && (start % (one_second/75) > (one_second/75) / 2)) || (direction > 0)) {
+ start = (nframes64_t) ceil ((double) start / (one_second / 75)) * (one_second / 75);
} else {
- start += session->smpte_offset ();
+ start = (nframes64_t) floor ((double) start / (one_second / 75)) * (one_second / 75);
}
break;
snaptype = SnapToRegionSync;
} else if (choice == _("CD Frames")) {
snaptype = SnapToCDFrame;
- } else if (choice == _("SMPTE Frames")) {
- snaptype = SnapToSMPTEFrame;
- } else if (choice == _("SMPTE Seconds")) {
- snaptype = SnapToSMPTESeconds;
- } else if (choice == _("SMPTE Minutes")) {
- snaptype = SnapToSMPTEMinutes;
+ } else if (choice == _("Timecode Frames")) {
+ snaptype = SnapToTimecodeFrame;
+ } else if (choice == _("Timecode Seconds")) {
+ snaptype = SnapToTimecodeSeconds;
+ } else if (choice == _("Timecode Minutes")) {
+ snaptype = SnapToTimecodeMinutes;
} else if (choice == _("Seconds")) {
snaptype = SnapToSeconds;
} else if (choice == _("Minutes")) {
break;
case SnapToCDFrame:
- case SnapToSMPTEFrame:
- case SnapToSMPTESeconds:
- case SnapToSMPTEMinutes:
+ case SnapToTimecodeFrame:
+ case SnapToTimecodeSeconds:
+ case SnapToTimecodeMinutes:
case SnapToSeconds:
case SnapToMinutes:
case SnapToRegionStart:
ArdourCanvas::Group *minsec_group;
ArdourCanvas::Pixbuf *logo_item;
ArdourCanvas::Group *bbt_group;
- ArdourCanvas::Group *smpte_group;
+ ArdourCanvas::Group *timecode_group;
ArdourCanvas::Group *frame_group;
ArdourCanvas::Group *tempo_group;
ArdourCanvas::Group *meter_group;
ArdourCanvas::Group* _region_motion_group;
enum RulerType {
- ruler_metric_smpte = 0,
+ ruler_metric_timecode = 0,
ruler_metric_bbt = 1,
ruler_metric_frames = 2,
ruler_metric_minsec = 3,
Gtk::Widget * ruler_grabbed_widget;
void initialize_rulers ();
- void update_just_smpte ();
+ void update_just_timecode ();
void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
void update_fixed_rulers ();
void update_tempo_based_rulers ();
void store_ruler_visibility ();
void restore_ruler_visibility ();
- static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
+ static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
gint minsec_nmarks;
void set_minsec_ruler_scale (gdouble lower, gdouble upper);
- enum SMPTERulerScale {
- smpte_show_bits,
- smpte_show_frames,
- smpte_show_seconds,
- smpte_show_minutes,
- smpte_show_hours
+ enum TimecodeRulerScale {
+ timecode_show_bits,
+ timecode_show_frames,
+ timecode_show_seconds,
+ timecode_show_minutes,
+ timecode_show_hours
};
- SMPTERulerScale smpte_ruler_scale;
+ TimecodeRulerScale timecode_ruler_scale;
- nframes_t smpte_mark_interval;
- gint smpte_mark_modulo;
- gint smpte_nmarks;
- void set_smpte_ruler_scale (gdouble lower, gdouble upper);
+ nframes_t timecode_mark_interval;
+ gint timecode_mark_modulo;
+ gint timecode_nmarks;
+ void set_timecode_ruler_scale (gdouble lower, gdouble upper);
enum BBTRulerScale {
bbt_over,
uint32_t bbt_accent_modulo;
void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper);
- gint metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
+ gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
Gtk::Widget *_ruler_separator;
- GtkWidget *_smpte_ruler;
+ GtkWidget *_timecode_ruler;
GtkWidget *_bbt_ruler;
GtkWidget *_frames_ruler;
GtkWidget *_minsec_ruler;
- Gtk::Widget *smpte_ruler;
+ Gtk::Widget *timecode_ruler;
Gtk::Widget *bbt_ruler;
Gtk::Widget *frames_ruler;
Gtk::Widget *minsec_ruler;
Gtk::Label minsec_label;
Gtk::Label bbt_label;
- Gtk::Label smpte_label;
+ Gtk::Label timecode_label;
Gtk::Label frame_label;
Gtk::Label tempo_label;
Gtk::Label meter_label;
void select_prev_route ();
void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
+ void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
RhythmFerret* rhythm_ferret;
BundleManager* _bundle_manager;
RadioAction::Group snap_choice_group;
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-cd-frame"), _("Snap to CD Frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToCDFrame)));
- ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-frame"), _("Snap to SMPTE frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTEFrame)));
- ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-seconds"), _("Snap to SMPTE seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTESeconds)));
- ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-minutes"), _("Snap to SMPTE minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTEMinutes)));
+ ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-frame"), _("Snap to Timecode frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeFrame)));
+ ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-seconds"), _("Snap to Timecode seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeSeconds)));
+ ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-minutes"), _("Snap to Timecode minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeMinutes)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-seconds"), _("Snap to Seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSeconds)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-minutes"), _("Snap to Minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMinutes)));
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirtyseconds"), _("Snap to Thirtyseconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAThirtysecondBeat)));
ruler_loop_punch_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-loop-punch-ruler"), _("Loop/Punch"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_transport_marker)));
ruler_bbt_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-bbt-ruler"), _("Bars & Beats"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_frames)));
ruler_samples_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-samples-ruler"), _("Samples"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_bbt)));
- ruler_timecode_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_smpte)));
+ ruler_timecode_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_timecode)));
ruler_minsec_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-minsec-ruler"), _("Min:Sec"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_minsec)));
/* set defaults here */
}
switch (rt) {
- case ruler_metric_smpte:
+ case ruler_metric_timecode:
action = "toggle-timecode-ruler";
break;
case ruler_metric_bbt:
case Editing::SnapToCDFrame:
action = "snap-to-cd-frame";
break;
- case Editing::SnapToSMPTEFrame:
- action = "snap-to-smpte-frame";
+ case Editing::SnapToTimecodeFrame:
+ action = "snap-to-timecode-frame";
break;
- case Editing::SnapToSMPTESeconds:
- action = "snap-to-smpte-seconds";
+ case Editing::SnapToTimecodeSeconds:
+ action = "snap-to-timecode-seconds";
break;
- case Editing::SnapToSMPTEMinutes:
- action = "snap-to-smpte-minutes";
+ case Editing::SnapToTimecodeMinutes:
+ action = "snap-to-timecode-minutes";
break;
case Editing::SnapToSeconds:
action = "snap-to-seconds";
{
switch (snap_type) {
case Editing::SnapToCDFrame:
- set_snap_to (Editing::SnapToSMPTEFrame);
+ set_snap_to (Editing::SnapToTimecodeFrame);
break;
- case Editing::SnapToSMPTEFrame:
- set_snap_to (Editing::SnapToSMPTESeconds);
+ case Editing::SnapToTimecodeFrame:
+ set_snap_to (Editing::SnapToTimecodeSeconds);
break;
- case Editing::SnapToSMPTESeconds:
- set_snap_to (Editing::SnapToSMPTEMinutes);
+ case Editing::SnapToTimecodeSeconds:
+ set_snap_to (Editing::SnapToTimecodeMinutes);
break;
- case Editing::SnapToSMPTEMinutes:
+ case Editing::SnapToTimecodeMinutes:
set_snap_to (Editing::SnapToSeconds);
break;
case Editing::SnapToSeconds:
update_punch_range_view (true);
} else if (p == "punch-out") {
update_punch_range_view (true);
- } else if (p == "smpte-format") {
- update_just_smpte ();
+ } else if (p == "timecode-format") {
+ update_just_timecode ();
} else if (p == "xfades-visible") {
update_xfade_visibility ();
} else if (p == "show-region-fades") {
} else if (p == "edit-mode") {
edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode()));
} else if (p == "subframes-per-frame") {
- update_just_smpte ();
+ update_just_timecode ();
} else if (p == "show-track-meters") {
toggle_meter_updating();
} else if (p == "show-summary") {
Editor::show_verbose_time_cursor (nframes64_t frame, double offset, double xpos, double ypos)
{
char buf[128];
- SMPTE::Time smpte;
+ Timecode::Time timecode;
BBT_Time bbt;
int hours, mins;
nframes64_t frame_rate;
snprintf (buf, sizeof (buf), "%02" PRIu32 "|%02" PRIu32 "|%02" PRIu32, bbt.bars, bbt.beats, bbt.ticks);
break;
- case AudioClock::SMPTE:
- session->smpte_time (frame, smpte);
- snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%02" PRId32 ":%02" PRId32, smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ case AudioClock::Timecode:
+ session->timecode_time (frame, timecode);
+ snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%02" PRId32 ":%02" PRId32, timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
break;
case AudioClock::MinSec:
Editor::show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset, double xpos, double ypos)
{
char buf[128];
- SMPTE::Time smpte;
+ Timecode::Time timecode;
BBT_Time sbbt;
BBT_Time ebbt;
int hours, mins;
snprintf (buf, sizeof (buf), "%02" PRIu32 "|%02" PRIu32 "|%02" PRIu32, ebbt.bars, ebbt.beats, ebbt.ticks);
break;
- case AudioClock::SMPTE:
- session->smpte_duration (end - start, smpte);
- snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%02" PRId32 ":%02" PRId32, smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ case AudioClock::Timecode:
+ session->timecode_duration (end - start, timecode);
+ snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%02" PRId32 ":%02" PRId32, timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
break;
case AudioClock::MinSec:
char used_str[8];
int used;
BBT_Time bbt;
- SMPTE::Time smpte;
+ Timecode::Time timecode;
bool missing_source = boost::dynamic_pointer_cast<SilentFileSource>(region->source());
sprintf (used_str, "%4d" , used);
switch (ARDOUR_UI::instance()->secondary_clock.mode ()) {
- case AudioClock::SMPTE:
- case AudioClock::Off: /* If the secondary clock is off, default to SMPTE */
- _session->smpte_time (region->position(), smpte);
- sprintf (start_str, "%02d:%02d:%02d:%02d", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
- _session->smpte_time (region->position() + region->length() - 1, smpte);
- sprintf (end_str, "%02d:%02d:%02d:%02d", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
- _session->smpte_time (region->length(), smpte);
- sprintf (length_str, "%02d:%02d:%02d:%02d", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
- _session->smpte_time (region->sync_position() + region->position(), smpte);
- sprintf (sync_str, "%02d:%02d:%02d:%02d", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ case AudioClock::Timecode:
+ case AudioClock::Off: /* If the secondary clock is off, default to Timecode */
+ _session->timecode_time (region->position(), timecode);
+ sprintf (start_str, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
+ _session->timecode_time (region->position() + region->length() - 1, timecode);
+ sprintf (end_str, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
+ _session->timecode_time (region->length(), timecode);
+ sprintf (length_str, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
+ _session->timecode_time (region->sync_position() + region->position(), timecode);
+ sprintf (sync_str, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
if (audioRegion && !fades_in_seconds) {
- _session->smpte_time (audioRegion->fade_in()->back()->when, smpte);
- sprintf (fadein_str, "%02d:%02d:%02d:%02d", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
- _session->smpte_time (audioRegion->fade_out()->back()->when, smpte);
- sprintf (fadeout_str, "%02d:%02d:%02d:%02d", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ _session->timecode_time (audioRegion->fade_in()->back()->when, timecode);
+ sprintf (fadein_str, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
+ _session->timecode_time (audioRegion->fade_out()->back()->when, timecode);
+ sprintf (fadeout_str, "%02d:%02d:%02d:%02d", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
}
break;
/* the order here must match the "metric" enums in editor.h */
GtkCustomMetric Editor::ruler_metrics[4] = {
- {1, Editor::_metric_get_smpte },
+ {1, Editor::_metric_get_timecode },
{1, Editor::_metric_get_bbt },
{1, Editor::_metric_get_frames },
{1, Editor::_metric_get_minsec }
minsec_ruler->hide ();
minsec_ruler->set_no_show_all();
- _smpte_ruler = gtk_custom_hruler_new ();
- smpte_ruler = Glib::wrap (_smpte_ruler);
- smpte_ruler->set_name ("SMPTERuler");
- smpte_ruler->set_size_request (-1, (int)timebar_height);
- gtk_custom_ruler_set_metric (GTK_CUSTOM_RULER(_smpte_ruler), &ruler_metrics[ruler_metric_smpte]);
- smpte_ruler->hide ();
- smpte_ruler->set_no_show_all();
- smpte_nmarks = 0;
+ _timecode_ruler = gtk_custom_hruler_new ();
+ timecode_ruler = Glib::wrap (_timecode_ruler);
+ timecode_ruler->set_name ("TimecodeRuler");
+ timecode_ruler->set_size_request (-1, (int)timebar_height);
+ gtk_custom_ruler_set_metric (GTK_CUSTOM_RULER(_timecode_ruler), &ruler_metrics[ruler_metric_timecode]);
+ timecode_ruler->hide ();
+ timecode_ruler->set_no_show_all();
+ timecode_nmarks = 0;
_bbt_ruler = gtk_custom_hruler_new ();
bbt_ruler = Glib::wrap (_bbt_ruler);
ruler_lab_children.push_back (Element(minsec_label, PACK_SHRINK, PACK_START));
ruler_children.insert (canvaspos, Element(*minsec_ruler, PACK_SHRINK, PACK_START));
- ruler_lab_children.push_back (Element(smpte_label, PACK_SHRINK, PACK_START));
- ruler_children.insert (canvaspos, Element(*smpte_ruler, PACK_SHRINK, PACK_START));
+ ruler_lab_children.push_back (Element(timecode_label, PACK_SHRINK, PACK_START));
+ ruler_children.insert (canvaspos, Element(*timecode_ruler, PACK_SHRINK, PACK_START));
ruler_lab_children.push_back (Element(frame_label, PACK_SHRINK, PACK_START));
ruler_children.insert (canvaspos, Element(*frames_ruler, PACK_SHRINK, PACK_START));
ruler_lab_children.push_back (Element(bbt_label, PACK_SHRINK, PACK_START));
ruler_children.insert (canvaspos, Element(*bbt_ruler, PACK_SHRINK, PACK_START));
- smpte_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
+ timecode_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
bbt_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
frames_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
minsec_ruler->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
- smpte_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
+ timecode_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
bbt_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
frames_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
minsec_ruler->signal_button_release_event().connect (mem_fun(*this, &Editor::ruler_button_release));
- smpte_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
+ timecode_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
bbt_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
frames_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
minsec_ruler->signal_button_press_event().connect (mem_fun(*this, &Editor::ruler_button_press));
- smpte_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
+ timecode_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
bbt_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
frames_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
minsec_ruler->signal_motion_notify_event().connect (mem_fun(*this, &Editor::ruler_mouse_motion));
- smpte_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
+ timecode_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
bbt_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
frames_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
minsec_ruler->signal_scroll_event().connect (mem_fun(*this, &Editor::ruler_scroll));
//Gtk::Main::grab_add (*minsec_ruler);
Widget * grab_widget = 0;
- if (smpte_ruler->is_realized() && ev->window == smpte_ruler->get_window()->gobj()) {
- grab_widget = smpte_ruler;
+ if (timecode_ruler->is_realized() && ev->window == timecode_ruler->get_window()->gobj()) {
+ grab_widget = timecode_ruler;
} else if (bbt_ruler->is_realized() && ev->window == bbt_ruler->get_window()->gobj()) {
grab_widget = bbt_ruler;
} else if (frames_ruler->is_realized() && ev->window == frames_ruler->get_window()->gobj()) {
{
XMLNode* node = new XMLNode(X_("RulerVisibility"));
- node->add_property (X_("smpte"), ruler_timecode_action->get_active() ? "yes": "no");
+ node->add_property (X_("timecode"), ruler_timecode_action->get_active() ? "yes": "no");
node->add_property (X_("bbt"), ruler_bbt_action->get_active() ? "yes": "no");
node->add_property (X_("frames"), ruler_samples_action->get_active() ? "yes": "no");
node->add_property (X_("minsec"), ruler_minsec_action->get_active() ? "yes": "no");
no_ruler_shown_update = true;
if (node) {
- if ((prop = node->property ("smpte")) != 0) {
+ if ((prop = node->property ("timecode")) != 0) {
if (string_is_affirmative (prop->value())) {
ruler_timecode_action->set_active (true);
} else {
if (ruler_timecode_action->get_active()) {
visible_rulers++;
- smpte_label.show ();
- smpte_ruler->show ();
+ timecode_label.show ();
+ timecode_ruler->show ();
} else {
- smpte_label.hide ();
- smpte_ruler->hide ();
+ timecode_label.hide ();
+ timecode_ruler->hide ();
}
if (ruler_samples_action->get_active()) {
}
void
-Editor::update_just_smpte ()
+Editor::update_just_timecode ()
{
- ENSURE_GUI_THREAD(mem_fun(*this, &Editor::update_just_smpte));
+ ENSURE_GUI_THREAD(mem_fun(*this, &Editor::update_just_timecode));
if (session == 0) {
return;
nframes64_t rightmost_frame = leftmost_frame + current_page_frames();
if (ruler_timecode_action->get_active()) {
- gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_smpte_ruler), leftmost_frame, rightmost_frame,
+ gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_timecode_ruler), leftmost_frame, rightmost_frame,
leftmost_frame, session->current_end_frame());
}
}
}
if (ruler_timecode_action->get_active()) {
- set_smpte_ruler_scale (leftmost_frame, leftmost_frame + current_page_frames() );
+ set_timecode_ruler_scale (leftmost_frame, leftmost_frame + current_page_frames() );
}
if (ruler_minsec_action->get_active()) {
return;
}
- ruler_metrics[ruler_metric_smpte].units_per_pixel = frames_per_unit;
+ ruler_metrics[ruler_metric_timecode].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_frames].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_minsec].units_per_pixel = frames_per_unit;
*/
if (ruler_timecode_action->get_active()) {
- gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_smpte_ruler), leftmost_frame, rightmost_frame,
+ gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_timecode_ruler), leftmost_frame, rightmost_frame,
leftmost_frame, session->current_end_frame());
}
/* Mark generation */
gint
-Editor::_metric_get_smpte (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
+Editor::_metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint maxchars)
{
- return ruler_editor->metric_get_smpte (marks, lower, upper, maxchars);
+ return ruler_editor->metric_get_timecode (marks, lower, upper, maxchars);
}
gint
}
void
-Editor::set_smpte_ruler_scale (gdouble lower, gdouble upper)
+Editor::set_timecode_ruler_scale (gdouble lower, gdouble upper)
{
nframes64_t range;
nframes64_t spacer;
upper = upper + spacer;
range = (nframes64_t) floor (upper - lower);
- if (range < (2 * session->frames_per_smpte_frame())) { /* 0 - 2 frames */
- smpte_ruler_scale = smpte_show_bits;
- smpte_mark_modulo = 20;
- smpte_nmarks = 2 + (2 * session->config.get_subframes_per_frame());
+ if (range < (2 * session->frames_per_timecode_frame())) { /* 0 - 2 frames */
+ timecode_ruler_scale = timecode_show_bits;
+ timecode_mark_modulo = 20;
+ timecode_nmarks = 2 + (2 * session->config.get_subframes_per_frame());
} else if (range <= (fr / 4)) { /* 2 frames - 0.250 second */
- smpte_ruler_scale = smpte_show_frames;
- smpte_mark_modulo = 1;
- smpte_nmarks = 2 + (range / (nframes64_t)session->frames_per_smpte_frame());
+ timecode_ruler_scale = timecode_show_frames;
+ timecode_mark_modulo = 1;
+ timecode_nmarks = 2 + (range / (nframes64_t)session->frames_per_timecode_frame());
} else if (range <= (fr / 2)) { /* 0.25-0.5 second */
- smpte_ruler_scale = smpte_show_frames;
- smpte_mark_modulo = 2;
- smpte_nmarks = 2 + (range / (nframes64_t)session->frames_per_smpte_frame());
+ timecode_ruler_scale = timecode_show_frames;
+ timecode_mark_modulo = 2;
+ timecode_nmarks = 2 + (range / (nframes64_t)session->frames_per_timecode_frame());
} else if (range <= fr) { /* 0.5-1 second */
- smpte_ruler_scale = smpte_show_frames;
- smpte_mark_modulo = 5;
- smpte_nmarks = 2 + (range / (nframes64_t)session->frames_per_smpte_frame());
+ timecode_ruler_scale = timecode_show_frames;
+ timecode_mark_modulo = 5;
+ timecode_nmarks = 2 + (range / (nframes64_t)session->frames_per_timecode_frame());
} else if (range <= 2 * fr) { /* 1-2 seconds */
- smpte_ruler_scale = smpte_show_frames;
- smpte_mark_modulo = 10;
- smpte_nmarks = 2 + (range / (nframes64_t)session->frames_per_smpte_frame());
+ timecode_ruler_scale = timecode_show_frames;
+ timecode_mark_modulo = 10;
+ timecode_nmarks = 2 + (range / (nframes64_t)session->frames_per_timecode_frame());
} else if (range <= 8 * fr) { /* 2-8 seconds */
- smpte_ruler_scale = smpte_show_seconds;
- smpte_mark_modulo = 1;
- smpte_nmarks = 2 + (range / fr);
+ timecode_ruler_scale = timecode_show_seconds;
+ timecode_mark_modulo = 1;
+ timecode_nmarks = 2 + (range / fr);
} else if (range <= 16 * fr) { /* 8-16 seconds */
- smpte_ruler_scale = smpte_show_seconds;
- smpte_mark_modulo = 2;
- smpte_nmarks = 2 + (range / fr);
+ timecode_ruler_scale = timecode_show_seconds;
+ timecode_mark_modulo = 2;
+ timecode_nmarks = 2 + (range / fr);
} else if (range <= 30 * fr) { /* 16-30 seconds */
- smpte_ruler_scale = smpte_show_seconds;
- smpte_mark_modulo = 5;
- smpte_nmarks = 2 + (range / fr);
+ timecode_ruler_scale = timecode_show_seconds;
+ timecode_mark_modulo = 5;
+ timecode_nmarks = 2 + (range / fr);
} else if (range <= 60 * fr) { /* 30-60 seconds */
- smpte_ruler_scale = smpte_show_seconds;
- smpte_mark_modulo = 5;
- smpte_nmarks = 2 + (range / fr);
+ timecode_ruler_scale = timecode_show_seconds;
+ timecode_mark_modulo = 5;
+ timecode_nmarks = 2 + (range / fr);
} else if (range <= 2 * 60 * fr) { /* 1-2 minutes */
- smpte_ruler_scale = smpte_show_seconds;
- smpte_mark_modulo = 15;
- smpte_nmarks = 2 + (range / fr);
+ timecode_ruler_scale = timecode_show_seconds;
+ timecode_mark_modulo = 15;
+ timecode_nmarks = 2 + (range / fr);
} else if (range <= 4 * 60 * fr) { /* 2-4 minutes */
- smpte_ruler_scale = smpte_show_seconds;
- smpte_mark_modulo = 30;
- smpte_nmarks = 2 + (range / fr);
+ timecode_ruler_scale = timecode_show_seconds;
+ timecode_mark_modulo = 30;
+ timecode_nmarks = 2 + (range / fr);
} else if (range <= 10 * 60 * fr) { /* 4-10 minutes */
- smpte_ruler_scale = smpte_show_minutes;
- smpte_mark_modulo = 2;
- smpte_nmarks = 2 + 10;
+ timecode_ruler_scale = timecode_show_minutes;
+ timecode_mark_modulo = 2;
+ timecode_nmarks = 2 + 10;
} else if (range <= 30 * 60 * fr) { /* 10-30 minutes */
- smpte_ruler_scale = smpte_show_minutes;
- smpte_mark_modulo = 5;
- smpte_nmarks = 2 + 30;
+ timecode_ruler_scale = timecode_show_minutes;
+ timecode_mark_modulo = 5;
+ timecode_nmarks = 2 + 30;
} else if (range <= 60 * 60 * fr) { /* 30 minutes - 1hr */
- smpte_ruler_scale = smpte_show_minutes;
- smpte_mark_modulo = 10;
- smpte_nmarks = 2 + 60;
+ timecode_ruler_scale = timecode_show_minutes;
+ timecode_mark_modulo = 10;
+ timecode_nmarks = 2 + 60;
} else if (range <= 4 * 60 * 60 * fr) { /* 1 - 4 hrs*/
- smpte_ruler_scale = smpte_show_minutes;
- smpte_mark_modulo = 30;
- smpte_nmarks = 2 + (60 * 4);
+ timecode_ruler_scale = timecode_show_minutes;
+ timecode_mark_modulo = 30;
+ timecode_nmarks = 2 + (60 * 4);
} else if (range <= 8 * 60 * 60 * fr) { /* 4 - 8 hrs*/
- smpte_ruler_scale = smpte_show_hours;
- smpte_mark_modulo = 1;
- smpte_nmarks = 2 + 8;
+ timecode_ruler_scale = timecode_show_hours;
+ timecode_mark_modulo = 1;
+ timecode_nmarks = 2 + 8;
} else if (range <= 16 * 60 * 60 * fr) { /* 16-24 hrs*/
- smpte_ruler_scale = smpte_show_hours;
- smpte_mark_modulo = 1;
- smpte_nmarks = 2 + 24;
+ timecode_ruler_scale = timecode_show_hours;
+ timecode_mark_modulo = 1;
+ timecode_nmarks = 2 + 24;
} else {
/* not possible if nframes64_t is a 32 bit quantity */
- smpte_ruler_scale = smpte_show_hours;
- smpte_mark_modulo = 4;
- smpte_nmarks = 2 + 24;
+ timecode_ruler_scale = timecode_show_hours;
+ timecode_mark_modulo = 4;
+ timecode_nmarks = 2 + 24;
}
}
gint
-Editor::metric_get_smpte (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upper*/, gint /*maxchars*/)
+Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upper*/, gint /*maxchars*/)
{
nframes_t pos;
nframes64_t spacer;
- SMPTE::Time smpte;
+ Timecode::Time timecode;
gchar buf[16];
gint n;
pos = (nframes_t) floor (lower);
- *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * smpte_nmarks);
- switch (smpte_ruler_scale) {
- case smpte_show_bits:
+ *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * timecode_nmarks);
+ switch (timecode_ruler_scale) {
+ case timecode_show_bits:
- // Find smpte time of this sample (pos) with subframe accuracy
- session->sample_to_smpte(pos, smpte, true /* use_offset */, true /* use_subframes */ );
+ // Find timecode time of this sample (pos) with subframe accuracy
+ session->sample_to_timecode(pos, timecode, true /* use_offset */, true /* use_subframes */ );
- for (n = 0; n < smpte_nmarks; n++) {
- session->smpte_to_sample(smpte, pos, true /* use_offset */, true /* use_subframes */ );
- if ((smpte.subframes % smpte_mark_modulo) == 0) {
- if (smpte.subframes == 0) {
+ for (n = 0; n < timecode_nmarks; n++) {
+ session->timecode_to_sample(timecode, pos, true /* use_offset */, true /* use_subframes */ );
+ if ((timecode.subframes % timecode_mark_modulo) == 0) {
+ if (timecode.subframes == 0) {
(*marks)[n].style = GtkCustomRulerMarkMajor;
- snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", smpte.negative ? "-" : "", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
} else {
(*marks)[n].style = GtkCustomRulerMarkMinor;
- snprintf (buf, sizeof(buf), ".%02u", smpte.subframes);
+ snprintf (buf, sizeof(buf), ".%02u", timecode.subframes);
}
} else {
snprintf (buf, sizeof(buf)," ");
(*marks)[n].position = pos;
// Increment subframes by one
- SMPTE::increment_subframes( smpte, session->config.get_subframes_per_frame() );
+ Timecode::increment_subframes( timecode, session->config.get_subframes_per_frame() );
}
break;
- case smpte_show_seconds:
- // Find smpte time of this sample (pos)
- session->sample_to_smpte(pos, smpte, true /* use_offset */, false /* use_subframes */ );
+ case timecode_show_seconds:
+ // Find timecode time of this sample (pos)
+ session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
// Go to next whole second down
- SMPTE::seconds_floor( smpte );
+ Timecode::seconds_floor( timecode );
- for (n = 0; n < smpte_nmarks; n++) {
- session->smpte_to_sample(smpte, pos, true /* use_offset */, false /* use_subframes */ );
- if ((smpte.seconds % smpte_mark_modulo) == 0) {
- if (smpte.seconds == 0) {
+ for (n = 0; n < timecode_nmarks; n++) {
+ session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
+ if ((timecode.seconds % timecode_mark_modulo) == 0) {
+ if (timecode.seconds == 0) {
(*marks)[n].style = GtkCustomRulerMarkMajor;
(*marks)[n].position = pos;
} else {
(*marks)[n].style = GtkCustomRulerMarkMinor;
(*marks)[n].position = pos;
}
- snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", smpte.negative ? "-" : "", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
} else {
snprintf (buf, sizeof(buf)," ");
(*marks)[n].style = GtkCustomRulerMarkMicro;
}
(*marks)[n].label = g_strdup (buf);
- SMPTE::increment_seconds( smpte, session->config.get_subframes_per_frame() );
+ Timecode::increment_seconds( timecode, session->config.get_subframes_per_frame() );
}
break;
- case smpte_show_minutes:
- // Find smpte time of this sample (pos)
- session->sample_to_smpte(pos, smpte, true /* use_offset */, false /* use_subframes */ );
+ case timecode_show_minutes:
+ // Find timecode time of this sample (pos)
+ session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
// Go to next whole minute down
- SMPTE::minutes_floor( smpte );
+ Timecode::minutes_floor( timecode );
- for (n = 0; n < smpte_nmarks; n++) {
- session->smpte_to_sample(smpte, pos, true /* use_offset */, false /* use_subframes */ );
- if ((smpte.minutes % smpte_mark_modulo) == 0) {
- if (smpte.minutes == 0) {
+ for (n = 0; n < timecode_nmarks; n++) {
+ session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
+ if ((timecode.minutes % timecode_mark_modulo) == 0) {
+ if (timecode.minutes == 0) {
(*marks)[n].style = GtkCustomRulerMarkMajor;
} else {
(*marks)[n].style = GtkCustomRulerMarkMinor;
}
- snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", smpte.negative ? "-" : "", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
} else {
snprintf (buf, sizeof(buf)," ");
(*marks)[n].style = GtkCustomRulerMarkMicro;
}
(*marks)[n].label = g_strdup (buf);
(*marks)[n].position = pos;
- SMPTE::increment_minutes( smpte, session->config.get_subframes_per_frame() );
+ Timecode::increment_minutes( timecode, session->config.get_subframes_per_frame() );
}
break;
- case smpte_show_hours:
- // Find smpte time of this sample (pos)
- session->sample_to_smpte(pos, smpte, true /* use_offset */, false /* use_subframes */ );
+ case timecode_show_hours:
+ // Find timecode time of this sample (pos)
+ session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
// Go to next whole hour down
- SMPTE::hours_floor( smpte );
+ Timecode::hours_floor( timecode );
- for (n = 0; n < smpte_nmarks; n++) {
- session->smpte_to_sample(smpte, pos, true /* use_offset */, false /* use_subframes */ );
- if ((smpte.hours % smpte_mark_modulo) == 0) {
+ for (n = 0; n < timecode_nmarks; n++) {
+ session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
+ if ((timecode.hours % timecode_mark_modulo) == 0) {
(*marks)[n].style = GtkCustomRulerMarkMajor;
- snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", smpte.negative ? "-" : "", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
} else {
snprintf (buf, sizeof(buf)," ");
(*marks)[n].style = GtkCustomRulerMarkMicro;
(*marks)[n].label = g_strdup (buf);
(*marks)[n].position = pos;
- SMPTE::increment_hours( smpte, session->config.get_subframes_per_frame() );
+ Timecode::increment_hours( timecode, session->config.get_subframes_per_frame() );
}
break;
- case smpte_show_frames:
- // Find smpte time of this sample (pos)
- session->sample_to_smpte(pos, smpte, true /* use_offset */, false /* use_subframes */ );
+ case timecode_show_frames:
+ // Find timecode time of this sample (pos)
+ session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
// Go to next whole frame down
- SMPTE::frames_floor( smpte );
+ Timecode::frames_floor( timecode );
- for (n = 0; n < smpte_nmarks; n++) {
- session->smpte_to_sample(smpte, pos, true /* use_offset */, false /* use_subframes */ );
- if ((smpte.frames % smpte_mark_modulo) == 0) {
- if (smpte.frames == 0) {
+ for (n = 0; n < timecode_nmarks; n++) {
+ session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
+ if ((timecode.frames % timecode_mark_modulo) == 0) {
+ if (timecode.frames == 0) {
(*marks)[n].style = GtkCustomRulerMarkMajor;
} else {
(*marks)[n].style = GtkCustomRulerMarkMinor;
}
(*marks)[n].position = pos;
- snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", smpte.negative ? "-" : "", smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
} else {
snprintf (buf, sizeof(buf)," ");
(*marks)[n].style = GtkCustomRulerMarkMicro;
}
(*marks)[n].label = g_strdup (buf);
- SMPTE::increment( smpte, session->config.get_subframes_per_frame() );
+ Timecode::increment( timecode, session->config.get_subframes_per_frame() );
}
break;
}
- return smpte_nmarks;
+ return timecode_nmarks;
}
#define REGISTER_ENUM(e) i.push_back (e); s.push_back (#e)
#define REGISTER_CLASS_ENUM(t,e) i.push_back (t::e); s.push_back (#e)
- REGISTER_CLASS_ENUM (AudioClock, SMPTE);
+ REGISTER_CLASS_ENUM (AudioClock, Timecode);
REGISTER_CLASS_ENUM (AudioClock, BBT);
REGISTER_CLASS_ENUM (AudioClock, MinSec);
REGISTER_CLASS_ENUM (AudioClock, Frames);
{
update_time (silence_start, silence_start_clock);
AnyTime zero;
- zero.type = AnyTime::SMPTE;
+ zero.type = AnyTime::Timecode;
manager.select_silence_beginning (silence_start_checkbox.get_active() ? silence_start : zero);
}
{
update_time (silence_end, silence_end_clock);
AnyTime zero;
- zero.type = AnyTime::SMPTE;
+ zero.type = AnyTime::Timecode;
manager.select_silence_end (silence_end_checkbox.get_active() ? silence_end : zero);
}
// TODO position
clock.set (session->convert_to_frames_at (0, time), true);
- AudioClock::Mode mode(AudioClock::SMPTE);
+ AudioClock::Mode mode(AudioClock::Timecode);
switch (time.type) {
- case AnyTime::SMPTE:
- mode = AudioClock::SMPTE;
+ case AnyTime::Timecode:
+ mode = AudioClock::Timecode;
break;
case AnyTime::BBT:
mode = AudioClock::BBT;
nframes_t frames = clock.current_duration();
switch (clock.mode()) {
- case AudioClock::SMPTE:
- time.type = AnyTime::SMPTE;
- session->smpte_time (frames, time.smpte);
+ case AudioClock::Timecode:
+ time.type = AnyTime::Timecode;
+ session->timecode_time (frames, time.timecode);
break;
case AudioClock::BBT:
time.type = AnyTime::BBT;
iter = time_format_list->append();
row = *iter;
- row[time_format_cols.format] = ExportProfileManager::SMPTE;
+ row[time_format_cols.format] = ExportProfileManager::Timecode;
row[time_format_cols.label] = X_("Timecode");
iter = time_format_list->append();
end = bbt_str (end_frame);
break;
- case AudioClock::SMPTE:
- start = smpte_str (start_frame);
- end = smpte_str (end_frame);
+ case AudioClock::Timecode:
+ start = timecode_str (start_frame);
+ end = timecode_str (end_frame);
break;
case AudioClock::MinSec:
}
Glib::ustring
-ExportTimespanSelector::smpte_str (nframes_t frames) const
+ExportTimespanSelector::timecode_str (nframes_t frames) const
{
if (!session) {
return "Error!";
}
std::ostringstream oss;
- SMPTE::Time time;
+ Timecode::Time time;
- session->smpte_time (frames, time);
+ session->timecode_time (frames, time);
oss << std::setfill('0') << std::right <<
std::setw(2) <<
Glib::ustring construct_label (ARDOUR::Location const * location) const;
Glib::ustring bbt_str (nframes_t frames) const;
- Glib::ustring smpte_str (nframes_t frames) const;
+ Glib::ustring timecode_str (nframes_t frames) const;
Glib::ustring ms_str (nframes_t frames) const;
void update_range_name (Glib::ustring const & path, Glib::ustring const & new_text);
add_option (_("Sync"), spf);
ComboOption<SmpteFormat>* smf = new ComboOption<SmpteFormat> (
- "smpte-format",
+ "timecode-format",
_("Timecode frames-per-second"),
- mem_fun (*_session_config, &SessionConfiguration::get_smpte_format),
- mem_fun (*_session_config, &SessionConfiguration::set_smpte_format)
+ mem_fun (*_session_config, &SessionConfiguration::get_timecode_format),
+ mem_fun (*_session_config, &SessionConfiguration::set_timecode_format)
);
- smf->add (smpte_23976, _("23.976"));
- smf->add (smpte_24, _("24"));
- smf->add (smpte_24976, _("24.976"));
- smf->add (smpte_25, _("25"));
- smf->add (smpte_2997, _("29.97"));
- smf->add (smpte_2997drop, _("29.97 drop"));
- smf->add (smpte_30, _("30"));
- smf->add (smpte_30drop, _("30 drop"));
- smf->add (smpte_5994, _("59.94"));
- smf->add (smpte_60, _("60"));
+ smf->add (timecode_23976, _("23.976"));
+ smf->add (timecode_24, _("24"));
+ smf->add (timecode_24976, _("24.976"));
+ smf->add (timecode_25, _("25"));
+ smf->add (timecode_2997, _("29.97"));
+ smf->add (timecode_2997drop, _("29.97 drop"));
+ smf->add (timecode_30, _("30"));
+ smf->add (timecode_30drop, _("30 drop"));
+ smf->add (timecode_5994, _("59.94"));
+ smf->add (timecode_60, _("60"));
add_option (_("Sync"), smf);
table.attach (timecode_clock, 1, 2, 5, 6, FILL, FILL);
length_clock.set_mode (ARDOUR_UI::instance()->secondary_clock.mode());
- timecode_clock.set_mode (AudioClock::SMPTE);
+ timecode_clock.set_mode (AudioClock::Timecode);
main_box.pack_start (table, false, false);
/// The sample rate of the session from which we are importing
nframes_t sample_rate;
- /// Converts smpte time to a string
- std::string smpte_to_string (SMPTE::Time & time) const;
+ /// Converts timecode time to a string
+ std::string timecode_to_string (Timecode::Time & time) const;
/// Converts samples so that times match the sessions sample rate
nframes_t rate_convert_samples (nframes_t samples) const;
typedef std::list<Location *> LocationList;
enum TimeFormat {
- SMPTE,
+ Timecode,
BBT,
MinSec,
Frames,
boost::shared_ptr<Location> selection_range,
boost::shared_ptr<LocationList> ranges) :
timespans (new TimespanList ()),
- time_format (SMPTE),
+ time_format (Timecode),
session_range (session_range),
selection_range (selection_range),
#include "ardour/rc_configuration.h"
#include "ardour/session_configuration.h"
#include "ardour/location.h"
-#include "ardour/smpte.h"
+#include "ardour/timecode.h"
#include "ardour/interpolation.h"
class XMLTree;
nframes_t nominal_frame_rate() const { return _nominal_frame_rate; }
nframes_t frames_per_hour() const { return _frames_per_hour; }
- double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
- nframes_t smpte_frames_per_hour() const { return _smpte_frames_per_hour; }
+ double frames_per_timecode_frame() const { return _frames_per_timecode_frame; }
+ nframes_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; }
- MIDI::byte get_mtc_smpte_bits() const {
- return mtc_smpte_bits; /* encoding of SMTPE type for MTC */
+ MIDI::byte get_mtc_timecode_bits() const {
+ return mtc_timecode_bits; /* encoding of SMTPE type for MTC */
}
- float smpte_frames_per_second() const;
- bool smpte_drop_frames() const;
+ float timecode_frames_per_second() const;
+ bool timecode_drop_frames() const;
/* Locations */
void sync_time_vars();
void bbt_time (nframes_t when, BBT_Time&);
- void smpte_to_sample(SMPTE::Time& smpte, nframes_t& sample, bool use_offset, bool use_subframes) const;
- void sample_to_smpte(nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes) const;
- void smpte_time (SMPTE::Time &);
- void smpte_time (nframes_t when, SMPTE::Time&);
- void smpte_time_subframes (nframes_t when, SMPTE::Time&);
+ void timecode_to_sample(Timecode::Time& timecode, nframes_t& sample, bool use_offset, bool use_subframes) const;
+ void sample_to_timecode(nframes_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
+ void timecode_time (Timecode::Time &);
+ void timecode_time (nframes_t when, Timecode::Time&);
+ void timecode_time_subframes (nframes_t when, Timecode::Time&);
- void smpte_duration (nframes_t, SMPTE::Time&) const;
- void smpte_duration_string (char *, nframes_t) const;
+ void timecode_duration (nframes_t, Timecode::Time&) const;
+ void timecode_duration_string (char *, nframes_t) const;
- void set_smpte_offset (nframes_t);
- nframes_t smpte_offset () const { return _smpte_offset; }
- void set_smpte_offset_negative (bool);
- bool smpte_offset_negative () const { return _smpte_offset_negative; }
+ void set_timecode_offset (nframes_t);
+ nframes_t timecode_offset () const { return _timecode_offset; }
+ void set_timecode_offset_negative (bool);
+ bool timecode_offset_negative () const { return _timecode_offset_negative; }
nframes_t convert_to_frames_at (nframes_t position, AnyTime const &);
static sigc::signal<void> StartTimeChanged;
static sigc::signal<void> EndTimeChanged;
- static sigc::signal<void> SMPTEOffsetChanged;
+ static sigc::signal<void> TimecodeOffsetChanged;
void request_slave_source (SlaveSource);
bool synced_to_jack() const { return Config->get_slave_source() == JACK; }
TempoMap& tempo_map() { return *_tempo_map; }
- /// signals the current transport position in frames, bbt and smpte time (in that order)
- sigc::signal<void, const nframes_t&, const BBT_Time&, const SMPTE::Time&> tick;
+ /// signals the current transport position in frames, bbt and timecode time (in that order)
+ sigc::signal<void, const nframes_t&, const BBT_Time&, const Timecode::Time&> tick;
/* region info */
MIDI::byte mmc_buffer[32];
MIDI::byte mtc_msg[16];
- MIDI::byte mtc_smpte_bits; /* encoding of SMTPE type for MTC */
+ MIDI::byte mtc_timecode_bits; /* encoding of SMTPE type for MTC */
MIDI::byte midi_msg[16];
- nframes_t outbound_mtc_smpte_frame;
- SMPTE::Time transmitting_smpte_time;
+ nframes_t outbound_mtc_timecode_frame;
+ Timecode::Time transmitting_timecode_time;
int next_quarter_frame_to_send;
- double _frames_per_smpte_frame; /* has to be floating point because of drop frame */
+ double _frames_per_timecode_frame; /* has to be floating point because of drop frame */
nframes_t _frames_per_hour;
- nframes_t _smpte_frames_per_hour;
- nframes_t _smpte_offset;
- bool _smpte_offset_negative;
+ nframes_t _timecode_frames_per_hour;
+ nframes_t _timecode_offset;
+ bool _timecode_offset_negative;
/* cache the most-recently requested time conversions. This helps when we
* have multiple clocks showing the same time (e.g. the transport frame) */
- bool last_smpte_valid;
- nframes_t last_smpte_when;
- SMPTE::Time last_smpte;
+ bool last_timecode_valid;
+ nframes_t last_timecode_when;
+ Timecode::Time last_timecode;
- bool _send_smpte_update; ///< Flag to send a full frame (SMPTE) MTC message this cycle
+ bool _send_timecode_update; ///< Flag to send a full frame (Timecode) MTC message this cycle
int send_full_time_code(nframes_t nframes);
int send_midi_time_code_for_cycle(nframes_t nframes);
CONFIG_VARIABLE (bool, punch_in, "punch-in", false)
CONFIG_VARIABLE (bool, punch_out, "punch-out", false)
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
-CONFIG_VARIABLE (SmpteFormat, smpte_format, "smpte-format", smpte_30)
+CONFIG_VARIABLE (SmpteFormat, timecode_format, "timecode-format", timecode_30)
CONFIG_VARIABLE_SPECIAL(Glib::ustring, raid_path, "raid-path", "", path_expand)
CONFIG_VARIABLE (std::string, bwf_country_code, "bwf-country-code", "US")
CONFIG_VARIABLE (std::string, bwf_organization_code, "bwf-organization-code", "US")
+++ /dev/null
-/* Copyright (C) 2006 Paul Davis
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-
-#ifndef __ardour_smpte_h__
-#define __ardour_smpte_h__
-
-#include <inttypes.h>
-
-namespace SMPTE {
-
-enum Wrap {
- NONE = 0,
- FRAMES,
- SECONDS,
- MINUTES,
- HOURS
-};
-
-/** SMPTE frame rate (in frames per second).
- *
- * This should be eliminated in favour of a float to support arbitrary rates.
- */
-enum FPS {
- MTC_24_FPS = 0,
- MTC_25_FPS = 1,
- MTC_30_FPS_DROP = 2,
- MTC_30_FPS = 3
-};
-
-struct Time {
- bool negative;
- uint32_t hours;
- uint32_t minutes;
- uint32_t seconds;
- uint32_t frames; ///< SMPTE frames (not audio samples)
- uint32_t subframes; ///< Typically unused
- FPS rate; ///< Frame rate of this Time
- static FPS default_rate; ///< Rate to use for default constructor
-
- Time(FPS a_rate = default_rate) {
- negative = false;
- hours = 0;
- minutes = 0;
- seconds = 0;
- frames = 0;
- subframes = 0;
- rate = a_rate;
- }
-};
-
-Wrap increment( Time& smpte );
-Wrap decrement( Time& smpte );
-Wrap increment_subframes( Time& smpte );
-Wrap decrement_subframes( Time& smpte );
-Wrap increment_seconds( Time& smpte );
-Wrap increment_minutes( Time& smpte );
-Wrap increment_hours( Time& smpte );
-void frames_floor( Time& smpte );
-void seconds_floor( Time& smpte );
-void minutes_floor( Time& smpte );
-void hours_floor( Time& smpte );
-
-} // namespace SMPTE
-
-#endif // __ardour_smpte_h__
virtual void tick(
const nframes_t& transport_frames,
const BBT_Time& transport_bbt,
- const SMPTE::Time& transport_smpte) = 0;
+ const Timecode::Time& transport_timecode) = 0;
virtual void set_session(Session& s);
virtual void going_away() { _session = 0; }
void tick(
const nframes_t& transport_frames,
const BBT_Time& transport_bbt,
- const SMPTE::Time& transport_smpte);
+ const Timecode::Time& transport_timecode);
void set_session(Session& s);
void going_away() { _midi_port = 0; Ticker::going_away(); }
--- /dev/null
+/* Copyright (C) 2006 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef __ardour_timecode_h__
+#define __ardour_timecode_h__
+
+#include <inttypes.h>
+
+namespace Timecode {
+
+enum Wrap {
+ NONE = 0,
+ FRAMES,
+ SECONDS,
+ MINUTES,
+ HOURS
+};
+
+/** Timecode frame rate (in frames per second).
+ *
+ * This should be eliminated in favour of a float to support arbitrary rates.
+ */
+enum FPS {
+ MTC_24_FPS = 0,
+ MTC_25_FPS = 1,
+ MTC_30_FPS_DROP = 2,
+ MTC_30_FPS = 3
+};
+
+struct Time {
+ bool negative;
+ uint32_t hours;
+ uint32_t minutes;
+ uint32_t seconds;
+ uint32_t frames; ///< Timecode frames (not audio samples)
+ uint32_t subframes; ///< Typically unused
+ FPS rate; ///< Frame rate of this Time
+ static FPS default_rate; ///< Rate to use for default constructor
+
+ Time(FPS a_rate = default_rate) {
+ negative = false;
+ hours = 0;
+ minutes = 0;
+ seconds = 0;
+ frames = 0;
+ subframes = 0;
+ rate = a_rate;
+ }
+};
+
+Wrap increment( Time& timecode );
+Wrap decrement( Time& timecode );
+Wrap increment_subframes( Time& timecode );
+Wrap decrement_subframes( Time& timecode );
+Wrap increment_seconds( Time& timecode );
+Wrap increment_minutes( Time& timecode );
+Wrap increment_hours( Time& timecode );
+void frames_floor( Time& timecode );
+void seconds_floor( Time& timecode );
+void minutes_floor( Time& timecode );
+void hours_floor( Time& timecode );
+
+} // namespace Timecode
+
+#endif // __ardour_timecode_h__
#include <inttypes.h>
#include <jack/types.h>
#include <jack/midiport.h>
-#include "control_protocol/smpte.h"
+#include "control_protocol/timecode.h"
#include "pbd/id.h"
#include <map>
};
enum SmpteFormat {
- smpte_23976,
- smpte_24,
- smpte_24976,
- smpte_25,
- smpte_2997,
- smpte_2997drop,
- smpte_30,
- smpte_30drop,
- smpte_5994,
- smpte_60
+ timecode_23976,
+ timecode_24,
+ timecode_24976,
+ timecode_25,
+ timecode_2997,
+ timecode_2997drop,
+ timecode_30,
+ timecode_30drop,
+ timecode_5994,
+ timecode_60
};
struct AnyTime {
enum Type {
- SMPTE,
+ Timecode,
BBT,
Frames,
Seconds
Type type;
- SMPTE::Time smpte;
+ Timecode::Time timecode;
BBT_Time bbt;
union {
{
/* make sure the wrap buffer is at least large enough to deal
with the speeds up to 1.2, to allow for micro-variation
- when slaving to MTC, SMPTE etc.
+ when slaving to MTC, Timecode etc.
*/
double sp = max (fabsf (_actual_speed), 1.2f);
AudioRegionImporter::get_info () const
{
nframes_t length, position;
- SMPTE::Time length_time, position_time;
+ Timecode::Time length_time, position_time;
std::ostringstream oss;
// Get sample positions
std::istringstream iss_position(xml_region.property ("position")->value());
iss_position >> position;
- // Convert to smpte
- session.sample_to_smpte(length, length_time, true, false);
- session.sample_to_smpte(position, position_time, true, false);
+ // Convert to timecode
+ session.sample_to_timecode(length, length_time, true, false);
+ session.sample_to_timecode(position, position_time, true, false);
// return info
oss << _("Length: ") <<
- smpte_to_string(length_time) <<
+ timecode_to_string(length_time) <<
_("\nPosition: ") <<
- smpte_to_string(position_time) <<
+ timecode_to_string(position_time) <<
_("\nChannels: ") <<
xml_region.property ("channels")->value();
}
string
-ElementImporter::smpte_to_string(SMPTE::Time & time) const
+ElementImporter::timecode_to_string(Timecode::Time & time) const
{
std::ostringstream oss;
oss << std::setfill('0') << std::right <<
REGISTER_CLASS_ENUM (Session, InCleanup);
REGISTER_BITS (_Session_StateOfTheState);
- REGISTER_ENUM (smpte_23976);
- REGISTER_ENUM (smpte_24);
- REGISTER_ENUM (smpte_24976);
- REGISTER_ENUM (smpte_25);
- REGISTER_ENUM (smpte_2997);
- REGISTER_ENUM (smpte_2997drop);
- REGISTER_ENUM (smpte_30);
- REGISTER_ENUM (smpte_30drop);
- REGISTER_ENUM (smpte_5994);
- REGISTER_ENUM (smpte_60);
+ REGISTER_ENUM (timecode_23976);
+ REGISTER_ENUM (timecode_24);
+ REGISTER_ENUM (timecode_24976);
+ REGISTER_ENUM (timecode_25);
+ REGISTER_ENUM (timecode_2997);
+ REGISTER_ENUM (timecode_2997drop);
+ REGISTER_ENUM (timecode_30);
+ REGISTER_ENUM (timecode_30drop);
+ REGISTER_ENUM (timecode_5994);
+ REGISTER_ENUM (timecode_60);
REGISTER (_Session_SmpteFormat);
REGISTER_CLASS_ENUM (Session, pullup_Plus4Plus1);
REGISTER_CLASS_ENUM (AutomationList, Curved);
REGISTER (_AutomationList_InterpolationStyle);
- REGISTER_CLASS_ENUM (AnyTime, SMPTE);
+ REGISTER_CLASS_ENUM (AnyTime, Timecode);
REGISTER_CLASS_ENUM (AnyTime, BBT);
REGISTER_CLASS_ENUM (AnyTime, Frames);
REGISTER_CLASS_ENUM (AnyTime, Seconds);
REGISTER_CLASS_ENUM (ExportFormatBase, SRC_Linear);
REGISTER (_ExportFormatBase_SRCQuality);
- REGISTER_CLASS_ENUM (ExportProfileManager, SMPTE);
+ REGISTER_CLASS_ENUM (ExportProfileManager, Timecode);
REGISTER_CLASS_ENUM (ExportProfileManager, BBT);
REGISTER_CLASS_ENUM (ExportProfileManager, MinSec);
REGISTER_CLASS_ENUM (ExportProfileManager, Frames);
ExportFormatSpecification::Time::operator= (AnyTime const & other)
{
type = other.type;
- smpte = other.smpte;
+ timecode = other.timecode;
bbt = other.bbt;
if (type == Frames) {
node->add_property ("format", enum_2_string (type));
switch (type) {
- case SMPTE:
- node->add_property ("hours", to_string (smpte.hours, std::dec));
- node->add_property ("minutes", to_string (smpte.minutes, std::dec));
- node->add_property ("seconds", to_string (smpte.seconds, std::dec));
- node->add_property ("frames", to_string (smpte.frames, std::dec));
+ case Timecode:
+ node->add_property ("hours", to_string (timecode.hours, std::dec));
+ node->add_property ("minutes", to_string (timecode.minutes, std::dec));
+ node->add_property ("seconds", to_string (timecode.seconds, std::dec));
+ node->add_property ("frames", to_string (timecode.frames, std::dec));
break;
case BBT:
node->add_property ("bars", to_string (bbt.bars, std::dec));
type = (Type) string_2_enum (prop->value(), Type);
switch (type) {
- case SMPTE:
+ case Timecode:
if ((prop = node.property ("hours"))) {
- smpte.hours = atoi (prop->value());
+ timecode.hours = atoi (prop->value());
}
if ((prop = node.property ("minutes"))) {
- smpte.minutes = atoi (prop->value());
+ timecode.minutes = atoi (prop->value());
}
if ((prop = node.property ("seconds"))) {
- smpte.seconds = atoi (prop->value());
+ timecode.seconds = atoi (prop->value());
}
if ((prop = node.property ("frames"))) {
- smpte.frames = atoi (prop->value());
+ timecode.frames = atoi (prop->value());
}
break;
, _silence_beginning (s)
, _silence_end (s)
{
- _silence_beginning.type = Time::SMPTE;
- _silence_end.type = Time::SMPTE;
+ _silence_beginning.type = Time::Timecode;
+ _silence_end.type = Time::Timecode;
set_state (state);
}
_silence_beginning.set_state (*child);
}
} else {
- _silence_beginning.type = Time::SMPTE;
+ _silence_beginning.type = Time::Timecode;
}
}
}
_silence_end.set_state (*child);
}
} else {
- _silence_end.type = Time::SMPTE;
+ _silence_end.type = Time::Timecode;
}
}
}
LocationImporter::get_info () const
{
nframes_t start, end;
- SMPTE::Time start_time, end_time;
+ Timecode::Time start_time, end_time;
// Get sample positions
std::istringstream iss_start (xml_location.property ("start")->value());
std::istringstream iss_end (xml_location.property ("end")->value());
iss_end >> end;
- // Convert to smpte
- session.sample_to_smpte (start, start_time, true, false);
- session.sample_to_smpte (end, end_time, true, false);
+ // Convert to timecode
+ session.sample_to_timecode (start, start_time, true, false);
+ session.sample_to_timecode (end, end_time, true, false);
// return info
std::ostringstream oss;
if (start == end) {
- oss << _("Location: ") << smpte_to_string (start_time);
+ oss << _("Location: ") << timecode_to_string (start_time);
} else {
- oss << _("Range\nstart: ") << smpte_to_string (start_time) <<
- _("\nend: ") << smpte_to_string (end_time);
+ oss << _("Range\nstart: ") << timecode_to_string (start_time) <<
+ _("\nend: ") << timecode_to_string (end_time);
}
return oss.str();
{
can_notify_on_unknown_rate = true;
- last_mtc_fps_byte = session.get_mtc_smpte_bits ();
+ last_mtc_fps_byte = session.get_mtc_timecode_bits ();
rebind (p);
reset ();
nframes_t qtr;
static cycles_t last_qtr = 0;
- qtr = (long) (session.frames_per_smpte_frame() / 4);
+ qtr = (long) (session.frames_per_timecode_frame() / 4);
mtc_frame += qtr;
last_qtr = cnow;
MTC_Slave::update_mtc_time (const byte *msg, bool was_full)
{
nframes_t now = session.engine().frame_time();
- SMPTE::Time smpte;
+ Timecode::Time timecode;
- smpte.hours = msg[3];
- smpte.minutes = msg[2];
- smpte.seconds = msg[1];
- smpte.frames = msg[0];
+ timecode.hours = msg[3];
+ timecode.minutes = msg[2];
+ timecode.seconds = msg[1];
+ timecode.frames = msg[0];
last_mtc_fps_byte = msg[4];
switch (msg[4]) {
case MTC_24_FPS:
- smpte.rate = 24;
- smpte.drop = false;
+ timecode.rate = 24;
+ timecode.drop = false;
can_notify_on_unknown_rate = true;
break;
case MTC_25_FPS:
- smpte.rate = 25;
- smpte.drop = false;
+ timecode.rate = 25;
+ timecode.drop = false;
can_notify_on_unknown_rate = true;
break;
case MTC_30_FPS_DROP:
- smpte.rate = 30;
- smpte.drop = true;
+ timecode.rate = 30;
+ timecode.drop = true;
can_notify_on_unknown_rate = true;
break;
case MTC_30_FPS:
- smpte.rate = 30;
- smpte.drop = false;
+ timecode.rate = 30;
+ timecode.drop = false;
can_notify_on_unknown_rate = true;
break;
default:
<< endmsg;
can_notify_on_unknown_rate = false;
}
- smpte.rate = session.smpte_frames_per_second();
- smpte.drop = session.smpte_drop_frames();
+ timecode.rate = session.timecode_frames_per_second();
+ timecode.drop = session.timecode_drop_frames();
}
- session.smpte_to_sample (smpte, mtc_frame, true, false);
+ session.timecode_to_sample (timecode, mtc_frame, true, false);
if (was_full) {
Also compensate for audio latency.
*/
- mtc_frame += (long) (1.75 * session.frames_per_smpte_frame()) + session.worst_output_latency();
+ mtc_frame += (long) (1.75 * session.frames_per_timecode_frame()) + session.worst_output_latency();
if (first_mtc_frame == 0) {
first_mtc_frame = mtc_frame;
ARDOUR::nframes_t
MTC_Slave::resolution() const
{
- return (nframes_t) session.frames_per_smpte_frame();
+ return (nframes_t) session.frames_per_timecode_frame();
}
void
sigc::signal<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
sigc::signal<void> Session::SendFeedback;
-sigc::signal<void> Session::SMPTEOffsetChanged;
+sigc::signal<void> Session::TimecodeOffsetChanged;
sigc::signal<void> Session::StartTimeChanged;
sigc::signal<void> Session::EndTimeChanged;
sigc::signal<void> Session::AutoBindingOn;
state_tree (0),
_butler (new Butler (this)),
post_transport_work((PostTransportWork)0),
- _send_smpte_update (false),
+ _send_timecode_update (false),
midi_thread (pthread_t (0)),
midi_requests (128), // the size of this should match the midi request pool size
diskstreams (new DiskstreamList),
state_tree (0),
_butler (new Butler (this)),
post_transport_work((PostTransportWork)0),
- _send_smpte_update (false),
+ _send_timecode_update (false),
midi_thread (pthread_t (0)),
midi_requests (16),
diskstreams (new DiskstreamList),
// cerr << "soft locate to " << ev->target_frame << endl;
start_locate (ev->target_frame, false, true, false);
}
- _send_smpte_update = true;
+ _send_timecode_update = true;
break;
case Event::LocateRoll:
// cerr << "soft locate to+roll " << ev->target_frame << endl;
start_locate (ev->target_frame, true, true, false);
}
- _send_smpte_update = true;
+ _send_timecode_update = true;
break;
case Event::LocateRollLocate:
#include "ardour/audio_diskstream.h"
#include "ardour/slave.h"
#include "ardour/cycles.h"
-#include "ardour/smpte.h"
+#include "ardour/timecode.h"
#include "i18n.h"
void
Session::setup_midi_control ()
{
- outbound_mtc_smpte_frame = 0;
+ outbound_mtc_timecode_frame = 0;
next_quarter_frame_to_send = 0;
/* setup the MMC buffer */
}
double diff_secs = diff.tv_sec + (diff.tv_usec / 1000000.0);
- double cur_speed = (((steps * 0.5) * smpte_frames_per_second()) / diff_secs) / smpte_frames_per_second();
+ double cur_speed = (((steps * 0.5) * timecode_frames_per_second()) / diff_secs) / timecode_frames_per_second();
if (_transport_speed == 0 || cur_speed * _transport_speed < 0) {
/* change direction */
}
nframes_t target_frame;
- SMPTE::Time smpte;
+ Timecode::Time timecode;
- smpte.hours = mmc_tc[0] & 0xf;
- smpte.minutes = mmc_tc[1];
- smpte.seconds = mmc_tc[2];
- smpte.frames = mmc_tc[3];
- smpte.rate = smpte_frames_per_second();
- smpte.drop = smpte_drop_frames();
+ timecode.hours = mmc_tc[0] & 0xf;
+ timecode.minutes = mmc_tc[1];
+ timecode.seconds = mmc_tc[2];
+ timecode.frames = mmc_tc[3];
+ timecode.rate = timecode_frames_per_second();
+ timecode.drop = timecode_drop_frames();
- // Also takes smpte offset into account:
- smpte_to_sample( smpte, target_frame, true /* use_offset */, false /* use_subframes */ );
+ // Also takes timecode offset into account:
+ timecode_to_sample( timecode, target_frame, true /* use_offset */, false /* use_subframes */ );
if (target_frame > max_frames) {
target_frame = max_frames;
poke_midi_thread ();
}
-/** Send MTC Full Frame message (complete SMPTE time) for the start of this cycle.
+/** Send MTC Full Frame message (complete Timecode time) for the start of this cycle.
* This resets the MTC code, the next quarter frame message that is sent will be
* the first one with the beginning of this cycle as the new start point.
*/
* that be useful? Does ardour do sub-block accurate locating? [DR] */
MIDI::byte msg[10];
- SMPTE::Time smpte;
+ Timecode::Time timecode;
- _send_smpte_update = false;
+ _send_timecode_update = false;
if (_mtc_port == 0 || !session_send_mtc) {
return 0;
}
- // Get smpte time for this transport frame
- sample_to_smpte(_transport_frame, smpte, true /* use_offset */, false /* no subframes */);
+ // Get timecode time for this transport frame
+ sample_to_timecode(_transport_frame, timecode, true /* use_offset */, false /* no subframes */);
- transmitting_smpte_time = smpte;
- outbound_mtc_smpte_frame = _transport_frame;
+ transmitting_timecode_time = timecode;
+ outbound_mtc_timecode_frame = _transport_frame;
// I don't understand this bit yet.. [DR]
- if (((mtc_smpte_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_smpte_time.frames % 2)) {
+ if (((mtc_timecode_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_timecode_time.frames % 2)) {
// start MTC quarter frame transmission on an even frame
- SMPTE::increment( transmitting_smpte_time, config.get_subframes_per_frame() );
- outbound_mtc_smpte_frame += (nframes_t) _frames_per_smpte_frame;
+ Timecode::increment( transmitting_timecode_time, config.get_subframes_per_frame() );
+ outbound_mtc_timecode_frame += (nframes_t) _frames_per_timecode_frame;
}
// Compensate for audio latency
- outbound_mtc_smpte_frame += _worst_output_latency;
+ outbound_mtc_timecode_frame += _worst_output_latency;
next_quarter_frame_to_send = 0;
- // Sync slave to the same SMPTE time as we are on
+ // Sync slave to the same Timecode time as we are on
msg[0] = 0xf0;
msg[1] = 0x7f;
msg[2] = 0x7f;
msg[4] = 0x1;
msg[9] = 0xf7;
- msg[5] = mtc_smpte_bits | smpte.hours;
- msg[6] = smpte.minutes;
- msg[7] = smpte.seconds;
- msg[8] = smpte.frames;
+ msg[5] = mtc_timecode_bits | timecode.hours;
+ msg[6] = timecode.minutes;
+ msg[7] = timecode.seconds;
+ msg[8] = timecode.frames;
- cerr << "MTC: Sending full time code at " << outbound_mtc_smpte_frame << endl;
+ cerr << "MTC: Sending full time code at " << outbound_mtc_timecode_frame << endl;
// Send message at offset 0, sent time is for the start of this cycle
if (_mtc_port->midimsg (msg, sizeof (msg), 0)) {
/** Send MTC (quarter-frame) messages for this cycle.
* Must be called exactly once per cycle from the audio thread. Realtime safe.
- * This function assumes the state of full SMPTE is sane, eg. the slave is
+ * This function assumes the state of full Timecode is sane, eg. the slave is
* expecting quarter frame messages and has the right frame of reference (any
- * full MTC SMPTE time messages that needed to be sent should have been sent
+ * full MTC Timecode time messages that needed to be sent should have been sent
* earlier already this cycle by send_full_time_code)
*/
int
assert (next_quarter_frame_to_send >= 0);
assert (next_quarter_frame_to_send <= 7);
- if (_mtc_port == 0 || !session_send_mtc || transmitting_smpte_time.negative
+ if (_mtc_port == 0 || !session_send_mtc || transmitting_timecode_time.negative
/*|| (next_quarter_frame_to_send < 0)*/ ) {
// cerr << "(MTC) Not sending MTC\n";
return 0;
}
/* Duration of one quarter frame */
- nframes_t quarter_frame_duration = ((long) _frames_per_smpte_frame) >> 2;
+ nframes_t quarter_frame_duration = ((long) _frames_per_timecode_frame) >> 2;
- // cerr << "(MTC) TR: " << _transport_frame << " - SF: " << outbound_mtc_smpte_frame
+ // cerr << "(MTC) TR: " << _transport_frame << " - SF: " << outbound_mtc_timecode_frame
// << " - NQ: " << next_quarter_frame_to_send << " - FD" << quarter_frame_duration << endl;
// FIXME: this should always be true
- //assert((outbound_mtc_smpte_frame + (next_quarter_frame_to_send * quarter_frame_duration))
+ //assert((outbound_mtc_timecode_frame + (next_quarter_frame_to_send * quarter_frame_duration))
// > _transport_frame);
// Send quarter frames for this cycle
- while (_transport_frame + nframes > (outbound_mtc_smpte_frame +
+ while (_transport_frame + nframes > (outbound_mtc_timecode_frame +
(next_quarter_frame_to_send * quarter_frame_duration))) {
// cerr << "(MTC) Next frame to send: " << next_quarter_frame_to_send << endl;
switch (next_quarter_frame_to_send) {
case 0:
- mtc_msg[1] = 0x00 | (transmitting_smpte_time.frames & 0xf);
+ mtc_msg[1] = 0x00 | (transmitting_timecode_time.frames & 0xf);
break;
case 1:
- mtc_msg[1] = 0x10 | ((transmitting_smpte_time.frames & 0xf0) >> 4);
+ mtc_msg[1] = 0x10 | ((transmitting_timecode_time.frames & 0xf0) >> 4);
break;
case 2:
- mtc_msg[1] = 0x20 | (transmitting_smpte_time.seconds & 0xf);
+ mtc_msg[1] = 0x20 | (transmitting_timecode_time.seconds & 0xf);
break;
case 3:
- mtc_msg[1] = 0x30 | ((transmitting_smpte_time.seconds & 0xf0) >> 4);
+ mtc_msg[1] = 0x30 | ((transmitting_timecode_time.seconds & 0xf0) >> 4);
break;
case 4:
- mtc_msg[1] = 0x40 | (transmitting_smpte_time.minutes & 0xf);
+ mtc_msg[1] = 0x40 | (transmitting_timecode_time.minutes & 0xf);
break;
case 5:
- mtc_msg[1] = 0x50 | ((transmitting_smpte_time.minutes & 0xf0) >> 4);
+ mtc_msg[1] = 0x50 | ((transmitting_timecode_time.minutes & 0xf0) >> 4);
break;
case 6:
- mtc_msg[1] = 0x60 | ((mtc_smpte_bits|transmitting_smpte_time.hours) & 0xf);
+ mtc_msg[1] = 0x60 | ((mtc_timecode_bits|transmitting_timecode_time.hours) & 0xf);
break;
case 7:
- mtc_msg[1] = 0x70 | (((mtc_smpte_bits|transmitting_smpte_time.hours) & 0xf0) >> 4);
+ mtc_msg[1] = 0x70 | (((mtc_timecode_bits|transmitting_timecode_time.hours) & 0xf0) >> 4);
break;
}
- const nframes_t msg_time = (outbound_mtc_smpte_frame
+ const nframes_t msg_time = (outbound_mtc_timecode_frame
+ (quarter_frame_duration * next_quarter_frame_to_send));
// This message must fall within this block or something is broken
return -1;
}
- /*cerr << "(MTC) SMPTE: " << transmitting_smpte_time.hours
- << ":" << transmitting_smpte_time.minutes
- << ":" << transmitting_smpte_time.seconds
- << ":" << transmitting_smpte_time.frames
+ /*cerr << "(MTC) Timecode: " << transmitting_timecode_time.hours
+ << ":" << transmitting_timecode_time.minutes
+ << ":" << transmitting_timecode_time.seconds
+ << ":" << transmitting_timecode_time.frames
<< ", qfm = " << next_quarter_frame_to_send
<< ", stamp = " << out_stamp
<< ", delta = " << _transport_frame + out_stamp - last_time << endl;*/
if (next_quarter_frame_to_send >= 8) {
// Wrap quarter frame counter
next_quarter_frame_to_send = 0;
- // Increment smpte time twice
- SMPTE::increment( transmitting_smpte_time, config.get_subframes_per_frame() );
- SMPTE::increment( transmitting_smpte_time, config.get_subframes_per_frame() );
+ // Increment timecode time twice
+ Timecode::increment( transmitting_timecode_time, config.get_subframes_per_frame() );
+ Timecode::increment( transmitting_timecode_time, config.get_subframes_per_frame() );
// Re-calculate timing of first quarter frame
- //smpte_to_sample( transmitting_smpte_time, outbound_mtc_smpte_frame, true /* use_offset */, false );
- outbound_mtc_smpte_frame += 8 * quarter_frame_duration;
+ //timecode_to_sample( transmitting_timecode_time, outbound_mtc_timecode_frame, true /* use_offset */, false );
+ outbound_mtc_timecode_frame += 8 * quarter_frame_duration;
// Compensate for audio latency
- outbound_mtc_smpte_frame += _worst_output_latency;
+ outbound_mtc_timecode_frame += _worst_output_latency;
}
}
{
using namespace MIDI;
int nbytes = 4;
- SMPTE::Time smpte;
+ Timecode::Time timecode;
if (_mmc_port == 0 || !session_send_mmc) {
// cerr << "Not delivering MMC " << _mmc_port << " - " << session_send_mmc << endl;
switch (cmd) {
case MachineControl::cmdLocate:
- smpte_time_subframes (where, smpte);
+ timecode_time_subframes (where, timecode);
mmc_buffer[nbytes++] = 0x6; // byte count
mmc_buffer[nbytes++] = 0x1; // "TARGET" subcommand
- mmc_buffer[nbytes++] = smpte.hours;
- mmc_buffer[nbytes++] = smpte.minutes;
- mmc_buffer[nbytes++] = smpte.seconds;
- mmc_buffer[nbytes++] = smpte.frames;
- mmc_buffer[nbytes++] = smpte.subframes;
+ mmc_buffer[nbytes++] = timecode.hours;
+ mmc_buffer[nbytes++] = timecode.minutes;
+ mmc_buffer[nbytes++] = timecode.seconds;
+ mmc_buffer[nbytes++] = timecode.frames;
+ mmc_buffer[nbytes++] = timecode.subframes;
break;
case MachineControl::cmdStop:
nframes_t transport_frames = transport_frame();
BBT_Time transport_bbt;
bbt_time(transport_frames, transport_bbt);
- SMPTE::Time transport_smpte;
- smpte_time(transport_frames, transport_smpte);
- tick (transport_frames, transport_bbt, transport_smpte); /* EMIT SIGNAL */
+ Timecode::Time transport_timecode;
+ timecode_time(transport_frames, transport_timecode);
+ tick (transport_frames, transport_bbt, transport_timecode); /* EMIT SIGNAL */
SendFeedback (); /* EMIT SIGNAL */
process_event (ev);
}
- /* Events caused a transport change, send an MTC Full Frame (SMPTE) message.
+ /* Events caused a transport change, send an MTC Full Frame (Timecode) message.
* This is sent whether rolling or not, to give slaves an idea of ardour time
* on locates (and allow slow slaves to position and prepare for rolling)
*/
- if (_send_smpte_update) {
+ if (_send_timecode_update) {
send_full_time_code(nframes);
}
pending_locate_flush = false;
state_was_pending = false;
set_next_event ();
- outbound_mtc_smpte_frame = 0;
+ outbound_mtc_timecode_frame = 0;
next_quarter_frame_to_send = -1;
current_block_size = 0;
solo_update_disabled = false;
waiting_for_sync_offset = false;
}
- last_smpte_when = 0;
- _smpte_offset = 0;
- _smpte_offset_negative = true;
- last_smpte_valid = false;
+ last_timecode_when = 0;
+ _timecode_offset = 0;
+ _timecode_offset_negative = true;
+ last_timecode_valid = false;
sync_time_vars ();
setup_raid_path (config.get_raid_path());
- } else if (p == "smpte-format") {
+ } else if (p == "timecode-format") {
sync_time_vars ();
_tempo_map->bbt_time (when, bbt);
}
-/* SMPTE TIME */
+/* Timecode TIME */
float
-Session::smpte_frames_per_second() const
+Session::timecode_frames_per_second() const
{
- switch (config.get_smpte_format()) {
- case smpte_23976:
+ switch (config.get_timecode_format()) {
+ case timecode_23976:
return 23.976;
break;
- case smpte_24:
+ case timecode_24:
return 24;
break;
- case smpte_24976:
+ case timecode_24976:
return 24.976;
break;
- case smpte_25:
+ case timecode_25:
return 25;
break;
- case smpte_2997:
+ case timecode_2997:
return 29.97;
break;
- case smpte_2997drop:
+ case timecode_2997drop:
return 29.97;
break;
- case smpte_30:
+ case timecode_30:
return 30;
break;
- case smpte_30drop:
+ case timecode_30drop:
return 30;
break;
- case smpte_5994:
+ case timecode_5994:
return 59.94;
break;
- case smpte_60:
+ case timecode_60:
return 60;
break;
default:
- cerr << "Editor received unexpected smpte type" << endl;
+ cerr << "Editor received unexpected timecode type" << endl;
}
return 30.0;
}
bool
-Session::smpte_drop_frames() const
+Session::timecode_drop_frames() const
{
- switch (config.get_smpte_format()) {
- case smpte_23976:
+ switch (config.get_timecode_format()) {
+ case timecode_23976:
return false;
break;
- case smpte_24:
+ case timecode_24:
return false;
break;
- case smpte_24976:
+ case timecode_24976:
return false;
break;
- case smpte_25:
+ case timecode_25:
return false;
break;
- case smpte_2997:
+ case timecode_2997:
return false;
break;
- case smpte_2997drop:
+ case timecode_2997drop:
return true;
break;
- case smpte_30:
+ case timecode_30:
return false;
break;
- case smpte_30drop:
+ case timecode_30drop:
return true;
break;
- case smpte_5994:
+ case timecode_5994:
return false;
break;
- case smpte_60:
+ case timecode_60:
return false;
break;
default:
- cerr << "Editor received unexpected smpte type" << endl;
+ cerr << "Editor received unexpected timecode type" << endl;
}
return false;
}
Session::sync_time_vars ()
{
_current_frame_rate = (nframes_t) round (_base_frame_rate * (1.0 + (config.get_video_pullup()/100.0)));
- _frames_per_smpte_frame = (double) _current_frame_rate / (double) smpte_frames_per_second();
- if (smpte_drop_frames()) {
- _frames_per_hour = (long)(107892 * _frames_per_smpte_frame);
+ _frames_per_timecode_frame = (double) _current_frame_rate / (double) timecode_frames_per_second();
+ if (timecode_drop_frames()) {
+ _frames_per_hour = (long)(107892 * _frames_per_timecode_frame);
} else {
- _frames_per_hour = (long)(3600 * rint(smpte_frames_per_second()) * _frames_per_smpte_frame);
+ _frames_per_hour = (long)(3600 * rint(timecode_frames_per_second()) * _frames_per_timecode_frame);
}
- _smpte_frames_per_hour = (nframes_t)rint(smpte_frames_per_second() * 3600.0);
+ _timecode_frames_per_hour = (nframes_t)rint(timecode_frames_per_second() * 3600.0);
- last_smpte_valid = false;
- // smpte type bits are the middle two in the upper nibble
- switch ((int) ceil (smpte_frames_per_second())) {
+ last_timecode_valid = false;
+ // timecode type bits are the middle two in the upper nibble
+ switch ((int) ceil (timecode_frames_per_second())) {
case 24:
- mtc_smpte_bits = 0;
+ mtc_timecode_bits = 0;
break;
case 25:
- mtc_smpte_bits = 0x20;
+ mtc_timecode_bits = 0x20;
break;
case 30:
default:
- if (smpte_drop_frames()) {
- mtc_smpte_bits = 0x40;
+ if (timecode_drop_frames()) {
+ mtc_timecode_bits = 0x40;
} else {
- mtc_smpte_bits = 0x60;
+ mtc_timecode_bits = 0x60;
}
break;
};
}
void
-Session::set_smpte_offset (nframes_t off)
+Session::set_timecode_offset (nframes_t off)
{
- _smpte_offset = off;
- last_smpte_valid = false;
+ _timecode_offset = off;
+ last_timecode_valid = false;
- SMPTEOffsetChanged (); /* EMIT SIGNAL */
+ TimecodeOffsetChanged (); /* EMIT SIGNAL */
}
void
-Session::set_smpte_offset_negative (bool neg)
+Session::set_timecode_offset_negative (bool neg)
{
- _smpte_offset_negative = neg;
- last_smpte_valid = false;
+ _timecode_offset_negative = neg;
+ last_timecode_valid = false;
- SMPTEOffsetChanged (); /* EMIT SIGNAL */
+ TimecodeOffsetChanged (); /* EMIT SIGNAL */
}
void
-Session::smpte_to_sample( SMPTE::Time& smpte, nframes_t& sample, bool use_offset, bool use_subframes ) const
+Session::timecode_to_sample( Timecode::Time& timecode, nframes_t& sample, bool use_offset, bool use_subframes ) const
{
- if (smpte.drop) {
+ if (timecode.drop) {
// The drop frame format was created to better approximate the 30000/1001 = 29.97002997002997....
// framerate of NTSC color TV. The used frame rate of drop frame is 29.97, which drifts by about
// 0.108 frame per hour, or about 1.3 frames per 12 hours. This is not perfect, but a lot better
//
// In table form:
//
- // SMPTE value frames offset subframes offset seconds (rounded) 44100 sample (rounded)
+ // Timecode value frames offset subframes offset seconds (rounded) 44100 sample (rounded)
// 0:00:00:00 0.0 0 0.000 0 (accurate)
// 0:00:59:29 1.8 144 60.027 2647177
// 0:01:00:02 -0.2 -16 60.060 2648648
// Per Sigmond <per@sigmond.no>
// Samples inside time dividable by 10 minutes (real time accurate)
- nframes_t base_samples = (nframes_t) (((smpte.hours * 107892) + ((smpte.minutes / 10) * 17982)) * _frames_per_smpte_frame);
+ nframes_t base_samples = (nframes_t) (((timecode.hours * 107892) + ((timecode.minutes / 10) * 17982)) * _frames_per_timecode_frame);
// Samples inside time exceeding the nearest 10 minutes (always offset, see above)
- long exceeding_df_minutes = smpte.minutes % 10;
- long exceeding_df_seconds = (exceeding_df_minutes * 60) + smpte.seconds;
- long exceeding_df_frames = (30 * exceeding_df_seconds) + smpte.frames - (2 * exceeding_df_minutes);
- nframes_t exceeding_samples = (nframes_t) rint(exceeding_df_frames * _frames_per_smpte_frame);
+ long exceeding_df_minutes = timecode.minutes % 10;
+ long exceeding_df_seconds = (exceeding_df_minutes * 60) + timecode.seconds;
+ long exceeding_df_frames = (30 * exceeding_df_seconds) + timecode.frames - (2 * exceeding_df_minutes);
+ nframes_t exceeding_samples = (nframes_t) rint(exceeding_df_frames * _frames_per_timecode_frame);
sample = base_samples + exceeding_samples;
} else {
/*
Non drop is easy.. just note the use of
- rint(smpte.rate) * _frames_per_smpte_frame
- (frames per SMPTE second), which is larger than
- frame_rate() in the non-integer SMPTE rate case.
+ rint(timecode.rate) * _frames_per_timecode_frame
+ (frames per Timecode second), which is larger than
+ frame_rate() in the non-integer Timecode rate case.
*/
- sample = (nframes_t)rint((((smpte.hours * 60 * 60) + (smpte.minutes * 60) + smpte.seconds) * (rint(smpte.rate) * _frames_per_smpte_frame)) + (smpte.frames * _frames_per_smpte_frame));
+ sample = (nframes_t)rint((((timecode.hours * 60 * 60) + (timecode.minutes * 60) + timecode.seconds) * (rint(timecode.rate) * _frames_per_timecode_frame)) + (timecode.frames * _frames_per_timecode_frame));
}
if (use_subframes) {
- sample += (long) (((double)smpte.subframes * _frames_per_smpte_frame) / config.get_subframes_per_frame());
+ sample += (long) (((double)timecode.subframes * _frames_per_timecode_frame) / config.get_subframes_per_frame());
}
if (use_offset) {
- if (smpte_offset_negative()) {
- if (sample >= smpte_offset()) {
- sample -= smpte_offset();
+ if (timecode_offset_negative()) {
+ if (sample >= timecode_offset()) {
+ sample -= timecode_offset();
} else {
/* Prevent song-time from becoming negative */
sample = 0;
}
} else {
- if (smpte.negative) {
- if (sample <= smpte_offset()) {
- sample = smpte_offset() - sample;
+ if (timecode.negative) {
+ if (sample <= timecode_offset()) {
+ sample = timecode_offset() - sample;
} else {
sample = 0;
}
} else {
- sample += smpte_offset();
+ sample += timecode_offset();
}
}
}
void
-Session::sample_to_smpte( nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes ) const
+Session::sample_to_timecode( nframes_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes ) const
{
nframes_t offset_sample;
if (!use_offset) {
offset_sample = sample;
- smpte.negative = false;
+ timecode.negative = false;
} else {
- if (_smpte_offset_negative) {
- offset_sample = sample + _smpte_offset;
- smpte.negative = false;
+ if (_timecode_offset_negative) {
+ offset_sample = sample + _timecode_offset;
+ timecode.negative = false;
} else {
- if (sample < _smpte_offset) {
- offset_sample = (_smpte_offset - sample);
- smpte.negative = true;
+ if (sample < _timecode_offset) {
+ offset_sample = (_timecode_offset - sample);
+ timecode.negative = true;
} else {
- offset_sample = sample - _smpte_offset;
- smpte.negative = false;
+ offset_sample = sample - _timecode_offset;
+ timecode.negative = false;
}
}
}
- double smpte_frames_left_exact;
- double smpte_frames_fraction;
- unsigned long smpte_frames_left;
+ double timecode_frames_left_exact;
+ double timecode_frames_fraction;
+ unsigned long timecode_frames_left;
// Extract whole hours. Do this to prevent rounding errors with
// high sample numbers in the calculations that follow.
- smpte.hours = offset_sample / _frames_per_hour;
+ timecode.hours = offset_sample / _frames_per_hour;
offset_sample = offset_sample % _frames_per_hour;
- // Calculate exact number of (exceeding) smpte frames and fractional frames
- smpte_frames_left_exact = (double) offset_sample / _frames_per_smpte_frame;
- smpte_frames_fraction = smpte_frames_left_exact - floor( smpte_frames_left_exact );
- smpte.subframes = (long) rint(smpte_frames_fraction * config.get_subframes_per_frame());
+ // Calculate exact number of (exceeding) timecode frames and fractional frames
+ timecode_frames_left_exact = (double) offset_sample / _frames_per_timecode_frame;
+ timecode_frames_fraction = timecode_frames_left_exact - floor( timecode_frames_left_exact );
+ timecode.subframes = (long) rint(timecode_frames_fraction * config.get_subframes_per_frame());
// XXX Not sure if this is necessary anymore...
- if (smpte.subframes == config.get_subframes_per_frame()) {
+ if (timecode.subframes == config.get_subframes_per_frame()) {
// This can happen with 24 fps (and 29.97 fps ?)
- smpte_frames_left_exact = ceil( smpte_frames_left_exact );
- smpte.subframes = 0;
+ timecode_frames_left_exact = ceil( timecode_frames_left_exact );
+ timecode.subframes = 0;
}
// Extract hour-exceeding frames for minute, second and frame calculations
- smpte_frames_left = ((long) floor( smpte_frames_left_exact ));
+ timecode_frames_left = ((long) floor( timecode_frames_left_exact ));
- if (smpte_drop_frames()) {
- // See long explanation in smpte_to_sample()...
+ if (timecode_drop_frames()) {
+ // See long explanation in timecode_to_sample()...
// Number of 10 minute chunks
- smpte.minutes = (smpte_frames_left / 17982) * 10; // exactly 17982 frames in 10 minutes
+ timecode.minutes = (timecode_frames_left / 17982) * 10; // exactly 17982 frames in 10 minutes
// frames exceeding the nearest 10 minute barrier
- long exceeding_df_frames = smpte_frames_left % 17982;
+ long exceeding_df_frames = timecode_frames_left % 17982;
// Find minutes exceeding the nearest 10 minute barrier
if (exceeding_df_frames >= 1800) { // nothing to do if we are inside the first minute (0-1799)
exceeding_df_frames -= 1800; // take away first minute (different number of frames than the others)
long extra_minutes_minus_1 = exceeding_df_frames / 1798; // how many minutes after the first one
exceeding_df_frames -= extra_minutes_minus_1 * 1798; // take away the (extra) minutes just found
- smpte.minutes += extra_minutes_minus_1 + 1; // update with exceeding minutes
+ timecode.minutes += extra_minutes_minus_1 + 1; // update with exceeding minutes
}
// Adjust frame numbering for dropped frames (frame 0 and 1 skipped at start of every minute except every 10th)
- if (smpte.minutes % 10) {
+ if (timecode.minutes % 10) {
// Every minute except every 10th
if (exceeding_df_frames < 28) {
// First second, frames 0 and 1 are skipped
- smpte.seconds = 0;
- smpte.frames = exceeding_df_frames + 2;
+ timecode.seconds = 0;
+ timecode.frames = exceeding_df_frames + 2;
} else {
// All other seconds, all 30 frames are counted
exceeding_df_frames -= 28;
- smpte.seconds = (exceeding_df_frames / 30) + 1;
- smpte.frames = exceeding_df_frames % 30;
+ timecode.seconds = (exceeding_df_frames / 30) + 1;
+ timecode.frames = exceeding_df_frames % 30;
}
} else {
// Every 10th minute, all 30 frames counted in all seconds
- smpte.seconds = exceeding_df_frames / 30;
- smpte.frames = exceeding_df_frames % 30;
+ timecode.seconds = exceeding_df_frames / 30;
+ timecode.frames = exceeding_df_frames % 30;
}
} else {
// Non drop is easy
- smpte.minutes = smpte_frames_left / ((long) rint (smpte_frames_per_second ()) * 60);
- smpte_frames_left = smpte_frames_left % ((long) rint (smpte_frames_per_second ()) * 60);
- smpte.seconds = smpte_frames_left / (long) rint(smpte_frames_per_second ());
- smpte.frames = smpte_frames_left % (long) rint(smpte_frames_per_second ());
+ timecode.minutes = timecode_frames_left / ((long) rint (timecode_frames_per_second ()) * 60);
+ timecode_frames_left = timecode_frames_left % ((long) rint (timecode_frames_per_second ()) * 60);
+ timecode.seconds = timecode_frames_left / (long) rint(timecode_frames_per_second ());
+ timecode.frames = timecode_frames_left % (long) rint(timecode_frames_per_second ());
}
if (!use_subframes) {
- smpte.subframes = 0;
+ timecode.subframes = 0;
}
/* set frame rate and drop frame */
- smpte.rate = smpte_frames_per_second ();
- smpte.drop = smpte_drop_frames();
+ timecode.rate = timecode_frames_per_second ();
+ timecode.drop = timecode_drop_frames();
}
void
-Session::smpte_time (nframes_t when, SMPTE::Time& smpte)
+Session::timecode_time (nframes_t when, Timecode::Time& timecode)
{
- if (last_smpte_valid && when == last_smpte_when) {
- smpte = last_smpte;
+ if (last_timecode_valid && when == last_timecode_when) {
+ timecode = last_timecode;
return;
}
- sample_to_smpte( when, smpte, true /* use_offset */, false /* use_subframes */ );
+ sample_to_timecode( when, timecode, true /* use_offset */, false /* use_subframes */ );
- last_smpte_when = when;
- last_smpte = smpte;
- last_smpte_valid = true;
+ last_timecode_when = when;
+ last_timecode = timecode;
+ last_timecode_valid = true;
}
void
-Session::smpte_time_subframes (nframes_t when, SMPTE::Time& smpte)
+Session::timecode_time_subframes (nframes_t when, Timecode::Time& timecode)
{
- if (last_smpte_valid && when == last_smpte_when) {
- smpte = last_smpte;
+ if (last_timecode_valid && when == last_timecode_when) {
+ timecode = last_timecode;
return;
}
- sample_to_smpte( when, smpte, true /* use_offset */, true /* use_subframes */ );
+ sample_to_timecode( when, timecode, true /* use_offset */, true /* use_subframes */ );
- last_smpte_when = when;
- last_smpte = smpte;
- last_smpte_valid = true;
+ last_timecode_when = when;
+ last_timecode = timecode;
+ last_timecode_valid = true;
}
void
-Session::smpte_duration (nframes_t when, SMPTE::Time& smpte) const
+Session::timecode_duration (nframes_t when, Timecode::Time& timecode) const
{
- sample_to_smpte( when, smpte, false /* use_offset */, true /* use_subframes */ );
+ sample_to_timecode( when, timecode, false /* use_offset */, true /* use_subframes */ );
}
void
-Session::smpte_duration_string (char* buf, nframes_t when) const
+Session::timecode_duration_string (char* buf, nframes_t when) const
{
- SMPTE::Time smpte;
+ Timecode::Time timecode;
- smpte_duration (when, smpte);
- snprintf (buf, sizeof (buf), "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, smpte.hours, smpte.minutes, smpte.seconds, smpte.frames);
+ timecode_duration (when, timecode);
+ snprintf (buf, sizeof (buf), "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
}
void
-Session::smpte_time (SMPTE::Time &t)
+Session::timecode_time (Timecode::Time &t)
{
- smpte_time (_transport_frame, t);
+ timecode_time (_transport_frame, t);
}
int
#ifdef HAVE_JACK_VIDEO_SUPPORT
//poke audio video ratio so Ardour can track Video Sync
- pos->audio_frames_per_video_frame = frame_rate() / smpte_frames_per_second();
+ pos->audio_frames_per_video_frame = frame_rate() / timecode_frames_per_second();
pos->valid = jack_position_bits_t (pos->valid | JackAudioVideoRatio);
#endif
#if 0
- /* SMPTE info */
+ /* Timecode info */
- t.smpte_offset = _smpte_offset;
- t.smpte_frame_rate = smpte_frames_per_second();
+ t.timecode_offset = _timecode_offset;
+ t.timecode_frame_rate = timecode_frames_per_second();
if (_transport_speed) {
return _tempo_map->frame_time ( any.bbt);
break;
- case AnyTime::SMPTE:
+ case AnyTime::Timecode:
/* XXX need to handle negative values */
- secs = any.smpte.hours * 60 * 60;
- secs += any.smpte.minutes * 60;
- secs += any.smpte.seconds;
- secs += any.smpte.frames / smpte_frames_per_second();
- if (_smpte_offset_negative)
+ secs = any.timecode.hours * 60 * 60;
+ secs += any.timecode.minutes * 60;
+ secs += any.timecode.seconds;
+ secs += any.timecode.frames / timecode_frames_per_second();
+ if (_timecode_offset_negative)
{
- return (nframes_t) floor (secs * frame_rate()) - _smpte_offset;
+ return (nframes_t) floor (secs * frame_rate()) - _timecode_offset;
}
else
{
- return (nframes_t) floor (secs * frame_rate()) + _smpte_offset;
+ return (nframes_t) floor (secs * frame_rate()) + _timecode_offset;
}
break;
return;
}
- // Update SMPTE time
+ // Update Timecode time
// [DR] FIXME: find out exactly where this should go below
_transport_frame = target_frame;
- smpte_time(_transport_frame, transmitting_smpte_time);
- outbound_mtc_smpte_frame = _transport_frame;
+ timecode_time(_transport_frame, transmitting_timecode_time);
+ outbound_mtc_timecode_frame = _transport_frame;
next_quarter_frame_to_send = 0;
if (_transport_speed && (!with_loop || loop_changing)) {
loop_changing = false;
- _send_smpte_update = true;
+ _send_timecode_update = true;
Located (); /* EMIT SIGNAL */
}
send_stop_event(0);
}
- tick(position, *((ARDOUR::BBT_Time *) 0), *((SMPTE::Time *)0));
+ tick(position, *((ARDOUR::BBT_Time *) 0), *((Timecode::Time *)0));
}
void MidiClockTicker::position_changed(nframes_t position)
_last_tick = loop_location->start() - elapsed_since_last_tick;
}
-void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*transport_bbt*/, const SMPTE::Time& /*transport_smpt*/)
+void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*transport_bbt*/, const Timecode::Time& /*transport_smpt*/)
{
#ifdef WITH_JACK_MIDI
if (!Config->get_send_midi_clock() || _session == 0 || _session->transport_speed() != 1.0f)
}
nframes_t
-BasicUI::smpte_frames_per_hour ()
+BasicUI::timecode_frames_per_hour ()
{
- return session->smpte_frames_per_hour ();
+ return session->timecode_frames_per_hour ();
}
void
-BasicUI::smpte_time (nframes_t where, SMPTE::Time& smpte)
+BasicUI::timecode_time (nframes_t where, Timecode::Time& timecode)
{
- session->smpte_time (where, *((SMPTE::Time *) &smpte));
+ session->timecode_time (where, *((Timecode::Time *) &timecode));
}
void
-BasicUI::smpte_to_sample (SMPTE::Time& smpte, nframes_t& sample, bool use_offset, bool use_subframes) const
+BasicUI::timecode_to_sample (Timecode::Time& timecode, nframes_t& sample, bool use_offset, bool use_subframes) const
{
- session->smpte_to_sample (*((SMPTE::Time*)&smpte), sample, use_offset, use_subframes);
+ session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_offset, use_subframes);
}
void
-BasicUI::sample_to_smpte (nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes) const
+BasicUI::sample_to_timecode (nframes_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const
{
- session->sample_to_smpte (sample, *((SMPTE::Time*)&smpte), use_offset, use_subframes);
+ session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes);
}
#include <string>
#include <jack/types.h>
-#include <control_protocol/smpte.h>
+#include <control_protocol/timecode.h>
namespace ARDOUR {
class Session;
void rec_enable_toggle ();
void toggle_all_rec_enables ();
- jack_nframes_t smpte_frames_per_hour ();
+ jack_nframes_t timecode_frames_per_hour ();
- void smpte_time (jack_nframes_t where, SMPTE::Time&);
- void smpte_to_sample (SMPTE::Time& smpte, jack_nframes_t& sample, bool use_offset, bool use_subframes) const;
- void sample_to_smpte (jack_nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes) const;
+ void timecode_time (jack_nframes_t where, Timecode::Time&);
+ void timecode_to_sample (Timecode::Time& timecode, jack_nframes_t& sample, bool use_offset, bool use_subframes) const;
+ void sample_to_timecode (jack_nframes_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
protected:
BasicUI ();
+++ /dev/null
-/*
- Copyright (C) 2006 Paul Davis
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __ardour_smpte_h__
-#define __ardour_smpte_h__
-
-#include <inttypes.h>
-
-namespace SMPTE {
-
-enum Wrap {
- NONE = 0,
- FRAMES,
- SECONDS,
- MINUTES,
- HOURS
-};
-
-struct Time {
- bool negative;
- uint32_t hours;
- uint32_t minutes;
- uint32_t seconds;
- uint32_t frames; ///< SMPTE frames (not audio samples)
- uint32_t subframes; ///< Typically unused
- float rate; ///< Frame rate of this Time
- static float default_rate;///< Rate to use for default constructor
- bool drop; ///< Whether this Time uses dropframe SMPTE
-
- Time(float a_rate = default_rate) {
- negative = false;
- hours = 0;
- minutes = 0;
- seconds = 0;
- frames = 0;
- subframes = 0;
- rate = a_rate;
- }
-};
-
-Wrap increment( Time& smpte, uint32_t );
-Wrap decrement( Time& smpte, uint32_t );
-Wrap increment_subframes( Time& smpte, uint32_t );
-Wrap decrement_subframes( Time& smpte, uint32_t );
-Wrap increment_seconds( Time& smpte, uint32_t );
-Wrap increment_minutes( Time& smpte, uint32_t );
-Wrap increment_hours( Time& smpte, uint32_t );
-void frames_floor( Time& smpte );
-void seconds_floor( Time& smpte );
-void minutes_floor( Time& smpte );
-void hours_floor( Time& smpte );
-
-} // namespace SMPTE
-
-#endif // __ardour_smpte_h__
--- /dev/null
+/*
+ Copyright (C) 2006 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __ardour_timecode_h__
+#define __ardour_timecode_h__
+
+#include <inttypes.h>
+
+namespace Timecode {
+
+enum Wrap {
+ NONE = 0,
+ FRAMES,
+ SECONDS,
+ MINUTES,
+ HOURS
+};
+
+struct Time {
+ bool negative;
+ uint32_t hours;
+ uint32_t minutes;
+ uint32_t seconds;
+ uint32_t frames; ///< Timecode frames (not audio samples)
+ uint32_t subframes; ///< Typically unused
+ float rate; ///< Frame rate of this Time
+ static float default_rate;///< Rate to use for default constructor
+ bool drop; ///< Whether this Time uses dropframe Timecode
+
+ Time(float a_rate = default_rate) {
+ negative = false;
+ hours = 0;
+ minutes = 0;
+ seconds = 0;
+ frames = 0;
+ subframes = 0;
+ rate = a_rate;
+ }
+};
+
+Wrap increment( Time& timecode, uint32_t );
+Wrap decrement( Time& timecode, uint32_t );
+Wrap increment_subframes( Time& timecode, uint32_t );
+Wrap decrement_subframes( Time& timecode, uint32_t );
+Wrap increment_seconds( Time& timecode, uint32_t );
+Wrap increment_minutes( Time& timecode, uint32_t );
+Wrap increment_hours( Time& timecode, uint32_t );
+void frames_floor( Time& timecode );
+void seconds_floor( Time& timecode );
+void minutes_floor( Time& timecode );
+void hours_floor( Time& timecode );
+
+} // namespace Timecode
+
+#endif // __ardour_timecode_h__
675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define SMPTE_IS_AROUND_ZERO( sm ) (!(sm).frames && !(sm).seconds && !(sm).minutes && !(sm).hours)
-#define SMPTE_IS_ZERO( sm ) (!(sm).frames && !(sm).seconds && !(sm).minutes && !(sm).hours && !(sm.subframes))
+#define Timecode_IS_AROUND_ZERO( sm ) (!(sm).frames && !(sm).seconds && !(sm).minutes && !(sm).hours)
+#define Timecode_IS_ZERO( sm ) (!(sm).frames && !(sm).seconds && !(sm).minutes && !(sm).hours && !(sm.subframes))
-#include "control_protocol/smpte.h"
+#include "control_protocol/timecode.h"
#include "ardour/rc_configuration.h"
-namespace SMPTE {
+namespace Timecode {
float Time::default_rate = 30.0;
-/** Increment @a smpte by exactly one frame (keep subframes value).
+/** Increment @a timecode by exactly one frame (keep subframes value).
* Realtime safe.
* @return true if seconds wrap.
*/
Wrap
-increment( Time& smpte, uint32_t subframes_per_frame )
+increment( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
- if (smpte.negative) {
- if (SMPTE_IS_AROUND_ZERO(smpte) && smpte.subframes) {
+ if (timecode.negative) {
+ if (Timecode_IS_AROUND_ZERO(timecode) && timecode.subframes) {
// We have a zero transition involving only subframes
- smpte.subframes = subframes_per_frame - smpte.subframes;
- smpte.negative = false;
+ timecode.subframes = subframes_per_frame - timecode.subframes;
+ timecode.negative = false;
return SECONDS;
}
- smpte.negative = false;
- wrap = decrement( smpte, subframes_per_frame );
- if (!SMPTE_IS_ZERO( smpte )) {
- smpte.negative = true;
+ timecode.negative = false;
+ wrap = decrement( timecode, subframes_per_frame );
+ if (!Timecode_IS_ZERO( timecode )) {
+ timecode.negative = true;
}
return wrap;
}
- switch ((int)ceil(smpte.rate)) {
+ switch ((int)ceil(timecode.rate)) {
case 24:
- if (smpte.frames == 23) {
- smpte.frames = 0;
+ if (timecode.frames == 23) {
+ timecode.frames = 0;
wrap = SECONDS;
}
break;
case 25:
- if (smpte.frames == 24) {
- smpte.frames = 0;
+ if (timecode.frames == 24) {
+ timecode.frames = 0;
wrap = SECONDS;
}
break;
case 30:
- if (smpte.drop) {
- if (smpte.frames == 29) {
- if ( ((smpte.minutes + 1) % 10) && (smpte.seconds == 59) ) {
- smpte.frames = 2;
+ if (timecode.drop) {
+ if (timecode.frames == 29) {
+ if ( ((timecode.minutes + 1) % 10) && (timecode.seconds == 59) ) {
+ timecode.frames = 2;
}
else {
- smpte.frames = 0;
+ timecode.frames = 0;
}
wrap = SECONDS;
}
} else {
- if (smpte.frames == 29) {
- smpte.frames = 0;
+ if (timecode.frames == 29) {
+ timecode.frames = 0;
wrap = SECONDS;
}
}
break;
case 60:
- if (smpte.frames == 59) {
- smpte.frames = 0;
+ if (timecode.frames == 59) {
+ timecode.frames = 0;
wrap = SECONDS;
}
break;
}
if (wrap == SECONDS) {
- if (smpte.seconds == 59) {
- smpte.seconds = 0;
+ if (timecode.seconds == 59) {
+ timecode.seconds = 0;
wrap = MINUTES;
- if (smpte.minutes == 59) {
- smpte.minutes = 0;
+ if (timecode.minutes == 59) {
+ timecode.minutes = 0;
wrap = HOURS;
- smpte.hours++;
+ timecode.hours++;
} else {
- smpte.minutes++;
+ timecode.minutes++;
}
} else {
- smpte.seconds++;
+ timecode.seconds++;
}
} else {
- smpte.frames++;
+ timecode.frames++;
}
return wrap;
}
-/** Decrement @a smpte by exactly one frame (keep subframes value)
+/** Decrement @a timecode by exactly one frame (keep subframes value)
* Realtime safe.
* @return true if seconds wrap. */
Wrap
-decrement( Time& smpte, uint32_t subframes_per_frame )
+decrement( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
- if (smpte.negative || SMPTE_IS_ZERO(smpte)) {
- smpte.negative = false;
- wrap = increment( smpte, subframes_per_frame );
- smpte.negative = true;
+ if (timecode.negative || Timecode_IS_ZERO(timecode)) {
+ timecode.negative = false;
+ wrap = increment( timecode, subframes_per_frame );
+ timecode.negative = true;
return wrap;
- } else if (SMPTE_IS_AROUND_ZERO(smpte) && smpte.subframes) {
+ } else if (Timecode_IS_AROUND_ZERO(timecode) && timecode.subframes) {
// We have a zero transition involving only subframes
- smpte.subframes = subframes_per_frame - smpte.subframes;
- smpte.negative = true;
+ timecode.subframes = subframes_per_frame - timecode.subframes;
+ timecode.negative = true;
return SECONDS;
}
- switch ((int)ceil(smpte.rate)) {
+ switch ((int)ceil(timecode.rate)) {
case 24:
- if (smpte.frames == 0) {
- smpte.frames = 23;
+ if (timecode.frames == 0) {
+ timecode.frames = 23;
wrap = SECONDS;
}
break;
case 25:
- if (smpte.frames == 0) {
- smpte.frames = 24;
+ if (timecode.frames == 0) {
+ timecode.frames = 24;
wrap = SECONDS;
}
break;
case 30:
- if (smpte.drop) {
- if ((smpte.minutes % 10) && (smpte.seconds == 0)) {
- if (smpte.frames <= 2) {
- smpte.frames = 29;
+ if (timecode.drop) {
+ if ((timecode.minutes % 10) && (timecode.seconds == 0)) {
+ if (timecode.frames <= 2) {
+ timecode.frames = 29;
wrap = SECONDS;
}
- } else if (smpte.frames == 0) {
- smpte.frames = 29;
+ } else if (timecode.frames == 0) {
+ timecode.frames = 29;
wrap = SECONDS;
}
} else {
- if (smpte.frames == 0) {
- smpte.frames = 29;
+ if (timecode.frames == 0) {
+ timecode.frames = 29;
wrap = SECONDS;
}
}
break;
case 60:
- if (smpte.frames == 0) {
- smpte.frames = 59;
+ if (timecode.frames == 0) {
+ timecode.frames = 59;
wrap = SECONDS;
}
break;
}
if (wrap == SECONDS) {
- if (smpte.seconds == 0) {
- smpte.seconds = 59;
+ if (timecode.seconds == 0) {
+ timecode.seconds = 59;
wrap = MINUTES;
- if (smpte.minutes == 0) {
- smpte.minutes = 59;
+ if (timecode.minutes == 0) {
+ timecode.minutes = 59;
wrap = HOURS;
- smpte.hours--;
+ timecode.hours--;
}
else {
- smpte.minutes--;
+ timecode.minutes--;
}
} else {
- smpte.seconds--;
+ timecode.seconds--;
}
} else {
- smpte.frames--;
+ timecode.frames--;
}
- if (SMPTE_IS_ZERO( smpte )) {
- smpte.negative = false;
+ if (Timecode_IS_ZERO( timecode )) {
+ timecode.negative = false;
}
return wrap;
/** Go to lowest absolute subframe value in this frame (set to 0 :-) ) */
void
-frames_floor( Time& smpte )
+frames_floor( Time& timecode )
{
- smpte.subframes = 0;
- if (SMPTE_IS_ZERO(smpte)) {
- smpte.negative = false;
+ timecode.subframes = 0;
+ if (Timecode_IS_ZERO(timecode)) {
+ timecode.negative = false;
}
}
-/** Increment @a smpte by one subframe */
+/** Increment @a timecode by one subframe */
Wrap
-increment_subframes( Time& smpte, uint32_t subframes_per_frame )
+increment_subframes( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
- if (smpte.negative) {
- smpte.negative = false;
- wrap = decrement_subframes( smpte, subframes_per_frame );
- if (!SMPTE_IS_ZERO(smpte)) {
- smpte.negative = true;
+ if (timecode.negative) {
+ timecode.negative = false;
+ wrap = decrement_subframes( timecode, subframes_per_frame );
+ if (!Timecode_IS_ZERO(timecode)) {
+ timecode.negative = true;
}
return wrap;
}
- smpte.subframes++;
- if (smpte.subframes >= subframes_per_frame) {
- smpte.subframes = 0;
- increment( smpte, subframes_per_frame );
+ timecode.subframes++;
+ if (timecode.subframes >= subframes_per_frame) {
+ timecode.subframes = 0;
+ increment( timecode, subframes_per_frame );
return FRAMES;
}
return NONE;
}
-/** Decrement @a smpte by one subframe */
+/** Decrement @a timecode by one subframe */
Wrap
-decrement_subframes( Time& smpte, uint32_t subframes_per_frame )
+decrement_subframes( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
- if (smpte.negative) {
- smpte.negative = false;
- wrap = increment_subframes( smpte, subframes_per_frame );
- smpte.negative = true;
+ if (timecode.negative) {
+ timecode.negative = false;
+ wrap = increment_subframes( timecode, subframes_per_frame );
+ timecode.negative = true;
return wrap;
}
- if (smpte.subframes <= 0) {
- smpte.subframes = 0;
- if (SMPTE_IS_ZERO(smpte)) {
- smpte.negative = true;
- smpte.subframes = 1;
+ if (timecode.subframes <= 0) {
+ timecode.subframes = 0;
+ if (Timecode_IS_ZERO(timecode)) {
+ timecode.negative = true;
+ timecode.subframes = 1;
return FRAMES;
} else {
- decrement( smpte, subframes_per_frame );
- smpte.subframes = 79;
+ decrement( timecode, subframes_per_frame );
+ timecode.subframes = 79;
return FRAMES;
}
} else {
- smpte.subframes--;
- if (SMPTE_IS_ZERO(smpte)) {
- smpte.negative = false;
+ timecode.subframes--;
+ if (Timecode_IS_ZERO(timecode)) {
+ timecode.negative = false;
}
return NONE;
}
/** Go to next whole second (frames == 0 or frames == 2) */
Wrap
-increment_seconds( Time& smpte, uint32_t subframes_per_frame )
+increment_seconds( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
// Clear subframes
- frames_floor( smpte );
+ frames_floor( timecode );
- if (smpte.negative) {
+ if (timecode.negative) {
// Wrap second if on second boundary
- wrap = increment(smpte, subframes_per_frame);
+ wrap = increment(timecode, subframes_per_frame);
// Go to lowest absolute frame value
- seconds_floor( smpte );
- if (SMPTE_IS_ZERO(smpte)) {
- smpte.negative = false;
+ seconds_floor( timecode );
+ if (Timecode_IS_ZERO(timecode)) {
+ timecode.negative = false;
}
} else {
// Go to highest possible frame in this second
- switch ((int)ceil(smpte.rate)) {
+ switch ((int)ceil(timecode.rate)) {
case 24:
- smpte.frames = 23;
+ timecode.frames = 23;
break;
case 25:
- smpte.frames = 24;
+ timecode.frames = 24;
break;
case 30:
- smpte.frames = 29;
+ timecode.frames = 29;
break;
case 60:
- smpte.frames = 59;
+ timecode.frames = 59;
break;
}
// Increment by one frame
- wrap = increment( smpte, subframes_per_frame );
+ wrap = increment( timecode, subframes_per_frame );
}
return wrap;
/** Go to lowest (absolute) frame value in this second
* Doesn't care about positive/negative */
void
-seconds_floor( Time& smpte )
+seconds_floor( Time& timecode )
{
// Clear subframes
- frames_floor( smpte );
+ frames_floor( timecode );
// Go to lowest possible frame in this second
- switch ((int)ceil(smpte.rate)) {
+ switch ((int)ceil(timecode.rate)) {
case 24:
case 25:
case 30:
case 60:
- if (!(smpte.drop)) {
- smpte.frames = 0;
+ if (!(timecode.drop)) {
+ timecode.frames = 0;
} else {
- if ((smpte.minutes % 10) && (smpte.seconds == 0)) {
- smpte.frames = 2;
+ if ((timecode.minutes % 10) && (timecode.seconds == 0)) {
+ timecode.frames = 2;
} else {
- smpte.frames = 0;
+ timecode.frames = 0;
}
}
break;
}
- if (SMPTE_IS_ZERO(smpte)) {
- smpte.negative = false;
+ if (Timecode_IS_ZERO(timecode)) {
+ timecode.negative = false;
}
}
/** Go to next whole minute (seconds == 0, frames == 0 or frames == 2) */
Wrap
-increment_minutes( Time& smpte, uint32_t subframes_per_frame )
+increment_minutes( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
// Clear subframes
- frames_floor( smpte );
+ frames_floor( timecode );
- if (smpte.negative) {
+ if (timecode.negative) {
// Wrap if on minute boundary
- wrap = increment_seconds( smpte, subframes_per_frame );
+ wrap = increment_seconds( timecode, subframes_per_frame );
// Go to lowest possible value in this minute
- minutes_floor( smpte );
+ minutes_floor( timecode );
} else {
// Go to highest possible second
- smpte.seconds = 59;
+ timecode.seconds = 59;
// Wrap minute by incrementing second
- wrap = increment_seconds( smpte, subframes_per_frame );
+ wrap = increment_seconds( timecode, subframes_per_frame );
}
return wrap;
/** Go to lowest absolute value in this minute */
void
-minutes_floor( Time& smpte )
+minutes_floor( Time& timecode )
{
// Go to lowest possible second
- smpte.seconds = 0;
+ timecode.seconds = 0;
// Go to lowest possible frame
- seconds_floor( smpte );
+ seconds_floor( timecode );
- if (SMPTE_IS_ZERO(smpte)) {
- smpte.negative = false;
+ if (Timecode_IS_ZERO(timecode)) {
+ timecode.negative = false;
}
}
/** Go to next whole hour (minute = 0, second = 0, frame = 0) */
Wrap
-increment_hours( Time& smpte, uint32_t subframes_per_frame )
+increment_hours( Time& timecode, uint32_t subframes_per_frame )
{
Wrap wrap = NONE;
// Clear subframes
- frames_floor(smpte);
+ frames_floor(timecode);
- if (smpte.negative) {
+ if (timecode.negative) {
// Wrap if on hour boundary
- wrap = increment_minutes( smpte, subframes_per_frame );
+ wrap = increment_minutes( timecode, subframes_per_frame );
// Go to lowest possible value in this hour
- hours_floor( smpte );
+ hours_floor( timecode );
} else {
- smpte.minutes = 59;
- wrap = increment_minutes( smpte, subframes_per_frame );
+ timecode.minutes = 59;
+ wrap = increment_minutes( timecode, subframes_per_frame );
}
return wrap;
/** Go to lowest absolute value in this hour */
void
-hours_floor( Time& smpte )
+hours_floor( Time& timecode )
{
- smpte.minutes = 0;
- smpte.seconds = 0;
- smpte.frames = 0;
- smpte.subframes = 0;
+ timecode.minutes = 0;
+ timecode.seconds = 0;
+ timecode.frames = 0;
+ timecode.subframes = 0;
- if (SMPTE_IS_ZERO(smpte)) {
- smpte.negative = false;
+ if (Timecode_IS_ZERO(timecode)) {
+ timecode.negative = false;
}
}
-} // namespace SMPTE
+} // namespace Timecode
group->add( *button );
group = groups["display"];
- button = new Button ( 53, 1, "smpte_beats", *group );
+ button = new Button ( 53, 1, "timecode_beats", *group );
buttons[0x35] = button;
controls.push_back( button );
- controls_by_name["smpte_beats"] = button;
+ controls_by_name["timecode_beats"] = button;
group->add( *button );
group = groups["none"];
group->add( *button );
group = groups["none"];
- led = new Led ( 113, 1, "smpte", *group );
+ led = new Led ( 113, 1, "timecode", *group );
leds[0x71] = led;
controls.push_back( led );
- controls_by_name["smpte"] = led;
+ controls_by_name["timecode"] = led;
group->add( *led );
group = groups["none"];
}
break;
- case 0x9035: // smpte_beats
+ case 0x9035: // timecode_beats
switch ( bs ) {
- case press: ls = mbh.smpte_beats_press( button ); break;
- case release: ls = mbh.smpte_beats_release( button ); break;
+ case press: ls = mbh.timecode_beats_press( button ); break;
+ case release: ls = mbh.timecode_beats_release( button ); break;
case neither: break;
}
break;
return default_button_release( button );
}
-LedState MackieButtonHandler::smpte_beats_press( Button & button )
+LedState MackieButtonHandler::timecode_beats_press( Button & button )
{
return default_button_press( button );
}
-LedState MackieButtonHandler::smpte_beats_release( Button & button )
+LedState MackieButtonHandler::timecode_beats_release( Button & button )
{
return default_button_release( button );
}
virtual LedState name_value_press( Button & );
virtual LedState name_value_release( Button & );
- virtual LedState smpte_beats_press( Button & );
- virtual LedState smpte_beats_release( Button & );
+ virtual LedState timecode_beats_press( Button & );
+ virtual LedState timecode_beats_release( Button & );
virtual LedState F1_press( Button & );
virtual LedState F1_release( Button & );
void MackieControlProtocol::zero_all()
{
- // TODO turn off SMPTE displays
+ // TODO turn off Timecode displays
// zero all strips
for ( Surface::Strips::iterator it = surface().strips.begin(); it != surface().strips.end(); ++it )
}
}
-void MackieControlProtocol::update_smpte_beats_led()
+void MackieControlProtocol::update_timecode_beats_led()
{
switch ( _timecode_type )
{
case ARDOUR::AnyTime::BBT:
update_global_led( "beats", on );
- update_global_led( "smpte", off );
+ update_global_led( "timecode", off );
break;
- case ARDOUR::AnyTime::SMPTE:
- update_global_led( "smpte", on );
+ case ARDOUR::AnyTime::Timecode:
+ update_global_led( "timecode", on );
update_global_led( "beats", off );
break;
default:
// update global buttons and displays
notify_record_state_changed();
notify_transport_state_changed();
- update_smpte_beats_led();
+ update_timecode_beats_led();
}
}
return os.str();
}
-string MackieControlProtocol::format_smpte_timecode( nframes_t now_frame )
+string MackieControlProtocol::format_timecode_timecode( nframes_t now_frame )
{
- SMPTE::Time smpte;
- session->smpte_time( now_frame, smpte );
+ Timecode::Time timecode;
+ session->timecode_time( now_frame, timecode );
// According to the Logic docs
// digits: 888/88/88/888
- // SMPTE mode: Hours/Minutes/Seconds/Frames
+ // Timecode mode: Hours/Minutes/Seconds/Frames
ostringstream os;
- os << setw(3) << setfill('0') << smpte.hours;
- os << setw(2) << setfill('0') << smpte.minutes;
- os << setw(2) << setfill('0') << smpte.seconds;
- os << setw(3) << setfill('0') << smpte.frames;
+ os << setw(3) << setfill('0') << timecode.hours;
+ os << setw(2) << setfill('0') << timecode.minutes;
+ os << setw(2) << setfill('0') << timecode.seconds;
+ os << setw(3) << setfill('0') << timecode.frames;
return os.str();
}
case ARDOUR::AnyTime::BBT:
timecode = format_bbt_timecode( current_frame );
break;
- case ARDOUR::AnyTime::SMPTE:
- timecode = format_smpte_timecode( current_frame );
+ case ARDOUR::AnyTime::Timecode:
+ timecode = format_timecode_timecode( current_frame );
break;
default:
ostringstream os;
return off;
}
-LedState MackieControlProtocol::smpte_beats_press (Button &)
+LedState MackieControlProtocol::timecode_beats_press (Button &)
{
switch ( _timecode_type )
{
case ARDOUR::AnyTime::BBT:
- _timecode_type = ARDOUR::AnyTime::SMPTE;
+ _timecode_type = ARDOUR::AnyTime::Timecode;
break;
- case ARDOUR::AnyTime::SMPTE:
+ case ARDOUR::AnyTime::Timecode:
_timecode_type = ARDOUR::AnyTime::BBT;
break;
default:
os << "Unknown Anytime::Type " << _timecode_type;
throw runtime_error( os.str() );
}
- update_smpte_beats_led();
+ update_timecode_beats_led();
return on;
}
-LedState MackieControlProtocol::smpte_beats_release( Button & )
+LedState MackieControlProtocol::timecode_beats_release( Button & )
{
return off;
}
void notify_parameter_changed( std::string const & );
void notify_solo_active_changed( bool );
- /// Turn smpte on and beats off, or vice versa, depending
+ /// Turn timecode on and beats off, or vice versa, depending
/// on state of _timecode_type
- void update_smpte_beats_led();
+ void update_timecode_beats_led();
/// this is called to generate the midi to send in response to a button press.
void update_led( Mackie::Button & button, Mackie::LedState );
virtual Mackie::LedState save_press( Mackie::Button & );
virtual Mackie::LedState save_release( Mackie::Button & );
- virtual Mackie::LedState smpte_beats_press( Mackie::Button & );
- virtual Mackie::LedState smpte_beats_release( Mackie::Button & );
+ virtual Mackie::LedState timecode_beats_press( Mackie::Button & );
+ virtual Mackie::LedState timecode_beats_release( Mackie::Button & );
// jog wheel states
virtual Mackie::LedState zoom_press( Mackie::Button & );
void update_timecode_display();
std::string format_bbt_timecode( nframes_t now_frame );
- std::string format_smpte_timecode( nframes_t now_frame );
+ std::string format_timecode_timecode( nframes_t now_frame );
/**
notification that the port is about to start it's init sequence.
// last written timecode string
std::string _timecode_last;
- // Which timecode are we displaying? BBT or SMPTE
+ // Which timecode are we displaying? BBT or Timecode
ARDOUR::AnyTime::Type _timecode_type;
};
group->add( *button );
group = groups["display"];
- button = new Button ( 53, 1, "smpte_beats", *group );
+ button = new Button ( 53, 1, "timecode_beats", *group );
buttons[0x35] = button;
controls.push_back( button );
- controls_by_name["smpte_beats"] = button;
+ controls_by_name["timecode_beats"] = button;
group->add( *button );
group = groups["none"];
group->add( *button );
group = groups["none"];
- led = new Led ( 113, 1, "smpte", *group );
+ led = new Led ( 113, 1, "timecode", *group );
leds[0x71] = led;
controls.push_back( led );
- controls_by_name["smpte"] = led;
+ controls_by_name["timecode"] = led;
group->add( *led );
group = groups["none"];
}
break;
- case 0x9035: // smpte_beats
+ case 0x9035: // timecode_beats
switch ( bs ) {
- case press: ls = mbh.smpte_beats_press( button ); break;
- case release: ls = mbh.smpte_beats_release( button ); break;
+ case press: ls = mbh.timecode_beats_press( button ); break;
+ case release: ls = mbh.timecode_beats_release( button ); break;
case neither: break;
}
break;
}
void
-TranzportControlProtocol::show_smpte (nframes_t where)
+TranzportControlProtocol::show_timecode (nframes_t where)
{
if ((where != last_where) || lcd_isdamaged(1,9,10)) {
char buf[5];
- SMPTE::Time smpte;
+ Timecode::Time timecode;
- session->smpte_time (where, smpte);
+ session->timecode_time (where, timecode);
- if (smpte.negative) {
- sprintf (buf, "-%02" PRIu32 ":", smpte.hours);
+ if (timecode.negative) {
+ sprintf (buf, "-%02" PRIu32 ":", timecode.hours);
} else {
- sprintf (buf, " %02" PRIu32 ":", smpte.hours);
+ sprintf (buf, " %02" PRIu32 ":", timecode.hours);
}
print (1, 8, buf);
- sprintf (buf, "%02" PRIu32 ":", smpte.minutes);
+ sprintf (buf, "%02" PRIu32 ":", timecode.minutes);
print (1, 12, buf);
- sprintf (buf, "%02" PRIu32 ":", smpte.seconds);
+ sprintf (buf, "%02" PRIu32 ":", timecode.seconds);
print (1, 15, buf);
- sprintf (buf, "%02" PRIu32, smpte.frames);
+ sprintf (buf, "%02" PRIu32, timecode.frames);
print_noretry (1, 18, buf);
last_where = where;
void show_track_gain ();
void show_transport_time ();
void show_bbt (nframes_t where);
- void show_smpte (nframes_t where);
+ void show_timecode (nframes_t where);
void show_wheel_mode ();
void show_gain ();
void show_pan ();