Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] interfaces lib building in windows with MSVC

Date2005-10-28 18:36
FromMichael Gogins
SubjectRe: [Cs-dev] interfaces lib building in windows with MSVC
I would prefer 3 separate functions: csoundPlay, csoundPause, csoundStop as Csound::Play, Csound::Pause, Csound::Stop. Perhaps the score rewinding and seeking functions could be renamed (csoundRewind, csoundSeek) so that these functions fit clearly into a functional group.

Regards,
Mike

-----Original Message-----
From: Istvan Varga 
Sent: Oct 28, 2005 12:14 PM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] interfaces lib building in windows with MSVC

Michael Gogins wrote:

> I mean the API calls Csound::Perform (usually from a separate thread).
 > Then, for example, the user decides he or she has heard enough, so the
 > user clicks on a Stop button which calls Csound::Stop() and the Perform()
 > call returns immediately. I have code for this in CppSound::perform and
 > CppSound::stop, but I want to push this code, or some other code that
 > does the same thing, down into the CSOUND object.

Is a function that takes an integer argument (0: play, 1: pause, 2: stop)
suitable ? What name should be used ?


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 18:51
FromIstvan Varga
SubjectRe: [Cs-dev] interfaces lib building in windows with MSVC
Michael Gogins wrote:

> I would prefer 3 separate functions: csoundPlay, csoundPause, csoundStop
 > as Csound::Play, Csound::Pause, Csound::Stop.

I would prefer having fewer functions in the C API; however, the
simple inline wrappers in csound.hpp can of course call this function
separately with the three different state values.

> Perhaps the score rewinding  and seeking functions could be renamed
 > (csoundRewind, csoundSeek) so that these functions fit clearly into
 > a functional group.

Unfortunately these functions cannot be used (well, at least not in a
safe way) from a separate thread while csoundPerform() is still running
in another thread. You can try to pause first, and then wait for some
time hoping that the perform thread has now really stopped, but this is
ugly and still not always safe.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 21:13
FromIstvan Varga
SubjectRe: [Cs-dev] interfaces lib building in windows with MSVC
By the way, how about changing csoundPerform() so that it no longer
implies csoundCompile(), but is rather just one of the various
csoundPerform*() functions that performs an entire score unless
caused to return early by a separate thread ? I mean something like:

{
     Csound csound;
     csound.Compile("examples/trapped.csd");
     // start the other thread
     // ...
     if (!csound.Perform())
       csound.Message("Performance terminated by another thread !\n");
     else
       csound.Message("End of score or error\n");
}

In other words, the fact that performance was stopped is indicated
by a zero return value that would otherwise never occur as csoundPerform()
normally only returns on end of score or error.
With this change, it may be enough to have a single function that
stops performance, and not other ones for pause/continue.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net