mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-02-26 00:09:11 +00:00
enable revive linter
- add package comments - fix redeclaration of built-in min/max - add comments to exported types - remove unused parameters
This commit is contained in:
parent
ac8f635263
commit
7a0d5c56e5
@ -6,8 +6,7 @@ run:
|
|||||||
go: '1.24'
|
go: '1.24'
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable:
|
disable: [dupl, errcheck, goconst, godot, staticcheck, unparam, predeclared]
|
||||||
[dupl, errcheck, goconst, godot, revive, staticcheck, unparam, predeclared]
|
|
||||||
enable:
|
enable:
|
||||||
# Default enabled linters
|
# Default enabled linters
|
||||||
- errcheck # Check for unchecked errors
|
- errcheck # Check for unchecked errors
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// Package main implements the command-line interface for controlling an X32 digital mixer.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -161,7 +162,7 @@ type MainEqOnCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqOnCmd command, either retrieving the current EQ on/off state of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqOnCmd command, either retrieving the current EQ on/off state of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqOnCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainEqOnCmd) Run(ctx *context) error {
|
||||||
if cmd.Enable == nil {
|
if cmd.Enable == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.On(0)
|
resp, err := ctx.Client.Main.Eq.On(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -184,7 +185,7 @@ type MainEqBandGainCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandGainCmd command, either retrieving the current gain of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandGainCmd command, either retrieving the current gain of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandGainCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandGainCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Level == nil {
|
if cmd.Level == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Gain(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Gain(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -212,7 +213,7 @@ type MainEqBandFreqCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandFreqCmd command, either retrieving the current frequency of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandFreqCmd command, either retrieving the current frequency of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandFreqCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandFreqCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Frequency == nil {
|
if cmd.Frequency == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Frequency(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Frequency(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -244,7 +245,7 @@ type MainEqBandQCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandQCmd command, either retrieving the current Q factor of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandQCmd command, either retrieving the current Q factor of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandQCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandQCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Q == nil {
|
if cmd.Q == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Q(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Q(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -271,7 +272,7 @@ type MainEqBandTypeCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandTypeCmd command, either retrieving the current type of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandTypeCmd command, either retrieving the current type of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandTypeCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandTypeCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Type == nil {
|
if cmd.Type == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Type(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Type(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -307,7 +308,7 @@ type MainCompOnCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompOnCmd command, either retrieving the current compressor on/off state of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompOnCmd command, either retrieving the current compressor on/off state of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompOnCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompOnCmd) Run(ctx *context) error {
|
||||||
if cmd.Enable == nil {
|
if cmd.Enable == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.On(0)
|
resp, err := ctx.Client.Main.Comp.On(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -330,7 +331,7 @@ type MainCompModeCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompModeCmd command, either retrieving the current compressor mode of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompModeCmd command, either retrieving the current compressor mode of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompModeCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompModeCmd) Run(ctx *context) error {
|
||||||
if cmd.Mode == nil {
|
if cmd.Mode == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Mode(0)
|
resp, err := ctx.Client.Main.Comp.Mode(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -353,7 +354,7 @@ type MainCompThresholdCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompThresholdCmd command, either retrieving the current compressor threshold of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompThresholdCmd command, either retrieving the current compressor threshold of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompThresholdCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompThresholdCmd) Run(ctx *context) error {
|
||||||
if cmd.Threshold == nil {
|
if cmd.Threshold == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Threshold(0)
|
resp, err := ctx.Client.Main.Comp.Threshold(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -376,7 +377,7 @@ type MainCompRatioCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompRatioCmd command, either retrieving the current compressor ratio of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompRatioCmd command, either retrieving the current compressor ratio of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompRatioCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompRatioCmd) Run(ctx *context) error {
|
||||||
if cmd.Ratio == nil {
|
if cmd.Ratio == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Ratio(0)
|
resp, err := ctx.Client.Main.Comp.Ratio(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -399,7 +400,7 @@ type MainCompMixCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompMixCmd command, either retrieving the current compressor mix level of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompMixCmd command, either retrieving the current compressor mix level of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompMixCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompMixCmd) Run(ctx *context) error {
|
||||||
if cmd.Mix == nil {
|
if cmd.Mix == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Mix(0)
|
resp, err := ctx.Client.Main.Comp.Mix(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -422,7 +423,7 @@ type MainCompMakeupCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompMakeupCmd command, either retrieving the current compressor makeup gain of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompMakeupCmd command, either retrieving the current compressor makeup gain of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompMakeupCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompMakeupCmd) Run(ctx *context) error {
|
||||||
if cmd.Makeup == nil {
|
if cmd.Makeup == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Makeup(0)
|
resp, err := ctx.Client.Main.Comp.Makeup(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -445,7 +446,7 @@ type MainCompAttackCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompAttackCmd command, either retrieving the current compressor attack time of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompAttackCmd command, either retrieving the current compressor attack time of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompAttackCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompAttackCmd) Run(ctx *context) error {
|
||||||
if cmd.Attack == nil {
|
if cmd.Attack == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Attack(0)
|
resp, err := ctx.Client.Main.Comp.Attack(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -468,7 +469,7 @@ type MainCompHoldCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompHoldCmd command, either retrieving the current compressor hold time of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompHoldCmd command, either retrieving the current compressor hold time of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompHoldCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompHoldCmd) Run(ctx *context) error {
|
||||||
if cmd.Hold == nil {
|
if cmd.Hold == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Hold(0)
|
resp, err := ctx.Client.Main.Comp.Hold(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -491,7 +492,7 @@ type MainCompReleaseCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompReleaseCmd command, either retrieving the current compressor release time of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompReleaseCmd command, either retrieving the current compressor release time of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompReleaseCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompReleaseCmd) Run(ctx *context) error {
|
||||||
if cmd.Release == nil {
|
if cmd.Release == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Release(0)
|
resp, err := ctx.Client.Main.Comp.Release(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -161,7 +161,7 @@ type MainMonoEqOnCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoEqOnCmd command, either retrieving the current EQ on/off state of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoEqOnCmd command, either retrieving the current EQ on/off state of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoEqOnCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoEqOnCmd) Run(ctx *context) error {
|
||||||
if cmd.Enable == nil {
|
if cmd.Enable == nil {
|
||||||
resp, err := ctx.Client.MainMono.Eq.On(0)
|
resp, err := ctx.Client.MainMono.Eq.On(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -186,7 +186,6 @@ 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.
|
// 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(
|
func (cmd *MainMonoEqBandGainCmd) Run(
|
||||||
ctx *context,
|
ctx *context,
|
||||||
main *MainCmdGroup,
|
|
||||||
mainEq *MainMonoEqCmdGroup,
|
mainEq *MainMonoEqCmdGroup,
|
||||||
) error {
|
) error {
|
||||||
if cmd.Level == nil {
|
if cmd.Level == nil {
|
||||||
@ -218,7 +217,6 @@ 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.
|
// 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(
|
func (cmd *MainMonoEqBandFreqCmd) Run(
|
||||||
ctx *context,
|
ctx *context,
|
||||||
main *MainCmdGroup,
|
|
||||||
mainEq *MainMonoEqCmdGroup,
|
mainEq *MainMonoEqCmdGroup,
|
||||||
) error {
|
) error {
|
||||||
if cmd.Frequency == nil {
|
if cmd.Frequency == nil {
|
||||||
@ -262,7 +260,6 @@ 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.
|
// 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(
|
func (cmd *MainMonoEqBandQCmd) Run(
|
||||||
ctx *context,
|
ctx *context,
|
||||||
main *MainCmdGroup,
|
|
||||||
mainEq *MainMonoEqCmdGroup,
|
mainEq *MainMonoEqCmdGroup,
|
||||||
) error {
|
) error {
|
||||||
if cmd.Q == nil {
|
if cmd.Q == nil {
|
||||||
@ -293,7 +290,6 @@ 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.
|
// 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(
|
func (cmd *MainMonoEqBandTypeCmd) Run(
|
||||||
ctx *context,
|
ctx *context,
|
||||||
main *MainCmdGroup,
|
|
||||||
mainEq *MainMonoEqCmdGroup,
|
mainEq *MainMonoEqCmdGroup,
|
||||||
) error {
|
) error {
|
||||||
if cmd.Type == nil {
|
if cmd.Type == nil {
|
||||||
@ -331,7 +327,7 @@ type MainMonoCompOnCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompOnCmd command, either retrieving the current compressor on/off state of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompOnCmd command, either retrieving the current compressor on/off state of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompOnCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompOnCmd) Run(ctx *context) error {
|
||||||
if cmd.Enable == nil {
|
if cmd.Enable == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.On(0)
|
resp, err := ctx.Client.MainMono.Comp.On(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -354,7 +350,7 @@ type MainMonoCompModeCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompModeCmd command, either retrieving the current compressor mode of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompModeCmd command, either retrieving the current compressor mode of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompModeCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompModeCmd) Run(ctx *context) error {
|
||||||
if cmd.Mode == nil {
|
if cmd.Mode == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Mode(0)
|
resp, err := ctx.Client.MainMono.Comp.Mode(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -377,7 +373,7 @@ type MainMonoCompThresholdCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompThresholdCmd command, either retrieving the current compressor threshold of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompThresholdCmd command, either retrieving the current compressor threshold of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompThresholdCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompThresholdCmd) Run(ctx *context) error {
|
||||||
if cmd.Threshold == nil {
|
if cmd.Threshold == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Threshold(0)
|
resp, err := ctx.Client.MainMono.Comp.Threshold(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -400,7 +396,7 @@ type MainMonoCompRatioCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompRatioCmd command, either retrieving the current compressor ratio of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompRatioCmd command, either retrieving the current compressor ratio of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompRatioCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompRatioCmd) Run(ctx *context) error {
|
||||||
if cmd.Ratio == nil {
|
if cmd.Ratio == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Ratio(0)
|
resp, err := ctx.Client.MainMono.Comp.Ratio(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -423,7 +419,7 @@ type MainMonoCompMixCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompMixCmd command, either retrieving the current compressor mix level of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompMixCmd command, either retrieving the current compressor mix level of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompMixCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompMixCmd) Run(ctx *context) error {
|
||||||
if cmd.Mix == nil {
|
if cmd.Mix == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Mix(0)
|
resp, err := ctx.Client.MainMono.Comp.Mix(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -446,7 +442,7 @@ type MainMonoCompMakeupCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompMakeupCmd command, either retrieving the current compressor makeup gain of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompMakeupCmd command, either retrieving the current compressor makeup gain of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompMakeupCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompMakeupCmd) Run(ctx *context) error {
|
||||||
if cmd.Makeup == nil {
|
if cmd.Makeup == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Makeup(0)
|
resp, err := ctx.Client.MainMono.Comp.Makeup(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -469,7 +465,7 @@ type MainMonoCompAttackCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompAttackCmd command, either retrieving the current compressor attack time of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompAttackCmd command, either retrieving the current compressor attack time of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompAttackCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompAttackCmd) Run(ctx *context) error {
|
||||||
if cmd.Attack == nil {
|
if cmd.Attack == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Attack(0)
|
resp, err := ctx.Client.MainMono.Comp.Attack(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -492,7 +488,7 @@ type MainMonoCompHoldCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompHoldCmd command, either retrieving the current compressor hold time of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompHoldCmd command, either retrieving the current compressor hold time of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompHoldCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompHoldCmd) Run(ctx *context) error {
|
||||||
if cmd.Hold == nil {
|
if cmd.Hold == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Hold(0)
|
resp, err := ctx.Client.MainMono.Comp.Hold(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -515,7 +511,7 @@ type MainMonoCompReleaseCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainMonoCompReleaseCmd command, either retrieving the current compressor release time of the Main Mono output or setting it based on the provided argument.
|
// Run executes the MainMonoCompReleaseCmd command, either retrieving the current compressor release time of the Main Mono output or setting it based on the provided argument.
|
||||||
func (cmd *MainMonoCompReleaseCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainMonoCompReleaseCmd) Run(ctx *context) error {
|
||||||
if cmd.Release == nil {
|
if cmd.Release == nil {
|
||||||
resp, err := ctx.Client.MainMono.Comp.Release(0)
|
resp, err := ctx.Client.MainMono.Comp.Release(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// Package main implements the command-line interface for controlling an XAir digital mixer.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -161,7 +162,7 @@ type MainEqOnCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqOnCmd command, either retrieving the current EQ on/off state of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqOnCmd command, either retrieving the current EQ on/off state of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqOnCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainEqOnCmd) Run(ctx *context) error {
|
||||||
if cmd.Enable == nil {
|
if cmd.Enable == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.On(0)
|
resp, err := ctx.Client.Main.Eq.On(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -184,7 +185,7 @@ type MainEqBandGainCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandGainCmd command, either retrieving the current gain of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandGainCmd command, either retrieving the current gain of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandGainCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandGainCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Level == nil {
|
if cmd.Level == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Gain(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Gain(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -212,7 +213,7 @@ type MainEqBandFreqCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandFreqCmd command, either retrieving the current frequency of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandFreqCmd command, either retrieving the current frequency of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandFreqCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandFreqCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Frequency == nil {
|
if cmd.Frequency == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Frequency(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Frequency(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -244,7 +245,7 @@ type MainEqBandQCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandQCmd command, either retrieving the current Q factor of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandQCmd command, either retrieving the current Q factor of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandQCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandQCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Q == nil {
|
if cmd.Q == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Q(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Q(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -271,7 +272,7 @@ type MainEqBandTypeCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainEqBandTypeCmd command, either retrieving the current type of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainEqBandTypeCmd command, either retrieving the current type of a specific EQ band on the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainEqBandTypeCmd) Run(ctx *context, main *MainCmdGroup, mainEq *MainEqCmdGroup) error {
|
func (cmd *MainEqBandTypeCmd) Run(ctx *context, mainEq *MainEqCmdGroup) error {
|
||||||
if cmd.Type == nil {
|
if cmd.Type == nil {
|
||||||
resp, err := ctx.Client.Main.Eq.Type(0, *mainEq.Band.Band)
|
resp, err := ctx.Client.Main.Eq.Type(0, *mainEq.Band.Band)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -307,7 +308,7 @@ type MainCompOnCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompOnCmd command, either retrieving the current compressor on/off state of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompOnCmd command, either retrieving the current compressor on/off state of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompOnCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompOnCmd) Run(ctx *context) error {
|
||||||
if cmd.Enable == nil {
|
if cmd.Enable == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.On(0)
|
resp, err := ctx.Client.Main.Comp.On(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -330,7 +331,7 @@ type MainCompModeCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompModeCmd command, either retrieving the current compressor mode of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompModeCmd command, either retrieving the current compressor mode of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompModeCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompModeCmd) Run(ctx *context) error {
|
||||||
if cmd.Mode == nil {
|
if cmd.Mode == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Mode(0)
|
resp, err := ctx.Client.Main.Comp.Mode(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -353,7 +354,7 @@ type MainCompThresholdCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompThresholdCmd command, either retrieving the current compressor threshold of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompThresholdCmd command, either retrieving the current compressor threshold of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompThresholdCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompThresholdCmd) Run(ctx *context) error {
|
||||||
if cmd.Threshold == nil {
|
if cmd.Threshold == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Threshold(0)
|
resp, err := ctx.Client.Main.Comp.Threshold(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -376,7 +377,7 @@ type MainCompRatioCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompRatioCmd command, either retrieving the current compressor ratio of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompRatioCmd command, either retrieving the current compressor ratio of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompRatioCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompRatioCmd) Run(ctx *context) error {
|
||||||
if cmd.Ratio == nil {
|
if cmd.Ratio == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Ratio(0)
|
resp, err := ctx.Client.Main.Comp.Ratio(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -399,7 +400,7 @@ type MainCompMixCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompMixCmd command, either retrieving the current compressor mix level of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompMixCmd command, either retrieving the current compressor mix level of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompMixCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompMixCmd) Run(ctx *context) error {
|
||||||
if cmd.Mix == nil {
|
if cmd.Mix == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Mix(0)
|
resp, err := ctx.Client.Main.Comp.Mix(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -422,7 +423,7 @@ type MainCompMakeupCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompMakeupCmd command, either retrieving the current compressor makeup gain of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompMakeupCmd command, either retrieving the current compressor makeup gain of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompMakeupCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompMakeupCmd) Run(ctx *context) error {
|
||||||
if cmd.Makeup == nil {
|
if cmd.Makeup == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Makeup(0)
|
resp, err := ctx.Client.Main.Comp.Makeup(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -445,7 +446,7 @@ type MainCompAttackCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompAttackCmd command, either retrieving the current compressor attack time of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompAttackCmd command, either retrieving the current compressor attack time of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompAttackCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompAttackCmd) Run(ctx *context) error {
|
||||||
if cmd.Attack == nil {
|
if cmd.Attack == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Attack(0)
|
resp, err := ctx.Client.Main.Comp.Attack(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -468,7 +469,7 @@ type MainCompHoldCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompHoldCmd command, either retrieving the current compressor hold time of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompHoldCmd command, either retrieving the current compressor hold time of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompHoldCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompHoldCmd) Run(ctx *context) error {
|
||||||
if cmd.Hold == nil {
|
if cmd.Hold == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Hold(0)
|
resp, err := ctx.Client.Main.Comp.Hold(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -491,7 +492,7 @@ type MainCompReleaseCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run executes the MainCompReleaseCmd command, either retrieving the current compressor release time of the Main L/R output or setting it based on the provided argument.
|
// Run executes the MainCompReleaseCmd command, either retrieving the current compressor release time of the Main L/R output or setting it based on the provided argument.
|
||||||
func (cmd *MainCompReleaseCmd) Run(ctx *context, main *MainCmdGroup) error {
|
func (cmd *MainCompReleaseCmd) Run(ctx *context) error {
|
||||||
if cmd.Release == nil {
|
if cmd.Release == nil {
|
||||||
resp, err := ctx.Client.Main.Comp.Release(0)
|
resp, err := ctx.Client.Main.Comp.Release(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Bus represents the bus parameters of the mixer.
|
||||||
type Bus struct {
|
type Bus struct {
|
||||||
client *client
|
client *client
|
||||||
baseAddress string
|
baseAddress string
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// Package xair provides a client for controlling XAir and X32 mixers using OSC messages.
|
||||||
package xair
|
package xair
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -9,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// XAirClient is a client for controlling XAir mixers.
|
// XAirClient is a client for controlling XAir mixers.
|
||||||
type XAirClient struct {
|
type XAirClient struct { // nolint: revive
|
||||||
client
|
client
|
||||||
Main *Main
|
Main *Main
|
||||||
Strip *Strip
|
Strip *Strip
|
||||||
@ -40,7 +41,7 @@ func NewXAirClient(mixerIP string, mixerPort int, opts ...EngineOption) (*XAirCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// X32Client is a client for controlling X32 mixers.
|
// X32Client is a client for controlling X32 mixers.
|
||||||
type X32Client struct {
|
type X32Client struct { // nolint: revive
|
||||||
client
|
client
|
||||||
Main *Main
|
Main *Main
|
||||||
MainMono *Main
|
MainMono *Main
|
||||||
@ -79,7 +80,7 @@ type client struct {
|
|||||||
Info InfoResponse
|
Info InfoResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start begins listening for messages in a goroutine.
|
// StartListening begins listening for messages in a goroutine.
|
||||||
func (c *client) StartListening() {
|
func (c *client) StartListening() {
|
||||||
go c.receiveLoop()
|
go c.receiveLoop()
|
||||||
log.Debugf("Started listening on %s...", c.engine.conn.LocalAddr().String())
|
log.Debugf("Started listening on %s...", c.engine.conn.LocalAddr().String())
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// DCA represents the DCA group parameters of the mixer.
|
||||||
type DCA struct {
|
type DCA struct {
|
||||||
client *client
|
client *client
|
||||||
baseAddress string
|
baseAddress string
|
||||||
|
|||||||
@ -55,6 +55,7 @@ func (e *Eq) SetOn(index int, on bool) error {
|
|||||||
return e.client.SendMessage(address, value)
|
return e.client.SendMessage(address, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mode retrieves the EQ mode for a specific strip or bus (1-based indexing).
|
||||||
func (e *Eq) Mode(index int) (string, error) {
|
func (e *Eq) Mode(index int) (string, error) {
|
||||||
address := e.AddressFunc(e.baseAddress, index) + "/mode"
|
address := e.AddressFunc(e.baseAddress, index) + "/mode"
|
||||||
err := e.client.SendMessage(address)
|
err := e.client.SendMessage(address)
|
||||||
@ -75,6 +76,7 @@ func (e *Eq) Mode(index int) (string, error) {
|
|||||||
return possibleModes[val], nil
|
return possibleModes[val], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetMode sets the EQ mode for a specific strip or bus (1-based indexing).
|
||||||
func (e *Eq) SetMode(index int, mode string) error {
|
func (e *Eq) SetMode(index int, mode string) error {
|
||||||
address := e.AddressFunc(e.baseAddress, index) + "/mode"
|
address := e.AddressFunc(e.baseAddress, index) + "/mode"
|
||||||
possibleModes := []string{"peq", "geq", "teq"}
|
possibleModes := []string{"peq", "geq", "teq"}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// HeadAmp represents the headphone amplifier parameters of the mixer.
|
||||||
type HeadAmp struct {
|
type HeadAmp struct {
|
||||||
client *client
|
client *client
|
||||||
baseAddress string
|
baseAddress string
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Main represents the main output parameters of the mixer.
|
||||||
type Main struct {
|
type Main struct {
|
||||||
client *client
|
client *client
|
||||||
baseAddress string
|
baseAddress string
|
||||||
@ -11,7 +12,7 @@ type Main struct {
|
|||||||
|
|
||||||
// newMainStereo creates a new Main instance for stereo main output.
|
// newMainStereo creates a new Main instance for stereo main output.
|
||||||
func newMainStereo(c *client) *Main {
|
func newMainStereo(c *client) *Main {
|
||||||
addressFunc := func(fmtString string, args ...any) string {
|
addressFunc := func(fmtString string, _ ...any) string {
|
||||||
return fmtString
|
return fmtString
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ func newMainStereo(c *client) *Main {
|
|||||||
|
|
||||||
// newMainMono creates a new MainMono instance for mono main output (X32 only).
|
// newMainMono creates a new MainMono instance for mono main output (X32 only).
|
||||||
func newMainMono(c *client) *Main {
|
func newMainMono(c *client) *Main {
|
||||||
addressFunc := func(fmtString string, args ...any) string {
|
addressFunc := func(fmtString string, _ ...any) string {
|
||||||
return fmtString
|
return fmtString
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Matrix represents the matrix parameters of the mixer.
|
||||||
type Matrix struct {
|
type Matrix struct {
|
||||||
client *client
|
client *client
|
||||||
baseAddress string
|
baseAddress string
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package xair
|
package xair
|
||||||
|
|
||||||
|
// InfoResponse represents the response from the /info OSC address, containing details about the X-Air device.
|
||||||
type InfoResponse struct {
|
type InfoResponse struct {
|
||||||
Host string
|
Host string
|
||||||
Name string
|
Name string
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
|
// EngineOption defines a functional option for configuring the engine.
|
||||||
type EngineOption func(*engine)
|
type EngineOption func(*engine)
|
||||||
|
|
||||||
// WithTimeout sets the timeout duration for OSC message responses.
|
// WithTimeout sets the timeout duration for OSC message responses.
|
||||||
@ -11,6 +12,7 @@ func WithTimeout(timeout time.Duration) EngineOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CompOption defines a functional option for configuring Comp parameters.
|
||||||
type CompOption func(*Comp)
|
type CompOption func(*Comp)
|
||||||
|
|
||||||
// WithCompAddressFunc allows customization of the OSC address formatting for Comp parameters.
|
// WithCompAddressFunc allows customization of the OSC address formatting for Comp parameters.
|
||||||
@ -20,6 +22,7 @@ func WithCompAddressFunc(f func(fmtString string, args ...any) string) CompOptio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EqOption defines a functional option for configuring Eq parameters.
|
||||||
type EqOption func(*Eq)
|
type EqOption func(*Eq)
|
||||||
|
|
||||||
// WithEqAddressFunc allows customization of the OSC address formatting for Eq parameters.
|
// WithEqAddressFunc allows customization of the OSC address formatting for Eq parameters.
|
||||||
@ -29,6 +32,7 @@ func WithEqAddressFunc(f func(fmtString string, args ...any) string) EqOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GateOption defines a functional option for configuring Gate parameters.
|
||||||
type GateOption func(*Gate)
|
type GateOption func(*Gate)
|
||||||
|
|
||||||
// WithGateAddressFunc allows customization of the OSC address formatting for Gate parameters.
|
// WithGateAddressFunc allows customization of the OSC address formatting for Gate parameters.
|
||||||
|
|||||||
@ -16,7 +16,7 @@ func newParser() *xairParser {
|
|||||||
return &xairParser{}
|
return &xairParser{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseOSCMessage parses raw bytes into an OSC message with improved error handling.
|
// Parse parses raw bytes into an OSC message with improved error handling.
|
||||||
func (p *xairParser) Parse(data []byte) (*osc.Message, error) {
|
func (p *xairParser) Parse(data []byte) (*osc.Message, error) {
|
||||||
log.Debug("=== PARSING OSC MESSAGE BEGIN ===")
|
log.Debug("=== PARSING OSC MESSAGE BEGIN ===")
|
||||||
defer log.Debug("=== PARSING OSC MESSAGE END ===")
|
defer log.Debug("=== PARSING OSC MESSAGE END ===")
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Snapshot represents a snapshot of the mixer's state, allowing for saving and recalling settings.
|
||||||
type Snapshot struct {
|
type Snapshot struct {
|
||||||
client *client
|
client *client
|
||||||
baseAddress string
|
baseAddress string
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package xair
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Strip represents an input channel strip on the mixer.
|
||||||
type Strip struct {
|
type Strip struct {
|
||||||
client *client
|
client *client
|
||||||
baseAddress string
|
baseAddress string
|
||||||
@ -43,7 +44,7 @@ func (s *Strip) Mute(index int) (bool, error) {
|
|||||||
// SetMute sets the mute status of the specified strip (1-based indexing).
|
// SetMute sets the mute status of the specified strip (1-based indexing).
|
||||||
func (s *Strip) SetMute(strip int, muted bool) error {
|
func (s *Strip) SetMute(strip int, muted bool) error {
|
||||||
address := fmt.Sprintf(s.baseAddress, strip) + "/mix/on"
|
address := fmt.Sprintf(s.baseAddress, strip) + "/mix/on"
|
||||||
var value int32 = 0
|
var value int32
|
||||||
if !muted {
|
if !muted {
|
||||||
value = 1
|
value = 1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,20 +2,20 @@ package xair
|
|||||||
|
|
||||||
import "math"
|
import "math"
|
||||||
|
|
||||||
func linGet(min, max, value float64) float64 {
|
func linGet(minVal, maxVal, value float64) float64 {
|
||||||
return min + (max-min)*value
|
return minVal + (maxVal-minVal)*value
|
||||||
}
|
}
|
||||||
|
|
||||||
func linSet(min, max, value float64) float64 {
|
func linSet(minVal, maxVal, value float64) float64 {
|
||||||
return (value - min) / (max - min)
|
return (value - minVal) / (maxVal - minVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
func logGet(min, max, value float64) float64 {
|
func logGet(minVal, maxVal, value float64) float64 {
|
||||||
return min * math.Exp(math.Log(max/min)*value)
|
return minVal * math.Exp(math.Log(maxVal/minVal)*value)
|
||||||
}
|
}
|
||||||
|
|
||||||
func logSet(min, max, value float64) float64 {
|
func logSet(minVal, maxVal, value float64) float64 {
|
||||||
return math.Log(value/min) / math.Log(max/min)
|
return math.Log(value/minVal) / math.Log(maxVal/minVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
func mustDbInto(db float64) float64 {
|
func mustDbInto(db float64) float64 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user