From a72c66a9fb058e31e842021e197085e0176b9c44 Mon Sep 17 00:00:00 2001 From: Eric Reinecke Date: Thu, 6 Nov 2025 13:53:07 -0600 Subject: [PATCH] 0.18.0 release locking Signed-off-by: Eric Reinecke --- .github/workflows/python-package.yml | 32 ++++----- CONTRIBUTORS.md | 8 ++- setup.py | 2 +- src/opentime/export.h | 92 +++++++++++++------------ src/opentime/rationalTime.cpp | 3 +- src/opentime/timeRange.h | 10 +-- src/opentimelineio/CORE_VERSION_MAP.cpp | 2 +- src/opentimelineio/clip.cpp | 9 +-- src/opentimelineio/clip.h | 8 +-- src/opentimelineio/color.cpp | 65 ++++++++++------- src/opentimelineio/color.h | 33 +++++---- src/opentimelineio/composition.cpp | 9 ++- src/opentimelineio/composition.h | 2 +- src/opentimelineio/deserialization.cpp | 13 ++-- src/opentimelineio/effect.cpp | 2 +- src/opentimelineio/effect.h | 2 +- src/opentimelineio/export.h | 34 ++++----- src/opentimelineio/item.h | 12 +--- src/opentimelineio/serialization.cpp | 11 ++- src/opentimelineio/stack.cpp | 4 +- src/opentimelineio/track.cpp | 8 ++- 21 files changed, 192 insertions(+), 169 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b5f8472f49..d5c0502d2b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -6,7 +6,7 @@ name: OpenTimelineIO # for configuring which build will be a C++ coverage build / coverage report env: GH_COV_PY: "3.10" - GH_COV_OS: ubuntu-latest + GH_COV_OS: ubuntu-24.04 GH_DEPENDABOT: dependabot on: @@ -24,15 +24,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-14, macos-latest] + os: [ubuntu-24.04, windows-2025, macos-14, macos-15] # Unfortunately the CMake test target is OS dependent so we set it as # a variable here. include: - - os: ubuntu-latest + - os: ubuntu-24.04 OTIO_TEST_TARGET: test - - os: windows-latest + - os: windows-2025 OTIO_TEST_TARGET: RUN_TESTS - - os: macos-latest + - os: macos-15 OTIO_TEST_TARGET: test - os: macos-14 OTIO_TEST_TARGET: test @@ -92,16 +92,16 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-14, macos-latest] + os: [ubuntu-24.04, windows-2025, macos-14, macos-15] python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] include: - - { os: ubuntu-latest, shell: bash } - - { os: macos-latest, shell: bash } + - { os: ubuntu-24.04, shell: bash } + - { os: macos-15, shell: bash } - { os: macos-14, shell: bash } - - { os: windows-latest, shell: pwsh } - - { os: windows-latest, shell: msys2, python-version: "mingw64" } + - { os: windows-2025, shell: pwsh } + - { os: windows-2025, shell: msys2, python-version: "mingw64" } exclude: - - { os: macos-latest, python-version: 3.9 } + - { os: macos-15, python-version: 3.9 } defaults: run: @@ -173,16 +173,16 @@ jobs: matrix: os: [ - ubuntu-latest, + ubuntu-24.04, ubuntu-24.04-arm, - windows-latest, + windows-2025, macos-14, - macos-latest, + macos-15, ] python-build: ["cp39", "cp310", "cp311", "cp312", "cp313"] #exclude: # none currently - # - { os: macos-latest, python-build: 'cp37' } + # - { os: macos-15, python-build: 'cp37' } steps: - uses: actions/checkout@v4 @@ -205,7 +205,7 @@ jobs: package_sdist: needs: py_build_test - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 06e1a7c0bf..36e1ca4f43 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,6 +16,7 @@ If you know of anyone missing from this list, please contact us: https://lists.a * Darwyn Peachey ([peachey](https://github.com/peachey)) * David Baraff ([davidbaraff](https://github.com/davidbaraff)) * dgw ([dgw](https://github.com/dgw)) +* Dimitris Apostolou ([rex4539](https://github.com/rex4539)) * Doug Halley ([douglascomet](https://github.com/douglascomet)) * Ed Caspersen ([repsac](https://github.com/repsac)) * Emile Labrosse ([elabrosseRodeofx](https://github.com/elabrosseRodeofx)) @@ -24,8 +25,10 @@ If you know of anyone missing from this list, please contact us: https://lists.a * Eric Reinecke ([reinecke](https://github.com/reinecke)) * Evan Blaudy ([EvanBldy](https://github.com/EvanBldy)) * Flavian Liger ([flavienliger](https://github.com/flavienliger)) +* Florian Schleich ([fschleich](https://github.com/fschleich)) * Fredrik Brännbacka ([smaragden](https://github.com/smaragden)) * Freeson Wang ([freesonluxo](https://github.com/freesonluxo)) +* furby™ ([furby-tm](https://github.com/furby-tm)) * Félix Bourbonnais ([BadSingleton](https://github.com/BadSingleton)) * Félix David ([Tilix4](https://github.com/Tilix4)) * Gonzalo Garramuño ([ggarra13](https://github.com/ggarra13)) @@ -63,6 +66,7 @@ If you know of anyone missing from this list, please contact us: https://lists.a * Sergio Rojas ([hisergiorojas](https://github.com/hisergiorojas)) * Shahbaz Khan ([shahbazk8194](https://github.com/shahbazk8194)) * Simran Spiller ([Simran-B](https://github.com/Simran-B)) +* Spencer Magnusson ([semagnum](https://github.com/semagnum)) * Stefan Schulze ([stefanschulze](https://github.com/stefanschulze)) * Stephan Steinbach ([ssteinbach](https://github.com/ssteinbach)) * Stéphane Deverly ([gplsteph](https://github.com/gplsteph)) @@ -70,9 +74,11 @@ If you know of anyone missing from this list, please contact us: https://lists.a * Thierry Dervieux-Lecocq ([tdervieux](https://github.com/tdervieux)) * ThomasWilshaw ([ThomasWilshaw](https://github.com/ThomasWilshaw)) * Tim Lehr ([timlehr](https://github.com/timlehr)) +* Tom V ([tomviner](https://github.com/tomviner)) * Troy James Sobotka ([sobotka](https://github.com/sobotka)) * Tuan Truong ([tuan-huy-truong](https://github.com/tuan-huy-truong)) * Utsab Saha ([utsab](https://github.com/utsab)) * Valerio Viperino ([vvzen](https://github.com/vvzen)) * Vincent Pinon ([vpinon](https://github.com/vpinon)) -* Visaj Nirav Shah ([visajshah](https://github.com/visajshah)) \ No newline at end of file +* Visaj Nirav Shah ([visajshah](https://github.com/visajshah)) +* Yingjie Wang ([cato-o](https://github.com/cato-o)) \ No newline at end of file diff --git a/setup.py b/setup.py index 9ed48682b7..79de63c575 100644 --- a/setup.py +++ b/setup.py @@ -218,7 +218,7 @@ def cmake_install(self): # Metadata that gets stamped into the __init__ files during the build phase. PROJECT_METADATA = { - "version": "0.18.0.dev1", + "version": "0.18.0", "author": 'Contributors to the OpenTimelineIO project', "author_email": 'otio-discussion@lists.aswf.io', "license": 'Apache 2.0 License', diff --git a/src/opentime/export.h b/src/opentime/export.h index 5e05031b3a..0d937a4785 100644 --- a/src/opentime/export.h +++ b/src/opentime/export.h @@ -6,61 +6,63 @@ // For an explanation of how these export defines work, see: // https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/base/arch/export.h #if defined(_WINDOWS) -# if defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__) -# define OPENTIMELINEIO_EXPORT __attribute__((dllexport)) -# define OPENTIMELINEIO_IMPORT __attribute__((dllimport)) -# define OPENTIMELINEIO_HIDDEN -# define OPENTIMELINEIO_EXPORT_TYPE -# define OPENTIMELINEIO_IMPORT_TYPE -# else -# define OPENTIMELINEIO_EXPORT __declspec(dllexport) -# define OPENTIMELINEIO_IMPORT __declspec(dllimport) -# define OPENTIMELINEIO_HIDDEN -# define OPENTIMELINEIO_EXPORT_TYPE -# define OPENTIMELINEIO_IMPORT_TYPE -# endif +# if defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__) +# define OPENTIMELINEIO_EXPORT __attribute__((dllexport)) +# define OPENTIMELINEIO_IMPORT __attribute__((dllimport)) +# define OPENTIMELINEIO_HIDDEN +# define OPENTIMELINEIO_EXPORT_TYPE +# define OPENTIMELINEIO_IMPORT_TYPE +# else +# define OPENTIMELINEIO_EXPORT __declspec(dllexport) +# define OPENTIMELINEIO_IMPORT __declspec(dllimport) +# define OPENTIMELINEIO_HIDDEN +# define OPENTIMELINEIO_EXPORT_TYPE +# define OPENTIMELINEIO_IMPORT_TYPE +# endif #elif defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__) -# define OPENTIMELINEIO_EXPORT __attribute__((visibility("default"))) -# define OPENTIMELINEIO_IMPORT -# define OPENTIMELINEIO_HIDDEN __attribute__((visibility("hidden"))) -# if defined(__clang__) -# define OPENTIMELINEIO_EXPORT_TYPE __attribute__((type_visibility("default"))) -# else -# define OPENTIMELINEIO_EXPORT_TYPE __attribute__((visibility("default"))) -# endif -# define OPENTIMELINEIO_IMPORT_TYPE +# define OPENTIMELINEIO_EXPORT __attribute__((visibility("default"))) +# define OPENTIMELINEIO_IMPORT +# define OPENTIMELINEIO_HIDDEN __attribute__((visibility("hidden"))) +# if defined(__clang__) +# define OPENTIMELINEIO_EXPORT_TYPE \ + __attribute__((type_visibility("default"))) +# else +# define OPENTIMELINEIO_EXPORT_TYPE \ + __attribute__((visibility("default"))) +# endif +# define OPENTIMELINEIO_IMPORT_TYPE #else -# define OPENTIMELINEIO_EXPORT -# define OPENTIMELINEIO_IMPORT -# define OPENTIMELINEIO_HIDDEN -# define OPENTIMELINEIO_EXPORT_TYPE -# define OPENTIMELINEIO_IMPORT_TYPE +# define OPENTIMELINEIO_EXPORT +# define OPENTIMELINEIO_IMPORT +# define OPENTIMELINEIO_HIDDEN +# define OPENTIMELINEIO_EXPORT_TYPE +# define OPENTIMELINEIO_IMPORT_TYPE #endif #define OPENTIMELINEIO_EXPORT_TEMPLATE(type, ...) -#define OPENTIMELINEIO_IMPORT_TEMPLATE(type, ...) \ +#define OPENTIMELINEIO_IMPORT_TEMPLATE(type, ...) \ extern template type OPENTIMELINEIO_IMPORT __VA_ARGS__ #if defined(OPENTIME_STATIC) -# define OPENTIME_API -# define OPENTIME_API_TYPE -# define OPENTIME_API_TEMPLATE_CLASS(...) -# define OPENTIME_API_TEMPLATE_STRUCT(...) -# define OPENTIME_LOCAL +# define OPENTIME_API +# define OPENTIME_API_TYPE +# define OPENTIME_API_TEMPLATE_CLASS(...) +# define OPENTIME_API_TEMPLATE_STRUCT(...) +# define OPENTIME_LOCAL #else -# if defined(OPENTIME_EXPORTS) -# define OPENTIME_API OPENTIMELINEIO_EXPORT -# define OPENTIME_API_TYPE OPENTIMELINEIO_EXPORT_TYPE -# define OPENTIME_API_TEMPLATE_CLASS(...) \ +# if defined(OPENTIME_EXPORTS) +# define OPENTIME_API OPENTIMELINEIO_EXPORT +# define OPENTIME_API_TYPE OPENTIMELINEIO_EXPORT_TYPE +# define OPENTIME_API_TEMPLATE_CLASS(...) \ OPENTIMELINEIO_EXPORT_TEMPLATE(class, __VA_ARGS__) -# define OPENTIME_API_TEMPLATE_STRUCT(...) \ +# define OPENTIME_API_TEMPLATE_STRUCT(...) \ OPENTIMELINEIO_EXPORT_TEMPLATE(struct, __VA_ARGS__) -# else -# define OPENTIME_API OPENTIMELINEIO_IMPORT -# define OPENTIME_API_TYPE OPENTIMELINEIO_IMPORT_TYPE -# define OPENTIME_API_TEMPLATE_CLASS(...) \ +# else +# define OPENTIME_API OPENTIMELINEIO_IMPORT +# define OPENTIME_API_TYPE OPENTIMELINEIO_IMPORT_TYPE +# define OPENTIME_API_TEMPLATE_CLASS(...) \ OPENTIMELINEIO_IMPORT_TEMPLATE(class, __VA_ARGS__) -# define OPENTIME_API_TEMPLATE_STRUCT(...) \ +# define OPENTIME_API_TEMPLATE_STRUCT(...) \ OPENTIMELINEIO_IMPORT_TEMPLATE(struct, __VA_ARGS__) -# endif -# define OPENTIME_LOCAL OPENTIMELINEIO_HIDDEN +# endif +# define OPENTIME_LOCAL OPENTIMELINEIO_HIDDEN #endif diff --git a/src/opentime/rationalTime.cpp b/src/opentime/rationalTime.cpp index 0082e91394..a24dd273e5 100644 --- a/src/opentime/rationalTime.cpp +++ b/src/opentime/rationalTime.cpp @@ -32,8 +32,7 @@ static constexpr std::array smpte_timecode_rates{ 48.0, 50.0, 60000.0 / 1001.0, - 60.0 - } + 60.0 } }; // deprecated in favor of `is_smpte_timecode_rate` diff --git a/src/opentime/timeRange.h b/src/opentime/timeRange.h index 00067abc82..4f6dc5e10a 100644 --- a/src/opentime/timeRange.h +++ b/src/opentime/timeRange.h @@ -43,9 +43,7 @@ class OPENTIME_API_TYPE TimeRange {} /// @brief Construct a new time range with the given start time and duration. - constexpr TimeRange( - RationalTime start_time, - RationalTime duration) noexcept + constexpr TimeRange(RationalTime start_time, RationalTime duration) noexcept : _start_time{ start_time } , _duration{ duration } {} @@ -65,7 +63,8 @@ class OPENTIME_API_TYPE TimeRange /// duration is invalid, or if the duration is less than zero. bool is_invalid_range() const noexcept { - return _start_time.is_invalid_time() || _duration.is_invalid_time() || _duration.value() < 0.0; + return _start_time.is_invalid_time() || _duration.is_invalid_time() + || _duration.value() < 0.0; } /// @brief Returns true if the time range is valid. @@ -75,7 +74,8 @@ class OPENTIME_API_TYPE TimeRange /// zero. bool is_valid_range() const noexcept { - return _start_time.is_valid_time() && _duration.is_valid_time() && _duration.value() >= 0.0; + return _start_time.is_valid_time() && _duration.is_valid_time() + && _duration.value() >= 0.0; } /// @brief Returns the start time. diff --git a/src/opentimelineio/CORE_VERSION_MAP.cpp b/src/opentimelineio/CORE_VERSION_MAP.cpp index 1043902253..0dc98d4b11 100644 --- a/src/opentimelineio/CORE_VERSION_MAP.cpp +++ b/src/opentimelineio/CORE_VERSION_MAP.cpp @@ -142,7 +142,7 @@ const label_to_schema_version_map CORE_VERSION_MAP{ { "Transition", 1 }, { "UnknownSchema", 1 }, } }, - { "0.18.0.dev1", + { "0.18.0", { { "Adapter", 1 }, { "Clip", 2 }, diff --git a/src/opentimelineio/clip.cpp b/src/opentimelineio/clip.cpp index 12e67de563..4a60f5eaeb 100644 --- a/src/opentimelineio/clip.cpp +++ b/src/opentimelineio/clip.cpp @@ -17,7 +17,8 @@ Clip::Clip( std::vector const& markers, std::string const& active_media_reference_key, std::optional const& color) - : Parent{ name, source_range, metadata, effects, markers, /*enabled*/ true, color } + : Parent{ name, source_range, metadata, effects, + markers, /*enabled*/ true, color } , _active_media_reference_key(active_media_reference_key) { set_media_reference(media_reference); @@ -191,12 +192,12 @@ std::optional Clip::available_image_bounds(ErrorStatus* error_status) const { auto active_media = media_reference(); - + //this code path most likely never runs since a null or empty media_reference gets //replaced with a placeholder value when instantiated if (!active_media) { - if(error_status) + if (error_status) { *error_status = ErrorStatus( ErrorStatus::CANNOT_COMPUTE_BOUNDS, @@ -209,7 +210,7 @@ Clip::available_image_bounds(ErrorStatus* error_status) const if (!active_media->available_image_bounds()) { - if(error_status) + if (error_status) { *error_status = ErrorStatus( ErrorStatus::CANNOT_COMPUTE_BOUNDS, diff --git a/src/opentimelineio/clip.h b/src/opentimelineio/clip.h index e9371ad0cd..220597f7a5 100644 --- a/src/opentimelineio/clip.h +++ b/src/opentimelineio/clip.h @@ -44,10 +44,10 @@ class OTIO_API_TYPE Clip : public Item MediaReference* media_reference = nullptr, std::optional const& source_range = std::nullopt, AnyDictionary const& metadata = AnyDictionary(), - std::vector const& effects = std::vector(), - std::vector const& markers = std::vector(), - std::string const& active_media_reference_key = default_media_key, - std::optional const& color = std::nullopt); + std::vector const& effects = std::vector(), + std::vector const& markers = std::vector(), + std::string const& active_media_reference_key = default_media_key, + std::optional const& color = std::nullopt); /// @name Media References ///@{ diff --git a/src/opentimelineio/color.cpp b/src/opentimelineio/color.cpp index 7dcd6113e4..6581592303 100644 --- a/src/opentimelineio/color.cpp +++ b/src/opentimelineio/color.cpp @@ -9,22 +9,25 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { Color::Color( - double const r, - double const g, - double const b, - double const a, - std::string const& name) - : _r(r), - _g(g), - _b(b), - _a(a), - _name(name) {} - -Color::Color(Color const& other) : _r(other.r()), - _g(other.g()), - _b(other.b()), - _a(other.a()), - _name(other.name()) {} + double const r, + double const g, + double const b, + double const a, + std::string const& name) + : _r(r) + , _g(g) + , _b(b) + , _a(a) + , _name(name) +{} + +Color::Color(Color const& other) + : _r(other.r()) + , _g(other.g()) + , _b(other.b()) + , _a(other.a()) + , _name(other.name()) +{} const Color Color::pink(1.0, 0.0, 1.0, 1.0, "Pink"); const Color Color::red(1.0, 0.0, 0.0, 1.0, "Red"); @@ -54,9 +57,9 @@ Color::from_hex(std::string const& color) double _r, _g, _b, _a; // 0xFFFFFFFF (rgba, 255) - int BASE_16 = 16; + int BASE_16 = 16; double BASE_16_DIV = 255.0; - double BASE_8_DIV = 15.0; + double BASE_8_DIV = 15.0; if (temp.length() == 8) { _r = std::stoi(temp.substr(0, 2), nullptr, BASE_16) / BASE_16_DIV; @@ -88,7 +91,8 @@ Color::from_hex(std::string const& color) _b = std::stoi(temp.substr(2, 1), nullptr, BASE_16) / BASE_8_DIV; _a = std::stoi(temp.substr(3, 1), nullptr, BASE_16) / BASE_8_DIV; } - else { + else + { throw std::invalid_argument("Invalid hex format"); } return new Color(_r, _g, _b, _a); @@ -97,11 +101,19 @@ Color::from_hex(std::string const& color) Color* Color::from_int_list(std::vector const& color, int bit_depth) { - double depth = pow(2, bit_depth) - 1.0; // e.g. 8 = 255.0 + double depth = pow(2, bit_depth) - 1.0; // e.g. 8 = 255.0 if (color.size() == 3) - return new Color(color[0] / depth, color[1] / depth, color[2] / depth, 1.0); + return new Color( + color[0] / depth, + color[1] / depth, + color[2] / depth, + 1.0); else if (color.size() == 4) - return new Color(color[0] / depth, color[1] / depth, color[2] / depth, color[3] / depth); + return new Color( + color[0] / depth, + color[1] / depth, + color[2] / depth, + color[3] / depth); throw std::invalid_argument("List must have exactly 3 or 4 elements"); } @@ -130,7 +142,7 @@ Color::from_float_list(std::vector const& color) std::string Color::to_hex() { - auto rgba = to_rgba_int_list(8); + auto rgba = to_rgba_int_list(8); std::stringstream ss; ss << "#"; @@ -146,7 +158,10 @@ std::vector Color::to_rgba_int_list(int base) { double math_base = pow(2, base) - 1.0; - return {int(_r * math_base), int(_g * math_base), int(_b * math_base), int(_a * math_base)}; + return { int(_r * math_base), + int(_g * math_base), + int(_b * math_base), + int(_a * math_base) }; } unsigned int @@ -159,7 +174,7 @@ Color::to_agbr_integer() std::vector Color::to_rgba_float_list() { - return {_r, _g, _b, _a}; + return { _r, _g, _b, _a }; } }} // namespace opentimelineio::OPENTIMELINEIO_VERSION \ No newline at end of file diff --git a/src/opentimelineio/color.h b/src/opentimelineio/color.h index a82c3ebb44..e8c1119ab4 100644 --- a/src/opentimelineio/color.h +++ b/src/opentimelineio/color.h @@ -11,7 +11,6 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { - /// @brief Color consists of red, green, blue, /// and alpha double floating point values, /// allowing conversion between different formats. @@ -32,11 +31,11 @@ class OTIO_API_TYPE Color }; OTIO_API Color( - double const r = 1.f, - double const g = 1.f, - double const b = 1.f, - double const a = 1.f, - std::string const& name = ""); + double const r = 1.f, + double const g = 1.f, + double const b = 1.f, + double const a = 1.f, + std::string const& name = ""); OTIO_API Color(Color const& other); @@ -58,10 +57,10 @@ class OTIO_API_TYPE Color static Color* from_agbr_int(unsigned int agbr) noexcept; static Color* from_float_list(std::vector const& color); - friend bool - operator==(Color lhs, Color rhs) noexcept + friend bool operator==(Color lhs, Color rhs) noexcept { - return lhs.to_hex() == rhs.to_hex() && lhs.to_agbr_integer() == rhs.to_agbr_integer(); + return lhs.to_hex() == rhs.to_hex() + && lhs.to_agbr_integer() == rhs.to_agbr_integer(); } OTIO_API std::string to_hex(); @@ -69,10 +68,10 @@ class OTIO_API_TYPE Color OTIO_API unsigned int to_agbr_integer(); OTIO_API std::vector to_rgba_float_list(); - double r() const { return _r; } - double g() const { return _g; } - double b() const { return _b; } - double a() const { return _a; } + double r() const { return _r; } + double g() const { return _g; } + double b() const { return _b; } + double a() const { return _a; } std::string name() const { return _name; } void set_r(double r) { _r = r; } @@ -82,10 +81,10 @@ class OTIO_API_TYPE Color void set_name(std::string const& name) { _name = name; } private: - double _r; - double _g; - double _b; - double _a; + double _r; + double _g; + double _b; + double _a; std::string _name; }; diff --git a/src/opentimelineio/composition.cpp b/src/opentimelineio/composition.cpp index 8de379960d..3021a77a6a 100644 --- a/src/opentimelineio/composition.cpp +++ b/src/opentimelineio/composition.cpp @@ -17,7 +17,14 @@ Composition::Composition( std::vector const& effects, std::vector const& markers, std::optional const& color) - : Parent(name, source_range, metadata, effects, markers, /*enabled*/ true, color) + : Parent( + name, + source_range, + metadata, + effects, + markers, + /*enabled*/ true, + color) {} Composition::~Composition() diff --git a/src/opentimelineio/composition.h b/src/opentimelineio/composition.h index 25069e726b..8392f1bb92 100644 --- a/src/opentimelineio/composition.h +++ b/src/opentimelineio/composition.h @@ -161,7 +161,7 @@ class OTIO_API_TYPE Composition : public Item ErrorStatus* error_status = nullptr, std::optional search_range = std::nullopt, bool shallow_search = false) const; - + /// @brief Find child clips. /// /// @param error_status The return status. diff --git a/src/opentimelineio/deserialization.cpp b/src/opentimelineio/deserialization.cpp index 952a89e4ce..6fc5c75dbe 100644 --- a/src/opentimelineio/deserialization.cpp +++ b/src/opentimelineio/deserialization.cpp @@ -590,13 +590,10 @@ SerializableObject::Reader::_decode(_Resolver& resolver) } else if (schema_name_and_version == "Color.1") { - double r, g, b, a; + double r, g, b, a; std::string name; - return _fetch("name", &name) - && _fetch("r", &r) - && _fetch("g", &g) - && _fetch("b", &b) - && _fetch("a", &a) + return _fetch("name", &name) && _fetch("r", &r) && _fetch("g", &g) + && _fetch("b", &b) && _fetch("a", &a) ? std::any(Color(r, g, b, a, name)) : std::any(); } @@ -837,8 +834,8 @@ SerializableObject::Reader::read( bool SerializableObject::Reader::read( - std::string const& key, - std::optional* value) + std::string const& key, + std::optional* value) { return _read_optional(key, value); } diff --git a/src/opentimelineio/effect.cpp b/src/opentimelineio/effect.cpp index e6daf05257..5923690ba5 100644 --- a/src/opentimelineio/effect.cpp +++ b/src/opentimelineio/effect.cpp @@ -10,7 +10,7 @@ Effect::Effect( std::string const& name, std::string const& effect_name, AnyDictionary const& metadata, - bool enabled) + bool enabled) : Parent(name, metadata) , _effect_name(effect_name) , _enabled(enabled) diff --git a/src/opentimelineio/effect.h b/src/opentimelineio/effect.h index 27981942e7..fb43265fc4 100644 --- a/src/opentimelineio/effect.h +++ b/src/opentimelineio/effect.h @@ -46,7 +46,7 @@ class OTIO_API_TYPE Effect : public SerializableObjectWithMetadata bool enabled() const { return _enabled; }; /// @brief Set whether the effect is enabled. - void set_enabled(bool enabled) { _enabled = enabled; } + void set_enabled(bool enabled) { _enabled = enabled; } protected: virtual ~Effect(); diff --git a/src/opentimelineio/export.h b/src/opentimelineio/export.h index 256bc52155..08e9176595 100644 --- a/src/opentimelineio/export.h +++ b/src/opentimelineio/export.h @@ -6,26 +6,26 @@ #include "opentime/export.h" #if defined(OTIO_STATIC) -# define OTIO_API -# define OTIO_API_TYPE -# define OTIO_API_TEMPLATE_CLASS(...) -# define OTIO_API_TEMPLATE_STRUCT(...) -# define OTIO_LOCAL +# define OTIO_API +# define OTIO_API_TYPE +# define OTIO_API_TEMPLATE_CLASS(...) +# define OTIO_API_TEMPLATE_STRUCT(...) +# define OTIO_LOCAL #else -# if defined(OTIO_EXPORTS) -# define OTIO_API OPENTIMELINEIO_EXPORT -# define OTIO_API_TYPE OPENTIMELINEIO_EXPORT_TYPE -# define OTIO_API_TEMPLATE_CLASS(...) \ +# if defined(OTIO_EXPORTS) +# define OTIO_API OPENTIMELINEIO_EXPORT +# define OTIO_API_TYPE OPENTIMELINEIO_EXPORT_TYPE +# define OTIO_API_TEMPLATE_CLASS(...) \ OPENTIMELINEIO_EXPORT_TEMPLATE(class, __VA_ARGS__) -# define OTIO_API_TEMPLATE_STRUCT(...) \ +# define OTIO_API_TEMPLATE_STRUCT(...) \ OPENTIMELINEIO_EXPORT_TEMPLATE(struct, __VA_ARGS__) -# else -# define OTIO_API OPENTIMELINEIO_IMPORT -# define OTIO_API_TYPE OPENTIMELINEIO_IMPORT_TYPE -# define OTIO_API_TEMPLATE_CLASS(...) \ +# else +# define OTIO_API OPENTIMELINEIO_IMPORT +# define OTIO_API_TYPE OPENTIMELINEIO_IMPORT_TYPE +# define OTIO_API_TEMPLATE_CLASS(...) \ OPENTIMELINEIO_IMPORT_TEMPLATE(class, __VA_ARGS__) -# define OTIO_API_TEMPLATE_STRUCT(...) \ +# define OTIO_API_TEMPLATE_STRUCT(...) \ OPENTIMELINEIO_IMPORT_TEMPLATE(struct, __VA_ARGS__) -# endif -# define OTIO_LOCAL OPENTIMELINEIO_HIDDEN +# endif +# define OTIO_LOCAL OPENTIMELINEIO_HIDDEN #endif diff --git a/src/opentimelineio/item.h b/src/opentimelineio/item.h index 20e74f345c..f84d619fb6 100644 --- a/src/opentimelineio/item.h +++ b/src/opentimelineio/item.h @@ -102,7 +102,7 @@ class OTIO_API_TYPE Item : public Composable /// @brief Return the trimmed range of the item in the parent's time. OTIO_API std::optional - trimmed_range_in_parent(ErrorStatus* error_status = nullptr) const; + trimmed_range_in_parent(ErrorStatus* error_status = nullptr) const; /// @brief Return the range of the item in the parent's time. OTIO_API TimeRange @@ -120,16 +120,10 @@ class OTIO_API_TYPE Item : public Composable Item const* to_item, ErrorStatus* error_status = nullptr) const; - std::optional color() const noexcept - { - return _color; - } + std::optional color() const noexcept { return _color; } /// @brief Set the color of the item. - void set_color(std::optional const& color) - { - _color = color; - } + void set_color(std::optional const& color) { _color = color; } protected: virtual ~Item(); diff --git a/src/opentimelineio/serialization.cpp b/src/opentimelineio/serialization.cpp index 632b406ba2..71cfd48cbd 100644 --- a/src/opentimelineio/serialization.cpp +++ b/src/opentimelineio/serialization.cpp @@ -260,12 +260,9 @@ class CloningEncoder : public Encoder if (_result_object_policy == ResultObjectPolicy::OnlyAnyDictionary) { AnyDictionary result{ - { "OTIO_SCHEMA", "Color.1" }, - { "r", value.r() }, - { "g", value.g() }, - { "b", value.b() }, - { "a", value.a() }, - { "name", value.name() }, + { "OTIO_SCHEMA", "Color.1" }, { "r", value.r() }, + { "g", value.g() }, { "b", value.b() }, + { "a", value.a() }, { "name", value.name() }, }; _store(std::any(std::move(result))); } @@ -983,7 +980,7 @@ SerializableObject::Writer::write(std::string const& key, TimeTransform value) void SerializableObject::Writer::write( - std::string const& key, + std::string const& key, std::optional value) { _encoder_write_key(key); diff --git a/src/opentimelineio/stack.cpp b/src/opentimelineio/stack.cpp index ee7ceeb378..b6d58a1864 100644 --- a/src/opentimelineio/stack.cpp +++ b/src/opentimelineio/stack.cpp @@ -82,10 +82,10 @@ Stack::range_of_all_children(ErrorStatus* error_status) const std::vector> Stack::children_in_range( TimeRange const& search_range, - ErrorStatus* error_status) const + ErrorStatus* error_status) const { std::vector> children; - for (const auto& child : this->children()) + for (const auto& child: this->children()) { if (const auto& item = dynamic_retainer_cast(child)) { diff --git a/src/opentimelineio/track.cpp b/src/opentimelineio/track.cpp index 44d372b229..b104f5d4a3 100644 --- a/src/opentimelineio/track.cpp +++ b/src/opentimelineio/track.cpp @@ -15,7 +15,13 @@ Track::Track( std::string const& kind, AnyDictionary const& metadata, std::optional const& color) - : Parent(name, source_range, metadata, std::vector(), std::vector(), color) + : Parent( + name, + source_range, + metadata, + std::vector(), + std::vector(), + color) , _kind(kind) {}