Re: [LAD] snd_seq_port_info and shared_ptr

From: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@email-addr-hidden>
Date: Mon Sep 07 2009 - 19:28:24 EEST

On Monday, September 7, 2009, Clemens Ladisch wrote:
> Christian wrote:
> > snd_seq_client_info_malloc(&clientInfo);
> > shared_ptr<snd_seq_client_info_t> clientInfoMemoryHandler(clientInfo,
> > snd_seq_client_info_free);
> >
> > Well the cleanUp methods are called at block-leaving.
> > I'm only a bit curious because after giving portInfo and clientInfo to
> > the shared_ptr for cleanup management I have to use them for all the
> > alsa queries.
> > But since I'm not using malloc and free in these queries everything is
> > ok, isn't it?
>
> Yes.
>
> You still have to remember to use the correct allocation function and
> to give the correct free function to the shared_ptr constructor, so it
> might be a better idea to write a specialized wrapper for these ALSA
> containers.

To use these queries in Qt4 applications, I've already made C++ wrappers for
the ALSA sequencer API:
http://sourceforge.net/projects/kmetronome/files/aseqmm/
http://kmetronome.sourceforge.net/aseqmm/

For instance, here is the documentation for the ClientInfo and PortInfo
classes:
http://kmetronome.sourceforge.net/aseqmm/classaseqmm_1_1ClientInfo.html
http://kmetronome.sourceforge.net/aseqmm/classaseqmm_1_1PortInfo.html

Regards,
Pedro
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Mon Sep 7 20:15:05 2009

This archive was generated by hypermail 2.1.8 : Mon Sep 07 2009 - 20:15:05 EEST