diff options
author | John Emmas <johne53@tiscali.co.uk> | 2013-10-18 10:03:22 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2013-10-18 10:03:22 +0100 |
commit | b855e5f3220027502a3c88f189d511fe2a5a3c2b (patch) | |
tree | b106fabe68c471cb95688e151e8466dac3e0ea4c /libs/midi++2 | |
parent | 75b933eadbe8f90a73a29bb207ff26eebcd4121a (diff) | |
parent | 5ba369918b07a4c0859f0e94537da7b5a11bb49f (diff) |
Merge remote-tracking branch 'remotes/origin/exportvis' into windows+cc
Conflicts (hopefully resolved):
gtk2_ardour/wscript
libs/ardour/ardour/audioregion.h
libs/ardour/ardour/debug.h
libs/ardour/ardour/directory_names.h
libs/ardour/ardour/filesystem_paths.h
libs/ardour/ardour/session_event.h
libs/gtkmm2ext/gtkmm2ext/utils.h
libs/panners/1in2out/wscript
libs/panners/2in2out/wscript
libs/panners/vbap/wscript
libs/pbd/pbd/debug.h
libs/pbd/pbd/file_utils.h
libs/pbd/pbd/pathexpand.h
libs/pbd/pbd/ringbuffer.h
libs/pbd/pbd/ringbufferNPT.h
libs/pbd/pbd/search_path.h
libs/pbd/pbd/stacktrace.h
libs/pbd/pbd/uuid.h
libs/pbd/pbd/uuid_boost.h
libs/surfaces/control_protocol/control_protocol/basic_ui.h
libs/surfaces/control_protocol/control_protocol/control_protocol.h
Diffstat (limited to 'libs/midi++2')
-rw-r--r-- | libs/midi++2/midi++/channel.h | 4 | ||||
-rw-r--r-- | libs/midi++2/midi++/event.h | 1 | ||||
-rw-r--r-- | libs/midi++2/midi++/ipmidi_port.h | 3 | ||||
-rw-r--r-- | libs/midi++2/midi++/libmidi_visibility.h | 56 | ||||
-rw-r--r-- | libs/midi++2/midi++/midnam_patch.h | 25 | ||||
-rw-r--r-- | libs/midi++2/midi++/mmc.h | 5 | ||||
-rw-r--r-- | libs/midi++2/midi++/parser.h | 3 | ||||
-rw-r--r-- | libs/midi++2/midi++/port.h | 5 | ||||
-rw-r--r-- | libs/midi++2/midi++/types.h | 10 | ||||
-rw-r--r-- | libs/midi++2/wscript | 10 |
10 files changed, 95 insertions, 27 deletions
diff --git a/libs/midi++2/midi++/channel.h b/libs/midi++2/midi++/channel.h index d00ce700c5..02c16e6729 100644 --- a/libs/midi++2/midi++/channel.h +++ b/libs/midi++2/midi++/channel.h @@ -23,8 +23,6 @@ #include <queue> #include "pbd/signals.h" - -#include "midi++/types.h" #include "midi++/parser.h" namespace MIDI { @@ -36,7 +34,7 @@ class Port; * This remembers various useful information about the current 'state' of a * MIDI channel (eg current pitch bend value). */ -class Channel : public PBD::ScopedConnectionList { +class LIBMIDIPP_API Channel : public PBD::ScopedConnectionList { public: Channel (byte channel_number, Port &); diff --git a/libs/midi++2/midi++/event.h b/libs/midi++2/midi++/event.h index 70744536a8..6620010071 100644 --- a/libs/midi++2/midi++/event.h +++ b/libs/midi++2/midi++/event.h @@ -26,6 +26,7 @@ #include <sstream> #include <assert.h> +#include "midi++/libmidi_visibility.h" #include "midi++/types.h" #include "midi++/events.h" #include "pbd/xml++.h" diff --git a/libs/midi++2/midi++/ipmidi_port.h b/libs/midi++2/midi++/ipmidi_port.h index a4adb14cf4..3f5f1c023b 100644 --- a/libs/midi++2/midi++/ipmidi_port.h +++ b/libs/midi++2/midi++/ipmidi_port.h @@ -48,13 +48,14 @@ #include "pbd/signals.h" #include "pbd/ringbuffer.h" +#include "midi++/libmidi_visibility.h" #include "midi++/types.h" #include "midi++/parser.h" #include "midi++/port.h" namespace MIDI { -class IPMIDIPort : public Port { +class LIBMIDIPP_API IPMIDIPort : public Port { public: IPMIDIPort (int base_port = lowest_ipmidi_port_default, const std::string& ifname = std::string()); IPMIDIPort (const XMLNode&); diff --git a/libs/midi++2/midi++/libmidi_visibility.h b/libs/midi++2/midi++/libmidi_visibility.h new file mode 100644 index 0000000000..62eebfe8e2 --- /dev/null +++ b/libs/midi++2/midi++/libmidi_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 __libmidi_libmidi_visibility_h__ +#define __libmidi_libmidi_visibility_h__ + +/* _WIN32 is defined by most compilers targetting Windows, but within the + * midi 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 LIBMIDIPP_DLL_IMPORT __declspec(dllimport) + #define LIBMIDIPP_DLL_EXPORT __declspec(dllexport) + #define LIBMIDIPP_DLL_LOCAL +#else + #if __GNUC__ >= 4 + #define LIBMIDIPP_DLL_IMPORT __attribute__ ((visibility ("default"))) + #define LIBMIDIPP_DLL_EXPORT __attribute__ ((visibility ("default"))) + #define LIBMIDIPP_DLL_LOCAL __attribute__ ((visibility ("hidden"))) + #else + #define LIBMIDIPP_DLL_IMPORT + #define LIBMIDIPP_DLL_EXPORT + #define LIBMIDIPP_DLL_LOCAL + #endif +#endif + +#ifdef LIBMIDIPP_DLL // libmidi is a DLL +#ifdef LIBMIDIPP_DLL_EXPORTS // defined if we are building the libmidi DLL (instead of using it) + #define LIBMIDIPP_API LIBMIDIPP_DLL_EXPORT +#else + #define LIBMIDIPP_API LIBMIDIPP_DLL_IMPORT +#endif +#define LIBMIDIPP_LOCAL LIBMIDIPP_DLL_LOCAL +#else /* static lib, not DLL */ +#define LIBMIDIPP_API +#define LIBMIDIPP_LOCAL +#endif + +#endif /* __libmidi_libmidi_visibility_h__ */ diff --git a/libs/midi++2/midi++/midnam_patch.h b/libs/midi++2/midi++/midnam_patch.h index ddd62c2916..d67543429a 100644 --- a/libs/midi++2/midi++/midnam_patch.h +++ b/libs/midi++2/midi++/midnam_patch.h @@ -30,6 +30,7 @@ #include <stdint.h> +#include "midi++/libmidi_visibility.h" #include "midi++/event.h" #include "pbd/xml++.h" @@ -39,7 +40,7 @@ namespace MIDI namespace Name { -struct PatchPrimaryKey +struct LIBMIDIPP_API PatchPrimaryKey { public: int bank_number; @@ -81,7 +82,7 @@ public: class PatchBank; -class Patch +class LIBMIDIPP_API Patch { public: @@ -112,7 +113,7 @@ private: typedef std::list<boost::shared_ptr<Patch> > PatchNameList; -class PatchBank +class LIBMIDIPP_API PatchBank { public: PatchBank (uint16_t n = 0, std::string a_name = std::string()) : _name(a_name), _number (n) {}; @@ -138,7 +139,7 @@ private: std::string _patch_list_name; }; -class ChannelNameSet +class LIBMIDIPP_API ChannelNameSet { public: typedef std::set<uint8_t> AvailableForChannels; @@ -221,7 +222,7 @@ private: std::ostream& operator<< (std::ostream&, const ChannelNameSet&); -class Note +class LIBMIDIPP_API Note { public: Note() {} @@ -241,7 +242,7 @@ private: std::string _name; }; -class NoteNameList +class LIBMIDIPP_API NoteNameList { public: typedef std::vector< boost::shared_ptr<Note> > Notes; @@ -262,7 +263,7 @@ private: Notes _notes; }; -class Control +class LIBMIDIPP_API Control { public: Control() {} @@ -291,7 +292,7 @@ private: std::string _name; }; -class ControlNameList +class LIBMIDIPP_API ControlNameList { public: typedef std::map<uint16_t, boost::shared_ptr<Control> > Controls; @@ -315,7 +316,7 @@ private: Controls _controls; }; -class CustomDeviceMode +class LIBMIDIPP_API CustomDeviceMode { public: CustomDeviceMode() {}; @@ -341,7 +342,7 @@ private: std::string _channel_name_set_assignments[16]; }; -class MasterDeviceNames +class LIBMIDIPP_API MasterDeviceNames { public: typedef std::set<std::string> Models; @@ -395,7 +396,7 @@ private: ControlNameLists _control_name_lists; }; -class MIDINameDocument +class LIBMIDIPP_API MIDINameDocument { public: // Maps Model names to MasterDeviceNames @@ -424,7 +425,7 @@ private: MasterDeviceNames::Models _all_models; }; -extern const char* general_midi_program_names[128]; /* 0 .. 127 */ +LIBMIDIPP_API extern const char* general_midi_program_names[128]; /* 0 .. 127 */ } diff --git a/libs/midi++2/midi++/mmc.h b/libs/midi++2/midi++/mmc.h index 01f8bf3b8a..2f34b9c793 100644 --- a/libs/midi++2/midi++/mmc.h +++ b/libs/midi++2/midi++/mmc.h @@ -26,6 +26,7 @@ #include "pbd/signals.h" #include "pbd/ringbuffer.h" +#include "midi++/libmidi_visibility.h" #include "midi++/types.h" #include "midi++/parser.h" @@ -40,7 +41,7 @@ class Parser; class MachineControlCommand; /** Class to handle incoming and outgoing MIDI machine control messages */ -class MachineControl +class LIBMIDIPP_API MachineControl { public: typedef PBD::Signal1<void,MachineControl&> MMCSignal; @@ -287,7 +288,7 @@ class MachineControl * In an ideal world we might use a class hierarchy for this, but objects of this type * have to be allocated off the stack for RT safety. */ -class MachineControlCommand +class LIBMIDIPP_API MachineControlCommand { public: MachineControlCommand () : _command (MachineControl::Command (0)) {} diff --git a/libs/midi++2/midi++/parser.h b/libs/midi++2/midi++/parser.h index 44897f9d8e..e4126b210b 100644 --- a/libs/midi++2/midi++/parser.h +++ b/libs/midi++2/midi++/parser.h @@ -25,6 +25,7 @@ #include "pbd/signals.h" +#include "midi++/libmidi_visibility.h" #include "midi++/types.h" namespace MIDI { @@ -39,7 +40,7 @@ typedef PBD::Signal2<void,Parser &, EventTwoBytes *> TwoByteSignal; typedef PBD::Signal2<void,Parser &, pitchbend_t> PitchBendSignal; typedef PBD::Signal3<void,Parser &, byte *, size_t> Signal; -class Parser { +class LIBMIDIPP_API Parser { public: Parser (); ~Parser (); diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h index a915320fa3..9515bdb5a4 100644 --- a/libs/midi++2/midi++/port.h +++ b/libs/midi++2/midi++/port.h @@ -33,6 +33,7 @@ #include "pbd/signals.h" #include "pbd/ringbuffer.h" +#include "midi++/libmidi_visibility.h" #include "midi++/types.h" #include "midi++/parser.h" @@ -41,7 +42,7 @@ namespace MIDI { class Channel; class PortRequest; -class Port { +class LIBMIDIPP_API Port { public: enum Flags { IsInput = JackPortIsInput, @@ -140,7 +141,7 @@ class Port { void init (std::string const &, Flags); }; -struct PortSet { +struct LIBMIDIPP_API PortSet { PortSet (std::string str) : owner (str) { } std::string owner; diff --git a/libs/midi++2/midi++/types.h b/libs/midi++2/midi++/types.h index 185e1e6f3f..a731855daa 100644 --- a/libs/midi++2/midi++/types.h +++ b/libs/midi++2/midi++/types.h @@ -23,6 +23,8 @@ #include <jack/jack.h> #include <inttypes.h> +#include "midi++/libmidi_visibility.h" + namespace MIDI { typedef char channel_t; @@ -60,10 +62,10 @@ namespace MIDI { reset = 0xFF }; - extern const char *controller_names[]; + LIBMIDIPP_API extern const char *controller_names[]; byte decode_controller_name (const char *name); - struct EventTwoBytes { + struct LIBMIDIPP_API EventTwoBytes { union { byte note_number; byte controller_number; @@ -74,14 +76,14 @@ namespace MIDI { }; }; - enum MTC_FPS { + enum LIBMIDIPP_API MTC_FPS { MTC_24_FPS = 0, MTC_25_FPS = 1, MTC_30_FPS_DROP = 2, MTC_30_FPS = 3 }; - enum MTC_Status { + enum LIBMIDIPP_API MTC_Status { MTC_Stopped = 0, MTC_Forward, MTC_Backward diff --git a/libs/midi++2/wscript b/libs/midi++2/wscript index 0abbab7d40..e27c4876ee 100644 --- a/libs/midi++2/wscript +++ b/libs/midi++2/wscript @@ -47,7 +47,7 @@ def options(opt): def configure(conf): conf.load('compiler_cxx') autowaf.build_version_files(path_prefix+'midi++/version.h', path_prefix+'version.cc', - 'midipp', MAJOR, MINOR, MICRO) + 'midipp', MAJOR, MINOR, MICRO, 'LIBMIDIPP_API', 'midi++/libmidi_visibility.h') autowaf.configure(conf) autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False) autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.118.2') @@ -62,9 +62,15 @@ def build(bld): # Library if bld.is_defined ('INTERNAL_SHARED_LIBS'): obj = bld.shlib(features = 'cxx cxxshlib', source=libmidi_sources) + obj.defines = [ 'LIBMIDIPP_DLL=1', 'LIBMIDIPP_DLL_EXPORTS=1' ] + obj.defines += [ 'LIBPBD_DLL=1', 'LIBEVORAL_DLL=1' ] + obj.cxxflags = [ '-fvisibility=hidden' ] + obj.cflags = [ '-fvisibility=hidden' ] else: obj = bld.stlib(features = 'cxx cxxstlib', source=libmidi_sources) - obj.cxxflags = [ '-fPIC', '-DWITH_JACK_MIDI' ] + obj.cxxflags = [ '-fPIC', '-DWITH_JACK_MIDI' ] + obj.defines = [] + # everybody loves JACK obj.export_includes = ['.'] obj.includes = ['.', '../surfaces/control_protocol', '../ardour' ] |