@@ -37,7 +37,7 @@ EditorViewport::EditorViewport()
3737 somethingIsBeingDraggedOver(false ), shiftDown(false ), canEdit(true ),
3838 lastEditorClicked(0 ), selectionIndex(0 ), borderSize(6 ), tabSize(30 ),
3939 tabButtonSize(15 ), insertionPoint(0 ), componentWantsToMove(false ),
40- indexOfMovingComponent(-1 ), currentTab(-1 )
40+ indexOfMovingComponent(-1 ), currentTab(-1 ), loadingConfig( false )
4141{
4242
4343 addMouseListener (this , true );
@@ -1159,7 +1159,7 @@ XmlElement* EditorViewport::createNodeXml(GenericProcessor* source)
11591159
11601160 name += source->getEditor ()->getName ();
11611161
1162- std::cout << name << std::endl;
1162+ // std::cout << name << std::endl;
11631163
11641164 e->setAttribute (" name" , name);
11651165 e->setAttribute (" insertionPoint" , 1 );
@@ -1172,7 +1172,7 @@ XmlElement* EditorViewport::createNodeXml(GenericProcessor* source)
11721172 e->setAttribute (" isSink" , source->isSink ());
11731173
11741174 /* *Saves individual processor parameters to XML */
1175- std::cout << " Create subnodes with parameters" << std::endl;
1175+ // std::cout << "Create subnodes with parameters" << std::endl;
11761176 source->saveToXml (e);
11771177
11781178 return e;
@@ -1221,6 +1221,7 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
12211221 // }
12221222
12231223 Array<GenericProcessor*> splitPoints;
1224+ Array<GenericProcessor*> allSplitters;
12241225 /* * Used to reset saveOrder at end, to allow saving the same processor multiple times*/
12251226 Array<GenericProcessor*> allProcessors;
12261227
@@ -1261,6 +1262,7 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
12611262 {
12621263 // add to list of splitters to come back to
12631264 splitPoints.add (processor);
1265+ allSplitters.add (processor);
12641266 processor->switchIO (0 );
12651267 }
12661268
@@ -1271,20 +1273,16 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
12711273 saveOrder++;
12721274
12731275 }
1274- else
1275- {
1276- std::cout << " Processor already saved as number " << processor->saveOrder << std::endl;
1277- }
12781276
12791277 // continue until the end of the chain
1280- std::cout << " Moving forward along signal chain." << std::endl;
1278+ // std::cout << " Moving forward along signal chain." << std::endl;
12811279 processor = processor->getDestNode ();
12821280
12831281 if (processor == nullptr )
12841282 {
12851283 if (splitPoints.size () > 0 )
12861284 {
1287- std::cout << " Going back to first unswitched splitter." << std::endl;
1285+ // std::cout << " Going back to first unswitched splitter." << std::endl;
12881286
12891287 processor = splitPoints.getFirst ();
12901288 splitPoints.remove (0 );
@@ -1294,10 +1292,14 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
12941292 }
12951293 else
12961294 {
1297- std::cout << " End of chain." << std::endl;
1295+ // std::cout << " End of chain." << std::endl;
12981296 }
12991297 }
13001298 }
1299+
1300+ for (GenericProcessor* sp : allSplitters) {
1301+ sp->switchIO (0 );
1302+ }
13011303
13021304 xml->addChildElement (signalChain);
13031305 }
@@ -1452,7 +1454,8 @@ const String EditorViewport::loadState(File fileToLoad)
14521454 return " Failed To Open " + fileToLoad.getFileName ();
14531455 }
14541456 clearSignalChain ();
1455-
1457+
1458+ loadingConfig = true ; // Indicate config is being loaded into the GUI
14561459 String description;// = " ";
14571460 int loadOrder = 0 ;
14581461
@@ -1620,7 +1623,9 @@ const String EditorViewport::loadState(File fileToLoad)
16201623 delete xml;
16211624
16221625 currentId=maxID+1 ; // make sure future processors don't have overlapping id numbers
1623-
1626+
1627+ loadingConfig = false ;
1628+
16241629 return error;
16251630}
16261631/* Set parameters based on XML.*/
0 commit comments