Re: threads



What is it you are using to interface to the infra-red receiver?

Maybe you should try the LIRC project 
http://fsinfo.cs.uni-sb.de/~columbus/lirc/

If you use their client library and the gdk_input_add(); function
(see: http://www.gtk.org/tutorial/gtk_tut-17.html) then you will have a
rather neat solution.

For a quick explanation:  The lirc library will open a file descriptor,
and the gdk_input_add can watch the descriptor to see if it has data
available, and then it can call the appropriate function to access and act
upon that data.


Leeman
alaric@portone.com

On Wed, 16 Aug 2000, Dr. Gerhard Dieringer wrote:

> Hi all,
> 
> I have the following problem: I want to controll a GTK-application with
> the IR remote controll 
> (IRRC) of my hauppauge tv card. My first solution was to write a
> function, that looks if a key
> was pressed on the IRRC and emit a 'clicked'-signal for the
> corresponding GTK-button-widget.
> The function is called via gtk_idle_add whenever GTK is idle. This
> solution works, but because
> the function is called ***very often***, I get a CPU-usage of 100%.
> 
> The next idea was to start two pthreads, one runs the gtk_main_loop and
> the other tries to
> read the IRRC-data, without first looking, if data is available. This
> 'solution' doesn't waste
> CPU-time, but it has the drawback, that it doesn't work :-((.
> 
> I got the following error message:
> Gdk-ERROR **: BadLength (poly request too large or internal Xlib length
> erro
>   serial 726 error_code 16 request_code 15 minor_code 0
> 
> So my questions are:
> Is it possible to send signals from one pthread to another one, that
> runs the gtk_main_loop?
> How do I do it?
> Are there examples to steal the code from?
> 
> Gerhard
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 
> 






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]