Skip to content

Commit

Permalink
Add symbols export
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Jan 2, 2024
1 parent 565a1aa commit fc8b1a2
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 29 deletions.
10 changes: 5 additions & 5 deletions Context.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*****************************************************************//**
/*****************************************************************//**
* \file Context.h
* \brief Directly Musical Data Access library for VST3 with JUCE.
*
* \author WuChang
* \email 31423836@qq.com
* \date July 2023
* \version 1.0.0
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/

Expand All @@ -19,7 +19,7 @@ namespace DMDA {
*
* You can inherit this to create your own context types.
*/
class Context {
class DMDA_API Context {
public:
Context() = default;
virtual ~Context();
Expand All @@ -31,7 +31,7 @@ namespace DMDA {
* You can inhert this in DMDA host then pass the object pointer
* to Context::addListener() method to listen the change of the context.
*/
class Listener {
class DMDA_API Listener {
public:
virtual ~Listener() = default;

Expand Down
6 changes: 3 additions & 3 deletions DMDA.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* \author WuChang
* \email 31423836@qq.com
* \date Dec 2023
* \version 1.2.2
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/

Expand All @@ -15,7 +15,7 @@
#include "Context.h"
#include "MidiFileContext.h"

#define DMDA_VERSION "1.2.2"
#define DMDA_VERSION "1.2.3"

#if DMDA_PLUGIN

Expand Down
51 changes: 48 additions & 3 deletions Macros.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*****************************************************************//**
/*****************************************************************//**
* \file Macros.h
* \brief Directly Musical Data Access library for VST3 with JUCE.
*
* \author WuChang
* \email 31423836@qq.com
* \date July 2023
* \version 1.0.0
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/

Expand All @@ -19,3 +19,48 @@
#ifndef DMDA_PLUGIN
#define DMDA_PLUGIN 0
#endif // !DMDA_PLUGIN

#if defined (__clang__)
#define DMDA_CLANG 1

#elif defined (__GNUC__)
#define DMDA_GCC 1

#elif defined (_MSC_VER)
#define DMDA_MSVC 1

#else
#error Unknown cpp compiler
#endif

#if DMDA_MSVC
#define DMDA_EXPORT __declspec(dllexport)
#define DMDA_IMPORT __declspec(dllimport)
#define DMDA_CALL _cdecl
#endif

#if DMDA_CLANG
#define DMDA_EXPORT __attribute__((visibility("default")))
#define DMDA_IMPORT __attribute__((visibility("default")))
#define DMDA_CALL
#endif

#if DMDA_GCC
#define DMDA_EXPORT __attribute__((visibility("default")))
#define DMDA_IMPORT __attribute__((visibility("default")))
#define DMDA_CALL
#endif

#if !(DMDA_MSVC || DMDA_CLANG || DMDA_GCC)
#define DMDA_EXPORT
#define DMDA_IMPORT
#define DMDA_CALL
#endif

#if DMDA_DLL_BUILD
#define DMDA_API DMDA_EXPORT
#elif DMDA_DLL
#define DMDA_API DMDA_IMPORT
#else
#define DMDA_API
#endif // DMDA_DLL_BUILD
8 changes: 4 additions & 4 deletions MidiFileContext.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*****************************************************************//**
/*****************************************************************//**
* \file MidiFileContext.h
* \brief Directly Musical Data Access library for VST3 with JUCE.
*
* \author WuChang
* \email 31423836@qq.com
* \date Aug 2023
* \version 1.2.1
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/

Expand All @@ -18,7 +18,7 @@ namespace DMDA {
/**
* The DMDA context with juce::MidiFile data.
*/
class MidiFileContext : public Context {
class DMDA_API MidiFileContext : public Context {
public:
MidiFileContext() = default;

Expand Down
12 changes: 7 additions & 5 deletions PluginExtensions.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
/*****************************************************************//**
/*****************************************************************//**
* \file PluginExtensions.h
* \brief Directly Musical Data Access library for VST3 with JUCE.
*
* \author WuChang
* \email 31423836@qq.com
* \date July 2023
* \version 1.0.0
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/

#pragma once

#include <JuceHeader.h>

#include "Macros.h"

namespace DMDA {
class PluginProcessor;

enum class Vst3Result : int32_t {
enum class DMDA_API Vst3Result : int32_t {
OK = 0,
ERROR = -1
};

class Vst3Extensions : public juce::VST3ClientExtensions {
class DMDA_API Vst3Extensions : public juce::VST3ClientExtensions {
public:
Vst3Extensions() = delete;
explicit Vst3Extensions(PluginProcessor* processor);
Expand Down
8 changes: 4 additions & 4 deletions PluginProcessor.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*****************************************************************//**
/*****************************************************************//**
* \file PluginProcessor.h
* \brief Directly Musical Data Access library for VST3 with JUCE.
*
* \author WuChang
* \email 31423836@qq.com
* \date July 2023
* \version 1.0.2
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/

Expand Down Expand Up @@ -37,7 +37,7 @@ namespace DMDA {
* And you should call initContext() method in your constructor to
* create the context.
*/
class PluginProcessor : public juce::AudioProcessor {
class DMDA_API PluginProcessor : public juce::AudioProcessor {
public:
PluginProcessor();
PluginProcessor(
Expand Down
10 changes: 5 additions & 5 deletions PluginVisitor.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*****************************************************************//**
/*****************************************************************//**
* \file PluginVisitor.h
* \brief Directly Musical Data Access library for VST3 with JUCE.
*
* \author WuChang
* \email 31423836@qq.com
* \date July 2023
* \version 1.0.0
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/

Expand All @@ -25,7 +25,7 @@ namespace DMDA {
* You can pass it to AudioPluginInstance::getExtensions()
* then the handleContext() method could be invoked.
*/
class PluginVisitor : public juce::ExtensionsVisitor {
class DMDA_API PluginVisitor : public juce::ExtensionsVisitor {
public:
virtual ~PluginVisitor() override = default;
/**
Expand Down Expand Up @@ -57,7 +57,7 @@ namespace DMDA {
* thePluginInstance->getExtensions(handler);
* @endcode
*/
class PluginHandler final : public PluginVisitor {
class DMDA_API PluginHandler final : public PluginVisitor {
public:
PluginHandler() = delete;
PluginHandler(std::function<void(Context*)> function);
Expand Down

0 comments on commit fc8b1a2

Please sign in to comment.