Allow master volume to be always muted.

This commit is contained in:
Simo Kinnunen
2017-09-22 17:07:45 +09:00
parent cc5d7580c2
commit 2351025f6f
5 changed files with 66 additions and 14 deletions

View File

@@ -85,8 +85,20 @@ module.exports.builder = function(yargs) {
, default: 7400
})
.option('mute-master', {
describe: 'Whether to mute master volume when devices are being used.'
, type: 'boolean'
describe: 'Whether to mute master volume.'
, choices: ['always', 'inuse', 'never']
, default: 'never'
, coerce: val => {
if (val === true) {
return 'inuse' // For backwards compatibility.
}
if (val === false) {
return 'never' // For backwards compatibility.
}
return val
}
})
.option('name', {
alias: 'n'
@@ -177,6 +189,7 @@ module.exports.handler = function(argv) {
, '--heartbeat-interval', argv.heartbeatInterval
, '--boot-complete-timeout', argv.bootCompleteTimeout
, '--vnc-initial-size', argv.vncInitialSize.join('x')
, '--mute-master', argv.muteMaster
]
.concat(argv.connectSub.reduce(function(all, val) {
return all.concat(['--connect-sub', val])
@@ -184,7 +197,6 @@ module.exports.handler = function(argv) {
.concat(argv.connectPush.reduce(function(all, val) {
return all.concat(['--connect-push', val])
}, []))
.concat(argv.muteMaster ? ['--mute-master'] : [])
.concat(argv.lockRotation ? ['--lock-rotation'] : [])
.concat(!argv.cleanup ? ['--no-cleanup'] : [])