Initial release
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.25.0)
|
||||
|
||||
project(smtg-vst3-adelay
|
||||
VERSION ${vstsdk_VERSION}.0
|
||||
DESCRIPTION "Steinberg VST 3 ADelay example"
|
||||
)
|
||||
|
||||
smtg_add_vst3plugin(adelay
|
||||
source/adelaycontroller.cpp
|
||||
source/adelaycontroller.h
|
||||
source/adelayids.h
|
||||
source/adelayprocessor.cpp
|
||||
source/adelayprocessor.h
|
||||
source/exampletest.cpp
|
||||
source/factory.cpp
|
||||
source/version.h
|
||||
${SDK_ROOT}/public.sdk/source/vst/utility/test/ringbuffertest.cpp
|
||||
${SDK_ROOT}/public.sdk/source/vst/utility/test/versionparsertest.cpp
|
||||
)
|
||||
|
||||
smtg_target_setup_as_vst3_example(adelay)
|
||||
@@ -0,0 +1,18 @@
|
||||
# ADelay
|
||||
|
||||
## Introduction
|
||||
|
||||
**ADelay** is a simple FX plug-in with just one parameter for delay control.
|
||||
|
||||
> See also: [Online Documentation](https://steinbergmedia.github.io/vst3_dev_portal/pages/What+is+the+VST+3+SDK/Plug-in+Examples.html#adelay).
|
||||
|
||||
## Getting Started
|
||||
|
||||
This plug-in is part of the VST 3 SDK package. It is created with the VST 3 SDK root project.
|
||||
|
||||
> See the top-level README of the VST 3 SDK: https://github.com/steinbergmedia/vst3sdk.git
|
||||
|
||||
## Getting Help
|
||||
|
||||
* Read through the SDK documentation on the **[VST 3 Developer Portal](https://steinbergmedia.github.io/vst3_dev_portal/pages/index.html)**
|
||||
* Ask some real people in the official **[VST 3 Developer Forum](https://forums.steinberg.net/c/developer/103)**
|
||||
@@ -0,0 +1,45 @@
|
||||
#include <windows.h>
|
||||
#include "../source/version.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Version
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION MAJOR_VERSION_INT,SUB_VERSION_INT,RELEASE_NUMBER_INT,BUILD_NUMBER_INT
|
||||
PRODUCTVERSION MAJOR_VERSION_INT,SUB_VERSION_INT,RELEASE_NUMBER_INT,BUILD_NUMBER_INT
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040004e4"
|
||||
BEGIN
|
||||
VALUE "FileVersion", FULL_VERSION_STR
|
||||
VALUE "ProductVersion", FULL_VERSION_STR
|
||||
VALUE "OriginalFilename", stringOriginalFilename
|
||||
VALUE "FileDescription", stringFileDescription
|
||||
VALUE "InternalName", stringFileDescription
|
||||
VALUE "ProductName", stringFileDescription
|
||||
VALUE "CompanyName", stringCompanyName
|
||||
VALUE "LegalCopyright", stringLegalCopyright
|
||||
VALUE "LegalTrademarks", stringLegalTrademarks
|
||||
//VALUE "PrivateBuild", " \0"
|
||||
//VALUE "SpecialBuild", " \0"
|
||||
//VALUE "Comments", " \0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x400, 1252
|
||||
END
|
||||
END
|
||||
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/adelaycontroller.cpp
|
||||
// Created by : Steinberg, 06/2009
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "adelaycontroller.h"
|
||||
#include "adelayids.h"
|
||||
#include "pluginterfaces/base/ibstream.h"
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#include "interappaudio/iosEditor.h"
|
||||
#endif
|
||||
#include "base/source/fstreamer.h"
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
DEF_CLASS_IID (IDelayTestController)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayController::initialize (FUnknown* context)
|
||||
{
|
||||
tresult result = EditController::initialize (context);
|
||||
if (result == kResultTrue)
|
||||
{
|
||||
parameters.addParameter (STR16 ("Bypass"), nullptr, 1, 0, ParameterInfo::kCanAutomate|ParameterInfo::kIsBypass, kBypassId);
|
||||
|
||||
parameters.addParameter (STR16 ("Delay"), STR16 ("sec"), 0, 1, ParameterInfo::kCanAutomate, kDelayId);
|
||||
}
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
//-----------------------------------------------------------------------------
|
||||
IPlugView* PLUGIN_API ADelayController::createView (FIDString name)
|
||||
{
|
||||
if (FIDStringsEqual (name, ViewType::kEditor))
|
||||
{
|
||||
return new ADelayEditorForIOS (this);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayController::setComponentState (IBStream* state)
|
||||
{
|
||||
// we receive the current state of the component (processor part)
|
||||
// we read only the gain and bypass value...
|
||||
if (!state)
|
||||
return kResultFalse;
|
||||
|
||||
IBStreamer streamer (state, kLittleEndian);
|
||||
float savedDelay = 0.f;
|
||||
if (streamer.readFloat (savedDelay) == false)
|
||||
return kResultFalse;
|
||||
setParamNormalized (kDelayId, static_cast<ParamValue> (savedDelay));
|
||||
|
||||
int32 bypassState = 0;
|
||||
if (streamer.readInt32 (bypassState) == false)
|
||||
{
|
||||
// could be an old version, continue
|
||||
}
|
||||
setParamNormalized (kBypassId, bypassState ? 1 : 0);
|
||||
|
||||
return kResultOk;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool PLUGIN_API ADelayController::doTest ()
|
||||
{
|
||||
// this is called when running thru the validator
|
||||
// we can now run our own test cases
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/adelaycontroller.h
|
||||
// Created by : Steinberg, 06/2009
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "public.sdk/source/vst/vsteditcontroller.h"
|
||||
|
||||
#if SMTG_OS_MACOS
|
||||
#include <TargetConditionals.h>
|
||||
#endif
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
class IDelayTestController : public FUnknown
|
||||
{
|
||||
public:
|
||||
virtual bool PLUGIN_API doTest () = 0;
|
||||
//------------------------------------------------------------------------
|
||||
static const FUID iid;
|
||||
};
|
||||
|
||||
DECLARE_CLASS_IID (IDelayTestController, 0x9FC98F39, 0x27234512, 0x84FBC4AD, 0x618A14FD)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class ADelayController : public EditController, public IDelayTestController
|
||||
{
|
||||
public:
|
||||
//------------------------------------------------------------------------
|
||||
// create function required for plug-in factory,
|
||||
// it will be called to create new instances of this controller
|
||||
//------------------------------------------------------------------------
|
||||
static FUnknown* createInstance (void*) { return (IEditController*)new ADelayController (); }
|
||||
|
||||
//---from IPluginBase--------
|
||||
tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE;
|
||||
|
||||
//---from EditController-----
|
||||
#if TARGET_OS_IPHONE
|
||||
IPlugView* PLUGIN_API createView (FIDString name) SMTG_OVERRIDE;
|
||||
#endif
|
||||
tresult PLUGIN_API setComponentState (IBStream* state) SMTG_OVERRIDE;
|
||||
|
||||
bool PLUGIN_API doTest () SMTG_OVERRIDE;
|
||||
|
||||
//---Interface---------
|
||||
OBJ_METHODS (ADelayController, EditController)
|
||||
DEFINE_INTERFACES
|
||||
DEF_INTERFACE (IDelayTestController)
|
||||
END_DEFINE_INTERFACES (EditController)
|
||||
REFCOUNT_METHODS (EditController)
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
@@ -0,0 +1,34 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/adelayids.h
|
||||
// Created by : Steinberg, 06/2009
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
// parameter tags
|
||||
enum {
|
||||
kDelayId = 100,
|
||||
kBypassId = 101
|
||||
};
|
||||
|
||||
// unique class ids
|
||||
static DECLARE_UID (ADelayProcessorUID, 0x0CDBB669, 0x85D548A9, 0xBFD83719, 0x09D24BB3);
|
||||
static DECLARE_UID (ADelayControllerUID, 0x038E7FA9, 0x629A4EAA, 0x8541B889, 0x18E8952C);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
+226
@@ -0,0 +1,226 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/adelayprocessor.cpp
|
||||
// Created by : Steinberg, 06/2009
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "adelayprocessor.h"
|
||||
#include "adelayids.h"
|
||||
#include "base/source/fstreamer.h"
|
||||
#include "pluginterfaces/base/ibstream.h"
|
||||
#include "pluginterfaces/vst/ivstparameterchanges.h"
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
ADelayProcessor::ADelayProcessor ()
|
||||
{
|
||||
setControllerClass (FUID::fromTUID (ADelayControllerUID));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayProcessor::initialize (FUnknown* context)
|
||||
{
|
||||
tresult result = AudioEffect::initialize (context);
|
||||
if (result == kResultTrue)
|
||||
{
|
||||
addAudioInput (STR16 ("AudioInput"), SpeakerArr::kStereo);
|
||||
addAudioOutput (STR16 ("AudioOutput"), SpeakerArr::kStereo);
|
||||
mNumChannels = 2;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayProcessor::setBusArrangements (SpeakerArrangement* inputs, int32 numIns,
|
||||
SpeakerArrangement* outputs, int32 numOuts)
|
||||
{
|
||||
// we only support one in and output bus and these busses must have the same number of channels
|
||||
if (numIns == 1 && numOuts == 1 && inputs[0] == outputs[0])
|
||||
{
|
||||
tresult res = AudioEffect::setBusArrangements (inputs, numIns, outputs, numOuts);
|
||||
if (res == kResultOk)
|
||||
mNumChannels = SpeakerArr::getChannelCount (outputs[0]);
|
||||
return res;
|
||||
}
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool ADelayProcessor::resetDelay ()
|
||||
{
|
||||
if (!mBuffer)
|
||||
return false;
|
||||
|
||||
size_t size = static_cast<size_t> (processSetup.sampleRate * sizeof (float) + 0.5);
|
||||
for (int32 channel = 0; channel < mNumChannels; channel++)
|
||||
{
|
||||
if (mBuffer[channel])
|
||||
memset (mBuffer[channel], 0, size);
|
||||
}
|
||||
mBufferPos = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayProcessor::setActive (TBool state)
|
||||
{
|
||||
if (mBuffer)
|
||||
{
|
||||
for (int32 channel = 0; channel < mNumChannels; channel++)
|
||||
{
|
||||
std::free (mBuffer[channel]);
|
||||
}
|
||||
std::free (mBuffer);
|
||||
mBuffer = nullptr;
|
||||
}
|
||||
|
||||
if (state)
|
||||
{
|
||||
mBuffer = (float**)std::malloc (mNumChannels * sizeof (float*));
|
||||
if (mBuffer)
|
||||
{
|
||||
size_t size = static_cast<size_t> (processSetup.sampleRate * sizeof (float) + 0.5);
|
||||
for (int32 channel = 0; channel < mNumChannels; channel++)
|
||||
{
|
||||
mBuffer[channel] = (float*)std::malloc (size); // 1 second delay max
|
||||
}
|
||||
resetDelay ();
|
||||
}
|
||||
}
|
||||
|
||||
return AudioEffect::setActive (state);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayProcessor::setProcessing (TBool state)
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
resetDelay ();
|
||||
}
|
||||
return kResultOk;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayProcessor::process (ProcessData& data)
|
||||
{
|
||||
if (data.inputParameterChanges)
|
||||
{
|
||||
int32 numParamsChanged = data.inputParameterChanges->getParameterCount ();
|
||||
for (int32 index = 0; index < numParamsChanged; index++)
|
||||
{
|
||||
if (IParamValueQueue* paramQueue = data.inputParameterChanges->getParameterData (index))
|
||||
{
|
||||
ParamValue value;
|
||||
int32 sampleOffset;
|
||||
int32 numPoints = paramQueue->getPointCount ();
|
||||
switch (paramQueue->getParameterId ())
|
||||
{
|
||||
case kDelayId:
|
||||
if (paramQueue->getPoint (numPoints - 1, sampleOffset, value) ==
|
||||
kResultTrue)
|
||||
mDelay = value;
|
||||
break;
|
||||
case kBypassId:
|
||||
if (paramQueue->getPoint (numPoints - 1, sampleOffset, value) ==
|
||||
kResultTrue)
|
||||
{
|
||||
mBypass = (value > 0.5f);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.numSamples > 0)
|
||||
{
|
||||
SpeakerArrangement arr;
|
||||
getBusArrangement (kOutput, 0, arr);
|
||||
int32 numChannels = SpeakerArr::getChannelCount (arr);
|
||||
|
||||
// TODO do something in Bypass : copy input to output if necessary...
|
||||
// you could use a BypassProcessor which is used in the SyncDelay example
|
||||
|
||||
// apply delay
|
||||
// we have a minimum of 1 sample delay here
|
||||
int32 delayInSamples = std::max<int32> (1, (int32) (mDelay * processSetup.sampleRate));
|
||||
for (int32 channel = 0; channel < numChannels; channel++)
|
||||
{
|
||||
float* inputChannel = data.inputs[0].channelBuffers32[channel];
|
||||
float* outputChannel = data.outputs[0].channelBuffers32[channel];
|
||||
|
||||
int32 tempBufferPos = mBufferPos;
|
||||
for (int32 sample = 0; sample < data.numSamples; sample++)
|
||||
{
|
||||
float tempSample = inputChannel[sample];
|
||||
outputChannel[sample] = mBuffer[channel][tempBufferPos];
|
||||
mBuffer[channel][tempBufferPos] = tempSample;
|
||||
tempBufferPos++;
|
||||
if (tempBufferPos >= delayInSamples)
|
||||
tempBufferPos = 0;
|
||||
}
|
||||
}
|
||||
mBufferPos += data.numSamples;
|
||||
while (delayInSamples && mBufferPos >= delayInSamples)
|
||||
mBufferPos -= delayInSamples;
|
||||
}
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayProcessor::setState (IBStream* state)
|
||||
{
|
||||
if (!state)
|
||||
return kResultFalse;
|
||||
|
||||
// called when we load a preset, the model has to be reloaded
|
||||
|
||||
IBStreamer streamer (state, kLittleEndian);
|
||||
float savedDelay = 0.f;
|
||||
if (streamer.readFloat (savedDelay) == false)
|
||||
return kResultFalse;
|
||||
|
||||
int32 savedBypass = 0;
|
||||
if (streamer.readInt32 (savedBypass) == false)
|
||||
{
|
||||
// could be an old version, continue
|
||||
}
|
||||
|
||||
mDelay = static_cast<ParamValue> (savedDelay);
|
||||
mBypass = savedBypass > 0;
|
||||
|
||||
return kResultOk;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayProcessor::getState (IBStream* state)
|
||||
{
|
||||
// here we need to save the model
|
||||
|
||||
IBStreamer streamer (state, kLittleEndian);
|
||||
|
||||
streamer.writeFloat (static_cast<float> (mDelay));
|
||||
streamer.writeInt32 (mBypass ? 1 : 0);
|
||||
|
||||
return kResultOk;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
@@ -0,0 +1,57 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/adelayprocessor.cpp
|
||||
// Created by : Steinberg, 06/2009
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "public.sdk/source/vst/vstaudioeffect.h"
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class ADelayProcessor : public AudioEffect
|
||||
{
|
||||
public:
|
||||
ADelayProcessor ();
|
||||
|
||||
tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE;
|
||||
tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns,
|
||||
SpeakerArrangement* outputs,
|
||||
int32 numOuts) SMTG_OVERRIDE;
|
||||
|
||||
tresult PLUGIN_API setActive (TBool state) SMTG_OVERRIDE;
|
||||
tresult PLUGIN_API setProcessing (TBool state) SMTG_OVERRIDE;
|
||||
tresult PLUGIN_API process (ProcessData& data) SMTG_OVERRIDE;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API setState (IBStream* state) SMTG_OVERRIDE;
|
||||
tresult PLUGIN_API getState (IBStream* state) SMTG_OVERRIDE;
|
||||
|
||||
static FUnknown* createInstance (void*) { return (IAudioProcessor*)new ADelayProcessor (); }
|
||||
|
||||
protected:
|
||||
bool resetDelay ();
|
||||
|
||||
ParamValue mDelay {1.};
|
||||
float** mBuffer {nullptr};
|
||||
int32 mBufferPos {0};
|
||||
int32 mNumChannels {0};
|
||||
bool mBypass {false};
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
@@ -0,0 +1,51 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/exampletest.cpp
|
||||
// Created by : Steinberg, 10/2010
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "adelaycontroller.h"
|
||||
#include "adelayprocessor.h"
|
||||
#include "base/source/fstring.h"
|
||||
#include "public.sdk/source/main/moduleinit.h"
|
||||
#include "public.sdk/source/vst/testsuite/vsttestsuite.h"
|
||||
#include "public.sdk/source/vst/utility/testing.h"
|
||||
#include "pluginterfaces/base/funknownimpl.h"
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
static ModuleInitializer InitTests ([] () {
|
||||
registerTest ("ExampleTest", nullptr, [] (FUnknown* context, ITestResult* testResult) {
|
||||
auto plugProvider = U::cast<ITestPlugProvider> (context);
|
||||
if (plugProvider)
|
||||
{
|
||||
auto controller = plugProvider->getController ();
|
||||
auto testController = U::cast<IDelayTestController> (controller);
|
||||
if (!controller)
|
||||
{
|
||||
testResult->addErrorMessage (String ("Unknown IEditController"));
|
||||
return false;
|
||||
}
|
||||
bool result = testController->doTest ();
|
||||
plugProvider->releasePlugIn (nullptr, controller);
|
||||
|
||||
return (result);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
}} // namespaces
|
||||
@@ -0,0 +1,60 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/factory.cpp
|
||||
// Created by : Steinberg, 06/2009
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "adelaycontroller.h"
|
||||
#include "adelayids.h"
|
||||
#include "adelayprocessor.h"
|
||||
#include "version.h" // for versioning
|
||||
#include "public.sdk/source/main/pluginfactory_constexpr.h"
|
||||
#include "public.sdk/source/vst/utility/testing.h"
|
||||
|
||||
#define stringPluginName "ADelay"
|
||||
|
||||
BEGIN_FACTORY_DEF (stringCompanyName, stringCompanyWeb, stringCompanyEmail, 3)
|
||||
|
||||
DEF_CLASS (Steinberg::Vst::ADelayProcessorUID, Steinberg::PClassInfo::kManyInstances,
|
||||
kVstAudioEffectClass,
|
||||
stringPluginName,
|
||||
Steinberg::Vst::kDistributable,
|
||||
"Fx|Delay",
|
||||
FULL_VERSION_STR, // Plug-in version (to be changed)
|
||||
kVstVersionString,
|
||||
Steinberg::Vst::ADelayProcessor::createInstance,
|
||||
nullptr)
|
||||
|
||||
DEF_CLASS (Steinberg::Vst::ADelayControllerUID, Steinberg::PClassInfo::kManyInstances,
|
||||
kVstComponentControllerClass,
|
||||
stringPluginName "Controller", // controller name (can be the same as the component name)
|
||||
0, // not used here
|
||||
"", // not used here
|
||||
FULL_VERSION_STR, // Plug-in version (to be changed)
|
||||
kVstVersionString,
|
||||
Steinberg::Vst::ADelayController::createInstance,
|
||||
nullptr)
|
||||
|
||||
// add Test Factory
|
||||
DEF_CLASS (Steinberg::Vst::TestFactoryUID,
|
||||
Steinberg::PClassInfo::kManyInstances,
|
||||
kTestClass,
|
||||
stringPluginName "Test Factory",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
Steinberg::Vst::createTestFactoryInstance,
|
||||
nullptr)
|
||||
|
||||
END_FACTORY
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="4488.2" systemVersion="12E55" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3715.3"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ADelayViewController">
|
||||
<connections>
|
||||
<outlet property="slider" destination="8qe-I8-OQ4" id="zbQ-xw-Cls"/>
|
||||
<outlet property="view" destination="1" id="cvV-er-vQe"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<slider opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="8qe-I8-OQ4">
|
||||
<rect key="frame" x="146" y="370" width="777" height="29"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<connections>
|
||||
<action selector="sliderChanged:" destination="-1" eventType="valueChanged" id="dXh-wG-NCY"/>
|
||||
</connections>
|
||||
</slider>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="blackOpaque"/>
|
||||
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/interappaudio/iosEditor.h
|
||||
// Created by : Steinberg, 08/2013
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Steinberg Media Technologies nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef __iosEditor__
|
||||
#define __iosEditor__
|
||||
|
||||
#include "base/source/fobject.h"
|
||||
#include "pluginterfaces/gui/iplugview.h"
|
||||
|
||||
#if __OBJC__
|
||||
@class ADelayViewController;
|
||||
#else
|
||||
struct ADelayViewController;
|
||||
#endif
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
class EditController;
|
||||
|
||||
class ADelayEditorForIOS : public FObject, public IPlugView
|
||||
{
|
||||
public:
|
||||
ADelayEditorForIOS (EditController* editController);
|
||||
|
||||
OBJ_METHODS(ADelayEditorForIOS, FObject)
|
||||
REFCOUNT_METHODS(FObject)
|
||||
DEFINE_INTERFACES
|
||||
DEF_INTERFACE(IPlugView)
|
||||
END_DEFINE_INTERFACES(FObject)
|
||||
protected:
|
||||
tresult PLUGIN_API isPlatformTypeSupported (FIDString type) override;
|
||||
tresult PLUGIN_API attached (void* parent, FIDString type) override;
|
||||
tresult PLUGIN_API removed () override;
|
||||
tresult PLUGIN_API onWheel (float distance) override;
|
||||
tresult PLUGIN_API onKeyDown (char16 key, int16 keyCode, int16 modifiers) override;
|
||||
tresult PLUGIN_API onKeyUp (char16 key, int16 keyCode, int16 modifiers) override;
|
||||
tresult PLUGIN_API getSize (ViewRect* size) override;
|
||||
tresult PLUGIN_API onSize (ViewRect* newSize) override;
|
||||
tresult PLUGIN_API onFocus (TBool state) override;
|
||||
tresult PLUGIN_API setFrame (IPlugFrame* frame) override;
|
||||
tresult PLUGIN_API canResize () override;
|
||||
tresult PLUGIN_API checkSizeConstraint (ViewRect* rect) override;
|
||||
|
||||
void PLUGIN_API update (FUnknown* changedUnknown, int32 message) override;
|
||||
|
||||
EditController* editController;
|
||||
ADelayViewController* viewController;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // __iosEditor__
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/interappaudio/iosEditor.mm
|
||||
// Created by : Steinberg, 08/2013
|
||||
// Description :
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Steinberg Media Technologies nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#import "iosEditor.h"
|
||||
#import "public.sdk/source/vst/vsteditcontroller.h"
|
||||
#import "adelayids.h"
|
||||
|
||||
using namespace Steinberg::Vst;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@interface ADelayViewController : UIViewController
|
||||
{
|
||||
EditController* editController;
|
||||
}
|
||||
@property (assign) IBOutlet UISlider* slider;
|
||||
|
||||
@end
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@implementation ADelayViewController
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
- (id)initWithVstEditController:(EditController*)_editController
|
||||
{
|
||||
self = [super initWithNibName:@"ADelayIPAD" bundle:nil];
|
||||
if (self)
|
||||
{
|
||||
editController = _editController;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
- (void)updateSlider
|
||||
{
|
||||
[self.slider setValue:editController->getParamNormalized (kDelayId)];
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
- (IBAction)sliderChanged:(id)sender
|
||||
{
|
||||
editController->setParamNormalized (kDelayId, self.slider.value);
|
||||
editController->performEdit(kDelayId, self.slider.value);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
ADelayEditorForIOS::ADelayEditorForIOS (EditController* editController)
|
||||
: editController (editController)
|
||||
, viewController (nil)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void PLUGIN_API ADelayEditorForIOS::update (FUnknown* changedUnknown, int32 message)
|
||||
{
|
||||
Parameter* param = FCast<Parameter> (changedUnknown);
|
||||
if (param && viewController)
|
||||
{
|
||||
[viewController updateSlider];
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::isPlatformTypeSupported (FIDString type)
|
||||
{
|
||||
if (strcmp (type, kPlatformTypeUIView) == 0)
|
||||
return kResultTrue;
|
||||
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::attached (void* parent, FIDString type)
|
||||
{
|
||||
if (strcmp (type, kPlatformTypeUIView) != 0)
|
||||
return kResultFalse;
|
||||
|
||||
UIView* parentView = (__bridge UIView*)parent;
|
||||
|
||||
viewController = [[ADelayViewController alloc] initWithVstEditController:editController];
|
||||
if (viewController && viewController.view)
|
||||
{
|
||||
[parentView addSubview:viewController.view];
|
||||
|
||||
[viewController updateSlider];
|
||||
Parameter* delayParam = editController->getParameterObject (kDelayId);
|
||||
if (delayParam)
|
||||
{
|
||||
delayParam->addDependent (this);
|
||||
}
|
||||
}
|
||||
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::removed ()
|
||||
{
|
||||
[viewController.view removeFromSuperview];
|
||||
Parameter* delayParam = editController->getParameterObject (kDelayId);
|
||||
if (delayParam)
|
||||
{
|
||||
delayParam->removeDependent (this);
|
||||
}
|
||||
viewController = nil;
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::onWheel (float distance)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::onKeyDown (char16 key, int16 keyCode, int16 modifiers)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::onKeyUp (char16 key, int16 keyCode, int16 modifiers)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::getSize (ViewRect* size)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::onSize (ViewRect* newSize)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::onFocus (TBool state)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::setFrame (IPlugFrame* frame)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::canResize ()
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API ADelayEditorForIOS::checkSizeConstraint (ViewRect* rect)
|
||||
{
|
||||
return kNotImplemented;
|
||||
}
|
||||
|
||||
}}
|
||||
@@ -0,0 +1,35 @@
|
||||
//------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Examples
|
||||
// Filename : public.sdk/samples/vst/adelay/source/version.h
|
||||
// Created by : Steinberg, 06/2009
|
||||
// Description : Example of handle the versioning and copyright info of adelay plugin
|
||||
// used for the resources (RC file for example)
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "pluginterfaces/base/fplatform.h"
|
||||
|
||||
// Plain project version file generated by cmake
|
||||
#include "projectversion.h"
|
||||
|
||||
#define stringOriginalFilename "adelay.vst3"
|
||||
#if SMTG_PLATFORM_64
|
||||
#define stringFileDescription "ADelay VST3-SDK (64Bit)"
|
||||
#else
|
||||
#define stringFileDescription "ADelay VST3-SDK"
|
||||
#endif
|
||||
#define stringCompanyWeb "http://www.steinberg.net"
|
||||
#define stringCompanyEmail "mailto:info@steinberg.de"
|
||||
#define stringCompanyName "Steinberg Media Technologies"
|
||||
#define stringLegalCopyright "© 2025 Steinberg Media Technologies"
|
||||
#define stringLegalTrademarks "VST is a trademark of Steinberg Media Technologies GmbH"
|
||||
Reference in New Issue
Block a user