Skip to content

Commit

Permalink
Added --keys / -k to list key bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
skgsergio committed Apr 25, 2013
1 parent 8e8e6c8 commit 0664396
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -87,8 +87,8 @@ Key Bindings
While playing you can use the following keys to control omxplayer:

z Show Info
1 Increase Speed
2 Decrease Speed
1 Decrease Speed
2 Increase Speed
j Previous Audio stream
k Next Audio stream
i Previous Chapter
Expand All @@ -102,7 +102,7 @@ While playing you can use the following keys to control omxplayer:
Space or p Pause/Resume
- Decrease Volume
+ Increase Volume
Left Arrow Seek -30
Right Arrow Seek +30
Down Arrow Seek -600
Up Arrow Seek +600
Left Arrow Seek -30 s
Right Arrow Seek +30 s
Down Arrow Seek -600 s
Up Arrow Seek +600 s
35 changes: 33 additions & 2 deletions omxplayer.cpp
Expand Up @@ -138,6 +138,7 @@ void print_usage()
printf("Usage: omxplayer [OPTIONS] [FILE]\n");
printf("Options :\n");
printf(" -h / --help print this help\n");
printf(" -k / --keys print key bindings\n");
// printf(" -a / --alang language audio language : e.g. ger\n");
printf(" -n / --aidx index audio stream index : e.g. 1\n");
printf(" -o / --adev device audio out device : e.g. hdmi/local\n");
Expand All @@ -163,13 +164,38 @@ void print_usage()
printf(" --align left/center subtitle alignment (default: left)\n");
printf(" --lines n number of lines to accommodate in the subtitle buffer\n");
printf(" (default: 3)\n");
printf(" --win \"x1 y1 x2 y2\" Set position of video window\n");
printf(" --win \"x1 y1 x2 y2\" Set position of video window\n");
printf(" --audio_fifo n Size of audio output fifo in seconds\n");
printf(" --video_fifo n Size of video output fifo in MB\n");
printf(" --audio_queue n Size of audio input queue in MB\n");
printf(" --video_queue n Size of video input queue in MB\n");
}

void print_keybindings()
{
printf("Key bindings :\n");
printf(" 1 decrease speed\n");
printf(" 2 increase speed\n");
printf(" z show info\n");
printf(" j previous audio stream\n");
printf(" k next audio stream\n");
printf(" i previous chapter\n");
printf(" o next chapter\n");
printf(" n previous subtitle stream\n");
printf(" m next subtitle stream\n");
printf(" s toggle subtitles\n");
printf(" d decrease subtitle delay (- 250 ms)\n");
printf(" f increase subtitle delay (+ 250 ms)\n");
printf(" q exit omxplayer\n");
printf(" p / space pause/resume\n");
printf(" - decrease volume\n");
printf(" + / = increase volume\n");
printf(" left arrow seek -30 seconds\n");
printf(" right arrow seek +30 seconds\n");
printf(" down arrow seek -600 seconds\n");
printf(" up arrow seek +600 seconds\n");
}

void PrintSubtitleInfo()
{
auto count = m_omx_reader.SubtitleStreamCount();
Expand Down Expand Up @@ -475,6 +501,7 @@ int main(int argc, char *argv[])
struct option longopts[] = {
{ "info", no_argument, NULL, 'i' },
{ "help", no_argument, NULL, 'h' },
{ "keys", no_argument, NULL, 'k' },
{ "aidx", required_argument, NULL, 'n' },
{ "adev", required_argument, NULL, 'o' },
{ "stats", no_argument, NULL, 's' },
Expand Down Expand Up @@ -505,7 +532,7 @@ int main(int argc, char *argv[])

int c;
std::string mode;
while ((c = getopt_long(argc, argv, "wihn:l:o:cslpd3:yzt:rg", longopts, NULL)) != -1)
while ((c = getopt_long(argc, argv, "wihkn:l:o:cslpd3:yzt:rg", longopts, NULL)) != -1)
{
switch (c)
{
Expand Down Expand Up @@ -620,6 +647,10 @@ int main(int argc, char *argv[])
print_usage();
return 0;
break;
case 'k':
print_keybindings();
return 0;
break;
case ':':
return 0;
break;
Expand Down

0 comments on commit 0664396

Please sign in to comment.