Hi!

On Tue, May 01, 2001 at 08:30:07PM -0400, Jeff Tranter wrote:
> I've just commited an update that adds Doxygen documentation comments
> to the CSL public header files. It can still use some polishing and I need
> to set up a Makefile.am for the doc directory that will build the docs when
> Doxygen is present.

Well, I had a discussion with Tim some time ago about documentation, and
we came to the result that documentation should be done inside the C source
files, not inside the headers, as it clutters up the header if you can't
see what function there are because of all the documentation.

Can doxygene do that?

> Going through the APIs I had some questions that maybe one of you
> can answer:
> 
> Is the logic in the example program example/cslmutex.c okay?

Yes, as far as I can see, it is good. The mutex should protect the two
threads from interfering even though they concurrently use the same driver,
that was the idea.


> What is the purpose of the role parameter in csl_pcm_open_{input,output} ?

It will be displayed in artscontrol, and used by the audio manager for auto
restore (well it should at least). The idea is that you start quake, and it
sets role="quake-music" (or "quake-soundeffects"). As user you do something
with the stream, i.e. assign it to your headphone output, or add an effect.

If you start quake the next time, aRts can see "oh well, it's quake again",
and restore the settings you used last time for quake again.

There are the following things to say:

 * role must be constant for a stream
 * role should not be internationalized
 * role should be different for different kinds of streams
 * role should be assigned to something like "quake", "noatun", "quake-sounds",
   ... that describes the role of the stream
 * you must assign a role

as opposed to title

 * the title can change for a stream i.e. "Noatun: Foo.mp3" and later
   "Noatun: Bar.mp3"
 * the title will be shown to the end user to describe the stream
 * the title should be internationalized utf-8
 * if you don't assign a title, it should default to role

> What is the purpose of the title parameter in csl_pcm_{set,dup}_title ?

Sets and gets the title (see above).

> What is csl_pcm_sink intended to do?

Suppose you opened a stream and written 128kb of audio data, then just after
the last bit of write, probably something will be in the buffers (networking,
CSL::Adapter and soundcard).

csl_pcm_flush - will remove as many bytes of these, i.e. try to stop playing
                immediately, cancelling already written bytes

csl_pcm_sink  - waits until the last sample of the stream buffer has been
                played

> Should  csl_pcm_list_channel_mappings accept a CslDriver or CslPcmStream? If
> driver, then should there be a way to list the stream mappings?

Suppose you have a number of streams that the soundcard supports, such
as in 5 surround channels:

#define CSL_PCM_CHANNEL_FRONT_LEFT  "<front-left>"
#define CSL_PCM_CHANNEL_FRONT_RIGHT "<front-right>"
#define CSL_PCM_CHANNEL_CENTER      "<center>"
#define CSL_PCM_CHANNEL_REAR_LEFT   "<rear-left>"
#define CSL_PCM_CHANNEL_REAR_RIGHT  "<rear-right>"

then these are per-driver-constant. I.e. you will open a driver, and the driver
will then support these 5 channels for all streams.

You can then per-stream assign the components of the stream to different
channels of the driver streams. I.e. if you have a stereo stream, you could
assign the left component of your stereo stream to front-left, and the right
component of your stereo stream to front-right.

So while the logic channel names you can assign to always stay the same over
the lifetime of the driver, you can as user modify how they are used for each
stream on the fly.


Two comments about your code: the wave thingy crashes for triangles:

stefan@stefan:~/src/csl/examples$ wave -w triangle
Segmentation fault

and... there are shortcuts for commonly used formats. So the following are
equivalent:

options.pcm_format = 
CSL_PCM_FORMAT_SIZE_16|CSL_PCM_FORMAT_ENCODING_LINEAR_SIGNED|CSL_PCM_FORMAT_ENDIAN_LE;
options.pcm_format = CSL_PCM_FORMAT_S16_LE;

   Cu... Stefan
-- 
  -* Stefan Westerfeld, [EMAIL PROTECTED] (PGP!), Hamburg/Germany
     KDE Developer, project infos at http://space.twc.de/~stefan/kde *-         

Reply via email to