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

@ -1,13 +1,20 @@
if bashcompletiondir != 'no'
aliases = [
aliases = []
if get_option('daemon')
aliases += [
'pacmd',
'pasuspender',
]
endif
aliases += [
'pacat',
'pacmd',
'pactl',
'padsp',
'paplay',
'parec',
'parecord',
'pasuspender',
]
install_data('pulseaudio', install_dir : bashcompletiondir)

View file

@ -113,7 +113,7 @@ _pactl() {
local comps
local flags='-h --help --version -s --server= --client-name='
local list_types='short sinks sources sink-inputs source-outputs cards
modules samples clients'
modules samples clients message-handlers'
local commands=(stat info list exit upload-sample play-sample remove-sample
load-module unload-module move-sink-input move-source-output
suspend-sink suspend-source set-card-profile set-default-sink
@ -121,7 +121,7 @@ _pactl() {
set-source-volume set-sink-input-volume set-source-output-volume
set-sink-mute set-source-mute set-sink-input-mute
set-source-output-mute set-sink-formats set-port-latency-offset
subscribe help)
subscribe send-message help)
_init_completion -n = || return
preprev=${words[$cword-2]}
@ -271,7 +271,7 @@ _pacmd() {
move-sink-input move-source-output suspend-sink suspend-source
suspend set-card-profile set-sink-port set-source-port
set-port-latency-offset set-log-target set-log-level set-log-meta
set-log-time set-log-backtrace)
set-log-time set-log-backtrace send-message)
_init_completion -n = || return
preprev=${words[$cword-2]}

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' \