mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
add export/visibility macros to libtimecode and build as a shared library again
This commit is contained in:
parent
b7bc2dd2c6
commit
2c21cbb044
3 changed files with 29 additions and 29 deletions
|
|
@ -23,10 +23,12 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
#include "timecode/visibility.h"
|
||||||
|
|
||||||
namespace Timecode {
|
namespace Timecode {
|
||||||
|
|
||||||
/** Bar, Beat, Tick Time (i.e. Tempo-Based Time) */
|
/** Bar, Beat, Tick Time (i.e. Tempo-Based Time) */
|
||||||
struct BBT_Time {
|
struct LIBTIMECODE_API BBT_Time {
|
||||||
static const double ticks_per_beat;
|
static const double ticks_per_beat;
|
||||||
|
|
||||||
uint32_t bars;
|
uint32_t bars;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include "timecode/visibility.h"
|
||||||
|
|
||||||
namespace Timecode {
|
namespace Timecode {
|
||||||
|
|
||||||
enum Wrap {
|
enum Wrap {
|
||||||
|
|
@ -47,7 +49,7 @@ enum TimecodeFormat {
|
||||||
timecode_60
|
timecode_60
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Time {
|
struct LIBTIMECODE_API Time {
|
||||||
bool negative;
|
bool negative;
|
||||||
uint32_t hours;
|
uint32_t hours;
|
||||||
uint32_t minutes;
|
uint32_t minutes;
|
||||||
|
|
@ -87,35 +89,34 @@ struct Time {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Wrap increment (Time& timecode, uint32_t);
|
Wrap LIBTIMECODE_API increment (Time& timecode, uint32_t);
|
||||||
Wrap decrement (Time& timecode, uint32_t);
|
Wrap LIBTIMECODE_API decrement (Time& timecode, uint32_t);
|
||||||
Wrap increment_subframes (Time& timecode, uint32_t);
|
Wrap LIBTIMECODE_API increment_subframes (Time& timecode, uint32_t);
|
||||||
Wrap decrement_subframes (Time& timecode, uint32_t);
|
Wrap LIBTIMECODE_API decrement_subframes (Time& timecode, uint32_t);
|
||||||
Wrap increment_seconds (Time& timecode, uint32_t);
|
Wrap LIBTIMECODE_API increment_seconds (Time& timecode, uint32_t);
|
||||||
Wrap increment_minutes (Time& timecode, uint32_t);
|
Wrap LIBTIMECODE_API increment_minutes (Time& timecode, uint32_t);
|
||||||
Wrap increment_hours (Time& timecode, uint32_t);
|
Wrap LIBTIMECODE_API increment_hours (Time& timecode, uint32_t);
|
||||||
void frames_floor (Time& timecode);
|
void LIBTIMECODE_API frames_floor (Time& timecode);
|
||||||
void seconds_floor (Time& timecode);
|
void LIBTIMECODE_API seconds_floor (Time& timecode);
|
||||||
void minutes_floor (Time& timecode);
|
void LIBTIMECODE_API minutes_floor (Time& timecode);
|
||||||
void hours_floor (Time& timecode);
|
void LIBTIMECODE_API hours_floor (Time& timecode);
|
||||||
|
|
||||||
double timecode_to_frames_per_second(TimecodeFormat const t);
|
double LIBTIMECODE_API timecode_to_frames_per_second(TimecodeFormat const t);
|
||||||
bool timecode_has_drop_frames(TimecodeFormat const t);
|
bool LIBTIMECODE_API timecode_has_drop_frames(TimecodeFormat const t);
|
||||||
|
|
||||||
std::string timecode_format_name (TimecodeFormat const t);
|
std::string LIBTIMECODE_API timecode_format_name (TimecodeFormat const t);
|
||||||
|
|
||||||
std::string timecode_format_time (Timecode::Time const timecode);
|
std::string LIBTIMECODE_API timecode_format_time (Timecode::Time const timecode);
|
||||||
|
|
||||||
std::string timecode_format_sampletime (
|
std::string LIBTIMECODE_API timecode_format_sampletime (
|
||||||
int64_t sample,
|
int64_t sample,
|
||||||
double sample_frame_rate,
|
double sample_frame_rate,
|
||||||
double timecode_frames_per_second, bool timecode_drop_frames
|
double timecode_frames_per_second, bool timecode_drop_frames
|
||||||
);
|
);
|
||||||
|
|
||||||
bool parse_timecode_format(std::string tc, Timecode::Time &TC);
|
bool LIBTIMECODE_API parse_timecode_format(std::string tc, Timecode::Time &TC);
|
||||||
|
|
||||||
void
|
void LIBTIMECODE_API timecode_to_sample(
|
||||||
timecode_to_sample(
|
|
||||||
Timecode::Time& timecode, int64_t& sample,
|
Timecode::Time& timecode, int64_t& sample,
|
||||||
bool use_offset, bool use_subframes,
|
bool use_offset, bool use_subframes,
|
||||||
/* Note - framerate info is taken from Timecode::Time& */
|
/* Note - framerate info is taken from Timecode::Time& */
|
||||||
|
|
@ -125,7 +126,7 @@ timecode_to_sample(
|
||||||
bool offset_is_negative, int64_t offset_samples
|
bool offset_is_negative, int64_t offset_samples
|
||||||
);
|
);
|
||||||
|
|
||||||
void sample_to_timecode (
|
void LIBTIMECODE_API sample_to_timecode (
|
||||||
int64_t sample, Timecode::Time& timecode,
|
int64_t sample, Timecode::Time& timecode,
|
||||||
bool use_offset, bool use_subframes,
|
bool use_offset, bool use_subframes,
|
||||||
/* framerate info */
|
/* framerate info */
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,12 @@ def configure(conf):
|
||||||
autowaf.configure(conf)
|
autowaf.configure(conf)
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
bld (export_includes = ['.'],
|
bld.shlib (
|
||||||
includes = ['.'],
|
|
||||||
name = 'libtimecode_includes'
|
|
||||||
)
|
|
||||||
|
|
||||||
bld.stlib (cxxflags = [ '-fPIC' ],
|
|
||||||
source = [ 'src/time.cc', 'src/bbt_time.cc' ],
|
source = [ 'src/time.cc', 'src/bbt_time.cc' ],
|
||||||
target = 'libtimecode',
|
target = 'libtimecode',
|
||||||
use = 'libtimecode_includes'
|
includes = ['.'],
|
||||||
|
export_includes = ['.'],
|
||||||
|
defines = [ 'LIBTIMECODE_DLL_EXPORTS' ]
|
||||||
)
|
)
|
||||||
|
|
||||||
def shutdown():
|
def shutdown():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue