Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Mar 5, 2025
1 parent 92aa7d6 commit ad18e4b
Show file tree
Hide file tree
Showing 19 changed files with 159 additions and 208 deletions.
12 changes: 7 additions & 5 deletions lib/tlTimeline/AudioInline.h → lib/tlTimeline/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,34 @@
// Copyright (c) 2021-2025 Darby Johnston
// All rights reserved.

#include <tlTimeline/Audio.h>

namespace tl
{
namespace timeline
{
inline bool AudioLayer::operator == (const AudioLayer& other) const
bool AudioLayer::operator == (const AudioLayer& other) const
{
return audio == other.audio;
}

inline bool AudioLayer::operator != (const AudioLayer& other) const
bool AudioLayer::operator != (const AudioLayer& other) const
{
return !(*this == other);
}

inline bool AudioData::operator == (const AudioData& other) const
bool AudioData::operator == (const AudioData& other) const
{
return seconds == other.seconds &&
layers == other.layers;
}

inline bool AudioData::operator != (const AudioData& other) const
bool AudioData::operator != (const AudioData& other) const
{
return !(*this == other);
}

inline bool isTimeEqual(const AudioData& a, const AudioData& b)
bool isTimeEqual(const AudioData& a, const AudioData& b)
{
return a.seconds == b.seconds;
}
Expand Down
2 changes: 0 additions & 2 deletions lib/tlTimeline/Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ namespace tl
bool isTimeEqual(const AudioData&, const AudioData&);
}
}

#include <tlTimeline/AudioInline.h>
15 changes: 5 additions & 10 deletions lib/tlTimeline/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
set(HEADERS
Audio.h
AudioInline.h
BackgroundOptions.h
ColorOptions.h
ColorOptionsInline.h
CompareOptions.h
CompareOptionsInline.h
DisplayOptions.h
DisplayOptionsInline.h
Edit.h
ForegroundOptions.h
IRender.h
Init.h
MemoryReference.h
Player.h
PlayerInline.h
PlayerOptions.h
PlayerOptionsInline.h
RenderUtil.h
TimeUnits.h
Timeline.h
Transition.h
Util.h
UtilInline.h
Video.h
VideoInline.h)
Video.h)
set(PRIVATE_HEADERS
PlayerPrivate.h
TimelinePrivate.h)

set(SOURCE
Audio.cpp
BackgroundOptions.cpp
ColorOptions.cpp
CompareOptions.cpp
Expand All @@ -41,14 +34,16 @@ set(SOURCE
MemoryReference.cpp
Player.cpp
PlayerAudio.cpp
PlayerOptions.cpp
PlayerPrivate.cpp
RenderUtil.cpp
TimeUnits.cpp
Timeline.cpp
TimelineCreate.cpp
TimelinePrivate.cpp
Transition.cpp
Util.cpp)
Util.cpp
Video.cpp)

add_library(tlTimeline ${HEADERS} ${PRIVATE_HEADERS} ${SOURCE})
target_link_libraries(tlTimeline tlIO)
Expand Down
29 changes: 29 additions & 0 deletions lib/tlTimeline/ColorOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,40 @@ namespace tl
{
namespace timeline
{
bool OCIOOptions::operator == (const OCIOOptions& other) const
{
return
enabled == other.enabled &&
fileName == other.fileName &&
input == other.input &&
display == other.display &&
view == other.view &&
look == other.look;
}

bool OCIOOptions::operator != (const OCIOOptions& other) const
{
return !(*this == other);
}

DTK_ENUM_IMPL(
LUTOrder,
"PostColorConfig",
"PreColorConfig");

bool LUTOptions::operator == (const LUTOptions& other) const
{
return
enabled == other.enabled &&
fileName == other.fileName &&
order == other.order;
}

bool LUTOptions::operator != (const LUTOptions& other) const
{
return !(*this == other);
}

std::vector<std::string> getLUTFormatNames()
{
std::vector<std::string> out;
Expand Down
2 changes: 0 additions & 2 deletions lib/tlTimeline/ColorOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,3 @@ namespace tl
///@}
}
}

#include <tlTimeline/ColorOptionsInline.h>
38 changes: 0 additions & 38 deletions lib/tlTimeline/ColorOptionsInline.h

This file was deleted.

14 changes: 14 additions & 0 deletions lib/tlTimeline/CompareOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ namespace tl
"Relative",
"Absolute");

bool CompareOptions::operator == (const CompareOptions& other) const
{
return
compare == other.compare &&
wipeCenter == other.wipeCenter &&
wipeRotation == other.wipeRotation &&
overlay == other.overlay;
}

bool CompareOptions::operator != (const CompareOptions& other) const
{
return !(*this == other);
}

std::vector<dtk::Box2I> getBoxes(Compare compare, const std::vector<dtk::ImageInfo>& infos)
{
std::vector<dtk::Box2I> out;
Expand Down
2 changes: 0 additions & 2 deletions lib/tlTimeline/CompareOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,3 @@ namespace tl
CompareTime);
}
}

#include <tlTimeline/CompareOptionsInline.h>
23 changes: 0 additions & 23 deletions lib/tlTimeline/CompareOptionsInline.h

This file was deleted.

78 changes: 78 additions & 0 deletions lib/tlTimeline/DisplayOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ namespace tl
{
namespace timeline
{
bool Color::operator == (const Color& other) const
{
return
enabled == other.enabled &&
add == other.add &&
brightness == other.brightness &&
contrast == other.contrast &&
saturation == other.saturation &&
tint == other.tint &&
invert == other.invert;
}

bool Color::operator != (const Color& other) const
{
return !(*this == other);
}

dtk::M44F brightness(const dtk::V3F& value)
{
return dtk::M44F(
Expand Down Expand Up @@ -79,6 +96,67 @@ namespace tl
tint(in.tint);
}

bool Levels::operator == (const Levels& other) const
{
return
enabled == other.enabled &&
inLow == other.inLow &&
inHigh == other.inHigh &&
gamma == other.gamma &&
outLow == other.outLow &&
outHigh == other.outHigh;
}

bool Levels::operator != (const Levels& other) const
{
return !(*this == other);
}

bool EXRDisplay::operator == (const EXRDisplay& other) const
{
return
enabled == other.enabled &&
exposure == other.exposure &&
defog == other.defog &&
kneeLow == other.kneeLow &&
kneeHigh == other.kneeHigh;
}

bool EXRDisplay::operator != (const EXRDisplay& other) const
{
return !(*this == other);
}

bool SoftClip::operator == (const SoftClip& other) const
{
return
enabled == other.enabled &&
value == other.value;
}

bool SoftClip::operator != (const SoftClip& other) const
{
return !(*this == other);
}

bool DisplayOptions::operator == (const DisplayOptions& other) const
{
return
channels == other.channels &&
mirror == other.mirror &&
color == other.color &&
levels == other.levels &&
exrDisplay == other.exrDisplay &&
softClip == other.softClip &&
imageFilters == other.imageFilters &&
videoLevels == other.videoLevels;
}

bool DisplayOptions::operator != (const DisplayOptions& other) const
{
return !(*this == other);
}

void to_json(nlohmann::json& json, const Color& in)
{
json["enabled"] = in.enabled;
Expand Down
2 changes: 0 additions & 2 deletions lib/tlTimeline/DisplayOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,3 @@ namespace tl
///@}
}
}

#include <tlTimeline/DisplayOptionsInline.h>
Loading

0 comments on commit ad18e4b

Please sign in to comment.