mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2026-04-18 05:23:31 +00:00
changes to error handling
readme, changelog updated to reflect changes version bump
This commit is contained in:
44
iremote.go
44
iremote.go
@@ -19,7 +19,11 @@ func (ir *iRemote) identifier() string {
|
||||
// getter_bool returns the value of a boolean parameter
|
||||
func (ir *iRemote) getter_bool(p string) bool {
|
||||
param := fmt.Sprintf("%s.%s", ir.identifier(), p)
|
||||
return getParameterFloat(param) == 1
|
||||
val, err := getParameterFloat(param)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
return val == 1
|
||||
}
|
||||
|
||||
// setter_bool sets the value of a boolean parameter
|
||||
@@ -31,41 +35,65 @@ func (ir *iRemote) setter_bool(p string, v bool) {
|
||||
} else {
|
||||
value = 0
|
||||
}
|
||||
setParameterFloat(param, float32(value))
|
||||
err := setParameterFloat(param, float32(value))
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
// getter_int returns the value of an int parameter p
|
||||
func (ir *iRemote) getter_int(p string) int {
|
||||
param := fmt.Sprintf("%s.%s", ir.identifier(), p)
|
||||
return int(getParameterFloat(param))
|
||||
val, err := getParameterFloat(param)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
return int(val)
|
||||
}
|
||||
|
||||
// setter_int sets the value v of an int parameter p
|
||||
func (ir *iRemote) setter_int(p string, v int) {
|
||||
param := fmt.Sprintf("%s.%s", ir.identifier(), p)
|
||||
setParameterFloat(param, float32(v))
|
||||
err := setParameterFloat(param, float32(v))
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
// getter_float returns the value of an int parameter p
|
||||
func (ir *iRemote) getter_float(p string) float64 {
|
||||
param := fmt.Sprintf("%s.%s", ir.identifier(), p)
|
||||
return getParameterFloat(param)
|
||||
val, err := getParameterFloat(param)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
// setter_float sets the value v of an int parameter p
|
||||
func (ir *iRemote) setter_float(p string, v float32) {
|
||||
param := fmt.Sprintf("%s.%s", ir.identifier(), p)
|
||||
setParameterFloat(param, float32(v))
|
||||
err := setParameterFloat(param, float32(v))
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
// getter_string returns the value of a string parameter p
|
||||
func (ir *iRemote) getter_string(p string) string {
|
||||
param := fmt.Sprintf("%s.%s", ir.identifier(), p)
|
||||
return getParameterString(param)
|
||||
val, err := getParameterString(param)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
// setter_string sets the value v of a string parameter p
|
||||
func (ir *iRemote) setter_string(p, v string) {
|
||||
param := fmt.Sprintf("%s.%s", ir.identifier(), p)
|
||||
setParameterString(param, v)
|
||||
err := setParameterString(param, v)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user