'libs/panners' - A small test (before going too far) to see if these changes have...
authorJohn Emmas <johne53@tiscali.co.uk>
Fri, 30 Aug 2013 18:51:45 +0000 (19:51 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Fri, 30 Aug 2013 18:51:45 +0000 (19:51 +0100)
libs/ardour/ardour/panner.h
libs/panners/1in2out/panner_1in2out.cc
libs/panners/1in2out/panner_1in2out.h

index b30b1859a3ec2e7dca916d386657c4f9951895bc..7ebf1ec989a97e05e20302cc543fc4356e8812c4 100644 (file)
 #include "ardour/automation_control.h"
 #include "ardour/automatable.h"
 
+#if !defined(ARDOURPANNER_IS_IN_WINDLL)
+       #if defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
+       // If you need '__declspec' compatibility, add extra compilers to the above as necessary
+               #define ARDOURPANNER_IS_IN_WINDLL 1
+       #else
+               #define ARDOURPANNER_IS_IN_WINDLL 0
+       #endif
+#endif
+
+#if ARDOURPANNER_IS_IN_WINDLL && !defined(ARDOURPANNER_API)
+       #if defined(BUILDING_ARDOURPANNERS)
+               #define ARDOURPANNER_API __declspec(dllexport)
+               #define ARDOURPANNER_APICALLTYPE __thiscall
+       #elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
+               #define ARDOURPANNER_API __declspec(dllimport)
+               #define ARDOURPANNER_APICALLTYPE __thiscall
+       #else
+               #error "Attempting to define __declspec with an incompatible compiler !"
+       #endif
+#elif !defined(ARDOURPANNER_API)
+       // Other compilers / platforms could be accommodated here
+       #define ARDOURPANNER_API
+       #define ARDOURPANNER_APICALLTYPE
+#endif
+
 namespace ARDOUR {
 
 class Session;
@@ -67,7 +92,7 @@ public:
           * return false
        */
 
-       virtual bool clamp_position (double&) { return true; }
+       virtual bool ARDOURPANNER_APICALLTYPE clamp_position (double&) { return true; }
        virtual bool clamp_width (double&) { return true; }
        virtual bool clamp_elevation (double&) { return true; }
 
@@ -75,7 +100,7 @@ public:
        virtual std::pair<double, double> width_range () const { return std::make_pair (-DBL_MAX, DBL_MAX); }
        virtual std::pair<double, double> elevation_range () const { return std::make_pair (-DBL_MAX, DBL_MAX); }
 
-       virtual void set_position (double) { }
+       virtual void ARDOURPANNER_APICALLTYPE set_position (double) { }
        virtual void set_width (double) { }
        virtual void set_elevation (double) { }
 
index 4524ed560bce98c556189af77418680bf374df50..ef70a11dc97d9d9f730b729c2d191dd880c4dd5f 100644 (file)
@@ -104,7 +104,7 @@ Panner1in2out::update ()
         desired_right = panR * (scale * panR + 1.0f - scale);
 }
 
-void
+ARDOURPANNER_API void ARDOURPANNER_APICALLTYPE
 Panner1in2out::set_position (double p)
 {
         if (clamp_position (p)) {
@@ -112,7 +112,7 @@ Panner1in2out::set_position (double p)
         }
 }
 
-bool
+ARDOURPANNER_API bool ARDOURPANNER_APICALLTYPE
 Panner1in2out::clamp_position (double& p)
 {
         /* any position between 0.0 and 1.0 is legal */
index 97d23495c716220cb929af7fbcf0a1af784a2d20..aa5428a329a873cab1f759a5bf746915b197cee4 100644 (file)
@@ -33,6 +33,7 @@
 #include "ardour/types.h"
 #include "ardour/panner.h"
 
+
 namespace ARDOUR {
 
 class Panner1in2out : public Panner
@@ -41,8 +42,8 @@ class Panner1in2out : public Panner
        Panner1in2out (boost::shared_ptr<Pannable>);
        ~Panner1in2out ();
 
-        void set_position (double);
-        bool clamp_position (double&);
+    ARDOURPANNER_API void ARDOURPANNER_APICALLTYPE set_position (double);
+    ARDOURPANNER_API bool ARDOURPANNER_APICALLTYPE clamp_position (double&);
        std::pair<double, double> position_range () const;
 
         double position() const;