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 sp_TopicIcon
Can't run the CustomViewsFour example
No permission to create posts
September 3, 2018
6:34 pm
Avatar
Diane
Member
Members
Forum Posts: 5
Member Since:
September 3, 2018
sp_UserOfflineSmall Offline

Hi Will,
First, let me say that RackAFX is wonderful and the amount of work you have put into supporting it really shines.

My question is regarding the CustomViewsFour example. I can't get it to run, there are lots of compilation errors. I've diagnosed it as far as I can but am still stuck - I feel like there is a configuration setting in my environment that is not finding some vital linked file.

Here are my steps and version info:

1. I'm running RackAFX v. 6.9.1.0 through VirtualBox with VisualStudio Community 2015.

2. I download the CustomViewsFour example and put it in my projects folder and open it with RackAFX. It warns me that a new version of RackAFX is detected and it will update the project files. I hit ok, and this seems to be successful as it displays "Upgraded Visual Studio project to latest version 6910. Answer YES if visual studio prompts you to reload the solution." It also says "Visual Studio Linker settings updated, answer YES if visual studio prompts you to reload the solution." I bet this has something to do with the problem. Finally, it says "Project code synchronized to latest version. You may now REBUILD..."

3. For the hell of it, I hit clean solution in visual studio, then Rebuild from RackAFX. You get a ton of errors around size being an undefined variable. This is supposed to be the CRect passed into the constructor of the WaveFormView class from showGUI.

4. If you click one of the errors to go investigate in the file then you get a warning dialog from visual studio that says 'Inconsistent Line Endings' and it wants to fix them for you. Default option is 'Windows CR (LF)'. It does this with WaveFormView.cpp, and I believe all the files in the project. Other options for line endings are: Macintosh, Unix, Unicode Line Separator and Unicode Paragraph Separator. I take the default Windows option and hit ok.

5. To deal with the undefined size errors, I added it as a member variable in the WaveFormView.h with the idea to store it in the constructor when we instantiate the WaveFormView. So I named it size for convenience, and renamed the incoming parameter as x:

In WaveFormView.h:

class CWaveFormView : public CView
{
public:
  CWaveFormView(const CRect& x);
  CRect size;

snip snip.

In WaveFormView.cpp:

CWaveFormView::CWaveFormView(const VSTGUI::CRect& x)
: CView(x)
{
  size = x;

snip snip.

6. Then, I get to the linker errors I don't know what to do about.
error LNK2019: unresolved external symbol "protected: bool __thiscall VSTGUI::CView::hasViewFlag(int)const " (?hasViewFlag@CView@VSTGUI@@IBE_NH@Z) referenced in function "public: virtual bool __thiscall VSTGUI::CView::isDirty(void)const " (?isDirty@CView@VSTGUI@@UBE_NXZ)

To fix this, I added a function declaration to WaveFormView.cpp that just matches the signature in the error message:

bool __thiscall CView::hasViewFlag(int32_t bit) const {
  return false;
}

This allows it to compile without errors.

7. When I load the plugin, it works in the regular prototype view, but when I try to show the custom gui, it crashes all of RackAFX with the message: "HEAP CORRUPTION DETECTED: after Normal block. CRT detected the application wrote to memory after end of heap buffer." If I say 'retry to debug' it just crashes RackAFX.

8. If I relaunch and load the plugin again, and try to switch to the custom gui, it says "Critical Error: No GUIParamSynchronizer!" and then the program crashes again.

I tried repeating this process as I wrote these steps above and this time ended up with a slightly different crash when I switched to the custom gui view the first time in step 7. It said
"The value of ESP was not properly saved across a function call. This is usually a result of calling function declared with one calling convention with a function pointer declared with a different calling convention. "

But I assume this is just another symptom of having to add in the definition for hasViewFlag and the size variable. Those must be declared somewhere else and I'm not linking to them somehow.

Not sure where to go from here, I was able to get basic custom guis to work by using vertical sliders connected to existing controls, so I assume nothing is too screwy with my environment but subclassing CView is where I am stuck.

Any advice would be very appreciated! Thank you!!!Smile

September 4, 2018
9:25 am
Avatar
W Pirkle
Admin
Forum Posts: 267
Member Since:
January 29, 2017
sp_UserOfflineSmall Offline

Hi Diane

The problem has to do with the latest VSTGUI4 updates. RackAFX always includes the latest VSTGUI4 (that you can install via Utilities) but the Custom View projects were last updated in 2015 so that is the issue. The authors of VSTGUI4 are constantly updating the library to conform to more modern C++ paradigms, e.g. C++11 and C++14 extensions are required now (good). They also regularly alter existing functions and objects that will break older code (unpleasant for us that have to maintain projects that use it). In some cases they may even obsolete objects or alter the functions so much that it breaks older code. 

The error you are receiving also has to do with the fact that the RackAFX GUI sub-system is linked to a static library called Sock2VST3.lib that you've probably noticed hanging out int he project folder. I believe (but not sure) that your error has to do with a cross-call between the library and the updated VSTGUI4 stuff in your vstgui4 folder that is compiled into the Custom View projects. 

Here's the latest - in about a month I'll be launching the new RackAFX v7. This includes a new RAFX2 API that will replace the old one. It also includes the ability to create ASPiK projects (independent of RackAFX) for AU, AAX and VST3. The new RAFX2 API is brand new. There is no longer any linking to static libraries - you compile all the GUI stuff directly in your own project (this is also true of ASPiK projects). RAFX2 and ASPiK are super-clean and light and they fix numerous issues that the old RAFX1 API (what you are using now) generated over the years. You can get more information on this update here:

http://www.willpirkle.com/foru.....-is-aspik/

When I designed ASPiK, I specifically spent time working on custom view stuff to provide the user with a robust (and most importantly thread-safe) method for doing custom views of all kinds. I've even included two C++ VSTGUI4 objects called WaveView and SpectrumView that display audio histograms and FFT data respectively as examples that show how to pipe audio data from the plugin to the view object. I also have examples of subclassing VSTGUI objects and setting up safe communication paths with them. In addition, I've included the ability to write custom sub-controllers (the other VSTGUI4 extension that the authors provided) to do things like intelligently combine controls together (linking knobs so that when you adjust one knob, the other follows - a common custom GUI chore). 

As I type this, I've got a document open that will become the new Custom View tutorials. There will only be 3 tutorials that will demonstrate everything. 

Because of the push to the new RAFX2/ASPiK, I am trying to move everyone over to the new system that hits in a month - the custom view tutorials you are working on will be sun-setted to work with the last version of RackAFX1, which is the version you are using now, I believe. I will need to update the custom view tutorials, but my advice is to wait until the new version of RackAFX drops. If you'd like to make the transition now, email me and I'll give you the beta tester page password to get started. 

So, ultimately I will do one last Custom View tutorial revision that should fix your issue - but that is currently taking a back-seat to the new RAFX/ASPiK (there is a new book involved, which should also drop at the same time). And, the new RAFX2/ASPiK is SO much more robust, thread-safe, and clean that I will try to get users switched over to it as soon as it is released. I am not sure when I'll do that last Custom View revision, but it will also be frozen to work with the latest VSTGUI4 (which is now 4.6). 

I hope that helps answer your question - I will post a note on this thread when I've updated the Custom View projects. 

- Will

September 4, 2018
10:29 am
Avatar
Diane
Member
Members
Forum Posts: 5
Member Since:
September 3, 2018
sp_UserOfflineSmall Offline

Hi Will,

Thanks so much for the quick response! I'd be happy to work with the beta update and I'll email you about that through your Contact page. 

If there is any simple workaround to just be able to draw lines on the CView object with my current project that would be really cool. I was working off of your CustomViewsFour example, but what I'm trying to do is actually considerably simpler. I don't need to plot audio samples, instead I am using some of my slider values to fuel a physical model and I just need to draw a couple lines every time the GUI_TIMER_PING happens - the math is already done, I really just want to override the draw function.

Would it be possible to show the bare minimum of how to subclass CView for this purpose? For example - just using the most basic volume slider plugin, what would I need to do to plot the current value of one slider onto the CView?

I know I would need the declaration of the subclass, I would need to instantiate it in showGUI, and I would need to override the draw() function. Is there anything else? Some simple example code along these lines would be extremely helpful.

Again, thank you so much for your help and all your hard work! If you think it makes more sense to just switch to the new version of RackAFX I can do that, but a simpler example to understand the process of subclassing the custom GUI objects would be really cool.

EDIT: Your contact page doesn't seem to be working so I'm not sure where to find your email for the beta. My email is diane.douglas1@gmail.com. Thanks Smile

September 4, 2018
1:49 pm
Avatar
W Pirkle
Admin
Forum Posts: 267
Member Since:
January 29, 2017
sp_UserOfflineSmall Offline

OK - yeah I just noticed the link at the top of the site doesn't connect anymore - the contact form is actually at the very bottom of the homepage. 

One thing I might do is try a quick fix for Custom Views Four to get you running - let me look at that in the next day or two and get back to you. After all, I still need to do one last rev of the Custom Views tutorials anyways...

- Will

September 4, 2018
2:58 pm
Avatar
Diane
Member
Members
Forum Posts: 5
Member Since:
September 3, 2018
sp_UserOfflineSmall Offline

That would be amazing, thank you!! Kiss 

September 5, 2018
4:15 pm
Avatar
W Pirkle
Admin
Forum Posts: 267
Member Since:
January 29, 2017
sp_UserOfflineSmall Offline

Hi Diane

OK - we're set. The issue was the version of VSTGUI4 that was used in the static library your plugin links with. It was v4.4 but RackAFX currently installs the latest version 4.6 -- to use the custom views, you just need to replace the vstgui4 folder with the correct library. The instructions are at the top of the Advanced GUI Tutorial page here (you may need to refresh your browser):

http://www.willpirkle.com/supp.....tutorials/

Just follow the instructions to replace v4.6 with the older version in your RackAFX projects folder and you are set. 

I tested every custom views project with VSTGUI4.4 and Visual Studio 2015 -- no problems except with CustomViewsTwo which needed an updated file - that CustomViewsTwo zip file has just been updated, in case you need that one as well. 

So, that should take care of the Custom Views tutorials for RackAFX v6.9 now.

- Will

September 7, 2018
8:54 pm
Avatar
Diane
Member
Members
Forum Posts: 5
Member Since:
September 3, 2018
sp_UserOfflineSmall Offline

It worked!!!!! Laugh

Sorry for the delay, I just had to try it a few times until I got the folder structure right. Then there was one time where I had it right but somehow I had a blank .h file in the example - it must not have downloaded correctly.

If anyone uses this thread for reference later, the vstgui4 folder should be in your projects folder like this: 

C:\Users\ddoug\AppData\Roaming\RackAFX\RackAFXProjects\vstgui4\vstgui

It is important to have the top level folder named 'vstgui4', and the next level folder should hold the readme and a folder called 'vstgui' (with no version number) and inside of that should be a ton of files including 'vstgui.cpp', and folders including 'Contrib' and 'Documentation'. 

Thanks again for your help, Will!

September 15, 2018
3:59 pm
Avatar
Diane
Member
Members
Forum Posts: 5
Member Since:
September 3, 2018
sp_UserOfflineSmall Offline

Hi Will,

I'm just checking back in on this topic because I'm still having some related issues with my own plugin, I think I might have some kind of linker defaults in RackAFX that are still looking at the wrong version of vstgui or something. Here are my steps:

1. CustomViewsFour project compiles and runs successfully because in my projects folder I replaced the newer vstgui with the older sdk. Both are still in place in the projects folder, but I renamed the newer one to 4.6 as you suggested in your instructions. 

2. I started a new plugin, adding just a volume control with a slider. Compiled and ran it to confirm all was working right. 

3. I added a new class called CVisualizer, and copied in your WaveFormView.cpp and .h files, changing the names to match mine. Compiled and ran without issue. 

4. In my .h file, I uncommented the #includes for GUIViewAttributes.h and ../vstgui4/vstgui/vstgui.h. Right between those two I include my Visualizer.h file, which is the equivalent of your WaveFormView.h file.

5. I added 2 variables. CVSTGUIHelper and pointer to CVisualizer class, just as you did. Like this:

 

// Add your code here: ----------------------------------------------------------- //
// --- our helper
CVSTGUIHelper m_GUIHelper;

// --- custom waveform view
CVisualizer* m_pVisualizer;

Except instead of m_pWaveFormView, mine is m_pVisualizer. 

 

Then in my main .cpp constructor I initialize my pointer to NULL like you did, again adding my own name for the variable.  

m_pVisualizer = NULL;

 

5. At this point I hit linker errors about CVSTGUIHelper, so I think it is a version issue. It says "unresolved external symbol public __thiscall CVSTGUIHelper::CVSTGUIHelper(void) referenced in function public: __thiscall CPendulumWaveshaper::CPendulumWaveshaper(void)".

CPendulumWaveshaper is my plugin, so I guess this is talking about my constructor referencing the constructor of CVSTGUIHelper? I thought that maybe it was because the CVSTGUIHelper wasn't instantiated yet, so I tried to do that inside the showGUI function, following this part in your code:

 

case GUI_CUSTOMVIEW:
{
if(strcmp(info->customViewName, "WPWaveView") == 0)
{
/ --- get the needed attributes with the helper
const CRect rect = m_GUIHelper.getRectWithVSTGUIRECT(info->customViewRect);

// --- create it!
m_pWaveFormView = new CWaveFormView(rect);

// --- return control cloaked as a void*
return (void*)m_pWaveFormView;
}
return NULL;
}

 

But I got the same linker error, even though it didn't complain about CVSTGUIHelper being undefined or anything like that.

 

I also tried copying the GUIViewAttributes.cpp and .h files and the pluginconstants.h file into my plugin folder from the CustomViewsFour project folder to see if that would be the correct version and fix it since I saw stuff about the CVSTGUIHelper defined in there, but that was apparently the WRONG thing to do because RackAFX crashed hard and wouldn't reopen until I put the old files back into that project folder. 

So - have you seen that error before? "unresolved external symbol public __thiscall CVSTGUIHelper::CVSTGUIHelper(void)" 

If it is a version issue, is there anything I need to do to link to the correct files? Again both this project and the CustomViewsFour project are in the same projects directory with the old version of vstgui4. CustomViewsFour compiles and runs successfully, but my project does not. Can't figure out any differences. 

Any help appreciated, thank you!Wink

Forum Timezone: America/New_York

Most Users Ever Online: 55

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 41

clau_ste: 39

Gwen: 32

JimmyM: 30

TheSmile: 28

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 536

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 31

Topics: 559

Posts: 2192

Newest Members:

Third Audio, LRT, TomJ, Giscard, Alejandro Florez, Tomaso, Jonas, Ralph, Wayne, Steve Duell

Moderators: W Pirkle: 267

Administrators: Tom: 67, JD Young: 80, Will Pirkle: 0, W Pirkle: 267