Skip to content

Commit

Permalink
Merge pull request #2 from Rossmaxx/enable-ladspa
Browse files Browse the repository at this point in the history
Enable ladspa
  • Loading branch information
dan-giddins authored Jul 22, 2023
2 parents edfb6ef + 249b332 commit d105f49
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 39 deletions.
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ IF(COMMAND CMAKE_POLICY)
ENDIF()
CMAKE_POLICY(SET CMP0020 NEW)
CMAKE_POLICY(SET CMP0057 NEW)
# TODO: Keep CMP0074 but remove this condition when cmake 3.12+ is guaranteed
IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12)
CMAKE_POLICY(SET CMP0074 NEW)
ENDIF()
ENDIF(COMMAND CMAKE_POLICY)


Expand Down Expand Up @@ -273,8 +277,17 @@ ELSE(WANT_CMT)
ENDIF(WANT_CMT)

IF(WANT_SWH)
SET(LMMS_HAVE_SWH TRUE)
SET(STATUS_SWH "OK")
IF(LMMS_BUILD_APPLE)
# Prefer system perl over Homebrew, MacPorts, etc
SET(Perl_ROOT "/usr/bin")
ENDIF()
FIND_PACKAGE(Perl)
IF(PERL_FOUND)
SET(LMMS_HAVE_SWH TRUE)
SET(STATUS_SWH "OK")
ELSE()
SET(STATUS_SWH "Skipping, perl is missing")
ENDIF()
ELSE(WANT_SWH)
SET(STATUS_SWH "not built as requested")
ENDIF(WANT_SWH)
Expand Down
8 changes: 0 additions & 8 deletions cmake/modules/PluginList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,3 @@ IF(LIST_PLUGINS)
LIST_ALL_PLUGINS()
ENDIF()

IF(MSVC)
SET(MSVC_INCOMPATIBLE_PLUGINS
LadspaEffect
)
message(WARNING "Compiling with MSVC. The following plugins are not available: ${MSVC_INCOMPATIBLE_PLUGINS}")
LIST(REMOVE_ITEM PLUGIN_LIST ${MSVC_INCOMPATIBLE_PLUGINS})
ENDIF()

3 changes: 3 additions & 0 deletions include/ladspa.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ typedef struct _LADSPA_Descriptor {
returning NULL, so the plugin count can be determined by checking
for the least index that results in NULL being returned. */

#ifdef _MSC_VER
__declspec(dllexport)
#endif
const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index);

/* Datatype corresponding to the ladspa_descriptor() function. */
Expand Down
5 changes: 4 additions & 1 deletion plugins/LadspaEffect/calf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ 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}")

IF(NOT MSVC)
SET_TARGET_PROPERTIES(veal PROPERTIES COMPILE_FLAGS "-fexceptions -O2 -finline-functions ${INLINE_FLAGS}")
endif()

if(LMMS_BUILD_WIN32)
add_custom_command(
Expand Down
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/calf/veal
Submodule veal updated 52 files
+4 −0 ChangeLog
+66 −15 calf-gui.xml
+2 −2 configure.ac
+18 −1 doc/manuals/Limiter.html
+6 −1 doc/manuals/Multiband Limiter.html
+5 −0 doc/manuals/Sidechain Limiter.html
+ doc/manuals/images/Calf - Limiters - ASC behaviours.jpg
+ doc/manuals/images/Calf - Limiters - ASC.jpg
+1 −1 gui/gui/eq30.xml
+17 −16 gui/gui/limiter.xml
+15 −12 gui/gui/multibandlimiter.xml
+12 −9 gui/gui/sidechainlimiter.xml
+58 −48 src/analyzer.cpp
+37 −21 src/audio_fx.cpp
+1 −0 src/calf/audio_fx.h
+4 −0 src/calf/biquad.h
+4 −4 src/calf/fixed_point.h
+2 −2 src/calf/giface.h
+2 −0 src/calf/gui.h
+2 −0 src/calf/gui_config.h
+2 −0 src/calf/host_session.h
+2 −2 src/calf/jackhost.h
+5 −0 src/calf/loudness.h
+1 −1 src/calf/lv2_options.h
+1 −1 src/calf/lv2_ui.h
+3 −3 src/calf/lv2wrap.h
+3 −0 src/calf/metadata.h
+9 −9 src/calf/modules_filter.h
+1,373 −1,089 src/calf/orfanidis_eq.h
+7 −3 src/calf/osctl.h
+6 −0 src/calf/primitives.h
+14 −3 src/calf/utils.h
+1 −4 src/ctl_knob.cpp
+0 −3 src/ctl_tube.cpp
+25 −0 src/fluidsynth.cpp
+9 −3 src/giface.cpp
+92 −67 src/gtk_main_win.cpp
+16 −10 src/gui_config.cpp
+37 −18 src/host_session.cpp
+21 −6 src/jackhost.cpp
+1 −1 src/makerdf.cpp
+6 −2 src/metadata.cpp
+72 −72 src/modules_comp.cpp
+4 −3 src/modules_delay.cpp
+38 −12 src/modules_dist.cpp
+82 −75 src/modules_filter.cpp
+26 −17 src/modules_limit.cpp
+26 −26 src/modules_mod.cpp
+10 −9 src/modules_tools.cpp
+2 −1 src/organ.cpp
+26 −1 src/utils.cpp
+0 −1 src/veal.cpp
6 changes: 5 additions & 1 deletion plugins/LadspaEffect/caps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ IF(LMMS_BUILD_WIN64)
ADD_DEFINITIONS(-DLMMS_BUILD_WIN64)
ENDIF(LMMS_BUILD_WIN64)
SET_TARGET_PROPERTIES(caps PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O2 -funroll-loops -Wno-write-strings")

IF (NOT MSVC)
SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O2 -funroll-loops -Wno-write-strings")
ENDIF(NOT MSVC)

IF(LMMS_BUILD_WIN32)
add_custom_command(
Expand All @@ -18,6 +21,7 @@ IF(LMMS_BUILD_WIN32)
COMMAND_EXPAND_LISTS
)
ENDIF(LMMS_BUILD_WIN32)

IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD)
SET_TARGET_PROPERTIES(caps PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined")
ENDIF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD)
Expand Down
11 changes: 7 additions & 4 deletions plugins/LadspaEffect/caps/basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@
#define _ISOC99_SOURCE 1
#define _ISOC9X_SOURCE 1

#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <math.h>

#include <assert.h>
#include <stdio.h>
#include <stdint.h>

#include <ladspa.h>

Expand Down Expand Up @@ -76,7 +79,7 @@

#define MIN_GAIN .000001 /* -120 dB */

/* smallest non-denormal 32 bit IEEE float is 1.18×10-38 */
/* smallest non-denormal 32 bit IEEE float is 1.18*10-38 */
#define NOISE_FLOOR .00000000000005 /* -266 dB */

typedef int8_t int8;
Expand Down
9 changes: 6 additions & 3 deletions plugins/LadspaEffect/caps/dsp/Eq.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
02111-1307, USA or point your web browser to http://www.gnu.org.
*/


#include "../basics.h"

#ifndef _DSP_EQ_H_
#define _DSP_EQ_H_

Expand Down Expand Up @@ -62,11 +65,11 @@ class Eq
{
public:
/* recursion coefficients, 3 per band */
eq_sample __attribute__ ((aligned)) a[Bands], b[Bands], c[Bands];
eq_sample a[Bands], b[Bands], c[Bands];
/* past outputs, 2 per band */
eq_sample __attribute__ ((aligned)) y[2][Bands];
eq_sample y[2][Bands];
/* current gain and recursion factor, each 1 per band = 2 */
eq_sample __attribute__ ((aligned)) gain[Bands], gf[Bands];
eq_sample gain[Bands], gf[Bands];
/* input history */
eq_sample x[2];
/* history index */
Expand Down
2 changes: 2 additions & 0 deletions plugins/LadspaEffect/caps/dsp/OnePole.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
02111-1307, USA or point your web browser to http://www.gnu.org.
*/

#include "../basics.h"

#ifndef _ONE_POLE_H_
#define _ONE_POLE_H_

Expand Down
3 changes: 3 additions & 0 deletions plugins/LadspaEffect/caps/dsp/SVF.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@
}
*/

#include "../basics.h"

#ifndef _DSP_SVF_H_
#define _DSP_SVF_H_


namespace DSP {

template <int OVERSAMPLE>
Expand Down
2 changes: 2 additions & 0 deletions plugins/LadspaEffect/caps/dsp/Sine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
02111-1307, USA or point your web browser to http://www.gnu.org.
*/

#include "../basics.h"

#ifndef _DSP_SINE_H_
#define _DSP_SINE_H_

Expand Down
24 changes: 9 additions & 15 deletions plugins/LadspaEffect/caps/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
(2541 - 2580 donated to [email protected])
*/

#include <sys/time.h>

#include "basics.h"

#include "Cabinet.h"
Expand Down Expand Up @@ -58,18 +56,8 @@
#define N 39
static DescriptorStub * descriptors [N];

/*static inline void
seed()
{
static struct timeval tv;
gettimeofday (&tv, 0);
srand (tv.tv_sec ^ tv.tv_usec);
}*/

extern "C" {

__attribute__ ((constructor))
void caps_so_init()
{
DescriptorStub ** d = descriptors;
Expand Down Expand Up @@ -121,11 +109,8 @@ void caps_so_init()

/* make sure N is correct */
assert (d - descriptors == N);

//seed();
}

__attribute__ ((destructor))
void caps_so_fini()
{
for (ulong i = 0; i < N; ++i)
Expand All @@ -134,6 +119,9 @@ void caps_so_fini()

/* /////////////////////////////////////////////////////////////////////// */

#ifdef _MSC_VER
__declspec(dllexport)
#endif
const LADSPA_Descriptor *
ladspa_descriptor (unsigned long i)
{
Expand All @@ -142,4 +130,10 @@ ladspa_descriptor (unsigned long i)
return 0;
}

struct CapsSoInit {
CapsSoInit() { caps_so_init(); }
~CapsSoInit() { caps_so_fini(); }
};
static CapsSoInit capsSoInit;

}; /* extern "C" */
3 changes: 2 additions & 1 deletion plugins/LadspaEffect/swh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SET(COMPILE_FLAGS "${COMPILE_FLAGS} ${PIC_FLAGS}")
# Loop over every XML file
FILE(GLOB XML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ladspa/*.xml")
LIST(SORT XML_SOURCES)

FOREACH(_item ${XML_SOURCES})
# Get library name and (soon to be) C file
GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
Expand All @@ -24,7 +25,7 @@ FOREACH(_item ${XML_SOURCES})
# Coerce XML source file to C
ADD_CUSTOM_COMMAND(
OUTPUT "${_out_file}"
COMMAND ./makestub.pl "${_item}" > "${_out_file}"
COMMAND ${PERL_EXECUTABLE} ./makestub.pl "${_item}" > "${_out_file}"
DEPENDS "${_item}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ladspa"
VERBATIM
Expand Down
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/swh/ladspa
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/tap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
FILE(GLOB PLUGIN_SOURCES tap-plugins/*.c)
LIST(SORT PLUGIN_SOURCES)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
FOREACH(_item ${PLUGIN_SOURCES})
GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
ADD_LIBRARY("${_plugin}" MODULE "${_item}")
Expand Down
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/tap/tap-plugins

0 comments on commit d105f49

Please sign in to comment.