diff --git a/libs/temporal/superclock.cc b/libs/temporal/superclock.cc index a67b3d9c13..8b7062042d 100644 --- a/libs/temporal/superclock.cc +++ b/libs/temporal/superclock.cc @@ -18,7 +18,9 @@ #include "temporal/superclock.h" +#ifndef COMPILER_MSVC Temporal::superclock_t Temporal::superclock_ticks_per_second = 508032000; // 2^10 * 3^4 * 5^3 * 7^2 +#endif int (*Temporal::sample_rate_callback)() = 0; diff --git a/libs/temporal/temporal/bbt_time.h b/libs/temporal/temporal/bbt_time.h index 4203653d41..63553f2de8 100644 --- a/libs/temporal/temporal/bbt_time.h +++ b/libs/temporal/temporal/bbt_time.h @@ -298,10 +298,10 @@ BBT_Time::operator!= (const BBT_Offset& other) const namespace std { -std::ostream& operator<< (std::ostream& o, Temporal::BBT_Time const & bbt); -std::ostream& operator<< (std::ostream& o, Temporal::BBT_Offset const & bbt); -std::istream& operator>> (std::istream& i, Temporal::BBT_Time& bbt); -std::istream& operator>> (std::istream& i, Temporal::BBT_Offset& bbt); +LIBTEMPORAL_API std::ostream& operator<< (std::ostream& o, Temporal::BBT_Time const & bbt); +LIBTEMPORAL_API std::ostream& operator<< (std::ostream& o, Temporal::BBT_Offset const & bbt); +LIBTEMPORAL_API std::istream& operator>> (std::istream& i, Temporal::BBT_Time& bbt); +LIBTEMPORAL_API std::istream& operator>> (std::istream& i, Temporal::BBT_Offset& bbt); template<> struct numeric_limits { diff --git a/libs/temporal/temporal/beats.h b/libs/temporal/temporal/beats.h index b22e0c92e3..def6e1f9bd 100644 --- a/libs/temporal/temporal/beats.h +++ b/libs/temporal/temporal/beats.h @@ -313,8 +313,8 @@ class DoubleableBeats : public Beats virtual-method-in-a-template will bite you. */ -std::ostream& operator<<(std::ostream& ostream, const Temporal::Beats& t); -std::istream& operator>>(std::istream& istream, Temporal::Beats& b); +LIBTEMPORAL_API std::ostream& operator<<(std::ostream& ostream, const Temporal::Beats& t); +LIBTEMPORAL_API std::istream& operator>>(std::istream& istream, Temporal::Beats& b); } // namespace Temporal diff --git a/libs/temporal/temporal/range.h b/libs/temporal/temporal/range.h index 4d7d04525b..7b7894abf6 100644 --- a/libs/temporal/temporal/range.h +++ b/libs/temporal/temporal/range.h @@ -130,7 +130,7 @@ template return coverage_inclusive_ends (sa, eaE.decrement(), sb, ebE.decrement()); } -template<> /*LIBTEMPORAL_API*/ OverlapType coverage_exclusive_ends (int64_t sa, int64_t eaE, int64_t sb, int64_t ebE); +template<> LIBTEMPORAL_TEMPLATE_API OverlapType coverage_exclusive_ends (int64_t sa, int64_t eaE, int64_t sb, int64_t ebE); class RangeList; diff --git a/libs/temporal/temporal/superclock.h b/libs/temporal/temporal/superclock.h index da5ce5ac1e..4eb2c02bf3 100644 --- a/libs/temporal/temporal/superclock.h +++ b/libs/temporal/temporal/superclock.h @@ -23,18 +23,24 @@ #include "pbd/integer_division.h" +#include "temporal/visibility.h" + namespace Temporal { typedef int64_t superclock_t; -extern superclock_t superclock_ticks_per_second; +#ifndef COMPILER_MSVC + extern superclock_t superclock_ticks_per_second; +#else + static superclock_t superclock_ticks_per_second = 508032000; // 2^10 * 3^4 * 5^3 * 7^2 +#endif static inline superclock_t superclock_to_samples (superclock_t s, int sr) { return int_div_round (s * sr, superclock_ticks_per_second); } static inline superclock_t samples_to_superclock (int64_t samples, int sr) { return int_div_round (samples * superclock_ticks_per_second, superclock_t (sr)); } extern int (*sample_rate_callback)(); -void set_sample_rate_callback (int (*function)()); +LIBTEMPORAL_API void set_sample_rate_callback (int (*function)()); } diff --git a/libs/temporal/temporal/timeline.h b/libs/temporal/temporal/timeline.h index a05b138e51..0d5354ea49 100644 --- a/libs/temporal/temporal/timeline.h +++ b/libs/temporal/temporal/timeline.h @@ -434,10 +434,10 @@ class LIBTEMPORAL_API timecnt_t { } /* end namespace Temporal */ namespace std { -std::ostream& operator<< (std::ostream & o, Temporal::timecnt_t const & tc); -std::istream& operator>> (std::istream & o, Temporal::timecnt_t & tc); -std::ostream& operator<< (std::ostream & o, Temporal::timepos_t const & tp); -std::istream& operator>> (std::istream & o, Temporal::timepos_t & tp); +LIBTEMPORAL_API std::ostream& operator<< (std::ostream & o, Temporal::timecnt_t const & tc); +LIBTEMPORAL_API std::istream& operator>> (std::istream & o, Temporal::timecnt_t & tc); +LIBTEMPORAL_API std::ostream& operator<< (std::ostream & o, Temporal::timepos_t const & tp); +LIBTEMPORAL_API std::istream& operator>> (std::istream & o, Temporal::timepos_t & tp); } #if 0 diff --git a/libs/temporal/temporal/types.h b/libs/temporal/temporal/types.h index 1ac7e8ec76..460fdbad56 100644 --- a/libs/temporal/temporal/types.h +++ b/libs/temporal/temporal/types.h @@ -26,9 +26,15 @@ #include "pbd/integer_division.h" +#include "temporal/visibility.h" + namespace Temporal { -extern void init (); +#ifdef COMPILER_MSVC + LIBTEMPORAL_API void init (); +#else + extern void init (); +#endif /* Any position measured in audio samples. Assumed to be non-negative but not enforced.