From a63e66b7277a0b1b4b2f83501cf7860b367b8e55 Mon Sep 17 00:00:00 2001 From: Darby Johnston Date: Tue, 19 Sep 2023 11:20:23 -0700 Subject: [PATCH] Remove unused code --- lib/tlTimeline/Edit.cpp | 65 ------------------------------- lib/tlTimeline/Edit.h | 4 -- tests/tlTimelineTest/EditTest.cpp | 57 --------------------------- tests/tlTimelineTest/EditTest.h | 1 - 4 files changed, 127 deletions(-) diff --git a/lib/tlTimeline/Edit.cpp b/lib/tlTimeline/Edit.cpp index f66655060..1af8aa7bc 100644 --- a/lib/tlTimeline/Edit.cpp +++ b/lib/tlTimeline/Edit.cpp @@ -70,71 +70,6 @@ namespace tl } } - otio::SerializableObject::Retainer getAssociatedClip( - const otio::SerializableObject::Retainer& clip) - { - otio::SerializableObject::Retainer out; - const auto timeRangeOpt = clip->trimmed_range_in_parent(); - if (timeRangeOpt.has_value()) - { - const otime::TimeRange timeRange = timeRangeOpt.value(); - if (auto track = dynamic_cast(clip->parent())) - { - if (otio::Track::Kind::video == track->kind()) - { - if (auto nextTrack = otio::dynamic_retainer_cast(getNextSibling(track))) - { - if (otio::Track::Kind::audio == nextTrack->kind()) - { - for (const auto& child : nextTrack->children()) - { - if (auto audioClip = otio::dynamic_retainer_cast(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(getPrevSibling(track))) - { - if (otio::Track::Kind::video == prevTrack->kind()) - { - for (const auto& child : prevTrack->children()) - { - if (auto videoClip = otio::dynamic_retainer_cast(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 insert( const otio::SerializableObject::Retainer& timeline, const std::vector& inserts) diff --git a/lib/tlTimeline/Edit.h b/lib/tlTimeline/Edit.h index 9eeaf2903..6fe07cc15 100644 --- a/lib/tlTimeline/Edit.h +++ b/lib/tlTimeline/Edit.h @@ -13,10 +13,6 @@ namespace tl { namespace timeline { - //! Find an associated audio or video clip on an adjacent track. - otio::SerializableObject::Retainer getAssociatedClip( - const otio::SerializableObject::Retainer&); - //! Insert data. struct InsertData { diff --git a/tests/tlTimelineTest/EditTest.cpp b/tests/tlTimelineTest/EditTest.cpp index 5cfb6e13c..c52fdf18a 100644 --- a/tests/tlTimelineTest/EditTest.cpp +++ b/tests/tlTimelineTest/EditTest.cpp @@ -50,7 +50,6 @@ namespace tl void EditTest::run() { _insert(); - _util(); } void EditTest::_insert() @@ -239,61 +238,5 @@ namespace tl TLRENDER_ASSERT("Video 0" == getChild(otioTimeline3, 0, 0)->name()); } } - - void EditTest::_util() - { - { - otio::SerializableObject::Retainer 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 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); - } - } } } diff --git a/tests/tlTimelineTest/EditTest.h b/tests/tlTimelineTest/EditTest.h index 7637a373a..7a6830dab 100644 --- a/tests/tlTimelineTest/EditTest.h +++ b/tests/tlTimelineTest/EditTest.h @@ -22,7 +22,6 @@ namespace tl private: void _insert(); - void _util(); }; } }