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
Updated Status Window Functions?
Avatar
Chaes
Member
Members
July 9, 2020 - 12:09 am
Member Since: February 21, 2020
Forum Posts: 37
sp_UserOfflineSmall Offline

Hello,

So I have finally made the complete switch to RackAFX 7, YAY. ASPiK is incredible! 

I was wondering if there is an updated documentation for the Status Window. I used to call some simple functions which were actually documented on the Website some time ago. Attempting the same method and poking around a similar function in Rack AFX 7 doesn't seem to work for me anymore. 

I just wish to print some basic variable checks into the status window such as the current value of a variable (i.e current amplitude modifier which is calculated from a polynomial based on a GUI parameter input).

Kind regards

C

Avatar
W Pirkle
Admin
July 9, 2020 - 10:25 am
Member Since: January 29, 2017
Forum Posts: 470
sp_UserOfflineSmall Offline

Hi Chaes

I did update the status window, but I did not put the hooks back into RackAFX (the RAFX2 API) because I was busy with the book projects. I will have a look at this and check. A fundamental issue previously was the use of the old fashioned char* which people gave me a lot of hell about; the issue with std::string is that it does not cross the DLL/EXE boundary (thunk) properly unless the compiler and configuration are identical - RackAFX is compiled with VS2015 in Release mode, so your plugin would also need that exact setting. 

However, I may be able to modify the messaging system in the base class.

I will get back with more information.

Will 

Avatar
Chaes
Member
Members
July 9, 2020 - 11:37 am
Member Since: February 21, 2020
Forum Posts: 37
sp_UserOfflineSmall Offline

Hi,

That is fair enough. Shame though... as I am having a strange interaction between a function and an expected output and it was a very quick way to just check things. The code would be removed after it is resolved. My knowledge of C is actually expanding through the use of R7 but still lacking so I am glad it wasn't me being bad. 😀 

C.

Avatar
W Pirkle
Admin
July 9, 2020 - 1:23 pm
Member Since: January 29, 2017
Forum Posts: 470
sp_UserOfflineSmall Offline

Yeah, the older version had all of these char* functions (addString, etc..) and I'd rather use std::string for that. So, I will work on it - honestly it should be easy to resurrect that functionality. 

I started having my class use the TRACE macro instead, to pump strings into the debug window in Visual Studio. Are you familiar with that? It's pretty simple to get running. 

You can download trace.h here:

http://willpirkle.com/Downloads/trace.h

#include it and then you can call it several ways (you'll need the appropriate std:: library includes if you use string)

TRACE("This is a trace output."); //< you need /n for newline
std::string dbgOutput = "The answer is: ";

// --- setup a string version of a float, double, int, etc...

std::stringstream strValue;

strValue << delayInMSec; // < that is a float or double

// --- append the strings (the old addString() function)

dbgOutput.append(strValue);

TRACE((strValue().c_str()));

Will 

Avatar
Chaes
Member
Members
July 13, 2020 - 2:47 am
Member Since: February 21, 2020
Forum Posts: 37
sp_UserOfflineSmall Offline

Hi Will!

Somewhat, I tinkered with it previously on and off. I will look into it properly now as any form of quick variable checking is fine and the above wont cost any time for no reason :).

Thankyou for the above, I will play around with it today. I also touched on the delay.

Kind regards,

C.

 

EDIT: 

I haven't had much luck apart from slowing down my output within rackafx making it inaudible using : TRACE("This is a debug message!
"); .. with no message to be found. Unless its in a spot I am unaware of which could be the case as I am quite unfamiliar with this area. 

I can't get the above working at all at the moment.... 

with the below lines causing the issue:

// --- append the strings (the old addString() function)

dbgOutput.append(strValue);

TRACE((strValue().c_str()));

 Link to errors: https://pasteboard.co/JhrMzFb.png

Avatar
W Pirkle
Admin
July 13, 2020 - 8:57 am
Member Since: January 29, 2017
Forum Posts: 470
sp_UserOfflineSmall Offline

You have to be in Debug mode to see your output.

I wrote that code off the top of my head, will check. But, being in Debug mode is key.

Avatar
Chaes
Member
Members
July 13, 2020 - 6:03 pm
Member Since: February 21, 2020
Forum Posts: 37
sp_UserOfflineSmall Offline

Ah. I thought that may be the case, I had hoped it would print to the window as it ran. I have steered clear of debug modes, but I will have a play with it and get used to it, thanks 🙂

C

Avatar
jim
Member
Members
July 16, 2020 - 11:46 am
Member Since: January 1, 2020
Forum Posts: 27
sp_UserOfflineSmall Offline

Hi Chaes,

I recently worked out a way to do something like what you're after here.

This code will send the value of an internal variable out to be read from the GUI using a Label object set up from the VSTGUI editor.

You'll need to declare a dummy parameter to send the output to and then link it's Control::ID with a label from the editor as normal.

Except there is no need to add a bound variable to be associated with this parameter from within the PluginCore::initPluginParameters() section.

Then just pop the following code within the switch brackets in PluginCore::guiParameterChanged()

case controlID::Parameter1: {                     *//enum of the control to be investigated

HostMessageInfo HMI;                              //declares a message object arbitrarily named HMI
HMI.hostMessage = sendGUIUpdate;          //effectively sets that message as sendable to the GUI
GUIParameter guipar;                               //declares a parameter object to work with named guipar

guipar.controlID = Parameter2;                          *//enum of control to update the output to
guipar.actualValue = param1cookedVar ;             *// whatever internal variable is to be output (float, double or int)

HMI.guiUpdateData.guiParameters.push_back(guipar);     // sets up the output message with the parameter data
pluginHostConnector->sendHostMessage(HMI);               // sends the completed message

return true; //  exits the switch case

}

The only three lines to modify are marked with an *

The only downside I see to this approach - if you intend to abuse it -, is that the sent back parameter remains visible to and adds to the DAW's cc parameter list, which the user will see when viewing the plugin in GUI-less mode. There's probably a way to set a parameter to be non-automatable for the DAW but I'm unaware of how to do that as such.

Hope that's a help to you, best luck,

James

Avatar
Chaes
Member
Members
July 16, 2020 - 9:17 pm
Member Since: February 21, 2020
Forum Posts: 37
sp_UserOfflineSmall Offline

Hi James! 

Thankyou for your time, I am just playing with some other parts you actually helped me on on another thread but I will break this down soon and get back to you,

Thanks again,

C! 

EDIT : This works fine for what I need in development, for some reason I can't link a Label, or the standard one anyway, but I found a work around for that. Thanks! 

Avatar
jim
Member
Members
July 19, 2020 - 1:47 pm
Member Since: January 1, 2020
Forum Posts: 27
sp_UserOfflineSmall Offline

Hey Chaes, glad too help Cheers

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
7 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: 37

JimmyM: 33

Gwen: 32

jim: 27

Member Stats:

Guest Posters: 1

Members: 649

Moderators: 1

Admins: 4

Forum Stats:

Groups: 13

Forums: 40

Topics: 696

Posts: 2675

Newest Members:

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

Moderators: W Pirkle: 470

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 470