Code Monkey home page Code Monkey logo

Comments (5)

VTimofeenko avatar VTimofeenko commented on August 19, 2024

@Sapd , have you considered alternative implementation to the current commandline switches, in form of
headsetcontrol {COMMAND} {VALUE} [PARAMS] like so:

image

?

From the interface perspective, I think it will make integrating something like #60 easier.

I am willing to do the legwork to start implementing this(although my C knowledge is very subpar). For now without making extra functionality to the utility, just adding alternative interface to the existing one.

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

However, some questions arise regarding the form. For example, how do you combine several parameters?

The current form is the form used by almost all Unix programs. After all, Unix has support for it (via getopt).

Why does it make #60 exactly easier? (did you cite the wrong issue id?)

However, the main.c actually needs to be revised. As it contains a lot of code duplication.

from headsetcontrol.

VTimofeenko avatar VTimofeenko commented on August 19, 2024

combine several parameters
Hm. I initially did not think about that use case, but this still could work like:

# headsetcontrol set sidetone 100 led 1

That would however break the ability to do something like

# headsetcontrol -s 100 -b

Why does it make #60 exactly easier
I had a thought that this approach would allow to easier separate the battery charge from whether the headset is charging or not, like so:

# headsetcontrol get is_connected 
1
# headsetcontrol get charge
75%
# headsetcontrol get is_charging
1

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

This would be theoretically possible with like this -b --charging

I don't think that's really worth changing. It would make the interface a bit simpler, but it would increase the code complexity (which is already quite complex - it is already difficult to keep it clean) and implement things that are already in the standard library.

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

The interface change a bit, it is at least possible to use now long options

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.