Skip to content

Commit

Permalink
Merge pull request surge-synthesizer#96 from jsakkine/master
Browse files Browse the repository at this point in the history
Project target/template for a standalone app
  • Loading branch information
kurasu authored Dec 18, 2018
2 parents fb6fa94 + ce2bc05 commit 0c10469
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 3 deletions.
36 changes: 36 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,39 @@ if (os.istarget("macosx")) then
postbuildcommands { "./package-au.sh" }

end

if (os.istarget("linux")) then
project "surge-app"
kind "WindowedApp"

defines
{
"TARGET_APP=1"
}

plugincommon()

files {
"src/app/main.cpp",
"src/app/PluginLayer.cpp",
VSTGUI .. "plugin-bindings/plugguieditor.cpp",
}

includedirs {
"src/app"
}

links {
"dl",
"freetype",
"fontconfig",
"X11",
}

configuration { "Debug" }
targetdir "target/app/Debug"
targetsuffix "-Debug"

configuration { "Release" }
targetdir "target/app/Release"
end
11 changes: 11 additions & 0 deletions src/app/PluginLayer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "PluginLayer.h"
#include "globals.h"
#include "SurgeSynthesizer.h"

void PluginLayer::updateDisplay()
{
}

void PluginLayer::sendParameterAutomation(long index, float value)
{
}
8 changes: 8 additions & 0 deletions src/app/PluginLayer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "SurgeSynthesizer.h"

class PluginLayer
{
public:
void updateDisplay();
void sendParameterAutomation(long index, float value);
};
11 changes: 11 additions & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "globals.h"
#include "CpuArchitecture.h"
#include "SurgeSynthesizer.h"
#include <float.h>

namespace VSTGUI { void* soHandle = nullptr; }

int main(int argc, char **argv)
{
return 0;
}
5 changes: 5 additions & 0 deletions src/common/SurgeSynthesizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#elif TARGET_VST3
#include "SurgeVst3Processor.h"
#include "vstgui/plugin-bindings/plugguieditor.h"
#elif TARGET_APP
#include "PluginLayer.h"
#include "vstgui/plugin-bindings/plugguieditor.h"
#else
#include "Vst2PluginInstance.h"
#include "vstgui/plugin-bindings/aeffguieditor.h"
Expand Down Expand Up @@ -676,6 +679,8 @@ void SurgeSynthesizer::sendParameterAutomation(long index, float value)
// getParent()->ParameterUpdate(externalparam);
#elif TARGET_VST3
getParent()->setParameterAutomated(externalparam, value);
#elif TARGET_APP
getParent()->sendParameterAutomation(externalparam, value);
#else
getParent()->setParameterAutomated(externalparam, value);
#endif
Expand Down
6 changes: 4 additions & 2 deletions src/common/SurgeSynthesizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ typedef aulayer PluginLayer;
#elif TARGET_VST3
class SurgeVst3Processor;
typedef SurgeVst3Processor PluginLayer;
#else
#elif TARGET_VST2
class Vst2PluginInstance;
using PluginLayer = Vst2PluginInstance;
#else
class PluginLayer;
#endif

class SurgeSynthesizer : public AbstractSynthesizer
Expand Down Expand Up @@ -193,4 +195,4 @@ class SurgeSynthesizer : public AbstractSynthesizer
void ReleaseControlInterpolator(int Idx);
ControllerModulationSource* ControlInterpolator(int Idx);
ControllerModulationSource* AddControlInterpolator(int Idx, bool& AlreadyExisted);
};
};
5 changes: 4 additions & 1 deletion src/common/gui/SurgeGUIEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ typedef PluginGUIEditor EditorType;
#elif TARGET_VST3
#include "public.sdk/source/vst/vstguieditor.h"
typedef Steinberg::Vst::VSTGUIEditor EditorType;
#else
#elif TARGET_VST2
#include <vstgui/plugin-bindings/aeffguieditor.h>
typedef AEffGUIEditor EditorType;
#else
#include <vstgui/plugin-bindings/plugguieditor.h>
typedef PluginGUIEditor EditorType;
#endif

#include "SurgeStorage.h"
Expand Down

0 comments on commit 0c10469

Please sign in to comment.