summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/evoral/Control.hpp4
-rw-r--r--libs/evoral/evoral/ControlList.hpp6
-rw-r--r--libs/evoral/evoral/ControlSet.hpp4
-rw-r--r--libs/evoral/evoral/Curve.hpp6
-rw-r--r--libs/evoral/evoral/Event.hpp11
-rw-r--r--libs/evoral/evoral/EventList.hpp4
-rw-r--r--libs/evoral/evoral/EventRingBuffer.hpp3
-rw-r--r--libs/evoral/evoral/EventSink.hpp4
-rw-r--r--libs/evoral/evoral/MIDIEvent.hpp5
-rw-r--r--libs/evoral/evoral/MIDIParameters.hpp10
-rw-r--r--libs/evoral/evoral/Note.hpp6
-rw-r--r--libs/evoral/evoral/OldSMF.hpp4
-rw-r--r--libs/evoral/evoral/Parameter.hpp4
-rw-r--r--libs/evoral/evoral/PatchChange.hpp5
-rw-r--r--libs/evoral/evoral/Range.hpp12
-rw-r--r--libs/evoral/evoral/SMF.hpp4
-rw-r--r--libs/evoral/evoral/SMFReader.hpp4
-rw-r--r--libs/evoral/evoral/Sequence.hpp8
-rw-r--r--libs/evoral/evoral/TimeConverter.hpp6
-rw-r--r--libs/evoral/evoral/TypeMap.hpp3
-rw-r--r--libs/evoral/evoral/midi_util.h4
-rw-r--r--libs/evoral/evoral/types.hpp9
-rw-r--r--libs/evoral/evoral/visibility.h56
-rw-r--r--libs/evoral/wscript18
24 files changed, 154 insertions, 46 deletions
diff --git a/libs/evoral/evoral/Control.hpp b/libs/evoral/evoral/Control.hpp
index 369c4df630..2b7fd0aa65 100644
--- a/libs/evoral/evoral/Control.hpp
+++ b/libs/evoral/evoral/Control.hpp
@@ -23,6 +23,8 @@
#include <map>
#include <boost/shared_ptr.hpp>
#include "pbd/signals.h"
+
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
#include "evoral/Parameter.hpp"
@@ -38,7 +40,7 @@ class Transport;
* a list of values for automation.
*/
-class Control
+class LIBEVORAL_API Control
{
public:
Control(const Parameter& parameter, boost::shared_ptr<ControlList>);
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp
index 967e08d619..de6eb6e3d9 100644
--- a/libs/evoral/evoral/ControlList.hpp
+++ b/libs/evoral/evoral/ControlList.hpp
@@ -25,6 +25,8 @@
#include <boost/pool/pool_alloc.hpp>
#include <glibmm/threads.h>
#include "pbd/signals.h"
+
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
#include "evoral/Range.hpp"
#include "evoral/Parameter.hpp"
@@ -35,7 +37,7 @@ class Curve;
/** A single event (time-stamped value) for a control
*/
-class ControlEvent {
+class LIBEVORAL_API ControlEvent {
public:
ControlEvent (double w, double v)
: when (w), value (v), coeff (0)
@@ -67,7 +69,7 @@ public:
/** A list (sequence) of time-stamped values for a control
*/
-class ControlList
+class LIBEVORAL_API ControlList
{
public:
typedef std::list<ControlEvent*> EventList;
diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp
index 716d199fec..57a77afe71 100644
--- a/libs/evoral/evoral/ControlSet.hpp
+++ b/libs/evoral/evoral/ControlSet.hpp
@@ -25,6 +25,8 @@
#include <boost/utility.hpp>
#include <glibmm/threads.h>
#include "pbd/signals.h"
+
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
#include "evoral/Parameter.hpp"
#include "evoral/ControlList.hpp"
@@ -34,7 +36,7 @@ namespace Evoral {
class Control;
class ControlEvent;
-class ControlSet : public boost::noncopyable {
+class LIBEVORAL_API ControlSet : public boost::noncopyable {
public:
ControlSet();
ControlSet (const ControlSet&);
diff --git a/libs/evoral/evoral/Curve.hpp b/libs/evoral/evoral/Curve.hpp
index 5719abf2d4..6aeeb039d7 100644
--- a/libs/evoral/evoral/Curve.hpp
+++ b/libs/evoral/evoral/Curve.hpp
@@ -22,11 +22,13 @@
#include <inttypes.h>
#include <boost/utility.hpp>
+#include "evoral/visibility.h"
+
namespace Evoral {
class ControlList;
-class Curve : public boost::noncopyable
+class LIBEVORAL_API Curve : public boost::noncopyable
{
public:
Curve (const ControlList& cl);
@@ -51,7 +53,7 @@ private:
} // namespace Evoral
extern "C" {
- void curve_get_vector_from_c (void *arg, double, double, float*, int32_t);
+ LIBEVORAL_API void curve_get_vector_from_c (void *arg, double, double, float*, int32_t);
}
#endif // EVORAL_CURVE_HPP
diff --git a/libs/evoral/evoral/Event.hpp b/libs/evoral/evoral/Event.hpp
index 747b795480..facaa64e68 100644
--- a/libs/evoral/evoral/Event.hpp
+++ b/libs/evoral/evoral/Event.hpp
@@ -25,6 +25,7 @@
#include <sstream>
#include <stdint.h>
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
/** If this is not defined, all methods of MidiEvent are RT safe
@@ -35,16 +36,16 @@
namespace Evoral {
-event_id_t event_id_counter();
-event_id_t next_event_id();
-void init_event_id_counter(event_id_t n);
+LIBEVORAL_API event_id_t event_id_counter();
+LIBEVORAL_API event_id_t next_event_id();
+LIBEVORAL_API void init_event_id_counter(event_id_t n);
/** An event (much like a type generic jack_midi_event_t)
*
* Template parameter Time is the type of the time stamp used for this event.
*/
template<typename Time>
-class Event {
+class LIBEVORAL_API Event {
public:
#ifdef EVORAL_EVENT_ALLOC
Event (EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false);
@@ -157,7 +158,7 @@ protected:
template<typename Time>
-std::ostream& operator<<(std::ostream& o, const Evoral::Event<Time>& ev) {
+LIBEVORAL_API std::ostream& operator<<(std::ostream& o, const Evoral::Event<Time>& ev) {
o << "Event #" << ev.id() << " type = " << ev.event_type() << " @ " << ev.time();
o << std::hex;
for (uint32_t n = 0; n < ev.size(); ++n) {
diff --git a/libs/evoral/evoral/EventList.hpp b/libs/evoral/evoral/EventList.hpp
index e1a2679ce7..fd9df01377 100644
--- a/libs/evoral/evoral/EventList.hpp
+++ b/libs/evoral/evoral/EventList.hpp
@@ -19,6 +19,8 @@
#define EVORAL_EVENT_LIST_HPP
#include <list>
+
+#include "evoral/visibility.h"
#include "evoral/EventSink.hpp"
#include "evoral/types.hpp"
#include "evoral/Event.hpp"
@@ -31,7 +33,7 @@ namespace Evoral {
* Used when we need an unsorted list of Events that is also an EventSink. Absolutely nothing more.
*/
template<typename Time>
-class EventList : public std::list<Evoral::Event<Time> *>, public Evoral::EventSink<Time> {
+class LIBEVORAL_API EventList : public std::list<Evoral::Event<Time> *>, public Evoral::EventSink<Time> {
public:
EventList() {}
diff --git a/libs/evoral/evoral/EventRingBuffer.hpp b/libs/evoral/evoral/EventRingBuffer.hpp
index 419f427f33..26864e0ef1 100644
--- a/libs/evoral/evoral/EventRingBuffer.hpp
+++ b/libs/evoral/evoral/EventRingBuffer.hpp
@@ -22,6 +22,7 @@
#include "pbd/ringbufferNPT.h"
+#include "evoral/visibility.h"
#include "evoral/EventSink.hpp"
#include "evoral/types.hpp"
@@ -39,7 +40,7 @@ namespace Evoral {
* possible interpretation of uint8_t.
*/
template<typename Time>
-class EventRingBuffer : public PBD::RingBufferNPT<uint8_t>, public Evoral::EventSink<Time> {
+class LIBEVORAL_API EventRingBuffer : public PBD::RingBufferNPT<uint8_t>, public Evoral::EventSink<Time> {
public:
/** @param capacity Ringbuffer capacity in bytes.
diff --git a/libs/evoral/evoral/EventSink.hpp b/libs/evoral/evoral/EventSink.hpp
index 29d2793dd3..59ae3803ec 100644
--- a/libs/evoral/evoral/EventSink.hpp
+++ b/libs/evoral/evoral/EventSink.hpp
@@ -19,15 +19,15 @@
#ifndef EVORAL_EVENT_SINK_HPP
#define EVORAL_EVENT_SINK_HPP
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
namespace Evoral {
-
/** Pure virtual base for anything you can write events to.
*/
template<typename Time>
-class EventSink {
+class LIBEVORAL_API EventSink {
public:
virtual ~EventSink() {}
virtual uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf) = 0;
diff --git a/libs/evoral/evoral/MIDIEvent.hpp b/libs/evoral/evoral/MIDIEvent.hpp
index 6ba7269571..d6541bafeb 100644
--- a/libs/evoral/evoral/MIDIEvent.hpp
+++ b/libs/evoral/evoral/MIDIEvent.hpp
@@ -21,8 +21,11 @@
#include <cmath>
#include <boost/shared_ptr.hpp>
+
+#include "evoral/visibility.h"
#include "evoral/Event.hpp"
#include "evoral/midi_events.h"
+
#ifdef EVORAL_MIDI_XML
class XMLNode;
#endif
@@ -36,7 +39,7 @@ namespace Evoral {
* valid MIDI data for these functions to make sense.
*/
template<typename Time>
-class MIDIEvent : public Event<Time> {
+class LIBEVORAL_API MIDIEvent : public Event<Time> {
public:
MIDIEvent(EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false)
: Event<Time>(type, time, size, buf, alloc)
diff --git a/libs/evoral/evoral/MIDIParameters.hpp b/libs/evoral/evoral/MIDIParameters.hpp
index 931d29b48d..fca53a7a45 100644
--- a/libs/evoral/evoral/MIDIParameters.hpp
+++ b/libs/evoral/evoral/MIDIParameters.hpp
@@ -19,23 +19,25 @@
#ifndef EVORAL_MIDI_PARAMETERS_HPP
#define EVORAL_MIDI_PARAMETERS_HPP
+#include "evoral/visibility.h"
+
namespace Evoral {
namespace MIDI {
-struct ContinuousController : public Parameter {
+struct LIBEVORAL_API ContinuousController : public Parameter {
ContinuousController(uint32_t cc_type, uint8_t channel, uint32_t controller)
: Parameter(cc_type, channel, controller) {}
};
-struct ProgramChange : public Parameter {
+struct LIBEVORAL_API ProgramChange : public Parameter {
ProgramChange(uint32_t pc_type, uint8_t channel) : Parameter(pc_type, channel, 0) {}
};
-struct ChannelPressure : public Parameter {
+struct LIBEVORAL_API ChannelPressure : public Parameter {
ChannelPressure(uint32_t ca_type, uint32_t channel) : Parameter(ca_type, channel, 0) {}
};
-struct PitchBender : public Parameter {
+struct LIBEVORAL_API PitchBender : public Parameter {
PitchBender(uint32_t pb_type, uint32_t channel) : Parameter(pb_type, channel, 0) {}
};
diff --git a/libs/evoral/evoral/Note.hpp b/libs/evoral/evoral/Note.hpp
index a400137f77..6b0aeebb4a 100644
--- a/libs/evoral/evoral/Note.hpp
+++ b/libs/evoral/evoral/Note.hpp
@@ -22,6 +22,8 @@
#include <algorithm>
#include <glib.h>
#include <stdint.h>
+
+#include "evoral/visibility.h"
#include "evoral/MIDIEvent.hpp"
namespace Evoral {
@@ -31,7 +33,7 @@ namespace Evoral {
* Currently a note is defined as (on event, length, off event).
*/
template<typename Time>
-class Note {
+class LIBEVORAL_API Note {
public:
Note(uint8_t chan=0, Time time=0, Time len=0, uint8_t note=0, uint8_t vel=0x40);
Note(const Note<Time>& copy);
@@ -106,7 +108,7 @@ private:
} // namespace Evoral
template<typename Time>
-std::ostream& operator<<(std::ostream& o, const Evoral::Note<Time>& n) {
+LIBEVORAL_API std::ostream& operator<<(std::ostream& o, const Evoral::Note<Time>& n) {
o << "Note #" << n.id() << ": pitch = " << (int) n.note()
<< " @ " << n.time() << " .. " << n.end_time()
<< " velocity " << (int) n.velocity()
diff --git a/libs/evoral/evoral/OldSMF.hpp b/libs/evoral/evoral/OldSMF.hpp
index 692e159926..00bd0024e8 100644
--- a/libs/evoral/evoral/OldSMF.hpp
+++ b/libs/evoral/evoral/OldSMF.hpp
@@ -19,6 +19,8 @@
#ifndef EVORAL_OLD_SMF_HPP
#define EVORAL_OLD_SMF_HPP
+#include "evoral/visibility.h"
+
namespace Evoral {
template<typename Time> class Event;
@@ -28,7 +30,7 @@ template<typename Time> class EventRingBuffer;
/** Standard Midi File (Type 0)
*/
template<typename Time>
-class SMF {
+class LIBEVORAL_API SMF {
public:
SMF();
virtual ~SMF();
diff --git a/libs/evoral/evoral/Parameter.hpp b/libs/evoral/evoral/Parameter.hpp
index 7142574dbd..2164475cf9 100644
--- a/libs/evoral/evoral/Parameter.hpp
+++ b/libs/evoral/evoral/Parameter.hpp
@@ -24,6 +24,8 @@
#include <stdint.h>
#include <boost/shared_ptr.hpp>
+#include "evoral/visibility.h"
+
namespace Evoral {
@@ -36,7 +38,7 @@ namespace Evoral {
* This class defines a < operator which is a strict weak ordering, so
* Parameter may be stored in a std::set, used as a std::map key, etc.
*/
-class Parameter
+class LIBEVORAL_API Parameter
{
public:
Parameter(uint32_t type, uint8_t channel=0, uint32_t id=0)
diff --git a/libs/evoral/evoral/PatchChange.hpp b/libs/evoral/evoral/PatchChange.hpp
index 53b50a3383..f468db4e5d 100644
--- a/libs/evoral/evoral/PatchChange.hpp
+++ b/libs/evoral/evoral/PatchChange.hpp
@@ -20,6 +20,7 @@
#ifndef EVORAL_PATCH_CHANGE_HPP
#define EVORAL_PATCH_CHANGE_HPP
+#include "evoral/visibility.h"
#include "evoral/Event.hpp"
#include "evoral/MIDIEvent.hpp"
@@ -29,7 +30,7 @@ namespace Evoral {
* bank select and then a program change.
*/
template<typename Time>
-class PatchChange
+class LIBEVORAL_API PatchChange
{
public:
/** @param t Time.
@@ -166,7 +167,7 @@ private:
}
template<typename Time>
-std::ostream& operator<< (std::ostream& o, const Evoral::PatchChange<Time>& p) {
+LIBEVORAL_API std::ostream& operator<< (std::ostream& o, const Evoral::PatchChange<Time>& p) {
o << "Patch Change " << p.id() << " @ " << p.time() << " bank " << (int) p.bank() << " program " << (int) p.program();
return o;
}
diff --git a/libs/evoral/evoral/Range.hpp b/libs/evoral/evoral/Range.hpp
index 02d92100b9..868dccdd5f 100644
--- a/libs/evoral/evoral/Range.hpp
+++ b/libs/evoral/evoral/Range.hpp
@@ -21,9 +21,11 @@
#include <list>
+#include "evoral/visibility.h"
+
namespace Evoral {
-enum OverlapType {
+enum LIBEVORAL_API OverlapType {
OverlapNone, // no overlap
OverlapInternal, // the overlap is 100% with the object
OverlapStart, // overlap covers start, but ends within
@@ -32,7 +34,7 @@ enum OverlapType {
};
template<typename T>
-OverlapType coverage (T sa, T ea, T sb, T eb) {
+LIBEVORAL_API OverlapType coverage (T sa, T ea, T sb, T eb) {
/* OverlapType returned reflects how the second (B)
range overlaps the first (A).
@@ -107,7 +109,7 @@ OverlapType coverage (T sa, T ea, T sb, T eb) {
/** Type to describe a time range */
template<typename T>
-struct Range {
+struct LIBEVORAL_API Range {
Range (T f, T t) : from (f), to (t) {}
T from; ///< start of the range
T to; ///< end of the range
@@ -119,7 +121,7 @@ bool operator== (Range<T> a, Range<T> b) {
}
template<typename T>
-class RangeList {
+class LIBEVORAL_API RangeList {
public:
RangeList () : _dirty (false) {}
@@ -172,7 +174,7 @@ private:
/** Type to describe the movement of a time range */
template<typename T>
-struct RangeMove {
+struct LIBEVORAL_API RangeMove {
RangeMove (T f, double l, T t) : from (f), length (l), to (t) {}
T from; ///< start of the range
double length; ///< length of the range
diff --git a/libs/evoral/evoral/SMF.hpp b/libs/evoral/evoral/SMF.hpp
index 8bd05444c4..91bc928d9a 100644
--- a/libs/evoral/evoral/SMF.hpp
+++ b/libs/evoral/evoral/SMF.hpp
@@ -21,6 +21,8 @@
#define EVORAL_SMF_HPP
#include <cassert>
+
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
struct smf_struct;
@@ -35,7 +37,7 @@ namespace Evoral {
/** Standard Midi File.
* Currently only tempo-based time of a given PPQN is supported.
*/
-class SMF {
+class LIBEVORAL_API SMF {
public:
class FileError : public std::exception {
public:
diff --git a/libs/evoral/evoral/SMFReader.hpp b/libs/evoral/evoral/SMFReader.hpp
index 91dd31da21..df7dc7073f 100644
--- a/libs/evoral/evoral/SMFReader.hpp
+++ b/libs/evoral/evoral/SMFReader.hpp
@@ -24,6 +24,8 @@
#include <string>
#include <inttypes.h>
+#include "evoral/visibility.h"
+
namespace Evoral {
@@ -31,7 +33,7 @@ namespace Evoral {
*
* Currently this only reads SMF files with tempo-based timing.
*/
-class SMFReader {
+class LIBEVORAL_API SMFReader {
public:
class PrematureEOF : public std::exception {
const char* what() const throw() { return "Unexpected end of file"; }
diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp
index dbc04d619b..e762d64ad1 100644
--- a/libs/evoral/evoral/Sequence.hpp
+++ b/libs/evoral/evoral/Sequence.hpp
@@ -26,6 +26,8 @@
#include <utility>
#include <boost/shared_ptr.hpp>
#include <glibmm/threads.h>
+
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
#include "evoral/Note.hpp"
#include "evoral/Parameter.hpp"
@@ -42,7 +44,7 @@ template<typename Time> class Event;
/** An iterator over (the x axis of) a 2-d double coordinate space.
*/
-class ControlIterator {
+class LIBEVORAL_API ControlIterator {
public:
ControlIterator(boost::shared_ptr<const ControlList> al, double ax, double ay)
: list(al)
@@ -60,7 +62,7 @@ public:
* notes (instead of just unassociated note on/off events) and controller data.
* Controller data is represented as a list of time-stamped float values. */
template<typename Time>
-class Sequence : virtual public ControlSet {
+class LIBEVORAL_API Sequence : virtual public ControlSet {
public:
Sequence(const TypeMap& type_map);
Sequence(const Sequence<Time>& other);
@@ -360,7 +362,7 @@ private:
} // namespace Evoral
-template<typename Time> std::ostream& operator<<(std::ostream& o, const Evoral::Sequence<Time>& s) { s.dump (o); return o; }
+template<typename Time> LIBEVORAL_API std::ostream& operator<<(std::ostream& o, const Evoral::Sequence<Time>& s) { s.dump (o); return o; }
#endif // EVORAL_SEQUENCE_HPP
diff --git a/libs/evoral/evoral/TimeConverter.hpp b/libs/evoral/evoral/TimeConverter.hpp
index da765c4b78..e46e9e2d1a 100644
--- a/libs/evoral/evoral/TimeConverter.hpp
+++ b/libs/evoral/evoral/TimeConverter.hpp
@@ -19,6 +19,8 @@
#ifndef EVORAL_TIME_CONVERTER_HPP
#define EVORAL_TIME_CONVERTER_HPP
+#include "evoral/visibility.h"
+
namespace Evoral {
/** A bidirectional converter between two different time units.
@@ -33,7 +35,7 @@ namespace Evoral {
* from() converts a time _origin_b + b into an offset from _origin_b in units of A.
*/
template<typename A, typename B>
-class TimeConverter {
+class LIBEVORAL_API TimeConverter {
public:
TimeConverter () : _origin_b (0) {}
TimeConverter (B ob) : _origin_b (ob) {}
@@ -63,7 +65,7 @@ protected:
* going on.
*/
template<typename A, typename B>
-class IdentityConverter : public TimeConverter<A,B> {
+class LIBEVORAL_API IdentityConverter : public TimeConverter<A,B> {
public:
IdentityConverter() {}
B to(A a) const { return static_cast<B>(a); }
diff --git a/libs/evoral/evoral/TypeMap.hpp b/libs/evoral/evoral/TypeMap.hpp
index 9d57cb8080..7fcb7f2880 100644
--- a/libs/evoral/evoral/TypeMap.hpp
+++ b/libs/evoral/evoral/TypeMap.hpp
@@ -19,6 +19,7 @@
#ifndef EVORAL_TYPE_MAP_HPP
#define EVORAL_TYPE_MAP_HPP
+#include "evoral/visibility.h"
#include "evoral/types.hpp"
namespace Evoral {
@@ -28,7 +29,7 @@ class Parameter;
/** The applications passes one of these which provide the implementation
* with required information about event types in an opaque, type neutral way
*/
-class TypeMap {
+class LIBEVORAL_API TypeMap {
public:
virtual ~TypeMap() {}
diff --git a/libs/evoral/evoral/midi_util.h b/libs/evoral/evoral/midi_util.h
index e4480b347e..5c72fb86c9 100644
--- a/libs/evoral/evoral/midi_util.h
+++ b/libs/evoral/evoral/midi_util.h
@@ -25,6 +25,8 @@
#include <string>
#include <sys/types.h>
#include <assert.h>
+
+#include "evoral/visibility.h"
#include "evoral/midi_events.h"
namespace Evoral {
@@ -119,7 +121,7 @@ midi_event_is_valid(const uint8_t* buffer, size_t len)
return true;
}
-std::string midi_note_name (uint8_t noteval);
+LIBEVORAL_API std::string midi_note_name (uint8_t noteval);
} // namespace Evoral
diff --git a/libs/evoral/evoral/types.hpp b/libs/evoral/evoral/types.hpp
index 000b79bb94..7259a5c0de 100644
--- a/libs/evoral/evoral/types.hpp
+++ b/libs/evoral/evoral/types.hpp
@@ -26,6 +26,8 @@
#include "pbd/debug.h"
+#include "evoral/visibility.h"
+
namespace Evoral {
/** ID of an event (note or other). This must be operable on by glib
@@ -35,6 +37,7 @@ typedef int32_t event_id_t;
/** Musical time: beats relative to some defined origin */
typedef double MusicalTime;
+
const MusicalTime MaxMusicalTime = DBL_MAX;
const MusicalTime MinMusicalTime = DBL_MIN;
@@ -77,9 +80,9 @@ typedef uint32_t EventType;
namespace PBD {
namespace DEBUG {
- extern uint64_t Sequence;
- extern uint64_t Note;
- extern uint64_t ControlList;
+ LIBEVORAL_API extern uint64_t Sequence;
+ LIBEVORAL_API extern uint64_t Note;
+ LIBEVORAL_API extern uint64_t ControlList;
}
}
diff --git a/libs/evoral/evoral/visibility.h b/libs/evoral/evoral/visibility.h
new file mode 100644
index 0000000000..380caca2fd
--- /dev/null
+++ b/libs/evoral/evoral/visibility.h
@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2013 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __libevoral_visibility_h__
+#define __libevoral_visibility_h__
+
+/* _WIN32 is defined by most compilers targetting Windows, but within the
+ * evoral source tree, we also define COMPILER_MSVC or COMPILER_MINGW depending
+ * on how a Windows build is built.
+ */
+
+#if defined _WIN32 || defined __CYGWIN__ || defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
+ #define LIBEVORAL_DLL_IMPORT __declspec(dllimport)
+ #define LIBEVORAL_DLL_EXPORT __declspec(dllexport)
+ #define LIBEVORAL_DLL_LOCAL
+#else
+ #if __GNUC__ >= 4
+ #define LIBEVORAL_DLL_IMPORT __attribute__ ((visibility ("default")))
+ #define LIBEVORAL_DLL_EXPORT __attribute__ ((visibility ("default")))
+ #define LIBEVORAL_DLL_LOCAL __attribute__ ((visibility ("hidden")))
+ #else
+ #define LIBEVORAL_DLL_IMPORT
+ #define LIBEVORAL_DLL_EXPORT
+ #define LIBEVORAL_DLL_LOCAL
+ #endif
+#endif
+
+#ifdef LIBEVORAL_DLL // libevoral is a DLL
+#ifdef LIBEVORAL_DLL_EXPORTS // defined if we are building the libevoral DLL (instead of using it)
+ #define LIBEVORAL_API LIBEVORAL_DLL_EXPORT
+#else
+ #define LIBEVORAL_API LIBEVORAL_DLL_IMPORT
+#endif
+#define LIBEVORAL_LOCAL LIBEVORAL_DLL_LOCAL
+#else /* static lib, not DLL */
+#define LIBEVORAL_API
+#define LIBEVORAL_LOCAL
+#endif
+
+#endif /* __libevoral_visibility_h__ */
diff --git a/libs/evoral/wscript b/libs/evoral/wscript
index bfb081217f..569aa0fc6b 100644
--- a/libs/evoral/wscript
+++ b/libs/evoral/wscript
@@ -88,8 +88,20 @@ def build(bld):
'''
# Library
- obj = bld(features = 'cxx cxxshlib')
- obj.source = lib_source
+ if bld.is_defined ('INTERNAL_SHARED_LIBS'):
+ obj = bld.shlib(features = 'c cxx cshlib cxxshlib', source=lib_source)
+ # DLL exports for this library
+ obj.defines = [ 'LIBEVORAL_DLL=1', 'LIBEVORAL_DLL_EXPORTS=1' ]
+ # DLL imports for other libraries
+ obj.defines += [ 'LIBPBD_DLL=1' ]
+ obj.cxxflags = [ '-fvisibility=hidden' ]
+ obj.cflags = [ '-fvisibility=hidden' ]
+ else:
+ obj = bld.stlib(features = 'c cxx cstlib cxxstlib', source=lib_source)
+ obj.cxxflags = [ '-fPIC' ]
+ obj.cflags = [ '-fPIC' ]
+ obj.defines = [ ]
+
obj.export_includes = ['.']
obj.includes = ['.', './src']
obj.name = 'libevoral'
@@ -98,7 +110,7 @@ def build(bld):
obj.use = 'libsmf libpbd'
obj.vnum = EVORAL_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
- obj.defines = ['PACKAGE="libevoral"', 'EVORAL_MIDI_XML=1' ]
+ obj.defines += [ 'PACKAGE="libevoral"', 'EVORAL_MIDI_XML=1' ]
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Static library (for unit test code coverage)