Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/clipboard.c
| Show All 22 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup bke | * \ingroup bke | ||||
| */ | */ | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_anim_types.h" | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_sequence_types.h" | #include "DNA_sequence_types.h" | ||||
| #include "DNA_sound_types.h" | #include "DNA_sound_types.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BKE_fcurve.h" | |||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_sound.h" | #include "BKE_sound.h" | ||||
| #include "SEQ_clipboard.h" | #include "SEQ_clipboard.h" | ||||
| #include "SEQ_select.h" | #include "SEQ_select.h" | ||||
| #include "sequencer.h" | #include "sequencer.h" | ||||
| #ifdef WITH_AUDASPACE | #ifdef WITH_AUDASPACE | ||||
| # include <AUD_Special.h> | # include <AUD_Special.h> | ||||
| #endif | #endif | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Manage pointers in the clipboard. | /* Manage pointers in the clipboard. | ||||
| * note that these pointers should _never_ be access in the sequencer, | * note that these pointers should _never_ be access in the sequencer, | ||||
| * they are only for storage while in the clipboard | * they are only for storage while in the clipboard | ||||
| * notice 'newid' is used for temp pointer storage here, validate on access (this is safe usage, | * notice 'newid' is used for temp pointer storage here, validate on access (this is safe usage, | ||||
| * since those data-blocks are fully out of Main lists). | * since those data-blocks are fully out of Main lists). | ||||
| */ | */ | ||||
| ListBase seqbase_clipboard; | ListBase seqbase_clipboard; | ||||
| ListBase fcurves_clipboard; | |||||
| int seqbase_clipboard_frame; | int seqbase_clipboard_frame; | ||||
| static char seq_clipboard_active_seq_name[SEQ_NAME_MAXSTR]; | static char seq_clipboard_active_seq_name[SEQ_NAME_MAXSTR]; | ||||
| void seq_clipboard_pointers_free(struct ListBase *seqbase); | void seq_clipboard_pointers_free(struct ListBase *seqbase); | ||||
| void SEQ_clipboard_free(void) | void SEQ_clipboard_free(void) | ||||
| { | { | ||||
| Sequence *seq, *nseq; | |||||
| seq_clipboard_pointers_free(&seqbase_clipboard); | seq_clipboard_pointers_free(&seqbase_clipboard); | ||||
| for (seq = seqbase_clipboard.first; seq; seq = nseq) { | LISTBASE_FOREACH_MUTABLE (Sequence *, seq, &seqbase_clipboard) { | ||||
| nseq = seq->next; | |||||
| seq_free_sequence_recurse(NULL, seq, false); | seq_free_sequence_recurse(NULL, seq, false); | ||||
| } | } | ||||
| BLI_listbase_clear(&seqbase_clipboard); | BLI_listbase_clear(&seqbase_clipboard); | ||||
| LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, &fcurves_clipboard) { | |||||
| BKE_fcurve_free(fcu); | |||||
| } | |||||
| BLI_listbase_clear(&fcurves_clipboard); | |||||
| } | } | ||||
| #define ID_PT (*id_pt) | #define ID_PT (*id_pt) | ||||
| static void seqclipboard_ptr_free(Main *UNUSED(bmain), ID **id_pt) | static void seqclipboard_ptr_free(Main *UNUSED(bmain), ID **id_pt) | ||||
| { | { | ||||
| if (ID_PT) { | if (ID_PT) { | ||||
| BLI_assert(ID_PT->newid != NULL); | BLI_assert(ID_PT->newid != NULL); | ||||
| MEM_freeN(ID_PT); | MEM_freeN(ID_PT); | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||