- updated
git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@117 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+94
-56
@@ -364,7 +364,6 @@ class VST3HostContext : public Vst::IComponentHandler, // From VST V3.0.0
|
||||
public Vst::IComponentHandler3, // From VST V3.5.0 (also very well named!)
|
||||
public Vst::IContextMenuTarget,
|
||||
public Vst::IHostApplication,
|
||||
public Vst::IParamValueQueue,
|
||||
public Vst::IUnitHandler
|
||||
{
|
||||
public:
|
||||
@@ -684,31 +683,6 @@ public:
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Vst::ParamID PLUGIN_API getParameterId() override
|
||||
{
|
||||
jassertfalse;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Steinberg::int32 PLUGIN_API getPointCount() override
|
||||
{
|
||||
jassertfalse;
|
||||
return 0;
|
||||
}
|
||||
|
||||
tresult PLUGIN_API getPoint (Steinberg::int32, Steinberg::int32&, Vst::ParamValue&) override
|
||||
{
|
||||
jassertfalse;
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
tresult PLUGIN_API addPoint (Steinberg::int32, Vst::ParamValue, Steinberg::int32&) override
|
||||
{
|
||||
jassertfalse;
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
tresult PLUGIN_API notifyUnitSelection (Vst::UnitID) override
|
||||
{
|
||||
@@ -736,7 +710,6 @@ public:
|
||||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IComponentHandler3)
|
||||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IContextMenuTarget)
|
||||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IHostApplication)
|
||||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IParamValueQueue)
|
||||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IUnitHandler)
|
||||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (iid, FUnknown, Vst::IComponentHandler)
|
||||
|
||||
@@ -2052,6 +2025,100 @@ public:
|
||||
(void) sizeInBytes;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
// NB: this class and its subclasses must be public to avoid problems in
|
||||
// DLL builds under MSVC.
|
||||
class ParameterChangeList : public Vst::IParameterChanges
|
||||
{
|
||||
public:
|
||||
ParameterChangeList() {}
|
||||
virtual ~ParameterChangeList() {}
|
||||
|
||||
JUCE_DECLARE_VST3_COM_REF_METHODS
|
||||
JUCE_DECLARE_VST3_COM_QUERY_METHODS
|
||||
|
||||
Steinberg::int32 PLUGIN_API getParameterCount() override { return (Steinberg::int32) queues.size(); }
|
||||
Vst::IParamValueQueue* PLUGIN_API getParameterData (Steinberg::int32 index) override { return queues[(int) index]; }
|
||||
|
||||
Vst::IParamValueQueue* PLUGIN_API addParameterData (const Vst::ParamID& id, Steinberg::int32& index) override
|
||||
{
|
||||
for (int i = queues.size(); --i >= 0;)
|
||||
{
|
||||
if (queues.getUnchecked (i)->getParameterId() == id)
|
||||
{
|
||||
index = (Steinberg::int32) i;
|
||||
return queues.getUnchecked (i);
|
||||
}
|
||||
}
|
||||
|
||||
ParamValueQueue* q = queues.add (new ParamValueQueue (id));
|
||||
index = getParameterCount() - 1;
|
||||
return q;
|
||||
}
|
||||
|
||||
struct ParamValueQueue : public Vst::IParamValueQueue
|
||||
{
|
||||
ParamValueQueue (Vst::ParamID parameterID) : paramID (parameterID)
|
||||
{
|
||||
points.ensureStorageAllocated (1024);
|
||||
}
|
||||
|
||||
virtual ~ParamValueQueue() {}
|
||||
|
||||
JUCE_DECLARE_VST3_COM_REF_METHODS
|
||||
JUCE_DECLARE_VST3_COM_QUERY_METHODS
|
||||
|
||||
Steinberg::Vst::ParamID PLUGIN_API getParameterId() override { return paramID; }
|
||||
Steinberg::int32 PLUGIN_API getPointCount() override { return (Steinberg::int32) points.size(); }
|
||||
|
||||
Steinberg::tresult PLUGIN_API getPoint (Steinberg::int32 index,
|
||||
Steinberg::int32& sampleOffset,
|
||||
Steinberg::Vst::ParamValue& value) override
|
||||
{
|
||||
if (isPositiveAndBelow ((int) index, points.size()))
|
||||
{
|
||||
ParamPoint e (points.getUnchecked ((int) index));
|
||||
sampleOffset = e.sampleOffset;
|
||||
value = e.value;
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
sampleOffset = -1;
|
||||
value = 0.0;
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
Steinberg::tresult PLUGIN_API addPoint (Steinberg::int32 sampleOffset,
|
||||
Steinberg::Vst::ParamValue value,
|
||||
Steinberg::int32& index) override
|
||||
{
|
||||
// XXX this may need to be made thread-safe..
|
||||
ParamPoint p = { sampleOffset, value };
|
||||
points.add (p);
|
||||
index = (Steinberg::int32) points.size();
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
private:
|
||||
struct ParamPoint
|
||||
{
|
||||
Steinberg::int32 sampleOffset;
|
||||
Steinberg::Vst::ParamValue value;
|
||||
};
|
||||
|
||||
Atomic<int> refCount;
|
||||
const Vst::ParamID paramID;
|
||||
Array<ParamPoint> points;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParamValueQueue)
|
||||
};
|
||||
|
||||
Atomic<int> refCount;
|
||||
OwnedArray<ParamValueQueue> queues;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParameterChangeList)
|
||||
};
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
VST3ModuleHandle::Ptr module;
|
||||
@@ -2122,35 +2189,6 @@ private:
|
||||
return stream;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class ParameterChangeList : public Vst::IParameterChanges
|
||||
{
|
||||
public:
|
||||
ParameterChangeList() {}
|
||||
virtual ~ParameterChangeList() {}
|
||||
|
||||
JUCE_DECLARE_VST3_COM_REF_METHODS
|
||||
JUCE_DECLARE_VST3_COM_QUERY_METHODS
|
||||
|
||||
Steinberg::int32 PLUGIN_API getParameterCount() override { return 0; }
|
||||
|
||||
Vst::IParamValueQueue* PLUGIN_API getParameterData (Steinberg::int32) override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Vst::IParamValueQueue* PLUGIN_API addParameterData (const Vst::ParamID&, Steinberg::int32& index) override
|
||||
{
|
||||
index = 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
Atomic<int> refCount;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParameterChangeList)
|
||||
};
|
||||
|
||||
ComSmartPtr<ParameterChangeList> inputParameterChanges, outputParameterChanges;
|
||||
ComSmartPtr<MidiEventList> midiInputs, midiOutputs;
|
||||
Vst::ProcessContext timingInfo; //< Only use this in processBlock()!
|
||||
|
||||
+19
-12
@@ -135,7 +135,14 @@ namespace
|
||||
char chunk[8]; // variable
|
||||
};
|
||||
|
||||
static VstInt32 fxbName (const char* name) noexcept { return (VstInt32) ByteOrder::bigEndianInt (name); }
|
||||
// Compares a magic value in either endianness.
|
||||
static bool compareMagic (VstInt32 magic, const char* name) noexcept
|
||||
{
|
||||
return magic == (VstInt32) ByteOrder::littleEndianInt (name)
|
||||
|| magic == (VstInt32) ByteOrder::bigEndianInt (name);
|
||||
}
|
||||
|
||||
static VstInt32 fxbName (const char* name) noexcept { return (VstInt32) ByteOrder::littleEndianInt (name); }
|
||||
static VstInt32 fxbSwap (const VstInt32 x) noexcept { return (VstInt32) ByteOrder::swapIfLittleEndian ((uint32) x); }
|
||||
|
||||
static float fxbSwapFloat (const float x) noexcept
|
||||
@@ -1013,12 +1020,12 @@ public:
|
||||
if (position.isLooping)
|
||||
{
|
||||
vstHostTime.cycleStartPos = position.ppqLoopStart;
|
||||
vstHostTime.cycleEndPos = position.ppqLoopEnd;
|
||||
vstHostTime.flags |= kVstCyclePosValid;
|
||||
vstHostTime.cycleEndPos = position.ppqLoopEnd;
|
||||
vstHostTime.flags |= (kVstCyclePosValid | kVstTransportCycleActive);
|
||||
}
|
||||
else
|
||||
{
|
||||
vstHostTime.flags &= ~kVstCyclePosValid;
|
||||
vstHostTime.flags &= ~(kVstCyclePosValid | kVstTransportCycleActive);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1432,11 +1439,10 @@ public:
|
||||
|
||||
const fxSet* const set = (const fxSet*) data;
|
||||
|
||||
if ((set->chunkMagic != fxbName ("CcnK") && set->chunkMagic != fxbName ("KncC"))
|
||||
|| fxbSwap (set->version) > fxbVersionNum)
|
||||
if ((! compareMagic (set->chunkMagic, "CcnK")) || fxbSwap (set->version) > fxbVersionNum)
|
||||
return false;
|
||||
|
||||
if (set->fxMagic == fxbName ("FxBk"))
|
||||
if (compareMagic (set->fxMagic, "FxBk"))
|
||||
{
|
||||
// bank of programs
|
||||
if (fxbSwap (set->numPrograms) >= 0)
|
||||
@@ -1472,12 +1478,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (set->fxMagic == fxbName ("FxCk"))
|
||||
else if (compareMagic (set->fxMagic, "FxCk"))
|
||||
{
|
||||
// single program
|
||||
const fxProgram* const prog = (const fxProgram*) data;
|
||||
|
||||
if (prog->chunkMagic != fxbName ("CcnK"))
|
||||
if (! compareMagic (prog->chunkMagic, "CcnK"))
|
||||
return false;
|
||||
|
||||
changeProgramName (getCurrentProgram(), prog->prgName);
|
||||
@@ -1485,7 +1491,7 @@ public:
|
||||
for (int i = 0; i < fxbSwap (prog->numParams); ++i)
|
||||
setParameter (i, fxbSwapFloat (prog->params[i]));
|
||||
}
|
||||
else if (set->fxMagic == fxbName ("FBCh") || set->fxMagic == fxbName ("hCBF"))
|
||||
else if (compareMagic (set->fxMagic, "FBCh"))
|
||||
{
|
||||
// non-preset chunk
|
||||
const fxChunkSet* const cset = (const fxChunkSet*) data;
|
||||
@@ -1495,7 +1501,7 @@ public:
|
||||
|
||||
setChunkData (cset->chunk, fxbSwap (cset->chunkSize), false);
|
||||
}
|
||||
else if (set->fxMagic == fxbName ("FPCh") || set->fxMagic == fxbName ("hCPF"))
|
||||
else if (compareMagic (set->fxMagic, "FPCh"))
|
||||
{
|
||||
// preset chunk
|
||||
const fxProgramSet* const cset = (const fxProgramSet*) data;
|
||||
@@ -1671,7 +1677,8 @@ private:
|
||||
|
||||
bool restoreProgramSettings (const fxProgram* const prog)
|
||||
{
|
||||
if (prog->chunkMagic == fxbName ("CcnK") && prog->fxMagic == fxbName ("FxCk"))
|
||||
if (compareMagic (prog->chunkMagic, "CcnK")
|
||||
&& compareMagic (prog->fxMagic, "FxCk"))
|
||||
{
|
||||
changeProgramName (getCurrentProgram(), prog->prgName);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "juce_audio_processors",
|
||||
"name": "JUCE audio plugin hosting classes",
|
||||
"version": "3.0.8",
|
||||
"version": "3.1.1",
|
||||
"description": "Classes for loading and playing VST, AU, or internally-generated audio processors.",
|
||||
"website": "http://www.juce.com/juce",
|
||||
"license": "GPL/Commercial",
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ public:
|
||||
if (paramHasChanged)
|
||||
{
|
||||
refresh();
|
||||
startTimer (1000 / 50);
|
||||
startTimerHz (50);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user