From 35b1c0ba23c0743aa79ee7b6f344d73b1b105162 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 5 Mar 2010 06:02:21 +0000 Subject: [PATCH] added initial vst main files --- src/vstmain.cpp | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ src/vstmain.h | 55 +++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100755 src/vstmain.cpp create mode 100755 src/vstmain.h diff --git a/src/vstmain.cpp b/src/vstmain.cpp new file mode 100755 index 00000000..53f28624 --- /dev/null +++ b/src/vstmain.cpp @@ -0,0 +1,98 @@ +/******************************************************************************\ + * Copyright (c) 2004-2010 + * + * Author(s): + * Volker Fischer + * + ****************************************************************************** + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +\******************************************************************************/ + +#include "vstmain.h" + + +/* Implementation *************************************************************/ +// this function is required for host to get plugin +AudioEffect* createEffectInstance ( audioMasterCallback AudioMaster ) +{ + return new CLlconVST ( AudioMaster ); +} + +CLlconVST::CLlconVST ( audioMasterCallback AudioMaster ) : + AudioEffectX ( AudioMaster, 1, 0 ) // 1 program with no parameters (=0) +{ + // stereo input/output + setNumInputs ( 2 ); + setNumOutputs ( 2 ); + + setUniqueID ( 'Llco' ); + + // capabilities of llcon VST plugin + canProcessReplacing (); // supports replacing output + canDoubleReplacing (); // supports double precision processing + + // set default program name + GetName ( strProgName ); +} + +bool CLlconVST::GetName ( char* cName ) +{ + // this name is used for program name, effect name, product string and + // vendor string + vst_strncpy ( cName, "Llcon", kVstMaxEffectNameLen ); + return true; +} + +void CLlconVST::processReplacing ( float** pvIn, + float** pvOut, + VstInt32 iNumSamples ) +{ + // get pointers to actual buffers + float* pfIn0 = pvIn[0]; + float* pfIn1 = pvIn[1]; + float* pfOut0 = pvOut[0]; + float* pfOut1 = pvOut[1]; + + +// TODO here we just copy the data -> add llcon processing here! + + for ( int i = 0; i < iNumSamples; i++ ) + { + pfOut0[i] = pfIn0[i]; + pfOut1[i] = pfIn1[i]; + } +} + +void CLlconVST::processDoubleReplacing ( double** pvIn, + double** pvOut, + VstInt32 iNumSamples ) +{ + // get pointers to actual buffers + double* pdIn0 = pvIn[0]; + double* pdIn1 = pvIn[1]; + double* pdOut0 = pvOut[0]; + double* pdOut1 = pvOut[1]; + + +// TODO here we just copy the data -> add llcon processing here! + + for ( int i = 0; i < iNumSamples; i++ ) + { + pdOut0[i] = pdIn0[i]; + pdOut1[i] = pdIn1[i]; + } +} diff --git a/src/vstmain.h b/src/vstmain.h new file mode 100755 index 00000000..ae82f90e --- /dev/null +++ b/src/vstmain.h @@ -0,0 +1,55 @@ +/******************************************************************************\ + * Copyright (c) 2004-2010 + * + * Author(s): + * Volker Fischer + * + ****************************************************************************** + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +\******************************************************************************/ + +#if !defined ( LLCONVST_HOIHGE76G34528_3_434DFGUHF1912__INCLUDED_ ) +#define LLCONVST_HOIHGE76G34528_3_434DFGUHF1912__INCLUDED_ + +// copy the VST SDK in the llcon/windows directory: "llcon/windows/vstsdk2.4" to +// get it work +#include "audioeffectx.h" + + +/* Classes ********************************************************************/ +class CLlconVST : public AudioEffectX +{ +public: + CLlconVST ( audioMasterCallback AudioMaster ); + + virtual void processReplacing ( float** pvIn, float** pvOut, VstInt32 iNumSamples ); + virtual void processDoubleReplacing ( double** pvIn, double** pvOut, VstInt32 iNumSamples ); + + virtual void setProgramName ( char* cName ) { vst_strncpy ( strProgName, cName, kVstMaxProgNameLen ); } + virtual void getProgramName ( char* cName ) { vst_strncpy ( cName, strProgName, kVstMaxProgNameLen ); } + + virtual bool getEffectName ( char* cString ) { return GetName ( cString ); } + virtual bool getVendorString ( char* cString ) { return GetName ( cString ); } + virtual bool getProductString ( char* cString ) { return GetName ( cString ); } + virtual VstInt32 getVendorVersion () { return 1000; } + +protected: + bool GetName ( char* cName ); + char strProgName[kVstMaxProgNameLen + 1]; +}; + +#endif /* !defined ( LLCONVST_HOIHGE76G34528_3_434DFGUHF1912__INCLUDED_ ) */