Support "media role" property for PulseAudio devices
authorSteve Youngs <steve@sxemacs.org>
Mon, 25 Jun 2012 03:41:45 +0000 (13:41 +1000)
committerSteve Youngs <steve@sxemacs.org>
Mon, 25 Jun 2012 03:41:45 +0000 (13:41 +1000)
commit9114804da42826c8bfdc8e200786bb0581787324
tree3e66a67f6e02f51325db7a73d6f50393902f1b56
parent374249e84cebf527df8434478871d019d75d35d5
Support "media role" property for PulseAudio devices

With PulseAudio a client can set various properties to tell the server
more about the client.  One of these properties is a "media role" which
tells the PulseAudio server what type of media the client is supplying.
For example a mp3 player might set a role of "music", or a movie player
might set a role of "video".

You can't do anything in SXEmacs with roles other than set them, but in
your PulseAudio config you can then do nifty things based on them.  Like,
you can get PulseAudio to mute (cork) your "music" streams when you play a
"video" stream.

This changeset allows the user to set the media role via the `:role'
keyword in #'make-audio-device.

* src/media/sound-pulse.c (sound_pulse_data_s): Add new object,
`role'.

* src/media/sound-pulse.c (sound_pulse_create): Parse :role as
well.

* src/media/sound-pulse.c (sound_pulse_finish):

* src/media/sound-pulse.c (sound_pulse_init_mainloop): Set
PULSE_PROP_media.role with the role.

* src/media/sound.c (Fmake_audio_device): Document PulseAudio
roles.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
src/media/sound-pulse.c
src/media/sound.c