PDA

View Full Version : Off by 1?


bozmillar
01-20-2011, 04:30 PM
I have a fader that by default is set to 512 by using this in the constructor:


GetParam(kPCMsize)->InitDouble("Win Size", 512, 100, 10000, 1, "Samples");

If I use:


PCMFaderVal = (int)GetParam(kPCMsize)->Value();

PCMFaderVal = 512, as expected, but if I send the plugin offline and bring it back online, PCMFaderVal is 511. I can't quite figure out why it would be different than it is when I open the plugin from scratch.

Hopefully this makes sense. So basically, I open the plugin, it works. I send it offline and bring it back online, it crashes, and it's because my values change from what they were when I sent it offline.

Tale
01-21-2011, 03:44 AM
I am not exactly sure why, but this seems to fix things:

// GetParam(kPCMsize)->InitDouble("Win Size", 512, 100, 10000, 1, "Samples");
GetParam(kPCMsize)->InitInt("Win Size", 512, 100, 10000, "Samples");

bozmillar
01-21-2011, 09:33 AM
oh. haha. thanks. man, where would I be without this forum?