[LONG] Mixers - suggestions needed
lool at via.ecp.fr
Sun Mar 17 21:08:02 CET 2002
Hey, I'm needing some piece of advice so I don't commit a big
I'm disturbed when watching a DVD by the differences in the output
levels of the background music and the speech for example. This is
compensable in spdif where you probably have a way of setting the
individual channels, but for a stereo output you have to find another
way. This could be achieved in altering the formula of downmixing, but
the levels aren't the same in each movie, or during a whole DVD anyway.
So I thought of writing a small mixer in Gtk. In that way, one can
adjust the gains as he likes them, at runtime. Following an advice
of sam, I made a generic code to display a n-channel mixer, probably
reusable for the audio output or for some other gain adjustments.
Now I have to integrate that thing in vlc, and I'm having troubles
imaginating for the following :
- the place where I will store current gain values
- the way of keeping these values while a decoder respawn (when you
change audio channel for example, the decoder is respawned)
- the way of having multiple time the same decoder with different gains
Point 2 is because you don't want to loose your gain settings after
you've selected another audio channel.
Point 3 is either a "be-generic" behavior I'd like to have (thinking of
the day vlc will be a multi-input, multi-intf, no-segfault player).
. Solution attempt
So the only current way I see now is following :
- have a gtk-plugin value keeping count of the number of mixer we're
looking at, destroy the window when 0, incremented when we want to
create a new mixer view (for example when a decoder plugin starts);
- have the audio decoders call a "register new mixer" function so they
make the gtkplugin clear where he could alter the gain, return a
- pass an identifier for that decoder when registering so that a respawn
gets the same settings.
So the actual gain value would be stored in the decoder, the preferred
one would be stored in the gtk plugin, when the decoder is in the
registered state the gtk-plugins alter both and shows the mixer, else it
just grays off the mixer.
The subtle part is in the identifier, I think. You can't only use the
decoder name because multiple instances of the same decoder could be
running and you can't use the thread id because he would change after a
I thought of something like "name of the decoder" + "id", where id
would reflect the number of the decoder (supposing they are spawned in
the same order).
All suggestions are appreciated,
Thanks to stef, sam & gildas for helping until here,
Loïc Minier <lool at via.ecp.fr>
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>
More information about the vlc-devel