Closed nicola02nb closed 2 months ago
It would be also cool a section equalizer_preset
that returns the presets of the headpones:
euqalizer_preset[
flat: [0,....0,],
bass: [....],
....
]
Yeah that is quite easy to do.
However I do not fully understand your preset example. So basically what I see what we can return is something like this:
euqalizer_preset[
flat,
bass,
smiley,
focus
]
Where are the numbers in your example come from? (can you also link me the device file when you reference a specific one)
Yeah, sorrry I missed some information... I was thinking something like this:
"euqalizer_preset":[
"flat":[0,0,0,0,0,0,0],
"bass":[0,0,0,0,0,0,0],
"smiley":[0,0,0,0,0,0,0],
"focus":[0,0,0,0,0,0,0]
]
I'm writing a GUI for HeadsetControl, and having those informations would be useful. Those values should come from the specific device... Take as example the Steelseries Artic Nova 7:
Ah yes now I get it, I saw the code before didn't realize that the command actually simply contains equalizer-payload.
Probably needs some code cleanup with more data-driven approach (defining the equalizer as struct and also using it to directly pass it to hid_write), but otherwise easily doable.
I think it can be implemented as a device function, which simply returns that information somewhere here - similar to other request functions (but that it instead returns the data from variables instead of from HID): https://github.com/Sapd/HeadsetControl/blob/f64ac48384cbb7df3878749cbe9635adefdae84c/src/device.h#L235
Can do so in the near future
Yeah, it could be an idea... it seems also quite simply to implement... Tell me if you need anithing else
Some suggestions:
device.h
in the device struct instead of a "feature"
EqualizerInfo
would have to be a pointer then inside the device struct, which is simply NULL
when there is no EQ info. When it is null no output is neededrequest_equalizer
Did a rollback and a new commit following your idea.
Looks fine to me on first looks, in any case you can create a PR from your fork
Description
Add for devices that supports the equalizer
-e --equalizer
argument some info when calling-o json
likeEQUALIZER_BANDS_SIZE
,EQUALIZER_BAND_MIN
,EQUALIZER_BAND_MAX
. It can be a sectionlike this: