mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-04-09 02:13:35 +00:00
litn fixes
This commit is contained in:
@@ -11,7 +11,7 @@ type Eq struct {
|
||||
AddressFunc func(fmtString string, args ...any) string
|
||||
}
|
||||
|
||||
// Factory function to create Eq instance with optional configuration
|
||||
// Factory function to create Eq instance with optional configuration.
|
||||
func newEq(c *client, baseAddress string, opts ...EqOption) *Eq {
|
||||
eq := &Eq{
|
||||
client: c,
|
||||
@@ -82,7 +82,7 @@ func (e *Eq) SetMode(index int, mode string) error {
|
||||
}
|
||||
|
||||
// Gain retrieves the gain for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) Gain(index int, band int) (float64, error) {
|
||||
func (e *Eq) Gain(index, band int) (float64, error) {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/g", band)
|
||||
err := e.client.SendMessage(address)
|
||||
if err != nil {
|
||||
@@ -101,13 +101,13 @@ func (e *Eq) Gain(index int, band int) (float64, error) {
|
||||
}
|
||||
|
||||
// SetGain sets the gain for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) SetGain(index int, band int, gain float64) error {
|
||||
func (e *Eq) SetGain(index, band int, gain float64) error {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/g", band)
|
||||
return e.client.SendMessage(address, float32(linSet(-15, 15, gain)))
|
||||
}
|
||||
|
||||
// Frequency retrieves the frequency for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) Frequency(index int, band int) (float64, error) {
|
||||
func (e *Eq) Frequency(index, band int) (float64, error) {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/f", band)
|
||||
err := e.client.SendMessage(address)
|
||||
if err != nil {
|
||||
@@ -126,13 +126,13 @@ func (e *Eq) Frequency(index int, band int) (float64, error) {
|
||||
}
|
||||
|
||||
// SetFrequency sets the frequency for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) SetFrequency(index int, band int, frequency float64) error {
|
||||
func (e *Eq) SetFrequency(index, band int, frequency float64) error {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/f", band)
|
||||
return e.client.SendMessage(address, float32(logSet(20, 20000, frequency)))
|
||||
}
|
||||
|
||||
// Q retrieves the Q factor for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) Q(index int, band int) (float64, error) {
|
||||
func (e *Eq) Q(index, band int) (float64, error) {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/q", band)
|
||||
err := e.client.SendMessage(address)
|
||||
if err != nil {
|
||||
@@ -151,13 +151,13 @@ func (e *Eq) Q(index int, band int) (float64, error) {
|
||||
}
|
||||
|
||||
// SetQ sets the Q factor for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) SetQ(index int, band int, q float64) error {
|
||||
func (e *Eq) SetQ(index, band int, q float64) error {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/q", band)
|
||||
return e.client.SendMessage(address, float32(1.0-logSet(0.3, 10, q)))
|
||||
}
|
||||
|
||||
// Type retrieves the type for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) Type(index int, band int) (string, error) {
|
||||
func (e *Eq) Type(index, band int) (string, error) {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/type", band)
|
||||
err := e.client.SendMessage(address)
|
||||
if err != nil {
|
||||
@@ -178,7 +178,7 @@ func (e *Eq) Type(index int, band int) (string, error) {
|
||||
}
|
||||
|
||||
// SetType sets the type for a specific EQ band on a strip or bus (1-based indexing).
|
||||
func (e *Eq) SetType(index int, band int, eqType string) error {
|
||||
func (e *Eq) SetType(index, band int, eqType string) error {
|
||||
address := e.AddressFunc(e.baseAddress, index) + fmt.Sprintf("/%d/type", band)
|
||||
possibleTypes := []string{"lcut", "lshv", "peq", "veq", "hshv", "hcut"}
|
||||
return e.client.SendMessage(address, int32(indexOf(possibleTypes, eqType)))
|
||||
|
||||
Reference in New Issue
Block a user