MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / Clear

Method Clear

src/Timeline.cpp:870–913  ·  view source on GitHub ↗

Clear all clips from timeline

Source from the content-addressed store, hash-verified

868
869// Clear all clips from timeline
870void Timeline::Clear()
871{
872 ZmqLogger::Instance()->AppendDebugMethod("Timeline::Clear");
873
874 // Get lock (prevent getting frames while this happens)
875 const std::lock_guard<std::recursive_mutex> guard(getFrameMutex);
876
877 // Close all open clips
878 for (auto clip : clips)
879 {
880 update_open_clips(clip, false);
881
882 // Delete clip object (if timeline allocated it)
883 bool allocated = allocated_clips.count(clip);
884 if (allocated) {
885 delete clip;
886 }
887 }
888 // Clear all clips
889 clips.clear();
890 allocated_clips.clear();
891
892 // Close all effects
893 for (auto effect : effects)
894 {
895 // Delete effect object (if timeline allocated it)
896 bool allocated = allocated_effects.count(effect);
897 if (allocated) {
898 delete effect;
899 }
900 }
901 // Clear all effects
902 effects.clear();
903 allocated_effects.clear();
904
905 // Delete all FrameMappers
906 for (auto mapper : allocated_frame_mappers)
907 {
908 mapper->Reader(NULL);
909 mapper->Close();
910 delete mapper;
911 }
912 allocated_frame_mappers.clear();
913}
914
915// Close the reader (and any resources it was consuming)
916void Timeline::Close()

Callers 15

CloseMethod · 0.45
ParentTimelineMethod · 0.45
SetJsonValueMethod · 0.45
AddEffectMethod · 0.45
RemoveEffectMethod · 0.45
CloseMethod · 0.45
SeekMethod · 0.45
AddClipMethod · 0.45
apply_json_to_clipsMethod · 0.45
ClearAllCacheMethod · 0.45
Clip.cppFile · 0.45
CacheMemory.cppFile · 0.45

Calls 4

AppendDebugMethodMethod · 0.80
clearMethod · 0.45
ReaderMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected