mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-04-18 06:43:33 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa704832d5 | |||
| 69925021af | |||
| e092ed3c4e | |||
| d87bc2678c | |||
| c3221f3df5 | |||
| dc733ba500 | |||
| 2a5e0e022f |
26
README.md
26
README.md
@@ -6,6 +6,28 @@
|
||||
go install github.com/onyx-and-iris/xair-cli@latest
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
||||
#### Flags
|
||||
|
||||
- --host/-H: Host of the mixer.
|
||||
- --port/-P: Port of the mixer.
|
||||
- --kind/-k: The kind of mixer. May one of (*xair*, *x32*).
|
||||
- Use this flag to connect to an x32 mixer.
|
||||
|
||||
#### Environment Variables
|
||||
|
||||
Example .envrc:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
XAIR_CLI_HOST=mixer.local
|
||||
XAIR_CLI_PORT=10024
|
||||
XAIR_CLI_KIND=xair
|
||||
XAIR_CLI_RAW_TIMEOUT=50ms
|
||||
```
|
||||
|
||||
### Use
|
||||
|
||||
```console
|
||||
@@ -29,8 +51,8 @@ Raw
|
||||
Main
|
||||
main mute Get or set the mute state of the Main L/R output.
|
||||
main fader Get or set the fader level of the Main L/R output.
|
||||
main fadein Get or set the fade-in time of the Main L/R output.
|
||||
main fadeout Get or set the fade-out time of the Main L/R output.
|
||||
main fadein Fade in the Main L/R output over a specified duration.
|
||||
main fadeout Fade out the Main L/R output over a specified duration.
|
||||
|
||||
Strip
|
||||
strip <index> mute Get or set the mute state of the strip.
|
||||
|
||||
@@ -9,6 +9,7 @@ vars:
|
||||
|
||||
WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe'
|
||||
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
|
||||
MACOS: '{{.BIN_DIR}}/{{.PROGRAM}}_darwin_amd64'
|
||||
|
||||
tasks:
|
||||
default:
|
||||
@@ -22,6 +23,7 @@ tasks:
|
||||
cmds:
|
||||
- task: build-windows
|
||||
- task: build-linux
|
||||
- task: build-macos
|
||||
|
||||
vet:
|
||||
desc: Vet the code
|
||||
@@ -46,6 +48,12 @@ tasks:
|
||||
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.version={{.VERSION}}"
|
||||
internal: true
|
||||
|
||||
build-macos:
|
||||
desc: Build the xair-cli project for macOS
|
||||
cmds:
|
||||
- GOOS=darwin GOARCH=amd64 go build -o {{.MACOS}} -ldflags="-X main.version={{.VERSION}}"
|
||||
internal: true
|
||||
|
||||
test:
|
||||
desc: Run tests
|
||||
cmds:
|
||||
|
||||
6
main.go
6
main.go
@@ -32,9 +32,9 @@ type context struct {
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Host string `default:"mixer.local" help:"The host of the X-Air device." env:"XAIR_CLI_HOST"`
|
||||
Port int `default:"10024" help:"The port of the X-Air device." env:"XAIR_CLI_PORT"`
|
||||
Kind string `default:"xr18" help:"The kind of the X-Air device." env:"XAIR_CLI_KIND"`
|
||||
Host string `default:"mixer.local" help:"The host of the X-Air device." env:"XAIR_CLI_HOST" short:"H"`
|
||||
Port int `default:"10024" help:"The port of the X-Air device." env:"XAIR_CLI_PORT" short:"P"`
|
||||
Kind string `default:"xr18" help:"The kind of the X-Air device." env:"XAIR_CLI_KIND" short:"K"`
|
||||
}
|
||||
|
||||
// CLI is the main struct for the command-line interface.
|
||||
|
||||
6
raw.go
6
raw.go
@@ -7,9 +7,9 @@ import (
|
||||
|
||||
// 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:""`
|
||||
Timeout time.Duration `help:"Timeout for the OSC message send operation." default:"100ms" short:"t" env:"XAIR_CLI_RAW_TIMEOUT"`
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user