treatment: create and check audiofilepath variable

This commit is contained in:
Trek H 2021-02-11 09:53:35 +10:30
parent 51c489946a
commit 8b4e28a944
1 changed files with 9 additions and 1 deletions

View File

@ -83,6 +83,7 @@ const (
// Variable map to send to netreceiver/vidgrind. // Variable map to send to netreceiver/vidgrind.
var varMap = map[string]string{ var varMap = map[string]string{
"mode": "enum:Paused,Play,Check", "mode": "enum:Paused,Play,Check",
"audioFilePath": "string",
} }
func main() { func main() {
@ -183,6 +184,13 @@ func run(rv *revid.Revid, ns *netsender.Sender, file *string, l *logger.Logger,
} }
l.Log(logger.Info, "revid successfully reconfigured") l.Log(logger.Info, "revid successfully reconfigured")
l.Log(logger.Debug, "checking audio file path")
f := vars["audioFilePath"]
if f != "" && *file != f {
file = &f
l.Log(logger.Info, "updated audio file path", "audioFilePath", f)
}
l.Log(logger.Debug, "checking mode") l.Log(logger.Debug, "checking mode")
switch ns.Mode() { switch ns.Mode() {
case modePaused: case modePaused: