Support LV2 with MSVC (#5730)

This commit is contained in:
Dominic Clark
2020-10-31 13:28:18 +00:00
committed by GitHub
parent 6a78d8d535
commit 615d36b08b
7 changed files with 37 additions and 11 deletions

View File

@@ -8,7 +8,11 @@ environment:
matrix:
- compiler: msvc
install:
- vcpkg install --triplet %PLATFORM%-windows --recurse fftw3 libsamplerate libsndfile sdl2
- cd C:\Tools\vcpkg
- git pull
- .\bootstrap-vcpkg.bat
- cd %APPVEYOR_BUILD_FOLDER%
- vcpkg install --triplet %PLATFORM%-windows --recurse fftw3 libsamplerate libsndfile lilv lv2 sdl2
- nuget install clcache -Version 4.1.0
build_script:
- cd %APPVEYOR_BUILD_FOLDER%

View File

@@ -203,14 +203,19 @@ IF(WANT_LV2)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(LV2 lv2)
PKG_CHECK_MODULES(LILV lilv-0)
IF(LV2_FOUND AND LILV_FOUND)
SET(LMMS_HAVE_LV2 TRUE)
SET(STATUS_LV2 "OK")
ELSE()
SET(STATUS_LV2 "not found, install it or set PKG_CONFIG_PATH appropriately")
ENDIF()
IF(NOT LV2_FOUND AND NOT LILV_FOUND)
FIND_PACKAGE(LV2 CONFIG)
FIND_PACKAGE(LILV CONFIG)
IF(LILV_FOUND)
SET(LILV_LIBRARIES "lilv::lilv")
ENDIF()
ENDIF()
IF(LV2_FOUND AND LILV_FOUND)
SET(LMMS_HAVE_LV2 TRUE)
SET(STATUS_LV2 "OK")
ELSE()
SET(STATUS_LV2 "not found, requires pkg-config")
SET(STATUS_LV2 "not found, install it or set PKG_CONFIG_PATH appropriately")
ENDIF()
ELSE(WANT_LV2)
SET(STATUS_LV2 "not built as requested")

View File

@@ -33,6 +33,7 @@
#include "DataFile.h"
#include "LinkedModelGroups.h"
#include "lmms_export.h"
#include "Plugin.h"
class Lv2Proc;
@@ -65,7 +66,7 @@ class PluginIssue;
* this class can not override virtuals of Instrument or EffectControls, so
it will offer functions that must be called by virtuals in its child class
*/
class Lv2ControlBase : public LinkedModelGroups
class LMMS_EXPORT Lv2ControlBase : public LinkedModelGroups
{
public:
static Plugin::PluginTypes check(const LilvPlugin* m_plugin,
@@ -87,7 +88,11 @@ protected:
//! this is the same pointer as this, but a different type
//! @param uri the Lv2 URI telling this class what plugin to construct
Lv2ControlBase(class Model *that, const QString& uri);
Lv2ControlBase(const Lv2ControlBase&) = delete;
~Lv2ControlBase() override;
Lv2ControlBase& operator=(const Lv2ControlBase&) = delete;
//! Must be checked after ctor or reload
bool isValid() const { return m_valid; }

View File

@@ -33,9 +33,10 @@
#include <lilv/lilv.h>
#include "lmms_export.h"
#include "Plugin.h"
class Lv2SubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures
class LMMS_EXPORT Lv2SubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures
{
private:
static const LilvPlugin *getPlugin(const Key &k);

View File

@@ -34,6 +34,7 @@
#include <QVector>
#include "LinkedModelGroupViews.h"
#include "lmms_export.h"
#include "Lv2Basics.h"
class Lv2Proc;
@@ -54,7 +55,7 @@ private:
//! Base class for view for one Lv2 plugin
class Lv2ViewBase : public LinkedModelGroupsView
class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView
{
protected:
//! @param pluginWidget A child class which inherits QWidget

View File

@@ -35,6 +35,9 @@
extern "C"
{
Plugin::Descriptor PLUGIN_EXPORT lv2effect_plugin_descriptor =
{
STRINGIFY(PLUGIN_NAME),
@@ -49,6 +52,8 @@ Plugin::Descriptor PLUGIN_EXPORT lv2effect_plugin_descriptor =
new Lv2SubPluginFeatures(Plugin::Effect)
};
}

View File

@@ -41,6 +41,9 @@
extern "C"
{
Plugin::Descriptor PLUGIN_EXPORT lv2instrument_plugin_descriptor =
{
STRINGIFY(PLUGIN_NAME),
@@ -55,6 +58,8 @@ Plugin::Descriptor PLUGIN_EXPORT lv2instrument_plugin_descriptor =
new Lv2SubPluginFeatures(Plugin::Instrument)
};
}
@@ -221,7 +226,7 @@ Lv2InsView::Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent) :
setAutoFillBackground(true);
if (m_reloadPluginButton) {
connect(m_reloadPluginButton, &QPushButton::clicked,
this, [this](){ castModel<Lv2Instrument>()->reloadPlugin();} );
this, [this](){ this->castModel<Lv2Instrument>()->reloadPlugin();} );
}
if (m_toggleUIButton) {
connect(m_toggleUIButton, &QPushButton::toggled,