From 8c8caff6854d91397125dfa8af030c299b2d580b Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Fri, 4 Mar 2022 21:54:35 +0100 Subject: [PATCH] Remove old VST code VST code is now on a feature branch (feature/vst) https://github.com/jamulussoftware/jamulus/tree/feature/vst since there hasn't been any development for years. Fixes: https://github.com/jamulussoftware/jamulus/issues/2405 --- src/client.h | 36 ++++++---------- src/vstmain.cpp | 112 ------------------------------------------------ src/vstmain.h | 68 ----------------------------- src/vstsound.h | 60 -------------------------- 4 files changed, 14 insertions(+), 262 deletions(-) delete mode 100644 src/vstmain.cpp delete mode 100644 src/vstmain.h delete mode 100644 src/vstsound.h diff --git a/src/client.h b/src/client.h index e7e44da2a9..86b7e29417 100644 --- a/src/client.h +++ b/src/client.h @@ -40,28 +40,25 @@ #include "util.h" #include "buffer.h" #include "signalhandler.h" -#ifdef LLCON_VST_PLUGIN -# include "vstsound.h" + +#if defined( _WIN32 ) && !defined( JACK_REPLACES_ASIO ) +# include "../windows/sound.h" #else -# if defined( _WIN32 ) && !defined( JACK_REPLACES_ASIO ) -# include "../windows/sound.h" +# if ( defined( Q_OS_MACX ) ) && !defined( JACK_REPLACES_COREAUDIO ) +# include "../mac/sound.h" # else -# if ( defined( Q_OS_MACX ) ) && !defined( JACK_REPLACES_COREAUDIO ) -# include "../mac/sound.h" +# if defined( Q_OS_IOS ) +# include "../ios/sound.h" # else -# if defined( Q_OS_IOS ) -# include "../ios/sound.h" +# ifdef ANDROID +# include "../android/sound.h" # else -# ifdef ANDROID -# include "../android/sound.h" -# else -# include "../linux/sound.h" -# ifndef JACK_REPLACES_ASIO // these headers are not available in Windows OS -# include -# include -# endif -# include +# include "../linux/sound.h" +# ifndef JACK_REPLACES_ASIO // these headers are not available in Windows OS +# include +# include # endif +# include # endif # endif # endif @@ -272,11 +269,6 @@ class CClient : public QObject CChannelCoreInfo ChannelInfo; QString strClientName; -#ifdef LLCON_VST_PLUGIN - // VST version must have direct access to sound object - CSound* GetSound() { return &Sound; } -#endif - protected: // callback function must be static, otherwise it does not work static void AudioCallback ( CVector& psData, void* arg ); diff --git a/src/vstmain.cpp b/src/vstmain.cpp deleted file mode 100644 index d13db4b0ef..0000000000 --- a/src/vstmain.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************\ - * Copyright (c) 2004-2022 - * - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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) - Client ( LLCON_DEFAULT_PORT_NUMBER ) -{ - // stereo input/output - setNumInputs ( 2 ); - setNumOutputs ( 2 ); - - setUniqueID ( 'Llco' ); - - // capabilities of llcon VST plugin - canProcessReplacing(); // supports replacing output - - // set default program name - GetName ( strProgName ); - - // we want a single shot timer to shut down the connection if no - // processing is done anymore (VST host has stopped the stream) - TimerOnOff.setSingleShot ( true ); - TimerOnOff.setInterval ( VST_STOP_TIMER_INTERVAL ); - - // connect timer event - connect ( &TimerOnOff, SIGNAL ( timeout() ), this, SLOT ( OnTimerOnOff() ) ); - - // clang-format off -// TODO settings -Client.SetServerAddr ( DEFAULT_SERVER_ADDRESS ); - // clang-format on -} - -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::OnTimerOnOff() -{ - // stop client since VST host seems to have stopped - Client.Stop(); -} - -void CLlconVST::processReplacing ( float** pvIn, float** pvOut, VstInt32 iNumSamples ) -{ - int i, j; - - // reset stop timer - TimerOnOff.start(); - - // check if client is running, if not, start it - if ( !Client.IsRunning() ) - { - // set buffer size and start - Client.GetSound()->SetMonoBufferSize ( iNumSamples ); - Client.Start(); - } - - // get pointers to actual buffers - float* pfIn0 = pvIn[0]; - float* pfIn1 = pvIn[1]; - float* pfOut0 = pvOut[0]; - float* pfOut1 = pvOut[1]; - - // copy input data - for ( i = 0, j = 0; i < iNumSamples; i++, j += 2 ) - { - Client.GetSound()->vecsTmpAudioSndCrdStereo[j] = pfIn0[i]; - Client.GetSound()->vecsTmpAudioSndCrdStereo[j + 1] = pfIn1[i]; - } - - // call processing callback function - Client.GetSound()->VSTProcessCallback(); - - // copy output data - for ( i = 0, j = 0; i < iNumSamples; i++, j += 2 ) - { - pfOut0[i] = Client.GetSound()->vecsTmpAudioSndCrdStereo[j]; - pfOut1[i] = Client.GetSound()->vecsTmpAudioSndCrdStereo[j + 1]; - } -} diff --git a/src/vstmain.h b/src/vstmain.h deleted file mode 100644 index 7afa9ec5c2..0000000000 --- a/src/vstmain.h +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************\ - * Copyright (c) 2004-2022 - * - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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" -# include -# include "global.h" -# include "client.h" - -/* Definitions ****************************************************************/ -// timeout after which the llcon client is stopped -# define VST_STOP_TIMER_INTERVAL 1000 - -/* Classes ********************************************************************/ -class CLlconVST : public QObject, public AudioEffectX -{ - Q_OBJECT - -public: - CLlconVST ( audioMasterCallback AudioMaster ); - - virtual void processReplacing ( float** pvIn, float** 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]; - - CClient Client; - QTimer TimerOnOff; - -protected slots: - void OnTimerOnOff(); -}; - -#endif /* !defined ( LLCONVST_HOIHGE76G34528_3_434DFGUHF1912__INCLUDED_ ) */ diff --git a/src/vstsound.h b/src/vstsound.h deleted file mode 100644 index e93d370786..0000000000 --- a/src/vstsound.h +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************\ - * Copyright (c) 2004-2022 - * - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - * -\******************************************************************************/ - -#if !defined( _VSTSOUND_H__9518A346345768_11D3_8C0D_EEBF182CF549__INCLUDED_ ) -# define _VSTSOUND_H__9518A346345768_11D3_8C0D_EEBF182CF549__INCLUDED_ - -# include "../src/util.h" -# include "../src/global.h" -# include "../src/soundbase.h" - -/* Classes ********************************************************************/ -class CSound : public CSoundBase -{ -public: - CSound ( void ( *fpNewCallback ) ( CVector& psData, void* arg ), void* arg ) : - CSoundBase ( true, fpNewCallback, arg ), - iVSTMonoBufferSize ( 0 ) - {} - - // special VST functions - void SetMonoBufferSize ( const int iNVBS ) { iVSTMonoBufferSize = iNVBS; } - void VSTProcessCallback() { CSoundBase::ProcessCallback ( vecsTmpAudioSndCrdStereo ); } - - virtual int Init ( const int ) - { - // init base class - CSoundBase::Init ( iVSTMonoBufferSize ); - vecsTmpAudioSndCrdStereo.Init ( 2 * iVSTMonoBufferSize /* stereo */ ); - return iVSTMonoBufferSize; - } - - // this vector must be accessible from the outside (quick hack solution) - CVector vecsTmpAudioSndCrdStereo; - -protected: - int iVSTMonoBufferSize; -}; - -#endif // !defined ( _VSTSOUND_H__9518A346345768_11D3_8C0D_EEBF182CF549__INCLUDED_ )