move TC FPS up into status bar, use lower right of timecode audioclock mode for something ... TBDiscussed

git-svn-id: svn://localhost/ardour2/branches/3.0@13257 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-10-12 16:25:57 +00:00
parent bce3184ff5
commit 5a8e83e0de
7 changed files with 90 additions and 18 deletions

View File

@ -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 ()
{

View File

@ -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 ();

View File

@ -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));
}

View File

@ -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");
}
}

View File

@ -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);

View File

@ -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&

View File

@ -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);