gst_stream_volume_set_volume (GST_STREAM_VOLUME (play->playbin),
GST_STREAM_VOLUME_FORMAT_CUBIC, volume);
- g_print ("Volume: %.0f%% \n", volume * 100);
+ g_print (_("Volume: %.0f%%"), volume * 100);
+ g_print (" \n");
}
/* returns TRUE if something was installed and we should restart playback */
g_print ("\n");
/* and switch to next item in list */
if (!play_next (play)) {
- g_print ("Reached end of play list.\n");
+ g_print ("%s\n", _("Reached end of play list."));
g_main_loop_quit (play->loop);
}
break;
}
/* try next item in list then */
if (!play_next (play)) {
- g_print ("Reached end of play list.\n");
+ g_print ("%s\n", _("Reached end of play list."));
g_main_loop_quit (play->loop);
}
break;
play_reset (play);
loc = play_uri_get_display_name (play, next_uri);
- g_print ("Now playing %s\n", loc);
+ g_print (_("Now playing %s"), loc);
+ g_print ("\n");
g_free (loc);
g_object_set (play->playbin, "uri", next_uri, NULL);
next_uri = play->uris[next_idx];
loc = play_uri_get_display_name (play, next_uri);
- g_print ("About to finish, preparing next title: %s\n", loc);
+ g_print (_("About to finish, preparing next title: %s"), loc);
+ g_print ("\n");
g_free (loc);
g_object_set (play->playbin, "uri", next_uri, NULL);
pos = pos + dur * percent;
if (pos > dur) {
if (!play_next (play)) {
- g_print ("\nReached end of play list.\n");
+ g_print ("\n%s\n", _("Reached end of play list."));
g_main_loop_quit (play->loop);
}
} else {
play_set_playback_rate (GstPlay * play, gdouble rate)
{
if (play_set_rate_and_trick_mode (play, rate, play->trick_mode)) {
- g_print ("Rate: %.2f \n", rate);
+ g_print (_("Playback rate: %.2f"), rate);
+ g_print (" \n");
} else {
- g_print ("\nCould not change playback rate to %.2f.\n", rate);
+ g_print ("\n");
+ g_print (_("Could not change playback rate to %.2f"), rate);
+ g_print (".\n");
}
}
static void
print_keyboard_help (void)
{
- g_print ("\n\nInteractive mode - keyboard control:\n");
- g_print ("space : pause/unpause\n");
- g_print ("q or ESC : quit\n");
- g_print ("> : play next\n");
- g_print ("< : play previous\n");
- g_print ("left : seek forward\n");
- g_print ("right : seek backward\n");
- g_print ("up : volume up\n");
- g_print ("down : volume down\n");
- g_print ("+ : increase playback rate\n");
- g_print ("- : decrease playback rate\n");
- g_print ("d : change playback direction\n");
- g_print ("t : enable/disable trick modes\n");
- g_print ("k : show keyboard shortcuts\n\n");
+ static struct
+ {
+ const gchar *key_desc;
+ const gchar *key_help;
+ } key_controls[] = {
+ {
+ N_("space"), N_("pause/unpause")}, {
+ N_("q or ESC"), N_("quit")}, {
+ ">", N_("play next")}, {
+ "<", N_("play previous")}, {
+ "\342\206\222", N_("seek forward")}, {
+ "\342\206\220", N_("seek backward")}, {
+ "\342\206\221", N_("volume up")}, {
+ "\342\206\223", N_("volume down")}, {
+ "+", N_("increase playback rate")}, {
+ "-", N_("decrease playback rate")}, {
+ "d", N_("change playback direction")}, {
+ "t", N_("enable/disable trick modes")}, {
+ "k", N_("show keyboard shortcuts")},};
+ guint i, chars_to_pad, desc_len, max_desc_len = 0;
+
+ g_print ("\n\n%s\n\n", _("Interactive mode - keyboard controls:"));
+
+ for (i = 0; i < G_N_ELEMENTS (key_controls); ++i) {
+ desc_len = g_utf8_strlen (key_controls[i].key_desc, -1);
+ max_desc_len = MAX (max_desc_len, desc_len);
+ }
+ ++max_desc_len;
+
+ for (i = 0; i < G_N_ELEMENTS (key_controls); ++i) {
+ chars_to_pad = max_desc_len - g_utf8_strlen (key_controls[i].key_desc, -1);
+ g_print ("\t%s", key_controls[i].key_desc);
+ g_print ("%-*s: ", chars_to_pad, "");
+ g_print ("%s\n", key_controls[i].key_help);
+ }
+ g_print ("\n");
}
static void
break;
case '>':
if (!play_next (play)) {
- g_print ("\nReached end of play list.\n");
+ g_print ("\n%s\n", _("Reached end of play list."));
g_main_loop_quit (play->loop);
}
break;
if (interactive) {
if (gst_play_kb_set_key_handler (keyboard_cb, play)) {
- g_print ("Press 'k' to see a list of keyboard shortcuts.\n");
+ g_print (_("Press 'k' to see a list of keyboard shortcuts.\n"));
atexit (restore_terminal);
} else {
g_print ("Interactive keyboard handling in terminal not available.\n");