diff --git a/Source/MainWindow.cpp b/Source/MainWindow.cpp index 87755e8f5082765150c8dd7833a9de1ffd6a8e25..d234bf00336fdf02d08944fc4ae42470daa3ba81 100644 --- a/Source/MainWindow.cpp +++ b/Source/MainWindow.cpp @@ -92,6 +92,7 @@ void MainWindow::saveWindowBounds() File file = File("./windowState.xml"); + XmlElement* xml = new XmlElement("MAINWINDOW"); XmlElement* bounds = new XmlElement("BOUNDS"); @@ -121,31 +122,35 @@ void MainWindow::loadWindowBounds() XmlDocument doc (file); XmlElement* xml = doc.getDocumentElement(); - // if (xml == 0 || ! xml->hasTagName (T("MAINWINDOW"))) - // { - // delete xml; - // // return "Not a valid file."; - // } + if (xml == 0 || ! xml->hasTagName (T("MAINWINDOW"))) + { + + std::cout << "File not found." << std::endl; + delete xml; + centreWithSize (800, 600); - String description;// = T(" "); + } else { - forEachXmlChildElement (*xml, e) - { + String description;// = T(" "); - int x = e->getIntAttribute("x"); - int y = e->getIntAttribute("y"); - int w = e->getIntAttribute("w"); - int h = e->getIntAttribute("h"); + forEachXmlChildElement (*xml, e) + { - bool fs = e->getBoolAttribute("fullscreen"); + int x = e->getIntAttribute("x"); + int y = e->getIntAttribute("y"); + int w = e->getIntAttribute("w"); + int h = e->getIntAttribute("h"); - // without the correction, you get drift over time - setTopLeftPosition(x,y-27); - getContentComponent()->setBounds(0,0,w,h-33); - //setFullScreen(fs); + bool fs = e->getBoolAttribute("fullscreen"); - } + // without the correction, you get drift over time + setTopLeftPosition(x,y-27); + getContentComponent()->setBounds(0,0,w,h-33); + //setFullScreen(fs); - delete xml; + } + + delete xml; + } // return "Everything went ok."; } \ No newline at end of file diff --git a/Source/Processors/ProcessorGraph.cpp b/Source/Processors/ProcessorGraph.cpp index ed020337e961faafb3f684f7d3a72b51dac43667..e799ffe06db37c942258b0dcb6cb15dc164ac29c 100644 --- a/Source/Processors/ProcessorGraph.cpp +++ b/Source/Processors/ProcessorGraph.cpp @@ -407,37 +407,8 @@ void ProcessorGraph::removeProcessor(GenericProcessor* processor) { std::cout << "Removing processor with ID " << processor->getNodeId() << std::endl; - // GenericProcessor* source = processor->getSourceNode(); - // GenericProcessor* dest = processor->getDestNode(); - // int numInputs = processor->getNumInputs(); - - // std::cout << " Source " << source << std::endl; - // std::cout << " Dest " << dest << std::endl; - removeNode(processor->getNodeId()); - // eliminate connections for now - /*if (dest !=0 && source !=0) { - - std::cout << " Making new connections...." << std::endl; - - // connect source and dest - for (int chan = 0; chan < numInputs; chan++) { - - addConnection(source->getNodeId(), - chan, - dest->getNodeId(), - chan); - } - - }*/ - - // if (dest != 0) - // dest->setSourceNode(source); - - // if (source != 0) - // source->setDestNode(dest); - } void ProcessorGraph::setUIComponent(UIComponent* ui) diff --git a/Source/UI/FilterViewport.cpp b/Source/UI/FilterViewport.cpp index ccd68d2d35835decbd962d143c1367d18e5a9076..6762af913cab289cfbb022aac213c0a77af394ba 100644 --- a/Source/UI/FilterViewport.cpp +++ b/Source/UI/FilterViewport.cpp @@ -1004,7 +1004,9 @@ const String FilterViewport::loadState(const File& file) if (xml == 0 || ! xml->hasTagName (T("PROCESSORGRAPH"))) { + std::cout << "File not found." << std::endl; delete xml; + // don't do anything return "Not a valid file."; }