Skip to content

Commit 9ad27fd

Browse files
committed
Fixes for Windows
Signed-off-by: Darby Johnston <[email protected]>
1 parent 3b471f0 commit 9ad27fd

35 files changed

+142
-130
lines changed

src/opentimelineio/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ target_link_libraries(opentimelineio
101101
set_target_properties(opentimelineio PROPERTIES
102102
DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX}"
103103
LIBRARY_OUTPUT_NAME "opentimelineio"
104-
POSITION_INDEPENDENT_CODE TRUE
105-
WINDOWS_EXPORT_ALL_SYMBOLS true)
104+
POSITION_INDEPENDENT_CODE TRUE)
106105

107106
if(BUILD_SHARED_LIBS)
108107
set_target_properties(opentimelineio PROPERTIES

src/opentimelineio/algo/editAlgorithm.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum class ReferencePoint
3838
//
3939
// If overwrite range starts and ends before A, a gap hole is filled with
4040
// fill_template.
41-
void overwrite(
41+
OTIO_API void overwrite(
4242
Item* item,
4343
Composition* composition,
4444
TimeRange const& range,
@@ -62,7 +62,7 @@ void overwrite(
6262
// If A and B's length is L1 and C's length is L2, the end result is L1 + L2.
6363
// A is split.
6464
//
65-
void insert(
65+
OTIO_API void insert(
6666
Item* const item,
6767
Composition* composition,
6868
RationalTime const& time,
@@ -88,7 +88,7 @@ void insert(
8888
// Fill now-"empty" time with gap or template
8989
// Unless item is meeting a Gap, then, existing Gap's duration will be augmented
9090
//
91-
void trim(
91+
OTIO_API void trim(
9292
Item* item,
9393
RationalTime const& delta_in,
9494
RationalTime const& delta_out,
@@ -101,7 +101,7 @@ void trim(
101101
// ^
102102
// composition = usually a track item.
103103
// time = time to slice at.
104-
void slice(
104+
OTIO_API void slice(
105105
Composition* composition,
106106
RationalTime const& time,
107107
bool const remove_transitions = true,
@@ -119,7 +119,7 @@ void slice(
119119
// Do not affect item duration.
120120
// Do not affect surrounding items.
121121
// Clamp to available_range of media (if available)
122-
void slip(Item* item, RationalTime const& delta);
122+
OTIO_API void slip(Item* item, RationalTime const& delta);
123123

124124
//
125125
// Slide an item start_time by + or -, adjusting the previous item's duration.
@@ -133,7 +133,7 @@ void slip(Item* item, RationalTime const& delta);
133133
//
134134
// If item is the first clip, it does nothing.
135135
//
136-
void slide(Item* item, RationalTime const& delta);
136+
OTIO_API void slide(Item* item, RationalTime const& delta);
137137

138138
//
139139
// Adjust a source_range without affecting any other items.
@@ -146,7 +146,7 @@ void slide(Item* item, RationalTime const& delta);
146146
// will be adjusted by
147147
// delta_out = RationalTime that the item's
148148
// source_range().end_time_exclusive() will be adjusted by
149-
void ripple(
149+
OTIO_API void ripple(
150150
Item* item,
151151
RationalTime const& delta_in,
152152
RationalTime const& delta_out,
@@ -168,7 +168,7 @@ void ripple(
168168
// will be adjusted by
169169
// delta_out = RationalTime that the item's
170170
// source_range().end_time_exclusive() will be adjusted by
171-
void roll(
171+
OTIO_API void roll(
172172
Item* item,
173173
RationalTime const& delta_in,
174174
RationalTime const& delta_out,
@@ -186,7 +186,7 @@ void roll(
186186
// reference_point = For 4 point editing, the reference point dictates what
187187
// transform to use when running the fill.
188188
//
189-
void fill(
189+
OTIO_API void fill(
190190
Item* item,
191191
Composition* track,
192192
RationalTime const& track_time,
@@ -207,7 +207,7 @@ void fill(
207207
//
208208
// if fill is not set, A and B become concatenated, with no fill.
209209
//
210-
void remove(
210+
OTIO_API void remove(
211211
Composition* composition,
212212
RationalTime const& time,
213213
bool const fill = true,

src/opentimelineio/anyDictionary.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
2525
/// This allows us to hand out iterators that can be aware of mutation and moves
2626
/// and take steps to safe-guard themselves from causing a crash. (Yes, I'm
2727
/// talking to you, Python...)
28-
class OTIO_API AnyDictionary : private std::map<std::string, std::any>
28+
class OTIO_API_TYPE AnyDictionary : private std::map<std::string, std::any>
2929
{
3030
public:
3131
using map::map;
3232

3333
/// @brief Create an empty dictionary.
34-
OTIO_API AnyDictionary()
34+
AnyDictionary()
3535
: map{}
3636
, _mutation_stamp{}
3737
{}
@@ -40,13 +40,13 @@ class OTIO_API AnyDictionary : private std::map<std::string, std::any>
4040
///
4141
/// To be safe, avoid brace-initialization so as to not trigger
4242
/// list initialization behavior in older compilers:
43-
OTIO_API AnyDictionary(const AnyDictionary& other)
43+
AnyDictionary(const AnyDictionary& other)
4444
: map(other)
4545
, _mutation_stamp{}
4646
{}
4747

4848
/// @brief Destructor.
49-
OTIO_API ~AnyDictionary()
49+
~AnyDictionary()
5050
{
5151
if (_mutation_stamp)
5252
{
@@ -56,15 +56,15 @@ class OTIO_API AnyDictionary : private std::map<std::string, std::any>
5656
}
5757

5858
/// @brief Copy operator.
59-
OTIO_API AnyDictionary& operator=(const AnyDictionary& other)
59+
AnyDictionary& operator=(const AnyDictionary& other)
6060
{
6161
mutate();
6262
map::operator=(other);
6363
return *this;
6464
}
6565

6666
/// @brief Move operator.
67-
OTIO_API AnyDictionary& operator=(AnyDictionary&& other)
67+
AnyDictionary& operator=(AnyDictionary&& other)
6868
{
6969
mutate();
7070
other.mutate();
@@ -73,7 +73,7 @@ class OTIO_API AnyDictionary : private std::map<std::string, std::any>
7373
}
7474

7575
/// @brief Copy operator.
76-
OTIO_API AnyDictionary& operator=(std::initializer_list<value_type> ilist)
76+
AnyDictionary& operator=(std::initializer_list<value_type> ilist)
7777
{
7878
mutate();
7979
map::operator=(ilist);
@@ -95,7 +95,7 @@ class OTIO_API AnyDictionary : private std::map<std::string, std::any>
9595
using map::rend;
9696

9797
/// @brief Clear the dictionary.
98-
OTIO_API void clear() noexcept
98+
void clear() noexcept
9999
{
100100
mutate();
101101
map::clear();
@@ -105,28 +105,28 @@ class OTIO_API AnyDictionary : private std::map<std::string, std::any>
105105
using map::insert;
106106

107107
/// @brief Erase an item.
108-
OTIO_API iterator erase(const_iterator pos)
108+
iterator erase(const_iterator pos)
109109
{
110110
mutate();
111111
return map::erase(pos);
112112
}
113113

114114
/// @brief Erase a range of items.
115-
OTIO_API iterator erase(const_iterator first, const_iterator last)
115+
iterator erase(const_iterator first, const_iterator last)
116116
{
117117
mutate();
118118
return map::erase(first, last);
119119
}
120120

121121
/// @brief Erase an item with the given key.
122-
OTIO_API size_type erase(const key_type& key)
122+
size_type erase(const key_type& key)
123123
{
124124
mutate();
125125
return map::erase(key);
126126
}
127127

128128
/// @brief Swap dictionaries.
129-
OTIO_API void swap(AnyDictionary& other)
129+
void swap(AnyDictionary& other)
130130
{
131131
mutate();
132132
other.mutate();

src/opentimelineio/anyVector.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#pragma once
55

6+
#include "opentimelineio/export.h"
67
#include "opentimelineio/version.h"
78

89
#include <any>
@@ -20,7 +21,7 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
2021
///
2122
/// This allows us to hand out iterators that can be aware of moves
2223
/// and take steps to safe-guard themselves from causing a crash.
23-
class AnyVector : private std::vector<std::any>
24+
class OTIO_API_TYPE AnyVector : private std::vector<std::any>
2425
{
2526
public:
2627
using vector::vector;

src/opentimelineio/clip.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
1212
/// @brief A clip is a segment of editable media (usually audio or video).
1313
///
1414
/// Contains a MediaReference and a trim on that media reference.
15-
class Clip : public Item
15+
class OTIO_API_TYPE Clip : public Item
1616
{
1717
public:
1818
/// @brief The default media within a clip.
@@ -39,7 +39,7 @@ class Clip : public Item
3939
/// @param markers The list of markers for the clip. Note that the
4040
/// the clip keeps a retainer to each marker.
4141
/// @param active_media_reference_key The active media reference.
42-
Clip(
42+
OTIO_API Clip(
4343
std::string const& name = std::string(),
4444
MediaReference* media_reference = nullptr,
4545
std::optional<TimeRange> const& source_range = std::nullopt,
@@ -54,37 +54,37 @@ class Clip : public Item
5454

5555
/// @brief Set the media reference. Note that the Clip keeps a Retainer to
5656
/// the media reference.
57-
void set_media_reference(MediaReference* media_reference);
57+
OTIO_API void set_media_reference(MediaReference* media_reference);
5858

5959
/// @brief Return the media reference.
60-
MediaReference* media_reference() const noexcept;
60+
OTIO_API MediaReference* media_reference() const noexcept;
6161

6262
using MediaReferences = std::map<std::string, MediaReference*>;
6363

6464
/// @brief Return the list of media references.
65-
MediaReferences media_references() const noexcept;
65+
OTIO_API MediaReferences media_references() const noexcept;
6666

6767
/// @brief Set the list of media references. Note that the Clip keeps a
6868
/// Retainer to each media reference.
69-
void set_media_references(
69+
OTIO_API void set_media_references(
7070
MediaReferences const& media_references,
7171
std::string const& new_active_key,
7272
ErrorStatus* error_status = nullptr) noexcept;
7373

7474
/// @brief Return the active media reference.
75-
std::string active_media_reference_key() const noexcept;
75+
OTIO_API std::string active_media_reference_key() const noexcept;
7676

7777
/// @brief Set the active media reference.
78-
void set_active_media_reference_key(
78+
OTIO_API void set_active_media_reference_key(
7979
std::string const& new_active_key,
8080
ErrorStatus* error_status = nullptr) noexcept;
8181

8282
///@}
8383

84-
TimeRange
84+
OTIO_API TimeRange
8585
available_range(ErrorStatus* error_status = nullptr) const override;
8686

87-
std::optional<IMATH_NAMESPACE::Box2d>
87+
OTIO_API std::optional<IMATH_NAMESPACE::Box2d>
8888
available_image_bounds(ErrorStatus* error_status = nullptr) const override;
8989

9090
protected:

src/opentimelineio/color.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <cmath>
77
#include <vector>
88

9+
#include "opentimelineio/export.h"
910
#include "opentimelineio/version.h"
1011

1112
namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
@@ -21,7 +22,7 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
2122
/// Round-trip conversions may not be guaranteed outside that.
2223
/// This class is meant for use in user interface elements,
2324
// like marker or clip coloring, NOT for image pixel content.
24-
class Color
25+
class OTIO_API_TYPE Color
2526
{
2627
public:
2728
struct Schema
@@ -30,14 +31,14 @@ class Color
3031
static int constexpr version = 1;
3132
};
3233

33-
Color(
34+
OTIO_API Color(
3435
double const r = 1.f,
3536
double const g = 1.f,
3637
double const b = 1.f,
3738
double const a = 1.f,
3839
std::string const& name = "");
3940

40-
Color(Color const& other);
41+
OTIO_API Color(Color const& other);
4142

4243
static const Color pink;
4344
static const Color red;
@@ -63,10 +64,10 @@ class Color
6364
return lhs.to_hex() == rhs.to_hex() && lhs.to_agbr_integer() == rhs.to_agbr_integer();
6465
}
6566

66-
std::string to_hex();
67-
std::vector<int> to_rgba_int_list(int base);
68-
unsigned int to_agbr_integer();
69-
std::vector<double> to_rgba_float_list();
67+
OTIO_API std::string to_hex();
68+
OTIO_API std::vector<int> to_rgba_int_list(int base);
69+
OTIO_API unsigned int to_agbr_integer();
70+
OTIO_API std::vector<double> to_rgba_float_list();
7071

7172
double r() const { return _r; }
7273
double g() const { return _g; }

src/opentimelineio/composable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
1313
class Composition;
1414

1515
/// @brief An object that can be composed within a Composition (such as a Track or Stack).
16-
class Composable : public SerializableObjectWithMetadata
16+
class OTIO_API_TYPE Composable : public SerializableObjectWithMetadata
1717
{
1818
public:
1919
/// @brief This struct provides the Composable schema.
@@ -29,7 +29,7 @@ class Composable : public SerializableObjectWithMetadata
2929
///
3030
/// @param name The name of the composable.
3131
/// @param metadata The metadata for the clip.
32-
Composable(
32+
OTIO_API Composable(
3333
std::string const& name = std::string(),
3434
AnyDictionary const& metadata = AnyDictionary());
3535

0 commit comments

Comments
 (0)