Re: [Cs-dev] interfaces lib building in windows with MSVC
Date | 2005-10-28 16:43 |
From | Michael Gogins |
Subject | Re: [Cs-dev] interfaces lib building in windows with MSVC |
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. Regards, Mike -----Original Message----- From: Istvan Varga |
Date | 2005-10-28 17:14 |
From | Istvan Varga |
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 |
Date | 2005-10-28 18:44 |
From | Istvan Varga |
Subject | Re: [Cs-dev] interfaces lib building in windows with MSVC |
Thinking more about this issue, I am now not so sure if running csoundPerform() in a separate thread is really so useful, perhaps with the exception of the specific application where you have a GUI that allows stopping (and maybe pausing) the performance, but nothing more. As Csound was not designed at all for allowing access to the same CSOUND* instance from multiple threads at the same time, any of the more advanced functionality such as setting the score offset in real time, triggering events, using the software bus, etc., would be unsafe. Unlike in the case of csoundPerformKsmps() and other functions that only perform for a small amount of time, with csoundPerform() the host application cannot implement reliable thread synchronization. Istvan Varga wrote: > 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 |
Date | 2005-10-28 20:46 |
From | Anthony Kozar |
Subject | Re: [Cs-dev] interfaces lib building in windows with MSVC |
This should be done, I think, using the csoundYield callback. The MacOS 9 front end already has a "transport" for pausing, stopping, and resuming a performance. It sets a yield callback to check for events and when a click on the pause button is detected, it does not return to Csound until the user clicks Play or Stop. If the user clicks Stop, the yield callback returns an error code which causes csoundPerform to end the performance. This all works fairly well (and has worked for nearly ten years). Anthony Kozar anthonykozar AT sbcglobal DOT net http://akozar.spymac.net/ Michael Gogins wrote on 10/28/05 11:43 AM: > 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. ------------------------------------------------------- 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 |
Date | 2005-10-28 21:03 |
From | Istvan Varga |
Subject | Re: [Cs-dev] interfaces lib building in windows with MSVC |
Anthony Kozar wrote: > This should be done, I think, using the csoundYield callback. I think the problem with the yield callback would be that the interface is expected to be usable from high level languages, and you may have problems setting callback functions that are expected to have a "C" interface from a scripting language like Python. ------------------------------------------------------- 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 |