1 /*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
16 * The Original Code is Copyright (C) 2008 Blender Foundation.
17 * All rights reserved.
18 */
19
20 /** \file
21 * \ingroup spseq
22 */
23
24 #include <math.h>
25 #include <stdlib.h>
26
27 #include "DNA_space_types.h"
28
29 #include "WM_api.h"
30 #include "WM_types.h"
31
32 #include "ED_markers.h"
33 #include "ED_select_utils.h"
34 #include "ED_sequencer.h"
35 #include "ED_transform.h" /* Transform keymap. */
36
37 #include "BKE_sequencer.h"
38
39 #include "sequencer_intern.h"
40
41 /* ************************** registration **********************************/
42
sequencer_operatortypes(void)43 void sequencer_operatortypes(void)
44 {
45 /* sequencer_edit.c */
46 WM_operatortype_append(SEQUENCER_OT_split);
47 WM_operatortype_append(SEQUENCER_OT_slip);
48 WM_operatortype_append(SEQUENCER_OT_mute);
49 WM_operatortype_append(SEQUENCER_OT_unmute);
50 WM_operatortype_append(SEQUENCER_OT_lock);
51 WM_operatortype_append(SEQUENCER_OT_unlock);
52 WM_operatortype_append(SEQUENCER_OT_reload);
53 WM_operatortype_append(SEQUENCER_OT_refresh_all);
54 WM_operatortype_append(SEQUENCER_OT_reassign_inputs);
55 WM_operatortype_append(SEQUENCER_OT_swap_inputs);
56 WM_operatortype_append(SEQUENCER_OT_duplicate);
57 WM_operatortype_append(SEQUENCER_OT_delete);
58 WM_operatortype_append(SEQUENCER_OT_offset_clear);
59 WM_operatortype_append(SEQUENCER_OT_images_separate);
60 WM_operatortype_append(SEQUENCER_OT_meta_toggle);
61 WM_operatortype_append(SEQUENCER_OT_meta_make);
62 WM_operatortype_append(SEQUENCER_OT_meta_separate);
63
64 WM_operatortype_append(SEQUENCER_OT_gap_remove);
65 WM_operatortype_append(SEQUENCER_OT_gap_insert);
66 WM_operatortype_append(SEQUENCER_OT_snap);
67 WM_operatortype_append(SEQUENCER_OT_strip_jump);
68 WM_operatortype_append(SEQUENCER_OT_swap);
69 WM_operatortype_append(SEQUENCER_OT_swap_data);
70 WM_operatortype_append(SEQUENCER_OT_rendersize);
71
72 WM_operatortype_append(SEQUENCER_OT_export_subtitles);
73
74 WM_operatortype_append(SEQUENCER_OT_copy);
75 WM_operatortype_append(SEQUENCER_OT_paste);
76
77 WM_operatortype_append(SEQUENCER_OT_rebuild_proxy);
78 WM_operatortype_append(SEQUENCER_OT_enable_proxies);
79 WM_operatortype_append(SEQUENCER_OT_change_effect_input);
80 WM_operatortype_append(SEQUENCER_OT_change_effect_type);
81 WM_operatortype_append(SEQUENCER_OT_change_path);
82
83 WM_operatortype_append(SEQUENCER_OT_set_range_to_strips);
84
85 /* sequencer_select.c */
86 WM_operatortype_append(SEQUENCER_OT_select_all);
87 WM_operatortype_append(SEQUENCER_OT_select);
88 WM_operatortype_append(SEQUENCER_OT_select_more);
89 WM_operatortype_append(SEQUENCER_OT_select_less);
90 WM_operatortype_append(SEQUENCER_OT_select_linked_pick);
91 WM_operatortype_append(SEQUENCER_OT_select_linked);
92 WM_operatortype_append(SEQUENCER_OT_select_handles);
93 WM_operatortype_append(SEQUENCER_OT_select_side);
94 WM_operatortype_append(SEQUENCER_OT_select_side_of_frame);
95 WM_operatortype_append(SEQUENCER_OT_select_box);
96 WM_operatortype_append(SEQUENCER_OT_select_grouped);
97
98 /* sequencer_add.c */
99 WM_operatortype_append(SEQUENCER_OT_scene_strip_add);
100 WM_operatortype_append(SEQUENCER_OT_movieclip_strip_add);
101 WM_operatortype_append(SEQUENCER_OT_mask_strip_add);
102 WM_operatortype_append(SEQUENCER_OT_movie_strip_add);
103 WM_operatortype_append(SEQUENCER_OT_sound_strip_add);
104 WM_operatortype_append(SEQUENCER_OT_image_strip_add);
105 WM_operatortype_append(SEQUENCER_OT_effect_strip_add);
106
107 /* sequencer_modifiers.c */
108 WM_operatortype_append(SEQUENCER_OT_strip_modifier_add);
109 WM_operatortype_append(SEQUENCER_OT_strip_modifier_remove);
110 WM_operatortype_append(SEQUENCER_OT_strip_modifier_move);
111 WM_operatortype_append(SEQUENCER_OT_strip_modifier_copy);
112
113 /* sequencer_view.h */
114 WM_operatortype_append(SEQUENCER_OT_sample);
115 WM_operatortype_append(SEQUENCER_OT_view_all);
116 WM_operatortype_append(SEQUENCER_OT_view_frame);
117 WM_operatortype_append(SEQUENCER_OT_view_all_preview);
118 WM_operatortype_append(SEQUENCER_OT_view_zoom_ratio);
119 WM_operatortype_append(SEQUENCER_OT_view_selected);
120 WM_operatortype_append(SEQUENCER_OT_view_ghost_border);
121 }
122
sequencer_keymap(wmKeyConfig * keyconf)123 void sequencer_keymap(wmKeyConfig *keyconf)
124 {
125 /* Common items ------------------------------------------------------------------ */
126 WM_keymap_ensure(keyconf, "SequencerCommon", SPACE_SEQ, 0);
127
128 /* Strips Region --------------------------------------------------------------- */
129 WM_keymap_ensure(keyconf, "Sequencer", SPACE_SEQ, 0);
130
131 /* Preview Region ----------------------------------------------------------- */
132 WM_keymap_ensure(keyconf, "SequencerPreview", SPACE_SEQ, 0);
133 }
134
ED_operatormacros_sequencer(void)135 void ED_operatormacros_sequencer(void)
136 {
137 wmOperatorType *ot;
138
139 ot = WM_operatortype_append_macro("SEQUENCER_OT_duplicate_move",
140 "Duplicate Strips",
141 "Duplicate selected strips and move them",
142 OPTYPE_UNDO | OPTYPE_REGISTER);
143
144 WM_operatortype_macro_define(ot, "SEQUENCER_OT_duplicate");
145 WM_operatortype_macro_define(ot, "TRANSFORM_OT_seq_slide");
146 }
147