2 Commits

Author SHA1 Message Date
c20aa82e3b remove redundant util function 2026-02-05 04:15:21 +00:00
1c5a75ffe1 add bus eq band 3 gain example 2026-02-05 04:06:08 +00:00
3 changed files with 9 additions and 17 deletions

View File

@@ -120,6 +120,11 @@ xair-cli strip 1 eq on true
xair-cli bus 1 name 'vocal mix'
```
*set bus 03 eq band 03 (LoMid) gain*
```console
xair-cli bus 3 eq 3 gain -- -3.5
```
*Send a raw OSC message to the mixer*
```console
xair-cli raw /xinfo

View File

@@ -134,8 +134,8 @@ func (cmd *StripFadeoutCmd) Run(ctx *context, strip *StripCmdGroup) error {
}
type StripSendCmd struct {
BusNum int `arg:"" help:"The bus number to get or set the send level for."`
Level *string `arg:"" help:"The send level to set (in dB)." optional:""`
BusNum int `arg:"" help:"The bus number to get or set the send level for."`
Level *float64 `arg:"" help:"The send level to set (in dB)." optional:""`
}
func (cmd *StripSendCmd) Run(ctx *context, strip *StripCmdGroup) error {
@@ -148,11 +148,10 @@ func (cmd *StripSendCmd) Run(ctx *context, strip *StripCmdGroup) error {
return nil
}
level := mustConvToFloat64(*cmd.Level)
if err := ctx.Client.Strip.SetSendLevel(strip.Index.Index, cmd.BusNum, level); err != nil {
if err := ctx.Client.Strip.SetSendLevel(strip.Index.Index, cmd.BusNum, *cmd.Level); err != nil {
return fmt.Errorf("failed to set send level: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d send level for bus %d set to: %.2f dB\n", strip.Index.Index, cmd.BusNum, level)
fmt.Fprintf(ctx.Out, "Strip %d send level for bus %d set to: %.2f dB\n", strip.Index.Index, cmd.BusNum, *cmd.Level)
return nil
}

12
util.go
View File

@@ -1,12 +0,0 @@
package main
import "strconv"
// mustConvToFloat64 converts a string to float64, panicking on error.
func mustConvToFloat64(floatStr string) float64 {
level, err := strconv.ParseFloat(floatStr, 64)
if err != nil {
panic(err)
}
return level
}