litn fixes

This commit is contained in:
2026-02-15 12:00:00 +00:00
parent 19fda4daec
commit ac8f635263
30 changed files with 840 additions and 253 deletions

View File

@@ -101,7 +101,12 @@ func (cmd *BusFadeinCmd) Run(ctx *context, bus *BusCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Bus %d fade-in complete. Final level: %.2f dB\n", bus.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Bus %d fade-in complete. Final level: %.2f dB\n",
bus.Index.Index,
cmd.Target,
)
return nil
}
@@ -140,7 +145,12 @@ func (cmd *BusFadeoutCmd) Run(ctx *context, bus *BusCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Bus %d fade-out complete. Final level: %.2f dB\n", bus.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Bus %d fade-out complete. Final level: %.2f dB\n",
bus.Index.Index,
cmd.Target,
)
return nil
}
@@ -250,14 +260,26 @@ func (cmd *BusEqBandGainCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d gain: %.2f dB\n", bus.Index.Index, *busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d gain: %.2f dB\n",
bus.Index.Index,
*busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetGain(bus.Index.Index, *busEq.Band.Band, *cmd.Gain); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d gain set to: %.2f dB\n", bus.Index.Index, *busEq.Band.Band, *cmd.Gain)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d gain set to: %.2f dB\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Gain,
)
return nil
}
@@ -273,14 +295,30 @@ func (cmd *BusEqBandFreqCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d frequency: %.2f Hz\n", bus.Index.Index, *busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d frequency: %.2f Hz\n",
bus.Index.Index,
*busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetFrequency(bus.Index.Index, *busEq.Band.Band, *cmd.Freq); err != nil {
if err := ctx.Client.Bus.Eq.SetFrequency(
bus.Index.Index,
*busEq.Band.Band,
*cmd.Freq,
); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d frequency set to: %.2f Hz\n", bus.Index.Index, *busEq.Band.Band, *cmd.Freq)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d frequency set to: %.2f Hz\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Freq,
)
return nil
}
@@ -296,14 +334,26 @@ func (cmd *BusEqBandQCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmdGro
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d Q factor: %.2f\n", bus.Index.Index, *busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d Q factor: %.2f\n",
bus.Index.Index,
*busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetQ(bus.Index.Index, *busEq.Band.Band, *cmd.Q); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d Q factor set to: %.2f\n", bus.Index.Index, *busEq.Band.Band, *cmd.Q)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d Q factor set to: %.2f\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Q,
)
return nil
}
@@ -319,14 +369,26 @@ func (cmd *BusEqBandTypeCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d type: %s\n", bus.Index.Index, *busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d type: %s\n",
bus.Index.Index,
*busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetType(bus.Index.Index, *busEq.Band.Band, *cmd.Type); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d type set to: %s\n", bus.Index.Index, *busEq.Band.Band, *cmd.Type)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d type set to: %s\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Type,
)
return nil
}
@@ -408,7 +470,12 @@ func (cmd *BusCompThresholdCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetThreshold(bus.Index.Index, *cmd.Threshold); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor threshold set to: %.2f dB\n", bus.Index.Index, *cmd.Threshold)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor threshold set to: %.2f dB\n",
bus.Index.Index,
*cmd.Threshold,
)
return nil
}
@@ -477,7 +544,12 @@ func (cmd *BusCompMakeupCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetMakeup(bus.Index.Index, *cmd.Makeup); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor makeup gain set to: %.2f dB\n", bus.Index.Index, *cmd.Makeup)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor makeup gain set to: %.2f dB\n",
bus.Index.Index,
*cmd.Makeup,
)
return nil
}
@@ -500,7 +572,12 @@ func (cmd *BusCompAttackCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetAttack(bus.Index.Index, *cmd.Attack); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor attack time set to: %.2f ms\n", bus.Index.Index, *cmd.Attack)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor attack time set to: %.2f ms\n",
bus.Index.Index,
*cmd.Attack,
)
return nil
}
@@ -523,7 +600,12 @@ func (cmd *BusCompHoldCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetHold(bus.Index.Index, *cmd.Hold); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor hold time set to: %.2f ms\n", bus.Index.Index, *cmd.Hold)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor hold time set to: %.2f ms\n",
bus.Index.Index,
*cmd.Hold,
)
return nil
}
@@ -546,6 +628,11 @@ func (cmd *BusCompReleaseCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetRelease(bus.Index.Index, *cmd.Release); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor release time set to: %.2f ms\n", bus.Index.Index, *cmd.Release)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor release time set to: %.2f ms\n",
bus.Index.Index,
*cmd.Release,
)
return nil
}

View File

@@ -11,6 +11,7 @@ import (
"github.com/alecthomas/kong"
"github.com/charmbracelet/log"
kongcompletion "github.com/jotaen/kong-completion"
"github.com/onyx-and-iris/xair-cli/internal/xair"
)

View File

@@ -38,14 +38,20 @@ func (cmd *HeadampGainCmd) Run(ctx *context, headamp *HeadampCmdGroup) error {
return fmt.Errorf("failed to get current headamp gain: %w", err)
}
if err := gradualGainAdjust(ctx, headamp.Index.Index, currentGain, *cmd.Gain, cmd.Duration); err != nil {
if err := gradualGainAdjust(
ctx,
headamp.Index.Index,
currentGain,
*cmd.Gain,
cmd.Duration,
); err != nil {
return fmt.Errorf("failed to set headamp gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Headamp %d gain set to: %.2f dB\n", headamp.Index.Index, *cmd.Gain)
return nil
}
// gradualGainAdjust gradually adjusts gain from current to target over specified duration
// gradualGainAdjust gradually adjusts gain from current to target over specified duration.
func gradualGainAdjust(
ctx *context,
index int,
@@ -96,7 +102,7 @@ type HeadampPhantomCmd struct {
State *string `help:"The phantom power state of the headamp." arg:"" enum:"true,on,false,off" optional:""`
}
// Validate checks if the provided phantom power state is valid and normalizes it to "true" or "false".
// Validate checks if the provided phantom power state is valid and normalises it to "true" or "false".
func (cmd *HeadampPhantomCmd) Validate() error {
if cmd.State != nil {
switch *cmd.State {
@@ -122,7 +128,10 @@ func (cmd *HeadampPhantomCmd) Run(ctx *context, headamp *HeadampCmdGroup) error
return nil
}
if err := ctx.Client.HeadAmp.SetPhantomPower(headamp.Index.Index, *cmd.State == "true"); err != nil {
if err := ctx.Client.HeadAmp.SetPhantomPower(
headamp.Index.Index,
*cmd.State == "true",
); err != nil {
return fmt.Errorf("failed to set headamp phantom power state: %w", err)
}
fmt.Fprintf(ctx.Out, "Headamp %d phantom power set to: %s\n", headamp.Index.Index, *cmd.State)

View File

@@ -2,8 +2,7 @@ package main
import "fmt"
type InfoCmd struct {
}
type InfoCmd struct{}
func (c *InfoCmd) Run(ctx *context) error {
fmt.Fprintf(

View File

@@ -13,7 +13,7 @@ type MainCmdGroup struct {
Fadein MainFadeinCmd `help:"Fade in the Main L/R output over a specified duration." cmd:""`
Fadeout MainFadeoutCmd `help:"Fade out the Main L/R output over a specified duration." cmd:""`
Eq MainEqCmdGroup `help:"Commands for controlling the equalizer settings of the Main L/R output." cmd:"eq"`
Eq MainEqCmdGroup `help:"Commands for controlling the equaliser settings of the Main L/R output." cmd:"eq"`
Comp MainCompCmdGroup `help:"Commands for controlling the compressor settings of the Main L/R output." cmd:"comp"`
}
@@ -131,7 +131,7 @@ func (cmd *MainFadeoutCmd) Run(ctx *context) error {
return nil
}
// MainEqCmdGroup defines the command group for controlling the equalizer settings of the Main L/R output, including commands for getting or setting the EQ parameters.
// MainEqCmdGroup defines the command group for controlling the equaliser settings of the Main L/R output, including commands for getting or setting the EQ parameters.
type MainEqCmdGroup struct {
On MainEqOnCmd `help:"Get or set the EQ on/off state of the Main L/R output." cmd:"on"`
Band struct {
@@ -197,7 +197,12 @@ func (cmd *MainEqBandGainCmd) Run(ctx *context, main *MainCmdGroup, mainEq *Main
if err := ctx.Client.Main.Eq.SetGain(0, *mainEq.Band.Band, *cmd.Level); err != nil {
return fmt.Errorf("failed to set Main L/R EQ band %d gain: %w", *mainEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d gain set to: %.2f dB\n", *mainEq.Band.Band, *cmd.Level)
fmt.Fprintf(
ctx.Out,
"Main L/R EQ band %d gain set to: %.2f dB\n",
*mainEq.Band.Band,
*cmd.Level,
)
return nil
}
@@ -211,7 +216,11 @@ func (cmd *MainEqBandFreqCmd) Run(ctx *context, main *MainCmdGroup, mainEq *Main
if cmd.Frequency == nil {
resp, err := ctx.Client.Main.Eq.Frequency(0, *mainEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Main L/R EQ band %d frequency: %w", *mainEq.Band.Band, err)
return fmt.Errorf(
"failed to get Main L/R EQ band %d frequency: %w",
*mainEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d frequency: %.2f Hz\n", *mainEq.Band.Band, resp)
return nil
@@ -220,7 +229,12 @@ func (cmd *MainEqBandFreqCmd) Run(ctx *context, main *MainCmdGroup, mainEq *Main
if err := ctx.Client.Main.Eq.SetFrequency(0, *mainEq.Band.Band, *cmd.Frequency); err != nil {
return fmt.Errorf("failed to set Main L/R EQ band %d frequency: %w", *mainEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d frequency set to: %.2f Hz\n", *mainEq.Band.Band, *cmd.Frequency)
fmt.Fprintf(
ctx.Out,
"Main L/R EQ band %d frequency set to: %.2f Hz\n",
*mainEq.Band.Band,
*cmd.Frequency,
)
return nil
}
@@ -234,7 +248,11 @@ func (cmd *MainEqBandQCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqC
if cmd.Q == nil {
resp, err := ctx.Client.Main.Eq.Q(0, *mainEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Main L/R EQ band %d Q factor: %w", *mainEq.Band.Band, err)
return fmt.Errorf(
"failed to get Main L/R EQ band %d Q factor: %w",
*mainEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d Q factor: %.2f\n", *mainEq.Band.Band, resp)
return nil

View File

@@ -13,7 +13,7 @@ type MainMonoCmdGroup struct {
Fadein MainMonoFadeinCmd `help:"Fade in the Main Mono output over a specified duration." cmd:""`
Fadeout MainMonoFadeoutCmd `help:"Fade out the Main Mono output over a specified duration." cmd:""`
Eq MainMonoEqCmdGroup `help:"Commands for controlling the equalizer settings of the Main Mono output." cmd:"eq"`
Eq MainMonoEqCmdGroup `help:"Commands for controlling the equaliser settings of the Main Mono output." cmd:"eq"`
Comp MainMonoCompCmdGroup `help:"Commands for controlling the compressor settings of the Main Mono output." cmd:"comp"`
}
@@ -131,7 +131,7 @@ func (cmd *MainMonoFadeoutCmd) Run(ctx *context) error {
return nil
}
// MainMonoEqCmdGroup defines the command group for controlling the equalizer settings of the Main Mono output, including commands for getting or setting the EQ parameters.
// MainMonoEqCmdGroup defines the command group for controlling the equaliser settings of the Main Mono output, including commands for getting or setting the EQ parameters.
type MainMonoEqCmdGroup struct {
On MainMonoEqOnCmd `help:"Get or set the EQ on/off state of the Main Mono output." cmd:"on"`
Band struct {
@@ -184,7 +184,11 @@ type MainMonoEqBandGainCmd struct {
}
// Run executes the MainMonoEqBandGainCmd command, either retrieving the current gain of a specific EQ band on the Main Mono output or setting it based on the provided argument.
func (cmd *MainMonoEqBandGainCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainMonoEqCmdGroup) error {
func (cmd *MainMonoEqBandGainCmd) Run(
ctx *context,
main *MainCmdGroup,
mainEq *MainMonoEqCmdGroup,
) error {
if cmd.Level == nil {
resp, err := ctx.Client.MainMono.Eq.Gain(0, *mainEq.Band.Band)
if err != nil {
@@ -197,7 +201,12 @@ func (cmd *MainMonoEqBandGainCmd) Run(ctx *context, main *MainCmdGroup, mainEq *
if err := ctx.Client.MainMono.Eq.SetGain(0, *mainEq.Band.Band, *cmd.Level); err != nil {
return fmt.Errorf("failed to set Main Mono EQ band %d gain: %w", *mainEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Main Mono EQ band %d gain set to: %.2f dB\n", *mainEq.Band.Band, *cmd.Level)
fmt.Fprintf(
ctx.Out,
"Main Mono EQ band %d gain set to: %.2f dB\n",
*mainEq.Band.Band,
*cmd.Level,
)
return nil
}
@@ -207,20 +216,41 @@ type MainMonoEqBandFreqCmd struct {
}
// Run executes the MainMonoEqBandFreqCmd command, either retrieving the current frequency of a specific EQ band on the Main Mono output or setting it based on the provided argument.
func (cmd *MainMonoEqBandFreqCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainMonoEqCmdGroup) error {
func (cmd *MainMonoEqBandFreqCmd) Run(
ctx *context,
main *MainCmdGroup,
mainEq *MainMonoEqCmdGroup,
) error {
if cmd.Frequency == nil {
resp, err := ctx.Client.MainMono.Eq.Frequency(0, *mainEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Main Mono EQ band %d frequency: %w", *mainEq.Band.Band, err)
return fmt.Errorf(
"failed to get Main Mono EQ band %d frequency: %w",
*mainEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Main Mono EQ band %d frequency: %.2f Hz\n", *mainEq.Band.Band, resp)
return nil
}
if err := ctx.Client.MainMono.Eq.SetFrequency(0, *mainEq.Band.Band, *cmd.Frequency); err != nil {
return fmt.Errorf("failed to set Main Mono EQ band %d frequency: %w", *mainEq.Band.Band, err)
if err := ctx.Client.MainMono.Eq.SetFrequency(
0,
*mainEq.Band.Band,
*cmd.Frequency,
); err != nil {
return fmt.Errorf(
"failed to set Main Mono EQ band %d frequency: %w",
*mainEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Main Mono EQ band %d frequency set to: %.2f Hz\n", *mainEq.Band.Band, *cmd.Frequency)
fmt.Fprintf(
ctx.Out,
"Main Mono EQ band %d frequency set to: %.2f Hz\n",
*mainEq.Band.Band,
*cmd.Frequency,
)
return nil
}
@@ -230,11 +260,19 @@ type MainMonoEqBandQCmd struct {
}
// Run executes the MainMonoEqBandQCmd command, either retrieving the current Q factor of a specific EQ band on the Main Mono output or setting it based on the provided argument.
func (cmd *MainMonoEqBandQCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainMonoEqCmdGroup) error {
func (cmd *MainMonoEqBandQCmd) Run(
ctx *context,
main *MainCmdGroup,
mainEq *MainMonoEqCmdGroup,
) error {
if cmd.Q == nil {
resp, err := ctx.Client.MainMono.Eq.Q(0, *mainEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Main Mono EQ band %d Q factor: %w", *mainEq.Band.Band, err)
return fmt.Errorf(
"failed to get Main Mono EQ band %d Q factor: %w",
*mainEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Main Mono EQ band %d Q factor: %.2f\n", *mainEq.Band.Band, resp)
return nil
@@ -253,7 +291,11 @@ type MainMonoEqBandTypeCmd struct {
}
// Run executes the MainMonoEqBandTypeCmd command, either retrieving the current type of a specific EQ band on the Main Mono output or setting it based on the provided argument.
func (cmd *MainMonoEqBandTypeCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainMonoEqCmdGroup) error {
func (cmd *MainMonoEqBandTypeCmd) Run(
ctx *context,
main *MainCmdGroup,
mainEq *MainMonoEqCmdGroup,
) error {
if cmd.Type == nil {
resp, err := ctx.Client.MainMono.Eq.Type(0, *mainEq.Band.Band)
if err != nil {

View File

@@ -15,7 +15,7 @@ type MatrixCmdGroup struct {
Fadein MatrixFadeinCmd `help:"Fade in the Matrix output over a specified duration." cmd:""`
Fadeout MatrixFadeoutCmd `help:"Fade out the Matrix output over a specified duration." cmd:""`
Eq MatrixEqCmdGroup `help:"Commands for controlling the equalizer settings of the Matrix output." cmd:"eq"`
Eq MatrixEqCmdGroup `help:"Commands for controlling the equaliser settings of the Matrix output." cmd:"eq"`
Comp MatrixCompCmdGroup `help:"Commands for controlling the compressor settings of the Matrix output." cmd:"comp"`
} `help:"Commands for controlling individual Matrix outputs." arg:""`
}
@@ -141,7 +141,7 @@ func (cmd *MatrixFadeoutCmd) Run(ctx *context, matrix *MatrixCmdGroup) error {
return nil
}
// MatrixEqCmdGroup defines the command group for controlling the equalizer settings of the Matrix output, including commands for getting or setting the EQ parameters.
// MatrixEqCmdGroup defines the command group for controlling the equaliser settings of the Matrix output, including commands for getting or setting the EQ parameters.
type MatrixEqCmdGroup struct {
On MatrixEqOnCmd `help:"Get or set the EQ on/off state of the Matrix output." cmd:"on"`
Band struct {
@@ -194,7 +194,11 @@ type MatrixEqBandGainCmd struct {
}
// Run executes the MatrixEqBandGainCmd command, either retrieving the current gain of a specific EQ band on the Matrix output or setting it based on the provided argument.
func (cmd *MatrixEqBandGainCmd) Run(ctx *context, matrix *MatrixCmdGroup, matrixEq *MatrixEqCmdGroup) error {
func (cmd *MatrixEqBandGainCmd) Run(
ctx *context,
matrix *MatrixCmdGroup,
matrixEq *MatrixEqCmdGroup,
) error {
if cmd.Level == nil {
resp, err := ctx.Client.Matrix.Eq.Gain(matrix.Index.Index, *matrixEq.Band.Band)
if err != nil {
@@ -204,10 +208,19 @@ func (cmd *MatrixEqBandGainCmd) Run(ctx *context, matrix *MatrixCmdGroup, matrix
return nil
}
if err := ctx.Client.Matrix.Eq.SetGain(matrix.Index.Index, *matrixEq.Band.Band, *cmd.Level); err != nil {
if err := ctx.Client.Matrix.Eq.SetGain(
matrix.Index.Index,
*matrixEq.Band.Band,
*cmd.Level,
); err != nil {
return fmt.Errorf("failed to set Matrix EQ band %d gain: %w", *matrixEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Matrix EQ band %d gain set to: %.2f dB\n", *matrixEq.Band.Band, *cmd.Level)
fmt.Fprintf(
ctx.Out,
"Matrix EQ band %d gain set to: %.2f dB\n",
*matrixEq.Band.Band,
*cmd.Level,
)
return nil
}
@@ -217,20 +230,37 @@ type MatrixEqBandFreqCmd struct {
}
// Run executes the MatrixEqBandFreqCmd command, either retrieving the current frequency of a specific EQ band on the Matrix output or setting it based on the provided argument.
func (cmd *MatrixEqBandFreqCmd) Run(ctx *context, matrix *MatrixCmdGroup, matrixEq *MatrixEqCmdGroup) error {
func (cmd *MatrixEqBandFreqCmd) Run(
ctx *context,
matrix *MatrixCmdGroup,
matrixEq *MatrixEqCmdGroup,
) error {
if cmd.Frequency == nil {
resp, err := ctx.Client.Matrix.Eq.Frequency(matrix.Index.Index, *matrixEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Matrix EQ band %d frequency: %w", *matrixEq.Band.Band, err)
return fmt.Errorf(
"failed to get Matrix EQ band %d frequency: %w",
*matrixEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Matrix EQ band %d frequency: %.2f Hz\n", *matrixEq.Band.Band, resp)
return nil
}
if err := ctx.Client.Matrix.Eq.SetFrequency(matrix.Index.Index, *matrixEq.Band.Band, *cmd.Frequency); err != nil {
if err := ctx.Client.Matrix.Eq.SetFrequency(
matrix.Index.Index,
*matrixEq.Band.Band,
*cmd.Frequency,
); err != nil {
return fmt.Errorf("failed to set Matrix EQ band %d frequency: %w", *matrixEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Matrix EQ band %d frequency set to: %.2f Hz\n", *matrixEq.Band.Band, *cmd.Frequency)
fmt.Fprintf(
ctx.Out,
"Matrix EQ band %d frequency set to: %.2f Hz\n",
*matrixEq.Band.Band,
*cmd.Frequency,
)
return nil
}
@@ -240,17 +270,29 @@ type MatrixEqBandQCmd struct {
}
// Run executes the MatrixEqBandQCmd command, either retrieving the current Q factor of a specific EQ band on the Matrix output or setting it based on the provided argument.
func (cmd *MatrixEqBandQCmd) Run(ctx *context, matrix *MatrixCmdGroup, matrixEq *MatrixEqCmdGroup) error {
func (cmd *MatrixEqBandQCmd) Run(
ctx *context,
matrix *MatrixCmdGroup,
matrixEq *MatrixEqCmdGroup,
) error {
if cmd.Q == nil {
resp, err := ctx.Client.Matrix.Eq.Q(matrix.Index.Index, *matrixEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Matrix EQ band %d Q factor: %w", *matrixEq.Band.Band, err)
return fmt.Errorf(
"failed to get Matrix EQ band %d Q factor: %w",
*matrixEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Matrix EQ band %d Q factor: %.2f\n", *matrixEq.Band.Band, resp)
return nil
}
if err := ctx.Client.Matrix.Eq.SetQ(matrix.Index.Index, *matrixEq.Band.Band, *cmd.Q); err != nil {
if err := ctx.Client.Matrix.Eq.SetQ(
matrix.Index.Index,
*matrixEq.Band.Band,
*cmd.Q,
); err != nil {
return fmt.Errorf("failed to set Matrix EQ band %d Q factor: %w", *matrixEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Matrix EQ band %d Q factor set to: %.2f\n", *matrixEq.Band.Band, *cmd.Q)
@@ -263,7 +305,11 @@ type MatrixEqBandTypeCmd struct {
}
// Run executes the MatrixEqBandTypeCmd command, either retrieving the current type of a specific EQ band on the Matrix output or setting it based on the provided argument.
func (cmd *MatrixEqBandTypeCmd) Run(ctx *context, matrix *MatrixCmdGroup, matrixEq *MatrixEqCmdGroup) error {
func (cmd *MatrixEqBandTypeCmd) Run(
ctx *context,
matrix *MatrixCmdGroup,
matrixEq *MatrixEqCmdGroup,
) error {
if cmd.Type == nil {
resp, err := ctx.Client.Matrix.Eq.Type(matrix.Index.Index, *matrixEq.Band.Band)
if err != nil {
@@ -273,7 +319,11 @@ func (cmd *MatrixEqBandTypeCmd) Run(ctx *context, matrix *MatrixCmdGroup, matrix
return nil
}
if err := ctx.Client.Matrix.Eq.SetType(matrix.Index.Index, *matrixEq.Band.Band, *cmd.Type); err != nil {
if err := ctx.Client.Matrix.Eq.SetType(
matrix.Index.Index,
*matrixEq.Band.Band,
*cmd.Type,
); err != nil {
return fmt.Errorf("failed to set Matrix EQ band %d type: %w", *matrixEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Matrix EQ band %d type set to: %s\n", *matrixEq.Band.Band, *cmd.Type)

View File

@@ -26,8 +26,7 @@ func (c *SnapshotCmdGroup) Validate() error {
return nil
}
type ListCmd struct {
}
type ListCmd struct{}
func (c *ListCmd) Run(ctx *context) error {
for i := range 64 {
@@ -73,15 +72,13 @@ func (c *SaveCmd) Run(ctx *context, snapshot *SnapshotCmdGroup) error {
return ctx.Client.Snapshot.CurrentSave(*snapshot.Index.Index)
}
type LoadCmd struct {
}
type LoadCmd struct{}
func (c *LoadCmd) Run(ctx *context, snapshot *SnapshotCmdGroup) error {
return ctx.Client.Snapshot.CurrentLoad(*snapshot.Index.Index)
}
type DeleteCmd struct {
}
type DeleteCmd struct{}
func (c *DeleteCmd) Run(ctx *context, snapshot *SnapshotCmdGroup) error {
return ctx.Client.Snapshot.CurrentDelete(*snapshot.Index.Index)

View File

@@ -99,7 +99,12 @@ func (cmd *StripFadeinCmd) Run(ctx *context, strip *StripCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Strip %d fade-in complete. Final level: %.2f dB\n", strip.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Strip %d fade-in complete. Final level: %.2f dB\n",
strip.Index.Index,
cmd.Target,
)
return nil
}
@@ -135,7 +140,12 @@ func (cmd *StripFadeoutCmd) Run(ctx *context, strip *StripCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Strip %d fade-out complete. Final level: %.2f dB\n", strip.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Strip %d fade-out complete. Final level: %.2f dB\n",
strip.Index.Index,
cmd.Target,
)
return nil
}
}
@@ -165,7 +175,11 @@ func (cmd *StripSendCmd) Run(ctx *context, strip *StripCmdGroup) error {
return nil
}
if err := ctx.Client.Strip.SetSendLevel(strip.Index.Index, cmd.SendIndex, *cmd.Level); err != nil {
if err := ctx.Client.Strip.SetSendLevel(
strip.Index.Index,
cmd.SendIndex,
*cmd.Level,
); err != nil {
return fmt.Errorf("failed to set send level: %w", err)
}
fmt.Fprintf(
@@ -178,7 +192,7 @@ func (cmd *StripSendCmd) Run(ctx *context, strip *StripCmdGroup) error {
return nil
}
// StripNameCmd defines the command for getting or setting the name of a strip, allowing users to assign custom names to strips for easier identification and organization.
// StripNameCmd defines the command for getting or setting the name of a strip, allowing users to assign custom names to strips for easier identification and organisation.
type StripNameCmd struct {
Name *string `arg:"" help:"The name to set for the strip." optional:""`
}
@@ -277,7 +291,12 @@ func (cmd *StripGateThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error
if err := ctx.Client.Strip.Gate.SetThreshold(strip.Index.Index, *cmd.Threshold); err != nil {
return fmt.Errorf("failed to set gate threshold: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d gate threshold set to: %.2f\n", strip.Index.Index, *cmd.Threshold)
fmt.Fprintf(
ctx.Out,
"Strip %d gate threshold set to: %.2f\n",
strip.Index.Index,
*cmd.Threshold,
)
return nil
}
@@ -323,7 +342,12 @@ func (cmd *StripGateAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Gate.SetAttack(strip.Index.Index, *cmd.Attack); err != nil {
return fmt.Errorf("failed to set gate attack time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d gate attack time set to: %.2f ms\n", strip.Index.Index, *cmd.Attack)
fmt.Fprintf(
ctx.Out,
"Strip %d gate attack time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Attack,
)
return nil
}
@@ -369,7 +393,12 @@ func (cmd *StripGateReleaseCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Gate.SetRelease(strip.Index.Index, *cmd.Release); err != nil {
return fmt.Errorf("failed to set gate release time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d gate release time set to: %.2f ms\n", strip.Index.Index, *cmd.Release)
fmt.Fprintf(
ctx.Out,
"Strip %d gate release time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Release,
)
return nil
}
@@ -426,40 +455,74 @@ type StripEqBandGainCmd struct {
}
// Run executes the StripEqBandGainCmd command, either retrieving the current gain of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandGainCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandGainCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Gain == nil {
resp, err := ctx.Client.Strip.Eq.Gain(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d gain: %.2f\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d gain: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetGain(strip.Index.Index, *stripEq.Band.Band, *cmd.Gain); err != nil {
if err := ctx.Client.Strip.Eq.SetGain(
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Gain,
); err != nil {
return fmt.Errorf("failed to set EQ band gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d gain set to: %.2f\n", strip.Index.Index, *stripEq.Band.Band, *cmd.Gain)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d gain set to: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Gain,
)
return nil
}
// StripEqBandFreqCmd defines the command for getting or setting the frequency of a specific EQ band on a strip, allowing users to adjust the center frequency of the band in hertz (Hz).
// StripEqBandFreqCmd defines the command for getting or setting the frequency of a specific EQ band on a strip, allowing users to adjust the centre frequency of the band in hertz (Hz).
type StripEqBandFreqCmd struct {
Freq *float64 `arg:"" help:"The frequency to set for the EQ band (in Hz)." optional:""`
}
// Run executes the StripEqBandFreqCmd command, either retrieving the current frequency of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandFreqCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandFreqCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Freq == nil {
resp, err := ctx.Client.Strip.Eq.Frequency(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band frequency: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d frequency: %.2f Hz\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d frequency: %.2f Hz\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetFrequency(strip.Index.Index, *stripEq.Band.Band, *cmd.Freq); err != nil {
if err := ctx.Client.Strip.Eq.SetFrequency(
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Freq,
); err != nil {
return fmt.Errorf("failed to set EQ band frequency: %w", err)
}
fmt.Fprintf(
@@ -478,20 +541,36 @@ type StripEqBandQCmd struct {
}
// Run executes the StripEqBandQCmd command, either retrieving the current Q factor of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandQCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandQCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Q == nil {
resp, err := ctx.Client.Strip.Eq.Q(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band Q factor: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d Q factor: %.2f\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d Q factor: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetQ(strip.Index.Index, *stripEq.Band.Band, *cmd.Q); err != nil {
return fmt.Errorf("failed to set EQ band Q factor: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d Q factor set to: %.2f\n", strip.Index.Index, *stripEq.Band.Band, *cmd.Q)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d Q factor set to: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Q,
)
return nil
}
@@ -501,20 +580,40 @@ type StripEqBandTypeCmd struct {
}
// Run executes the StripEqBandTypeCmd command, either retrieving the current type of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandTypeCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandTypeCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Type == nil {
resp, err := ctx.Client.Strip.Eq.Type(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band type: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d type: %s\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d type: %s\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetType(strip.Index.Index, *stripEq.Band.Band, *cmd.Type); err != nil {
if err := ctx.Client.Strip.Eq.SetType(
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Type,
); err != nil {
return fmt.Errorf("failed to set EQ band type: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d type set to: %s\n", strip.Index.Index, *stripEq.Band.Band, *cmd.Type)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d type set to: %s\n",
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Type,
)
return nil
}
@@ -596,7 +695,12 @@ func (cmd *StripCompThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error
if err := ctx.Client.Strip.Comp.SetThreshold(strip.Index.Index, *cmd.Threshold); err != nil {
return fmt.Errorf("failed to set compressor threshold: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor threshold set to: %.2f\n", strip.Index.Index, *cmd.Threshold)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor threshold set to: %.2f\n",
strip.Index.Index,
*cmd.Threshold,
)
return nil
}
@@ -665,7 +769,12 @@ func (cmd *StripCompMakeupCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetMakeup(strip.Index.Index, *cmd.Makeup); err != nil {
return fmt.Errorf("failed to set compressor makeup gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor makeup gain set to: %.2f\n", strip.Index.Index, *cmd.Makeup)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor makeup gain set to: %.2f\n",
strip.Index.Index,
*cmd.Makeup,
)
return nil
}
@@ -688,7 +797,12 @@ func (cmd *StripCompAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetAttack(strip.Index.Index, *cmd.Attack); err != nil {
return fmt.Errorf("failed to set compressor attack time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor attack time set to: %.2f ms\n", strip.Index.Index, *cmd.Attack)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor attack time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Attack,
)
return nil
}
@@ -711,7 +825,12 @@ func (cmd *StripCompHoldCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetHold(strip.Index.Index, *cmd.Hold); err != nil {
return fmt.Errorf("failed to set compressor hold time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor hold time set to: %.2f ms\n", strip.Index.Index, *cmd.Hold)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor hold time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Hold,
)
return nil
}
@@ -734,6 +853,11 @@ func (cmd *StripCompReleaseCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetRelease(strip.Index.Index, *cmd.Release); err != nil {
return fmt.Errorf("failed to set compressor release time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor release time set to: %.2f ms\n", strip.Index.Index, *cmd.Release)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor release time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Release,
)
return nil
}

View File

@@ -101,7 +101,12 @@ func (cmd *BusFadeinCmd) Run(ctx *context, bus *BusCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Bus %d fade-in complete. Final level: %.2f dB\n", bus.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Bus %d fade-in complete. Final level: %.2f dB\n",
bus.Index.Index,
cmd.Target,
)
return nil
}
@@ -140,7 +145,12 @@ func (cmd *BusFadeoutCmd) Run(ctx *context, bus *BusCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Bus %d fade-out complete. Final level: %.2f dB\n", bus.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Bus %d fade-out complete. Final level: %.2f dB\n",
bus.Index.Index,
cmd.Target,
)
return nil
}
@@ -250,14 +260,26 @@ func (cmd *BusEqBandGainCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d gain: %.2f dB\n", bus.Index.Index, busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d gain: %.2f dB\n",
bus.Index.Index,
busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetGain(bus.Index.Index, *busEq.Band.Band, *cmd.Gain); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d gain set to: %.2f dB\n", bus.Index.Index, *busEq.Band.Band, *cmd.Gain)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d gain set to: %.2f dB\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Gain,
)
return nil
}
@@ -273,14 +295,30 @@ func (cmd *BusEqBandFreqCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d frequency: %.2f Hz\n", bus.Index.Index, *busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d frequency: %.2f Hz\n",
bus.Index.Index,
*busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetFrequency(bus.Index.Index, *busEq.Band.Band, *cmd.Freq); err != nil {
if err := ctx.Client.Bus.Eq.SetFrequency(
bus.Index.Index,
*busEq.Band.Band,
*cmd.Freq,
); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d frequency set to: %.2f Hz\n", bus.Index.Index, *busEq.Band.Band, *cmd.Freq)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d frequency set to: %.2f Hz\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Freq,
)
return nil
}
@@ -296,14 +334,26 @@ func (cmd *BusEqBandQCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmdGro
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d Q factor: %.2f\n", bus.Index.Index, *busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d Q factor: %.2f\n",
bus.Index.Index,
*busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetQ(bus.Index.Index, *busEq.Band.Band, *cmd.Q); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d Q factor set to: %.2f\n", bus.Index.Index, *busEq.Band.Band, *cmd.Q)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d Q factor set to: %.2f\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Q,
)
return nil
}
@@ -319,14 +369,26 @@ func (cmd *BusEqBandTypeCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
if err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d type: %s\n", bus.Index.Index, *busEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d type: %s\n",
bus.Index.Index,
*busEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Bus.Eq.SetType(bus.Index.Index, *busEq.Band.Band, *cmd.Type); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d EQ band %d type set to: %s\n", bus.Index.Index, *busEq.Band.Band, *cmd.Type)
fmt.Fprintf(
ctx.Out,
"Bus %d EQ band %d type set to: %s\n",
bus.Index.Index,
*busEq.Band.Band,
*cmd.Type,
)
return nil
}
@@ -408,7 +470,12 @@ func (cmd *BusCompThresholdCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetThreshold(bus.Index.Index, *cmd.Threshold); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor threshold set to: %.2f dB\n", bus.Index.Index, *cmd.Threshold)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor threshold set to: %.2f dB\n",
bus.Index.Index,
*cmd.Threshold,
)
return nil
}
@@ -477,7 +544,12 @@ func (cmd *BusCompMakeupCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetMakeup(bus.Index.Index, *cmd.Makeup); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor makeup gain set to: %.2f dB\n", bus.Index.Index, *cmd.Makeup)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor makeup gain set to: %.2f dB\n",
bus.Index.Index,
*cmd.Makeup,
)
return nil
}
@@ -500,7 +572,12 @@ func (cmd *BusCompAttackCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetAttack(bus.Index.Index, *cmd.Attack); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor attack time set to: %.2f ms\n", bus.Index.Index, *cmd.Attack)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor attack time set to: %.2f ms\n",
bus.Index.Index,
*cmd.Attack,
)
return nil
}
@@ -523,7 +600,12 @@ func (cmd *BusCompHoldCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetHold(bus.Index.Index, *cmd.Hold); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor hold time set to: %.2f ms\n", bus.Index.Index, *cmd.Hold)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor hold time set to: %.2f ms\n",
bus.Index.Index,
*cmd.Hold,
)
return nil
}
@@ -546,6 +628,11 @@ func (cmd *BusCompReleaseCmd) Run(ctx *context, bus *BusCmdGroup) error {
if err := ctx.Client.Bus.Comp.SetRelease(bus.Index.Index, *cmd.Release); err != nil {
return err
}
fmt.Fprintf(ctx.Out, "Bus %d compressor release time set to: %.2f ms\n", bus.Index.Index, *cmd.Release)
fmt.Fprintf(
ctx.Out,
"Bus %d compressor release time set to: %.2f ms\n",
bus.Index.Index,
*cmd.Release,
)
return nil
}

View File

@@ -11,6 +11,7 @@ import (
"github.com/alecthomas/kong"
"github.com/charmbracelet/log"
kongcompletion "github.com/jotaen/kong-completion"
"github.com/onyx-and-iris/xair-cli/internal/xair"
)

View File

@@ -38,14 +38,20 @@ func (cmd *HeadampGainCmd) Run(ctx *context, headamp *HeadampCmdGroup) error {
return fmt.Errorf("failed to get current headamp gain: %w", err)
}
if err := gradualGainAdjust(ctx, headamp.Index.Index, currentGain, *cmd.Gain, cmd.Duration); err != nil {
if err := gradualGainAdjust(
ctx,
headamp.Index.Index,
currentGain,
*cmd.Gain,
cmd.Duration,
); err != nil {
return fmt.Errorf("failed to set headamp gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Headamp %d gain set to: %.2f dB\n", headamp.Index.Index, *cmd.Gain)
return nil
}
// gradualGainAdjust gradually adjusts gain from current to target over specified duration
// gradualGainAdjust gradually adjusts gain from current to target over specified duration.
func gradualGainAdjust(
ctx *context,
index int,
@@ -96,7 +102,7 @@ type HeadampPhantomCmd struct {
State *string `help:"The phantom power state of the headamp." arg:"" enum:"true,on,false,off" optional:""`
}
// Validate checks if the provided phantom power state is valid and normalizes it to "true" or "false".
// Validate checks if the provided phantom power state is valid and normalises it to "true" or "false".
func (cmd *HeadampPhantomCmd) Validate() error {
if cmd.State != nil {
switch *cmd.State {
@@ -122,7 +128,10 @@ func (cmd *HeadampPhantomCmd) Run(ctx *context, headamp *HeadampCmdGroup) error
return nil
}
if err := ctx.Client.HeadAmp.SetPhantomPower(headamp.Index.Index, *cmd.State == "true"); err != nil {
if err := ctx.Client.HeadAmp.SetPhantomPower(
headamp.Index.Index,
*cmd.State == "true",
); err != nil {
return fmt.Errorf("failed to set headamp phantom power state: %w", err)
}
fmt.Fprintf(ctx.Out, "Headamp %d phantom power set to: %s\n", headamp.Index.Index, *cmd.State)

View File

@@ -2,8 +2,7 @@ package main
import "fmt"
type InfoCmd struct {
}
type InfoCmd struct{}
func (c *InfoCmd) Run(ctx *context) error {
fmt.Fprintf(

View File

@@ -13,7 +13,7 @@ type MainCmdGroup struct {
Fadein MainFadeinCmd `help:"Fade in the Main L/R output over a specified duration." cmd:""`
Fadeout MainFadeoutCmd `help:"Fade out the Main L/R output over a specified duration." cmd:""`
Eq MainEqCmdGroup `help:"Commands for controlling the equalizer settings of the Main L/R output." cmd:"eq"`
Eq MainEqCmdGroup `help:"Commands for controlling the equaliser settings of the Main L/R output." cmd:"eq"`
Comp MainCompCmdGroup `help:"Commands for controlling the compressor settings of the Main L/R output." cmd:"comp"`
}
@@ -131,7 +131,7 @@ func (cmd *MainFadeoutCmd) Run(ctx *context) error {
return nil
}
// MainEqCmdGroup defines the command group for controlling the equalizer settings of the Main L/R output, including commands for getting or setting the EQ parameters.
// MainEqCmdGroup defines the command group for controlling the equaliser settings of the Main L/R output, including commands for getting or setting the EQ parameters.
type MainEqCmdGroup struct {
On MainEqOnCmd `help:"Get or set the EQ on/off state of the Main L/R output." cmd:"on"`
Band struct {
@@ -197,7 +197,12 @@ func (cmd *MainEqBandGainCmd) Run(ctx *context, main *MainCmdGroup, mainEq *Main
if err := ctx.Client.Main.Eq.SetGain(0, *mainEq.Band.Band, *cmd.Level); err != nil {
return fmt.Errorf("failed to set Main L/R EQ band %d gain: %w", *mainEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d gain set to: %.2f dB\n", *mainEq.Band.Band, *cmd.Level)
fmt.Fprintf(
ctx.Out,
"Main L/R EQ band %d gain set to: %.2f dB\n",
*mainEq.Band.Band,
*cmd.Level,
)
return nil
}
@@ -211,7 +216,11 @@ func (cmd *MainEqBandFreqCmd) Run(ctx *context, main *MainCmdGroup, mainEq *Main
if cmd.Frequency == nil {
resp, err := ctx.Client.Main.Eq.Frequency(0, *mainEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Main L/R EQ band %d frequency: %w", *mainEq.Band.Band, err)
return fmt.Errorf(
"failed to get Main L/R EQ band %d frequency: %w",
*mainEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d frequency: %.2f Hz\n", *mainEq.Band.Band, resp)
return nil
@@ -220,7 +229,12 @@ func (cmd *MainEqBandFreqCmd) Run(ctx *context, main *MainCmdGroup, mainEq *Main
if err := ctx.Client.Main.Eq.SetFrequency(0, *mainEq.Band.Band, *cmd.Frequency); err != nil {
return fmt.Errorf("failed to set Main L/R EQ band %d frequency: %w", *mainEq.Band.Band, err)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d frequency set to: %.2f Hz\n", *mainEq.Band.Band, *cmd.Frequency)
fmt.Fprintf(
ctx.Out,
"Main L/R EQ band %d frequency set to: %.2f Hz\n",
*mainEq.Band.Band,
*cmd.Frequency,
)
return nil
}
@@ -234,7 +248,11 @@ func (cmd *MainEqBandQCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqC
if cmd.Q == nil {
resp, err := ctx.Client.Main.Eq.Q(0, *mainEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get Main L/R EQ band %d Q factor: %w", *mainEq.Band.Band, err)
return fmt.Errorf(
"failed to get Main L/R EQ band %d Q factor: %w",
*mainEq.Band.Band,
err,
)
}
fmt.Fprintf(ctx.Out, "Main L/R EQ band %d Q factor: %.2f\n", *mainEq.Band.Band, resp)
return nil

View File

@@ -26,8 +26,7 @@ func (c *SnapshotCmdGroup) Validate() error {
return nil
}
type ListCmd struct {
}
type ListCmd struct{}
func (c *ListCmd) Run(ctx *context) error {
for i := range 64 {
@@ -73,15 +72,13 @@ func (c *SaveCmd) Run(ctx *context, snapshot *SnapshotCmdGroup) error {
return ctx.Client.Snapshot.CurrentSave(*snapshot.Index.Index)
}
type LoadCmd struct {
}
type LoadCmd struct{}
func (c *LoadCmd) Run(ctx *context, snapshot *SnapshotCmdGroup) error {
return ctx.Client.Snapshot.CurrentLoad(*snapshot.Index.Index)
}
type DeleteCmd struct {
}
type DeleteCmd struct{}
func (c *DeleteCmd) Run(ctx *context, snapshot *SnapshotCmdGroup) error {
return ctx.Client.Snapshot.CurrentDelete(*snapshot.Index.Index)

View File

@@ -99,7 +99,12 @@ func (cmd *StripFadeinCmd) Run(ctx *context, strip *StripCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Strip %d fade-in complete. Final level: %.2f dB\n", strip.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Strip %d fade-in complete. Final level: %.2f dB\n",
strip.Index.Index,
cmd.Target,
)
return nil
}
@@ -135,7 +140,12 @@ func (cmd *StripFadeoutCmd) Run(ctx *context, strip *StripCmdGroup) error {
time.Sleep(stepDuration)
}
fmt.Fprintf(ctx.Out, "Strip %d fade-out complete. Final level: %.2f dB\n", strip.Index.Index, cmd.Target)
fmt.Fprintf(
ctx.Out,
"Strip %d fade-out complete. Final level: %.2f dB\n",
strip.Index.Index,
cmd.Target,
)
return nil
}
}
@@ -155,18 +165,34 @@ func (cmd *StripSendCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err != nil {
return fmt.Errorf("failed to get send level: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d send %d level: %.2f dB\n", strip.Index.Index, cmd.SendIndex, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d send %d level: %.2f dB\n",
strip.Index.Index,
cmd.SendIndex,
resp,
)
return nil
}
if err := ctx.Client.Strip.SetSendLevel(strip.Index.Index, cmd.SendIndex, *cmd.Level); err != nil {
if err := ctx.Client.Strip.SetSendLevel(
strip.Index.Index,
cmd.SendIndex,
*cmd.Level,
); err != nil {
return fmt.Errorf("failed to set send level: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d send %d level set to: %.2f dB\n", strip.Index.Index, cmd.SendIndex, *cmd.Level)
fmt.Fprintf(
ctx.Out,
"Strip %d send %d level set to: %.2f dB\n",
strip.Index.Index,
cmd.SendIndex,
*cmd.Level,
)
return nil
}
// StripNameCmd defines the command for getting or setting the name of a strip, allowing users to assign custom names to strips for easier identification and organization.
// StripNameCmd defines the command for getting or setting the name of a strip, allowing users to assign custom names to strips for easier identification and organisation.
type StripNameCmd struct {
Name *string `arg:"" help:"The name to set for the strip." optional:""`
}
@@ -265,7 +291,12 @@ func (cmd *StripGateThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error
if err := ctx.Client.Strip.Gate.SetThreshold(strip.Index.Index, *cmd.Threshold); err != nil {
return fmt.Errorf("failed to set gate threshold: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d gate threshold set to: %.2f\n", strip.Index.Index, *cmd.Threshold)
fmt.Fprintf(
ctx.Out,
"Strip %d gate threshold set to: %.2f\n",
strip.Index.Index,
*cmd.Threshold,
)
return nil
}
@@ -311,7 +342,12 @@ func (cmd *StripGateAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Gate.SetAttack(strip.Index.Index, *cmd.Attack); err != nil {
return fmt.Errorf("failed to set gate attack time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d gate attack time set to: %.2f ms\n", strip.Index.Index, *cmd.Attack)
fmt.Fprintf(
ctx.Out,
"Strip %d gate attack time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Attack,
)
return nil
}
@@ -357,7 +393,12 @@ func (cmd *StripGateReleaseCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Gate.SetRelease(strip.Index.Index, *cmd.Release); err != nil {
return fmt.Errorf("failed to set gate release time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d gate release time set to: %.2f ms\n", strip.Index.Index, *cmd.Release)
fmt.Fprintf(
ctx.Out,
"Strip %d gate release time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Release,
)
return nil
}
@@ -414,40 +455,74 @@ type StripEqBandGainCmd struct {
}
// Run executes the StripEqBandGainCmd command, either retrieving the current gain of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandGainCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandGainCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Gain == nil {
resp, err := ctx.Client.Strip.Eq.Gain(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d gain: %.2f\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d gain: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetGain(strip.Index.Index, *stripEq.Band.Band, *cmd.Gain); err != nil {
if err := ctx.Client.Strip.Eq.SetGain(
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Gain,
); err != nil {
return fmt.Errorf("failed to set EQ band gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d gain set to: %.2f\n", strip.Index.Index, *stripEq.Band.Band, *cmd.Gain)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d gain set to: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Gain,
)
return nil
}
// StripEqBandFreqCmd defines the command for getting or setting the frequency of a specific EQ band on a strip, allowing users to adjust the center frequency of the band in hertz (Hz).
// StripEqBandFreqCmd defines the command for getting or setting the frequency of a specific EQ band on a strip, allowing users to adjust the centre frequency of the band in hertz (Hz).
type StripEqBandFreqCmd struct {
Freq *float64 `arg:"" help:"The frequency to set for the EQ band (in Hz)." optional:""`
}
// Run executes the StripEqBandFreqCmd command, either retrieving the current frequency of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandFreqCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandFreqCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Freq == nil {
resp, err := ctx.Client.Strip.Eq.Frequency(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band frequency: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d frequency: %.2f Hz\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d frequency: %.2f Hz\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetFrequency(strip.Index.Index, *stripEq.Band.Band, *cmd.Freq); err != nil {
if err := ctx.Client.Strip.Eq.SetFrequency(
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Freq,
); err != nil {
return fmt.Errorf("failed to set EQ band frequency: %w", err)
}
fmt.Fprintf(
@@ -466,20 +541,36 @@ type StripEqBandQCmd struct {
}
// Run executes the StripEqBandQCmd command, either retrieving the current Q factor of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandQCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandQCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Q == nil {
resp, err := ctx.Client.Strip.Eq.Q(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band Q factor: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d Q factor: %.2f\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d Q factor: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetQ(strip.Index.Index, *stripEq.Band.Band, *cmd.Q); err != nil {
return fmt.Errorf("failed to set EQ band Q factor: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d Q factor set to: %.2f\n", strip.Index.Index, *stripEq.Band.Band, *cmd.Q)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d Q factor set to: %.2f\n",
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Q,
)
return nil
}
@@ -489,20 +580,40 @@ type StripEqBandTypeCmd struct {
}
// Run executes the StripEqBandTypeCmd command, either retrieving the current type of the specified EQ band on the strip or setting it based on the provided argument.
func (cmd *StripEqBandTypeCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *StripEqCmdGroup) error {
func (cmd *StripEqBandTypeCmd) Run(
ctx *context,
strip *StripCmdGroup,
stripEq *StripEqCmdGroup,
) error {
if cmd.Type == nil {
resp, err := ctx.Client.Strip.Eq.Type(strip.Index.Index, *stripEq.Band.Band)
if err != nil {
return fmt.Errorf("failed to get EQ band type: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d type: %s\n", strip.Index.Index, *stripEq.Band.Band, resp)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d type: %s\n",
strip.Index.Index,
*stripEq.Band.Band,
resp,
)
return nil
}
if err := ctx.Client.Strip.Eq.SetType(strip.Index.Index, *stripEq.Band.Band, *cmd.Type); err != nil {
if err := ctx.Client.Strip.Eq.SetType(
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Type,
); err != nil {
return fmt.Errorf("failed to set EQ band type: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d EQ band %d type set to: %s\n", strip.Index.Index, *stripEq.Band.Band, *cmd.Type)
fmt.Fprintf(
ctx.Out,
"Strip %d EQ band %d type set to: %s\n",
strip.Index.Index,
*stripEq.Band.Band,
*cmd.Type,
)
return nil
}
@@ -584,7 +695,12 @@ func (cmd *StripCompThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error
if err := ctx.Client.Strip.Comp.SetThreshold(strip.Index.Index, *cmd.Threshold); err != nil {
return fmt.Errorf("failed to set compressor threshold: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor threshold set to: %.2f\n", strip.Index.Index, *cmd.Threshold)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor threshold set to: %.2f\n",
strip.Index.Index,
*cmd.Threshold,
)
return nil
}
@@ -653,7 +769,12 @@ func (cmd *StripCompMakeupCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetMakeup(strip.Index.Index, *cmd.Makeup); err != nil {
return fmt.Errorf("failed to set compressor makeup gain: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor makeup gain set to: %.2f\n", strip.Index.Index, *cmd.Makeup)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor makeup gain set to: %.2f\n",
strip.Index.Index,
*cmd.Makeup,
)
return nil
}
@@ -676,7 +797,12 @@ func (cmd *StripCompAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetAttack(strip.Index.Index, *cmd.Attack); err != nil {
return fmt.Errorf("failed to set compressor attack time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor attack time set to: %.2f ms\n", strip.Index.Index, *cmd.Attack)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor attack time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Attack,
)
return nil
}
@@ -699,7 +825,12 @@ func (cmd *StripCompHoldCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetHold(strip.Index.Index, *cmd.Hold); err != nil {
return fmt.Errorf("failed to set compressor hold time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor hold time set to: %.2f ms\n", strip.Index.Index, *cmd.Hold)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor hold time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Hold,
)
return nil
}
@@ -722,6 +853,11 @@ func (cmd *StripCompReleaseCmd) Run(ctx *context, strip *StripCmdGroup) error {
if err := ctx.Client.Strip.Comp.SetRelease(strip.Index.Index, *cmd.Release); err != nil {
return fmt.Errorf("failed to set compressor release time: %w", err)
}
fmt.Fprintf(ctx.Out, "Strip %d compressor release time set to: %.2f ms\n", strip.Index.Index, *cmd.Release)
fmt.Fprintf(
ctx.Out,
"Strip %d compressor release time set to: %.2f ms\n",
strip.Index.Index,
*cmd.Release,
)
return nil
}