Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/opentimelineio/transition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Transition::Transition(
, _transition_type(transition_type)
, _in_offset(in_offset)
, _out_offset(out_offset)
, _enabled(true)
{}

Transition::~Transition()
Expand All @@ -33,6 +34,7 @@ Transition::read_from(Reader& reader)
return reader.read("in_offset", &_in_offset) &&
reader.read("out_offset", &_out_offset) &&
reader.read("transition_type", &_transition_type) &&
reader.read("enabled", &_enabled) &&
Parent::read_from(reader);
}

Expand All @@ -43,6 +45,7 @@ Transition::write_to(Writer& writer) const
writer.write("in_offset", _in_offset);
writer.write("out_offset", _out_offset);
writer.write("transition_type", _transition_type);
writer.write("enabled", _enabled);
}

RationalTime
Expand Down
8 changes: 8 additions & 0 deletions src/opentimelineio/transition.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class Transition : public Composable

virtual bool overlapping() const;

bool enabled() const { return _enabled; };

void set_enabled(bool enabled)
{
_enabled = enabled;
}

std::string transition_type() const noexcept { return _transition_type; }

void set_transition_type(std::string const& transition_type)
Expand Down Expand Up @@ -73,6 +80,7 @@ class Transition : public Composable
private:
std::string _transition_type;
RationalTime _in_offset, _out_offset;
bool _enabled;
};

}} // namespace opentimelineio::OPENTIMELINEIO_VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ static void define_items_and_compositions(py::module m) {
.def_property("transition_type", &Transition::transition_type, &Transition::set_transition_type)
.def_property("in_offset", &Transition::in_offset, &Transition::set_in_offset)
.def_property("out_offset", &Transition::out_offset, &Transition::set_out_offset)
.def_property("enabled", &Transition::enabled, &Transition::set_enabled)
.def("duration", [](Transition* t) {
return t->duration(ErrorStatusHandler());
})
Expand Down
3 changes: 2 additions & 1 deletion tests/baselines/empty_transition.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
},
"out_offset": {
"FROM_TEST_FILE" : "empty_rationaltime.json"
}
},
"enabled": true
}