[vlc-devel] libvlc API: Add equalizer to audio.c

Pierre d'Herbemont pdherbemont at gmail.com
Tue Jul 28 10:02:16 CEST 2009


On Jul 28, 2009, at 12:47 AM, Cyril MATHE wrote:

> Le lundi 27 juillet 2009 à 22:34 -0700, Pierre d'Herbemont a écrit :
> what do you mean by libvlc_audio_equalizer ?

struct libvlc_audio_equalizer_t;

a simple opaque structure. This would be a libvlc object such as  
media, media_player, media_list etc.

Of course it needs:
libvlc_audio_equalizer_release(libvlc_audio_equalizer_t * equalizer);

But you don't need to implement refcounting.

>> libvlc_audio_equalizer *
>> libvlc_audio_equalizer_new_from_preset_name(const char *);
> set a preset ? i would prefer that it take an integer instead of a  
> char

I am not against. Though it could be convenient to do:

equalizer_new_from_preset_name("jazz");

This is not something critical regarding performance a a hash table  
should be sufficient enough to resolve it.

But I am not sure  if we want to encourage such a use though. Up to  
you here.

>> libvlc_audio_equalizer *  libvlc_audio_equalizer_new(); /*  
>> eventually ? */
> enable equalizer ? shouldn't be: libvlc_audio_equalizer_new(bool
> b_enable)

No I don't think that's a good approach.

The equalizer should be enabled depending on each particular  
media_player using libvlc_media_player_set_equalizer().

Basically if it is attached to a media_player, it has to be enabled in  
that context.

BTW, we should support having the same equalizer attached to two  
media_player.

So a per equalizer enabled state should not be a good approach.

>
>> libvlc_audio_equalizer_(get| 
>> set)_amplification_at_band_index(unsigned);
> get set a amplification value. It must take a float value for set:
> libvlc_audio_equalizer_set_amplification_at_band_index(unsigned index,
> float band _value);

Right. Or a double probably in 64 bits. Depends if it makes sense for  
the core. Up to you.

>> libvlc_audio_equalizer_(get|set)_preamplification();
> take a float value for set ?

Right. Same as before.

>>
>> libvlc_media_player_(get|set)_equalizer(libvlc_audio_equalizer *);
> can you be more specific on libvlc_audio_equalizer ? and i really
> understand what this function is supposed to do

I answered that question above.

I know that this implies that kind of persistence in the  
implementation, but that shouldn't be that hard to do. (We should be  
able to lure the core using the same kind of technics we use with  
set_drawable).

Pierre.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090728/de4c1c56/attachment.html>


More information about the vlc-devel mailing list