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

Converting to PFile, Timers, Threads




CONVERTING TO PFILE

I eventually plan to support placing samples in pak files.
What do I need to do to convert convert from the standard
file functions to the ones in PFile? Is it something as easy
as replacing fread with ppfRead ?

I have been starting to using libaudiofile to load samples.
It seems to be very portable. I only had to add guards for
unistd.h and a few other minor things to get it to compile
under windows. I'd prefer to leave it to libaudiofile to
handle the samples but if it would be possible to get it
to work with pak files without modifying it.

TIMERS

Are there any utilities for setting timers in penguinplay?
I think a timer class might be very useful.
Whats the best way to implement a millisecond timeout
in unix? I've been using setitimer.  The one pitfall is
that each process has only one timer. You have to be
careful if your using threads since threads share the timer
and you need to be careful that the right thread gets the
right signal.

Windows has some nice "Multimedia timers". These
let you configure the resolution of the timer using
timeBeginPeriod and timeEndPeriod. The timeout
can be set to repeat or occur only once. The timeout
can be set to either trigger an event (which can be
waited on) or a call a callback.

THREADS

I have been using a separate thread to mix the
samples for /dev/dsp and  esound. This is done so that
it can be treated in the same manner as /dev/sequencer
and directsound.

Would it be better to instead fork a separate process for this and
communicate via a pipe or shared memory or something?

Some graphics libraries aren't thread safe.
Gtk seems to be okay with it as long
as only one thread handles the interface. Qt seems
to have problems with threads.

Peter Burns




FIRST DATA - CONFIDENTIAL COMMUNICATION
===========================================
This e-mail and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to whom it is
addressed.  If you are not the intended recipient be advised that you have
received this e-mail in error and that any use, dissemination, forwarding,
printing, or copying of this e-mail and any file attachments is strictly
prohibited.  If you have received this e-mail in error, please destroy the
original transmission (including any attachments) and immediately notify
the sender by telephone at +612 9959 7333 or by reply e-mail.

First  Data  takes  all  care  to ensure that data transmitted is free from
viruses or other faults/defects but does not represent or warrant that this
communication or any attached file(s) is free from such computer viruses or
other faults or defects.  First Data will not be liable to the recipient or
any other person for any loss or damage (including direct, consequential or
economic  loss  or  damage)  however  caused  which  may result directly or
indirectly  from  the  receipt  or  use  of this communication or any files
attached  to  it.   It  is  the  responsibility  of  any  person using this
communication  or  opening  any  files  attached  to  this communication to
implement  appropriate measure to ensure the integrity of their environment
is maintained.