summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour_ui.cc20
-rw-r--r--gtk2_ardour/ardour_ui.h3
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc16
-rw-r--r--gtk2_ardour/audio_clock.cc10
-rw-r--r--gtk2_ardour/rc_option_editor.cc6
-rw-r--r--libs/timecode/src/time.cc51
-rw-r--r--libs/timecode/timecode/time.h2
7 files changed, 90 insertions, 18 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index b02bfd61c4..19f01ff7d1 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -74,6 +74,8 @@
#include "ardour/session_state_utils.h"
#include "ardour/session_utils.h"
+#include "timecode/time.h"
+
typedef uint64_t microseconds_t;
#include "about.h"
@@ -463,6 +465,7 @@ ARDOUR_UI::post_engine ()
update_disk_space ();
update_cpu_load ();
update_sample_rate (engine->frame_rate());
+ update_timecode_format ();
Config->ParameterChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
@@ -886,6 +889,7 @@ ARDOUR_UI::every_second ()
update_cpu_load ();
update_buffer_load ();
update_disk_space ();
+ update_timecode_format ();
return TRUE;
}
@@ -1095,6 +1099,22 @@ ARDOUR_UI::update_disk_space()
disk_space_label.set_markup (buf);
}
+void
+ARDOUR_UI::update_timecode_format ()
+{
+ char buf[64];
+
+ if (_session) {
+ snprintf (buf, sizeof (buf), S_("Timecode|TC: <span foreground=\"%s\">%sfps</span>"),
+ rand() % 2 ? X_("red") : X_("green"),
+ Timecode::timecode_format_name (_session->config.get_timecode_format()).c_str());
+ } else {
+ snprintf (buf, sizeof (buf), "TC: n/a");
+ }
+
+ timecode_format_label.set_markup (buf);
+}
+
gint
ARDOUR_UI::update_wall_clock ()
{
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 92e7295514..1c95232479 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -502,6 +502,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
Gtk::Label disk_space_label;
void update_disk_space ();
+ Gtk::Label timecode_format_label;
+ void update_timecode_format ();
+
Gtk::Label cpu_load_label;
void update_cpu_load ();
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index c556b9a957..0ac3516d85 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -551,6 +551,8 @@ ARDOUR_UI::build_menu_bar ()
wall_clock_label.set_use_markup ();
disk_space_label.set_name ("WallClock");
disk_space_label.set_use_markup ();
+ timecode_format_label.set_name ("WallClock");
+ timecode_format_label.set_use_markup ();
cpu_load_label.set_name ("CPULoad");
cpu_load_label.set_use_markup ();
buffer_load_label.set_name ("BufferLoad");
@@ -582,6 +584,7 @@ ARDOUR_UI::build_menu_bar ()
hbox->pack_end (cpu_load_label, false, false, 4);
hbox->pack_end (buffer_load_label, false, false, 4);
hbox->pack_end (sample_rate_label, false, false, 4);
+ hbox->pack_end (timecode_format_label, false, false, 4);
hbox->pack_end (format_label, false, false, 4);
menu_hbox.pack_end (*ev, false, false, 6);
@@ -589,12 +592,13 @@ ARDOUR_UI::build_menu_bar ()
menu_bar_base.set_name ("MainMenuBar");
menu_bar_base.add (menu_hbox);
- _status_bar_visibility.add (&wall_clock_label, X_("WallClock"), _("Wall Clock"), wall_clock);
- _status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space);
- _status_bar_visibility.add (&cpu_load_label, X_("DSP"), _("DSP"), true);
- _status_bar_visibility.add (&buffer_load_label, X_("Buffers"), _("Buffers"), true);
- _status_bar_visibility.add (&sample_rate_label, X_("JACK"), _("JACK Sampling Rate and Latency"), true);
- _status_bar_visibility.add (&format_label, X_("Format"), _("File Format"), true);
+ _status_bar_visibility.add (&wall_clock_label, X_("WallClock"), _("Wall Clock"), wall_clock);
+ _status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space);
+ _status_bar_visibility.add (&cpu_load_label, X_("DSP"), _("DSP"), true);
+ _status_bar_visibility.add (&buffer_load_label, X_("Buffers"), _("Buffers"), true);
+ _status_bar_visibility.add (&sample_rate_label, X_("JACK"), _("JACK Sampling Rate and Latency"), true);
+ _status_bar_visibility.add (&timecode_format_label, X_("TCFormat"), _("Timecode Format"), true);
+ _status_bar_visibility.add (&format_label, X_("Format"), _("File Format"), true);
ev->signal_button_press_event().connect (sigc::mem_fun (_status_bar_visibility, &VisibilityGroup::button_press_event));
}
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index dbaf3e7292..03a7ca33ba 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -1101,15 +1101,7 @@ AudioClock::set_timecode (framepos_t when, bool /*force*/)
_left_layout->set_text ("INT");
}
- double timecode_frames = _session->timecode_frames_per_second();
-
- if (fmod(timecode_frames, 1.0) == 0.0) {
- sprintf (buf, "FPS %u %s", int (timecode_frames), (_session->timecode_drop_frames() ? "D" : ""));
- } else {
- sprintf (buf, "%.2f %s", timecode_frames, (_session->timecode_drop_frames() ? "D" : ""));
- }
-
- _right_layout->set_text (buf);
+ _right_layout->set_text ("TBDiscussed");
}
}
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 3500022239..6b59e8718e 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -1051,8 +1051,8 @@ RCOptionEditor::RCOptionEditor ()
Gtkmm2ext::UI::instance()->set_tip
(_sync_framerate->tip_widget(),
_("This option controls the value of the video frame rate <i>while chasing</i> an external timecode source.\n\n"
- "<b>When enabled</b>, the session video frame rate will be changed to match that of the selected external timecode source.\n\n"
- "<b>When disabled</b>, the session video frame rate will not be changed to match that of the selected external timecode source."
+ "<b>When enabled</b> the session video frame rate will be changed to match that of the selected external timecode source.\n\n"
+ "<b>When disabled</b> the session video frame rate will not be changed to match that of the selected external timecode source."
"Instead the frame rate indication in the main clock will flash red and Ardour will convert between the external "
"timecode standard and the session standard"));
@@ -1066,7 +1066,7 @@ RCOptionEditor::RCOptionEditor ()
);
Gtkmm2ext::UI::instance()->set_tip
(_sync_genlock->tip_widget(),
- _("<b>When enabled</b>, indicates that the selected external timecode source shares sync (Black &amp; Burst, Wordclock, etc) with the audio interface"));
+ _("<b>When enabled</b> indicates that the selected external timecode source shares sync (Black &amp; Burst, Wordclock, etc) with the audio interface"));
add_option (_("Transport"), _sync_genlock);
diff --git a/libs/timecode/src/time.cc b/libs/timecode/src/time.cc
index 6dc123624b..cc687d492b 100644
--- a/libs/timecode/src/time.cc
+++ b/libs/timecode/src/time.cc
@@ -526,6 +526,57 @@ timecode_has_drop_frames(TimecodeFormat t)
return false;
}
+std::string
+timecode_format_name (TimecodeFormat const t)
+{
+ switch (t) {
+ case timecode_23976:
+ return "23.98";
+
+ break;
+ case timecode_24:
+ return "24";
+
+ break;
+ case timecode_24976:
+ return "24.98";
+
+ break;
+ case timecode_25:
+ return "25";
+
+ break;
+ case timecode_2997:
+ return "29.97";
+
+ break;
+ case timecode_2997drop:
+ return "29.97 drop";
+
+ break;
+ case timecode_30:
+ return "30";
+
+ break;
+ case timecode_30drop:
+ return "30 drop";
+
+ break;
+ case timecode_5994:
+ return "59.94";
+
+ break;
+ case timecode_60:
+ return "60";
+
+ break;
+ default:
+ break;
+ }
+
+ return "??";
+}
+
} // namespace Timecode
std::ostream&
diff --git a/libs/timecode/timecode/time.h b/libs/timecode/timecode/time.h
index 090d3851fb..7d77da1213 100644
--- a/libs/timecode/timecode/time.h
+++ b/libs/timecode/timecode/time.h
@@ -100,6 +100,8 @@ void hours_floor (Time& timecode);
float timecode_to_frames_per_second(TimecodeFormat const t);
bool timecode_has_drop_frames(TimecodeFormat const t);
+std::string timecode_format_name (TimecodeFormat const t);
+
} // namespace Timecode
std::ostream& operator<< (std::ostream& ostr, const Timecode::Time& t);