@@ -1141,7 +1141,7 @@ void SignalChainTabButton::paintButton(Graphics& g, bool isMouseOver, bool isBut
11411141
11421142// how about some loading and saving?
11431143
1144- XmlElement* EditorViewport::createNodeXml (GenericProcessor* source)
1144+ XmlElement* EditorViewport::createNodeXml (GenericProcessor* source, bool isStartOfSignalChain )
11451145{
11461146
11471147 XmlElement* e = new XmlElement (" PROCESSOR" );
@@ -1162,7 +1162,10 @@ XmlElement* EditorViewport::createNodeXml(GenericProcessor* source)
11621162 // std::cout << name << std::endl;
11631163
11641164 e->setAttribute (" name" , name);
1165- e->setAttribute (" insertionPoint" , 1 );
1165+ if (isStartOfSignalChain)
1166+ e->setAttribute (" insertionPoint" , 0 );
1167+ else
1168+ e->setAttribute (" insertionPoint" , 1 );
11661169 e->setAttribute (" pluginName" , source->getPluginName ());
11671170 e->setAttribute (" pluginType" , (int )(source->getPluginType ()));
11681171 e->setAttribute (" pluginIndex" , source->getIndex ());
@@ -1248,11 +1251,13 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
12481251
12491252 XmlElement* machineName = info->createNewChildElement (" MACHINE" );
12501253 machineName->addTextElement (SystemStats::getComputerName ());
1251-
1254+
12521255 for (int n = 0 ; n < signalChainArray.size (); n++)
12531256 {
12541257 XmlElement* signalChain = new XmlElement (" SIGNALCHAIN" );
1255-
1258+
1259+ bool isStartOfSignalChain = true ;
1260+
12561261 GenericProcessor* processor = signalChainArray[n]->getEditor ()->getProcessor ();
12571262
12581263 while (processor != nullptr )
@@ -1273,7 +1278,7 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
12731278 }
12741279
12751280 // create a new XML element
1276- signalChain->addChildElement (createNodeXml (processor));
1281+ signalChain->addChildElement (createNodeXml (processor, isStartOfSignalChain ));
12771282 processor->saveOrder = saveOrder;
12781283 allProcessors.addIfNotAlreadyThere (processor);
12791284 saveOrder++;
@@ -1283,6 +1288,7 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
12831288 // continue until the end of the chain
12841289 // std::cout << " Moving forward along signal chain." << std::endl;
12851290 processor = processor->getDestNode ();
1291+ isStartOfSignalChain = false ;
12861292
12871293 if (processor == nullptr )
12881294 {
@@ -1301,6 +1307,7 @@ const String EditorViewport::saveState(File fileToUse, String* xmlText)
13011307 // std::cout << " End of chain." << std::endl;
13021308 }
13031309 }
1310+
13041311 }
13051312
13061313 xml->addChildElement (signalChain);
0 commit comments