This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kmix qdbus

Tags: None
(comma "," separated)
User avatar
the.root
Registered Member
Posts
4
Karma
0

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?

Thanks!
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

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
/Mixers/0/alsa_output_pci_0000_00_1b_0_analog_stereo
/Mixers/0/bluez_sink_mac_address_was_here

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


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar