summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authordanny song <danny.song.ga@gmail.com>2015-05-23 01:50:11 +0900
committerTim-Philipp Müller <tim@centricular.com>2015-05-24 16:12:04 +0100
commitbd35bf593382a1cf88149e306e751d9975adfb5d (patch)
tree806a9216d7c0d1e07c9f8114d405d5a164487ce7 /tools
parent8fc0e4f55c5ef2840e3d6b30c310436ba0f0dc45 (diff)
tools: gst-play: add keyboard shortcut help
https://bugzilla.gnome.org/show_bug.cgi?id=749740
Diffstat (limited to 'tools')
-rw-r--r--tools/gst-play.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/gst-play.c b/tools/gst-play.c
index f03827662..7c4a2ffc2 100644
--- a/tools/gst-play.c
+++ b/tools/gst-play.c
@@ -832,11 +832,33 @@ play_switch_trick_mode (GstPlay * play)
}
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 void
keyboard_cb (const gchar * key_input, gpointer user_data)
{
GstPlay *play = (GstPlay *) user_data;
switch (g_ascii_tolower (key_input[0])) {
+ case 'k':
+ print_keyboard_help ();
+ break;
case ' ':
toggle_paused (play);
break;
@@ -1046,6 +1068,7 @@ main (int argc, char **argv)
if (interactive) {
if (gst_play_kb_set_key_handler (keyboard_cb, play)) {
+ 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");