Re: gtk interface and sound playing



On 2002.05.06 05:26 Andrea Paternesi wrote:
Hi,

I am writing a little gtk apllication and i would like to add sound to
certain events that could happen.
I use the ALSA library to play wav files but i have a  problem of
syncronization.

When i play the file, the gtk-main-loop stops.
I cannot use threads because gtk is not thread safe.
How can i play the wav file without block the gtk loop?

now i just use gtk_signal_connect(....,playwav,...)
where playwav is the function that plays wavs.

Hi,

     You might want to look into Ylib,
http://wolfpack.twu.net/YIFF

You need to add a Ylib initializer when you initialize
GTK and add a GTK timeout function that calls the Ylib
management function.

Once then you can write callbacks for events like
"button_press_event" and have them call a Ylib function
to play a sound.  There's a Ylib tutorial on the site
too.

--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/




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