--------------------------------------------------------------
| 1556 | |
| 1557 | //-------------------------------------------------------------- |
| 1558 | void DurationController::saveProject(){ |
| 1559 | |
| 1560 | timeline.save(); |
| 1561 | |
| 1562 | ofxXmlSettings projectSettings; |
| 1563 | //SAVE ALL TRACKS |
| 1564 | projectSettings.addTag("tracks"); |
| 1565 | projectSettings.pushTag("tracks"); |
| 1566 | vector<ofxTLPage*>& pages = timeline.getPages(); |
| 1567 | for(int i = 0; i < pages.size(); i++){ |
| 1568 | projectSettings.addTag("page"); |
| 1569 | projectSettings.pushTag("page", i); |
| 1570 | projectSettings.addValue("name", pages[i]->getName()); |
| 1571 | vector<ofxTLTrack*>& tracks = pages[i]->getTracks(); |
| 1572 | for (int t = 0; t < tracks.size(); t++) { |
| 1573 | projectSettings.addTag("track"); |
| 1574 | projectSettings.pushTag("track", t); |
| 1575 | //save track properties |
| 1576 | string trackType = tracks[t]->getTrackType(); |
| 1577 | string trackName = tracks[t]->getName(); |
| 1578 | projectSettings.addValue("type", trackType); |
| 1579 | projectSettings.addValue("xmlFileName", tracks[t]->getXMLFileName()); |
| 1580 | projectSettings.addValue("trackName",tracks[t]->getName()); |
| 1581 | projectSettings.addValue("displayName",tracks[t]->getDisplayName()); |
| 1582 | //save custom gui props |
| 1583 | projectSettings.addValue("sendOSC", headers[trackName]->sendOSC()); |
| 1584 | projectSettings.addValue("receiveOSC", headers[trackName]->receiveOSC()); |
| 1585 | if(trackType == "Curves" || trackType == "LFO"){ |
| 1586 | ofxTLKeyframes* curves = (ofxTLKeyframes*)tracks[t]; |
| 1587 | projectSettings.addValue("min", curves->getValueRange().min); |
| 1588 | projectSettings.addValue("max", curves->getValueRange().max); |
| 1589 | |
| 1590 | } |
| 1591 | else if(trackType == "Colors"){ |
| 1592 | ofxTLColorTrack* colors = (ofxTLColorTrack*)tracks[t]; |
| 1593 | projectSettings.addValue("palette", colors->getPalettePath()); |
| 1594 | } |
| 1595 | else if(trackType == "Audio"){ |
| 1596 | projectSettings.addValue("clip", audioTrack->getSoundfilePath()); |
| 1597 | // int numbins = audioTrack->getFFTBinCount(); |
| 1598 | // projectSettings.addValue("bins", audioTrack->getFFTBinCount()); |
| 1599 | } |
| 1600 | projectSettings.popTag(); |
| 1601 | } |
| 1602 | projectSettings.popTag(); //page |
| 1603 | } |
| 1604 | projectSettings.popTag(); //tracks |
| 1605 | |
| 1606 | //LOAD OTHER SETTINGS |
| 1607 | projectSettings.addTag("timelineSettings"); |
| 1608 | projectSettings.pushTag("timelineSettings"); |
| 1609 | projectSettings.addValue("duration", timeline.getDurationInTimecode()); |
| 1610 | projectSettings.addValue("playhead", timeline.getCurrentTimecode()); |
| 1611 | projectSettings.addValue("inpoint", timeline.getInPointTimecode()); |
| 1612 | projectSettings.addValue("outpoint", timeline.getOutPointTimecode()); |
| 1613 | projectSettings.addValue("loop", timeline.getLoopType() == OF_LOOP_NORMAL); |
| 1614 | projectSettings.popTag();// timelineSettings |
| 1615 |
nothing calls this directly
no test coverage detected