Re: Multiple threads and gtk_main()

2007-07-11 Thread Jonathan Winterflood
Hi,

Could the GAsyncQueue be configured to run a callback in the main thread
when a element (or whatever gets pushed into it) is ready, just like one
woud do with a GIOChannel ?

It would be cleaner than a timeout or an idle function I think.

Jonathan

On 7/10/07, Chris Vine [EMAIL PROTECTED] wrote:

 On Tue, 2007-07-10 at 13:10 -0300, Eduardo M KALINOWSKI wrote:
 [snip]
  Make your threads add stuff to a single GAsyncQueue. Let an idle
  function (or a timeout function) always run, that checks the GAsyncQueue
  and does something if there is something to do, or simply returns if it
  is empty. Wouldn't that work?

 That would work with a timeout, but not with an idle function.  Using
 g_idle_add() in this way would create a busy loop.

 Chris


 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Morpheus linux, c'est une question de VI ou de MORE
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Multiple threads and gtk_main()

2007-07-11 Thread Jonathan Winterflood
On 7/11/07, Gabriele Greco [EMAIL PROTECTED] wrote:

 Jonathan Winterflood wrote:
  Could the GAsyncQueue be configured to run a callback in the main thread
  when a element (or whatever gets pushed into it) is ready, just like one
  woud do with a GIOChannel ?
 
  It would be cleaner than a timeout or an idle function I think.
 
 That will be the ideal solution, but unfortunately I fear there is no
 API to hook an asyncqueue to a giochannel or straight to the main loop.

 --
 Bye,
 Gabry


Indeed, it seems so...
What about creating a couple of GIOChannels and using them the same as a
pipe, but inside the program (then just pass pointers through it, the same
as with the asynqueue?)

I'm not sure it's possible though, just probing...

Jonathan
-- 
Morpheus linux, c'est une question de VI ou de MORE
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Multiple threads and gtk_main()

2007-07-11 Thread Gabriele Greco
Eduardo M KALINOWSKI wrote:
 Make your threads add stuff to a single GAsyncQueue. Let an idle 
 function (or a timeout function) always run, that checks the GAsyncQueue 
 and does something if there is something to do, or simply returns if it 
 is empty. Wouldn't that work?
   
Yes, but that would be polling, and polling is what I'm trying to avoid.

--
Bye,
 Gabry

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


waveform display in gtk

2007-07-11 Thread bert
Hi all,

Is there a GTK widget to display audio or signal waveforms? 

If not, is there a related project in which such a widget is available? 

Thanks,
Bert.


   
-
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links. 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Multiple threads and gtk_main()

2007-07-11 Thread Dong Luo
I'm new to gtk and still reading tutorials, but can we
register a new signal to any global object (possiblely
main window), thus call back function can be connected
in the main thread and the signal can be emitted in
other threads?

--- Jonathan Winterflood
[EMAIL PROTECTED] wrote:

 On 7/11/07, Gabriele Greco [EMAIL PROTECTED]
 wrote:
 
  Jonathan Winterflood wrote:
   Could the GAsyncQueue be configured to run a
 callback in the main thread
   when a element (or whatever gets pushed into it)
 is ready, just like one
   woud do with a GIOChannel ?
  
   It would be cleaner than a timeout or an idle
 function I think.
  
  That will be the ideal solution, but unfortunately
 I fear there is no
  API to hook an asyncqueue to a giochannel or
 straight to the main loop.
 
  --
  Bye,
  Gabry
 
 
 Indeed, it seems so...
 What about creating a couple of GIOChannels and
 using them the same as a
 pipe, but inside the program (then just pass
 pointers through it, the same
 as with the asynqueue?)
 
 I'm not sure it's possible though, just probing...
 
 Jonathan
 -- 
 Morpheus linux, c'est une question de VI ou de
 MORE
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org

http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 



 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Multiple threads and gtk_main()

2007-07-11 Thread Chris Vine
On Wed, 2007-07-11 at 08:59 +0200, Jonathan Winterflood wrote:
 Hi,
 
 Could the GAsyncQueue be configured to run a callback in the main
 thread when a element (or whatever gets pushed into it) is ready, just
 like one woud do with a GIOChannel ?
 
 It would be cleaner than a timeout or an idle function I think. 

If you want to use it on a Unix system, then a pipe is the cleanest way
to do it.  If you don't mind a bit of C++, this is an example:

http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/notifier.h
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/notifier.cpp

If you are using windows it is probably easiest to use a timeout.

Chris


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Multiple threads and gtk_main()

2007-07-11 Thread Chris Vine
On Wed, 2007-07-11 at 22:06 +0100, Chris Vine wrote:
 On Wed, 2007-07-11 at 08:59 +0200, Jonathan Winterflood wrote:
  Hi,
  
  Could the GAsyncQueue be configured to run a callback in the main
  thread when a element (or whatever gets pushed into it) is ready, just
  like one woud do with a GIOChannel ?
  
  It would be cleaner than a timeout or an idle function I think. 
 
 If you want to use it on a Unix system, then a pipe is the cleanest way
 to do it.  If you don't mind a bit of C++, this is an example:
 
 http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/notifier.h
 http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/notifier.cpp
 
 If you are using windows it is probably easiest to use a timeout.

Ah, I should have said that to make sense of this you also need to see:

http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/io_watch.h
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/io_watch.cpp
which connects a file descriptor to the Glib main loop and
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/pipes.h
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/pipes.cpp
which wraps a unix anonymous pipe.

Chris


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: waveform display in gtk

2007-07-11 Thread Jim George
On 7/11/07, bert [EMAIL PROTECTED] wrote:
 Hi all,

 Is there a GTK widget to display audio or signal waveforms?

 If not, is there a related project in which such a widget is available?

If you needed to display relatively short signals (a few seconds),
something like GtkDatabox would work. GtkDatabox is not suited for
long audio clips, since you'd have to only show the signal envelope
after resampling, otherwise refreshing takes too long.

-Jim
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list