Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/opentime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if(OTIO_SHARED_LIBS)
VERSION ${OTIO_VERSION})
target_compile_definitions(
opentime
PUBLIC
PRIVATE
OPENTIME_EXPORTS)
else()
target_compile_definitions(
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ if(OTIO_SHARED_LIBS)
VERSION ${OTIO_VERSION})
target_compile_definitions(
opentimelineio
PUBLIC
PRIVATE
OTIO_EXPORTS)
else()
target_compile_definitions(
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/bundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace bundle {
};

/// @brief Get a file from a URL.
std::optional<std::string> file_from_url(std::string const& url);
OTIO_API std::optional<std::string> file_from_url(std::string const& url);

/// @brief Options for writing bundles.
struct OTIO_API_TYPE WriteOptions
Expand Down
34 changes: 17 additions & 17 deletions src/opentimelineio/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ class OTIO_API_TYPE Color

OTIO_API Color(Color const& other);

static const Color pink;
static const Color red;
static const Color orange;
static const Color yellow;
static const Color green;
static const Color cyan;
static const Color blue;
static const Color purple;
static const Color magenta;
static const Color black;
static const Color white;
static const Color transparent;

static Color* from_hex(std::string const& color);
static Color* from_int_list(std::vector<int> const& color, int bit_depth);
static Color* from_agbr_int(unsigned int agbr) noexcept;
static Color* from_float_list(std::vector<double> const& color);
OTIO_API static const Color pink;
OTIO_API static const Color red;
OTIO_API static const Color orange;
OTIO_API static const Color yellow;
OTIO_API static const Color green;
OTIO_API static const Color cyan;
OTIO_API static const Color blue;
OTIO_API static const Color purple;
OTIO_API static const Color magenta;
OTIO_API static const Color black;
OTIO_API static const Color white;
OTIO_API static const Color transparent;

OTIO_API static Color* from_hex(std::string const& color);
OTIO_API static Color* from_int_list(std::vector<int> const& color, int bit_depth);
OTIO_API static Color* from_agbr_int(unsigned int agbr) noexcept;
OTIO_API static Color* from_float_list(std::vector<double> const& color);

friend bool operator==(Color lhs, Color rhs) noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/composition.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class OTIO_API_TYPE Composition : public Item
/// @param shallow_search The search is recursive unless shallow_search is
/// set to true.
template <typename T = Composable>
OTIO_API std::vector<Retainer<T>> find_children(
std::vector<Retainer<T>> find_children(
ErrorStatus* error_status = nullptr,
std::optional<TimeRange> search_range = std::nullopt,
bool shallow_search = false) const;
Expand Down
2 changes: 2 additions & 0 deletions src/opentimelineio/deserialization.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project

#include "opentimelineio/deserialization.h"

#include "opentime/rationalTime.h"
#include "opentime/timeRange.h"
#include "opentime/timeTransform.h"
Expand Down
10 changes: 5 additions & 5 deletions src/opentimelineio/imageSequenceReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,23 @@ class OTIO_API_TYPE ImageSequenceReference final : public MediaReference
}

/// @brief Return the end frame.
int end_frame() const;
OTIO_API int end_frame() const;

/// @brief Return the number of images in the sequence.
int number_of_images_in_sequence() const;
OTIO_API int number_of_images_in_sequence() const;

/// @brief Return the frame for the given time.
int frame_for_time(
OTIO_API int frame_for_time(
RationalTime const& time,
ErrorStatus* error_status = nullptr) const;

/// @brief Return the target URL for the given image number.
std::string target_url_for_image_number(
OTIO_API std::string target_url_for_image_number(
int image_number,
ErrorStatus* error_status = nullptr) const;

/// @brief Return the presentation time for the given image number.
RationalTime presentation_time_for_image_number(
OTIO_API RationalTime presentation_time_for_image_number(
int image_number,
ErrorStatus* error_status = nullptr) const;

Expand Down
63 changes: 32 additions & 31 deletions src/opentimelineio/safely_typed_any.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/// common library. That's why the seemingly silly code in safely_typed_any.cpp
/// exists.

#include "opentimelineio/export.h"
#include "opentime/rationalTime.h"
#include "opentime/timeRange.h"
#include "opentime/timeTransform.h"
Expand All @@ -31,48 +32,48 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION_NS {
/// @name Any Create
///@{

std::any create_safely_typed_any(bool&&);
std::any create_safely_typed_any(int&&);
std::any create_safely_typed_any(int64_t&&);
std::any create_safely_typed_any(uint64_t&&);
std::any create_safely_typed_any(double&&);
std::any create_safely_typed_any(std::string&&);
std::any create_safely_typed_any(RationalTime&&);
std::any create_safely_typed_any(TimeRange&&);
std::any create_safely_typed_any(Color&&);
std::any create_safely_typed_any(TimeTransform&&);
std::any create_safely_typed_any(IMATH_NAMESPACE::V2d&&);
std::any create_safely_typed_any(IMATH_NAMESPACE::Box2d&&);
std::any create_safely_typed_any(AnyVector&&);
std::any create_safely_typed_any(AnyDictionary&&);
std::any create_safely_typed_any(SerializableObject*);
OTIO_API std::any create_safely_typed_any(bool&&);
OTIO_API std::any create_safely_typed_any(int&&);
OTIO_API std::any create_safely_typed_any(int64_t&&);
OTIO_API std::any create_safely_typed_any(uint64_t&&);
OTIO_API std::any create_safely_typed_any(double&&);
OTIO_API std::any create_safely_typed_any(std::string&&);
OTIO_API std::any create_safely_typed_any(RationalTime&&);
OTIO_API std::any create_safely_typed_any(TimeRange&&);
OTIO_API std::any create_safely_typed_any(Color&&);
OTIO_API std::any create_safely_typed_any(TimeTransform&&);
OTIO_API std::any create_safely_typed_any(IMATH_NAMESPACE::V2d&&);
OTIO_API std::any create_safely_typed_any(IMATH_NAMESPACE::Box2d&&);
OTIO_API std::any create_safely_typed_any(AnyVector&&);
OTIO_API std::any create_safely_typed_any(AnyDictionary&&);
OTIO_API std::any create_safely_typed_any(SerializableObject*);

///@}

/// @name Any Casting
///@{

bool safely_cast_bool_any(std::any const& a);
int safely_cast_int_any(std::any const& a);
int64_t safely_cast_int64_any(std::any const& a);
uint64_t safely_cast_uint64_any(std::any const& a);
double safely_cast_double_any(std::any const& a);
std::string safely_cast_string_any(std::any const& a);
RationalTime safely_cast_rational_time_any(std::any const& a);
TimeRange safely_cast_time_range_any(std::any const& a);
TimeTransform safely_cast_time_transform_any(std::any const& a);
Color safely_cast_color_any(std::any const& a);
IMATH_NAMESPACE::V2d safely_cast_point_any(std::any const& a);
IMATH_NAMESPACE::Box2d safely_cast_box_any(std::any const& a);
OTIO_API bool safely_cast_bool_any(std::any const& a);
OTIO_API int safely_cast_int_any(std::any const& a);
OTIO_API int64_t safely_cast_int64_any(std::any const& a);
OTIO_API uint64_t safely_cast_uint64_any(std::any const& a);
OTIO_API double safely_cast_double_any(std::any const& a);
OTIO_API std::string safely_cast_string_any(std::any const& a);
OTIO_API RationalTime safely_cast_rational_time_any(std::any const& a);
OTIO_API TimeRange safely_cast_time_range_any(std::any const& a);
OTIO_API TimeTransform safely_cast_time_transform_any(std::any const& a);
OTIO_API Color safely_cast_color_any(std::any const& a);
OTIO_API IMATH_NAMESPACE::V2d safely_cast_point_any(std::any const& a);
OTIO_API IMATH_NAMESPACE::Box2d safely_cast_box_any(std::any const& a);

SerializableObject* safely_cast_retainer_any(std::any const& a);
OTIO_API SerializableObject* safely_cast_retainer_any(std::any const& a);

AnyDictionary safely_cast_any_dictionary_any(std::any const& a);
OTIO_API AnyDictionary safely_cast_any_dictionary_any(std::any const& a);
AnyVector safely_cast_any_vector_any(std::any const& a);

/// @bug Don't use these unless you know what you're doing...
AnyDictionary& temp_safely_cast_any_dictionary_any(std::any const& a);
AnyVector& temp_safely_cast_any_vector_any(std::any const& a);
OTIO_API AnyDictionary& temp_safely_cast_any_dictionary_any(std::any const& a);
OTIO_API AnyVector& temp_safely_cast_any_vector_any(std::any const& a);

///@}

Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/serializableCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class OTIO_API_TYPE SerializableCollection
/// @param shallow_search The search is recursive unless shallow_search is
/// set to true.
template <typename T = Composable>
OTIO_API std::vector<Retainer<T>> find_children(
std::vector<Retainer<T>> find_children(
ErrorStatus* error_status = nullptr,
std::optional<TimeRange> search_range = std::nullopt,
bool shallow_search = false) const;
Expand Down
24 changes: 12 additions & 12 deletions src/opentimelineio/serializableObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class OTIO_API_TYPE SerializableObject
bool read(std::string const& key, IMATH_NAMESPACE::Box2d* value);
bool read(std::string const& key, AnyVector* dest);
bool read(std::string const& key, AnyDictionary* dest);
bool read(std::string const& key, std::any* dest);
OTIO_API bool read(std::string const& key, std::any* dest);

bool read(std::string const& key, std::optional<bool>* dest);
bool read(std::string const& key, std::optional<int>* dest);
Expand Down Expand Up @@ -402,7 +402,7 @@ class OTIO_API_TYPE SerializableObject
bool _fetch(std::string const& key, int64_t* dest);
bool _fetch(std::string const& key, double* dest);
bool _fetch(std::string const& key, SerializableObject** dest);
bool
OTIO_API bool
_type_check(std::type_info const& wanted, std::type_info const& found);
bool _type_check_so(
std::type_info const& wanted,
Expand Down Expand Up @@ -446,7 +446,7 @@ class OTIO_API_TYPE SerializableObject
ErrorStatus* error_status = nullptr);

void write(std::string const& key, bool value);
void write(std::string const& key, int64_t value);
OTIO_API void write(std::string const& key, int64_t value);
void write(std::string const& key, double value);
void write(std::string const& key, std::string const& value);
void write(std::string const& key, RationalTime value);
Expand Down Expand Up @@ -604,13 +604,13 @@ class OTIO_API_TYPE SerializableObject
};

/// @brief Deserialize from the given reader.
virtual bool read_from(Reader&);
OTIO_API virtual bool read_from(Reader&);

/// @brief Serialize to the given writer.
virtual void write_to(Writer&) const;
OTIO_API virtual void write_to(Writer&) const;

/// @brief Return whether this schema is unknown.
virtual bool is_unknown_schema() const;
OTIO_API virtual bool is_unknown_schema() const;

/// @brief Return the schema name.
std::string schema_name() const { return _type_record()->schema_name; }
Expand Down Expand Up @@ -673,11 +673,11 @@ class OTIO_API_TYPE SerializableObject
};

protected:
virtual ~SerializableObject();
OTIO_API virtual ~SerializableObject();

virtual bool _is_deletable();
OTIO_API virtual bool _is_deletable();

virtual std::string _schema_name_for_reference() const;
OTIO_API virtual std::string _schema_name_for_reference() const;

private:
SerializableObject(SerializableObject const&) = delete;
Expand All @@ -700,12 +700,12 @@ class OTIO_API_TYPE SerializableObject
};

/// @todo Add comment.
void install_external_keepalive_monitor(
OTIO_API void install_external_keepalive_monitor(
std::function<void()> monitor,
bool apply_now);

/// @brief Return the current reference count.
int current_ref_count() const;
OTIO_API int current_ref_count() const;

/// @brief This struct provides an unknown type.
struct UnknownType
Expand All @@ -719,7 +719,7 @@ class OTIO_API_TYPE SerializableObject
_cached_type_record = type_record;
}

TypeRegistry::_TypeRecord const* _type_record() const;
OTIO_API TypeRegistry::_TypeRecord const* _type_record() const;

mutable TypeRegistry::_TypeRecord const* _cached_type_record;
int _managed_ref_count;
Expand Down
6 changes: 3 additions & 3 deletions src/opentimelineio/serializableObjectWithMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class OTIO_API_TYPE SerializableObjectWithMetadata : public SerializableObject
AnyDictionary metadata() const noexcept { return _metadata; }

protected:
virtual ~SerializableObjectWithMetadata();
OTIO_API virtual ~SerializableObjectWithMetadata();

bool read_from(Reader&) override;
void write_to(Writer&) const override;
OTIO_API bool read_from(Reader&) override;
OTIO_API void write_to(Writer&) const override;

private:
std::string _name;
Expand Down
2 changes: 2 additions & 0 deletions src/opentimelineio/stringUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project

#include "stringUtils.h"

#include "opentimelineio/serializableObject.h"
#include <cstdlib>
#include <memory>
Expand Down
7 changes: 4 additions & 3 deletions src/opentimelineio/stringUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include "opentime/stringPrintf.h"
#include "opentimelineio/export.h"
#include "opentimelineio/version.h"
using opentime::string_printf;

Expand All @@ -17,9 +18,9 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION_NS {

void fatal_error(std::string const& errMsg);

std::string type_name_for_error_message(std::type_info const&);
std::string type_name_for_error_message(std::any const& a);
std::string type_name_for_error_message(class SerializableObject*);
OTIO_API std::string type_name_for_error_message(std::type_info const&);
OTIO_API std::string type_name_for_error_message(std::any const& a);
OTIO_API std::string type_name_for_error_message(class SerializableObject*);

template <typename T>
std::string
Expand Down
4 changes: 2 additions & 2 deletions src/opentimelineio/timeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class OTIO_API_TYPE Timeline : public SerializableObjectWithMetadata
}*/

/// @brief Set the timeline stack.
void set_tracks(Stack* stack);
OTIO_API void set_tracks(Stack* stack);

/// @brief Return the global start time.
std::optional<RationalTime> global_start_time() const noexcept
Expand Down Expand Up @@ -97,7 +97,7 @@ class OTIO_API_TYPE Timeline : public SerializableObjectWithMetadata
/// @param shallow_search The search is recursive unless shallow_search is
/// set to true.
template <typename T = Composable>
OTIO_API std::vector<Retainer<T>> find_children(
std::vector<Retainer<T>> find_children(
ErrorStatus* error_status = nullptr,
std::optional<TimeRange> search_range = std::nullopt,
bool shallow_search = false) const;
Expand Down
4 changes: 2 additions & 2 deletions src/opentimelineio/transition.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class OTIO_API_TYPE Transition : public Composable
RationalTime duration(ErrorStatus* error_status = nullptr) const override;

/// @brief Return the range in the parent's time.
std::optional<TimeRange>
OTIO_API std::optional<TimeRange>
range_in_parent(ErrorStatus* error_status = nullptr) const;

/// @brief Return the range trimmed in the parent's time.
std::optional<TimeRange>
OTIO_API std::optional<TimeRange>
trimmed_range_in_parent(ErrorStatus* error_status = nullptr) const;

protected:
Expand Down
Loading
Loading