Blender  V2.93
strip_select.c
Go to the documentation of this file.
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) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  *
19  * - Blender Foundation, 2003-2009
20  * - Peter Schlaile <peter [at] schlaile [dot] de> 2005/2006
21  */
22 
27 #include "DNA_scene_types.h"
28 #include "DNA_sequence_types.h"
29 
30 #include "BKE_scene.h"
31 
32 #include "SEQ_select.h"
33 #include "SEQ_sequencer.h"
34 
36 {
37  Editing *ed = SEQ_editing_get(scene, false);
38 
39  if (ed == NULL) {
40  return NULL;
41  }
42 
43  return ed->act_seq;
44 }
45 
47 {
48  Editing *ed = SEQ_editing_get(scene, false);
49 
50  if (ed == NULL) {
51  return;
52  }
53 
54  ed->act_seq = seq;
55 }
56 
57 int SEQ_select_active_get_pair(Scene *scene, Sequence **r_seq_act, Sequence **r_seq_other)
58 {
59  Editing *ed = SEQ_editing_get(scene, false);
60 
61  *r_seq_act = SEQ_select_active_get(scene);
62 
63  if (*r_seq_act == NULL) {
64  return 0;
65  }
66 
67  Sequence *seq;
68 
69  *r_seq_other = NULL;
70 
71  for (seq = ed->seqbasep->first; seq; seq = seq->next) {
72  if (seq->flag & SELECT && (seq != (*r_seq_act))) {
73  if (*r_seq_other) {
74  return 0;
75  }
76 
77  *r_seq_other = seq;
78  }
79  }
80 
81  return (*r_seq_other != NULL);
82 }
#define SELECT
Scene scene
Editing * SEQ_editing_get(Scene *scene, bool alloc)
Definition: sequencer.c:232
Sequence * SEQ_select_active_get(Scene *scene)
Definition: strip_select.c:35
int SEQ_select_active_get_pair(Scene *scene, Sequence **r_seq_act, Sequence **r_seq_other)
Definition: strip_select.c:57
void SEQ_select_active_set(Scene *scene, Sequence *seq)
Definition: strip_select.c:46
ListBase * seqbasep
Sequence * act_seq
void * first
Definition: DNA_listBase.h:47
struct Sequence * next