@ryanww this is exactly what i was looking for. Thanks very much. I needed the ability to add new timelines on the fly with the same template. here’s what i did for the setup:
void testApp::setupNewTimeline(){
ofLogVerbose() << "setting up new timeline";
ofxTimeline* t = new ofxTimeline();
t->setWorkingFolder("timeline");
t->setup();
t->setFrameRate(30);
t->setDurationInSeconds(15);
t->setLoopType(OF_LOOP_NORMAL);
t->addCurves("Deep_Blue" + ofToString(timelines.size()), ofRange(0, 255));
t->addCurves("Blue" + ofToString(timelines.size()), ofRange(0,255));
t->addCurves("Red" + ofToString(timelines.size()), ofRange(0,255));
t->addCurves("Deep_Red" + ofToString(timelines.size()), ofRange(0, 255));
t->addCurves("Infra_Red" + ofToString(timelines.size()), ofRange(0, 255));
t->setFrameBased(false);
t->setAutosave(false);
timelines.push_back(t);
//set the current timeline to the newest timeline
currentTimelineIndex = timelines.size()-1;
//we want to save the first timeline
if(timelines.size() == 1)
{
timelines[0]->saveTracksToFolder("timeline");
}
showOneTimeline(currentTimelineIndex);
syncNewTimeline(currentTimelineIndex);
the showOneTimeline
function hides all but the current timeline:
void testApp::showOneTimeline(int timelineNum){
//hide all other timelines
for(int i = 0; i < timelines.size(); i++)
{
if(i != timelineNum)
{
timelines[i]->hide();
}
}
//show and draw current timeline
timelines[timelineNum]->show();
and the syncNewTimeline
function syncs up any new timeline to the original template:
void testApp::syncNewTimeline(int timelineNum){
file.copyFromTo("timeline/timeline0_Deep_Blue", "timeline/timeline"+ofToString(timelineNum)+"_Deep_Blue.xml", true, true);
file.copyFromTo("timeline/timeline0_Blue", "timeline/timeline"+ofToString(timelineNum)+"_Blue.xml", true, true);
file.copyFromTo("timeline/timeline0_Red", "timeline/timeline"+ofToString(timelineNum)+"_Red.xml", true, true);
file.copyFromTo("timeline/timeline0_Deep_Red", "timeline/timeline"+ofToString(timelineNum)+"_Deep_Red.xml", true, true);
file.copyFromTo("timeline/timeline0_Infra_Red", "timeline/timeline"+ofToString(timelineNum)+"_Infra_Red.xml", true, true);
timelines[timelineNum]->loadTracksFromFolder("timeline/");
This works really well. Thanks again for taking time to help.