mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-04-09 02:13:35 +00:00
litn fixes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user