Reply to topic

kmix qdbus

User avatar the.root
Registered Member

kmix qdbus

Fri Feb 08, 2013 1:39 am
I'm not well versed with qdbus so excuse my ignorance. I'm trying to create a script and bind a key that will change what "Master Channel" is selected in kmix. Thus when i use my keyboard wheel it goes to the right Channel. This is come about because I use pulseaudio and multiple cards that I switch between.

So i'm looking at qdbus

Code: Select all
qdbus org.kde.kmix /kmix/KMixWindow/actions/select_master

And I think

Code: Select all
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)

Is what I need to use to set it. But the problem is I don't really know what it's looking for for "interface_name" "property_name" and "value". I can't get passed figuring out what the "interface_name" would be. Whatever I try I just get the following error :
Code: Select all
qdbus org.kde.kmix /kmix/KMixWindow/actions/select_master org.freedesktop.DBus.Properties.Set 1 1 1
Error: org.freedesktop.DBus.Error.UnknownInterface
Interface 1 was not found in object /kmix/KMixWindow/actions/select_master

(obviously know all 3 options aren't 1 was just an example to show I have no idea lol)

Anyone have any clues or can point me in the right direction?

User avatar bcooksley

Re: kmix qdbus

Fri Feb 08, 2013 3:12 am
If you wanted to create a convenient script to trigger the showing of the "Select Master Channel" window, then you would have it run:
Code: Select all
qdbus org.kde.kmix /kmix/KMixWindow/actions/select_master trigger

You can find out the current master channel by executing the following:
Code: Select all
qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.currentMasterControl

To change the master channel, you need two things: a mixer and a controller. From what I can tell, both are one and the same.
Code: Select all
qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.setCurrentMaster <mixer> <controller>

Unfortunately, the hard part is getting a list of valid mixers/controllers. The only way I saw was to grep the output of "qdbus" for the particular mixer I was interested in.
To determine the current master mixer, one needs to compare the output of this command:
Code: Select all
qdbus org.kde.kmix /Mixers currentMasterMixer

With the output of the following:
Code: Select all
qdbus org.kde.kmix <mixer path> id

Where <mixer path> is one of the values from the list returned by the following command:
Code: Select all
qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.mixers

Once you have determined the currently active master mixer, you can look beneath it for devices. In this example, the currently active mixer was "/Mixer/0" so I needed to run:
Code: Select all
qdbus org.kde.kmix | grep /Mixers/0/

This yielded a list of two entries:
Code: Select all

These are the device names which can be passed to "setCurrentMixer" (after removing the /Mixers/0/ part).

System Settings and Device Actions KCM maintainer

Reply to topic


Who is online

Registered users: Alastair, apater, Baidu [Spider], Bing [Bot], Exabot [Bot], garthecho, ggael, Google [Bot], google01103, Horus, jitseniesen, Joif, kde-jriddell, ken300, La Ninje, Mamarok, mmistretta, Nuc!eoN, psbot [Picsearch], rbruce, renatoatilio, sacarde, sinclair, stephans, TheraHedwig, tienhung, wolfi323, Yahoo [Bot]