[Linux-wildo-devel] Some talk about the sound API
Status: Pre-Alpha
Brought to you by:
darkschneider2
|
From: Gabriele D. C. <dar...@io...> - 2007-07-03 21:50:12
|
This is a copy from IRC about gros idea on how the new API shoudl look like: The API for the sound part shouldn't be hard to define. Basically, you need open(), close(), get/setParameters(), encode() and decode(). open() and close() would take no parameters. Parameters would be twofold: implementation-specific ones (for example, the device name for OSS, or the port to use for a Jack-based one) and LW-specific ones (quality). encode and decode would take/return a sized buffer chunk of data. both encode and decode should take the amount of desired bytes to read/write as a parameter. open, close, encode and decode would all throw an IOException when something goes wrong, to manage error cases. the LW client would probably pass the initialization parameters to the sound class constructor (which would then have a "contructor(string params)" prototype. Ideally, you'd want to wrap sound classes management into a factory class, so to "hide" the implementation details from the rest of the LW code, which would only give an init string to the factory, and get a generic "LW_Sound" class in return. (and thus you can first isolate the sound stuff from the rest, and then implement more complex management, like hotplugging or autodetection of available sound drivers) Salutes, Gabriele ----------- http://linux-wildo.sf.net http://www.diniciacci.org |