Implemented the Close() method, so it closes all clips' readers on the timeline

This commit is contained in:
Jonathan Thomas
2012-10-10 00:52:47 -05:00
parent d840297572
commit 9d01dd7900
2 changed files with 13 additions and 1 deletions

View File

@@ -34,9 +34,12 @@ int main()
t.AddClip(&c3);
// Request frames
for (int x=0; x<330; x++)
for (int x=0; x<133; x++)
t.GetFrame(x);
// Close timeline
t.Close();
cout << "Successfully Finished Timeline DEMO" << endl;
return 0;

View File

@@ -70,7 +70,16 @@ void Timeline::SortClips()
// Close the reader (and any resources it was consuming)
void Timeline::Close()
{
// Close all open clips
list<Clip*>::iterator clip_itr;
for (clip_itr=clips.begin(); clip_itr != clips.end(); ++clip_itr)
{
// Get clip object from the iterator
Clip *clip = (*clip_itr);
// Open or Close this clip, based on if it's intersecting or not
update_open_clips(clip, false);
}
}
// Open the reader (and start consuming resources)