Simplify command names

This commit is contained in:
Tomas Sardyha
2020-04-29 18:20:12 +02:00
parent f3930ce864
commit 676dcd672b
2 changed files with 39 additions and 39 deletions

View File

@@ -210,33 +210,33 @@ Expands the bottom timeline until pressed again, or next mouse move. Useful to c
Toggles the always visible portion of the timeline. You can look at it as switching `timeline_size_min` option between it's configured value and 0. Toggles the always visible portion of the timeline. You can look at it as switching `timeline_size_min` option between it's configured value and 0.
#### `context-menu` #### `menu`
Toggles context menu. Context menu is empty by default and won't show up when this is pressed. Read [Context menu](#context-menu-1) section below to find out how to fill it up with items you want there. Toggles menu. Menu is empty by default and won't show up when this is pressed. Read [Menu](#menu-1) section below to find out how to fill it up with items you want there.
#### `load-subtitles` #### `load-subtitles`
Displays a file explorer with directory navigation to load external subtitles. Explorer only displays file types defined in `subtitle_types` option. Displays a file explorer with directory navigation to load external subtitles. Explorer only displays file types defined in `subtitle_types` option.
#### `select-subtitles` #### `subtitles`
Menu to select a subtitle track. Menu to select a subtitle track.
#### `select-audio` #### `audio`
Menu to select an audio track. Menu to select an audio track.
#### `select-video` #### `video`
Menu to select a video track. Menu to select a video track.
#### `navigate-playlist` #### `playlist`
Menu to select an item from playlist. Playlist navigation.
#### `navigate-chapters` #### `chapters`
Menu to seek to start of a specific chapter. Chapter navigation.
#### `open-file` #### `open-file`
@@ -276,15 +276,15 @@ Show current file in your operating systems' file explorer.
Open directory with `mpv.conf` in file explorer. Open directory with `mpv.conf` in file explorer.
## Context menu ## Menu
**uosc** provides a way to build, display, and use your own context menu. Limitation is that the UI rendering API provided by mpv can only render stuff within window borders, so the menu can't float above it but needs to fit inside. This might be annoying for tiny videos but otherwise it accomplishes the same thing. **uosc** provides a way to build, display, and use your own menu. Limitation is that the UI rendering API provided by mpv can only render stuff within window borders, so the menu can't float above it but needs to fit inside. This might be annoying for tiny videos but otherwise it accomplishes the same thing.
To display the menu, add **uosc**'s `context-menu` command to a key of your choice. Example to bind it to **right click** and **menu** buttons: To display the menu, add **uosc**'s `menu` command to a key of your choice. Example to bind it to **right click** and **menu** buttons:
``` ```
mbtn_right script-binding uosc/context-menu mbtn_right script-binding uosc/menu
menu script-binding uosc/context-menu menu script-binding uosc/menu
``` ```
***menu** button is the key between **win** and **right_ctrl** buttons that none uses (might not be on your keyboard).* ***menu** button is the key between **win** and **right_ctrl** buttons that none uses (might not be on your keyboard).*
@@ -333,15 +333,15 @@ q quit #!
Suggested minimal context menu setup to start with: Suggested minimal context menu setup to start with:
``` ```
menu script-binding uosc/context-menu menu script-binding uosc/menu
mbtn_right script-binding uosc/context-menu mbtn_right script-binding uosc/menu
o script-binding uosc/open-file #! Open file o script-binding uosc/open-file #! Open file
alt+s script-binding uosc/load-subtitles #! Load subtitles alt+s script-binding uosc/load-subtitles #! Load subtitles
S script-binding uosc/select-subtitles #! Select subtitles S script-binding uosc/subtitles #! Select subtitles
A script-binding uosc/select-audio #! Select audio A script-binding uosc/audio #! Select audio
ctrl+s async screenshot #! Utils > Screenshot ctrl+s async screenshot #! Utils > Screenshot
P script-binding uosc/navigate-playlist #! Utils > Navigate playlist P script-binding uosc/playlist #! Utils > Playlist
C script-binding uosc/navigate-chapters #! Utils > Navigate chapters C script-binding uosc/chapters #! Utils > Chapters
# script-binding uosc/open-config-directory #! Utils > Open config directory # script-binding uosc/open-config-directory #! Utils > Open config directory
# set video-aspect-override "-1" #! Aspect ratio > Default # set video-aspect-override "-1" #! Aspect ratio > Default
# set video-aspect-override "16:9" #! Aspect ratio > 16:9 # set video-aspect-override "16:9" #! Aspect ratio > 16:9

View File

@@ -148,13 +148,13 @@ Available keybindings (place into `input.conf`):
``` ```
Key script-binding uosc/peek-timeline Key script-binding uosc/peek-timeline
Key script-binding uosc/toggle-progress Key script-binding uosc/toggle-progress
Key script-binding uosc/context-menu Key script-binding uosc/menu
Key script-binding uosc/load-subtitles Key script-binding uosc/load-subtitles
Key script-binding uosc/select-subtitles Key script-binding uosc/subtitles
Key script-binding uosc/select-audio Key script-binding uosc/audio
Key script-binding uosc/select-video Key script-binding uosc/video
Key script-binding uosc/navigate-playlist Key script-binding uosc/playlist
Key script-binding uosc/navigate-chapters Key script-binding uosc/chapters
Key script-binding uosc/open-file Key script-binding uosc/open-file
Key script-binding uosc/next-file Key script-binding uosc/next-file
Key script-binding uosc/prev-file Key script-binding uosc/prev-file
@@ -789,7 +789,7 @@ function Menu:open(items, open_item, opts)
elements:add('menu', Element.new({ elements:add('menu', Element.new({
captures = {mouse_buttons = true}, captures = {mouse_buttons = true},
type = nil, -- menu type such as `context-menu`, `navigate-chapters`, ... type = nil, -- menu type such as `menu`, `chapters`, ...
title = nil, title = nil,
width = nil, width = nil,
height = nil, height = nil,
@@ -2967,13 +2967,13 @@ mp.add_key_binding(nil, 'toggle-progress', function()
timeline:tween_property('size_min_override', timeline.size_min, 0) timeline:tween_property('size_min_override', timeline.size_min, 0)
end end
end) end)
mp.add_key_binding(nil, 'context-menu', function() mp.add_key_binding(nil, 'menu', function()
if menu:is_open('context-menu') then if menu:is_open('menu') then
menu:close() menu:close()
elseif state.context_menu_items then elseif state.context_menu_items then
menu:open(state.context_menu_items, function(command) menu:open(state.context_menu_items, function(command)
mp.command(command) mp.command(command)
end, {type = 'context-menu'}) end, {type = 'menu'})
end end
end) end)
mp.add_key_binding(nil, 'load-subtitles', function() mp.add_key_binding(nil, 'load-subtitles', function()
@@ -2989,10 +2989,10 @@ mp.add_key_binding(nil, 'load-subtitles', function()
) )
end end
end) end)
mp.add_key_binding(nil, 'select-subtitles', create_select_tracklist_type_menu_opener('Subtitles', 'sub', 'sid')) mp.add_key_binding(nil, 'subtitles', create_select_tracklist_type_menu_opener('Subtitles', 'sub', 'sid'))
mp.add_key_binding(nil, 'select-audio', create_select_tracklist_type_menu_opener('Audio', 'audio', 'aid')) mp.add_key_binding(nil, 'audio', create_select_tracklist_type_menu_opener('Audio', 'audio', 'aid'))
mp.add_key_binding(nil, 'select-video', create_select_tracklist_type_menu_opener('Video', 'video', 'vid')) mp.add_key_binding(nil, 'video', create_select_tracklist_type_menu_opener('Video', 'video', 'vid'))
mp.add_key_binding(nil, 'navigate-playlist', function() mp.add_key_binding(nil, 'playlist', function()
function serialize_playlist() function serialize_playlist()
local pos = mp.get_property_number('playlist-pos-1', 0) local pos = mp.get_property_number('playlist-pos-1', 0)
local items = {} local items = {}
@@ -3012,7 +3012,7 @@ mp.add_key_binding(nil, 'navigate-playlist', function()
-- Update active index and playlist content on playlist changes -- Update active index and playlist content on playlist changes
function handle_playlist_change() function handle_playlist_change()
if menu:is_open('navigate-playlist') then if menu:is_open('playlist') then
local items, active_item = serialize_playlist() local items, active_item = serialize_playlist()
elements.menu:set_items(items, { elements.menu:set_items(items, {
active_item = active_item, active_item = active_item,
@@ -3026,7 +3026,7 @@ mp.add_key_binding(nil, 'navigate-playlist', function()
menu:open(items, function(index) menu:open(items, function(index)
mp.commandv('set', 'playlist-pos-1', tostring(index)) mp.commandv('set', 'playlist-pos-1', tostring(index))
end, { end, {
type = 'navigate-playlist', type = 'playlist',
title = 'Playlist', title = 'Playlist',
active_item = active_item, active_item = active_item,
on_open = function() on_open = function()
@@ -3038,7 +3038,7 @@ mp.add_key_binding(nil, 'navigate-playlist', function()
end, end,
}) })
end) end)
mp.add_key_binding(nil, 'navigate-chapters', function() mp.add_key_binding(nil, 'chapters', function()
local items = {} local items = {}
local chapters = get_normalized_chapters() local chapters = get_normalized_chapters()
@@ -3062,7 +3062,7 @@ mp.add_key_binding(nil, 'navigate-chapters', function()
-- Update selected chapter in chapter navigation menu -- Update selected chapter in chapter navigation menu
function seek_handler() function seek_handler()
if menu:is_open('navigate-chapters') then if menu:is_open('chapters') then
elements.menu:activate_index(get_selected_chapter_index()) elements.menu:activate_index(get_selected_chapter_index())
end end
end end
@@ -3070,7 +3070,7 @@ mp.add_key_binding(nil, 'navigate-chapters', function()
menu:open(items, function(time) menu:open(items, function(time)
mp.commandv('seek', tostring(time), 'absolute') mp.commandv('seek', tostring(time), 'absolute')
end, { end, {
type = 'navigate-chapters', type = 'chapters',
title = 'Chapters', title = 'Chapters',
active_item = get_selected_chapter_index(), active_item = get_selected_chapter_index(),
on_open = function() mp.register_event('seek', seek_handler) end, on_open = function() mp.register_event('seek', seek_handler) end,