Sign In:     


Forum: Addons

Topic: virtualFX - Page: 4
Understand... Thanks anyway!
I hope I can use it soon!!
 

Since apple now charge for me to make plugins for 3rd parties, I'm offering the the source code so you can build it yourself locally for your own use on the build machine.
If you can build the default plugin example you can build this.
And here's a guide from djCel

.zip file
Virtualfx
MacSiliconSource.zip?rlkey=tgcsvaiip6cguzz2dwre4nmcy&st=oma7lbcf&dl=0" target="_blank" rel="nofollow">https://www.dropbox.com/scl/fi/tnrv4lzhx7bz1eut75bo3/VirtualfxMacSiliconSource.zip?rlkey=tgcsvaiip6cguzz2dwre4nmcy&st=oma7lbcf&dl=0

Everything you need is in the .zip
vdj headers
my .h & .cpp
pch.h

No licencing, use as you wish, throw a beer my way if you want.
If you're a mac developer and building for the community good is something you want to do, it would be appreciated.

Overview, no master piece, but it's pretty straight forward.

main.cpp
// This is the standard DLL loader for COM object.

#include "Virtualfx.h"

HRESULT VDJ_API DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject)
{
if (memcmp(&rclsid,&CLSID_VdjPlugin8,sizeof(GUID))==0 && memcmp(&riid,&IID_IVdjPluginDsp8,sizeof(GUID))==0)
{
*ppObject=new CMyPlugin8();
}
else
{
return CLASS_E_CLASSNOTAVAILABLE;
}

return NO_ERROR;
}


pch.h

// pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
// Do not add files here that you will be updating frequently as this negates the performance advantage.

#ifndef PCH_H
#define PCH_H

// add headers that you want to pre-compile here
#include "vdjDsp8.h"
#include "vdjDsp8.h"
#include <stdio.h>
#include <sstream>
#endif //PCH_H


Virtualfx.h
#ifndef MYPLUGIN8_H
#define MYPLUGIN8_H
#include "pch.h"

class CMyPlugin8 : public IVdjPluginDsp8
{
public:
HRESULT VDJ_API OnLoad();
HRESULT VDJ_API OnGetPluginInfo(TVdjPluginInfo8* infos);
ULONG VDJ_API Release();
HRESULT VDJ_API OnStart();
HRESULT VDJ_API OnStop();
HRESULT VDJ_API OnProcessSamples(float* buffer, int nb);
HRESULT VDJ_API OnParameter(int id);
HRESULT VDJ_API OnGetParameterString(int id, char* outParam, int outParamSize);

private:
float parSlider1, parSlider2, parSlider3;
int parButton1, parButton2, parButton3, parButton4, dckc;
double dClick;
long long now, then;

char parStatus1[8192] {'\0'};
char parStatus2[2048] {'\0'};
char parStatus3[8192] {'\0'};
char parStatus4[2048] {'\0'};
char parStatus5[8192] {'\0'};
char parStatus6[2048] {'\0'};
char parStatus7[8192] {'\0'};
char parStatus8[8192] {'\0'};
char parStatus9[8192] {'\0'};
char parStatus10[8192] {'\0'};
char parStatus11[8192] {'\0'};
char parStatus12[8192] {'\0'};
char labelA[10] {'\0'};
char labelB[10] {'\0'};
char labelC[10] {'\0'};
char thisFX[32] {'\0'};

long long getMilliseconds();

enum
{
LocoDog4_Param_Slider1,
LocoDog4_Param_String_1,
LocoDog4_Param_String_2,
LocoDog4_Param_Slider2,
LocoDog4_Param_String_3,
LocoDog4_Param_String_4,
LocoDog4_Param_Slider3,
LocoDog4_Param_String_6,
LocoDog4_Param_String_5,
LocoDog4_Param_Button1,
LocoDog4_Param_String_7,
LocoDog4_Param_Button2,
LocoDog4_Param_String_8,
LocoDog4_Param_Button3,
LocoDog4_Param_String_9,
LocoDog4_Param_Button4,
LocoDog4_Param_String_10,
LocoDog4_Param_String_11,
LocoDog4_Param_String_12
};
};
#endif


Virtualfx.cpp
#include "pch.h"
#include "Virtualfx.h"
#include <stdbool.h>

#include <sys/time.h>



HRESULT VDJ_API CMyPlugin8::OnLoad()
{
GetStringInfo("get_effect_name", &thisFX[0], 32);
DeclareParameterSlider(&parSlider1, LocoDog4_Param_Slider1, "DIAL A", "A", 0.5f);
DeclareParameterString(parStatus1, LocoDog4_Param_String_1, "DIAL A", "A", 8192);
DeclareParameterString(parStatus2, LocoDog4_Param_String_2, "LABEL A", "A", 2048);
DeclareParameterSlider(&parSlider2, LocoDog4_Param_Slider2, "DIAL B", "B", 0.5f);
DeclareParameterString(parStatus3, LocoDog4_Param_String_3, "DIAL B", "B", 8192);
DeclareParameterString(parStatus4, LocoDog4_Param_String_4, "LABEL B", "B", 2048);
DeclareParameterSlider(&parSlider3, LocoDog4_Param_Slider3, "DIAL C", "C", 0.5f);
DeclareParameterString(parStatus5, LocoDog4_Param_String_5, "DIAL C", "C", 8192);
DeclareParameterString(parStatus6, LocoDog4_Param_String_6, "LABEL C", "C", 2048);
DeclareParameterSwitch(&parButton1, LocoDog4_Param_Button1, "BUTTON 1", "", false);
DeclareParameterString(parStatus7, LocoDog4_Param_String_7, "BUTTON 1", "", 8192);
DeclareParameterSwitch(&parButton2, LocoDog4_Param_Button2, "BUTTON 2", "", false);
DeclareParameterString(parStatus8, LocoDog4_Param_String_8, "BUTTON 2", "", 8192);
DeclareParameterSwitch(&parButton3, LocoDog4_Param_Button3, "BUTTON 3", "", false);
DeclareParameterString(parStatus9, LocoDog4_Param_String_9, "BUTTON 3", "", 8192);
DeclareParameterString(parStatus10, LocoDog4_Param_String_10, "OnStart", "", 8192);
DeclareParameterString(parStatus11, LocoDog4_Param_String_11, "OnStop", "", 8192);
DeclareParameterString(parStatus12, LocoDog4_Param_String_12, "Buffer", "", 8192);
DeclareParameterButton(&parButton4, LocoDog4_Param_Button4, "CLEAR", "");

std::stringstream cmd;
cmd << "wait 200ms & effect_slider '" << thisFX << "' 1 " << parSlider1 << " & effect_slider '" << thisFX << "' 2 " << parSlider2 << " & effect_slider '" << thisFX << "' 3 " << parSlider3;
SendCommand(cmd.str().c_str());
return S_OK;
}
HRESULT VDJ_API CMyPlugin8::OnGetPluginInfo(TVdjPluginInfo8* infos)
{
infos->Author = "locodog";
infos->PluginName = "Virtualfx";
infos->Description = "fx building template";
infos->Version = "1.5.0";
infos->Bitmap = NULL;

return S_OK;
}
ULONG VDJ_API CMyPlugin8::Release()
{
delete this;
return 0;
}
HRESULT VDJ_API CMyPlugin8::OnStart()
{
std::stringstream cmd;
cmd << "effect_slider '" << thisFX << "' 1 " << parSlider1 << " & effect_slider '" << thisFX << "' 2 " << parSlider2 << " & effect_slider '" << thisFX << "' 3 " << parSlider3;
SendCommand(cmd.str().c_str());
SendCommand(parStatus10);
return S_OK;
}
HRESULT VDJ_API CMyPlugin8::OnStop()
{
SendCommand(parStatus11);
return S_OK;
}
HRESULT VDJ_API CMyPlugin8::OnProcessSamples(float* buffer, int nb)
{
if (parStatus12[0] != '\0')
SendCommand(parStatus12);
return S_OK;
}
HRESULT VDJ_API CMyPlugin8::OnParameter(int id)
{
std::stringstream cmd11, cmd12;
switch (id)
{
case LocoDog4_Param_Slider1:
SendCommand(parStatus1);
break;
case LocoDog4_Param_Slider2:
SendCommand(parStatus3);
break;
case LocoDog4_Param_Slider3:
SendCommand(parStatus5);
break;
case LocoDog4_Param_Button1:
SendCommand(parStatus7);
break;
case LocoDog4_Param_Button2:
SendCommand(parStatus8);
break;
case LocoDog4_Param_Button3:
SendCommand(parStatus9);
break;
case LocoDog4_Param_Button4:
parButton4 = 0;
now = getMilliseconds();
if (now < then) {
for (int i = 1; i < 13; i++)
{
cmd11 << " & effect_string \"" << thisFX << "\" " << i << " \"\"";
}
SendCommand(cmd11.str().c_str());
}
else { then = getMilliseconds() + 100; }
break;

default: break;
}

return S_OK;
}
HRESULT VDJ_API CMyPlugin8::OnGetParameterString(int id, char* outParam, int outParamSize)
{
switch (id)
{
case LocoDog4_Param_Slider1:
GetStringInfo(parStatus2, &labelA[0], 10);
snprintf(outParam, outParamSize, "%s", labelA);
return S_OK;
case LocoDog4_Param_Slider2:
GetStringInfo(parStatus4, &labelB[0], 10);
snprintf(outParam, outParamSize, "%s", labelB);
return S_OK;
case LocoDog4_Param_Slider3:
GetStringInfo(parStatus6, &labelC[0], 10);
snprintf(outParam, outParamSize, "%s", labelC);
return S_OK;
default: break;
}
return E_NOTIMPL;
}

long long CMyPlugin8::getMilliseconds()
{
timeval time;
gettimeofday(&time, NULL);
long millis = (time.tv_sec * 1000) + (time.tv_usec / 1000);
return millis;
}
 

OK, Great!
I'll try to make it work and let you now.
Thanks again!