Hi, First, suggest to take a look at the code of gnome-volume-control, I didn't look deeply, I remember it uses GstMixer to set the volume. Second, OHM-ng does not provide interface to tell you which sink is active, and it does *not* know the exact sink name. It only knows abstract name such as bt, headset, the real mapping from bt/headset to specific bt/alsa sink is done inside pulse audio enforcement point.
If you want to get the current active sink, you may check the pa_sink_info.state to see if it is PA_SINK_RUNNING. But if both alsa sink and bt sink are both active, do you expect controlling the volume slider to affect two devices? I didn't see this kind of usage before. Another approach is only to set the volume of the *default* sink of pulse audio, however unfortunately, pulse audio does not provide interface to get default sink, you may take a look at the code of pacmd. (hint is when you type list-sinks inside pacmd, taking look at the output, there's a * character before the index of the default sink). -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Kevron Rees Sent: Friday, April 15, 2011 4:00 AM To: [email protected] Subject: [MeeGo-dev] setting volume in meego For the meego-ux, we've been talking directly to pulseaudio to set the volume. We try to guess what the current active sink is (usually the alsa one), but I'm afraid that is prone to bugs when ohm changes the sink to something else (ie, a bluez sink when a bluetooth headset is connected). With that in mind, I have a few questions maybe the minds on this mailing list can help me answer. 1) is talking directly to pulseaudio to set the volume the "right thing to do TM"? 2) is there a way I can ask OHM-ng what the active sink is so I can start using it? Much appreciated. -Kevron _______________________________________________ MeeGo-dev mailing list [email protected] http://lists.meego.com/listinfo/meego-dev http://wiki.meego.com/Mailing_list_guidelines _______________________________________________ MeeGo-dev mailing list [email protected] http://lists.meego.com/listinfo/meego-dev http://wiki.meego.com/Mailing_list_guidelines
