update upstream-2021-08-15

This commit is contained in:
Chengyi Zhao 2021-08-15 02:35:23 +08:00
parent c8653c13fa
commit 1703683def
297 changed files with 91782 additions and 54869 deletions

View file

@ -34,6 +34,7 @@ _devices() {
case $words[$((CURRENT - 2))] in
move-sink-input) cmd=('sinks');;
move-source-output) cmd=('sources');;
play-sample) cmd=('sinks');;
esac
elif [[ $service == (pacat|paplay|parec|parecord) ]]; then
@ -147,7 +148,7 @@ _ports() {
if [[ $line != [[:blank:]] &&
$line != (*Part?of*|*Properties:*|*device.icon_name*) ]]; then
_port_name=${line%%: *}
_port_name=${_port_name//[[:blank:]]/}
_port_name=${_port_name##[[:blank:]]#}
_port_description=${line#*: }
_port_list+=($_port_name:$_port_description)
fi
@ -158,6 +159,13 @@ _ports() {
_describe 'port list' _port_list
}
_sample_names() {
local -a _sample_names
sample_names=(${${${(f)"$(_call_program samples_tag "pactl $remote list samples short 2> /dev/null")"}##[[:digit:]]#[[:blank:]]#}%%[[:blank:]]*})
_wanted pactl-samples expl 'sample list' compadd $sample_names
}
_cards(){
local -a _card_list
local _card _cad_name
@ -263,6 +271,7 @@ _pactl_completion() {
'set-sink-input-mute: mute a stream'
'set-source-output-mute: mute a recording stream'
'set-sink-formats: set supported formats of a sink'
'send-message: send a message to a pulseaudio object'
'subscribe: subscribe to events'
)
@ -284,6 +293,7 @@ _pactl_completion() {
'clients: list connected clients'
'samples: list samples'
'cards: list available cards'
'message-handlers: list available message-handlers'
)
if ((CURRENT == 2)); then
@ -304,10 +314,10 @@ _pactl_completion() {
_play_sample_parameter() {
if ((CURRENT == 2)); then
# We're completing the first parameter after "play-sample".
# TODO: Implement sample name completion.
_sample_names
elif ((CURRENT == 3)); then
# We're completing the second parameter after "play-sample".
# TODO: Implement sink name completion.
_devices
fi
}
@ -470,7 +480,7 @@ _pactl_completion() {
list) _list_parameter;;
upload-sample) if ((CURRENT == 2)); then _files; fi;;
play-sample) _play_sample_parameter;;
remove-sample) ;; # TODO: Implement sample name completion.
remove-sample) if ((CURRENT == 2)); then _sample_names; fi;;
load-module) _load_module_parameter;;
unload-module) if ((CURRENT == 2)); then _loaded_modules; fi;;
move-sink-input) _move_sink_input_parameter;;
@ -561,6 +571,7 @@ _pacmd_completion() {
'dump: show daemon configuration'
'dump-volumes: show the state of all volumes'
'shared: show shared properties'
'send-message: send a message to a pulseaudio object'
'exit: ask the PulseAudio daemon to exit'
)
_describe 'pacmd commands' _pacmd_commands
@ -668,7 +679,7 @@ _pacat_completion() {
'--process-time-msec=[request the specified process time in msec]:msec' \
'--property=[set the specified property]:property' \
'--raw[record/play raw PCM data]' \
'--passthrough[passtrough data]' \
'--passthrough[passthrough data]' \
'--file-format=[record/play formatted PCM data]:format:_pacat_file_formats' \
'--list-file-formats[list available formats]' \
'::files:_files' \