26#if JUCE_PLUGINHOST_VST
29#undef PRAGMA_ALIGN_SUPPORTED
32#if ! JUCE_MINGW && ! JUCE_MSVC
39#define VST_FORCE_DEPRECATED 0
54#include "juce_VSTMidiEventList.h"
58 #define WM_APPCOMMAND 0x0319
61 static void _fpreset() {}
62 static void _clearfp() {}
65#ifndef JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
66 #define JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
69#ifndef JUCE_VST_WRAPPER_INVOKE_MAIN
70 #define JUCE_VST_WRAPPER_INVOKE_MAIN effect = module->moduleMain (&audioMaster);
73#ifndef JUCE_VST_FALLBACK_HOST_NAME
74 #define JUCE_VST_FALLBACK_HOST_NAME "Juce VST Host"
84 const int fxbVersionNum = 1;
109 fxProgram programs[1];
141 static bool compareMagic (
int32 magic,
const char*
name)
noexcept
150 static float fxbSwapFloat (
const float x)
noexcept
152 #ifdef JUCE_LITTLE_ENDIAN
153 union {
uint32 asInt;
float asFloat; }
n;
166 static double getVSTHostTimeNanoseconds()
noexcept
170 #elif JUCE_LINUX || JUCE_BSD || JUCE_IOS || JUCE_ANDROID
172 gettimeofday (µ,
nullptr);
173 return (
double) micro.tv_usec * 1000.0;
176 Microseconds (µ);
177 return micro.lo * 1000.0;
181 static int shellUIDToCreate = 0;
182 static int insideVSTCallback = 0;
184 struct IdleCallRecursionPreventer
186 IdleCallRecursionPreventer() : isMessageThread (MessageManager::getInstance()->isThisTheMessageThread())
192 ~IdleCallRecursionPreventer()
198 const bool isMessageThread;
203 static bool makeFSRefFromPath (FSRef* destFSRef,
const String& path)
205 return FSPathMakeRef (
reinterpret_cast<const UInt8*
> (path.
toRawUTF8()), destFSRef,
nullptr) == noErr;
217 #define VST_LOGGING 1
221 #define JUCE_VST_LOG(a) Logger::writeToLog(a);
223 #define JUCE_VST_LOG(a)
227#if JUCE_LINUX || JUCE_BSD
231 using EventProcPtr =
void (*)(XEvent*);
233 Window getChildWindow (Window windowToCheck)
235 Window rootWindow, parentWindow;
236 Window* childWindows;
237 unsigned int numChildren = 0;
239 X11Symbols::getInstance()->xQueryTree (XWindowSystem::getInstance()->getDisplay(),
240 windowToCheck, &rootWindow, &parentWindow, &childWindows, &numChildren);
243 return childWindows [0];
255 static VSTXMLInfo* createFor (
const juce::XmlElement& xml)
257 if (xml.
hasTagName (
"VSTParametersStructure"))
258 return new VSTXMLInfo (xml);
261 return new VSTXMLInfo (*
x);
280 juce::StringArray shortNames;
286 struct Group :
public Base
289 juce::OwnedArray<Base> paramTree;
295 Range (
const juce::String&
s) { set (
s); }
297 void set (
const juce::String&
s)
299 inclusiveLow =
s.startsWithChar (
'[');
300 inclusiveHigh =
s.endsWithChar (
']');
302 auto str =
s.removeCharacters (
"[]");
304 low = str.upToFirstOccurrenceOf (
",",
false,
false).getFloatValue();
305 high = str.fromLastOccurrenceOf (
",",
false,
false).getFloatValue();
308 bool contains (
float f)
const noexcept
310 return (inclusiveLow ? (
f >= low) : (
f > low))
311 && (inclusiveHigh ? (
f <= high) : (
f < high));
317 bool inclusiveLow =
false;
318 bool inclusiveHigh =
false;
330 juce::OwnedArray<Entry> entries;
336 juce::OwnedArray<Param> params;
339 const Param* getParamForID (
const int paramID,
const Group*
const grp)
const
341 for (
auto item : (grp !=
nullptr ? grp->paramTree : paramTree))
343 if (
auto param =
dynamic_cast<const Param*
> (item))
344 if (param->paramID == paramID)
347 if (
auto group =
dynamic_cast<const Group*
> (item))
348 if (
auto res = getParamForID (paramID, group))
355 const ValueType* getValueType (
const juce::String&
name)
const
357 for (
auto v : valueTypes)
364 juce::OwnedArray<Base> paramTree;
365 juce::OwnedArray<ValueType> valueTypes;
366 juce::OwnedArray<Template> templates;
368 ValueType switchValueType;
371 VSTXMLInfo (
const juce::XmlElement& xml)
373 switchValueType.entries.add (
new Entry({
TRANS(
"Off"), Range (
"[0, 0.5[") }));
374 switchValueType.entries.add (
new Entry({
TRANS(
"On"), Range (
"[0.5, 1]") }));
378 if (item->hasTagName (
"Param")) parseParam (*item,
nullptr,
nullptr);
379 else if (item->hasTagName (
"ValueType")) parseValueType (*item);
380 else if (item->hasTagName (
"Template")) parseTemplate (*item);
381 else if (item->hasTagName (
"Group")) parseGroup (*item,
nullptr);
385 void parseParam (
const juce::XmlElement& item, Group* group, Template* temp)
387 auto param =
new Param();
400 param->shortNames.addTokens (item.
getStringAttribute (
"shortName"),
",", juce::StringRef());
401 param->shortNames.trim();
402 param->shortNames.removeEmptyStrings();
404 if (group !=
nullptr)
406 group->paramTree.add (param);
407 param->parent =
group;
409 else if (temp !=
nullptr)
411 temp->params.add (param);
415 paramTree.
add (param);
419 void parseValueType (
const juce::XmlElement& item)
421 auto vt =
new ValueType();
432 auto entry =
new Entry();
433 entry->name = entryXml->getStringAttribute (
"name");
435 if (entryXml->hasAttribute (
"value"))
437 entry->range.set(entryXml->getStringAttribute (
"value"));
441 entry->range.low = (float) curEntry / (
float) numEntries;
442 entry->range.high = (float) (curEntry + 1) / (float) numEntries;
444 entry->range.inclusiveLow =
true;
445 entry->range.inclusiveHigh = (curEntry == numEntries - 1);
448 vt->entries.add (entry);
453 void parseTemplate (
const juce::XmlElement& item)
455 auto temp =
new Template();
456 templates.
add (temp);
460 parseParam (*param,
nullptr, temp);
463 void parseGroup (
const juce::XmlElement& item, Group* parentGroup)
465 auto group =
new Group();
469 parentGroup->paramTree.add (group);
470 group->parent = parentGroup;
474 paramTree.
add (group);
481 juce::StringArray variables;
485 for (
auto temp : templates)
489 for (
int i = 0;
i < temp->params.size(); ++
i)
491 auto param =
new Param();
492 group->paramTree.add (param);
494 param->parent =
group;
495 param->paramID = evaluate (temp->params[
i]->expr, variables);
496 param->defaultValue = temp->params[
i]->defaultValue;
497 param->label = temp->params[
i]->label;
498 param->name = temp->params[
i]->name;
499 param->numberOfStates = temp->params[
i]->numberOfStates;
500 param->shortNames = temp->params[
i]->shortNames;
501 param->type = temp->params[
i]->type;
510 if (subItem->hasTagName (
"Param")) parseParam (*subItem, group,
nullptr);
511 else if (subItem->hasTagName (
"Group")) parseGroup (*subItem, group);
516 int evaluate (juce::String expr,
const juce::StringArray& variables)
const
518 juce::StringArray names;
519 juce::Array<int> vals;
521 for (
auto&
v : variables)
523 if (
v.contains (
"="))
525 names.
add (
v.upToFirstOccurrenceOf (
"=",
false,
false));
526 vals.
add (
v.fromFirstOccurrenceOf (
"=",
false,
false).getIntValue());
530 for (
int i = 0;
i < names.
size(); ++
i)
546 juce::StringArray tokens;
547 tokens.
addTokens (expr,
" ", juce::StringRef());
552 for (
const auto&
s : tokens)
565 val +=
s.getIntValue();
567 val -=
s.getIntValue();
576struct ModuleHandle :
public ReferenceCountedObject
579 MainCall moduleMain, customMain = {};
581 std::unique_ptr<XmlElement> vstXml;
583 using Ptr = ReferenceCountedObjectPtr<ModuleHandle>;
585 static Array<ModuleHandle*>& getActiveModules()
587 static Array<ModuleHandle*> activeModules;
588 return activeModules;
592 static Ptr findOrCreateModule (
const File&
file)
594 for (
auto* module : getActiveModules())
595 if (module->file ==
file)
598 const IdleCallRecursionPreventer icrp;
599 shellUIDToCreate = 0;
602 JUCE_VST_LOG (
"Attempting to load VST: " +
file.getFullPathName());
604 Ptr
m =
new ModuleHandle (
file,
nullptr);
616 ModuleHandle (
const File&
f, MainCall customMainCall)
617 :
file (
f), moduleMain (customMainCall)
619 getActiveModules().add (
this);
621 #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_IOS || JUCE_ANDROID
622 fullParentDirectoryPathName =
f.getParentDirectory().getFullPathName();
625 makeFSRefFromPath (&ref,
f.getParentDirectory().getFullPathName());
626 FSGetCatalogInfo (&ref, kFSCatInfoNone,
nullptr,
nullptr, &parentDirFSSpec,
nullptr);
632 getActiveModules().removeFirstMatchingValue (
this);
638 String fullParentDirectoryPathName;
641 #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_ANDROID
642 DynamicLibrary module;
646 if (moduleMain !=
nullptr)
649 pluginName =
file.getFileNameWithoutExtension();
651 module.open (file.getFullPathName());
653 moduleMain = (MainCall) module.getFunction (
"VSTPluginMain");
655 if (moduleMain ==
nullptr)
656 moduleMain = (MainCall) module.getFunction (
"main");
658 JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
660 if (moduleMain !=
nullptr)
665 if (vstXml ==
nullptr)
670 return moduleMain !=
nullptr;
680 void closeEffect (Vst2::VstEffectInterface* eff)
686 static String getDLLResource (
const File& dllFile,
const String&
type,
int resID)
689 auto dllModule = (HMODULE) dll.getNativeHandle();
691 if (dllModule != INVALID_HANDLE_VALUE)
693 if (
auto res = FindResource (dllModule,
MAKEINTRESOURCE (resID),
type.toWideCharPointer()))
695 if (
auto hGlob = LoadResource (dllModule, res))
697 auto*
data =
static_cast<const char*
> (LockResource (hGlob));
707 Handle resHandle = {};
708 CFUniquePtr<CFBundleRef> bundleRef;
711 CFBundleRefNum resFileId = {};
712 FSSpec parentDirFSSpec;
717 if (moduleMain !=
nullptr)
722 if (
file.hasFileExtension (
".vst"))
724 auto* utf8 =
file.getFullPathName().toRawUTF8();
726 if (
auto url = CFUniquePtr<CFURLRef> (CFURLCreateFromFileSystemRepresentation (
nullptr, (
const UInt8*) utf8,
727 (CFIndex) strlen (utf8),
file.isDirectory())))
729 bundleRef.reset (CFBundleCreate (kCFAllocatorDefault, url.get()));
731 if (bundleRef !=
nullptr)
733 if (CFBundleLoadExecutable (bundleRef.get()))
735 moduleMain = (MainCall) CFBundleGetFunctionPointerForName (bundleRef.get(), CFSTR(
"main_macho"));
737 if (moduleMain ==
nullptr)
738 moduleMain = (MainCall) CFBundleGetFunctionPointerForName (bundleRef.get(), CFSTR(
"VSTPluginMain"));
740 JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
742 if (moduleMain !=
nullptr)
744 if (CFTypeRef
name = CFBundleGetValueForInfoDictionaryKey (bundleRef.get(), CFSTR(
"CFBundleName")))
746 if (CFGetTypeID (
name) == CFStringGetTypeID())
750 if (CFStringGetCString ((CFStringRef)
name, buffer,
sizeof (buffer), CFStringGetSystemEncoding()))
756 pluginName =
file.getFileNameWithoutExtension();
759 resFileId = CFBundleOpenBundleResourceMap (bundleRef.get());
764 auto vstXmlFiles =
file
766 .getChildFile (
"Contents")
767 .getChildFile (
"Resources")
771 if (! vstXmlFiles.isEmpty())
772 vstXml =
parseXML (vstXmlFiles.getReference(0));
778 CFBundleUnloadExecutable (bundleRef.get());
790 if (bundleRef !=
nullptr)
793 CFBundleCloseBundleResourceMap (bundleRef.get(), resFileId);
796 if (CFGetRetainCount (bundleRef.get()) == 1)
797 CFBundleUnloadExecutable (bundleRef.get());
799 if (CFGetRetainCount (bundleRef.get()) > 0)
804 void closeEffect (Vst2::VstEffectInterface* eff)
815static const int defaultVSTSampleRateValue = 44100;
816static const int defaultVSTBlockSizeValue = 512;
821struct VSTPluginInstance
final : public AudioPluginInstance,
825 struct VSTParameter
final :
public Parameter
827 VSTParameter (VSTPluginInstance&
parent,
828 const String& paramName,
829 const Array<String>& shortParamNames,
830 float paramDefaultValue,
831 const String& paramLabel,
832 bool paramIsAutomatable,
833 bool paramIsDiscrete,
836 const StringArray& paramValueStrings,
837 const VSTXMLInfo::ValueType* paramValueType)
838 : pluginInstance (
parent),
840 shortNames (shortParamNames),
841 defaultValue (paramDefaultValue),
843 automatable (paramIsAutomatable),
844 discrete (paramIsDiscrete),
845 numSteps (numParamSteps),
846 isSwitch (isBoolSwitch),
847 vstValueStrings (paramValueStrings),
848 valueType (paramValueType)
852 float getValue()
const override
854 if (
auto* effect = pluginInstance.vstEffect)
858 return effect->getParameterValueFunction (effect, getParameterIndex());
864 void setValue (
float newValue)
override
866 if (
auto* effect = pluginInstance.vstEffect)
870 if (effect->getParameterValueFunction (effect, getParameterIndex()) != newValue)
871 effect->setParameterValueFunction (effect, getParameterIndex(), newValue);
875 String
getText (
float value,
int maximumStringLength)
const override
877 if (valueType !=
nullptr)
879 for (
auto&
v : valueType->entries)
880 if (
v->range.contains (
value))
884 return Parameter::getText (
value, maximumStringLength);
887 float getValueForText (
const String&
text)
const override
889 if (valueType !=
nullptr)
891 for (
auto&
v : valueType->entries)
893 return (
v->range.high +
v->range.low) / 2.0f;
896 return Parameter::getValueForText (
text);
899 String getCurrentValueAsText()
const override
901 if (valueType !=
nullptr || ! vstValueStrings.isEmpty())
902 return getText (getValue(), 1024);
907 float getDefaultValue()
const override
912 String getName (
int maximumStringLength)
const override
915 return pluginInstance.getTextForOpcode (getParameterIndex(),
918 if (
name.length() <= maximumStringLength)
921 if (! shortNames.isEmpty())
923 for (
auto&
n : shortNames)
924 if (
n.length() <= maximumStringLength)
927 return shortNames.getLast();
933 String getLabel()
const override
935 return label.isEmpty() ? pluginInstance.getTextForOpcode (getParameterIndex(),
940 bool isAutomatable()
const override
945 bool isDiscrete()
const override
950 bool isBoolean()
const override
955 int getNumSteps()
const override
960 StringArray getAllValueStrings()
const override
962 return vstValueStrings;
965 String getParameterID()
const override
967 return String (getParameterIndex());
970 VSTPluginInstance& pluginInstance;
973 const Array<String> shortNames;
974 const float defaultValue;
976 const bool automatable, discrete;
979 const StringArray vstValueStrings;
980 const VSTXMLInfo::ValueType*
const valueType;
983 VSTPluginInstance (
const ModuleHandle::Ptr& mh,
const BusesProperties& ioConfig, Vst2::VstEffectInterface* effect,
984 double sampleRateToUse,
int blockSizeToUse)
985 : AudioPluginInstance (ioConfig),
988 name (mh->pluginName),
989 bypassParam (new VST2BypassParameter (*this))
991 jassert (vstEffect !=
nullptr);
993 if (
auto* xml = vstModule->vstXml.get())
994 xmlInfo.reset (VSTXMLInfo::createFor (*xml));
996 refreshParameterList();
998 vstSupportsBypass = (pluginCanDo (
"bypass") > 0);
999 setRateAndBufferSizeDetails (sampleRateToUse, blockSizeToUse);
1002 void refreshParameterList()
override
1004 AudioProcessorParameterGroup newParameterTree;
1006 for (
int i = 0;
i < vstEffect->numParameters; ++
i)
1009 Array<String> shortParamNames;
1010 float defaultValue = 0;
1013 bool isDiscrete =
false;
1014 int numSteps = AudioProcessor::getDefaultNumParameterSteps();
1015 bool isBoolSwitch =
false;
1016 StringArray parameterValueStrings;
1017 const VSTXMLInfo::ValueType* valueType =
nullptr;
1019 if (xmlInfo !=
nullptr)
1021 if (
auto* param = xmlInfo->getParamForID (
i,
nullptr))
1023 paramName = param->name;
1025 for (
auto&
n : param->shortNames)
1026 shortParamNames.
add (
n);
1028 struct LengthComparator
1030 static int compareElements (
const juce::String& first,
const juce::String& second)
noexcept
1036 LengthComparator
comp;
1039 defaultValue = param->defaultValue;
1040 label = param->label;
1042 if (param->type ==
"switch")
1044 isBoolSwitch =
true;
1046 valueType = &xmlInfo->switchValueType;
1050 valueType = xmlInfo->getValueType (param->type);
1053 if (param->numberOfStates >= 2)
1055 numSteps = param->numberOfStates;
1057 if (valueType !=
nullptr)
1059 for (
auto* entry : valueType->entries)
1060 parameterValueStrings.
add (entry->name);
1066 isDiscrete = (numSteps != AudioProcessor::getDefaultNumParameterSteps());
1070 newParameterTree.addChild (std::make_unique<VSTParameter> (*
this, paramName, shortParamNames, defaultValue,
1071 label, isAutomatable, isDiscrete, numSteps,
1072 isBoolSwitch, parameterValueStrings, valueType));
1075 setHostedParameterTree (std::move (newParameterTree));
1078 ~VSTPluginInstance()
override
1089 if (vstModule->resFileId != 0)
1090 UseResFile (vstModule->resFileId);
1094 jassert (getActiveEditor() ==
nullptr);
1098 vstModule->closeEffect (vstEffect);
1101 vstModule =
nullptr;
1102 vstEffect =
nullptr;
1105 static VSTPluginInstance* create (
const ModuleHandle::Ptr& newModule,
1106 double initialSampleRate,
1107 int initialBlockSize)
1109 if (
auto* newEffect = constructEffect (newModule))
1111 newEffect->hostSpace2 = 0;
1115 auto blockSize =
jmax (32, initialBlockSize);
1121 BusesProperties ioConfig = queryBusIO (newEffect);
1123 return new VSTPluginInstance (newModule, ioConfig, newEffect, initialSampleRate, blockSize);
1130 void fillInPluginDescription (PluginDescription& desc)
const override
1135 char buffer[512] = { 0 };
1140 if (desc.descriptiveName.isEmpty())
1141 desc.descriptiveName =
name;
1144 desc.fileOrIdentifier = vstModule->file.getFullPathName();
1145 desc.uniqueId = desc.deprecatedUid = getUID();
1146 desc.lastFileModTime = vstModule->file.getLastModificationTime();
1147 desc.lastInfoUpdateTime = Time::getCurrentTime();
1148 desc.pluginFormatName =
"VST";
1149 desc.category = getCategory();
1152 char buffer[512] = { 0 };
1158 desc.numInputChannels = getTotalNumInputChannels();
1159 desc.numOutputChannels = getTotalNumOutputChannels();
1160 desc.isInstrument = isSynthPlugin();
1163 bool initialiseEffect (
double initialSampleRate,
int initialBlockSize)
1165 if (vstEffect !=
nullptr)
1168 initialise (initialSampleRate, initialBlockSize);
1175 void initialise (
double initialSampleRate,
int initialBlockSize)
1177 if (initialised || vstEffect ==
nullptr)
1188 JUCE_VST_LOG (
"Initialising VST: " + vstModule->pluginName +
" (" +
getVersion() +
")");
1191 setRateAndBufferSizeDetails (initialSampleRate, initialBlockSize);
1198 if (getBlockSize() > 0)
1203 setRateAndBufferSizeDetails (
getSampleRate(), getBlockSize());
1205 if (getNumPrograms() > 1)
1206 setCurrentProgram (0);
1214 updateStoredProgramNames();
1216 wantsMidiMessages = pluginCanDo (
"receiveVstMidiEvent") > 0 || isSynthPlugin();
1218 setLatencySamples (vstEffect->latency);
1221 void getExtensions (ExtensionsVisitor& visitor)
const override
1223 struct Extensions :
public ExtensionsVisitor::VSTClient
1225 explicit Extensions (
const VSTPluginInstance* instanceIn) : instance (instanceIn) {}
1229 const VSTPluginInstance* instance =
nullptr;
1232 visitor.visitVSTClient (Extensions {
this });
1235 void* getPlatformSpecificData()
override {
return vstEffect; }
1237 const String getName()
const override
1239 if (vstEffect !=
nullptr)
1241 char buffer[512] = { 0 };
1257 int uid = vstEffect !=
nullptr ? vstEffect->plugInIdentifier : 0;
1260 uid = vstModule->file.hashCode();
1265 double getTailLengthSeconds()
const override
1267 if (vstEffect ==
nullptr)
1270 if ((vstEffect->flags & 512) != 0)
1280 if (tailSize >= std::numeric_limits<int32>::max())
1281 return std::numeric_limits<double>::infinity();
1283 if (tailSize >= 0 && sampleRate > 0)
1284 return static_cast<double> (tailSize) / sampleRate;
1289 bool acceptsMidi()
const override {
return wantsMidiMessages; }
1290 bool producesMidi()
const override {
return pluginCanDo (
"sendVstMidiEvent") > 0; }
1291 bool supportsMPE()
const override {
return pluginCanDo (
"MPE") > 0; }
1300 void prepareToPlay (
double rate,
int samplesPerBlockExpected)
override
1302 auto numInputBuses = getBusCount (
true);
1303 auto numOutputBuses = getBusCount (
false);
1305 setRateAndBufferSizeDetails (rate, samplesPerBlockExpected);
1307 if (numInputBuses <= 1 && numOutputBuses <= 1)
1309 SpeakerMappings::VstSpeakerConfigurationHolder inArr (getChannelLayoutOfBus (
true, 0));
1310 SpeakerMappings::VstSpeakerConfigurationHolder outArr (getChannelLayoutOfBus (
false, 0));
1315 vstHostTime.tempoBPM = 120.0;
1316 vstHostTime.timeSignatureNumerator = 4;
1317 vstHostTime.timeSignatureDenominator = 4;
1318 vstHostTime.sampleRate = rate;
1319 vstHostTime.samplePosition = 0;
1328 wantsMidiMessages = wantsMidiMessages || (pluginCanDo (
"receiveVstMidiEvent") > 0) || isSynthPlugin();
1330 if (wantsMidiMessages)
1331 midiEventsToSend.ensureSize (256);
1333 midiEventsToSend.freeEvents();
1335 incomingMidi.clear();
1340 if (supportsDoublePrecisionProcessing())
1348 auto maxChannels =
jmax (1,
jmax (vstEffect->numInputChannels, vstEffect->numOutputChannels));
1350 tmpBufferFloat .setSize (maxChannels, samplesPerBlockExpected);
1351 tmpBufferDouble.setSize (maxChannels, samplesPerBlockExpected);
1353 channelBufferFloat .calloc (
static_cast<size_t> (maxChannels));
1354 channelBufferDouble.calloc (
static_cast<size_t> (maxChannels));
1356 outOfPlaceBuffer.setSize (
jmax (1, vstEffect->numOutputChannels), samplesPerBlockExpected);
1364 if (
auto* firstParam = getParameters()[0])
1366 auto old = firstParam->getValue();
1367 firstParam->setValue ((old < 0.5f) ? 1.0f : 0.0f);
1368 firstParam->setValue (old);
1374 setLatencySamples (vstEffect->latency);
1378 void releaseResources()
override
1386 channelBufferFloat.free();
1387 tmpBufferFloat.setSize (0, 0);
1389 channelBufferDouble.free();
1390 tmpBufferDouble.setSize (0, 0);
1392 outOfPlaceBuffer.setSize (1, 1);
1393 incomingMidi.clear();
1395 midiEventsToSend.freeEvents();
1398 void reset()
override
1408 void processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
override
1410 jassert (! isUsingDoublePrecision());
1411 processAudio (buffer, midiMessages, tmpBufferFloat, channelBufferFloat,
false);
1414 void processBlock (AudioBuffer<double>& buffer, MidiBuffer& midiMessages)
override
1416 jassert (isUsingDoublePrecision());
1417 processAudio (buffer, midiMessages, tmpBufferDouble, channelBufferDouble,
false);
1420 void processBlockBypassed (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
override
1422 jassert (! isUsingDoublePrecision());
1423 processAudio (buffer, midiMessages, tmpBufferFloat, channelBufferFloat,
true);
1426 void processBlockBypassed (AudioBuffer<double>& buffer, MidiBuffer& midiMessages)
override
1428 jassert (isUsingDoublePrecision());
1429 processAudio (buffer, midiMessages, tmpBufferDouble, channelBufferDouble,
true);
1433 bool supportsDoublePrecisionProcessing()
const override
1439 AudioProcessorParameter* getBypassParameter()
const override {
return vstSupportsBypass ? bypassParam.get() :
nullptr; }
1442 bool canAddBus (
bool)
const override {
return false; }
1443 bool canRemoveBus (
bool)
const override {
return false; }
1445 bool isBusesLayoutSupported (
const BusesLayout& layouts)
const override
1447 auto numInputBuses = getBusCount (
true);
1448 auto numOutputBuses = getBusCount (
false);
1451 if (numInputBuses > 1 || numOutputBuses > 1)
1452 return (layouts == getBusesLayout());
1454 return (layouts.getNumChannels (
true, 0) <= vstEffect->numInputChannels
1455 && layouts.getNumChannels (
false, 0) <= vstEffect->numOutputChannels);
1459 #if JUCE_IOS || JUCE_ANDROID
1460 bool hasEditor()
const override {
return false; }
1465 AudioProcessorEditor* createEditor()
override;
1468 const String getInputChannelName (
int index)
const override
1470 if (isValidChannel (index,
true))
1472 Vst2::VstPinInfo pinProps;
1474 return String (pinProps.
text, sizeof (pinProps.
text));
1480 bool isInputChannelStereoPair (
int index)
const override
1482 if (! isValidChannel (index,
true))
1485 Vst2::VstPinInfo pinProps;
1492 const String getOutputChannelName (
int index)
const override
1494 if (isValidChannel (index,
false))
1496 Vst2::VstPinInfo pinProps;
1498 return String (pinProps.
text, sizeof (pinProps.
text));
1504 bool isOutputChannelStereoPair (
int index)
const override
1506 if (! isValidChannel (index,
false))
1509 Vst2::VstPinInfo pinProps;
1516 bool isValidChannel (
int index,
bool isInput)
const noexcept
1519 : getTotalNumOutputChannels());
1523 int getNumPrograms()
override {
return vstEffect !=
nullptr ?
jmax (0, vstEffect->numPrograms) : 0; }
1528 void setCurrentProgram (
int newIndex)
override
1530 if (getNumPrograms() > 0 && newIndex != getCurrentProgram())
1534 const String getProgramName (
int index)
override
1538 if (index == getCurrentProgram())
1539 return getCurrentProgramName();
1541 if (vstEffect !=
nullptr)
1543 char nm[264] = { 0 };
1553 void changeProgramName (
int index,
const String& newName)
override
1555 if (index >= 0 && index == getCurrentProgram())
1557 if (getNumPrograms() > 0 && newName != getCurrentProgramName())
1567 void getStateInformation (MemoryBlock& mb)
override { saveToFXBFile (mb,
true); }
1568 void getCurrentProgramStateInformation (MemoryBlock& mb)
override { saveToFXBFile (mb,
false); }
1570 void setStateInformation (
const void*
data,
int size)
override { loadFromFXBFile (
data, (
size_t)
size); }
1571 void setCurrentProgramStateInformation (
const void*
data,
int size)
override { loadFromFXBFile (
data, (
size_t)
size); }
1574 void timerCallback()
override
1580 void handleAsyncUpdate()
override
1582 updateHostDisplay (AudioProcessorListener::ChangeDetails().withProgramChanged (
true)
1583 .withParameterInfoChanged (
true));
1591 if (
auto* param = getParameters()[index])
1592 param->sendValueChangedMessageToListeners (opt);
1615 if (
auto* param = getParameters()[index])
1616 param->beginChangeGesture();
1623 if (
auto* param = getParameters()[index])
1624 param->endChangeGesture();
1655 return handleGeneralCallback (
opcode, index,
value, ptr, opt);
1681 DBG (
"*** Unhandled VST Callback: " + String ((
int)
opcode));
1693 if (vstEffect !=
nullptr)
1696 const IdleCallRecursionPreventer icrp;
1701 auto oldResFile = CurResFile();
1703 if (vstModule->resFileId != 0)
1704 UseResFile (vstModule->resFileId);
1707 result = vstEffect->dispatchFunction (vstEffect,
opcode, index,
value, ptr, opt);
1710 auto newResFile = CurResFile();
1712 if (newResFile != oldResFile)
1714 vstModule->resFileId = newResFile;
1715 UseResFile (oldResFile);
1726 bool loadFromFXBFile (
const void*
const data,
const size_t dataSize)
1731 auto set = (
const fxSet*)
data;
1733 if ((! compareMagic (set->chunkMagic,
"CcnK")) || fxbSwap (set->version) > fxbVersionNum)
1736 if (compareMagic (set->fxMagic,
"FxBk"))
1739 if (fxbSwap (set->numPrograms) >= 0)
1741 auto oldProg = getCurrentProgram();
1742 auto numParams = fxbSwap (((
const fxProgram*) (set->programs))->numParams);
1743 auto progLen = (
int)
sizeof (fxProgram) + (numParams - 1) * (
int)
sizeof (float);
1745 for (
int i = 0;
i < fxbSwap (set->numPrograms); ++
i)
1751 if (getAddressDifference (prog, set) >= (
int) dataSize)
1754 if (fxbSwap (set->numPrograms) > 0)
1755 setCurrentProgram (
i);
1757 if (! restoreProgramSettings (prog))
1762 if (fxbSwap (set->numPrograms) > 0)
1763 setCurrentProgram (oldProg);
1767 if (getAddressDifference (prog, set) >= (
int) dataSize)
1770 if (! restoreProgramSettings (prog))
1774 else if (compareMagic (set->fxMagic,
"FxCk"))
1777 auto prog = (
const fxProgram*)
data;
1779 if (! compareMagic (prog->chunkMagic,
"CcnK"))
1782 changeProgramName (getCurrentProgram(), prog->prgName);
1784 for (
int i = 0;
i < fxbSwap (prog->numParams); ++
i)
1785 if (
auto* param = getParameters()[
i])
1786 param->setValue (fxbSwapFloat (prog->params[
i]));
1788 else if (compareMagic (set->fxMagic,
"FBCh"))
1791 auto cset = (
const fxChunkSet*)
data;
1793 if ((
size_t) fxbSwap (cset->chunkSize) + sizeof (fxChunkSet) - 8 > (
size_t) dataSize)
1796 setChunkData (cset->chunk, fxbSwap (cset->chunkSize),
false);
1798 else if (compareMagic (set->fxMagic,
"FPCh"))
1801 auto cset = (
const fxProgramSet*)
data;
1803 if ((
size_t) fxbSwap (cset->chunkSize) + sizeof (fxProgramSet) - 8 > (
size_t) dataSize)
1806 setChunkData (cset->chunk, fxbSwap (cset->chunkSize),
true);
1808 changeProgramName (getCurrentProgram(), cset->name);
1818 bool saveToFXBFile (MemoryBlock& dest,
bool isFXB,
int maxSizeMB = 128)
1820 auto numPrograms = getNumPrograms();
1821 auto numParams = getParameters().size();
1826 getChunkData (chunk, ! isFXB, maxSizeMB);
1830 auto totalLen =
sizeof (fxChunkSet) + chunk.
getSize() - 8;
1831 dest.
setSize (totalLen,
true);
1833 auto set = (fxChunkSet*) dest.
getData();
1834 set->chunkMagic = fxbName (
"CcnK");
1836 set->fxMagic = fxbName (
"FBCh");
1837 set->version = fxbSwap (fxbVersionNum);
1838 set->fxID = fxbSwap (getUID());
1839 set->fxVersion = fxbSwap (getVersionNumber());
1840 set->numPrograms = fxbSwap (numPrograms);
1847 auto totalLen =
sizeof (fxProgramSet) + chunk.
getSize() - 8;
1848 dest.
setSize (totalLen,
true);
1850 auto set = (fxProgramSet*) dest.
getData();
1851 set->chunkMagic = fxbName (
"CcnK");
1853 set->fxMagic = fxbName (
"FPCh");
1854 set->version = fxbSwap (fxbVersionNum);
1855 set->fxID = fxbSwap (getUID());
1856 set->fxVersion = fxbSwap (getVersionNumber());
1857 set->numPrograms = fxbSwap (numPrograms);
1860 getCurrentProgramName().copyToUTF8 (set->name, sizeof (set->name) - 1);
1868 auto progLen = (
int)
sizeof (fxProgram) + (numParams - 1) * (
int)
sizeof (float);
1869 auto len = (size_t) (progLen *
jmax (1, numPrograms)) + (
sizeof (fxSet) -
sizeof (fxProgram));
1872 auto set = (fxSet*) dest.
getData();
1873 set->chunkMagic = fxbName (
"CcnK");
1875 set->fxMagic = fxbName (
"FxBk");
1876 set->version = fxbSwap (fxbVersionNum);
1877 set->fxID = fxbSwap (getUID());
1878 set->fxVersion = fxbSwap (getVersionNumber());
1879 set->numPrograms = fxbSwap (numPrograms);
1881 MemoryBlock oldSettings;
1882 createTempParameterStore (oldSettings);
1884 auto oldProgram = getCurrentProgram();
1886 if (oldProgram >= 0)
1887 setParamsInProgramBlock (addBytesToPointer (set->programs, oldProgram * progLen));
1889 for (
int i = 0;
i < numPrograms; ++
i)
1891 if (
i != oldProgram)
1893 setCurrentProgram (
i);
1894 setParamsInProgramBlock (addBytesToPointer (set->programs,
i * progLen));
1898 if (oldProgram >= 0)
1899 setCurrentProgram (oldProgram);
1901 restoreFromTempParameterStore (oldSettings);
1905 dest.
setSize ((
size_t) ((numParams - 1) * (
int)
sizeof (
float)) +
sizeof (fxProgram),
true);
1906 setParamsInProgramBlock ((fxProgram*) dest.
getData());
1915 bool getChunkData (MemoryBlock& mb,
bool isPreset,
int maxSizeMB)
const
1919 void*
data =
nullptr;
1922 if (
data !=
nullptr && bytes <= (
size_t) maxSizeMB * 1024 * 1024)
1934 bool setChunkData (
const void*
data,
const int size,
bool isPreset)
1936 if (
size > 0 && usesChunks())
1941 updateStoredProgramNames();
1949 bool updateSizeFromEditor (
int w,
int h);
1951 Vst2::VstEffectInterface* vstEffect;
1952 ModuleHandle::Ptr vstModule;
1954 std::unique_ptr<VSTPluginFormat::ExtraFunctions> extraFunctions;
1958 struct VST2BypassParameter
final :
public Parameter
1960 VST2BypassParameter (VSTPluginInstance& effectToUse)
1968 void setValue (
float newValue)
override
1970 currentValue = (newValue != 0.0f);
1972 if (
parent.vstSupportsBypass)
1976 float getValueForText (
const String&
text)
const override
1978 String lowercaseText (
text.toLowerCase());
1980 for (
auto& testText : vstOnStrings)
1981 if (lowercaseText == testText)
1984 for (
auto& testText : vstOffStrings)
1985 if (lowercaseText == testText)
1988 return text.getIntValue() != 0 ? 1.0f : 0.0f;
1991 float getValue()
const override {
return currentValue; }
1992 float getDefaultValue()
const override {
return 0.0f; }
1993 String getName (
int )
const override {
return "Bypass"; }
1995 bool isAutomatable()
const override {
return true; }
1996 bool isDiscrete()
const override {
return true; }
1997 bool isBoolean()
const override {
return true; }
1998 int getNumSteps()
const override {
return 2; }
1999 StringArray getAllValueStrings()
const override {
return values; }
2000 String getLabel()
const override {
return {}; }
2001 String getParameterID()
const override {
return {}; }
2003 VSTPluginInstance&
parent;
2004 bool currentValue =
false;
2005 StringArray vstOnStrings, vstOffStrings, values;
2010 CriticalSection lock;
2011 std::atomic<bool> wantsMidiMessages {
false };
2012 bool initialised =
false;
2013 std::atomic<bool> isPowerOn {
false };
2014 bool lastProcessBlockCallWasBypass =
false, vstSupportsBypass =
false;
2015 mutable StringArray programNames;
2016 AudioBuffer<float> outOfPlaceBuffer;
2018 CriticalSection midiInLock;
2019 MidiBuffer incomingMidi;
2020 VSTMidiEventList midiEventsToSend;
2021 Vst2::VstTimingInformation vstHostTime;
2023 AudioBuffer<float> tmpBufferFloat;
2024 HeapBlock<float*> channelBufferFloat;
2026 AudioBuffer<double> tmpBufferDouble;
2027 HeapBlock<double*> channelBufferDouble;
2028 std::unique_ptr<VST2BypassParameter> bypassParam;
2030 std::unique_ptr<VSTXMLInfo> xmlInfo;
2034 static const char* canDos[] = {
"supplyIdle",
2039 "receiveVstMidiEvent",
2045 if (strcmp (canDos[
i],
name) == 0)
2055 if (
auto* app = JUCEApplicationBase::getInstance())
2056 hostName = app->getApplicationName();
2066 return (pointer_sized_int) &vstHostTime;
2073 if (insideVSTCallback == 0 && MessageManager::getInstance()->isThisTheMessageThread())
2075 const IdleCallRecursionPreventer icrp;
2078 if (getActiveEditor() !=
nullptr)
2082 Timer::callPendingTimersSynchronously();
2083 handleUpdateNowIfNeeded();
2085 for (
int i = ComponentPeer::getNumPeers(); --
i >= 0;)
2086 if (
auto*
p = ComponentPeer::getPeer(
i))
2087 p->performAnyPendingRepaintsNow();
2093 #if JUCE_LINUX || JUCE_BSD
2094 const MessageManagerLock mmLock;
2101 static Vst2::VstEffectInterface* constructEffect (
const ModuleHandle::Ptr& module)
2103 Vst2::VstEffectInterface* effect =
nullptr;
2106 const IdleCallRecursionPreventer icrp;
2109 JUCE_VST_LOG (
"Creating VST instance: " + module->pluginName);
2112 if (module->resFileId != 0)
2113 UseResFile (module->resFileId);
2117 JUCE_VST_WRAPPER_INVOKE_MAIN
2138 static BusesProperties queryBusIO (Vst2::VstEffectInterface* effect)
2140 BusesProperties returnValue;
2151 if (! pluginHasDefaultChannelLayouts (effect))
2153 SpeakerMappings::VstSpeakerConfigurationHolder canonicalIn (AudioChannelSet::canonicalChannelSet (effect->
numInputChannels));
2154 SpeakerMappings::VstSpeakerConfigurationHolder canonicalOut (AudioChannelSet::canonicalChannelSet (effect->
numOutputChannels));
2157 (pointer_sized_int) &canonicalIn.get(), (
void*) &canonicalOut.get(), 0.0f);
2160 const auto arrangement = getSpeakerArrangementWrapper (effect);
2162 for (
int dir = 0; dir < 2; ++dir)
2164 const bool isInput = (dir == 0);
2167 const auto* arr = (isInput ? arrangement.in : arrangement.out);
2168 bool busAdded =
false;
2170 Vst2::VstPinInfo pinProps;
2171 AudioChannelSet layout;
2173 for (
int ch = 0; ch < maxChannels; ch += layout.size())
2175 if (effect->dispatchFunction (effect,
opcode, ch, 0, &pinProps, 0.0f) == 0)
2180 layout = SpeakerMappings::vstArrangementTypeToChannelSet (pinProps.
configurationType, 0);
2182 if (layout.isDisabled())
2185 else if (arr ==
nullptr)
2193 returnValue.addBus (isInput, pinProps.
text, layout,
true);
2197 if (! busAdded && maxChannels > 0)
2199 String busName = (isInput ?
"Input" :
"Output");
2201 if (effect->dispatchFunction (effect,
opcode, 0, 0, &pinProps, 0.0f) != 0)
2202 busName = pinProps.
text;
2205 layout = SpeakerMappings::vstArrangementTypeToChannelSet (*arr);
2207 layout = AudioChannelSet::canonicalChannelSet (maxChannels);
2209 returnValue.addBus (isInput, busName, layout,
true);
2216 static bool pluginHasDefaultChannelLayouts (Vst2::VstEffectInterface* effect)
2218 if (getSpeakerArrangementWrapper (effect).isValid())
2221 for (
int dir = 0; dir < 2; ++dir)
2223 const bool isInput = (dir == 0);
2229 for (
int ch = 0; ch < maxChannels; ch += channels)
2231 Vst2::VstPinInfo pinProps;
2233 if (effect->dispatchFunction (effect,
opcode, ch, 0, &pinProps, 0.0f) == 0)
2246 struct SpeakerArrangements
2248 const Vst2::VstSpeakerConfiguration*
in;
2249 const Vst2::VstSpeakerConfiguration*
out;
2254 static SpeakerArrangements getSpeakerArrangementWrapper (Vst2::VstEffectInterface* effect)
2261 return {
nullptr,
nullptr };
2263 SpeakerArrangements
result {
nullptr,
nullptr };
2264 const auto dispatchResult = effect->dispatchFunction (effect,
2271 if (dispatchResult != 0)
2274 return {
nullptr,
nullptr };
2277 template <
typename Member,
typename Value>
2278 void setFromOptional (Member& target, Optional<Value> opt,
int32_t flag)
2282 target =
static_cast<Member
> (*opt);
2283 vstHostTime.flags |=
flag;
2287 vstHostTime.flags &= ~flag;
2292 template <
typename FloatType>
2293 void processAudio (AudioBuffer<FloatType>& buffer, MidiBuffer& midiMessages,
2294 AudioBuffer<FloatType>& tmpBuffer,
2295 HeapBlock<FloatType*>& channelBuffer,
2296 bool processBlockBypassedCalled)
2298 if (vstSupportsBypass)
2300 updateBypass (processBlockBypassedCalled);
2302 else if (processBlockBypassedCalled)
2305 AudioProcessor::processBlockBypassed (buffer, midiMessages);
2309 auto numSamples =
buffer.getNumSamples();
2310 auto numChannels =
buffer.getNumChannels();
2314 if (
auto* currentPlayHead = getPlayHead())
2316 if (
const auto position = currentPlayHead->getPosition())
2318 if (
const auto samplePos =
position->getTimeInSamples())
2319 vstHostTime.samplePosition = (double) *samplePos;
2323 if (
auto sig =
position->getTimeSignature())
2326 vstHostTime.timeSignatureNumerator = sig->numerator;
2327 vstHostTime.timeSignatureDenominator = sig->denominator;
2339 int32 newTransportFlags = 0;
2349 const auto optionalFrameRate = [fr =
position->getFrameRate()]() -> Optional<int32>
2351 if (! fr.hasValue())
2354 switch (fr->getBaseRate())
2367 vstHostTime.smpteRate = optionalFrameRate.orFallback (0);
2368 const auto effectiveRate =
position->getFrameRate().hasValue() ?
position->getFrameRate()->getEffectiveRate() : 0.0;
2369 vstHostTime.smpteOffset = (
int32) (
position->getTimeInSeconds().orFallback (0.0) * 80.0 * effectiveRate + 0.5);
2374 vstHostTime.loopStartPosition =
loop->ppqStart;
2375 vstHostTime.loopEndPosition =
loop->ppqEnd;
2389 vstHostTime.systemTimeNanoseconds = getVSTHostTimeNanoseconds();
2391 if (wantsMidiMessages)
2393 midiEventsToSend.clear();
2394 midiEventsToSend.ensureSize (1);
2396 for (
const auto metadata : midiMessages)
2397 midiEventsToSend.addEvent (metadata.data, metadata.numBytes,
2398 jlimit (0, numSamples - 1, metadata.samplePosition));
2407 auto channels = channelBuffer.get();
2409 if (numChannels < maxChannels)
2411 if (numSamples > tmpBuffer.getNumSamples())
2412 tmpBuffer.setSize (tmpBuffer.getNumChannels(), numSamples);
2417 for (
int ch = 0; ch < maxChannels; ++ch)
2418 channels[ch] = (ch < numChannels ?
buffer.getWritePointer (ch) : tmpBuffer.getWritePointer (ch));
2421 AudioBuffer<FloatType> processBuffer (channels, maxChannels, numSamples);
2423 invokeProcessFunction (processBuffer, numSamples);
2429 for (
int i = getTotalNumOutputChannels(); --
i >= 0;)
2437 midiMessages.swapWith (incomingMidi);
2438 incomingMidi.
clear();
2443 inline void invokeProcessFunction (AudioBuffer<float>& buffer,
int32 sampleFrames)
2447 vstEffect->processAudioInplaceFunction (vstEffect,
buffer.getArrayOfWritePointers(),
2448 buffer.getArrayOfWritePointers(), sampleFrames);
2453 outOfPlaceBuffer.clear();
2455 vstEffect->processAudioFunction (vstEffect,
buffer.getArrayOfWritePointers(),
2456 outOfPlaceBuffer.getArrayOfWritePointers(), sampleFrames);
2459 buffer.copyFrom (
i, 0, outOfPlaceBuffer.getReadPointer (
i), sampleFrames);
2463 inline void invokeProcessFunction (AudioBuffer<double>& buffer,
int32 sampleFrames)
2465 vstEffect->processDoubleAudioInplaceFunction (vstEffect,
buffer.getArrayOfWritePointers(),
2466 buffer.getArrayOfWritePointers(), sampleFrames);
2470 bool restoreProgramSettings (
const fxProgram*
const prog)
2472 if (compareMagic (prog->chunkMagic,
"CcnK")
2473 && compareMagic (prog->fxMagic,
"FxCk"))
2475 changeProgramName (getCurrentProgram(), prog->prgName);
2477 for (
int i = 0;
i < fxbSwap (prog->numParams); ++
i)
2478 if (
auto* param = getParameters()[
i])
2479 param->setValue (fxbSwapFloat (prog->params[
i]));
2487 String getTextForOpcode (
const int index,
const int opcode)
const
2489 if (vstEffect ==
nullptr)
2492 jassert (index >= 0 && index < vstEffect->numParameters);
2493 char nm[256] = { 0 };
2494 dispatch (
opcode, index, 0, nm, 0);
2498 String getCurrentProgramName()
2502 if (vstEffect !=
nullptr)
2505 char nm[256] = { 0 };
2510 const int index = getCurrentProgram();
2512 if (index >= 0 && programNames[index].isEmpty())
2514 while (programNames.
size() < index)
2515 programNames.
add (String());
2517 programNames.
set (index, progName);
2524 void setParamsInProgramBlock (fxProgram* prog)
2526 auto numParams = getParameters().size();
2528 prog->chunkMagic = fxbName (
"CcnK");
2530 prog->fxMagic = fxbName (
"FxCk");
2531 prog->version = fxbSwap (fxbVersionNum);
2532 prog->fxID = fxbSwap (getUID());
2533 prog->fxVersion = fxbSwap (getVersionNumber());
2534 prog->numParams = fxbSwap (numParams);
2536 getCurrentProgramName().copyToUTF8 (prog->prgName, sizeof (prog->prgName) - 1);
2538 for (
int i = 0;
i < numParams; ++
i)
2539 if (
auto* param = getParameters()[
i])
2540 prog->params[
i] = fxbSwapFloat (param->getValue());
2543 void updateStoredProgramNames()
2545 if (vstEffect !=
nullptr && getNumPrograms() > 0)
2547 char nm[256] = { 0 };
2552 auto oldProgram = getCurrentProgram();
2553 MemoryBlock oldSettings;
2554 createTempParameterStore (oldSettings);
2556 for (
int i = 0;
i < getNumPrograms(); ++
i)
2558 setCurrentProgram (
i);
2559 getCurrentProgramName();
2562 setCurrentProgram (oldProgram);
2563 restoreFromTempParameterStore (oldSettings);
2568 void handleMidiFromPlugin (
const Vst2::VstEventBlock* events)
2570 if (events !=
nullptr)
2573 VSTMidiEventList::addEventsToMidiBuffer (events, incomingMidi);
2578 void createTempParameterStore (MemoryBlock& dest)
2580 auto numParameters = getParameters().size();
2581 dest.
setSize (64 + 4 * (
size_t) numParameters);
2584 getCurrentProgramName().copyToUTF8 ((
char*) dest.
getData(), 63);
2586 auto p = unalignedPointerCast<float*> (((
char*) dest.
getData()) + 64);
2588 for (
int i = 0;
i < numParameters; ++
i)
2589 if (
auto* param = getParameters()[
i])
2590 p[
i] = param->getValue();
2593 void restoreFromTempParameterStore (
const MemoryBlock&
m)
2595 changeProgramName (getCurrentProgram(), (
const char*)
m.getData());
2597 auto p = unalignedPointerCast<float*> (((
char*)
m.getData()) + 64);
2598 auto numParameters = getParameters().size();
2600 for (
int i = 0;
i < numParameters; ++
i)
2601 if (
auto* param = getParameters()[
i])
2602 param->setValue (
p[
i]);
2608 return (pointer_sized_int) (
void*) &vstModule->parentDirFSSpec;
2610 return (pointer_sized_int) (
pointer_sized_uint) vstModule->fullParentDirectoryPathName.toRawUTF8();
2623 if (
v == 0 || (
int)
v == -1)
2624 v = (
unsigned int) getVersionNumber();
2631 unsigned int major = 0, minor = 0, bugfix = 0, build = 0;
2640 minor = (
v % 1000) / 100;
2641 bugfix = (
v % 100) / 10;
2644 else if (
v < 0x10000)
2646 major = (
v / 10000);
2647 minor = (
v % 10000) / 1000;
2648 bugfix = (
v % 1000) / 100;
2649 build = (
v % 100) / 10;
2651 else if (
v < 0x650000)
2653 major = (
v >> 16) & 0xff;
2654 minor = (
v >> 8) & 0xff;
2655 bugfix = (
v >> 0) & 0xff;
2659 major = (
v / 10000000);
2660 minor = (
v % 10000000) / 100000;
2661 bugfix = (
v % 100000) / 1000;
2665 s << (
int) major <<
'.' << (
int) minor <<
'.' << (
int) bugfix <<
'.' << (
int) build;
2671 const char* getCategory()
const
2673 switch (getVstCategory())
2693 void setPower (
const bool on)
2700 void updateBypass (
bool processBlockBypassedCalled)
2702 if (processBlockBypassedCalled)
2704 if (bypassParam->getValue() == 0.0f || ! lastProcessBlockCallWasBypass)
2705 bypassParam->setValue (1.0f);
2709 if (lastProcessBlockCallWasBypass)
2710 bypassParam->setValue (0.0f);
2713 lastProcessBlockCallWasBypass = processBlockBypassedCalled;
2720#if ! (JUCE_IOS || JUCE_ANDROID)
2721struct VSTPluginWindow;
2722static Array<VSTPluginWindow*> activeVSTWindows;
2725struct VSTPluginWindow :
public AudioProcessorEditor,
2727 private ComponentMovementWatcher,
2732 VSTPluginWindow (VSTPluginInstance& plug)
2733 : AudioProcessorEditor (&plug),
2735 ComponentMovementWatcher (this),
2739 #if JUCE_LINUX || JUCE_BSD
2740 pluginWindow =
None;
2743 ignoreUnused (recursiveResize, pluginRefusesToResize, alreadyInside);
2745 cocoaWrapper.reset (
new NSViewComponentWithParent (plugin));
2746 addAndMakeVisible (cocoaWrapper.get());
2749 activeVSTWindows.
add (
this);
2751 Vst2::VstEditorBounds* rect =
nullptr;
2754 if (rect !=
nullptr)
2757 updateSizeFromEditor (1, 1);
2763 addAndMakeVisible (embeddedComponent);
2767 ~VSTPluginWindow()
override
2769 closePluginWindow();
2772 cocoaWrapper.reset();
2776 plugin.editorBeingDeleted (
this);
2781 Rectangle<int> vstToComponentRect (Component& editor,
const Rectangle<int>& vr)
const
2783 return editor.getLocalArea (
nullptr, vr / (nativeScaleFactor * getDesktopScaleFactor()));
2786 Rectangle<int> componentToVstRect (Component& editor,
const Rectangle<int>& vr)
const
2788 if (
auto* tl = editor.getTopLevelComponent())
2789 return tl->getLocalArea (&editor, vr) * nativeScaleFactor * tl->getDesktopScaleFactor();
2794 bool updateSizeFromEditor (
int w,
int h)
2796 const auto correctedBounds = vstToComponentRect (*
this, {
w,
h });
2797 setSize (correctedBounds.getWidth(), correctedBounds.getHeight());
2800 if (cocoaWrapper !=
nullptr)
2801 cocoaWrapper->setSize (correctedBounds.getWidth(), correctedBounds.getHeight());
2808 void paint (Graphics&
g)
override
2810 g.fillAll (Colours::black);
2813 void visibilityChanged()
override
2816 openPluginWindow ((NSView*) cocoaWrapper->getView());
2818 closePluginWindow();
2821 void childBoundsChanged (Component*)
override
2823 auto w = cocoaWrapper->getWidth();
2824 auto h = cocoaWrapper->getHeight();
2826 if (
w != getWidth() ||
h != getHeight())
2830 void parentHierarchyChanged()
override { visibilityChanged(); }
2832 float getEffectiveScale()
const
2834 return nativeScaleFactor * userScaleFactor;
2837 void paint (Graphics&
g)
override
2839 #if JUCE_LINUX || JUCE_BSD
2842 if (pluginWindow != 0)
2844 auto clip = componentToVstRect (*
this,
g.getClipBounds().toNearestInt());
2846 X11Symbols::getInstance()->xClearArea (display, pluginWindow,
clip.getX(),
clip.getY(),
2847 static_cast<unsigned int> (
clip.getWidth()),
2848 static_cast<unsigned int> (
clip.getHeight()), True);
2854 g.fillAll (Colours::black);
2858 void componentMovedOrResized (
bool ,
bool )
override
2860 if (recursiveResize)
2863 if (getPeer() !=
nullptr)
2865 const ScopedValueSetter<bool> recursiveResizeSetter (recursiveResize,
true);
2868 embeddedComponent.setBounds (getLocalBounds());
2869 #elif JUCE_LINUX || JUCE_BSD
2870 const auto pos = componentToVstRect (*
this, getLocalBounds());
2872 if (pluginWindow != 0)
2874 auto* symbols = X11Symbols::getInstance();
2875 symbols->xMoveResizeWindow (display,
2879 (
unsigned int) pos.getWidth(),
2880 (
unsigned int) pos.getHeight());
2881 symbols->xMapRaised (display, pluginWindow);
2882 symbols->xFlush (display);
2888 using ComponentMovementWatcher::componentMovedOrResized;
2890 void componentVisibilityChanged()
override
2894 else if (! shouldAvoidDeletingWindow())
2895 closePluginWindow();
2897 setContentScaleFactor();
2899 #if JUCE_LINUX || JUCE_BSD
2900 MessageManager::callAsync ([safeThis = SafePointer<VSTPluginWindow> {
this }]
2902 if (safeThis !=
nullptr)
2903 safeThis->componentMovedOrResized (
true,
true);
2906 componentMovedOrResized (
true,
true);
2910 using ComponentMovementWatcher::componentVisibilityChanged;
2912 void componentPeerChanged()
override
2914 closePluginWindow();
2916 if (getPeer() !=
nullptr)
2919 componentMovedOrResized (
true,
true);
2923 void setContentScaleFactor()
2925 if (pluginRespondsToDPIChanges)
2929 nullptr, getEffectiveScale());
2933 void setScaleFactor (
float scale)
override
2935 userScaleFactor = scale;
2938 setContentScaleFactor();
2947 bool keyStateChanged (
bool)
override {
return pluginWantsKeys; }
2948 bool keyPressed (
const juce::KeyPress&)
override {
return pluginWantsKeys; }
2951 void timerCallback()
override
2956 if (--sizeCheckCount <= 0)
2958 sizeCheckCount = 10;
2959 checkPluginWindowSize();
2963 static bool reentrantGuard =
false;
2965 if (! reentrantGuard)
2967 reentrantGuard =
true;
2972 ScopedThreadDPIAwarenessSetter
scope (getPluginHWND());
2976 reentrantGuard =
false;
2979 #if JUCE_LINUX || JUCE_BSD
2980 if (pluginWindow == 0)
2982 updatePluginWindowHandle();
2984 if (pluginWindow != 0)
2985 componentMovedOrResized (
true,
true);
2992 void mouseDown (
const MouseEvent&
e)
override
2996 #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD
3001 void broughtToFront()
override
3004 activeVSTWindows.
add (
this);
3015 bool shouldAvoidDeletingWindow()
const
3017 return plugin.getPluginDescription()
3018 .manufacturerName.containsIgnoreCase (
"Loud Technologies");
3023 bool shouldRepaintCarbonWindowWhenCreated()
3025 return ! plugin.getName().containsIgnoreCase (
"izotope");
3030 void openPluginWindow (
void* parentWindow)
3032 if (isOpen || parentWindow ==
nullptr)
3037 Vst2::VstEditorBounds* rect =
nullptr;
3049 int w = 250,
h = 150;
3051 if (rect !=
nullptr)
3056 if (
w == 0 ||
h == 0)
3066 updateSizeFromEditor (
w,
h);
3068 startTimer (18 + juce::Random::getSystemRandom().nextInt (5));
3072 void openPluginWindow()
3077 JUCE_VST_LOG (
"Opening VST UI: " + plugin.getName());
3080 pluginRespondsToDPIChanges = plugin.pluginCanDo (
"supportsViewDpiScaling") > 0;
3082 setContentScaleFactor();
3084 Vst2::VstEditorBounds* rect =
nullptr;
3089 auto* handle = embeddedComponent.getHWND();
3091 auto* handle = getWindowHandle();
3100 originalWndProc = 0;
3101 auto* pluginHWND = getPluginHWND();
3103 if (pluginHWND == 0)
3112 if (! pluginWantsKeys)
3123 ScopedThreadDPIAwarenessSetter threadDpiAwarenessSetter { pluginHWND };
3127 auto w = (
int) (
r.right -
r.left);
3128 auto h = (
int) (
r.bottom -
r.top);
3130 if (rect !=
nullptr)
3135 if ((rw > 50 && rh > 50 && rw < 2000 && rh < 2000 && (! isWithin (
w, rw, 2) || ! isWithin (
h, rh, 2)))
3136 || ((
w == 0 && rw > 0) || (
h == 0 && rh > 0)))
3139 if (std::abs (rw -
w) > 350 || std::abs (rh -
h) > 350)
3141 ScopedThreadDPIAwarenessSetter threadDpiAwarenessSetter { pluginHWND };
3149 w =
r.right -
r.left;
3150 h =
r.bottom -
r.top;
3152 pluginRefusesToResize = (
w != rw) || (
h != rh);
3159 #elif JUCE_LINUX || JUCE_BSD
3160 updatePluginWindowHandle();
3162 int w = 250,
h = 150;
3164 if (rect !=
nullptr)
3169 if (
w == 0 ||
h == 0)
3176 if (pluginWindow != 0)
3177 X11Symbols::getInstance()->xMapRaised (display, pluginWindow);
3184 updateSizeFromEditor (
w,
h);
3187 checkPluginWindowSize();
3190 startTimer (18 + juce::Random::getSystemRandom().nextInt (5));
3196 void closePluginWindow()
3204 JUCE_VST_LOG (
"Closing VST UI: " + plugin.getName());
3211 auto* pluginHWND = getPluginHWND();
3213 if (originalWndProc != 0 && pluginHWND != 0 &&
IsWindow (pluginHWND))
3217 originalWndProc = 0;
3218 #elif JUCE_LINUX || JUCE_BSD
3227 return plugin.dispatch (
opcode, index,
value, ptr, opt);
3232 bool isWindowSizeCorrectForPlugin (
int w,
int h)
3234 if (pluginRefusesToResize)
3237 const auto converted = vstToComponentRect (*
this, {
w,
h });
3238 return (isWithin (converted.getWidth(), getWidth(), 5) && isWithin (converted.getHeight(), getHeight(), 5));
3243 Vst2::VstEditorBounds* rect =
nullptr;
3249 if (! isWindowSizeCorrectForPlugin (
w,
h))
3251 updateSizeFromEditor (
w,
h);
3255 embeddedComponent.updateHWNDBounds();
3258 void checkPluginWindowSize()
3260 if (! pluginRespondsToDPIChanges)
3267 for (
int i = activeVSTWindows.
size(); --
i >= 0;)
3269 Component::SafePointer<VSTPluginWindow>
w (activeVSTWindows[
i]);
3271 auto* pluginHWND =
w->getPluginHWND();
3273 if (
w !=
nullptr && pluginHWND == hW)
3297 #if JUCE_LINUX || JUCE_BSD
3298 void updatePluginWindowHandle()
3300 pluginWindow = getChildWindow ((Window) getWindowHandle());
3306 std::unique_ptr<NSViewComponentWithParent> cocoaWrapper;
3308 void resized()
override
3314 VSTPluginInstance& plugin;
3315 float userScaleFactor = 1.0f;
3316 bool isOpen =
false, recursiveResize =
false;
3317 bool pluginWantsKeys =
false, pluginRefusesToResize =
false, alreadyInside =
false;
3320 bool pluginRespondsToDPIChanges =
false;
3322 float nativeScaleFactor = 1.0f;
3324 struct ScaleNotifierCallback
3328 void operator() (
float platformScale)
const
3330 MessageManager::callAsync ([ref = Component::SafePointer<VSTPluginWindow> (&window), platformScale]
3332 if (
auto*
r = ref.getComponent())
3334 r->nativeScaleFactor = platformScale;
3335 r->setContentScaleFactor();
3340 r->componentMovedOrResized (
true,
true);
3346 NativeScaleFactorNotifier scaleNotifier {
this, ScaleNotifierCallback { *
this } };
3349 struct ViewComponent :
public HWNDComponent
3354 inner.addToDesktop (0);
3356 if (
auto* peer = inner.getPeer())
3357 setHWND (peer->getNativeHandle());
3360 void paint (Graphics&
g)
override {
g.fillAll (Colours::black); }
3363 struct Inner :
public Component
3365 Inner() { setOpaque (
true); }
3366 void paint (Graphics&
g)
override {
g.fillAll (Colours::black); }
3372 HWND getPluginHWND()
const
3377 ViewComponent embeddedComponent;
3378 void* originalWndProc = {};
3379 int sizeCheckCount = 0;
3380 #elif JUCE_LINUX || JUCE_BSD
3381 ::Display* display = XWindowSystem::getInstance()->getDisplay();
3382 Window pluginWindow = 0;
3385 static constexpr auto nativeScaleFactor = 1.0f;
3396AudioProcessorEditor* VSTPluginInstance::createEditor()
3398 #if JUCE_IOS || JUCE_ANDROID
3401 return hasEditor() ?
new VSTPluginWindow (*
this)
3406bool VSTPluginInstance::updateSizeFromEditor (
int w,
int h)
3408 if (
auto* editor =
dynamic_cast<VSTPluginWindow*
> (getActiveEditor()))
3409 return editor->updateSizeFromEditor (
w,
h);
3418 if (effect !=
nullptr)
3419 if (
auto* instance = (VSTPluginInstance*) (effect->
hostSpace2))
3420 return instance->handleCallback (
opcode, index,
value, ptr, opt);
3422 return VSTPluginInstance::handleGeneralCallback (
opcode, index,
value, ptr, opt);
3426VSTPluginFormat::VSTPluginFormat() {}
3427VSTPluginFormat::~VSTPluginFormat() {}
3429static std::unique_ptr<VSTPluginInstance> createAndUpdateDesc (VSTPluginFormat&
format, PluginDescription& desc)
3431 if (
auto p =
format.createInstanceFromDescription (desc, 44100.0, 512))
3433 if (
auto instance =
dynamic_cast<VSTPluginInstance*
> (
p.release()))
3436 if (instance->vstModule->resFileId != 0)
3437 UseResFile (instance->vstModule->resFileId);
3440 instance->fillInPluginDescription (desc);
3441 return std::unique_ptr<VSTPluginInstance> (instance);
3450void VSTPluginFormat::findAllTypesForFile (OwnedArray<PluginDescription>& results,
3451 const String& fileOrIdentifier)
3453 if (! fileMightContainThisPluginType (fileOrIdentifier))
3456 PluginDescription desc;
3457 desc.fileOrIdentifier = fileOrIdentifier;
3458 desc.uniqueId = desc.deprecatedUid = 0;
3460 auto instance = createAndUpdateDesc (*
this, desc);
3462 if (instance ==
nullptr)
3468 results.add (
new PluginDescription (desc));
3477 char shellEffectName [256] = { 0 };
3483 desc.uniqueId = desc.deprecatedUid = uid;
3484 desc.name = shellEffectName;
3486 aboutToScanVSTShellPlugin (desc);
3488 std::unique_ptr<VSTPluginInstance> shellInstance (createAndUpdateDesc (*
this, desc));
3490 if (shellInstance !=
nullptr)
3492 jassert (desc.deprecatedUid == uid);
3493 jassert (desc.uniqueId == uid);
3494 desc.hasSharedContainer =
true;
3495 desc.name = shellEffectName;
3497 if (! arrayContainsPlugin (results, desc))
3498 results.add (
new PluginDescription (desc));
3504void VSTPluginFormat::createPluginInstance (
const PluginDescription& desc,
3505 double sampleRate,
int blockSize,
3508 std::unique_ptr<VSTPluginInstance>
result;
3510 if (fileMightContainThisPluginType (desc.fileOrIdentifier))
3512 File
file (desc.fileOrIdentifier);
3515 file.getParentDirectory().setAsCurrentWorkingDirectory();
3517 if (
auto module = ModuleHandle::findOrCreateModule (
file))
3519 shellUIDToCreate = desc.uniqueId != 0 ? desc.uniqueId : desc.deprecatedUid;
3521 result.reset (VSTPluginInstance::create (module, sampleRate, blockSize));
3523 if (
result !=
nullptr && !
result->initialiseEffect (sampleRate, blockSize))
3527 previousWorkingDirectory.setAsCurrentWorkingDirectory();
3533 errorMsg =
TRANS (
"Unable to load XXX plug-in file").
replace (
"XXX",
"VST-2");
3538bool VSTPluginFormat::requiresUnblockedMessageThreadDuringCreation (
const PluginDescription&)
const
3543bool VSTPluginFormat::fileMightContainThisPluginType (
const String& fileOrIdentifier)
3547 #if JUCE_MAC || JUCE_IOS
3548 return f.isDirectory() &&
f.hasFileExtension (
".vst");
3550 return f.existsAsFile() &&
f.hasFileExtension (
".dll");
3551 #elif JUCE_LINUX || JUCE_BSD || JUCE_ANDROID
3552 return f.existsAsFile() &&
f.hasFileExtension (
".so");
3556String VSTPluginFormat::getNameOfPluginFromIdentifier (
const String& fileOrIdentifier)
3558 return fileOrIdentifier;
3561bool VSTPluginFormat::pluginNeedsRescanning (
const PluginDescription& desc)
3563 return File (desc.fileOrIdentifier).getLastModificationTime() != desc.lastFileModTime;
3566bool VSTPluginFormat::doesPluginStillExist (
const PluginDescription& desc)
3568 return File (desc.fileOrIdentifier).exists();
3571StringArray VSTPluginFormat::searchPathsForPlugins (
const FileSearchPath& directoriesToSearch,
const bool recursive,
bool)
3573 StringArray results;
3575 for (
int j = 0;
j < directoriesToSearch.getNumPaths(); ++
j)
3576 recursiveFileSearch (results, directoriesToSearch [
j], recursive);
3581void VSTPluginFormat::recursiveFileSearch (StringArray& results,
const File& dir,
const bool recursive)
3587 auto f = iter.getFile();
3590 if (fileMightContainThisPluginType (
f.getFullPathName()))
3593 results.
add (
f.getFullPathName());
3596 if (recursive && (! isPlugin) &&
f.isDirectory())
3597 recursiveFileSearch (results,
f,
true);
3601FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch()
3604 return FileSearchPath (
"~/Library/Audio/Plug-Ins/VST;/Library/Audio/Plug-Ins/VST");
3605 #elif JUCE_LINUX || JUCE_BSD || JUCE_ANDROID
3606 return FileSearchPath (SystemStats::getEnvironmentVariable (
"VST_PATH",
3607 "/usr/lib/vst;/usr/local/lib/vst;~/.vst")
3608 .replace (
":",
";"));
3612 FileSearchPath paths;
3613 paths.add (WindowsRegistry::getValue (
"HKEY_LOCAL_MACHINE\\Software\\VST\\VSTPluginsPath"));
3614 paths.addIfNotAlreadyThere (programFiles +
"\\Steinberg\\VstPlugins");
3615 paths.addIfNotAlreadyThere (programFiles +
"\\VstPlugins");
3616 paths.removeRedundantPaths();
3620 CFUniquePtr<CFURLRef> relativePluginDir (CFBundleCopyBuiltInPlugInsURL (CFBundleGetMainBundle()));
3621 CFUniquePtr<CFURLRef> pluginDir (CFURLCopyAbsoluteURL (relativePluginDir.get()));
3623 CFUniquePtr<CFStringRef> path (CFURLCopyFileSystemPath (pluginDir.get(), kCFURLPOSIXPathStyle));
3624 FileSearchPath
retval (String (CFStringGetCStringPtr (path.get(), kCFStringEncodingUTF8)));
3629const XmlElement* VSTPluginFormat::getVSTXML (AudioPluginInstance* plugin)
3631 if (
auto* vst =
dynamic_cast<VSTPluginInstance*
> (plugin))
3632 if (vst->vstModule !=
nullptr)
3633 return vst->vstModule->vstXml.get();
3638bool VSTPluginFormat::loadFromFXBFile (AudioPluginInstance* plugin,
const void*
data,
size_t dataSize)
3640 if (
auto* vst =
dynamic_cast<VSTPluginInstance*
> (plugin))
3641 return vst->loadFromFXBFile (
data, dataSize);
3646bool VSTPluginFormat::saveToFXBFile (AudioPluginInstance* plugin, MemoryBlock& dest,
bool asFXB)
3648 if (
auto* vst =
dynamic_cast<VSTPluginInstance*
> (plugin))
3649 return vst->saveToFXBFile (dest, asFXB);
3654bool VSTPluginFormat::getChunkData (AudioPluginInstance* plugin, MemoryBlock&
result,
bool isPreset)
3656 if (
auto* vst =
dynamic_cast<VSTPluginInstance*
> (plugin))
3657 return vst->getChunkData (
result, isPreset, 128);
3662bool VSTPluginFormat::setChunkData (AudioPluginInstance* plugin,
const void*
data,
int size,
bool isPreset)
3664 if (
auto* vst =
dynamic_cast<VSTPluginInstance*
> (plugin))
3665 return vst->setChunkData (
data,
size, isPreset);
3670AudioPluginInstance* VSTPluginFormat::createCustomVSTFromMainCall (
void* entryPointFunction,
3671 double initialSampleRate,
int initialBufferSize)
3673 ModuleHandle::Ptr module =
new ModuleHandle (File(), (MainCall) entryPointFunction);
3677 std::unique_ptr<VSTPluginInstance>
result (VSTPluginInstance::create (module, initialSampleRate, initialBufferSize));
3680 if (
result->initialiseEffect (initialSampleRate, initialBufferSize))
3687void VSTPluginFormat::setExtraFunctions (AudioPluginInstance* plugin, ExtraFunctions* functions)
3689 std::unique_ptr<ExtraFunctions>
f (functions);
3691 if (
auto* vst =
dynamic_cast<VSTPluginInstance*
> (plugin))
3692 std::swap (vst->extraFunctions,
f);
3695AudioPluginInstance* VSTPluginFormat::getPluginInstanceFromVstEffectInterface (
void* aEffect)
3697 if (
auto* vstAEffect =
reinterpret_cast<Vst2::VstEffectInterface*
> (aEffect))
3698 if (
auto* instanceVST =
reinterpret_cast<VSTPluginInstance*
> (vstAEffect->hostSpace2))
3699 return dynamic_cast<AudioPluginInstance*
> (instanceVST);
3706 if (
auto* vst =
dynamic_cast<VSTPluginInstance*
> (plugin))
3707 return vst->dispatch (
opcode, index,
value, ptr, opt);
3712void VSTPluginFormat::aboutToScanVSTShellPlugin (
const PluginDescription&) {}
#define JUCE_VST_FALLBACK_HOST_NAME
Definition AppConfig.h:212
struct _AEffect AEffect
Definition vestige.h:315
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
#define noexcept
Definition DistrhoDefines.h:72
#define final
Definition DistrhoDefines.h:74
#define nullptr
Definition DistrhoDefines.h:75
static Audio_Scope * scope
Definition player.cpp:26
opcode
Definition Spc_Cpu.h:173
goto loop
Definition Spc_Cpu.h:155
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static void message(int level, const char *fmt,...)
Definition adplugdb.cpp:120
int64_t int64
Definition basics.h:91
int32_t int32
Definition basics.h:89
uint32_t uint32
Definition basics.h:90
void removeFirstMatchingValue(ParameterType valueToRemove)
Definition Array.h:789
bool add(const ElementType &newElement) noexcept
Definition Array.h:354
int size() const noexcept
Definition Array.h:187
void sort()
Definition Array.h:1014
static uint32 littleEndianInt(const void *bytes) noexcept
Definition ByteOrder.h:236
static uint16 swapIfLittleEndian(uint16 value) noexcept
Definition ByteOrder.h:227
static uint32 bigEndianInt(const void *bytes) noexcept
Definition ByteOrder.h:239
static uint16 swap(uint16 value) noexcept
Definition ByteOrder.h:151
static File createFileWithoutCheckingPath(const String &absolutePath) noexcept
Definition File.cpp:65
static File getCurrentWorkingDirectory()
Definition File.cpp:1395
@ findFiles
Definition File.h:462
@ findFilesAndDirectories
Definition File.h:463
const String & getFullPathName() const noexcept
Definition File.h:152
static File getSpecialLocation(const SpecialLocationType type)
Definition File.cpp:1642
void copyFrom(const void *srcData, int destinationOffset, size_t numBytes) noexcept
Definition MemoryBlock.cpp:222
size_t getSize() const noexcept
Definition MemoryBlock.h:102
void setSize(const size_t newSize, bool initialiseNewSpaceToZero=false)
Definition MemoryBlock.cpp:109
void fillWith(uint8 valueToUse) noexcept
Definition MemoryBlock.cpp:162
void * getData() const noexcept
Definition MemoryBlock.h:91
void copyTo(void *destData, int sourceOffset, size_t numBytes) const noexcept
Definition MemoryBlock.cpp:240
void clear() noexcept
Definition MidiBuffer.cpp:106
void set(int index, const String &newString)
Definition StringArray.cpp:147
bool add(const String &stringToAdd)
Definition StringArray.cpp:108
int size() const noexcept
Definition StringArray.h:97
void removeEmptyStrings(bool removeWhitespaceStrings=true)
Definition StringArray.cpp:208
bool isNotEmpty() const noexcept
Definition String.h:244
String substring(int startIndex, int endIndex) const
Definition String.cpp:1373
static String createStringFromData(const void *data, int size)
Definition String.cpp:1721
const char * toRawUTF8() const
Definition String.cpp:1925
String replace(StringRef stringToReplace, StringRef stringToInsertInstead, bool ignoreCase=false) const
Definition String.cpp:1159
static String fromUTF8(const char *utf8buffer, int bufferSizeBytes=-1)
Definition String.cpp:1961
bool isEmpty() const noexcept
Definition String.h:238
void add(const ElementType &newElement)
Definition juce_Array.h:418
const String & getFullPathName() const noexcept
Definition juce_File.h:153
ObjectClass * add(ObjectClass *newObject)
Definition juce_OwnedArray.h:294
int size() const noexcept
Definition juce_StringArray.h:136
void trim()
Definition juce_StringArray.cpp:266
void add(String stringToAdd)
Definition juce_StringArray.cpp:136
int addTokens(StringRef stringToTokenise, bool preserveQuotedStrings)
Definition juce_StringArray.cpp:329
String trim() const
Definition juce_String.cpp:1656
const char * toRawUTF8() const
Definition juce_String.cpp:2074
String retainCharacters(StringRef charactersToRetain) const
Definition juce_String.cpp:1735
int indexOfWholeWord(StringRef wordToLookFor) const noexcept
Definition juce_String.cpp:1050
String replace(StringRef stringToReplace, StringRef stringToInsertInstead, bool ignoreCase=false) const
Definition juce_String.cpp:1279
String replaceSection(int startIndex, int numCharactersToReplace, StringRef stringToInsert) const
Definition juce_String.cpp:1218
int getNumChildElements() const noexcept
Definition juce_XmlElement.cpp:668
XmlElement * getChildByName(StringRef tagNameToLookFor) const noexcept
Definition juce_XmlElement.cpp:678
double getDoubleAttribute(StringRef attributeName, double defaultReturnValue=0.0) const
Definition juce_XmlElement.cpp:579
Iterator< GetNextElementWithTagName > getChildWithTagNameIterator(StringRef name) const
Definition juce_XmlElement.h:730
bool hasAttribute(StringRef attributeName) const noexcept
Definition juce_XmlElement.cpp:549
bool hasTagName(StringRef possibleTagName) const noexcept
Definition juce_XmlElement.cpp:470
Iterator< GetNextElement > getChildIterator() const
Definition juce_XmlElement.h:715
int getIntAttribute(StringRef attributeName, int defaultReturnValue=0) const
Definition juce_XmlElement.cpp:571
const String & getStringAttribute(StringRef attributeName) const noexcept
Definition juce_XmlElement.cpp:555
* e
Definition inflate.c:1404
UINT_D64 w
Definition inflate.c:942
unsigned * m
Definition inflate.c:1559
register unsigned j
Definition inflate.c:1576
unsigned v[N_MAX]
Definition inflate.c:1584
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
int retval
Definition inflate.c:947
unsigned s
Definition inflate.c:1555
unsigned x[BMAX+1]
Definition inflate.c:1586
unsigned f
Definition inflate.c:1572
static PuglViewHint int value
Definition pugl.h:1708
static const char * name
Definition pugl.h:1582
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
static uintptr_t parent
Definition pugl.h:1644
virtual ASIOError future(long selector, void *opt)=0
virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate)=0
int val
Definition jpeglib.h:956
JSAMPIMAGE data
Definition jpeglib.h:945
int version
Definition jpeglib.h:901
#define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...)
Definition juce_CompilerWarnings.h:181
#define JUCE_END_IGNORE_WARNINGS_GCC_LIKE
Definition juce_CompilerWarnings.h:182
#define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings)
Definition juce_CompilerWarnings.h:198
#define JUCE_END_IGNORE_WARNINGS_MSVC
Definition juce_CompilerWarnings.h:199
#define TRANS(stringLiteral)
Definition juce_LocalisedStrings.h:208
#define JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED
Definition juce_MessageManager.h:465
#define JUCE_ASSERT_MESSAGE_THREAD
Definition juce_MessageManager.h:473
#define VSTINTERFACECALL
Definition juce_VSTInterface.h:44
@ vstTimingInfoFlagLoopPositionValid
Definition juce_VSTInterface.h:379
@ vstTimingInfoFlagTransportChanged
Definition juce_VSTInterface.h:369
@ vstTimingInfoFlagTimeSignatureValid
Definition juce_VSTInterface.h:380
@ vstTimingInfoFlagLoopActive
Definition juce_VSTInterface.h:371
#define WM_APPCOMMAND
Definition juce_win32_Windowing.cpp:49
static void cleanup(void)
Definition lilv_test.c:152
float in
Definition lilv_test.c:1460
float out
Definition lilv_test.c:1461
static int JUCE_CDECL comp(const void *a, const void *b)
Definition lsp.c:298
int int32_t
Definition mid.cpp:97
const char * getVersion()
Definition carla_juce.cpp:57
Definition juce_VSTMidiEventList.h:29
@ vstEffectFlagInplaceDoubleAudio
Definition juce_VSTMidiEventList.h:92
@ vstEffectFlagInplaceAudio
Definition juce_VSTMidiEventList.h:89
@ vstEffectFlagIsSynth
Definition juce_VSTMidiEventList.h:91
@ vstEffectFlagHasEditor
Definition juce_VSTMidiEventList.h:88
@ vstEffectFlagDataInChunks
Definition juce_VSTMidiEventList.h:90
@ vstMaxPlugInNameStringLength
Definition juce_VSTMidiEventList.h:250
@ vstMaxManufacturerStringLength
Definition juce_VSTMidiEventList.h:249
@ hostOpcodeGetProductName
Definition juce_VSTMidiEventList.h:189
@ hostOpcodeOfflineStart
Definition juce_VSTMidiEventList.h:181
@ hostOpcodeGetBlockSize
Definition juce_VSTMidiEventList.h:173
@ hostOpcodeParameterChanged
Definition juce_VSTMidiEventList.h:157
@ hostOpcodeGetNextPlugIn
Definition juce_VSTMidiEventList.h:177
@ hostOpcodeOfflineGetCurrentPass
Definition juce_VSTMidiEventList.h:184
@ hostOpcodeIdle
Definition juce_VSTMidiEventList.h:160
@ hostOpcodeGetDirectory
Definition juce_VSTMidiEventList.h:197
@ hostOpcodeSetIcon
Definition juce_VSTMidiEventList.h:192
@ hostOpcodeSetOutputSampleRate
Definition juce_VSTMidiEventList.h:186
@ hostOpcodeOfflineGetCurrentMetaPass
Definition juce_VSTMidiEventList.h:185
@ hostOpcodeGetLanguage
Definition juce_VSTMidiEventList.h:194
@ hostOpcodeManufacturerSpecific
Definition juce_VSTMidiEventList.h:191
@ hostOpcodePinConnected
Definition juce_VSTMidiEventList.h:161
@ hostOpcodeGetNumberOfAutomatableParameters
Definition juce_VSTMidiEventList.h:167
@ hostOpcodeGetManufacturerName
Definition juce_VSTMidiEventList.h:188
@ hostOpcodeGetManufacturerVersion
Definition juce_VSTMidiEventList.h:190
@ hostOpcodeSetTime
Definition juce_VSTMidiEventList.h:165
@ hostOpcodeGetOutputLatency
Definition juce_VSTMidiEventList.h:175
@ hostOpcodeWillReplace
Definition juce_VSTMidiEventList.h:178
@ hostOpcodeUpdateView
Definition juce_VSTMidiEventList.h:198
@ hostOpcodeWindowSize
Definition juce_VSTMidiEventList.h:171
@ hostOpcodeVstVersion
Definition juce_VSTMidiEventList.h:158
@ hostOpcodeTempoAt
Definition juce_VSTMidiEventList.h:166
@ hostOpcodePlugInWantsMidi
Definition juce_VSTMidiEventList.h:162
@ hostOpcodeGetAutomationState
Definition juce_VSTMidiEventList.h:180
@ hostOpcodeNeedsIdle
Definition juce_VSTMidiEventList.h:170
@ hostOpcodeGetInputLatency
Definition juce_VSTMidiEventList.h:174
@ hostOpcodeCanHostDo
Definition juce_VSTMidiEventList.h:193
@ hostOpcodeIOModified
Definition juce_VSTMidiEventList.h:169
@ hostOpcodeCurrentId
Definition juce_VSTMidiEventList.h:159
@ hostOpcodeOpenEditorWindow
Definition juce_VSTMidiEventList.h:195
@ hostOpcodeGetParameterInterval
Definition juce_VSTMidiEventList.h:168
@ hostOpcodeGetTimingInfo
Definition juce_VSTMidiEventList.h:163
@ hostOpcodeGetPreviousPlugIn
Definition juce_VSTMidiEventList.h:176
@ hostOpcodePreAudioProcessingEvents
Definition juce_VSTMidiEventList.h:164
@ hostOpcodeCloseEditorWindow
Definition juce_VSTMidiEventList.h:196
@ hostOpcodeGetOutputSpeakerConfiguration
Definition juce_VSTMidiEventList.h:187
@ hostOpcodeOfflineWrite
Definition juce_VSTMidiEventList.h:183
@ hostOpcodeGetSampleRate
Definition juce_VSTMidiEventList.h:172
@ hostOpcodeParameterChangeGestureBegin
Definition juce_VSTMidiEventList.h:199
@ hostOpcodeParameterChangeGestureEnd
Definition juce_VSTMidiEventList.h:200
@ hostOpcodeGetCurrentAudioProcessingLevel
Definition juce_VSTMidiEventList.h:179
@ hostOpcodeOfflineReadSource
Definition juce_VSTMidiEventList.h:182
@ vstTimingInfoFlagAutomationReadModeActive
Definition juce_VSTMidiEventList.h:375
@ vstTimingInfoFlagMusicalPositionValid
Definition juce_VSTMidiEventList.h:377
@ vstTimingInfoFlagTransportChanged
Definition juce_VSTMidiEventList.h:370
@ vstTimingInfoFlagTempoValid
Definition juce_VSTMidiEventList.h:378
@ vstTimingInfoFlagCurrentlyPlaying
Definition juce_VSTMidiEventList.h:371
@ vstTimingInfoFlagAutomationWriteModeActive
Definition juce_VSTMidiEventList.h:374
@ vstTimingInfoFlagSmpteValid
Definition juce_VSTMidiEventList.h:382
@ vstTimingInfoFlagTimeSignatureValid
Definition juce_VSTMidiEventList.h:381
@ vstTimingInfoFlagNanosecondsValid
Definition juce_VSTMidiEventList.h:376
@ vstTimingInfoFlagLoopPositionValid
Definition juce_VSTMidiEventList.h:380
@ vstTimingInfoFlagLoopActive
Definition juce_VSTMidiEventList.h:372
@ vstTimingInfoFlagCurrentlyRecording
Definition juce_VSTMidiEventList.h:373
@ vstTimingInfoFlagLastBarPositionValid
Definition juce_VSTMidiEventList.h:379
@ plugInOpcodeStopProcess
Definition juce_VSTMidiEventList.h:146
@ plugInOpcodeManufacturerSpecific
Definition juce_VSTMidiEventList.h:136
@ plugInOpcodeSetCurrentProgramName
Definition juce_VSTMidiEventList.h:102
@ plugInOpcodeGetTailSize
Definition juce_VSTMidiEventList.h:138
@ plugInOpcodeIdle
Definition juce_VSTMidiEventList.h:139
@ plugInOpcodeSetBlockSize
Definition juce_VSTMidiEventList.h:108
@ plugInOpcodeGetProgramName
Definition juce_VSTMidiEventList.h:124
@ plugInOpcodePreAudioProcessingEvents
Definition juce_VSTMidiEventList.h:121
@ plugInOpcodeSetSpeakerConfiguration
Definition juce_VSTMidiEventList.h:130
@ plugInOpcodeGetParameterLabel
Definition juce_VSTMidiEventList.h:104
@ plugInOpcodeIsParameterAutomatable
Definition juce_VSTMidiEventList.h:122
@ plugInOpcodeeffEditorTop
Definition juce_VSTMidiEventList.h:116
@ plugInOpcodeOpen
Definition juce_VSTMidiEventList.h:98
@ plugInOpcodeGetSpeakerArrangement
Definition juce_VSTMidiEventList.h:143
@ plugInOpcodeGetData
Definition juce_VSTMidiEventList.h:119
@ plugInOpcodeSetSampleRate
Definition juce_VSTMidiEventList.h:107
@ plugInOpcodeSetCurrentProgram
Definition juce_VSTMidiEventList.h:100
@ plugInOpcodeGetEditorBounds
Definition juce_VSTMidiEventList.h:110
@ plugInOpcodeGetPlugInName
Definition juce_VSTMidiEventList.h:132
@ plugInOpcodeGetManufacturerName
Definition juce_VSTMidiEventList.h:133
@ plugInOpcodeNextPlugInUniqueID
Definition juce_VSTMidiEventList.h:144
@ plugInOpcodeIdentify
Definition juce_VSTMidiEventList.h:118
@ plugInOpcodeSetData
Definition juce_VSTMidiEventList.h:120
@ plugInOpcodeGetPlugInCategory
Definition juce_VSTMidiEventList.h:129
@ plugInOpcodeKeyboardFocusRequired
Definition juce_VSTMidiEventList.h:140
@ plugInOpcodeGetCurrentProgramName
Definition juce_VSTMidiEventList.h:103
@ plugInOpcodeGetManufacturerVersion
Definition juce_VSTMidiEventList.h:135
@ plugInOpcodeEditorIdle
Definition juce_VSTMidiEventList.h:115
@ plugInOpcodeOpenEditor
Definition juce_VSTMidiEventList.h:111
@ plugInOpcodeSetSampleFloatType
Definition juce_VSTMidiEventList.h:148
@ plugInOpcodeGetParameterText
Definition juce_VSTMidiEventList.h:105
@ plugInOpcodeStartProcess
Definition juce_VSTMidiEventList.h:145
@ plugInOpcodeGetOutputPinProperties
Definition juce_VSTMidiEventList.h:128
@ plugInOpcodeCanPlugInDo
Definition juce_VSTMidiEventList.h:137
@ plugInOpcodeGetCurrentProgram
Definition juce_VSTMidiEventList.h:101
@ plugInOpcodeGetParameterName
Definition juce_VSTMidiEventList.h:106
@ plugInOpcodeConnectOutput
Definition juce_VSTMidiEventList.h:126
@ plugInOpcodeClose
Definition juce_VSTMidiEventList.h:99
@ plugInOpcodeGetManufacturerProductName
Definition juce_VSTMidiEventList.h:134
@ plugInOpcodeSetBypass
Definition juce_VSTMidiEventList.h:131
@ plugInOpcodeConnectInput
Definition juce_VSTMidiEventList.h:125
@ plugInOpcodeGetInputPinProperties
Definition juce_VSTMidiEventList.h:127
@ plugInOpcodeCloseEditor
Definition juce_VSTMidiEventList.h:112
@ plugInOpcodeResumeSuspend
Definition juce_VSTMidiEventList.h:109
VstPlugInCategory
Definition juce_VSTMidiEventList.h:214
@ kPlugCategMastering
Definition juce_VSTMidiEventList.h:219
@ kPlugCategGenerator
Definition juce_VSTMidiEventList.h:226
@ kPlugCategSpacializer
Definition juce_VSTMidiEventList.h:220
@ kPlugCategAnalysis
Definition juce_VSTMidiEventList.h:218
@ kPlugCategEffect
Definition juce_VSTMidiEventList.h:216
@ kPlugCategSynth
Definition juce_VSTMidiEventList.h:217
@ kPlugCategRoomFx
Definition juce_VSTMidiEventList.h:221
@ kPlugCategUnknown
Definition juce_VSTMidiEventList.h:215
@ kPlugCategOfflineProcess
Definition juce_VSTMidiEventList.h:224
@ kPlugCategShell
Definition juce_VSTMidiEventList.h:225
@ kPlugSurroundFx
Definition juce_VSTMidiEventList.h:222
@ kPlugCategRestoration
Definition juce_VSTMidiEventList.h:223
@ vstProcessingSampleTypeFloat
Definition juce_VSTMidiEventList.h:206
@ vstProcessingSampleTypeDouble
Definition juce_VSTMidiEventList.h:207
@ vstSmpteRateFps30drop
Definition juce_VSTMidiEventList.h:394
@ vstSmpteRateFps239
Definition juce_VSTMidiEventList.h:399
@ vstSmpteRateFps249
Definition juce_VSTMidiEventList.h:400
@ vstSmpteRateFps599
Definition juce_VSTMidiEventList.h:401
@ vstSmpteRateFps25
Definition juce_VSTMidiEventList.h:390
@ vstSmpteRateFps60
Definition juce_VSTMidiEventList.h:402
@ vstSmpteRateFps2997
Definition juce_VSTMidiEventList.h:391
@ vstSmpteRateFps30
Definition juce_VSTMidiEventList.h:392
@ vstSmpteRateFps24
Definition juce_VSTMidiEventList.h:389
@ vstSmpteRateFps2997drop
Definition juce_VSTMidiEventList.h:393
const int32 juceVstInterfaceIdentifier
Definition juce_VSTMidiEventList.h:50
pointer_sized_int(VSTINTERFACECALL * VstHostCallback)(VstEffectInterface *, int32 op, int32 index, pointer_sized_int value, void *ptr, float opt)
Definition juce_VSTMidiEventList.h:84
@ vstPinInfoFlagValid
Definition juce_VSTMidiEventList.h:271
@ vstPinInfoFlagIsStereo
Definition juce_VSTMidiEventList.h:270
float mono(T v)
Convert a single value to single value = do nothing :) (but it's a generic with specialisation for st...
Definition primitives.h:219
T clip(T value, T min, T max)
Clip a value to [min, max].
Definition primitives.h:231
void initialise()
Definition hardgate.cpp:79
JOCTET * buffer
Definition juce_JPEGLoader.cpp:302
Definition carla_juce.cpp:31
CriticalSection::ScopedLockType ScopedLock
Definition juce_CriticalSection.h:186
void callOnMessageThread(Callback &&callback)
Definition juce_audio_processors.cpp:81
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
std::unique_ptr< XmlElement > parseXML(const String &textToParse)
Definition juce_XmlDocument.cpp:41
void ignoreUnused(Types &&...) noexcept
Definition juce_MathsFunctions.h:333
Type * addBytesToPointer(Type *basePointer, IntegerType bytes) noexcept
Definition juce_Memory.h:111
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Definition juce_MathsFunctions.h:279
int pointer_sized_int
Definition juce_MathsFunctions.h:80
unsigned int pointer_sized_uint
Definition juce_MathsFunctions.h:82
@ window
Definition juce_AccessibilityRole.h:63
@ label
Definition juce_AccessibilityRole.h:44
@ group
Definition juce_AccessibilityRole.h:61
constexpr int numElementsInArray(Type(&)[N]) noexcept
Definition juce_MathsFunctions.h:344
void add(SampleFrame *dst, const SampleFrame *src, int frames)
Add samples from src to dst.
Definition MixHelpers.cpp:135
Base
Definition PathUtil.h:34
auto getText(std::string_view name) -> QString
Definition embed.cpp:125
QPoint position(const QDropEvent *de)
position is a backwards-compatible adapter for QDropEvent::position and pos functions.
Definition DeprecationHelper.h:47
osc_element< 1, rtMsg< Types... > >::type second(rtMsg< Types... > &Tuple)
Definition typed-message.h:159
osc_element< 0, rtMsg< Types... > >::type first(rtMsg< Types... > &Tuple)
Definition typed-message.h:152
bool isPlugin
Definition Util.cpp:41
png_uint_32 length
Definition png.c:2247
int16 lower
Definition juce_VSTMidiEventList.h:238
int16 upper
Definition juce_VSTMidiEventList.h:236
int16 rightmost
Definition juce_VSTMidiEventList.h:239
int16 leftmost
Definition juce_VSTMidiEventList.h:237
int32 interfaceIdentifier
Definition juce_VSTMidiEventList.h:59
int32 plugInVersion
Definition juce_VSTMidiEventList.h:78
int32 numInputChannels
Definition juce_VSTMidiEventList.h:66
int32 flags
Definition juce_VSTMidiEventList.h:68
pointer_sized_int hostSpace2
Definition juce_VSTMidiEventList.h:70
int32 numOutputChannels
Definition juce_VSTMidiEventList.h:67
void * effectPointer
Definition juce_VSTMidiEventList.h:75
int32 flags
Definition juce_VSTMidiEventList.h:261
char text[vstMaxParameterOrPinLabelLength]
Definition juce_VSTMidiEventList.h:260
int32 configurationType
Definition juce_VSTMidiEventList.h:262
#define CallWindowProc(A, B, C, D, E)
const char * text
Definition swell-functions.h:167
RECT const char void(* callback)(const char *droppath))) SWELL_API_DEFINE(BOOL
Definition swell-functions.h:1004
#define timeGetTime()
Definition swell-functions.h:83
bool GetWindowRect(HWND hwnd, RECT *r)
Definition swell-generic-headless.cpp:130
LONG_PTR LRESULT
Definition swell-types.h:171
unsigned int UINT
Definition swell-types.h:166
LONG_PTR LPARAM
Definition swell-types.h:170
intptr_t LONG_PTR
Definition swell-types.h:42
ULONG_PTR WPARAM
Definition swell-types.h:169
LRESULT(* WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition swell-types.h:587
struct HWND__ * HWND
Definition swell-types.h:210
#define CALLBACK
Definition swell-types.h:635
#define MAKEINTRESOURCE(x)
Definition swell-types.h:1157
LRESULT DefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition swell-wnd-generic.cpp:7223
LRESULT SendMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition swell-wnd-generic.cpp:315
HWND GetWindow(HWND hwnd, int what)
Definition swell-wnd-generic.cpp:737
void SetWindowPos(HWND hwnd, HWND zorder, int x, int y, int cx, int cy, int flags)
Definition swell-wnd-generic.cpp:637
bool IsWindow(HWND hwnd)
Definition swell-wnd-generic.cpp:289
int n
Definition crypt.c:458
uch * p
Definition crypt.c:594
int r
Definition crypt.c:458
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
int result
Definition process.c:1455
int flag
Definition unix.c:754
static ZCONST char Far None[]
Definition unzip.c:380
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396
struct zdirent * file
Definition win32.c:1500
_WDL_CSTRING_PREFIX void INT_PTR const char * format
Definition wdlcstring.h:263
#define GetWindowLongPtr(a, b)
Definition wdltypes.h:63
#define SetWindowLongPtr(a, b, c)
Definition wdltypes.h:62
#define GWLP_WNDPROC
Definition wdltypes.h:56
#define const
Definition zconf.h:137