Hello...<br><br><div class="gmail_quote">On 12 August 2012 11:49, Alexey Sokolov <span dir="ltr"><<a href="mailto:alexey@asokolov.org" target="_blank">alexey@asokolov.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello.<br>
<br>
12.08.2012 15:30, Mark Lee пишет:<br>
<div class="im">> +/**<br>
> + * Create a new default equalizer, with all frequency values zeroed.<br>
> + *<br>
> + * The new equalizer can subsequently be associated with a media player by using<br>
> + * libvlc_media_player_set_equalizer().<br>
> + *<br>
> + * When the application is finished with a particular equalizer instance it should<br>
> + * disassociate it from the media player by invoking libvlc_media_player_set_equalizer(NULL)<br>
> + * and then free it by using libvlc_audio_equalizer_release().<br>
> + *<br>
<br>
</div>Why not to use reference count, as other libvlc objects do? So no need<br>
to manually preserve the pointer to the equalizer which is just<br>
associated with a player.<br>
E.g. you're free to call libvlc_media_release(p_media) just after adding<br>
this media to media_player.<br>
<div class="im"><br></div></blockquote><div><br>I did think about that. The original discussion that I referenced on the mailing list from way-back-when suggested reference counting would not be needed for the equalizer.<br>
<br>I think the handling of libvlc_media_t is a fair analogy.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> + * It is the responsibility of the application itself to deal wth the lifecycle management<br>
> + * of equalizer instances, and not the responsibilty of libvlc.<br>
> + *<br>
> + * \return opaque equalizer handle, or NULL on error<br>
> + * \version LibVLC 2.1.0 or later<br>
> + */<br>
> +LIBVLC_API libvlc_equalizer_t *libvlc_audio_equalizer_new( void );<br>
> +<br>
<br>
</div>I'd make it libvlc_audio_equalizer_new(libvlc_instance_t*) for more<br>
consistency with other libvlc objects<br>
<div class="im"><br></div></blockquote><div>That instance parameter would not be used for anything unless reference counting is definitely needed.<br><br>So is there a consensus that reference counting is definitely needed? I am happy to make those changes, but the reference counting change is quite significant so I would like some consensus on this point first.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> +/**<br>
> + * Create a new equalizer, with initial frequency values copied from an existing<br>
> + * preset.<br>
> + *<br>
> + * The new equalizer can subsequently be associated with a media player by using<br>
> + * libvlc_media_player_set_equalizer().<br>
> + *<br>
> + * When the application is finished with a particular equalizer instance it should<br>
> + * disassociate it from the media player by invoking libvlc_media_player_set_equalizer(NULL)<br>
> + * and then free it by using libvlc_audio_equalizer_release().<br>
> + *<br>
> + * It is the responsibility of the application itself to deal with the lifecycle management<br>
> + * of equalizer instances, and not the responsibilty of libvlc.<br>
> + *<br>
> + * \param i_index index of the preset, counting from zero<br>
> + * \return opaque equalizer handle, or NULL on error<br>
> + * \version LibVLC 2.1.0 or later<br>
> + */<br>
> +LIBVLC_API libvlc_equalizer_t *libvlc_audio_equalizer_new_from_preset( int i_index );<br>
> +<br>
<br>
</div>Same here<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Best regards,<br>
Alexey "DarthGandalf" Sokolov<br>
</font></span><br>
</blockquote></div>Thanks for your comments.<br><br>