GNOME Bugzilla – Bug 570832
Add flags to enhance mixer interfaces
Last modified: 2009-02-24 17:45:09 UTC
This patch adds a few flags to the mixer and mixerctrl interfaces. If there are any issues with how the flags should be named, how they work, or the documentation; then we would be happy to rework the patch as needed. Just let us know. Note this patch was written by Garret D'Amore (garrett.damore@sun.com) with some help from me. He is the lead engineer working to integrate OSSv4 into Solaris. Obviously these new flags won't have any effect until plugins make use of them and gnome-volume-control is enhanced to make use of them. I have patches for the SunAudio (in gst-plugins-good) and OSSv4 (in gst-plugins-bad) plugins to make use of these flags, and I also have a patch for gnome-volume-control to recognize the flags and do the right thing when the flags are set. I can attach those patches to this enhancement request if you think they would be helpful to review this change. A few words on binary compatibility: a) If you don't use the flags, they are benign. (i.e. no change if the mixer plugin doesn't implement any of them.) b) A mixer plugin need not implement any of these flags. In that case, gvc will behave much as it does today. c) If you have not updated gvc with support for these flags, but you *have* got mixer plugins that use them, you might not be too happy -- the application will work, but the layout will probably not be what you'd like to see. The results are not terribly user-friendly. d) In other words, all of these flags primarily impact usability/ui, by giving the mixer implementation more influence on the resulting UI. The end result is much more flexible support and a nicer user interface as well. The inline doc comments explain them briefly, but here's more detail: New mixer flags --------------- GST_MIXER_FLAG_HAS_WHITELIST: This allows the mixer implementation to indicate that it doesn't want to use the builtin whitelist in applications (gnome-volume-control), but will flag tracks & options that should be displayed by default. (This hands control over the "default" display to the mixer implementation, instead of relying on a horrible hack in gnome-volume-control.) GST_MIXER_FLAG_GROUPING: This flag, if present, means that some tracks will not be flagged as either INPUT or OUTPUT. Those tracks will be displayed on the "OPTIONS" page in gvc. Furthermore, if this flag is present, switches and options that are marked as either INPUT or OUTPUT will be put in the appropriate flagbuttonbox, and displayed on the Playback or Recording notebook pages. (I added this flag so that I could retain the old behavior in case ALSA or something relied on it.) New track flags --------------- GST_MIXER_TRACK_NO_RECORD: If present, this suppresses the display of the "record" button on input tracks. This is necessary for both the Sun audio and OSS v4 plugins, where there is not a 1-1 mapping of input tracks and hardware record sources. (I.e. where the record source selection is handled via a separate option.) GST_MIXER_TRACK_NO_MUTE: If present, this suppresses the display and handling of the "mute" button on a track. The idea is that some sliders may represent values where "mute" makes no sense... for example, a slider representing tone levels, 3D centering, or balance adjustments, should not have a "mute" button. GST_MIXER_TRACK_WHITELIST: If present (and the mixer has GST_MIXER_FLAG_HAS_WHITELIST), then this track will be in the default whitelist of tracks to display by default. If it is not present, but the mixer has GST_MIXER_FLAG_HAS_WHITELIST set, then the track will *not* be in the default whitelist of tracks to display by default. Note that this is handled by gvc; its a hint to the application only.
Created attachment 128126 [details] [review] patch adding flags
Note gvc enhancement request bug #571106 which shows the changes needed to gvc to make this work. It also includes a picture to show how things work with this change.
These extra flags look fine to me. I'll add them to -base later, unless there are objections?
Committed: commit b8af1223db33a929df6c792516f4f3c3a7087a28 Author: Garret D'Amore <garrett.damore@sun.com> Date: Tue Feb 24 17:23:58 2009 +0000 mixer interface: Add flags to enhance mixer interfaces This patch adds a few flags to the mixer and mixerctrl interface to better support OSSv4 (and potentially other backends). Patch By: Garret D'Amore <garrett.damore@sun.com> Signed-Off-By: Jan Schmidt <jan.schmidt@sun.com> API: GST_MIXER_FLAG_HAS_WHITELIST, GST_MIXER_FLAG_GROUPING, API: GST_MIXER_TRACK_NO_RECORD, GST_MIXER_TRACK_NO_MUTE, API: GST_MIXER_TRACK_WHITELIST