Blender V5.0
strip_select.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 * SPDX-FileCopyrightText: 2003-2009 Blender Authors
3 * SPDX-FileCopyrightText: 2005-2006 Peter Schlaile <peter [at] schlaile [dot] de>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later */
6
10
11#include "DNA_scene_types.h"
12#include "DNA_sequence_types.h"
13
14#include "BLI_listbase.h"
15
16#include "SEQ_select.hh"
17#include "SEQ_sequencer.hh"
18
19namespace blender::seq {
20
22{
23 const Editing *ed = editing_get(scene);
24
25 if (ed == nullptr) {
26 return nullptr;
27 }
28
29 return ed->act_strip;
30}
31
32void select_active_set(Scene *scene, Strip *strip)
33{
34 Editing *ed = editing_get(scene);
35
36 if (ed == nullptr) {
37 return;
38 }
39
40 ed->act_strip = strip;
41}
42
43bool select_active_get_pair(Scene *scene, Strip **r_strip_act, Strip **r_strip_other)
44{
45 Editing *ed = editing_get(scene);
46
47 *r_strip_act = select_active_get(scene);
48
49 if (*r_strip_act == nullptr) {
50 return false;
51 }
52
53 *r_strip_other = nullptr;
54
55 LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) {
56 if (strip->flag & SELECT && (strip != (*r_strip_act))) {
57 if (*r_strip_other) {
58 return false;
59 }
60
61 *r_strip_other = strip;
62 }
63 }
64
65 return (*r_strip_other != nullptr);
66}
67
68} // namespace blender::seq
#define LISTBASE_FOREACH(type, var, list)
#define SELECT
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:286
Strip * select_active_get(const Scene *scene)
bool select_active_get_pair(Scene *scene, Strip **r_strip_act, Strip **r_strip_other)
void select_active_set(Scene *scene, Strip *strip)