char buf[128];
Timecode::Time timecode;
Timecode::BBT_Time bbt;
- int hours, mins;
- framepos_t frame_rate;
- float secs;
if (_editor->_session == 0) {
return;
case AudioClock::Timecode:
_editor->_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);
+ snprintf (buf, sizeof (buf), "%s", Timecode::timecode_format_time (timecode).c_str());
break;
case AudioClock::MinSec:
- /* XXX this is copied from show_verbose_duration_cursor() */
- frame_rate = _editor->_session->frame_rate();
- hours = frame / (frame_rate * 3600);
- frame = frame % (frame_rate * 3600);
- mins = frame / (frame_rate * 60);
- frame = frame % (frame_rate * 60);
- secs = (float) frame / (float) frame_rate;
- snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%07.4f", hours, mins, secs);
+ AudioClock::print_minsec (frame, buf, sizeof (buf), _editor->_session->frame_rate());
break;
default:
Timecode::Time timecode;
Timecode::BBT_Time sbbt;
Timecode::BBT_Time ebbt;
- int hours, mins;
- framepos_t distance, frame_rate;
- float secs;
Meter meter_at_start (_editor->_session->tempo_map().meter_at(start));
if (_editor->_session == 0) {
return;
}
- AudioClock::Mode m;
-
- if (Profile->get_sae() || Profile->get_small_screen() || Profile->get_trx()) {
- m = ARDOUR_UI::instance()->primary_clock->mode ();
- } else {
- m = ARDOUR_UI::instance()->secondary_clock->mode ();
- }
+ AudioClock::Mode m = ARDOUR_UI::instance()->primary_clock->mode ();
switch (m) {
case AudioClock::BBT:
case AudioClock::Timecode:
_editor->_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);
+ snprintf (buf, sizeof (buf), "%s", Timecode::timecode_format_time (timecode).c_str());
break;
case AudioClock::MinSec:
- /* XXX this stuff should be elsewhere.. */
- distance = end - start;
- frame_rate = _editor->_session->frame_rate();
- hours = distance / (frame_rate * 3600);
- distance = distance % (frame_rate * 3600);
- mins = distance / (frame_rate * 60);
- distance = distance % (frame_rate * 60);
- secs = (float) distance / (float) frame_rate;
- snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%07.4f", hours, mins, secs);
+ AudioClock::print_minsec (end - start, buf, sizeof (buf), _editor->_session->frame_rate());
break;
default: