Clear all clips from timeline
| 868 | |
| 869 | // Clear all clips from timeline |
| 870 | void 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) |
| 916 | void Timeline::Close() |
no test coverage detected