Blender V5.0
tree_element_seq.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10#include "DNA_sequence_types.h"
11
12#include "BLI_listbase.h"
13
14#include "BLT_translation.hh"
15
16#include "../outliner_intern.hh"
17#include "tree_element_seq.hh"
18
19namespace blender::ed::outliner {
20
22 : AbstractTreeElement(legacy_te), strip_(strip)
23{
24 BLI_assert(legacy_te.store_elem->type == TSE_STRIP);
25 legacy_te.name = strip_.name + 2;
26}
27
28bool TreeElementStrip::expand_poll(const SpaceOutliner & /*space_outliner*/) const
29{
30 return !strip_.is_effect();
31}
32
33void TreeElementStrip::expand(SpaceOutliner & /*space_outliner*/) const
34{
35 /*
36 * This work like the strip.
37 * If the strip have a name (not default name)
38 * show it, in other case put the filename.
39 */
40
41 if (strip_.type == STRIP_TYPE_META) {
42 LISTBASE_FOREACH (Strip *, child, &strip_.seqbase) {
43 add_element(&legacy_te_.subtree, nullptr, child, &legacy_te_, TSE_STRIP, 0);
44 }
45 }
46 else {
47 add_element(&legacy_te_.subtree, nullptr, strip_.data, &legacy_te_, TSE_STRIP_DATA, 0);
48 }
49}
50
52{
53 return strip_;
54}
55
57{
58 return StripType(strip_.type);
59}
60
61/* -------------------------------------------------------------------- */
62/* Strip */
63
65 : AbstractTreeElement(legacy_te)
66{
68
69 if (strip.dirpath[0] != '\0') {
70 legacy_te_.name = strip.dirpath;
71 }
72 else {
73 legacy_te_.name = IFACE_("Strip None");
74 }
75}
76
77/* -------------------------------------------------------------------- */
78/* Strip Duplicate */
79
81 : AbstractTreeElement(legacy_te), strip_(strip)
82{
84 legacy_te_.name = strip.data->stripdata->filename;
85}
86
88{
89 return strip_;
90}
91
92} // namespace blender::ed::outliner
#define BLI_assert(a)
Definition BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
#define IFACE_(msgid)
@ TSE_STRIP_DUP
@ TSE_STRIP
@ TSE_STRIP_DATA
@ STRIP_TYPE_META
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
TreeElementStripData(TreeElement &legacy_te, StripData &strip)
TreeElementStripDuplicate(TreeElement &legacy_te, Strip &strip)
bool expand_poll(const SpaceOutliner &) const override
TreeElementStrip(TreeElement &legacy_te, Strip &strip)
void expand(SpaceOutliner &) const override
StripElem * stripdata
char dirpath[768]
char filename[256]
StripData * data
ListBase seqbase