All of lore.kernel.org
 help / color / mirror / Atom feed
* creating/deleting MIDI events
@ 2003-10-20 13:32 Bernhard Gerlach
  2003-10-21  7:36 ` Clemens Ladisch
  2003-10-21  9:25 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Bernhard Gerlach @ 2003-10-20 13:32 UTC (permalink / raw)
  To: alsa-devel


Hello,

Question 1:

How do create a pointer and allocate memory to variables of type 
snd_seq_event to generate events by software? The function 
snd_seq_create_event doesn't exist anymore...


Question 2:

snd_seq_event * event;
snd_seq_event_input( handle, &event );

This allocates memory, but how do I release it? The function 
snd_seq_free_event is marked as deprecated and seems to be empty.

Thanks for answers!

Bernhard


-- 

---------------------------------
Bernhard Gerlach
Fraunhofer AEMT
Am Helmholtzring 1 (Haus M)
98693 Ilmenau
Germany

mail: gerlacbd@emt.iis.fhg.de
---------------------------------



-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: creating/deleting MIDI events
  2003-10-20 13:32 creating/deleting MIDI events Bernhard Gerlach
@ 2003-10-21  7:36 ` Clemens Ladisch
  2003-10-21  9:25 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Clemens Ladisch @ 2003-10-21  7:36 UTC (permalink / raw)
  To: Bernhard Gerlach; +Cc: alsa-devel

Bernhard Gerlach wrote:
> How do create a pointer and allocate memory to variables of type
> snd_seq_event to generate events by software? The function
> snd_seq_create_event doesn't exist anymore...

Use a standard pointer, and malloc/calloc/whateveralloc.
You can allocate events directly on the stack (without pointers), too.

> snd_seq_event * event;
> snd_seq_event_input( handle, &event );
>
> This allocates memory, but how do I release it? The function
> snd_seq_free_event is marked as deprecated and seems to be empty.

The event lives in some internal buffer managed by the ALSA library.
Simply don't do anything to free it.

The event buffer may be reused by the next snd_seq_event_input() call.


HTH
Clemens




-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: creating/deleting MIDI events
  2003-10-20 13:32 creating/deleting MIDI events Bernhard Gerlach
  2003-10-21  7:36 ` Clemens Ladisch
@ 2003-10-21  9:25 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2003-10-21  9:25 UTC (permalink / raw)
  To: Bernhard Gerlach; +Cc: alsa-devel

At Mon, 20 Oct 2003 15:32:29 +0200,
Bernhard Gerlach wrote:
> 
> 
> Hello,
> 
> Question 1:
> 
> How do create a pointer and allocate memory to variables of type 
> snd_seq_event to generate events by software? The function 
> snd_seq_create_event doesn't exist anymore...

simply use malloc.  it's one of few exceptions that the struct is
defined explicitly.


> Question 2:
> 
> snd_seq_event * event;
> snd_seq_event_input( handle, &event );
> 
> This allocates memory, but how do I release it? The function 
> snd_seq_free_event is marked as deprecated and seems to be empty.
 
you don't need to free it since it doesn't allocate the memory but
give the pointer in the buffer in fact.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-21  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-20 13:32 creating/deleting MIDI events Bernhard Gerlach
2003-10-21  7:36 ` Clemens Ladisch
2003-10-21  9:25 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.