-
Notifications
You must be signed in to change notification settings - Fork 289
/
track.h
93 lines (71 loc) · 2.73 KB
/
track.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project
#pragma once
#include "opentimelineio/composition.h"
#include "opentimelineio/version.h"
namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
class Clip;
class Track : public Composition
{
public:
struct Kind
{
static auto constexpr video = "Video";
static auto constexpr audio = "Audio";
};
enum NeighborGapPolicy
{
never = 0,
around_transitions = 1
};
struct Schema
{
static auto constexpr name = "Track";
static int constexpr version = 1;
};
using Parent = Composition;
Track(
std::string const& name = std::string(),
std::optional<TimeRange> const& source_range = std::nullopt,
std::string const& kind = Kind::video,
AnyDictionary const& metadata = AnyDictionary());
std::string kind() const noexcept { return _kind; }
void set_kind(std::string const& kind) { _kind = kind; }
TimeRange range_of_child_at_index(
int index,
ErrorStatus* error_status = nullptr) const override;
TimeRange trimmed_range_of_child_at_index(
int index,
ErrorStatus* error_status = nullptr) const override;
TimeRange
available_range(ErrorStatus* error_status = nullptr) const override;
std::pair<std::optional<RationalTime>, std::optional<RationalTime>>
handles_of_child(
Composable const* child,
ErrorStatus* error_status = nullptr) const override;
std::pair<Retainer<Composable>, Retainer<Composable>> neighbors_of(
Composable const* item,
ErrorStatus* error_status = nullptr,
NeighborGapPolicy insert_gap = NeighborGapPolicy::never) const;
std::map<Composable*, TimeRange>
range_of_all_children(ErrorStatus* error_status = nullptr) const override;
std::optional<IMATH_NAMESPACE::Box2d>
available_image_bounds(ErrorStatus* error_status) const override;
// Find child clips.
//
// An optional search_range may be provided to limit the search.
//
// The search is recursive unless shallow_search is set to true.
std::vector<Retainer<Clip>> find_clips(
ErrorStatus* error_status = nullptr,
std::optional<TimeRange> const& search_range = std::nullopt,
bool shallow_search = false) const;
protected:
virtual ~Track();
std::string composition_kind() const override;
bool read_from(Reader&) override;
void write_to(Writer&) const override;
private:
std::string _kind;
};
}} // namespace opentimelineio::OPENTIMELINEIO_VERSION