mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-04-18 23:03:36 +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
|
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
|
### Use
|
||||||
|
|
||||||
```console
|
```console
|
||||||
@@ -29,8 +51,8 @@ Raw
|
|||||||
Main
|
Main
|
||||||
main mute Get or set the mute state of the Main L/R output.
|
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 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 fadein Fade in the Main L/R output over a specified duration.
|
||||||
main fadeout Get or set the fade-out time of the Main L/R output.
|
main fadeout Fade out the Main L/R output over a specified duration.
|
||||||
|
|
||||||
Strip
|
Strip
|
||||||
strip <index> mute Get or set the mute state of the 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'
|
WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe'
|
||||||
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
|
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
|
||||||
|
MACOS: '{{.BIN_DIR}}/{{.PROGRAM}}_darwin_amd64'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
default:
|
default:
|
||||||
@@ -22,6 +23,7 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- task: build-windows
|
- task: build-windows
|
||||||
- task: build-linux
|
- task: build-linux
|
||||||
|
- task: build-macos
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
desc: Vet the code
|
desc: Vet the code
|
||||||
@@ -46,6 +48,12 @@ tasks:
|
|||||||
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.version={{.VERSION}}"
|
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.version={{.VERSION}}"
|
||||||
internal: true
|
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:
|
test:
|
||||||
desc: Run tests
|
desc: Run tests
|
||||||
cmds:
|
cmds:
|
||||||
|
|||||||
6
main.go
6
main.go
@@ -32,9 +32,9 @@ type context struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Host string `default:"mixer.local" help:"The host of the X-Air device." env:"XAIR_CLI_HOST"`
|
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"`
|
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"`
|
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.
|
// CLI is the main struct for the command-line interface.
|
||||||
|
|||||||
2
raw.go
2
raw.go
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
// RawCmd represents the command to send raw OSC messages to the mixer.
|
// RawCmd represents the command to send raw OSC messages to the mixer.
|
||||||
type RawCmd struct {
|
type RawCmd struct {
|
||||||
Timeout time.Duration `help:"Timeout for the OSC message send operation." default:"200ms" short:"t"`
|
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:""`
|
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:""`
|
Args []string `help:"The arguments to include in the OSC message." arg:"" optional:""`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user