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

Pierre d'Herbemont pdherbemont at free.fr
Tue Jul 28 07:34:53 CEST 2009


Hey Cyril,

This review process can be sometimes harsh, but it is not. And slow,
but that's a time zone issue :-)

Here is an API proposal that I could see working:

unsigned libvlc_audio_equalizer_presets_get_count();
char * libvlc_audio_equalizer_preset_name_at_index();

libvlc_audio_equalizer *
libvlc_audio_equalizer_new_from_preset_name(const char *);
libvlc_audio_equalizer *  libvlc_audio_equalizer_new(); /* eventually ? */

libvlc_audio_equalizer_get_band_count();
libvlc_audio_equalizer_(get|set)_amplification_at_band_index(unsigned);
libvlc_audio_equalizer_(get|set)_preamplification();

libvlc_media_player_(get|set)_equalizer(libvlc_audio_equalizer *);

I am open to suggestions. Especially on presets.

Pierre.

On Mon, Jul 27, 2009 at 8:09 AM, Cyril
MATHE<cmathe at actech-innovation.com> wrote:
> Le samedi 25 juillet 2009 à 10:23 -0700, Pierre d'Herbemont a écrit :
>> Cyril,
>>
>> I am reluctant about that patch because two structures are being used.
>> Please don't use structure at all, or in a very limited manner.
> I agree with you, but the first one had just one structure. I changed it
> because you asked me that the getter return a value.
> Anyway i really need the eqz_t structure.
>
>>
>> The ownership is unclear, and the libvlc_audio_get_eqz() is completely
>> leading to leak the psz_name member. I would suggest to do it in a
>> similar way to what was done for your previous patch, with explicit
>> setters and getters.
> I try to be the most similar with the previous patch, but it's not
> really work in the same way as in marquee, so I cannot just return a
> integer value or a string value. I return all the equalizer value on a
> structure.
> For example if i want to return a band value, I must at least to return
> the band value and the band number, so it doesn't match with an integer
> return function. It can works with a structure or a tab. For enabling I
> need to return the boolean value so just an int and for the equalizer
> name a char*. So do I have to do three getters ? with three different
> kind of return value ?
> the problem is the same for the setters, which means also three
> setters ? I think it's a bit much redundant, isn't it ?
> But if you prefer something like this, I don't mind to do it, I just
> don't see the interest. That's why I choose to return all values in a
> structure using just one function. The second structure is to know what
> the user want to do, and get his option values.
>
>>
>> I would suggest to draft the prototype API first, and then implement
>> it.
> If you have some suggestion tell me.
>> So that you don't waist too much time just by implementing
>> something that will have to change.
> I agree with you. It's a big  waste a time for me.
>
>
>
>
>
>>
>> Thanks for your work,
>>
>> Pierre.
>>
>> On Mon, Jul 20, 2009 at 1:34 AM, Cyril
>> MATHE<cmathe at actech-innovation.com> wrote:
>> > This patch add equalizer audio filter to audio.c.
>> > It adds two new functions:
>> >
>> > libvlc_audio_set_eqz(libvlc_audio_eqz_config_t, libvlc_audio_eqz_t):
>> > enable/disable equalizer, set a new band value, set an equalizer preset
>> >
>> > libvlc_audio_eqz_t libvlc_audio_get_eqz(libvlc_audio_eqz_config_t): get
>> > equalizer status (enabled or not), get bands values, get equalizer
>> > preset settings.
>> >
>> > Best Regards,
>> >        Cyril Mathé
>> >
>> > _______________________________________________
>> > vlc-devel mailing list
>> > To unsubscribe or modify your subscription options:
>> > http://mailman.videolan.org/listinfo/vlc-devel
>> >
>> >
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> http://mailman.videolan.org/listinfo/vlc-devel
>>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>



More information about the vlc-devel mailing list