@@ -935,7 +935,7 @@ void ofxVisualProgramming::clearObjectsMap(){
935935// --------------------------------------------------------------
936936string ofxVisualProgramming::getSubpatchParent (string subpatchName){
937937 for (map<string,vector<string>>::iterator it = subpatchesTree.begin (); it != subpatchesTree.end (); it++ ){
938- for (int s=0 ;s<it->second .size ();s++){
938+ for (unsigned int s=0 ;s<it->second .size ();s++){
939939 if (it->second .at (s) == subpatchName){
940940 return it->first ;
941941 }
@@ -1026,7 +1026,7 @@ void ofxVisualProgramming::removeObject(int &id){
10261026void ofxVisualProgramming::duplicateObject (int &id){
10271027 // disable duplicate for hardware&system related objects
10281028 if (patchObjects[id]->getName () != " audio device" && patchObjects[id]->getName () != " video grabber" && patchObjects[id]->getName () != " kinect grabber" && patchObjects[id]->getName () != " live patching" && patchObjects[id]->getName () != " projection mapping" ){
1029- ofVec2f newPos = ofVec2f (patchObjects[id]->getPos ().x + patchObjects[id]->getObjectWidth (),patchObjects[id]->getPos ().y );
1029+ // ofVec2f newPos = ofVec2f(patchObjects[id]->getPos().x + patchObjects[id]->getObjectWidth(),patchObjects[id]->getPos().y);
10301030 addObject (patchObjects[id]->getName (),patchObjects[id]->getPos ());
10311031 }else {
10321032 ofLog (OF_LOG_NOTICE," '%s' is one of the Mosaic objects that can't (for now) be duplicated due to hardware/system related issues." ,patchObjects[id]->getName ().c_str ());
@@ -1266,6 +1266,11 @@ void ofxVisualProgramming::loadPatch(string patchFile){
12661266 XML.setValue (" bpm" ,bpm);
12671267 }
12681268
1269+ delete engine;
1270+ engine = nullptr ;
1271+ engine = new pdsp::Engine ();
1272+
1273+ soundStreamIN.close ();
12691274 audioDevices = soundStreamIN.getDeviceList ();
12701275 audioDevicesStringIN.clear ();
12711276 audioDevicesID_IN.clear ();
@@ -1332,15 +1337,11 @@ void ofxVisualProgramming::loadPatch(string patchFile){
13321337 XML.setValue (" output_channels" ,static_cast <int >(audioDevices[audioOUTDev].outputChannels ));
13331338 XML.saveFile ();
13341339
1335- delete engine;
1336- engine = nullptr ;
1337- engine = new pdsp::Engine ();
1338-
13391340 if (dspON){
13401341 engine->setChannels (audioDevices[audioINDev].inputChannels , audioDevices[audioOUTDev].outputChannels );
13411342 this ->setChannels (audioDevices[audioINDev].inputChannels ,0 );
13421343
1343- for (int in=0 ;in<audioDevices[audioINDev].inputChannels ;in++){
1344+ for (unsigned int in=0 ;in<audioDevices[audioINDev].inputChannels ;in++){
13441345 engine->audio_in (in) >> this ->in (in);
13451346 }
13461347 this ->out_silent () >> engine->blackhole ();
@@ -1514,8 +1515,8 @@ void ofxVisualProgramming::setAudioInDevice(int ind){
15141515
15151516 bool found = false ;
15161517 int index = audioDevicesID_IN.at (ind);
1517- for (int i=0 ;i<audioDevices[index].sampleRates .size ();i++){
1518- if (audioDevices[index].sampleRates [i] == audioSampleRate){
1518+ for (size_t i=0 ;i<audioDevices[index].sampleRates .size ();i++){
1519+ if (( int ) audioDevices[index].sampleRates [i] == audioSampleRate){
15191520 found = true ;
15201521 }
15211522 }
@@ -1561,7 +1562,7 @@ void ofxVisualProgramming::activateDSP(){
15611562 engine->setChannels (audioDevices[audioINDev].inputChannels , audioDevices[audioOUTDev].outputChannels );
15621563 this ->setChannels (audioDevices[audioINDev].inputChannels ,0 );
15631564
1564- for (int in=0 ;in<audioDevices[audioINDev].inputChannels ;in++){
1565+ for (unsigned int in=0 ;in<audioDevices[audioINDev].inputChannels ;in++){
15651566 engine->audio_in (in) >> this ->in (in);
15661567 }
15671568 this ->out_silent () >> engine->blackhole ();
0 commit comments