pantherb / setBfree

DSP tonewheel organ
http://setbfree.org
GNU General Public License v2.0
194 stars 35 forks source link

Cannot build against zita-convolver v4 #69

Closed falkTX closed 4 years ago

falkTX commented 4 years ago
convolution.cc:32:2: error: #error "This programs requires zita-convolver 3.x.x"
 #error "This programs requires zita-convolver 3.x.x

I imagine this is a problem in a few distributions. Debian probably already patched it. EDIT: just checked, debian does not patch anything

falkTX commented 4 years ago

Here is a patch fix:

--- setbfree-0.8.11.orig/b_conv/convolution.cc
+++ setbfree-0.8.11/b_conv/convolution.cc
@@ -28,8 +28,8 @@
 #include <sndfile.h>
 #include <zita-convolver.h>

-#if ZITA_CONVOLVER_MAJOR_VERSION != 3
-#error "This programs requires zita-convolver 3.x.x"
+#if ZITA_CONVOLVER_MAJOR_VERSION != 3 && ZITA_CONVOLVER_MAJOR_VERSION != 4
+#error "This programs requires zita-convolver 3.x.x or 4.x.x"
 #endif

 #ifndef DFLT_IR_FILE
@@ -182,7 +182,9 @@ initConvolution (

    convproc = new Convproc;
    convproc->set_options (options);
+#if ZITA_CONVOLVER_MAJOR_VERSION == 3
    convproc->set_density (dens);
+#endif

    if (convproc->configure (
            /*in*/ channels,
@@ -191,6 +193,9 @@ initConvolution (
            /*fragm*/ buffersize,
            /*min-part*/ buffersize,
            /*max-part*/ buffersize /*Convproc::MAXPART*/
+#if ZITA_CONVOLVER_MAJOR_VERSION == 4
+           , dens /*density*/
+#endif
            )) {
        fprintf (stderr, "\nConvolution: Cannot initialize convolution engine.\n");
        exit (1);
x42 commented 4 years ago

Do not compile setBfree with ENABLE_CONVOLUTION. The build-in convolver was a failed experiment, has never been enabled by default, and should not be used as-is.

falkTX commented 4 years ago

Oh, I was not aware of this at all.. can we make the code error out if enabled then?

x42 commented 4 years ago

can we make the code error out if enabled then?

It's potentially useful for some future dev so that'd be tricky. Then again it hasn't been since 8 years so I might just remove it.