Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command-line plugin support #3643

Open
mjpieters opened this issue Apr 21, 2021 · 0 comments
Open

Command-line plugin support #3643

mjpieters opened this issue Apr 21, 2021 · 0 comments

Comments

@mjpieters
Copy link
Contributor

The proposed change

Allow (event or GUI) plugins to register command-line extensions; e.g. quodlibet --plugin=pluginname [args] would result in a specific method being called on the named plugin.

Exactly what type of plugin that supports this is an open question; command-line calls are perhaps events, but they are also a form of UI.

Benefits of this change

Personally, I have a need to automate QuodLibet beyond what is offered by the current crop of command-line options (which is very rich!). Specifically, I regularly switch out the default output device on my Macbook Pro, and on top of this add an Audio-Hijack pipeline. As a child I lost some of my hearing in one of my ears (I no longer have inner-ear bones on that side) and the audio-setup I use compensates for that. But only when I plug in my laptop to my home office dock; the switch is fully automated using Apple Script and command-line tools, except for QuodLibet. I always need to open the preferences panel, click on Apply on the Playback tab, to trigger a GStreamer pipeline rebuild, because GStreamer can't by itself detect that audio routing has changed. I can't automate this using Apple Script because GTK+ doesn't provide enough information to the OS to make this possible.

So, I'd love to be able to just write a plugin that calls player._rebuild_pipeline() on command. For now I think I'll resort to an event plugin that uses GLib.timeout_add to re-check audio settings repeatedly, but I'd much prefer to have a command-line option to trigger this.

Any issues this might cause

The biggest issue here is implementation work.

  • Extending the plugin system to expose a method that can accept arbitrary command-line arguments
  • Extending the CLI parser and Command infrastructure to support a new switch
  • and the tests for this.

There is no performance cost beyond what a plugin might do with the call, but that's the case for any existing plugins.

There may be compatibility issues with how such a command would swallow all following command-line arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants