rncbc / qjackctl

QjackCtl - JACK Audio Connection Kit Qt GUI Interface
https://qjackctl.sourceforge.io
GNU General Public License v2.0
185 stars 41 forks source link

Command line options to manipulate qjackctl #216

Open tkna91 opened 1 week ago

tkna91 commented 1 week ago

I have to use the mouse to do the work of right-clicking the qjackctl tray icon and clicking Reset. Is it possible to do those things with qjackctl command line options?

If not, it would be useful if the following menu operations could also be specified with command line options.

20241016-113227_screenshot

Please consider adding the feature.

Environment:

rncbc commented 1 week ago

most of those commands are available from the native d-bus interface (cf. Setup > Misc > Other > Enable D-Bus Interface).

eg. usage: dbus-send --system / org.rncbc.qjackctl.{start|stop|reset|quit|...}

ps. as matter of fact the reset d-bus method was missing, now added in c7b7068 (develop branch).

tkna91 commented 1 week ago

I see. It seems that the commands can be extracted as follows

https://github.com/rncbc/qjackctl/blob/main/src/qjackctlMainForm.cpp#L847

dbus-send --system / org.rncbc.qjackctl.start
dbus-send --system / org.rncbc.qjackctl.stop
dbus-send --system / org.rncbc.qjackctl.reset
dbus-send --system / org.rncbc.qjackctl.main
dbus-send --system / org.rncbc.qjackctl.messages
dbus-send --system / org.rncbc.qjackctl.status
dbus-send --system / org.rncbc.qjackctl.session
dbus-send --system / org.rncbc.qjackctl.connections
dbus-send --system / org.rncbc.qjackctl.patchbay
dbus-send --system / org.rncbc.qjackctl.graph
dbus-send --system / org.rncbc.qjackctl.rewind
dbus-send --system / org.rncbc.qjackctl.backward
dbus-send --system / org.rncbc.qjackctl.play
dbus-send --system / org.rncbc.qjackctl.pause
dbus-send --system / org.rncbc.qjackctl.forward
dbus-send --system / org.rncbc.qjackctl.setup
dbus-send --system / org.rncbc.qjackctl.about
dbus-send --system / org.rncbc.qjackctl.quit
dbus-send --system / org.rncbc.qjackctl.preset
dbus-send --system / org.rncbc.qjackctl.active-patchbay
dbus-send --system / org.rncbc.qjackctl.load
dbus-send --system / org.rncbc.qjackctl.save
dbus-send --system / org.rncbc.qjackctl.savequit
dbus-send --system / org.rncbc.qjackctl.savetemplate

After a quick check, I could not seem to perform the following...am I doing something wrong?

$ dbus-send --system / org.rncbc.qjackctl.active-patchbay
Invalid signal name: Member name was not valid: 'active-patchbay'
$
rncbc commented 1 week ago

active-patchbay and preset commands need an argument of type string

eg. dbus-send --system / org.rncbc.qjackctl.active-patchbay string:/path/to/patchbay.xml

tkna91 commented 1 week ago

Okay, thanks. I feel like it would be nice to have an explanation in the manual, since it is not very obvious what to do with the above list of objects in general that can be manipulated with d-bus, and the following in particular. How do you feel about it?

dbus-send --system / org.rncbc.qjackctl.preset string:FILEPATH
dbus-send --system / org.rncbc.qjackctl.active-patchbay string:FILEPATH
dbus-send --system / org.rncbc.qjackctl.load
dbus-send --system / org.rncbc.qjackctl.save
dbus-send --system / org.rncbc.qjackctl.savequit
dbus-send --system / org.rncbc.qjackctl.savetemplate
rncbc commented 1 week ago

IIRC the preset parameter is the preset name, not a file path:

dbus-send --system / org.rncbc.qjackctl.preset string:LABEL

although as usual documentation is buried deep in the ChangedLog, feel free to propose yourself a PR to extend the qjackctl.1 man page. thanks