bs2b VST plugin: add recipe for version 2.1.0

This commit is contained in:
Sergei Reznikov
2015-04-24 14:47:16 +03:00
parent 61617156ee
commit b55da069c0
2 changed files with 247 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
SUMMARY="Bauer stereophonic-to-binaural DSP VST plugin"
DESCRIPTION="The Bauer stereophonic-to-binaural DSP (bs2b) is designed to \
improve headphone listening of stereo audio records.
Recommended for headphone prolonged listening to disable superstereo fatigue.
"
LICENSE="MIT"
COPYRIGHT="2005 Boris Mikhaylov"
HOMEPAGE="http://bs2b.sourceforge.net"
SRC_URI="svn://svn.code.sf.net/p/bs2b/code/trunk"
SRC_URI_2="svn+https://github.com/kxproject/kx-audio-driver/trunk/vst"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PATCHES="bs2b-2.1.0.patchset"
PROVIDES="
bs2b$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libsndfile$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libsndfile$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:g++$secondaryArchSuffix
cmd:make
cmd:libtoolize
cmd:aclocal
cmd:autoconf
cmd:autoreconf
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cd $sourceDir/libbs2b
./autogen.sh
./configure
make
# fix line endings
sed -i 's/\r//' $sourceDir2/h/*.h
sed -i 's/\r//' $sourceDir2/vstlib/*.h
sed -i 's/\r//' $sourceDir2/vstgui/*.h
cd $sourceDir/plugins/vst/src
gcc -shared -o bs2b $sourceDir2/vstlib/audioeffect.cpp \
$sourceDir2/vstlib/audioeffectx.cpp \
bs2b_vst.cpp \
main.cpp \
-I$sourceDir2/h/ -I$sourceDir2/vstlib -I$sourceDir2/vstgui -I../../../libbs2b/src \
../../../libbs2b/src/.libs/libbs2b.a
}
INSTALL()
{
mkdir -p $addOnsDir/media/vstplugins
cp $sourceDir/plugins/vst/src/bs2b $addOnsDir/media/vstplugins
}

View File

@@ -0,0 +1,180 @@
From 27930cde64a958aca9f824801f3e6dd4403b9dc9 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 23 Apr 2015 23:24:40 +1000
Subject: Add stub for haiku
diff --git a/plugins/vst/src/bs2b_vst.cpp b/plugins/vst/src/bs2b_vst.cpp
index 09756ec..d11b454 100644
--- a/plugins/vst/src/bs2b_vst.cpp
+++ b/plugins/vst/src/bs2b_vst.cpp
@@ -26,6 +26,7 @@
#include "bs2b_effect.h"
#include "bs2b_editor.h"
+
AudioEffect *createEffectInstance( audioMasterCallback audioMaster )
{
return new bs2b_effect( audioMaster );
@@ -44,7 +45,7 @@ bs2b_effect::bs2b_effect( audioMasterCallback audioMaster )
vst_strncpy( m_programName, "Default", kVstMaxProgNameLen );
// EDITOR
- editor = new bs2b_editor( this );
+ //editor = new bs2b_editor( this );
}
bs2b_effect::~bs2b_effect() {}
@@ -65,24 +66,24 @@ void bs2b_effect::setParameter( VstInt32 index, float value )
{
case PARAM_LEVEL_FEED:
if( ! param_defs )
- bs2b.set_level_feed_norm( value );
+ _bs2b.set_level_feed_norm( value );
break;
case PARAM_LEVEL_FCUT:
if( ! param_defs )
- bs2b.set_level_fcut_norm( value );
+ _bs2b.set_level_fcut_norm( value );
break;
case PARAM_LEVEL_DEFS:
param_defs = ( int )( value * PARAM_LEVEL_DEF__MAX - 0.01f );
switch( param_defs )
{
case PARAM_LEVEL_DEF_DEFAULT:
- bs2b.set_level( BS2B_DEFAULT_CLEVEL );
+ _bs2b.set_level( BS2B_DEFAULT_CLEVEL );
break;
case PARAM_LEVEL_DEF_CMOY:
- bs2b.set_level( BS2B_CMOY_CLEVEL );
+ _bs2b.set_level( BS2B_CMOY_CLEVEL );
break;
case PARAM_LEVEL_DEF_JMEIER:
- bs2b.set_level( BS2B_JMEIER_CLEVEL );
+ _bs2b.set_level( BS2B_JMEIER_CLEVEL );
break;
default:
param_defs = 0;
@@ -91,8 +92,8 @@ void bs2b_effect::setParameter( VstInt32 index, float value )
break;
} // switch( index )
- if( editor )
- ( ( AEffGUIEditor * )editor )->setParameter( index, value );
+ //if( editor )
+ // ( ( AEffGUIEditor * )editor )->setParameter( index, value );
}
float bs2b_effect::getParameter( VstInt32 index )
@@ -100,9 +101,9 @@ float bs2b_effect::getParameter( VstInt32 index )
switch( index )
{
case PARAM_LEVEL_FEED:
- return bs2b.get_level_feed_norm();
+ return _bs2b.get_level_feed_norm();
case PARAM_LEVEL_FCUT:
- return bs2b.get_level_fcut_norm();
+ return _bs2b.get_level_fcut_norm();
case PARAM_LEVEL_DEFS:
return ( float )param_defs / ( PARAM_LEVEL_DEF__MAX - 1 );
default:
@@ -134,7 +135,7 @@ void bs2b_effect::getParameterDisplay( VstInt32 index, char *text )
{
case PARAM_LEVEL_FEED:
{
- int feed = bs2b.get_level_feed();
+ int feed = _bs2b.get_level_feed();
sprintf( string, "%d.%d", feed / 10, feed % 10 );
vst_strncpy( text, string, kVstMaxParamStrLen );
}
@@ -142,7 +143,7 @@ void bs2b_effect::getParameterDisplay( VstInt32 index, char *text )
case PARAM_LEVEL_FCUT:
{
sprintf( string, "%d/%d",
- bs2b.get_level_fcut(), bs2b.get_level_delay() );
+ _bs2b.get_level_fcut(), _bs2b.get_level_delay() );
vst_strncpy( text, string, kVstMaxParamStrLen );
}
break;
@@ -172,7 +173,7 @@ void bs2b_effect::getParameterLabel( VstInt32 index, char *label )
void bs2b_effect::setSampleRate( float sampleRate )
{
- bs2b.set_srate( ( uint32_t )sampleRate );
+ _bs2b.set_srate( ( uint32_t )sampleRate );
}
bool bs2b_effect::getEffectName( char *name )
@@ -222,7 +223,7 @@ void bs2b_effect::processReplacing( float **inputs, float **outputs,
sample[ 0 ] = *( in1++ );
sample[ 1 ] = *( in2++ );
- bs2b.cross_feed( sample );
+ _bs2b.cross_feed( sample );
*( out1++ ) = sample[ 0 ];
*( out2++ ) = sample[ 1 ];
@@ -247,7 +248,7 @@ void bs2b_effect::processDoubleReplacing( double **inputs, double **outputs,
sample[ 0 ] = *( in1++ );
sample[ 1 ] = *( in2++ );
- bs2b.cross_feed( sample );
+ _bs2b.cross_feed( sample );
*( out1++ ) = sample[ 0 ];
*( out2++ ) = sample[ 1 ];
diff --git a/plugins/vst/src/main.cpp b/plugins/vst/src/main.cpp
new file mode 100644
index 0000000..bd1f6be
--- /dev/null
+++ b/plugins/vst/src/main.cpp
@@ -0,0 +1,23 @@
+#include "aeffectx.h"
+#include "bs2b_effect.h"
+
+extern "C"
+{
+ extern AEffect * VSTPluginMain(audioMasterCallback audioMaster);
+ extern "C" __declspec(dllexport) AEffect * main_plugin (audioMasterCallback audioMaster);
+
+#define main main_plugin
+
+AEffect *main (audioMasterCallback audioMaster)
+{
+ if (!audioMaster (0, audioMasterVersion, 0, 0, 0, 0))
+ return 0;
+
+ bs2b_effect* effect = new bs2b_effect (audioMaster);
+ if (!effect)
+ return 0;
+
+ return effect->getAeffect ();
+}
+}
+
--
2.2.2
From 896767499c321a46421ba4543ef685c18802389b Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 23 Apr 2015 23:39:08 +1000
Subject: Fix object name
diff --git a/plugins/vst/src/bs2b_effect.h b/plugins/vst/src/bs2b_effect.h
index 528b28d..de14803 100644
--- a/plugins/vst/src/bs2b_effect.h
+++ b/plugins/vst/src/bs2b_effect.h
@@ -92,7 +92,7 @@ public:
class bs2b_effect : public AudioEffectX
{
private:
- bs2b bs2b;
+ bs2b _bs2b;
public:
bs2b_effect( audioMasterCallback audioMaster );
--
2.2.2