Initial release

This commit is contained in:
civ
2026-08-16 18:24:52 +07:00
commit 876886a39a
13244 changed files with 2353959 additions and 0 deletions
@@ -0,0 +1,18 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "pluginterfaces/base/funknown.h"
#include "pluginterfaces/vst/vsttypes.h"
namespace Steinberg::Vst {
//------------------------------------------------------------------------
static const Steinberg::FUID kVST3AUPlugInProcessorUID (0x301DF339, 0xAFA3533F, 0xB5053B1B, 0x41367137);
static const Steinberg::FUID kVST3AUPlugInControllerUID (0x473E512F, 0x68875B49, 0xB2EEFB2D, 0x886C33C6);
#define VST3AUPlugInVST3Category "Fx"
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,82 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#include "controller.h"
#include "cids.h"
#include "vstgui/plugin-bindings/vst3editor.h"
using namespace Steinberg;
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInController Implementation
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::initialize (FUnknown* context)
{
// Here the Plug-in will be instantiated
//---do not forget to call parent ------
tresult result = EditControllerEx1::initialize (context);
if (result != kResultOk)
{
return result;
}
// Here you could register some parameters
return result;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::terminate ()
{
// Here the Plug-in will be de-instantiated, last possibility to remove some memory!
//---do not forget to call parent ------
return EditControllerEx1::terminate ();
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::setComponentState (IBStream* state)
{
// Here you get the state of the component (Processor part)
if (!state)
return kResultFalse;
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::setState (IBStream* state)
{
// Here you get the state of the controller
return kResultTrue;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::getState (IBStream* state)
{
// Here you are asked to deliver the state of the controller (if needed)
// Note: the real state of your plug-in is saved in the processor
return kResultTrue;
}
//------------------------------------------------------------------------
IPlugView* PLUGIN_API VST3AUPlugInController::createView (FIDString name)
{
// Here the Host wants to open your editor (if you have one)
if (FIDStringsEqual (name, Vst::ViewType::kEditor))
{
// create your editor here and return a IPlugView ptr of it
auto* view = new VSTGUI::VST3Editor (this, "view", "editor.uidesc");
return view;
}
return nullptr;
}
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,49 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "public.sdk/source/vst/vsteditcontroller.h"
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInController
//------------------------------------------------------------------------
class VST3AUPlugInController : public Steinberg::Vst::EditControllerEx1
{
public:
//------------------------------------------------------------------------
VST3AUPlugInController () = default;
~VST3AUPlugInController () SMTG_OVERRIDE = default;
// Create function
static Steinberg::FUnknown* createInstance (void* /*context*/)
{
return (Steinberg::Vst::IEditController*)new VST3AUPlugInController;
}
//--- from IPluginBase -----------------------------------------------
Steinberg::tresult PLUGIN_API initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API terminate () SMTG_OVERRIDE;
//--- from EditController --------------------------------------------
Steinberg::tresult PLUGIN_API setComponentState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::IPlugView* PLUGIN_API createView (Steinberg::FIDString name) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API setState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API getState (Steinberg::IBStream* state) SMTG_OVERRIDE;
//---Interface---------
DEFINE_INTERFACES
// Here you can add more supported VST3 interfaces
// DEF_INTERFACE (Vst::IXXX)
END_DEFINE_INTERFACES (EditController)
DELEGATE_REFCOUNT (EditController)
//------------------------------------------------------------------------
protected:
};
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,50 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#include "processor.h"
#include "controller.h"
#include "cids.h"
#include "version.h"
#include "public.sdk/source/main/pluginfactory.h"
#define stringPluginName "VST3 AU PlugIn"
using namespace Steinberg::Vst;
using namespace Steinberg::Vst;
//------------------------------------------------------------------------
// VST Plug-in Entry
//------------------------------------------------------------------------
BEGIN_FACTORY_DEF ("Steinberg Media Technologies",
"https://steinberg.net",
"mailto:info@steinberg.de")
//---First Plug-in included in this factory-------
// its kVstAudioEffectClass component
DEF_CLASS2 (INLINE_UID_FROM_FUID(kVST3AUPlugInProcessorUID),
PClassInfo::kManyInstances, // cardinality
kVstAudioEffectClass, // the component category (do not changed this)
stringPluginName, // here the Plug-in name (to be changed)
Vst::kDistributable, // means that component and controller could be distributed on different computers
VST3AUPlugInVST3Category, // Subcategory for this Plug-in (to be changed)
FULL_VERSION_STR, // Plug-in version (to be changed)
kVstVersionString, // the VST 3 SDK version (do not changed this, use always this define)
VST3AUPlugInProcessor::createInstance) // function pointer called when this component should be instantiated
// its kVstComponentControllerClass component
DEF_CLASS2 (INLINE_UID_FROM_FUID (kVST3AUPlugInControllerUID),
PClassInfo::kManyInstances, // cardinality
kVstComponentControllerClass,// the Controller category (do not changed this)
stringPluginName "Controller", // controller name (could be the same than component name)
0, // not used here
"", // not used here
FULL_VERSION_STR, // Plug-in version (to be changed)
kVstVersionString, // the VST 3 SDK version (do not changed this, use always this define)
VST3AUPlugInController::createInstance)// function pointer called when this component should be instantiated
//----for others Plug-ins contained in this factory, put like for the first Plug-in different DEF_CLASS2---
END_FACTORY
@@ -0,0 +1,180 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#include "processor.h"
#include "cids.h"
#include "base/source/fstreamer.h"
#include "pluginterfaces/vst/ivstparameterchanges.h"
using namespace Steinberg;
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInProcessor
//------------------------------------------------------------------------
VST3AUPlugInProcessor::VST3AUPlugInProcessor ()
{
//--- set the wanted controller for our processor
setControllerClass (kVST3AUPlugInControllerUID);
}
//------------------------------------------------------------------------
VST3AUPlugInProcessor::~VST3AUPlugInProcessor ()
{}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::initialize (FUnknown* context)
{
// Here the Plug-in will be instantiated
//---always initialize the parent-------
tresult result = AudioEffect::initialize (context);
// if everything Ok, continue
if (result != kResultOk)
{
return result;
}
//--- create Audio IO ------
addAudioInput (STR16 ("Stereo In"), Steinberg::Vst::SpeakerArr::kStereo);
addAudioOutput (STR16 ("Stereo Out"), Steinberg::Vst::SpeakerArr::kStereo);
/* If you don't need an event bus, you can remove the next line */
addEventInput (STR16 ("Event In"), 1);
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::terminate ()
{
// Here the Plug-in will be de-instantiated, last possibility to remove some memory!
//---do not forget to call parent ------
return AudioEffect::terminate ();
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::setActive (TBool state)
{
//--- called when the Plug-in is enable/disable (On/Off) -----
return AudioEffect::setActive (state);
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::process (Vst::ProcessData& data)
{
//--- First : Read inputs parameter changes-----------
/*if (data.inputParameterChanges)
{
int32 numParamsChanged = data.inputParameterChanges->getParameterCount ();
for (int32 index = 0; index < numParamsChanged; index++)
{
if (auto* paramQueue = data.inputParameterChanges->getParameterData (index))
{
Vst::ParamValue value;
int32 sampleOffset;
int32 numPoints = paramQueue->getPointCount ();
switch (paramQueue->getParameterId ())
{
}
}
}
}*/
//--- Here you have to implement your processing
if (data.numSamples > 0)
{
//--- ------------------------------------------
// here as example a default implementation where we try to copy the inputs to the outputs:
// if less input than outputs then clear outputs
//--- ------------------------------------------
int32 minBus = std::min (data.numInputs, data.numOutputs);
for (int32 i = 0; i < minBus; i++)
{
int32 minChan = std::min (data.inputs[i].numChannels, data.outputs[i].numChannels);
for (int32 c = 0; c < minChan; c++)
{
// do not need to be copied if the buffers are the same
if (data.outputs[i].channelBuffers32[c] != data.inputs[i].channelBuffers32[c])
{
memcpy (data.outputs[i].channelBuffers32[c], data.inputs[i].channelBuffers32[c],
data.numSamples * sizeof (Vst::Sample32));
}
}
data.outputs[i].silenceFlags = data.inputs[i].silenceFlags;
// clear the remaining output buffers
for (int32 c = minChan; c < data.outputs[i].numChannels; c++)
{
// clear output buffers
memset (data.outputs[i].channelBuffers32[c], 0,
data.numSamples * sizeof (Vst::Sample32));
// inform the host that this channel is silent
data.outputs[i].silenceFlags |= ((uint64)1 << c);
}
}
// clear the remaining output buffers
for (int32 i = minBus; i < data.numOutputs; i++)
{
// clear output buffers
for (int32 c = 0; c < data.outputs[i].numChannels; c++)
{
memset (data.outputs[i].channelBuffers32[c], 0,
data.numSamples * sizeof (Vst::Sample32));
}
// inform the host that this bus is silent
data.outputs[i].silenceFlags = ((uint64)1 << data.outputs[i].numChannels) - 1;
}
}
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::setupProcessing (Vst::ProcessSetup& newSetup)
{
//--- called before any processing ----
return AudioEffect::setupProcessing (newSetup);
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::canProcessSampleSize (int32 symbolicSampleSize)
{
// by default kSample32 is supported
if (symbolicSampleSize == Vst::kSample32)
return kResultTrue;
// disable the following comment if your processing support kSample64
/* if (symbolicSampleSize == Vst::kSample64)
return kResultTrue; */
return kResultFalse;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::setState (IBStream* state)
{
// called when we load a preset, the model has to be reloaded
IBStreamer streamer (state, kLittleEndian);
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::getState (IBStream* state)
{
// here we need to save the model
IBStreamer streamer (state, kLittleEndian);
return kResultOk;
}
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,57 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "public.sdk/source/vst/vstaudioeffect.h"
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInProcessor
//------------------------------------------------------------------------
class VST3AUPlugInProcessor : public Steinberg::Vst::AudioEffect
{
public:
VST3AUPlugInProcessor ();
~VST3AUPlugInProcessor () SMTG_OVERRIDE;
// Create function
static Steinberg::FUnknown* createInstance (void* /*context*/)
{
return (Steinberg::Vst::IAudioProcessor*)new VST3AUPlugInProcessor;
}
//--- ---------------------------------------------------------------------
// AudioEffect overrides:
//--- ---------------------------------------------------------------------
/** Called at first after constructor */
Steinberg::tresult PLUGIN_API initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE;
/** Called at the end before destructor */
Steinberg::tresult PLUGIN_API terminate () SMTG_OVERRIDE;
/** Switch the Plug-in on/off */
Steinberg::tresult PLUGIN_API setActive (Steinberg::TBool state) SMTG_OVERRIDE;
/** Will be called before any process call */
Steinberg::tresult PLUGIN_API setupProcessing (Steinberg::Vst::ProcessSetup& newSetup) SMTG_OVERRIDE;
/** Asks if a given sample size is supported see SymbolicSampleSizes. */
Steinberg::tresult PLUGIN_API canProcessSampleSize (Steinberg::int32 symbolicSampleSize) SMTG_OVERRIDE;
/** Here we go...the process call */
Steinberg::tresult PLUGIN_API process (Steinberg::Vst::ProcessData& data) SMTG_OVERRIDE;
/** For persistence */
Steinberg::tresult PLUGIN_API setState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API getState (Steinberg::IBStream* state) SMTG_OVERRIDE;
//------------------------------------------------------------------------
protected:
};
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,20 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "pluginterfaces/base/fplatform.h"
// Plain project version file generated by cmake
#include "projectversion.h"
#define stringOriginalFilename "VST3 AU PlugIn.vst3"
#if SMTG_PLATFORM_64
#define stringFileDescription "VST3 AU PlugIn VST3 (64Bit)"
#else
#define stringFileDescription "VST3 AU PlugIn VST3"
#endif
#define stringCompanyName "Steinberg Media Technologies\0"
#define stringLegalCopyright "Copyright(c) 2024 Steinberg Media Technologies."
#define stringLegalTrademarks "VST is a trademark of Steinberg Media Technologies GmbH"