Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Potential bug in RackAFX?
Avatar
Matt
Member
Members
October 5, 2020 - 10:11 am
Member Since: July 20, 2018
Forum Posts: 14
sp_UserOfflineSmall Offline

UPDATE: Since posting this, I've now made a pure ASPiK (no RackAFX) plugin, VST3, and the same thing happens: Entering invalid data into an exit box that expects numerical data crashes my host (in my case, Reaper).

 

Hi,

I would like to report what might be a bug in RackAFX:

 

When I load a custom GUI, through View => Custom Plugin GUI, and I double click an edit box that's connected to a plugin parameter (in my case part of a knob group), when I then enter an invalid value, e.g. an non-numerical character or string rather than a number, and press enter, RackAFX as a whole crashes without warning.

I take it this is because RackAFX will try to convert that non-numerical string into a number?
So either that conversion would need to be surrounded by a try-catch or something, or maybe entering non-numerical data should be prohibited?

In the RackAFX design panel I notice entering non-numerical characters isn't possible, which I feel would be the best option.

 

I haven't tried building a VST plugin yet to see what happens there, but I suspect behaviour might be the same.

 

Will, many thanks again for the great work you're doing Cool

Avatar
W Pirkle
Admin
October 21, 2020 - 10:43 am
Member Since: January 29, 2017
Forum Posts: 508
sp_UserOfflineSmall Offline

This is an issue in the plugingui.cpp file in the valueChanged function. In RackAFX, there is extra information available to the prototyping object (from the .prj file) so it can treat the edit control differently depending on the kind of parameter.

I can add a fix for this in the new ASPiK/RackAFX but you can also patch it yourself if you want.

In plugingui.cpp at line 1551 you can find this chunk of code:

if (receiver)

{

// --- need to handle labels (or edits) differently

CTextLabel* label = dynamic_cast<CTextLabel*>(pControl);

if (label)

{

     std::string strLabel(label->getText());

     actualValue = stof(strLabel);

The crash is happening from the stof( ) function call (that does not check to see if the text is numerical or not).

   actualValue = stof(strLabel);

You would need to insert code before that call that checks the text. And, there is no cut-and-dried way to do that, but there are some options you can find here:

https://stackoverflow.com/questions/4654636/how-to-determine-if-a-string-is-a-number-with-c

Will 

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

Chaes: 38

JimmyM: 33

Gwen: 32

jim: 31

Member Stats:

Guest Posters: 1

Members: 649

Moderators: 1

Admins: 5

Forum Stats:

Groups: 13

Forums: 41

Topics: 706

Posts: 2726

Newest Members:

jcayetano, Alex, oneday, Phelan Kane, audiocoder, agel, Makai, Abyz, Nonlinear, IgorVish

Moderators: W Pirkle: 508

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 508, VariableCook: 3