Skip to content

Commit

Permalink
Native linux VST support (#6048)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
  • Loading branch information
akimaze and DomClark authored Mar 2, 2022
1 parent 7db3fa9 commit a08e7f9
Show file tree
Hide file tree
Showing 11 changed files with 444 additions and 44 deletions.
3 changes: 1 addition & 2 deletions include/RemotePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <string>
#include <cassert>


#if !(defined(LMMS_HAVE_SYS_IPC_H) && defined(LMMS_HAVE_SEMAPHORE_H))
#define SYNC_WITH_SHM_FIFO
#define USE_QT_SEMAPHORES
Expand Down Expand Up @@ -440,6 +439,7 @@ enum RemoteMessageIDs
IdSavePresetFile,
IdLoadPresetFile,
IdDebugMessage,
IdIdle,
IdUserBase = 64
} ;

Expand Down Expand Up @@ -1000,7 +1000,6 @@ class RemotePluginClient : public RemotePluginBase

sample_rate_t m_sampleRate;
fpp_t m_bufferSize;

} ;

#endif
Expand Down
4 changes: 4 additions & 0 deletions include/aeffectx.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
#include <type_traits>

// Calling convention
#ifdef _WIN32
#define VST_CALL_CONV __cdecl
#else
#define VST_CALL_CONV
#endif

template<typename T>
constexpr int32_t CCONST(T a, T b, T c, T d)
Expand Down
7 changes: 7 additions & 0 deletions plugins/vestige/vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ Plugin::Descriptor Q_DECL_EXPORT vestige_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
#ifdef LMMS_BUILD_LINUX
"dll,so",
#else
"dll",
#endif
nullptr,
} ;

Expand Down Expand Up @@ -682,6 +686,9 @@ void VestigeInstrumentView::openPlugin()
QStringList types;
types << tr( "DLL-files (*.dll)" )
<< tr( "EXE-files (*.exe)" )
#ifdef LMMS_BUILD_LINUX
<< tr( "SO-files (*.so)" )
#endif
;
ofd.setNameFilters( types );

Expand Down
8 changes: 8 additions & 0 deletions plugins/vst_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ INCLUDE(ExternalProject)
# These variables are not meant to be used normally, except packaging
SET(REMOTE_VST_PLUGIN_FILEPATH_32 "32/RemoteVstPlugin32" CACHE STRING "Relative file path to RemoteVstPlugin32")
SET(REMOTE_VST_PLUGIN_FILEPATH_64 "RemoteVstPlugin64" CACHE STRING "Relative file path to RemoteVstPlugin64")
IF(LMMS_BUILD_LINUX)
SET(NATIVE_LINUX_REMOTE_VST_PLUGIN_FILEPATH_64 "NativeLinuxRemoteVstPlugin64"
CACHE STRING "Relative file path to NativeLinuxRemoteVstPlugin64")
ENDIF()

ADD_SUBDIRECTORY(vstbase)

Expand Down Expand Up @@ -48,3 +52,7 @@ ENDIF()
IF(WANT_VST_64)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/RemoteVstPlugin64.cmake")
ENDIF()

IF(LMMS_BUILD_LINUX)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/NativeLinuxRemoteVstPlugin64.cmake")
ENDIF()
11 changes: 11 additions & 0 deletions plugins/vst_base/NativeLinuxRemoteVstPlugin64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
IF(LMMS_BUILD_LINUX)
ExternalProject_Add(NativeLinuxRemoteVstPlugin64
"${EXTERNALPROJECT_ARGS}"
CMAKE_ARGS
"${EXTERNALPROJECT_CMAKE_ARGS}"
"-DCMAKE_CXX_FLAGS=-m64 -DNATIVE_LINUX_VST"
"-DCMAKE_C_FLAGS=-DNATIVE_LINUX_VST"
)
INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../NativeLinuxRemoteVstPlugin64" DESTINATION "${PLUGIN_DIR}")
ENDIF()

Loading

0 comments on commit a08e7f9

Please sign in to comment.