PDA

View Full Version : Presets


RRokkenAudio
01-24-2010, 01:44 AM
I haven't thought about this any, Just went through my head right now, Is there maybe some way we can make a window text box that pops up for our Design versions of a plug that will spit out the follow info:

MakePreset("preset 1", -5.0, 5.0, 17, kReversed);

I think that would be sweet. Change the knobs and hit "print" and you just copy paste ur presets to a text file. Wen done, simply paste them inside of the code :)

Presets, as much as I hate them, Are a nice feature to have in plugs. I guess I could go write all the settings down, but hey, why do that when u can have some code do it for you!

~Rob.

bvesco
01-24-2010, 03:50 AM
There's a function in IPlug that will print that stuff to a text file.

RRokkenAudio
01-25-2010, 03:23 PM
Think i found it :

IPlugBase::DumpPresetSrcCode(const char* filename, const char* paramEnumNames[])

ok, i'm getting this now :0

Include the following files in cpp:

#include "IPlugBase.h"
#include "IPlugBase.cpp"

Then attach a button, then put:

char filename[20]="C:\presets.txt";

void SimpleDelay::DumpPresetSrcCode(const char* filename, const char* paramEnumNames[finputgain]){

if(rdump == 1){

bool sDumped = true;
}


}



just having a problem putting presets.txt or the directory in. Compiles fine, switch is thrown, nothing happens.

~Rob.

Xenakios
01-25-2010, 08:36 PM
just having a problem putting presets.txt or the directory in. Compiles fine, switch is thrown, nothing happens.

~Rob.

The idea here is not to reimplement that method (IPlugBase:: DumpPresetSrcCode) in your plugin but to use it as it is.

RRokkenAudio
01-25-2010, 08:47 PM
I have a feeling that the sDumped variable isn't hooked to anything.

schwa
01-25-2010, 09:53 PM
Like Xenakios said, you just want to be calling the existing DumpPresetSrcCode, not implementing it.


if (button is pushed)
{
DumpPresetSrcCode(...);
}

RRokkenAudio
01-25-2010, 10:30 PM
I've tried:

if (rdump != 0)
{
char filename[16]="C:\\presets.txt";
DumpPresetSrcCode(const char* filename, const char* paramEnumNames[finputgain]);
}


And

if (rdump != 0)
{
char filename[16]="C:\\presets.txt";
DumpPresetSrcCode(filename, finputgain)
}


Throwing errors like crazy..

DumpPresetSrcCode' : cannot convert parameter 2 from 'EParams' to 'const char *[]'

schwa
01-25-2010, 10:38 PM
The plugin code doesn't have any way to meta-know what the enum names (the actual code variables) for the parameters are. So you do something like


const char* params[] = { "kGain", "kPan", "kWhatever", "kBlah" };
DumpPresetSrcCode("dumpfile.txt", params);

RRokkenAudio
01-26-2010, 12:04 AM
well, plug loads fine, when i throw the switch, it crashes reaper, but it does make the file :) it is empty, but lol

int rdump = GetParam(srdump)->Value();

if (rdump == 1)
{
const char* params[] = {"kGain"};
DumpPresetSrcCode("dumpfile.txt", params);
}



~Rob.

Xenakios
01-26-2010, 01:29 AM
well, plug loads fine, when i throw the switch, it crashes reaper, but it does make the file :) it is empty, but lol

int rdump = GetParam(srdump)->Value();

if (rdump == 1)
{
const char* params[] = {"kGain"};
DumpPresetSrcCode("dumpfile.txt", params);
}



~Rob.

Does your plugin have more than that one gain parameter? The param dump function will try to enumerate all the parameters in your plugin, but you only provide the text string ("kGain") for one. So the dump function will crash since it expects you are not trying to give it bad data. ;)

RRokkenAudio
01-26-2010, 02:23 AM
heh, I just did that for a test, I see what you mean, I bet it will work now :)

~Rob.

Bad Data is my middle name :)

RRokkenAudio
03-02-2010, 07:18 PM
I know its gonna be a long painful trail, but just revisiting this thread in hopes to create an A/B system!

~Rob.