#include "audio_clock.h"
#include "editor.h"
#include "editor_drag.h"
+#include "global_signals.h"
#include "main_clock.h"
#include "verbose_cursor.h"
_canvas_item = new ArdourCanvas::TrackingText (_editor->get_noscroll_group());
CANVAS_DEBUG_NAME (_canvas_item, "verbose canvas cursor");
_canvas_item->set_font_description (Pango::FontDescription (ARDOUR_UI::config()->get_canvasvar_LargerBoldFont()));
+ color_handler ();
+
+ ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &VerboseCursor::color_handler));
+}
+
+void
+VerboseCursor::color_handler ()
+{
_canvas_item->set_color (ARDOUR_UI::config()->get_canvasvar_VerboseCanvasCursor());
}
char buf[128];
Timecode::Time timecode;
Timecode::BBT_Time bbt;
- int hours, mins;
- framepos_t frame_rate;
- float secs;
if (_editor->_session == 0) {
return;
}
- AudioClock::Mode m;
+ /* Take clock mode from the primary clock */
- 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_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: