mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-04-18 14:53:34 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ed0560d08 | |||
| 6a4577118f |
@@ -14,6 +14,7 @@ go install github.com/onyx-and-iris/xair-cli@latest
|
|||||||
- --port/-P: Port of the mixer.
|
- --port/-P: Port of the mixer.
|
||||||
- --kind/-k: The kind of mixer. May be one of (*xair*, *x32*).
|
- --kind/-k: The kind of mixer. May be one of (*xair*, *x32*).
|
||||||
- Use this flag to connect to an x32 mixer.
|
- Use this flag to connect to an x32 mixer.
|
||||||
|
- --timeout/-T: Timeout for OSC operations.
|
||||||
- --loglevel/-L: The application's logging verbosity.
|
- --loglevel/-L: The application's logging verbosity.
|
||||||
|
|
||||||
Pass `--host` and any other configuration as flags on the root commmand:
|
Pass `--host` and any other configuration as flags on the root commmand:
|
||||||
|
|||||||
6
main.go
6
main.go
@@ -21,7 +21,7 @@ type MainCmdGroup struct {
|
|||||||
|
|
||||||
// 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".
|
// 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 {
|
type MainMuteCmd struct {
|
||||||
Mute *bool `arg:"" help:"The mute state to set. If not provided, the current state will be printed." optional:""`
|
Mute *string `arg:"" help:"The mute state to set. If not provided, the current state will be printed." optional:"" enum:"true,false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.
|
// 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.
|
||||||
@@ -35,10 +35,10 @@ func (cmd *MainMuteCmd) Run(ctx *context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ctx.Client.Main.SetMute(*cmd.Mute); err != nil {
|
if err := ctx.Client.Main.SetMute(*cmd.Mute == "true"); err != nil {
|
||||||
return fmt.Errorf("failed to set Main L/R mute state: %w", err)
|
return fmt.Errorf("failed to set Main L/R mute state: %w", err)
|
||||||
}
|
}
|
||||||
fmt.Fprintf(ctx.Out, "Main L/R mute state set to: %t\n", *cmd.Mute)
|
fmt.Fprintf(ctx.Out, "Main L/R mute state set to: %s\n", *cmd.Mute)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user