Csound Csound-dev Csound-tekno Search About

[Cs-dev] Object design question for API use

Date2006-04-08 03:22
FromIain Duncan
Subject[Cs-dev] Object design question for API use
I am still teaching myself OO design, so would like an opinion if gurus
on here have time to weigh in.

In my front end, all csound controls ( transport, csd name, performing
flag, etc ) are wrapped up in a class that protects all critical csound
data variables with a mutex so that gui and other control clients can
ask for information if csound has time to give it to them. However,
these same attributes are used in the csound performance thread in the
kpass loop. The texts I am reading generally say that all data should be
private and controlled through accessor and mutator functions, however,
it seems to me that the kpass loop should always execute as quickly as
possible. Would it be a good idea to make the csound thread into a
friend class of Csound_Interface so that it can access private data
quickly, and not lock/unlock mutexex more than it needs to? Or would it
likely be better to make the entire csound thread and csound data
construct one class that allows other threads to ask for data?

Thanks
Iain


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net