Attempt to recreate vst2wrapper compatible headers

The entirety of the content here is based on 'vst.h', 'VST 3 SDK' and 'VSTGUI'. Due to the license header provided in the files investigated, the final license for these files is the BSD 3-Clause license. It was about a day and a half of work, but it is almost in working condition.

While not all features/functionality is present, the main functionality that makes vst2wrapper compile is there. So with any luck I'll be able to figure out the rest with ease.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2024-03-11 10:27:23 +01:00
parent 621843c949
commit b780509704
21 changed files with 1780 additions and 29 deletions
+116
View File
@@ -0,0 +1,116 @@
# AUTOGENERATED COPYRIGHT HEADER START
# Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
# AUTOGENERATED COPYRIGHT HEADER END
# Basic Formatting
TabWidth: 4
UseTab: ForContinuationAndIndentation
ColumnLimit: 65535
#- 0 does not respect the original line breaks!
# Language
Language: Cpp
Standard: c++17
# Indentation
AccessModifierOffset: 0
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentCaseLabels: false
#IndentPPDirectives: true
IndentWidth: 4
IndentWrappedFunctionNames: true
NamespaceIndentation: All
# Includes
#IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"warning-disable.hpp"$'
Priority: 50
- Regex: '^(<|")(config.hpp|common.hpp|ui-common.hpp|strings.hpp|version.hpp|obs.h)("|>)'
Priority: 100
- Regex: '^<obs-'
Priority: 150
- Regex: '^<'
Priority: 200
- Regex: '^<Q'
Priority: 250
- Regex: '^"'
Priority: 300
- Regex: '.moc"$'
Priority: 300
- Regex: '^"warning-enable.hpp"$'
Priority: 500
SortIncludes: true
# Alignment
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
DerivePointerAlignment: false
PointerAlignment: Left
# Wrapping and Breaking
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
# AfterExternBlock: false
AfterFunction: true
AfterNamespace: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
#BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
Cpp11BracedListStyle: true
# Spaces
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCpp11BracedList: false
#SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Other
CommentPragmas: '^(!FIXME!|!TODO!|ToDo:)'
CompactNamespaces: false
DisableFormat: false
FixNamespaceComments: true
#ForEachMacros: ''
KeepEmptyLinesAtTheStartOfBlocks: false
ReflowComments: false
SortUsingDeclarations: true
+140
View File
@@ -0,0 +1,140 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
#include "vstversion.h"
#pragma pack(push, 8)
enum AEffectOpCodes {
audioEffectOpen, // Create/Open Effect
audioEffectClose, // Destroy/Close Effect
audioEffectSetProgram, // Set Program
audioEffectGetProgram, // Get Program
audioEffectSetProgramName, // Set Program Name
audioEffectGetProgramName, // Get Program Name
audioEffectGetParameterLabel, // Get Parameter Label
audioEffectGetParameterDisplay, // Get Parameter Display
audioEffectGetParameterName, // Get Parameter Name
AEffectOpCode_09,
audioEffectSetSampleRate, // Set Sample Rate
audioEffectSetBlockSize, // Set Block Size
audioEffectSuspendResume, // Suspend/Resume
audioEffectEditorGetSize, // Get Editor Size
audioEffectEditorOpen, // Create/Open Editor
audioEffectEditorClose, // Destroy/Close Editor
AEffectOpCode_10,
AEffectOpCode_11,
AEffectOpCode_12,
audioEffectEditorDoNothing,
AEffectOpCode_14,
AEffectOpCode_15,
AEffectOpCode_16, // Always FOURCC('N', 'v', 'E', 'F')? Might be different for some VST 1.x and 2.x plug-ins. Doesn't seem to be used.
audioEffectGetChunk, // Get Chunk
audioEffectSetChunk, // Set Chunk
// All OpCodes above this maximum are version 2.x
AEffectOpCodeMax
};
enum AEffectMasterOpCodes {
AEffectMasterOpCode_00,
audioMasterAutomate = AEffectMasterOpCode_00,
AEffectMasterOpCode_01,
audioMasterVersion = AEffectMasterOpCode_01,
AEffectMasterOpCode_02,
AEffectMasterOpCode_03,
AEffectMasterOpCode_04,
// All OpCodes above this maximum are version 2.x
AEffectMasterOpCodeMax,
};
enum AEffectFlags { // Guessed name based on struct+field combination.
AEffectFlagHasEditor = 1 << 0,
AEffectFlagCanReplacing = 1 << 4,
AEffectFlagProgramsAreChunks = 1 << 5, // Not sure what this means.
AEffectFlagIsSynthesizer = 1 << 8,
AEffectFlagIsSilentOnSilence = 1 << 9, // Does not generate tail samples?
};
struct AEffect {
VstInt32 magic; // Must be FOURCC('V', 's', 't', 'P')
VstIntPtr(__cdecl* control)(AEffect* self, VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value);
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
// No 2.4 host ever calls this, processReplacing and processDoubleReplacing seem to be required.
[[deprecated]]
#endif
void(__cdecl* process)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
void(__cdecl* setParameter)(AEffect* self, VstInt32 index, float value);
float(__cdecl* getParameter)(AEffect* self, VstInt32 index);
VstInt32 numPrograms;
VstInt32 numParams;
VstInt32 numInputs; // Guessing names here based on the other ones. We already know what their type is anyway.
VstInt32 numOutputs;
VstInt32 flags; // AEffectFlags, see vst.h for more.
VstIntPtr __unk04;
VstIntPtr __unk05;
VstInt32 delay;
VstInt32 __unk06;
VstInt32 __unk07;
float __unk08;
void* effect_data; // I think this is effect private data.
void* host_data; // And this is host private data.
VstInt32 uniqueID; // A very collidable unique id. 32 bit is not a lot.
VstInt32 version; // VstVersion
/** Process float data in-place.
*
* Must be present for 2.4 or later hosts. Make sure you set the proper flag.
*
* \param inputs Input buffers. Can have pointers used in outputs.
* \param outputs Output buffers. Can have pointers used in inputs.
* \param sampleFrames Number of samples in all buffers.
*/
void(__cdecl* processReplacing)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
// These only appear in version >= 2.4
/** Process double data in-place.
*
* \param inputs Input buffers. Can have pointers used in outputs.
* \param outputs Output buffers. Can have pointers used in inputs.
* \param sampleFrames Number of samples in all buffers.
*/
void(__cdecl* processDoubleReplacing)(AEffect* self, double** inputs, double** outputs, VstInt32 sampleFrames);
char __unk12[56];
#else
char __unk12[60];
#endif
};
// Master callback.
typedef VstIntPtr (*audioMasterCallback)(AEffect*, VstInt32 opcode, VstInt32, VstInt32, void* ptr, float);
#pragma pack(pop)
+178
View File
@@ -0,0 +1,178 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
// File name based on "AudioEffectX" and "AudioEffect". Since we have a struct called "AEffect", logically there's a struct AEffectX right? Don't see any references to it though...
#pragma once
#include "aeffect.h"
#include "vstpin.h"
#include "vsttime.h"
#include "vstversion.h"
enum AEffectXFlags {
AEffectFlagCanDoubleReplacing = 1 << 12, // Only available in 2.4 or later. Name based on AudioEffect::canDoubleReplacing
};
enum AEffectXOpCodes {
__AEffectXOpCode_Lowest = 0x18, // Starts at highest OpCode from AEffect.
AEffectXOpCode_19,
audioEffectProcessEvents, // Process Events
audioEffectIsParameterAutomatable, // Is Parameter Automatable?
audioEffectConvertStringToParameter, // Convert String to Parameter index
audioEffectGetProgramNameIndexed,
AEffectXOpCode_1E,
AEffectXOpCode_1F,
AEffectXOpCode_20,
audioEffectGetInputProperties, // Get Input Properties
audioEffectGetOutputProperties, // Get Output Properties
audioEffectGetPlugCategory, // Get "Plug" Category
AEffectXOpCode_24,
AEffectXOpCode_25,
AEffectXOpCode_26,
AEffectXOpCode_27,
AEffectXOpCode_28,
AEffectXOpCode_29,
audioEffectSetSpeakerArrangement, // Set Speaker Arrangment
AEffectXOpCode_2B,
audioEffectBypass, // Bypass
audioEffectGetEffectName, // Get Effect Name
AEffectXOpCode_2E,
audioEffectGetVendorString, // Get Vendor Name
audioEffectGetProductString, // Get Product Name
audioEffectGetVendorVersion, // Get Vendor Version
audioEffectVendorSpecific, // Seems to be used rarely to implement host-specific custom behavior.
audioEffectCanDo, // Test for Feature support
audioEffectGetTailSize, // Get Tail Samples
AEffectXOpCode_35,
AEffectXOpCode_36,
AEffectXOpCode_37,
audioEffectGetParameterProperties,
AEffectXOpCode_39,
audioEffectGetVSTVersion, // Get VST Version
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2100)
// Only seen in version 2.1 or later
audioEffectEditorKeyDown, // Key Down in Editor.
audioEffectEditorKeyUp, // Key Up in Editor
audioEffectEditorKnobMode, // Editor Knob Mode, see CKnobMode in vstgui.
audioEffectMidiGetProgramName,
audioEffectMidiGetCurrentProgram,
audioEffectMidiGetProgramCategory,
audioEffectMidiHasProgramsChanged,
audioEffectMidiGetKeyName,
AEffectXOpCode_43,
AEffectXOpCode_44,
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2300)
// Only seen in version 2.3 or later
audioEffectGetSpeakerArrangement, // Get Speaker Arrangement
AEffectXOpCode_46,
audioEffectStartProcessing, // Start processing audio.
audioEffectStopProcessing, // Stop processing audio.
AEffectXOpCode_49,
AEffectXOpCode_4A,
AEffectXOpCode_4B,
AEffectXOpCode_4C,
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
// Only seen in version 2.4 or later.
audioEffectSetProcessingPrecision, // Set Processing Precision, see VstProcessPrecision
audioEffectMidiGetNumInputChannels,
audioEffectMidiGetNumOutputChannels,
#endif
// Never seen any OpCodes at or above this maximum.
AEffectXOpCodeMax
};
enum AEffectXMasterOpCodes {
__AEffectXMasterOpCodeLowest = 0x04,
AEffectXMasterOpCode_05, // Appears to be unused entirely.
AEffectXMasterOpCode_06,
audioMasterGetTimeInfo, // Get Time Info. Name guessed based on AudioEffectX::getTimeInfo
audioMasterProcessEvents, // Name guessed based on AudioEffectX::sendVstEventsToHost. Name is likely a mirror of audioEffectsProcessEvents.
AEffectXMasterOpCode_09,
AEffectXMasterOpCode_0A,
AEffectXMasterOpCode_0B,
AEffectXMasterOpCode_0C,
audioMasterIOChanged, // Notify Host that our Inputs/Outputs/etc have changed. Name guessed based on AudioEffectX::ioChanged
AEffectXMasterOpCode_0E,
audioMasterSizeWindow, // Request a resize of the editor window. Name guessed based on AudioEffectX::sizeWindow
AEffectXMasterOpCode_10,
AEffectXMasterOpCode_11,
AEffectXMasterOpCode_12,
AEffectXMasterOpCode_13,
AEffectXMasterOpCode_14,
AEffectXMasterOpCode_15,
AEffectXMasterOpCode_16,
audioMasterGetCurrentProcessLevel, // Name guessed based on AudioEffectX::getCurrentProcessLevel
AEffectXMasterOpCode_18,
AEffectXMasterOpCode_19,
AEffectXMasterOpCode_1A,
AEffectXMasterOpCode_1B,
AEffectXMasterOpCode_1C,
AEffectXMasterOpCode_1D,
AEffectXMasterOpCode_1E,
AEffectXMasterOpCode_1F,
audioMasterGetVendorString, // Get Vendor Name
audioMasterGetProductString, // Get Product Name
audioMasterGetVendorVersion, // Get Vendor Version
AEffectXMasterOpCode_23, // Counterpart to AEffectXOpCode_32
AEffectXMasterOpCode_24,
AEffectXMasterOpCode_25,
AEffectXMasterOpCode_26,
AEffectXMasterOpCode_27,
AEffectXMasterOpCode_28,
AEffectXMasterOpCode_29, // When called, returns a pointer to a string.
audioMasterUpdateDisplay, // Request an update for the editor display? Name guessed via AudioEffectX::updateDisplay
audioMasterBeginEdit, // Parameter Gained Focus. Likely used to help the host ignore unwanted inputs. Name guessed via AudioEffectX::beginEdit
audioMasterEndEdit, // Parameter Lost Focus. Likely used to help the host ignore unwanted inputs. Name guessed via AudioEffectX::endEdit
AEffectXMasterOpCode_2D,
AEffectXMasterOpCode_2E,
AEffectXMasterOpCode_2F,
AEffectXMasterOpCode_30,
AEffectXMasterOpCode_31,
AEffectXMasterOpCodeMax
};
enum VstPlugCategory { // Based on OpCode being here only.
// Taken from VstPlugCategory Vst2Wrapper::getPlugCategory (), then shuffled around until it made sense in most VST hosts.
kPlugCategUnknown = 0,
kPlugCategEffect,
kPlugCategSynth,
kPlugCategAnalysis,
kPlugCategMastering,
kPlugCategSpacializer,
kPlugCategRoomFx,
kPlugCateg__unk00, // Unknown use.
kPlugCategRestoration,
kPlugCateg__unk01, // Unknown use.
kPlugCategContainer, // AEffectX contains multiple plugins. Not clear how this works.
kPlugCategGenerator,
};
enum VstProcessLevels {
// No idea what the rest are.
kVstProcessLevelRealtime = 2,
kVstProcessLevelOffline = 4,
};
enum VstProcessPrecision {
kVstProcessPrecision32, // Single
kVstProcessPrecision64, // Double
};
+36
View File
@@ -0,0 +1,36 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#include "aeffeditor.hpp"
AEffEditor::AEffEditor(AudioEffect* effect) : _effect(effect), _handle() {}
AEffEditor::~AEffEditor() {}
bool AEffEditor::getRect(ERect** rect) {}
bool AEffEditor::open(void* ptr) {}
void AEffEditor::close() {}
void AEffEditor::do_nothing() {}
bool AEffEditor::setKnobMode(VstInt32 val) {}
bool AEffEditor::onKeyDown(VstKeyCode& keyCode) {}
bool AEffEditor::onKeyUp(VstKeyCode& keyCode) {}
bool AEffEditor::onWheel(float distance) {}
+17
View File
@@ -0,0 +1,17 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "aeffeditor.hpp"
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vstkey.h"
#include "vsttypes.h"
#pragma pack(push, 8)
class AudioEffect;
class AEffEditor {
public:
AEffEditor(AudioEffect* effect);
virtual ~AEffEditor();
virtual bool getRect(ERect** rect);
virtual bool open(void* ptr);
virtual void close();
virtual void do_nothing();
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2100)
virtual bool setKnobMode(VstInt32 val);
virtual bool onKeyDown(VstKeyCode& keyCode);
virtual bool onKeyUp(VstKeyCode& keyCode);
virtual bool onWheel(float distance);
#endif
protected:
AudioEffect* effect; // Restricted to this name by vst2wrapper.
void* _handle;
};
#pragma pack(pop)
+177
View File
@@ -0,0 +1,177 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#include "audioeffect.hpp"
#include <cstring>
#include "aeffect.h"
#define FOURCC(a, b, c, d) ((a << 24) | (b << 16) | (c << 8) | d)
AudioEffect::AudioEffect(audioMasterCallback p_audioMaster, VstInt32 __unk00, VstInt32 __unk01)
{
memset(&cEffect, 0, sizeof(AEffect));
cEffect.magic = FOURCC('V', 's', 't', 'P');
cEffect.effect_data = this;
#if (!defined VST_VERSION_SUPPORT)
cEffect.version = kVstVersion_2400;
#else
cEffect.version = VST_VERSION_SUPPORT;
#endif
cEffect.control = [](AEffect* self, VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value) { return reinterpret_cast<AudioEffect*>(self->effect_data)->control(opcode, param1, param2, ptr, value); };
cEffect.process = [](AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames) { return reinterpret_cast<AudioEffect*>(self->effect_data)->process(inputs, outputs, sampleFrames); };
cEffect.setParameter = [](AEffect* self, VstInt32 index, float value) { reinterpret_cast<AudioEffect*>(self->effect_data)->setParameter(index, value); };
cEffect.getParameter = [](AEffect* self, VstInt32 index) { return reinterpret_cast<AudioEffect*>(self->effect_data)->getParameter(index); };
cEffect.processReplacing = [](AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames) { return reinterpret_cast<AudioEffect*>(self->effect_data)->processReplacing(inputs, outputs, sampleFrames); };
audioMaster = p_audioMaster;
numPrograms = cEffect.numPrograms;
curProgram = 0;
editor = nullptr;
}
AudioEffect::~AudioEffect() {}
VstIntPtr AudioEffect::control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value)
{
switch (opcode) {
case audioEffectOpen:
open();
break;
case audioEffectClose:
close();
break;
case audioEffectSetProgram:
setProgram(param1);
break;
case audioEffectGetProgram:
return getProgram();
case audioEffectSetProgramName:
setProgramName((char*)ptr);
break;
case audioEffectGetProgramName:
getProgramName((char*)ptr);
break;
case audioEffectGetParameterLabel:
getParameterLabel(param1, (char*)ptr);
break;
case audioEffectGetParameterDisplay:
getParameterDisplay(param1, (char*)ptr);
break;
case audioEffectGetParameterName:
getParameterName(param1, (char*)ptr);
break;
case audioEffectSetSampleRate:
setSampleRate(value);
break;
case audioEffectSetBlockSize:
setBlockSize(static_cast<VstInt32>(value));
break;
case audioEffectSuspendResume:
if (!param2) {
suspend();
} else {
resume();
}
break;
case audioEffectEditorGetSize:
if (editor) {
return editor->getRect((ERect**)ptr) ? 1 : 0;
}
break;
case audioEffectEditorOpen:
if (editor) {
return editor->open(ptr);
}
break;
case audioEffectEditorClose:
if (editor) {
editor->close();
}
break;
case audioEffectEditorDoNothing: // Occasionally appears. Does nothing? Only called when editor is open.
if (editor) {
editor->do_nothing();
}
break;
case audioEffectGetChunk:
return getChunk((void**)ptr, !!param1);
case audioEffectSetChunk:
return setChunk(ptr, static_cast<VstInt32>(value), !!param1);
default:
break;
}
return 0;
}
AEffect* AudioEffect::getAeffect()
{
return &cEffect;
}
void AudioEffect::setEditor(AEffEditor* p_editor)
{
editor = p_editor;
}
void AudioEffect::setUniqueID(VstInt32 uniqueID)
{
cEffect.uniqueID = uniqueID;
}
void AudioEffect::setNumInputs(VstInt32 numInputs)
{
cEffect.numInputs = numInputs;
}
void AudioEffect::setNumOutputs(VstInt32 numOutputs)
{
cEffect.numOutputs = numOutputs;
}
void AudioEffect::setInitialDelay(VstInt32 delay)
{
cEffect.delay = delay;
}
void AudioEffect::canProcessReplacing(bool value)
{
if (value)
cEffect.flags |= AEffectFlagCanReplacing;
else
cEffect.flags &= ~AEffectFlagCanReplacing;
}
void AudioEffect::isSynth(bool value)
{
if (value)
cEffect.flags |= AEffectFlagIsSynthesizer;
else
cEffect.flags &= ~AEffectFlagIsSynthesizer;
}
void AudioEffect::programsAreChunks(bool value)
{
if (value)
cEffect.flags |= AEffectFlagProgramsAreChunks;
else
cEffect.flags &= ~AEffectFlagProgramsAreChunks;
}
void AudioEffect::setParameterAutomated(VstInt32 index, float value)
{
setParameter(index, value);
if (audioMaster)
audioMaster(getAeffect(), audioMasterAutomate, index, 0, 0, value);
}
+97
View File
@@ -0,0 +1,97 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "aeffect.h"
#include "aeffeditor.h"
#include "vstevent.h"
#include "vstkey.h"
#include "vstparameter.h"
#include "vstpin.h"
#include "vstspeaker.h"
#include "vsttypes.h"
// This may work. Or it may not. We don't guarantee compatibility with the original.
class AudioEffect {
public:
AudioEffect(audioMasterCallback audioMaster, VstInt32 __unk00, VstInt32 __unk01);
virtual ~AudioEffect();
protected:
// Internal
virtual VstIntPtr control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value);
public:
// AudioEffect
virtual AEffect* getAeffect();
virtual void setEditor(AEffEditor* editor);
virtual void process(float** inputs, float** outputs, VstInt32 sampleFrames){};
virtual float getParameter(VstInt32 index)
{
return 0;
}
virtual void setParameter(VstInt32 index, float value){};
virtual void processReplacing(float** inputs, float** outputs, VstInt32 sampleFrames){};
// AEffect
virtual void setUniqueID(VstInt32 uniqueID);
virtual void setNumInputs(VstInt32 numInputs);
virtual void setNumOutputs(VstInt32 numOutputs);
virtual void setInitialDelay(VstInt32 delay);
virtual void canProcessReplacing(bool value);
virtual void isSynth(bool value);
virtual void programsAreChunks(bool value);
// Audio Master (sorted by AEffectMasterOpCodes)
virtual void setParameterAutomated(VstInt32 index, float value);
// Audio Plugin (sorted by AEffectOpCodes)
virtual void open(){};
virtual void close(){};
virtual void setProgram(VstInt32 program){};
virtual VstInt32 getProgram(){};
virtual void setProgramName(char* name){};
virtual void getProgramName(char* name)
{
*name = 0;
}
virtual void getParameterLabel(VstInt32 index, char* label){};
virtual void getParameterDisplay(VstInt32 index, char* text){};
virtual void getParameterName(VstInt32 index, char* text){};
virtual void setSampleRate(float newSamplerate){};
virtual void setBlockSize(VstInt32 newBlockSize){};
virtual void suspend(){};
virtual void resume(){};
virtual VstInt32 getChunk(void** data, bool isPreset = false)
{
return 0;
}
virtual VstInt32 setChunk(void* data, VstInt32 byteSize, bool isPreset = false)
{
return 0;
}
// Defined by Implementation
protected: // Needs to be accessible by AudioEffectX
AEffect cEffect; // vst2wrapper requires this.
audioMasterCallback audioMaster; // vst2wrapper requires this.
VstInt32 numPrograms;
VstInt32 curProgram;
AEffEditor* editor;
};
+223
View File
@@ -0,0 +1,223 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#include "audioeffectx.hpp"
#include "vstkey.h"
AudioEffectX::AudioEffectX(audioMasterCallback audioMaster, VstInt32 __unk00, VstInt32 __unk01) : AudioEffect(audioMaster, __unk00, __unk01)
{
cEffect.processDoubleReplacing = [](AEffect* self, double** inputs, double** outputs, VstInt32 sampleFrames) { return reinterpret_cast<AudioEffectX*>(self->effect_data)->processDoubleReplacing(inputs, outputs, sampleFrames); };
}
AudioEffectX::~AudioEffectX() {}
VstIntPtr AudioEffectX::control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value)
{
switch (opcode) {
case audioEffectProcessEvents:
return processEvents((VstEvents*)ptr);
case audioEffectIsParameterAutomatable:
return canParameterBeAutomated(param1) ? 1 : 0;
case audioEffectConvertStringToParameter:
return string2parameter(param1, (char*)ptr) ? 1 : 0;
case audioEffectGetProgramNameIndexed:
return getProgramNameIndexed(static_cast<VstInt32>(value), param1, (char*)ptr) ? 1 : 0;
case audioEffectGetInputProperties:
return getInputProperties(param1, (VstPinProperties*)ptr);
case audioEffectGetOutputProperties:
return getOutputProperties(param1, (VstPinProperties*)ptr);
case audioEffectGetPlugCategory:
return (VstIntPtr)getPlugCategory();
case audioEffectSetSpeakerArrangement:
// MSVC: No you can't convert float to VstSpeakerArrangement*!!
// Also MSVC: Perfectly happy with this mess...
return setSpeakerArrangement(*(VstSpeakerArrangement**)(&value), (VstSpeakerArrangement*)ptr);
case audioEffectBypass:
return setBypass(!!param2) ? 1 : 0;
case audioEffectGetEffectName:
return getEffectName((char*)ptr) ? 1 : 0;
case audioEffectGetVendorString:
return getVendorString((char*)ptr) ? 1 : 0;
case audioEffectGetProductString:
return getProductString((char*)ptr) ? 1 : 0;
case audioEffectGetVendorVersion:
return getVendorVersion();
case audioEffectVendorSpecific:
return vendorSpecific(param1, param2, ptr, value);
case audioEffectCanDo:
return canDo((char*)ptr);
case audioEffectGetTailSize:
return getGetTailSize();
case audioEffectGetParameterProperties:
return getParameterProperties(param1, (VstParameterProperties*)ptr) ? 1 : 0;
case audioEffectGetVSTVersion:
return cEffect.version;
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2100)
case audioEffectEditorKeyDown:
if (editor) {
VstKeyCode keycode{.character = param1, .virt = static_cast<unsigned char>(param2), .modifier = static_cast<unsigned char>(value)};
editor->onKeyDown(keycode);
}
return 0;
case audioEffectEditorKeyUp:
if (editor) {
VstKeyCode keycode{.character = param1, .virt = static_cast<unsigned char>(param2), .modifier = static_cast<unsigned char>(value)};
editor->onKeyUp(keycode);
}
return 0;
case audioEffectEditorKnobMode:
if (editor) {
editor->setKnobMode(param2) ? 1 : 0;
}
return 0;
case audioEffectMidiGetProgramName:
return getMidiProgramName(param1, (MidiProgramName*)ptr);
case audioEffectMidiGetCurrentProgram:
return getCurrentMidiProgram(param1, (MidiProgramName*)ptr);
case audioEffectMidiGetProgramCategory:
return getMidiProgramCategory(param1, (MidiProgramCategory*)ptr);
case audioEffectMidiHasProgramsChanged:
return hasMidiProgramsChanged(param1) ? 1 : 0;
case audioEffectMidiGetKeyName:
return getMidiKeyName(param1, (MidiKeyName*)ptr) ? 1 : 0;
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2300)
case audioEffectGetSpeakerArrangement:
return getSpeakerArrangement(*(VstSpeakerArrangement***)(&value), (VstSpeakerArrangement**)ptr);
case audioEffectStartProcessing:
return startProcess();
case audioEffectStopProcessing:
return stopProcess();
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
case audioEffectSetProcessingPrecision:
return setProcessPrecision(param1) ? 1 : 0;
case audioEffectMidiGetNumInputChannels:
return getNumMidiInputChannels();
case audioEffectMidiGetNumOutputChannels:
return getNumMidiOutputChannels();
#endif
default:
return AudioEffect::control(opcode, param1, param2, ptr, value);
}
return 0;
}
VstInt32 AudioEffectX::canHostDo(char* text)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterBeginEdit, 0, 0, text, 0);
return false;
}
bool AudioEffectX::beginEdit(VstInt32 paramIndex)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterBeginEdit, paramIndex, 0, 0, 0);
return false;
}
bool AudioEffectX::endEdit(VstInt32 paramIndex)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterEndEdit, paramIndex, 0, 0, 0);
return false;
}
bool AudioEffectX::ioChanged()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterIOChanged, 0, 0, 0, 0);
return false;
}
bool AudioEffectX::updateDisplay()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterUpdateDisplay, 0, 0, 0, 0);
return false;
}
bool AudioEffectX::sizeWindow(VstInt32 width, VstInt32 height)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterSizeWindow, width, height, 0, 0);
return false;
}
VstInt32 AudioEffectX::getCurrentProcessLevel()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetCurrentProcessLevel, 0, 0, 0, 0);
return 0;
}
bool AudioEffectX::getHostVendorString(char* text)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetVendorString, 0, 0, text, 0);
return false;
}
bool AudioEffectX::getHostProductString(char* text)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetProductString, 0, 0, text, 0);
return false;
}
VstInt32 AudioEffectX::getHostVendorVersion()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetVendorVersion, 0, 0, 0, 0);
return 0;
}
bool AudioEffectX::canDoubleReplacing(bool value)
{
if (value)
cEffect.flags |= AEffectFlagCanDoubleReplacing;
else
cEffect.flags &= ~AEffectFlagCanDoubleReplacing;
}
void AudioEffectX::noTail(bool value)
{
if (value)
cEffect.flags |= AEffectFlagIsSilentOnSilence;
else
cEffect.flags &= ~AEffectFlagIsSilentOnSilence;
}
VstTimeInfo* AudioEffectX::getTimeInfo(VstInt32 filter)
{
if (audioMaster) {
auto ptr = audioMaster(getAeffect(), audioMasterGetTimeInfo, 0, filter, 0, 0);
// Returned value should be a pointer to a VstTimeInfo.
return reinterpret_cast<VstTimeInfo*>(ptr);
}
return 0;
}
bool AudioEffectX::sendVstEventsToHost(VstEvents* events)
{
if (audioMaster) {
audioMaster(getAeffect(), audioMasterProcessEvents, 0, 0, events, 0);
}
return 0;
}
+23
View File
@@ -0,0 +1,23 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
/*
* This is based on the publicly available VST 3.x SDK "vst2wrapper" files. All content is as such licensed under the BSD 3-Clause license provided in those files, and also shown above.
*
* Assume that everything here is guesswork. It seems to work, but is largely unconfirmed.
*/
#pragma once
#include "audioeffectx.hpp"
+167
View File
@@ -0,0 +1,167 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "aeffectx.h"
#include "audioeffect.hpp"
#include "vstmidi.h"
#include "vstpin.h"
#include "vstspeaker.h"
#include "vsttypes.h"
class AudioEffectX : public AudioEffect {
public:
AudioEffectX(audioMasterCallback audioMaster, VstInt32 __unk00, VstInt32 __unk01);
virtual ~AudioEffectX();
protected:
// Internal
virtual VstIntPtr control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value) override;
public:
// AEffect/AEffectX
virtual bool canDoubleReplacing(bool value);
virtual void noTail(bool value);
virtual void processDoubleReplacing(double** inputs, double** outputs, VstInt32 sampleFrames){};
// Audio Master (sorted by AEffectMasterOpCodes)
virtual VstTimeInfo* getTimeInfo(VstInt32 filter);
virtual bool sendVstEventsToHost(VstEvents* events);
virtual bool ioChanged();
virtual bool sizeWindow(VstInt32 width, VstInt32 height);
virtual VstInt32 getCurrentProcessLevel();
virtual bool getHostVendorString(char* text);
virtual bool getHostProductString(char* text);
virtual VstInt32 getHostVendorVersion();
virtual VstInt32 canHostDo(char* text);
virtual bool beginEdit(VstInt32 paramIndex);
virtual bool endEdit(VstInt32 paramIndex);
virtual bool updateDisplay();
// Audio Plugin (sorted by AEffectOpCodes)
virtual VstInt32 processEvents(VstEvents* events)
{
return 0;
}
virtual bool canParameterBeAutomated(VstInt32 index)
{
return false;
}
virtual bool string2parameter(VstInt32 index, char* text)
{
return false;
}
virtual bool getProgramNameIndexed(VstInt32 category, VstInt32 index, char* text)
{
return false;
}
virtual bool getInputProperties(VstInt32 index, VstPinProperties* properties)
{
return false;
}
virtual bool getOutputProperties(VstInt32 index, VstPinProperties* properties)
{
return false;
}
virtual VstPlugCategory getPlugCategory()
{
return kPlugCategUnknown;
}
virtual bool setSpeakerArrangement(VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput)
{
return false;
}
virtual bool setBypass(bool onOff)
{
return false;
}
virtual bool getEffectName(char* name)
{
return false;
}
virtual bool getVendorString(char* text)
{
return false;
}
virtual bool getProductString(char* text)
{
return false;
}
virtual VstInt32 getVendorVersion()
{
return 0;
}
virtual VstIntPtr vendorSpecific(VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg)
{
return 0;
}
virtual VstInt32 canDo(char* text)
{
return 0;
}
virtual VstInt32 getGetTailSize()
{
return 0;
}
virtual bool getParameterProperties(VstInt32 index, VstParameterProperties* p)
{
return false;
}
virtual VstInt32 getMidiProgramName(VstInt32 channel, MidiProgramName* midiProgramName)
{
return 0;
}
virtual VstInt32 getCurrentMidiProgram(VstInt32 channel, MidiProgramName* currentProgram)
{
return 0;
}
virtual VstInt32 getMidiProgramCategory(VstInt32 channel, MidiProgramCategory* category)
{
return 0;
}
virtual bool hasMidiProgramsChanged(VstInt32 channel)
{
return false;
}
virtual bool getMidiKeyName(VstInt32 channel, MidiKeyName* keyName)
{
return false;
}
virtual bool getSpeakerArrangement(VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput)
{
return false;
}
virtual VstInt32 startProcess()
{
return 0;
}
virtual VstInt32 stopProcess()
{
return 0;
}
virtual bool setProcessPrecision(VstInt32 precision)
{
return false;
}
virtual VstInt32 getNumMidiInputChannels()
{
return 0;
}
virtual VstInt32 getNumMidiOutputChannels()
{
return 0;
}
};
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstEventTypes {
kVstMidiType = 1,
kVstSysExType = 6,
};
struct VstEvent {
VstInt32 type;
VstInt32 byteSize;
VstInt32 deltaFrames;
VstInt32 flags;
// ? bytes
};
struct VstEvents {
VstInt32 numEvents;
VstInt32 reserved;
VstEvent* events[2];
};
#pragma pack(pop)
+100
View File
@@ -0,0 +1,100 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
// vstgui4 has a perfect implementation of this just lying around.
#pragma pack(push, 8)
enum VstModifierKey {
MODIFIER_SHIFT = 1 << 0, // Shift
MODIFIER_ALTERNATE = 1 << 1, // Alt
MODIFIER_COMMAND = 1 << 2, // Control on Mac
MODIFIER_CONTROL = 1 << 3 // Ctrl on PC, Apple on Mac
};
enum VstVirtualKey {
VKEY_BACK = 1,
VKEY_TAB,
VKEY_CLEAR,
VKEY_RETURN,
VKEY_PAUSE,
VKEY_ESCAPE,
VKEY_SPACE,
VKEY_NEXT,
VKEY_END,
VKEY_HOME,
VKEY_LEFT,
VKEY_UP,
VKEY_RIGHT,
VKEY_DOWN,
VKEY_PAGEUP,
VKEY_PAGEDOWN,
VKEY_SELECT,
VKEY_PRINT,
VKEY_ENTER,
VKEY_SNAPSHOT,
VKEY_INSERT,
VKEY_DELETE,
VKEY_HELP,
VKEY_NUMPAD0,
VKEY_NUMPAD1,
VKEY_NUMPAD2,
VKEY_NUMPAD3,
VKEY_NUMPAD4,
VKEY_NUMPAD5,
VKEY_NUMPAD6,
VKEY_NUMPAD7,
VKEY_NUMPAD8,
VKEY_NUMPAD9,
VKEY_MULTIPLY,
VKEY_ADD,
VKEY_SEPARATOR,
VKEY_SUBTRACT,
VKEY_DECIMAL,
VKEY_DIVIDE,
VKEY_F1,
VKEY_F2,
VKEY_F3,
VKEY_F4,
VKEY_F5,
VKEY_F6,
VKEY_F7,
VKEY_F8,
VKEY_F9,
VKEY_F10,
VKEY_F11,
VKEY_F12,
VKEY_NUMLOCK,
VKEY_SCROLL,
VKEY_SHIFT,
VKEY_CONTROL,
VKEY_ALT,
VKEY_EQUALS
};
struct VstKeyCode {
VstInt32 character;
unsigned char virt; // see enum VstVirtualKey
unsigned char modifier; // see enum VstModifierKey
};
#pragma pack(pop)
+69
View File
@@ -0,0 +1,69 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
#include "vstversion.h"
#pragma pack(push, 8)
enum VstMidiEventFlags {
kVstMidiEventIsRealtime,
};
struct VstMidiEvent : VstEvent {
VstInt32 noteLength;
VstInt32 noteOffset;
char midiData[4];
char detune;
char noteOffVelocity;
char __unk00;
char __unk01;
};
struct VstMidiSysexEvent : VstEvent {
VstInt32 dumpBytes;
VstIntPtr __unk00;
char* sysexDump;
VstIntPtr __unk01;
};
struct MidiKeyName {
VstInt32 thisProgramIndex;
VstInt32 thisKeyNumber;
char keyName[kVstMaxNameLen];
VstInt32 __unk00;
VstInt32 __unk01;
};
struct MidiProgramName {
VstInt32 thisProgramIndex;
char name[kVstMaxNameLen];
VstInt32 midiProgram; // Could be swapped with thisProgramIndex?
VstInt32 midiBankMsb;
VstInt32 midiBankLsb;
VstInt32 __unk01;
VstInt32 parentCategoryIndex; // -1 appears to mean no category.
VstInt32 flags;
};
struct MidiProgramCategory {
VstInt32 thisCategoryIndex;
char name[kVstMaxNameLen]; // Name guessed, but might be wrong. Doesn't seem to be used.
VstInt32 parentCategoryIndex;
VstInt32 flags;
};
#pragma pack(pop)
+48
View File
@@ -0,0 +1,48 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstParameterFlags {
kVstParameterIsSwitch = 1,
kVstParameterUsesIntegerMinMax = 2,
kVstParameterCanRamp = 7,
};
struct VstParameterProperties {
float __unk00;
float __unk01;
float __unk02;
char label[64];
VstInt32 flags;
VstInt32 minInteger;
VstInt32 maxInteger;
VstInt32 __unk03;
VstInt32 __unk04;
char shortLabel[8];
// There's more after this, but it's not used?
// We know what they're for (see vst.h), but they don't appear anywhere.
VstInt16 __unk05; // Order/Index for display. Starts at 0.
VstInt16 __unk06; // Category Index, 0 for none, 1+ for category.
VstInt16 __unk07; // Number of parameters in this category
VstInt16 __unk08; // Know absolutely nothing about this one.
char __unk09[24]; // Category Label. We know the size here, and what it is.
char __unk10[16]; // Always exists, not sure why. May be padding.
};
#pragma pack(pop)
+36
View File
@@ -0,0 +1,36 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstPinFlags {
kVstPinIsActive,
kVstPinUseSpeaker,
kVstPinIsStereo,
};
struct VstPinProperties {
char label[kVstMaxLabelLen];
VstInt32 flags;
VstInt32 arrangementType;
char shortLabel;
// ? bytes
};
#pragma pack(pop)
+97
View File
@@ -0,0 +1,97 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstSpeakerArrangmentType { // Name adapted from vst.h
kSpeakerArrUserDefined = -2,
kSpeakerArr__unk01 = -1,
// Taken from: VstInt32 Vst2Wrapper::vst3ToVst2SpeakerArr
kSpeakerArrMono = 0,
kSpeakerArrStereo,
kSpeakerArrStereoSurround,
kSpeakerArrStereoCenter,
kSpeakerArrStereoSide,
kSpeakerArrStereoCLfe,
kSpeakerArr30Cine,
kSpeakerArr30Music,
kSpeakerArr31Cine,
kSpeakerArr31Music,
kSpeakerArr40Cine,
kSpeakerArr40Music,
kSpeakerArr41Cine,
kSpeakerArr41Music,
kSpeakerArr50,
kSpeakerArr51,
kSpeakerArr60Cine,
kSpeakerArr60Music,
kSpeakerArr61Cine,
kSpeakerArr61Music,
kSpeakerArr70Cine,
kSpeakerArr70Music,
kSpeakerArr71Cine,
kSpeakerArr71Music,
kSpeakerArr80Cine,
kSpeakerArr80Music,
kSpeakerArr81Cine,
kSpeakerArr81Music,
kSpeakerArr102,
};
enum VstSpeakerType { // Name adapted from vst.h
// Taken from VstInt32 Vst2Wrapper::vst3ToVst2Speaker (Vst::Speaker vst3Speaker)
kSpeakerUndefined = INT32_MAX, // Weirdest one to figure out. Why not -1?
kSpeakerM = 0,
kSpeakerL,
kSpeakerR,
kSpeakerC,
kSpeakerLfe,
kSpeakerLs,
kSpeakerRs,
kSpeakerLc,
kSpeakerRc,
kSpeakerS,
kSpeakerSl,
kSpeakerSr,
kSpeakerTm,
kSpeakerTfl,
kSpeakerTfc,
kSpeakerTfr,
kSpeakerTrl,
kSpeakerTrc,
kSpeakerTrr,
kSpeakerLfe2,
};
struct VstSpeakerProperties {
float __unk00;
float __unk01;
float __unk02;
float __unk03;
char name[64];
VstInt32 type; // VstSpeakerType, see vst.h
char __unk04[28];
};
struct VstSpeakerArrangement {
VstInt32 type; // VstSpeakerArrangmentType, see vst.h
VstInt32 numChannels;
VstSpeakerProperties speakers[32]; // See vst.h. I don't know if this size is correct.
};
#pragma pack(pop)
+54
View File
@@ -0,0 +1,54 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstSMPTEFrameRate {
// Taken from: void Vst2Wrapper::setupProcessTimeInfo ()
kVstSmpte24fps = 0,
kVstSmpte25fps = 1,
kVstSmpte2997fps = 2,
kVstSmpte30fps = 3,
kVstSmpte2997dfps = 4,
kVstSmpte30dfps = 5,
kVstSmpteFilm16mm = 6,
kVstSmpteFilm35mm = 7,
kVstSmpte239fps = 9,
kVstSmpte249fps = 10,
kVstSmpte599fps = 11,
kVstSmpte60fps = 12,
};
struct VstTimeInfo {
double samplePos;
double sampleRate;
double nanoSeconds;
double ppqPos;
double tempo;
double barStartPos;
double cycleStartPos;
double cycleEndPos;
VstInt32 timeSigNumerator;
VstInt32 timeSigDenominator;
VstInt32 smpteOffset;
VstInt32 smpteFrameRate;
VstInt32 samplesToNextClock;
VstInt32 flags;
};
#pragma pack(pop)
+51
View File
@@ -0,0 +1,51 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
#ifdef __cplusplus
#include <cinttypes>
#else
#include <inttypes.h>
#endif
enum VstMaxLengths { // Anything with k is an enum?
kVstMaxNameLen = 64,
kVstMaxLabelLen = 64,
kVstMaxShortLabelLen = 8,
kVstExtMaxParamStrLen = 32, // Apparently incorrect, but actually in use by many hosts.
kVstMaxParamStrLen = 8,
kVstMaxProgNameLen = 24,
kVstMaxVendorStrLen = 64,
kVstMaxEffectNameLen = 32,
};
// 16-bit wide Integer
typedef int16_t VstInt16;
// 32-bit wide Integer
typedef int32_t VstInt32;
// Variable size Integer Pointer
typedef intptr_t VstIntPtr;
// Float and double are used as-is. No custom type name here.
// Bus Direction. Appears to be int32_t
typedef int32_t BusDirection;
// Rectangle
struct ERect {
VstInt16 left, top, right, bottom;
};
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/
#pragma once
enum VstVersion {
kVstVersion_0 = 0, // Anything before 2.0, rarely used.
kVstVersion_1000 = 1000, // 1.0
kVstVersion_1100 = 1100, // 1.1
kVstVersion_2 = 2, // 2.0, rarely used.
kVstVersion_2000 = 2000, // 2.0
kVstVersion_2100 = 2100, // 2.1
kVstVersion_2200 = 2200, // 2.2
kVstVersion_2300 = 2300, // 2.3
kVstVersion_2400 = 2400, // 2.4
};
+24 -16
View File
@@ -1,9 +1,22 @@
// This was created from released VST2.x plugins, and is technically under the 2-clause BSD license.
// Depending on which country you are in, Steinberg can do fuck all about this. Notable countries for
// this are most members of the United States of America, the entirety of Europe, Japan, and Russia.
// Consult a lawyer if you don't know if clean room reverse engineering is allowed in your country.
/*
* Copyright 2020 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 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 HOLDER 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.
*/
// See README.md for all information.
/*
* This was created from released VST2.x plugins, and is technically under the 2-clause BSD license. Depending on which country you are in, Steinberg can do fuck all about this. Notable countries for this are most members of the United States of America, the entirety of Europe, Japan, and Russia.
*
* Consult a lawyer if you don't know if clean room reverse engineering is allowed in your country.
*
* See README.md for all information.
*/
// Known additional information:
// - Function call standard seems to be stdcall.
@@ -18,7 +31,7 @@
#ifndef VST2SDK_VST_H
#define VST2SDK_VST_H
#define VST_FUNCTION_INTERFACE __stdcall
#define VST_FUNCTION_INTERFACE __cdecl
#define VST_ALIGNMENT 8
#define VST_MAGICNUMBER 'VstP'
@@ -812,8 +825,7 @@ struct vst_effect {
* @param p_ptr Parameter, see VST_EFFECT_OPCODES.
* @param p_float Parameter, see VST_EFFECT_OPCODES.
*/
intptr_t(VST_FUNCTION_INTERFACE* control)(vst_effect* pthis, VST_EFFECT_OPCODE opcode, int32_t p_int1,
intptr_t p_int2, void* p_ptr, float p_float);
intptr_t(VST_FUNCTION_INTERFACE* control)(vst_effect* pthis, VST_EFFECT_OPCODE opcode, int32_t p_int1, intptr_t p_int2, void* p_ptr, float p_float);
/* Process the given number of samples in inputs and outputs.
*
@@ -824,8 +836,7 @@ struct vst_effect {
* @param outputs Pointer to an array of 'float[samples]' with size numOutputs.
* @param samples Number of samples per channel in inputs.
*/
void(VST_FUNCTION_INTERFACE* process)(vst_effect* pthis, const float* const* inputs, float** outputs,
int32_t samples);
void(VST_FUNCTION_INTERFACE* process)(vst_effect* pthis, const float* const* inputs, float** outputs, int32_t samples);
/* Updates the value for the parameter at the given index, or does nothing if out of bounds.
*
@@ -903,8 +914,7 @@ struct vst_effect {
* @param outputs Pointer to an array of 'float[samples]' with size numOutputs.
* @param samples Number of samples per channel in inputs.
*/
void(VST_FUNCTION_INTERFACE* process_float)(vst_effect* pthis, const float* const* inputs, float** outputs,
int32_t samples);
void(VST_FUNCTION_INTERFACE* process_float)(vst_effect* pthis, const float* const* inputs, float** outputs, int32_t samples);
/* Process the given number of double samples in inputs and outputs.
*
@@ -915,8 +925,7 @@ struct vst_effect {
* @param outputs Pointer to an array of 'double[samples]' with size numOutputs.
* @param samples Number of samples per channel in inputs.
*/
void(VST_FUNCTION_INTERFACE* process_double)(vst_effect* pthis, const double* const* inputs, double** outputs,
int32_t samples);
void(VST_FUNCTION_INTERFACE* process_double)(vst_effect* pthis, const double* const* inputs, double** outputs, int32_t samples);
// Everything after this is unknown and was present in reacomp-standalone.dll.
uint8_t _unknown[56]; // 56-bytes of something. Could also just be 52-bytes.
@@ -970,8 +979,7 @@ struct vst_speaker_arrangement {
* @param p_str Zero terminated string or null on call.
* @return ?
*/
typedef intptr_t (*vst_host_callback)(vst_effect* plugin, VST_HOST_OPCODE opcode, int32_t p_int1, int64_t p_int2,
const char* p_str, int32_t p_int3);
typedef intptr_t (*vst_host_callback)(vst_effect* plugin, VST_HOST_OPCODE opcode, int32_t p_int1, int64_t p_int2, const char* p_str, float p_float);
static const char* vst_host_string[] = {
"GetResourcePath", // ReaControlMIDI