creating/deleting MIDI events
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
Quoted 3 lines · Bernhard Gerlach
How do create a pointer and allocate memory to variables of type
snd_seq_eventto generate events by software? The functionsnd_seq_create_eventdoesn'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_eventis 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
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_eventto generate events by software? The functionsnd_seq_create_eventdoesn'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_eventis 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