On Mon, Jun 02, 2008 at 21:55:30 +0200
Fons Adriaensen <fons@email-addr-hidden> wrote:
> On Mon, Jun 02, 2008 at 07:32:16PM +0200, rdxesy@email-addr-hidden wrote:
> Other solutions are:
>
> - Use a separate thread to read the midi data, then send
> it as an X event (you can make 'user' event types) to your
> main window. Doing this will trigger the GTK loop.
>
> - Use a separate thread, and a mutex used by this thread
> and the GTK loop to avoid concurrent access to data and
> mixed-up X-calls.
>
>
Ciao,
i use the mutex solution since tha fits well into the
existing code "). So, I have a thread that polls the
incoming queue in an endless loop:
while(1)
...
midi_callback()
}
and this function:
midi_callback(void)
{ ...
gdk_threads_enter ();
/* do the slider dance */
gdk_threads_leave ();
...
}
works and i am happy as the gui feedback is almost instant
now. ")
Cheers,
Jan
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Tue Jun 3 04:15:02 2008
This archive was generated by hypermail 2.1.8 : Tue Jun 03 2008 - 04:15:03 EEST