Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Sep 19, 2023
1 parent bc15f68 commit a63e66b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 127 deletions.
65 changes: 0 additions & 65 deletions lib/tlTimeline/Edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,71 +70,6 @@ namespace tl
}
}

otio::SerializableObject::Retainer<otio::Clip> getAssociatedClip(
const otio::SerializableObject::Retainer<otio::Clip>& clip)
{
otio::SerializableObject::Retainer<otio::Clip> out;
const auto timeRangeOpt = clip->trimmed_range_in_parent();
if (timeRangeOpt.has_value())
{
const otime::TimeRange timeRange = timeRangeOpt.value();
if (auto track = dynamic_cast<otio::Track*>(clip->parent()))
{
if (otio::Track::Kind::video == track->kind())
{
if (auto nextTrack = otio::dynamic_retainer_cast<otio::Track>(getNextSibling(track)))
{
if (otio::Track::Kind::audio == nextTrack->kind())
{
for (const auto& child : nextTrack->children())
{
if (auto audioClip = otio::dynamic_retainer_cast<otio::Clip>(child))
{
const auto audioTimeRangeOpt = audioClip->trimmed_range_in_parent();
if (audioTimeRangeOpt.has_value())
{
const otime::TimeRange audioTimeRange = audioTimeRangeOpt.value();
if (audioTimeRange == timeRange)
{
out = audioClip;
break;
}
}
}
}
}
}
}
else if (otio::Track::Kind::audio == track->kind())
{
if (auto prevTrack = otio::dynamic_retainer_cast<otio::Track>(getPrevSibling(track)))
{
if (otio::Track::Kind::video == prevTrack->kind())
{
for (const auto& child : prevTrack->children())
{
if (auto videoClip = otio::dynamic_retainer_cast<otio::Clip>(child))
{
const auto videoTimeRangeOpt = videoClip->trimmed_range_in_parent();
if (videoTimeRangeOpt.has_value())
{
const otime::TimeRange videoTimeRange = videoTimeRangeOpt.value();
if (videoTimeRange == timeRange)
{
out = videoClip;
break;
}
}
}
}
}
}
}
}
}
return out;
}

otio::SerializableObject::Retainer<otio::Timeline> insert(
const otio::SerializableObject::Retainer<otio::Timeline>& timeline,
const std::vector<InsertData>& inserts)
Expand Down
4 changes: 0 additions & 4 deletions lib/tlTimeline/Edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ namespace tl
{
namespace timeline
{
//! Find an associated audio or video clip on an adjacent track.
otio::SerializableObject::Retainer<otio::Clip> getAssociatedClip(
const otio::SerializableObject::Retainer<otio::Clip>&);

//! Insert data.
struct InsertData
{
Expand Down
57 changes: 0 additions & 57 deletions tests/tlTimelineTest/EditTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ namespace tl
void EditTest::run()
{
_insert();
_util();
}

void EditTest::_insert()
Expand Down Expand Up @@ -239,61 +238,5 @@ namespace tl
TLRENDER_ASSERT("Video 0" == getChild(otioTimeline3, 0, 0)->name());
}
}

void EditTest::_util()
{
{
otio::SerializableObject::Retainer<otio::Timeline> otioTimeline(new otio::Timeline);
auto otioTrack = new otio::Track("Video", otio::nullopt, otio::Track::Kind::video);
otioTimeline->tracks()->append_child(otioTrack);
otioTrack->append_child(new otio::Clip(
"Video",
nullptr,
otime::TimeRange(
otime::RationalTime(0.0, 24.0),
otime::RationalTime(24.0, 24.0))));
otioTrack = new otio::Track(
"Audio",
otio::nullopt,
otio::Track::Kind::audio);
otioTimeline->tracks()->append_child(otioTrack);
otioTrack->append_child(new otio::Clip(
"Audio",
nullptr,
otime::TimeRange(
otime::RationalTime(0.0, 48000.0),
otime::RationalTime(48000.0, 48000.0))));

TLRENDER_ASSERT(
timeline::getAssociatedClip(getClip(otioTimeline, 0, 0)).value ==
getClip(otioTimeline, 1, 0).value);
}
{
otio::SerializableObject::Retainer<otio::Timeline> otioTimeline(new otio::Timeline);
auto otioTrack = new otio::Track("Video", otio::nullopt, otio::Track::Kind::video);
otioTimeline->tracks()->append_child(otioTrack);
otioTrack->append_child(new otio::Clip(
"Video",
nullptr,
otime::TimeRange(
otime::RationalTime(0.0, 24.0),
otime::RationalTime(24.0, 24.0))));
otioTrack = new otio::Track(
"Audio",
otio::nullopt,
otio::Track::Kind::audio);
otioTimeline->tracks()->append_child(otioTrack);
otioTrack->append_child(new otio::Clip(
"Audio",
nullptr,
otime::TimeRange(
otime::RationalTime(0.0, 48000.0),
otime::RationalTime(2 * 48000.0, 48000.0))));

TLRENDER_ASSERT(
timeline::getAssociatedClip(getClip(otioTimeline, 0, 0)).value !=
getClip(otioTimeline, 1, 0).value);
}
}
}
}
1 change: 0 additions & 1 deletion tests/tlTimelineTest/EditTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespace tl

private:
void _insert();
void _util();
};
}
}

0 comments on commit a63e66b

Please sign in to comment.