mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-02-26 00:09:11 +00:00
add docstrings
upd help messages
This commit is contained in:
parent
c20aa82e3b
commit
2ad9f2fd6a
80
bus.go
80
bus.go
@ -7,6 +7,7 @@ import (
|
||||
"github.com/alecthomas/kong"
|
||||
)
|
||||
|
||||
// BusCmdGroup defines the commands related to controlling the buses of the X-Air device.
|
||||
type BusCmdGroup struct {
|
||||
Index struct {
|
||||
Index int `arg:"" help:"The index of the bus. (1-based indexing)"`
|
||||
@ -18,13 +19,15 @@ type BusCmdGroup struct {
|
||||
|
||||
Eq BusEqCmdGroup ` help:"Commands related to the bus EQ." cmd:"eq"`
|
||||
Comp BusCompCmdGroup ` help:"Commands related to the bus compressor." cmd:"comp"`
|
||||
} `arg:"" help:"The index of the bus."`
|
||||
} `arg:"" help:"Control a specific bus by index."`
|
||||
}
|
||||
|
||||
// BusMuteCmd defines the command for getting or setting the mute state of a bus.
|
||||
type BusMuteCmd struct {
|
||||
State *string `arg:"" help:"The mute state to set (true or false). If not provided, the current mute state will be returned." optional:"" enum:"true,false"`
|
||||
}
|
||||
|
||||
// Run executes the BusMuteCmd command, either retrieving the current mute state or setting it based on the provided argument.
|
||||
func (cmd *BusMuteCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.State == nil {
|
||||
resp, err := ctx.Client.Bus.Mute(bus.Index.Index)
|
||||
@ -42,10 +45,12 @@ func (cmd *BusMuteCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusFaderCmd defines the command for getting or setting the fader level of a bus.
|
||||
type BusFaderCmd struct {
|
||||
Level *float64 `arg:"" help:"The fader level to set (in dB). If not provided, the current fader level will be returned."`
|
||||
Level *float64 `arg:"" help:"The fader level to set (in dB). If not provided, the current fader level will be returned." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the BusFaderCmd command, either retrieving the current fader level or setting it based on the provided argument.
|
||||
func (cmd *BusFaderCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Level == nil {
|
||||
resp, err := ctx.Client.Bus.Fader(bus.Index.Index)
|
||||
@ -63,11 +68,13 @@ func (cmd *BusFaderCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusFadeinCmd defines the command for fading in a bus over a specified duration to a target fader level.
|
||||
type BusFadeinCmd struct {
|
||||
Duration time.Duration `flag:"" help:"The duration of the fade-in effect." default:"5s"`
|
||||
Target float64 ` help:"The target fader level (in dB)." default:"0.0" arg:""`
|
||||
}
|
||||
|
||||
// Run executes the BusFadeinCmd command, gradually increasing the fader level of the bus from its current level to the target level over the specified duration.
|
||||
func (cmd *BusFadeinCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
currentLevel, err := ctx.Client.Bus.Fader(bus.Index.Index)
|
||||
if err != nil {
|
||||
@ -100,11 +107,13 @@ func (cmd *BusFadeinCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusFadeoutCmd defines the command for fading out a bus over a specified duration to a target fader level.
|
||||
type BusFadeoutCmd struct {
|
||||
Duration time.Duration `flag:"" help:"The duration of the fade-out effect." default:"5s"`
|
||||
Target float64 ` help:"The target fader level (in dB)." default:"-90.0" arg:""`
|
||||
}
|
||||
|
||||
// Run executes the BusFadeoutCmd command, gradually decreasing the fader level of the bus from its current level to the target level over the specified duration.
|
||||
func (cmd *BusFadeoutCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
currentLevel, err := ctx.Client.Bus.Fader(bus.Index.Index)
|
||||
if err != nil {
|
||||
@ -137,10 +146,12 @@ func (cmd *BusFadeoutCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusNameCmd defines the command for getting or setting the name of a bus.
|
||||
type BusNameCmd struct {
|
||||
Name *string `arg:"" help:"The name to set for the bus. If not provided, the current name will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusNameCmd command, either retrieving the current name of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusNameCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Name == nil {
|
||||
resp, err := ctx.Client.Bus.Name(bus.Index.Index)
|
||||
@ -158,18 +169,20 @@ func (cmd *BusNameCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusEqCmdGroup defines the commands related to controlling the EQ of a bus.
|
||||
type BusEqCmdGroup struct {
|
||||
On BusEqOnCmd `help:"Get or set the EQ on/off state of the bus." cmd:"on"`
|
||||
Mode BusEqModeCmd `help:"Get or set the EQ mode of the bus (graphic or parametric)." cmd:"mode"`
|
||||
On BusEqOnCmd `help:"Get or set the EQ on/off state of the bus." cmd:"on"`
|
||||
Mode BusEqModeCmd `help:"Get or set the EQ mode of the bus (peq, geq or teq)." cmd:"mode"`
|
||||
Band struct {
|
||||
Band int `arg:"" help:"The EQ band number."`
|
||||
Gain BusEqBandGainCmd `help:"Get or set the gain of the EQ band." cmd:"gain"`
|
||||
Freq BusEqBandFreqCmd `help:"Get or set the frequency of the EQ band." cmd:"freq"`
|
||||
Q BusEqBandQCmd `help:"Get or set the Q factor of the EQ band." cmd:"q"`
|
||||
Type BusEqBandTypeCmd `help:"Get or set the type of the EQ band (bell, high shelf, low shelf, high pass, low pass)." cmd:"type"`
|
||||
} `help:"Commands for controlling a specific EQ band of the bus." arg:""`
|
||||
Type BusEqBandTypeCmd `help:"Get or set the type of the EQ band (lcut, lshv, peq, veq, hshv, hcut)." cmd:"type"`
|
||||
} `help:"Commands for controlling a specific EQ band of the bus." arg:""`
|
||||
}
|
||||
|
||||
// Validate checks that the provided EQ band number is within the valid range (1-6).
|
||||
func (cmd *BusEqCmdGroup) Validate(ctx kong.Context) error {
|
||||
if cmd.Band.Band < 1 || cmd.Band.Band > 6 {
|
||||
return fmt.Errorf("EQ band number must be between 1 and 6")
|
||||
@ -177,10 +190,12 @@ func (cmd *BusEqCmdGroup) Validate(ctx kong.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompCmdGroup defines the commands related to controlling the compressor of a bus.
|
||||
type BusEqOnCmd struct {
|
||||
State *string `arg:"" help:"The EQ on/off state to set (true or false). If not provided, the current EQ state will be returned." optional:"" enum:"true,false"`
|
||||
}
|
||||
|
||||
// Run executes the BusEqOnCmd command, either retrieving the current EQ on/off state of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusEqOnCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.State == nil {
|
||||
resp, err := ctx.Client.Bus.Eq.On(bus.Index.Index)
|
||||
@ -198,10 +213,12 @@ func (cmd *BusEqOnCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusEqModeCmd defines the command for getting or setting the EQ mode of a bus.
|
||||
type BusEqModeCmd struct {
|
||||
Mode *string `arg:"" help:"The EQ mode to set (graphic or parametric). If not provided, the current EQ mode will be returned." optional:"" enum:"peq,geq,teq"`
|
||||
Mode *string `arg:"" help:"The EQ mode to set (peq, geq or teq). If not provided, the current EQ mode will be returned." optional:"" enum:"peq,geq,teq"`
|
||||
}
|
||||
|
||||
// Run executes the BusEqModeCmd command, either retrieving the current EQ mode of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusEqModeCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Mode == nil {
|
||||
resp, err := ctx.Client.Bus.Eq.Mode(bus.Index.Index)
|
||||
@ -219,10 +236,12 @@ func (cmd *BusEqModeCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusEqBandGainCmd defines the command for getting or setting the gain of a specific EQ band of a bus.
|
||||
type BusEqBandGainCmd struct {
|
||||
Gain *float64 `arg:"" help:"The gain to set for the EQ band (in dB). If not provided, the current gain will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusEqBandGainCmd command, either retrieving the current gain of the specified EQ band of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusEqBandGainCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmdGroup) error {
|
||||
if cmd.Gain == nil {
|
||||
resp, err := ctx.Client.Bus.Eq.Gain(bus.Index.Index, busEq.Band.Band)
|
||||
@ -240,10 +259,12 @@ func (cmd *BusEqBandGainCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusEqBandFreqCmd defines the command for getting or setting the frequency of a specific EQ band of a bus.
|
||||
type BusEqBandFreqCmd struct {
|
||||
Freq *float64 `arg:"" help:"The frequency to set for the EQ band (in Hz). If not provided, the current frequency will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusEqBandFreqCmd command, either retrieving the current frequency of the specified EQ band of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusEqBandFreqCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmdGroup) error {
|
||||
if cmd.Freq == nil {
|
||||
resp, err := ctx.Client.Bus.Eq.Frequency(bus.Index.Index, busEq.Band.Band)
|
||||
@ -261,10 +282,12 @@ func (cmd *BusEqBandFreqCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusEqBandQCmd defines the command for getting or setting the Q factor of a specific EQ band of a bus.
|
||||
type BusEqBandQCmd struct {
|
||||
Q *float64 `arg:"" help:"The Q factor to set for the EQ band. If not provided, the current Q factor will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusEqBandQCmd command, either retrieving the current Q factor of the specified EQ band of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusEqBandQCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmdGroup) error {
|
||||
if cmd.Q == nil {
|
||||
resp, err := ctx.Client.Bus.Eq.Q(bus.Index.Index, busEq.Band.Band)
|
||||
@ -282,10 +305,12 @@ func (cmd *BusEqBandQCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmdGro
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusEqBandTypeCmd defines the command for getting or setting the type of a specific EQ band of a bus.
|
||||
type BusEqBandTypeCmd struct {
|
||||
Type *string `arg:"" help:"The type to set for the EQ band (bell, high shelf, low shelf, high pass, low pass). If not provided, the current type will be returned." optional:"" enum:"lcut,lshv,peq,veq,hshv,hcut"`
|
||||
Type *string `arg:"" help:"The type to set for the EQ band (lcut, lshv, peq, veq, hshv, hcut). If not provided, the current type will be returned." optional:"" enum:"lcut,lshv,peq,veq,hshv,hcut"`
|
||||
}
|
||||
|
||||
// Run executes the BusEqBandTypeCmd command, either retrieving the current type of the specified EQ band of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusEqBandTypeCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmdGroup) error {
|
||||
if cmd.Type == nil {
|
||||
resp, err := ctx.Client.Bus.Eq.Type(bus.Index.Index, busEq.Band.Band)
|
||||
@ -303,22 +328,25 @@ func (cmd *BusEqBandTypeCmd) Run(ctx *context, bus *BusCmdGroup, busEq *BusEqCmd
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompCmdGroup defines the commands related to controlling the compressor of a bus.
|
||||
type BusCompCmdGroup struct {
|
||||
On BusCompOnCmd `help:"Get or set the compressor on/off state of the bus." cmd:"on"`
|
||||
Mode BusCompModeCmd `help:"Get or set the compressor mode of the bus (standard, vintage, or modern)." cmd:"mode"`
|
||||
Threshold BusCompThresholdCmd `help:"Get or set the compressor threshold of the bus (in dB)." cmd:"threshold"`
|
||||
Ratio BusCompRatioCmd `help:"Get or set the compressor ratio of the bus." cmd:"ratio"`
|
||||
Mix BusCompMixCmd `help:"Get or set the compressor mix level of the bus (in %)." cmd:"mix"`
|
||||
Makeup BusCompMakeupCmd `help:"Get or set the compressor makeup gain of the bus (in dB)." cmd:"makeup"`
|
||||
Attack BusCompAttackCmd `help:"Get or set the compressor attack time of the bus (in ms)." cmd:"attack"`
|
||||
Hold BusCompHoldCmd `help:"Get or set the compressor hold time of the bus (in ms)." cmd:"hold"`
|
||||
Release BusCompReleaseCmd `help:"Get or set the compressor release time of the bus (in ms)." cmd:"release"`
|
||||
On BusCompOnCmd `help:"Get or set the compressor on/off state of the bus." cmd:"on"`
|
||||
Mode BusCompModeCmd `help:"Get or set the compressor mode of the bus (comp, exp)." cmd:"mode"`
|
||||
Threshold BusCompThresholdCmd `help:"Get or set the compressor threshold of the bus (in dB)." cmd:"threshold"`
|
||||
Ratio BusCompRatioCmd `help:"Get or set the compressor ratio of the bus." cmd:"ratio"`
|
||||
Mix BusCompMixCmd `help:"Get or set the compressor mix level of the bus (in %)." cmd:"mix"`
|
||||
Makeup BusCompMakeupCmd `help:"Get or set the compressor makeup gain of the bus (in dB)." cmd:"makeup"`
|
||||
Attack BusCompAttackCmd `help:"Get or set the compressor attack time of the bus (in ms)." cmd:"attack"`
|
||||
Hold BusCompHoldCmd `help:"Get or set the compressor hold time of the bus (in ms)." cmd:"hold"`
|
||||
Release BusCompReleaseCmd `help:"Get or set the compressor release time of the bus (in ms)." cmd:"release"`
|
||||
}
|
||||
|
||||
// BusCompOnCmd defines the command for getting or setting the compressor on/off state of a bus.
|
||||
type BusCompOnCmd struct {
|
||||
State *string `arg:"" help:"The compressor on/off state to set (true or false). If not provided, the current compressor state will be returned." optional:"" enum:"true,false"`
|
||||
}
|
||||
|
||||
// Run executes the BusCompOnCmd command, either retrieving the current compressor on/off state of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompOnCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.State == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.On(bus.Index.Index)
|
||||
@ -336,10 +364,12 @@ func (cmd *BusCompOnCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompModeCmd defines the command for getting or setting the compressor mode of a bus.
|
||||
type BusCompModeCmd struct {
|
||||
Mode *string `arg:"" help:"The compressor mode to set (standard, vintage, or modern). If not provided, the current compressor mode will be returned." optional:"" enum:"comp,exp"`
|
||||
Mode *string `arg:"" help:"The compressor mode to set (comp, exp). If not provided, the current compressor mode will be returned." optional:"" enum:"comp,exp"`
|
||||
}
|
||||
|
||||
// Run executes the BusCompModeCmd command, either retrieving the current compressor mode of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompModeCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Mode == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Mode(bus.Index.Index)
|
||||
@ -357,10 +387,12 @@ func (cmd *BusCompModeCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompThresholdCmd defines the command for getting or setting the compressor threshold of a bus.
|
||||
type BusCompThresholdCmd struct {
|
||||
Threshold *float64 `arg:"" help:"The compressor threshold to set (in dB). If not provided, the current compressor threshold will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusCompThresholdCmd command, either retrieving the current compressor threshold of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompThresholdCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Threshold == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Threshold(bus.Index.Index)
|
||||
@ -378,10 +410,12 @@ func (cmd *BusCompThresholdCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompRatioCmd defines the command for getting or setting the compressor ratio of a bus.
|
||||
type BusCompRatioCmd struct {
|
||||
Ratio *float64 `arg:"" help:"The compressor ratio to set. If not provided, the current compressor ratio will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusCompRatioCmd command, either retrieving the current compressor ratio of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompRatioCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Ratio == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Ratio(bus.Index.Index)
|
||||
@ -399,10 +433,12 @@ func (cmd *BusCompRatioCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompMixCmd defines the command for getting or setting the compressor mix level of a bus.
|
||||
type BusCompMixCmd struct {
|
||||
Mix *float64 `arg:"" help:"The compressor mix level to set (in %). If not provided, the current compressor mix level will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusCompMixCmd command, either retrieving the current compressor mix level of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompMixCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Mix == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Mix(bus.Index.Index)
|
||||
@ -420,10 +456,12 @@ func (cmd *BusCompMixCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompMakeupCmd defines the command for getting or setting the compressor makeup gain of a bus.
|
||||
type BusCompMakeupCmd struct {
|
||||
Makeup *float64 `arg:"" help:"The compressor makeup gain to set (in dB). If not provided, the current compressor makeup gain will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusCompMakeupCmd command, either retrieving the current compressor makeup gain of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompMakeupCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Makeup == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Makeup(bus.Index.Index)
|
||||
@ -441,10 +479,12 @@ func (cmd *BusCompMakeupCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompAttackCmd defines the command for getting or setting the compressor attack time of a bus.
|
||||
type BusCompAttackCmd struct {
|
||||
Attack *float64 `arg:"" help:"The compressor attack time to set (in ms). If not provided, the current compressor attack time will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusCompAttackCmd command, either retrieving the current compressor attack time of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompAttackCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Attack == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Attack(bus.Index.Index)
|
||||
@ -462,10 +502,12 @@ func (cmd *BusCompAttackCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompHoldCmd defines the command for getting or setting the compressor hold time of a bus.
|
||||
type BusCompHoldCmd struct {
|
||||
Hold *float64 `arg:"" help:"The compressor hold time to set (in ms). If not provided, the current compressor hold time will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusCompHoldCmd command, either retrieving the current compressor hold time of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompHoldCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Hold == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Hold(bus.Index.Index)
|
||||
@ -483,10 +525,12 @@ func (cmd *BusCompHoldCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BusCompReleaseCmd defines the command for getting or setting the compressor release time of a bus.
|
||||
type BusCompReleaseCmd struct {
|
||||
Release *float64 `arg:"" help:"The compressor release time to set (in ms). If not provided, the current compressor release time will be returned."`
|
||||
}
|
||||
|
||||
// Run executes the BusCompReleaseCmd command, either retrieving the current compressor release time of the bus or setting it based on the provided argument.
|
||||
func (cmd *BusCompReleaseCmd) Run(ctx *context, bus *BusCmdGroup) error {
|
||||
if cmd.Release == nil {
|
||||
resp, err := ctx.Client.Bus.Comp.Release(bus.Index.Index)
|
||||
|
||||
@ -7,6 +7,7 @@ import (
|
||||
"github.com/charmbracelet/log"
|
||||
)
|
||||
|
||||
// HeadampCmdGroup defines the command group for controlling input gain and phantom power of a headamp, allowing users to specify the index of the headamp they want to control.
|
||||
type HeadampCmdGroup struct {
|
||||
Index struct {
|
||||
Index int `arg:"" help:"The index of the headamp."`
|
||||
@ -15,11 +16,13 @@ type HeadampCmdGroup struct {
|
||||
} `arg:"" help:"Control a specific headamp by index."`
|
||||
}
|
||||
|
||||
// HeadampGainCmd defines the command for getting or setting the gain of a headamp, allowing users to specify the gain in dB and an optional duration for a gradual fade when setting the gain.
|
||||
type HeadampGainCmd struct {
|
||||
Duration time.Duration `help:"The duration of the fade in/out when setting the gain." default:"5s"`
|
||||
Gain *float64 `help:"The gain of the headamp in dB." arg:""`
|
||||
}
|
||||
|
||||
// Run executes the HeadampGainCmd command, either retrieving the current gain of the headamp or setting it based on the provided argument, with an optional fade duration for smooth transitions.
|
||||
func (cmd *HeadampGainCmd) Run(ctx *context, headamp *HeadampCmdGroup) error {
|
||||
if cmd.Gain == nil {
|
||||
resp, err := ctx.Client.HeadAmp.Gain(headamp.Index.Index)
|
||||
@ -88,10 +91,12 @@ func gradualGainAdjust(
|
||||
return nil
|
||||
}
|
||||
|
||||
// HeadampPhantomCmd defines the command for getting or setting the phantom power state of a headamp, allowing users to specify the desired state as "true"/"on" or "false"/"off".
|
||||
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".
|
||||
func (cmd *HeadampPhantomCmd) Validate() error {
|
||||
if cmd.State != nil {
|
||||
switch *cmd.State {
|
||||
@ -106,6 +111,7 @@ func (cmd *HeadampPhantomCmd) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Run executes the HeadampPhantomCmd command, either retrieving the current phantom power state of the headamp or setting it based on the provided argument.
|
||||
func (cmd *HeadampPhantomCmd) Run(ctx *context, headamp *HeadampCmdGroup) error {
|
||||
if cmd.State == nil {
|
||||
resp, err := ctx.Client.HeadAmp.PhantomPower(headamp.Index.Index)
|
||||
|
||||
9
lr.go
9
lr.go
@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// MainCmdGroup defines the command group for controlling the Main L/R output, including commands for mute state, fader level, and fade-in/fade-out times.
|
||||
type MainCmdGroup struct {
|
||||
Mute MainMuteCmd `help:"Get or set the mute state of the Main L/R output." cmd:""`
|
||||
|
||||
@ -13,10 +14,12 @@ type MainCmdGroup struct {
|
||||
Fadeout MainFadeoutCmd `help:"Get or set the fade-out time of the Main L/R output." cmd:""`
|
||||
}
|
||||
|
||||
// MainMuteCmd defines the command for getting or setting the mute state of the Main L/R output, allowing users to specify the desired state as "true"/"on" or "false"/"off".
|
||||
type MainMuteCmd struct {
|
||||
Mute *bool `arg:"" help:"The mute state to set. If not provided, the current state will be printed."`
|
||||
}
|
||||
|
||||
// Run executes the MainMuteCmd command, either retrieving the current mute state of the Main L/R output or setting it based on the provided argument.
|
||||
func (cmd *MainMuteCmd) Run(ctx *context) error {
|
||||
if cmd.Mute == nil {
|
||||
resp, err := ctx.Client.Main.Mute()
|
||||
@ -34,10 +37,12 @@ func (cmd *MainMuteCmd) Run(ctx *context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MainFaderCmd defines the command for getting or setting the fader level of the Main L/R output, allowing users to specify the desired level in dB.
|
||||
type MainFaderCmd struct {
|
||||
Level *float64 `arg:"" help:"The fader level to set. If not provided, the current level will be printed."`
|
||||
}
|
||||
|
||||
// Run executes the MainFaderCmd command, either retrieving the current fader level of the Main L/R output or setting it based on the provided argument.
|
||||
func (cmd *MainFaderCmd) Run(ctx *context) error {
|
||||
if cmd.Level == nil {
|
||||
resp, err := ctx.Client.Main.Fader()
|
||||
@ -55,11 +60,13 @@ func (cmd *MainFaderCmd) Run(ctx *context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MainFadeinCmd defines the command for getting or setting the fade-in time of the Main L/R output, allowing users to specify the desired duration for the fade-in effect.
|
||||
type MainFadeinCmd struct {
|
||||
Duration time.Duration `flag:"" help:"The duration of the fade-in. (in seconds.)" default:"5s"`
|
||||
Target float64 ` help:"The target level for the fade-in. If not provided, the current target level will be printed." default:"0.0" arg:""`
|
||||
}
|
||||
|
||||
// Run executes the MainFadeinCmd command, either retrieving the current fade-in time of the Main L/R output or setting it based on the provided argument, with an optional target level for the fade-in effect.
|
||||
func (cmd *MainFadeinCmd) Run(ctx *context) error {
|
||||
currentLevel, err := ctx.Client.Main.Fader()
|
||||
if err != nil {
|
||||
@ -87,11 +94,13 @@ func (cmd *MainFadeinCmd) Run(ctx *context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MainFadeoutCmd defines the command for getting or setting the fade-out time of the Main L/R output, allowing users to specify the desired duration for the fade-out effect and an optional target level to fade out to.
|
||||
type MainFadeoutCmd struct {
|
||||
Duration time.Duration `flag:"" help:"The duration of the fade-out. (in seconds.)" default:"5s"`
|
||||
Target float64 ` help:"The target level for the fade-out. If not provided, the current target level will be printed." default:"-90.0" arg:""`
|
||||
}
|
||||
|
||||
// Run executes the MainFadeoutCmd command, either retrieving the current fade-out time of the Main L/R output or setting it based on the provided argument, with an optional target level for the fade-out effect.
|
||||
func (cmd *MainFadeoutCmd) Run(ctx *context) error {
|
||||
currentLevel, err := ctx.Client.Main.Fader()
|
||||
if err != nil {
|
||||
|
||||
3
main.go
3
main.go
@ -37,6 +37,8 @@ type Config struct {
|
||||
Kind string `default:"xr18" help:"The kind of the X-Air device." env:"XAIR_CLI_KIND"`
|
||||
}
|
||||
|
||||
// CLI is the main struct for the command-line interface.
|
||||
// It embeds the Config struct for global configuration and defines the available commands and flags.
|
||||
type CLI struct {
|
||||
Config `embed:"" prefix:"" help:"The configuration for the CLI."`
|
||||
|
||||
@ -103,6 +105,7 @@ func run(ctx *kong.Context, config Config) error {
|
||||
return ctx.Run()
|
||||
}
|
||||
|
||||
// connect creates a new X-Air client based on the provided configuration.
|
||||
func connect(config Config) (*xair.Client, error) {
|
||||
client, err := xair.NewClient(config.Host, config.Port, xair.WithKind(config.Kind))
|
||||
if err != nil {
|
||||
|
||||
2
raw.go
2
raw.go
@ -5,12 +5,14 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// RawCmd represents the command to send raw OSC messages to the mixer.
|
||||
type RawCmd struct {
|
||||
Timeout time.Duration `help:"Timeout for the OSC message send operation." default:"200ms" short:"t"`
|
||||
Address string `help:"The OSC address to send the message to." arg:""`
|
||||
Args []string `help:"The arguments to include in the OSC message." arg:"" optional:""`
|
||||
}
|
||||
|
||||
// Run executes the RawCmd by sending the specified OSC message to the mixer and optionally waiting for a response.
|
||||
func (cmd *RawCmd) Run(ctx *context) error {
|
||||
params := make([]any, len(cmd.Args))
|
||||
for i, arg := range cmd.Args {
|
||||
|
||||
63
strip.go
63
strip.go
@ -7,6 +7,7 @@ import (
|
||||
"github.com/alecthomas/kong"
|
||||
)
|
||||
|
||||
// StripCmdGroup defines the command group for controlling the strips of the mixer, including commands for getting and setting various parameters such as mute state, fader level, send levels, and EQ settings.
|
||||
type StripCmdGroup struct {
|
||||
Index struct {
|
||||
Index int `arg:"" help:"The index of the strip. (1-based indexing)"`
|
||||
@ -20,13 +21,15 @@ type StripCmdGroup struct {
|
||||
Gate StripGateCmdGroup ` help:"Commands related to the strip gate." cmd:"gate"`
|
||||
Eq StripEqCmdGroup ` help:"Commands related to the strip EQ." cmd:"eq"`
|
||||
Comp StripCompCmdGroup ` help:"Commands related to the strip compressor." cmd:"comp"`
|
||||
} `arg:"" help:"The index of the strip."`
|
||||
} `arg:"" help:"Control a specific strip by index."`
|
||||
}
|
||||
|
||||
// StripMuteCmd defines the command for getting or setting the mute state of a strip.
|
||||
type StripMuteCmd struct {
|
||||
State *string `arg:"" help:"The mute state to set (true or false). If not provided, the current mute state will be returned." optional:"" enum:"true,false"`
|
||||
}
|
||||
|
||||
// Run executes the StripMuteCmd command, either retrieving the current mute state of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripMuteCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.State == nil {
|
||||
resp, err := ctx.Client.Strip.Mute(strip.Index.Index)
|
||||
@ -44,10 +47,12 @@ func (cmd *StripMuteCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripFaderCmd defines the command for getting or setting the fader level of a strip.
|
||||
type StripFaderCmd struct {
|
||||
Level *float64 `arg:"" help:"The fader level to set (in dB)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripFaderCmd command, either retrieving the current fader level of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripFaderCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Level == nil {
|
||||
resp, err := ctx.Client.Strip.Fader(strip.Index.Index)
|
||||
@ -65,11 +70,13 @@ func (cmd *StripFaderCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripFadeinCmd defines the command for fading in a strip over a specified duration, gradually increasing the fader level from its current value to a target value.
|
||||
type StripFadeinCmd struct {
|
||||
Duration time.Duration `flag:"" help:"The duration of the fade-in (in seconds)." default:"5s"`
|
||||
Target float64 ` help:"The target fader level (in dB)." default:"0.0" arg:""`
|
||||
}
|
||||
|
||||
// Run executes the StripFadeinCmd command, gradually increasing the fader level of the strip from its current value to the specified target value over the specified duration.
|
||||
func (cmd *StripFadeinCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
currentLevel, err := ctx.Client.Strip.Fader(strip.Index.Index)
|
||||
if err != nil {
|
||||
@ -98,11 +105,13 @@ func (cmd *StripFadeinCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripFadeoutCmd defines the command for fading out a strip over a specified duration, gradually decreasing the fader level from its current value to a target value.
|
||||
type StripFadeoutCmd struct {
|
||||
Duration time.Duration `flag:"" help:"The duration of the fade-out (in seconds)." default:"5s"`
|
||||
Target float64 ` help:"The target fader level (in dB)." default:"-90.0" arg:""`
|
||||
}
|
||||
|
||||
// Run executes the StripFadeoutCmd command, gradually decreasing the fader level of the strip from its current value to the specified target value over the specified duration.
|
||||
func (cmd *StripFadeoutCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
{
|
||||
currentLevel, err := ctx.Client.Strip.Fader(strip.Index.Index)
|
||||
@ -133,11 +142,13 @@ func (cmd *StripFadeoutCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
}
|
||||
}
|
||||
|
||||
// StripSendCmd defines the command for getting or setting the send level for a specific bus on a strip, allowing users to control the level of the signal being sent from the strip to a particular bus.
|
||||
type StripSendCmd struct {
|
||||
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:""`
|
||||
}
|
||||
|
||||
// Run executes the StripSendCmd command, either retrieving the current send level for the specified bus on the strip or setting it based on the provided argument.
|
||||
func (cmd *StripSendCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Level == nil {
|
||||
resp, err := ctx.Client.Strip.SendLevel(strip.Index.Index, cmd.BusNum)
|
||||
@ -155,10 +166,12 @@ 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.
|
||||
type StripNameCmd struct {
|
||||
Name *string `arg:"" help:"The name to set for the strip." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripNameCmd command, either retrieving the current name of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripNameCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Name == nil {
|
||||
resp, err := ctx.Client.Strip.Name(strip.Index.Index)
|
||||
@ -176,20 +189,23 @@ func (cmd *StripNameCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripGateCmdGroup defines the command group for controlling the gate settings of a strip, including commands for getting and setting the gate on/off state, mode, threshold, range, attack time, hold time, and release time.
|
||||
type StripGateCmdGroup struct {
|
||||
On StripGateOnCmd `help:"Get or set the gate on/off state of the strip." cmd:""`
|
||||
Mode StripGateModeCmd `help:"Get or set the gate mode of the strip." cmd:""`
|
||||
Threshold StripGateThresholdCmd `help:"Get or set the gate threshold of the strip." cmd:""`
|
||||
Range StripGateRangeCmd `help:"Get the gate range of the strip." cmd:""`
|
||||
Range StripGateRangeCmd `help:"Get or set the gate range of the strip." cmd:""`
|
||||
Attack StripGateAttackCmd `help:"Get or set the gate attack time of the strip." cmd:""`
|
||||
Hold StripGateHoldCmd `help:"Get or set the gate hold time of the strip." cmd:""`
|
||||
Release StripGateReleaseCmd `help:"Get or set the gate release time of the strip." cmd:""`
|
||||
}
|
||||
|
||||
// StripGateOnCmd defines the command for getting or setting the gate on/off state of a strip, allowing users to enable or disable the gate effect on the strip.
|
||||
type StripGateOnCmd struct {
|
||||
Enable *string `arg:"" help:"Whether to enable or disable the gate." optional:"" enum:"true,false"`
|
||||
}
|
||||
|
||||
// Run executes the StripGateOnCmd command, either retrieving the current gate on/off state of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripGateOnCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Enable == nil {
|
||||
resp, err := ctx.Client.Strip.Gate.On(strip.Index.Index)
|
||||
@ -207,10 +223,12 @@ func (cmd *StripGateOnCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripGateModeCmd defines the command for getting or setting the gate mode of a strip, allowing users to choose from different gate modes such as exp2, exp3, exp4, gate, or duck.
|
||||
type StripGateModeCmd struct {
|
||||
Mode *string `arg:"" help:"The gate mode to set." optional:"" enum:"exp2,exp3,exp4,gate,duck"`
|
||||
}
|
||||
|
||||
// Run executes the StripGateModeCmd command, either retrieving the current gate mode of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripGateModeCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Mode == nil {
|
||||
resp, err := ctx.Client.Strip.Gate.Mode(strip.Index.Index)
|
||||
@ -228,10 +246,12 @@ func (cmd *StripGateModeCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripGateThresholdCmd defines the command for getting or setting the gate threshold of a strip, allowing users to specify the threshold level at which the gate will start to attenuate the signal.
|
||||
type StripGateThresholdCmd struct {
|
||||
Threshold *float64 `arg:"" help:"The gate threshold to set (in dB)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripGateThresholdCmd command, either retrieving the current gate threshold of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripGateThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Threshold == nil {
|
||||
resp, err := ctx.Client.Strip.Gate.Threshold(strip.Index.Index)
|
||||
@ -249,10 +269,12 @@ func (cmd *StripGateThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripGateRangeCmd defines the command for getting or setting the gate range of a strip, allowing users to specify the amount of attenuation applied by the gate when the signal falls below the threshold.
|
||||
type StripGateRangeCmd struct {
|
||||
Range *float64 `arg:"" help:"The gate range to set (in dB)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripGateRangeCmd command, either retrieving the current gate range of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripGateRangeCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Range == nil {
|
||||
resp, err := ctx.Client.Strip.Gate.Range(strip.Index.Index)
|
||||
@ -270,10 +292,12 @@ func (cmd *StripGateRangeCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripGateAttackCmd defines the command for getting or setting the gate attack time of a strip, allowing users to specify the time it takes for the gate to fully open after the signal exceeds the threshold.
|
||||
type StripGateAttackCmd struct {
|
||||
Attack *float64 `arg:"" help:"The gate attack time to set (in ms)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripGateAttackCmd command, either retrieving the current gate attack time of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripGateAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Attack == nil {
|
||||
resp, err := ctx.Client.Strip.Gate.Attack(strip.Index.Index)
|
||||
@ -291,10 +315,12 @@ func (cmd *StripGateAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripGateHoldCmd defines the command for getting or setting the gate hold time of a strip, allowing users to specify the time that the gate remains open after the signal falls below the threshold before it starts to close.
|
||||
type StripGateHoldCmd struct {
|
||||
Hold *float64 `arg:"" help:"The gate hold time to set (in ms)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripGateHoldCmd command, either retrieving the current gate hold time of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripGateHoldCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Hold == nil {
|
||||
resp, err := ctx.Client.Strip.Gate.Hold(strip.Index.Index)
|
||||
@ -312,10 +338,12 @@ func (cmd *StripGateHoldCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripGateReleaseCmd defines the command for getting or setting the gate release time of a strip, allowing users to specify the time it takes for the gate to fully close after the signal falls below the threshold and the hold time has elapsed.
|
||||
type StripGateReleaseCmd struct {
|
||||
Release *float64 `arg:"" help:"The gate release time to set (in ms)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripGateReleaseCmd command, either retrieving the current gate release time of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripGateReleaseCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Release == nil {
|
||||
resp, err := ctx.Client.Strip.Gate.Release(strip.Index.Index)
|
||||
@ -333,6 +361,7 @@ func (cmd *StripGateReleaseCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripEqCmdGroup defines the command group for controlling the EQ settings of a strip, including commands for getting and setting the EQ on/off state and parameters for each EQ band such as gain, frequency, Q factor, and type.
|
||||
type StripEqCmdGroup struct {
|
||||
On StripEqOnCmd `help:"Get or set the EQ on/off state of the strip." cmd:""`
|
||||
Band struct {
|
||||
@ -344,6 +373,7 @@ type StripEqCmdGroup struct {
|
||||
} `help:"Commands for controlling a specific EQ band of the strip." arg:""`
|
||||
}
|
||||
|
||||
// Validate checks if the provided EQ band number is valid (between 1 and 4) and returns an error if it is not.
|
||||
func (cmd *StripEqCmdGroup) Validate(ctx kong.Context) error {
|
||||
if cmd.Band.Band < 1 || cmd.Band.Band > 4 {
|
||||
return fmt.Errorf("EQ band number must be between 1 and 4")
|
||||
@ -351,10 +381,12 @@ func (cmd *StripEqCmdGroup) Validate(ctx kong.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripEqOnCmd defines the command for getting or setting the EQ on/off state of a strip, allowing users to enable or disable the EQ effect on the strip.
|
||||
type StripEqOnCmd struct {
|
||||
Enable *string `arg:"" help:"Whether to enable or disable the EQ." optional:"" enum:"true,false"`
|
||||
}
|
||||
|
||||
// Run executes the StripEqOnCmd command, either retrieving the current EQ on/off state of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripEqOnCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Enable == nil {
|
||||
resp, err := ctx.Client.Strip.Eq.On(strip.Index.Index)
|
||||
@ -372,10 +404,12 @@ func (cmd *StripEqOnCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripEqBandGainCmd defines the command for getting or setting the gain of a specific EQ band on a strip, allowing users to adjust the level of the signal for that band in decibels (dB).
|
||||
type StripEqBandGainCmd struct {
|
||||
Gain *float64 `arg:"" help:"The gain to set for the EQ band (in dB)." optional:""`
|
||||
}
|
||||
|
||||
// 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 {
|
||||
if cmd.Gain == nil {
|
||||
resp, err := ctx.Client.Strip.Eq.Gain(strip.Index.Index, stripEq.Band.Band)
|
||||
@ -393,10 +427,12 @@ func (cmd *StripEqBandGainCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *
|
||||
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).
|
||||
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 {
|
||||
if cmd.Freq == nil {
|
||||
resp, err := ctx.Client.Strip.Eq.Frequency(strip.Index.Index, stripEq.Band.Band)
|
||||
@ -420,10 +456,12 @@ func (cmd *StripEqBandFreqCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripEqBandQCmd defines the command for getting or setting the Q factor of a specific EQ band on a strip, allowing users to adjust the bandwidth of the band, which determines how wide or narrow the affected frequency range is.
|
||||
type StripEqBandQCmd struct {
|
||||
Q *float64 `arg:"" help:"The Q factor to set for the EQ band." optional:""`
|
||||
}
|
||||
|
||||
// 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 {
|
||||
if cmd.Q == nil {
|
||||
resp, err := ctx.Client.Strip.Eq.Q(strip.Index.Index, stripEq.Band.Band)
|
||||
@ -441,10 +479,12 @@ func (cmd *StripEqBandQCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *Str
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripEqBandTypeCmd defines the command for getting or setting the type of a specific EQ band on a strip, allowing users to choose from different EQ types such as low cut (lcut), low shelf (lshv), parametric (peq), variable Q (veq), high shelf (hshv), or high cut (hcut).
|
||||
type StripEqBandTypeCmd struct {
|
||||
Type *string `arg:"" help:"The type to set for the EQ band." optional:"" enum:"lcut,lshv,peq,veq,hshv,hcut"`
|
||||
}
|
||||
|
||||
// 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 {
|
||||
if cmd.Type == nil {
|
||||
resp, err := ctx.Client.Strip.Eq.Type(strip.Index.Index, stripEq.Band.Band)
|
||||
@ -462,6 +502,7 @@ func (cmd *StripEqBandTypeCmd) Run(ctx *context, strip *StripCmdGroup, stripEq *
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompCmdGroup defines the command group for controlling the compressor settings of a strip, including commands for getting and setting the compressor on/off state, mode, threshold, ratio, mix, makeup gain, attack time, hold time, and release time.
|
||||
type StripCompCmdGroup struct {
|
||||
On StripCompOnCmd `help:"Get or set the compressor on/off state of the strip." cmd:""`
|
||||
Mode StripCompModeCmd `help:"Get or set the compressor mode of the strip." cmd:""`
|
||||
@ -474,10 +515,12 @@ type StripCompCmdGroup struct {
|
||||
Release StripCompReleaseCmd `help:"Get or set the compressor release time of the strip." cmd:""`
|
||||
}
|
||||
|
||||
// StripCompOnCmd defines the command for getting or setting the compressor on/off state of a strip, allowing users to enable or disable the compressor effect on the strip.
|
||||
type StripCompOnCmd struct {
|
||||
Enable *string `arg:"" help:"Whether to enable or disable the compressor." optional:"" enum:"true,false"`
|
||||
}
|
||||
|
||||
// Run executes the StripCompOnCmd command, either retrieving the current compressor on/off state of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompOnCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Enable == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.On(strip.Index.Index)
|
||||
@ -495,10 +538,12 @@ func (cmd *StripCompOnCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompModeCmd defines the command for getting or setting the compressor mode of a strip, allowing users to choose from different compressor modes such as comp (standard compression) or exp (expander).
|
||||
type StripCompModeCmd struct {
|
||||
Mode *string `arg:"" help:"The compressor mode to set." optional:"" enum:"comp,exp"`
|
||||
}
|
||||
|
||||
// Run executes the StripCompModeCmd command, either retrieving the current compressor mode of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompModeCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Mode == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Mode(strip.Index.Index)
|
||||
@ -516,10 +561,12 @@ func (cmd *StripCompModeCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompThresholdCmd defines the command for getting or setting the compressor threshold of a strip, allowing users to specify the threshold level at which the compressor will start to reduce the signal level.
|
||||
type StripCompThresholdCmd struct {
|
||||
Threshold *float64 `arg:"" help:"The compressor threshold to set (in dB)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripCompThresholdCmd command, either retrieving the current compressor threshold of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Threshold == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Threshold(strip.Index.Index)
|
||||
@ -537,10 +584,12 @@ func (cmd *StripCompThresholdCmd) Run(ctx *context, strip *StripCmdGroup) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompRatioCmd defines the command for getting or setting the compressor ratio of a strip, allowing users to specify the amount of gain reduction applied by the compressor once the signal exceeds the threshold.
|
||||
type StripCompRatioCmd struct {
|
||||
Ratio *float64 `arg:"" help:"The compressor ratio to set." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripCompRatioCmd command, either retrieving the current compressor ratio of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompRatioCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Ratio == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Ratio(strip.Index.Index)
|
||||
@ -558,10 +607,12 @@ func (cmd *StripCompRatioCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompMixCmd defines the command for getting or setting the compressor mix of a strip, allowing users to specify the blend between the dry (unprocessed) signal and the wet (compressed) signal, typically expressed as a percentage.
|
||||
type StripCompMixCmd struct {
|
||||
Mix *float64 `arg:"" help:"The compressor mix to set (0-100%)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripCompMixCmd command, either retrieving the current compressor mix of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompMixCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Mix == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Mix(strip.Index.Index)
|
||||
@ -579,10 +630,12 @@ func (cmd *StripCompMixCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompMakeupCmd defines the command for getting or setting the compressor makeup gain of a strip, allowing users to specify the amount of gain applied to the signal after compression to compensate for any reduction in level caused by the compressor.
|
||||
type StripCompMakeupCmd struct {
|
||||
Makeup *float64 `arg:"" help:"The compressor makeup gain to set (in dB)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripCompMakeupCmd command, either retrieving the current compressor makeup gain of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompMakeupCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Makeup == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Makeup(strip.Index.Index)
|
||||
@ -600,10 +653,12 @@ func (cmd *StripCompMakeupCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompAttackCmd defines the command for getting or setting the compressor attack time of a strip, allowing users to specify the time it takes for the compressor to start reducing the signal level after the signal exceeds the threshold.
|
||||
type StripCompAttackCmd struct {
|
||||
Attack *float64 `arg:"" help:"The compressor attack time to set (in ms)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripCompAttackCmd command, either retrieving the current compressor attack time of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Attack == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Attack(strip.Index.Index)
|
||||
@ -621,10 +676,12 @@ func (cmd *StripCompAttackCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompHoldCmd defines the command for getting or setting the compressor hold time of a strip, allowing users to specify the time that the compressor continues to reduce the signal level after the signal falls below the threshold before it starts to release.
|
||||
type StripCompHoldCmd struct {
|
||||
Hold *float64 `arg:"" help:"The compressor hold time to set (in ms)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripCompHoldCmd command, either retrieving the current compressor hold time of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompHoldCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Hold == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Hold(strip.Index.Index)
|
||||
@ -642,10 +699,12 @@ func (cmd *StripCompHoldCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StripCompReleaseCmd defines the command for getting or setting the compressor release time of a strip, allowing users to specify the time it takes for the compressor to stop reducing the signal level after the signal falls below the threshold and the hold time has elapsed.
|
||||
type StripCompReleaseCmd struct {
|
||||
Release *float64 `arg:"" help:"The compressor release time to set (in ms)." optional:""`
|
||||
}
|
||||
|
||||
// Run executes the StripCompReleaseCmd command, either retrieving the current compressor release time of the strip or setting it based on the provided argument.
|
||||
func (cmd *StripCompReleaseCmd) Run(ctx *context, strip *StripCmdGroup) error {
|
||||
if cmd.Release == nil {
|
||||
resp, err := ctx.Client.Strip.Comp.Release(strip.Index.Index)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user