diff --git a/.gitmodules b/.gitmodules index f6731d121ae..1ed1eead067 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,6 @@ [submodule "plugins/OpulenZ/adplug"] path = plugins/OpulenZ/adplug url = https://github.com/adplug/adplug.git -[submodule "plugins/LadspaEffect/calf/calf"] - path = plugins/LadspaEffect/calf/calf - url = https://github.com/calf-studio-gear/calf +[submodule "plugins/LadspaEffect/calf/veal"] + path = plugins/LadspaEffect/calf/veal + url = https://github.com/lmms/veal diff --git a/plugins/LadspaEffect/calf/CMakeLists.txt b/plugins/LadspaEffect/calf/CMakeLists.txt new file mode 100644 index 00000000000..eaccd87aee8 --- /dev/null +++ b/plugins/LadspaEffect/calf/CMakeLists.txt @@ -0,0 +1,45 @@ +# Note: +# The last version of Calf that was LADSPA-capable is version 0.0.18.2 + +# Parse version info from autoconf +FILE(READ veal/configure.ac VERSION_FILE) +STRING(REPLACE "[" ";" VERSION_FILE ${VERSION_FILE} ) +STRING(REPLACE "]" ";" VERSION_FILE ${VERSION_FILE} ) +LIST(GET VERSION_FILE 2 VERSION) +CONFIGURE_FILE(config.h.in config.h) + +FILE(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/veal/src/*.cpp") +LIST(SORT SOURCES) + +# Skip files matching pattern +SET(FILE_PATTERNS "ctl;gui;gtk;session;connector;jack;rdf;draw;fluid;preset;lv2;benchmark;win") +FOREACH(_item ${SOURCES}) + FOREACH(_pattern ${FILE_PATTERNS}) + IF(${_item} MATCHES ${_pattern}) + LIST(REMOVE_ITEM SOURCES ${_item}) + ENDIF() + ENDFOREACH() +ENDFOREACH() + +ADD_LIBRARY(veal MODULE ${SOURCES}) +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include" + "${CMAKE_BINARY_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/veal/src") + +INSTALL(TARGETS veal LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa") +SET_TARGET_PROPERTIES(veal PROPERTIES PREFIX "") +SET(INLINE_FLAGS "") +IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + SET(INLINE_FLAGS "-finline-functions-called-once -finline-limit=80") +ENDIF() +SET_TARGET_PROPERTIES(veal PROPERTIES COMPILE_FLAGS "-fexceptions -O2 -finline-functions ${INLINE_FLAGS}") + +# Don't strip if "Debug" or "RelWithDebInfo" +IF(LMMS_BUILD_WIN32 AND NOT CMAKE_BUILD_TYPE MATCHES "Deb") + ADD_CUSTOM_COMMAND(TARGET veal POST_BUILD COMMAND "${STRIP}" "$") +ENDIF() +IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD) + SET_TARGET_PROPERTIES(veal PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined") +ENDIF() + diff --git a/plugins/LadspaEffect/calf/calf b/plugins/LadspaEffect/calf/calf deleted file mode 160000 index f71e2742e14..00000000000 --- a/plugins/LadspaEffect/calf/calf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f71e2742e1463906c3d44a4b33c1d90e3ad61acb diff --git a/plugins/LadspaEffect/calf/config.h.in b/plugins/LadspaEffect/calf/config.h.in new file mode 100644 index 00000000000..a636660e583 --- /dev/null +++ b/plugins/LadspaEffect/calf/config.h.in @@ -0,0 +1,3 @@ +#define VERSION "${VERSION}" +#define PACKAGE_NAME "veal" +#define USE_LADSPA 1 diff --git a/plugins/LadspaEffect/calf/veal b/plugins/LadspaEffect/calf/veal new file mode 160000 index 00000000000..b192af9bf76 --- /dev/null +++ b/plugins/LadspaEffect/calf/veal @@ -0,0 +1 @@ +Subproject commit b192af9bf7620730fe67d32dc668060e8dacb725 diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index cd73be05dc4..7d9f40fdeb9 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -995,6 +995,31 @@ void DataFile::upgrade_1_3_0() } } } + + list = elementsByTagName( "effect" ); + for( int i = 0; !list.item( i ).isNull(); ++i ) + { + QDomElement effect = list.item( i ).toElement(); + if( effect.attribute( "name" ) == "ladspaeffect" ) + { + QDomNodeList keys = effect.elementsByTagName( "key" ); + for( int j = 0; !keys.item( j ).isNull(); ++j ) + { + QDomElement key = keys.item( j ).toElement(); + QDomNodeList attributes = key.elementsByTagName( "attribute" ); + for( int k = 0; !attributes.item( k ).isNull(); ++k ) + { + QDomElement attribute = attributes.item( k ).toElement(); + if( attribute.attribute( "name" ) == "file" && + ( attribute.attribute( "value" ) == "calf" || + attribute.attribute( "value" ) == "calf.so" ) ) + { + attribute.setAttribute( "value", "veal" ); + } + } + } + } + } }