Skip to contentSkip to conversation

creating/deleting MIDI events

DISCUSSION Bernhard Gerlach 3 participants 3 messages Oct 20, 2003 – Oct 21, 2003

lore
Share & tools
lore
#0 lore raw

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

Signature · 17 lines
---------------------------------
Bernhard Gerlach
Fraunhofer AEMT
Am Helmholtzring 1 (Haus M)
98693 Ilmenau
Germany

mail: [email protected]
---------------------------------



-------------------------------------------------------
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
#1 lore raw
Quoted 3 lines · Bernhard Gerlach

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.

Quoted 5 lines

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

#2 lore raw
In reply to Bernhard Gerlach

At Mon, 20 Oct 2003 15:32:29 +0200,

Quoted 9 lines · Bernhard Gerlach

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.

Quoted 7 lines

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