Code Monkey home page Code Monkey logo

Comments (9)

nicola02nb avatar nicola02nb commented on July 19, 2024

It would be also cool a section equalizer_preset that returns the presets of the headpones:

euqalizer_preset[
   flat: [0,....0,],
   bass: [....],
   ....
]

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

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)

from headsetcontrol.

nicola02nb avatar nicola02nb commented on July 19, 2024

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:
image

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

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):

int (*request_chatmix)(hid_device* hid_device);

Can do so in the near future

from headsetcontrol.

nicola02nb avatar nicola02nb commented on July 19, 2024

Yeah, it could be an idea... it seems also quite simply to implement...
Tell me if you need anithing else

from headsetcontrol.

nicola02nb avatar nicola02nb commented on July 19, 2024

@Sapd I done a commit on my fork where I added the feature for json output... It needs some refactor of some comments on device.h added function firms, and it also needs to get implemented all missing functions for compatible devices... can you give a look at it?

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

Some suggestions:

  • Maybe it would be easier to be a device information in device.h in the device struct instead of a "feature"
    • As when you request json output without any options you will get all information anyway. And this information is static in any case
    • 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 needed
    • You would also then do not need the functions like request_equalizer

from headsetcontrol.

nicola02nb avatar nicola02nb commented on July 19, 2024

Did a rollback and a new commit following your idea.

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

Looks fine to me on first looks, in any case you can create a PR from your fork

from headsetcontrol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.