#compdef dtas-ctl # To the extent possible under law, James Rowe has waived all copyright and # related or neighboring rights to this example. _arguments \ ':dtas-ctl command:(( cd\:"Change the current working directory of the player." clear\:"Clear current queue." cue\:"Display the index/offsets of the embedded CUE sheet." current\:"Output information about the current track/command in YAML." enq\:"Enqueue the given FILENAME for playback." enq-cmd\:"Run the following command for playback." env\:"Set/unset environment variables." format\:"Configure the format between source and sink." pause\:"Pause playback." play\:"Restart playback from pause." play_pause\:"Toggle the play/pause state." queue\ cat\:"Dump the contents of the queue as YAML." restart\:"Restarts all processes in the current pipeline." rg\:"Configure ReplayGain support." seek\:"Seek the current track to a specified time." skip\:"Abort current track/command." sink\:"Control sinks." source\:"Control sources." state\ dump\:"Immediately dump the state of the player." tl\:"Control tracklist." trim\:"Limits playback of all tracks in the tracklist." watch\:"Adds the client to the passive watch list for notifications." ))' \ '*::subcmd:->subcmd' && return 0 case "$words[1]" in (cd) _arguments \ ':select dir:_path_files -/' ;; (cue) _arguments \ '1:dtas-ctl command:(( next\:"Skip to the next cue sheet offset." prev\:"Skip to the previous cue sheet offset." goto\:"Go to the cue index." seek\:"Seek within the current cue index." ))' ;; (enq|state dump) _arguments \ ':select file:_files' ;; (format) _arguments \ 'channels=[Number of channels to use internally.]' \ 'endian=[Change endianess.]:select endianess:(big little swap)' \ 'bits=[Sample precision.]:select precision:(16 bypass)' \ 'rate=[Sample rate of audio.]:select sample rate:(44100 48000 bypass)' \ 'type=[Change the raw PCM format.]:select raw PCM format:(s16 s24 s32 u16 u24 u32 f32 f64)' ;; (rg) _arguments \ 'fallback_gain=[Adjust the volume by this level for tracks.]:select adjustment:_guard "-?[0-9]#" "dB value"' \ 'fallback_track=[When in album_gain mode, fallback to track_gain.]:select option:(true false)' \ 'mode=[Controls the ReplayGain tag to use.]:(album_gain track_gain track_norm album_norm off)' \ 'preamp=[Adjust the album_gain or track_gain.]:select adjustment:_guard "-?[0-9]#" "dB value"' \ 'norm_level=[Control the level to normalize.]:select level:_guard "-?[0-9]#" "dB value"' ;; (seek) _arguments \ '1:select track:_guard "[0-9]#" "track number"' ;; (sink) _arguments \ ':sink subcommand:(( ls\:"List names of current sinks." cat\:"Dump SINKNAME config in YAML." rm\:"Remove SINKNAME." ed\:"create/edit SINKNAME." ))' ;; (source) _arguments \ ':source subcommand:(( cat\:"Dump the current source command and env in YAML." ed\:"Edit the source parameters." ls\:"Dump the names of sources sorted by tryorder." restart\:"Restart the current source command." ))' ;; (tl) _arguments \ ':tl subcommand:(( add\:"Add files to the tracklist." clear\:"Clear current tracklist." consume\:"Show/or change consume status of the tracklist." current\:"Display the pathname to the currently playing track." current-id\:"Display the TRACKID of the currently playing track." remove\:"Remove the track with the given TRACKID from the track list." get\:"Returns a list of TRACKIDS mapped to shell-escaped filenames." goto\:"Plays the given TRACKID." max\:"Sets or gets the maximum number of tracks allowed in the tracklist." next\:"Jump to the next track in the tracklist." prev\:"Jump to the previous track in the tracklist." repeat\:"Show/or change repeat status of the tracklist." shuffle\:"Show/or change the current shuffle status of the tracklist." swap\:"Swaps the positions of two tracks." tracks\:"Returns a list of all TRACKIDS in the tracklist." ))' ;; (trim) _arguments \ '1:select beginning' \ '2:select end' ;; (*) ;; esac