-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// muteCmd toggles the mute state of the speakers | ||
var eqProfileCmd = &cobra.Command{ | ||
Use: "eq_profile", | ||
Short: "Get the equaliser Profile of the speakers", | ||
Long: `Get the equaliser Profile of the speakers`, | ||
Args: cobra.MaximumNArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
eqProfile, _ := currentSpeaker.GetEQProfileV2() | ||
fmt.Println(eqProfile) | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(eqProfileCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,42 @@ | ||
package kefw2 | ||
|
||
import "encoding/json" | ||
|
||
type EQProfileV2 struct { | ||
SubwooferCount int `json:"subwooferCount"` // 0, 1, 2 | ||
TrebleAmount float32 `json:"trebleAmount"` | ||
DeskMode bool `json:"deskMode"` | ||
BassExtension string `json:"bassExtension"` // less, standard, more | ||
HighPassMode bool `json:"highPassMode"` | ||
AudioPolarity string `json:"audioPolarity"` | ||
IsExpertMode bool `json:"isExpertMode"` | ||
DeskModeSetting int `json:"deskModeSetting"` | ||
SubwooferPreset string `json:"subwooferPreset"` | ||
HighPassModeFreq int `json:"highPassModeFreq"` | ||
WallModeSetting float32 `json:"wallModeSetting"` | ||
Balance int `json:"balance"` | ||
SubEnableStereo bool `json:"subEnableStereo"` | ||
SubwooferPolarity string `json:"subwooferPolarity"` | ||
SubwooferGain int `json:"subwooferGain"` | ||
IsKW1 bool `json:"isKW1"` | ||
PhaseCorrection bool `json:"phaseCorrection"` | ||
WallMode bool `json:"wallMode"` | ||
ProfileId string `json:"profileId"` | ||
ProfileName string `json:"profileName"` | ||
SubOutLPFreq float32 `json:"subOutLPFreq"` | ||
SubwooferCount int `json:"subwooferCount"` // 0, 1, 2 | ||
TrebleAmount float32 `json:"trebleAmount"` | ||
DeskMode bool `json:"deskMode"` | ||
BassExtension string `json:"bassExtension"` // less, standard, more | ||
HighPassMode bool `json:"highPassMode"` | ||
AudioPolarity string `json:"audioPolarity"` | ||
IsExpertMode bool `json:"isExpertMode"` | ||
DeskModeSetting int `json:"deskModeSetting"` | ||
SubwooferPreset string `json:"subwooferPreset"` | ||
HighPassModeFreq int `json:"highPassModeFreq"` | ||
WallModeSetting float32 `json:"wallModeSetting"` | ||
Balance int `json:"balance"` | ||
SubEnableStereo bool `json:"subEnableStereo"` | ||
SubwooferPolarity string `json:"subwooferPolarity"` | ||
SubwooferGain int `json:"subwooferGain"` | ||
IsKW1 bool `json:"isKW1"` | ||
PhaseCorrection bool `json:"phaseCorrection"` | ||
WallMode bool `json:"wallMode"` | ||
ProfileId string `json:"profileId"` | ||
ProfileName string `json:"profileName"` | ||
SubOutLPFreq float32 `json:"subOutLPFreq"` | ||
SubwooferOutHotfix bool `json:"subwooferOutHotfix"` | ||
SubwooferOut bool `json:"subwooferOut"` | ||
} | ||
|
||
// GetEQProfileV2 returns the current EQProfileV2 for the speaker | ||
// EQ Profiles are connected to the selected source | ||
func (s *KEFSpeaker) GetEQProfileV2() (EQProfileV2, error) { | ||
eqProfile, err := JSONUnmarshalValue(s.getData("kef:eqProfile/v2")) | ||
return eqProfile.(EQProfileV2), err | ||
} | ||
|
||
// String dumps a json EQProfileV2 | ||
func (e EQProfileV2) String() string { | ||
profile, _ := json.MarshalIndent(e, "", " ") | ||
return string(profile) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters