There are dozens if not hundreds of "examples" of this - any JACK client with a GUI.
But to get an idea of the basic idea, take a look in the JACK example clients and/or tools. jack_capture would be a good place to start, since it faces the problem of handing over incoming (audio) data to another thread.On Sat, Oct 19, 2013 at 3:08 AM, Craig Bakalian <craigbakalian@xxxxxxxxxxx> wrote:
Hi,On 10/18/2013 11:12 PM, Paul Davis wrote:
On Fri, Oct 18, 2013 at 11:04 PM, Craig Bakalian <craigbakalian@xxxxxxxxxxx> wrote:
Hi Paul,
Okay, I have a design flaw. I am the only one who uses this app, so no harm done. But I am still confused by the conversation here. If I cannot use gdk_threads_idle_add() then what can I do.
I am confused because, I imagine, anticipate that creating a thread in the jack callback and running it calling an function that inserts text into a textbuffer will not work because I can only act on the main thread?
A simple code example of a solution would be helpful.
all GTK GUIs should be unithreaded anyway.
from the JACK callback, queue whatever data you want in to jack_ringbuffer_t (which is a single-reader, single-writer lock free object), then use a semaphore to signal some other thread. easier than a semaphore, but not quite as RT safe: write to a pipe. the GUI thread can add the other end of the pipe to its event loop so that it will wake up when writing is done.
--p
Is there a code example that does what you are saying? Forgive me, I still don't understand what you are saying. Are you telling me to write data to a pipe in the JACK callback? If so, how do I get the pipe to send data to a GtkTextBuffer?
Craig Bakalian
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx https://mail.gnome.org/mailman/listinfo/gtk-list