mirror of https://bitbucket.org/ausocean/av.git
cmd/treatment: remove build tags for treatment
This was done because I don't know why this wouldn't build on circleci with the standard pi audio command in pi.go. cmd/treatment: merge pi.go into main.go There's no need for two files Approved-by: Alan Noble
This commit is contained in:
parent
2dd2c464c6
commit
9f56bee095
|
@ -1,34 +0,0 @@
|
|||
// +build !pi3
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
circleci.go defines a dummy initialisation command for running on circleci.
|
||||
|
||||
AUTHORS
|
||||
Ella Pietraroia <ella@ausocean.org>
|
||||
Scott Barnard <scott@ausocean.org>
|
||||
|
||||
LICENSE
|
||||
Copyright (C) 2020 the Australian Ocean Lab (AusOcean)
|
||||
|
||||
It is free software: you can redistribute it and/or modify them
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
It is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
in gpl.txt. If not, see http://www.gnu.org/licenses.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import "bitbucket.org/ausocean/utils/logging"
|
||||
|
||||
const audioCmd = ""
|
||||
|
||||
func initCommand(log logging.Logger) {}
|
|
@ -81,17 +81,21 @@ const (
|
|||
// Channel modes.
|
||||
const (
|
||||
modeStereo = "Stereo"
|
||||
modeLeft = "LeftMono"
|
||||
modeRight = "RightMono"
|
||||
modeMute = "Mute"
|
||||
modeLeft = "LeftMono"
|
||||
modeRight = "RightMono"
|
||||
modeMute = "Mute"
|
||||
)
|
||||
|
||||
// Variable map to send to netreceiver/vidgrind.
|
||||
var varMap = map[string]string{
|
||||
"SpeakerMode": "enum:"+strings.Join([]string{modeStereo, modeLeft, modeRight, modeMute}, ","),
|
||||
"AudioFilePath": "string",
|
||||
"SpeakerMode": "enum:" + strings.Join([]string{modeStereo, modeLeft, modeRight, modeMute}, ","),
|
||||
"AudioFilePath": "string",
|
||||
}
|
||||
|
||||
const audioCmd = "aplay"
|
||||
|
||||
func initCommand(l logging.Logger) { checkPath(audioCmd, l) }
|
||||
|
||||
func main() {
|
||||
mts.Meta = meta.NewWith([][2]string{{metaPreambleKey, metaPreambleData}})
|
||||
|
||||
|
@ -220,9 +224,9 @@ func setChannels(mode string, l logging.Logger) error {
|
|||
// Set the volume of each channel.
|
||||
vols := map[string]string{
|
||||
modeStereo: "100%,100%",
|
||||
modeLeft: "0%,100%",
|
||||
modeRight: "100%,0%",
|
||||
modeMute: "0%,0%",
|
||||
modeLeft: "0%,100%",
|
||||
modeRight: "100%,0%",
|
||||
modeMute: "0%,0%",
|
||||
}[mode]
|
||||
if vols == "" {
|
||||
l.Warning("invalid SpeakeMode", "SpeakerMode", mode)
|
||||
|
@ -274,7 +278,6 @@ func setChannels(mode string, l logging.Logger) error {
|
|||
return fmt.Errorf("channel set command failed: %s", &errBuff)
|
||||
}
|
||||
|
||||
|
||||
l.Info("mode set to", "mode", mode)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
// +build pi3
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
pi3.go defines an initialisation function for use when running on the
|
||||
Raspberry Pi 3.
|
||||
|
||||
AUTHORS
|
||||
Ella Pietraroia <ella@ausocean.org>
|
||||
Scott Barnard <scott@ausocean.org>
|
||||
Saxon Nelson-Milton <saxon@ausocean.org>
|
||||
|
||||
LICENSE
|
||||
Copyright (C) 2020 the Australian Ocean Lab (AusOcean)
|
||||
|
||||
It is free software: you can redistribute it and/or modify them
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
It is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
in gpl.txt. If not, see http://www.gnu.org/licenses.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"bitbucket.org/ausocean/utils/logging"
|
||||
)
|
||||
|
||||
const audioCmd = "aplay"
|
||||
|
||||
func initCommand(l logging.Logger) { checkPath(audioCmd, l) }
|
Loading…
Reference in New Issue