Hi
I pushed on with this and have it mostly working under JUCE 4.1, I can get a VST plugin wrapped and audio processing as an AU without the Carbon Component Manager working, basically what I wanted. To get there I had to:
-
cpl/gui/CView.h:273-276
Comment all of this out, thread local doesn’t compile for me.
-
cpl/lib/readerwriterqueue/atomicops.h:182-185,194-197
Comment out the non-default case statements to remove these atomic bits that won’t compile
Up to here, I was running on the JUCE that’s included in your package, and it worked with the exception that stereo plugins didn’t work as AU as it reported as {1,1} only. The Jucer file didn’t work for me, so I recreated it under 4.1 and added {1,2},{2,2} topologies. To continue to compile…
-
Source/ChameleonEngine.cpp:265
silenceInProducesSilenceOut is deprecated, so I removed it.
-
Source/ChameleonEngine.cpp:359
getSampleData now needs to use getWritePointer in processBlock
-
Source/CLoader.cpp:37
Including AudioUnit/AudioUnit.h so late seemed to cause problems, on forum recommendations I moved it before the other includes. However, I clearly have not fixed the real problem because on line 212 I can’t use JucePlugin_AUMainType and bodged it to ‘aufx’ (I was getting impatient and started hacking)
-
Source/CLoader.cpp:268
std::string root does not need to redeclare the variable name
-
Source/MainView.h:43,54
PluginListComponent does not seem to have a PluginComponentListener anymore, and hence no onPluginSelection. I’ve removed it and this breaks file selection of course. I am clearly missing something obvious that I can’t see how now you’re supposed to respond to clicking on a plugin list item. But since I was hacking away, what the hell. I’ve just started messing with the stdplugin.xml within the binary to fix up which VST I want to use.
-
cpl/gui/Controls/CColourControl.cpp
References to getARGB don’t seem to be ok anymore, getNativeARGB seems to work, but I have no idea what damage I actually have done to the code at this point to make it compile here so I won’t go into details.
…and then it basically worked, but I may well have broken cpl in many places.
There seems to be an issue unloading the wrapped VST in Logic X, and Studio One 3 (an AU wrap failed as below, a VST3 wrap worked ok). In Logic X, if the wrapped plugin has been loaded, clicked (i.e. transferring focus to it as you would editing a parameter), and is then unloaded with the UI open I get a crash. In Studio One, it only needs to be open and visible for the crash. In Reaper, no crash at all.
Logic X 10.2.2:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff87c09b26 search_method_list(method_list_t const*, objc_selector*) + 136
1 libobjc.A.dylib 0x00007fff87c0ad40 lookUpImpOrForward + 359
2 libobjc.A.dylib 0x00007fff87c04591 objc_msgSend + 209
3 com.apple.AppKit 0x00007fff9967d108 -[NSView _removeNextPointersToMe] + 797
4 com.apple.AppKit 0x00007fff9967cdd0 -[NSView _removeFromKeyViewLoop] + 198
5 com.apple.AppKit 0x00007fff9967c52a -[NSView _finalizeWithReferenceCounting] + 752
6 com.apple.AppKit 0x00007fff9967c212 -[NSView dealloc] + 151
7 libobjc.A.dylib 0x00007fff87c0c2f4 objc_object::sidetable_release(bool) + 242
8 libobjc.A.dylib 0x00007fff87c0aac4 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 476
9 com.apple.CoreFoundation 0x00007fff873bec12 _CFAutoreleasePoolPop + 50
10 com.apple.Foundation 0x00007fff989329f5 -[NSAutoreleasePool release] + 146
11 com.apple.logic10 0x000000010dedb5d0 0x10d861000 + 6792656
12 com.apple.logic10 0x000000010de3aa39 0x10d861000 + 6134329
13 com.apple.logic10 0x000000010de3a8c5 0x10d861000 + 6133957
14 com.apple.logic10 0x000000010dab36c5 0x10d861000 + 2434757
15 com.apple.logic10 0x000000010ded1491 0x10d861000 + 6751377
16 com.apple.logic10 0x000000010decd44e 0x10d861000 + 6734926
17 com.apple.Foundation 0x00007fff989b7d6c __NSFireTimer + 95
18 com.apple.CoreFoundation 0x00007fff87408b94 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
19 com.apple.CoreFoundation 0x00007fff87408823 __CFRunLoopDoTimer + 1075
20 com.apple.CoreFoundation 0x00007fff8740837a __CFRunLoopDoTimers + 298
21 com.apple.CoreFoundation 0x00007fff873ff871 __CFRunLoopRun + 1841
22 com.apple.CoreFoundation 0x00007fff873feed8 CFRunLoopRunSpecific + 296
23 com.apple.HIToolbox 0x00007fff880e3935 RunCurrentEventLoopInMode + 235
24 com.apple.HIToolbox 0x00007fff880e3677 ReceiveNextEventCommon + 184
25 com.apple.HIToolbox 0x00007fff880e35af _BlockUntilNextEventMatchingListInModeWithFilter + 71
26 com.apple.AppKit 0x00007fff9968aefa _DPSNextEvent + 1067
27 com.apple.AppKit 0x00007fff9968a32a -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
28 com.apple.AppKit 0x00007fff9967ee84 -[NSApplication run] + 682
29 com.apple.AppKit 0x00007fff9964846c NSApplicationMain + 1176
30 com.apple.logic10 0x000000010de9fc5e 0x10d861000 + 6548574
31 libdyld.dylib 0x00007fff90cdb5ad start + 1
Studio One 3:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff87c0ac64 lookUpImpOrForward + 139
1 libobjc.A.dylib 0x00007fff87c04591 objc_msgSend + 209
2 libobjc.A.dylib 0x00007fff87c0b390 _class_initialize + 706
3 libobjc.A.dylib 0x00007fff87c0ac90 lookUpImpOrForward + 183
4 libobjc.A.dylib 0x00007fff87c04591 objc_msgSend + 209
5 libobjc.A.dylib 0x00007fff87c0c2f4 objc_object::sidetable_release(bool) + 242
6 libobjc.A.dylib 0x00007fff87c0aac4 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 476
7 com.apple.CoreFoundation 0x00007fff873bec12 _CFAutoreleasePoolPop + 50
8 com.apple.Foundation 0x00007fff9892684a -[NSAutoreleasePool drain] + 153
9 com.apple.AppKit 0x00007fff9967ef57 -[NSApplication run] + 893
10 com.apple.Foundation 0x00007fff98942f4e -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 1115
11 com.apple.Foundation 0x00007fff98942a75 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 131
12 com.presonus.cclgui 0x0000000107e13228 0x107ca0000 + 1520168
13 com.presonus.studioone2 0x00000001062d40ef 0x1062d3000 + 4335
14 com.presonus.studioone2 0x00000001063a96f2 0x1062d3000 + 878322
15 libdyld.dylib 0x00007fff90cdb5ad start + 1
In these tests I used Lexicon PCM’s LexHall, Exponential Audio’s PheonixVerb and R2 which I believe to be well tested JUCE based plugins and had the crash. I tried 2CAudio’s Aether and FabFilter’s Pro Q 2 and they did not crash it. I also checked this behaviour on the simplest VSTGUI plugin I could make (which I am happy to share if you want it) and that crashed so seems fairly common but not universal.
Is this a project you are wanting to continue with making it robust over multiple hosts and wrapped plugins, using new JUCE versions, or do I need to push ahead on my own here effectively on a fork?
– Edited following further testing of plugins.