Initial release

This commit is contained in:
civ
2026-08-16 18:24:52 +07:00
commit 876886a39a
13244 changed files with 2353959 additions and 0 deletions
@@ -0,0 +1,57 @@
if(NOT SMTG_ENABLE_VSTGUI_SUPPORT)
return()
endif()
cmake_minimum_required(VERSION 3.25.0)
project(smtg-vst3-hostchecker
VERSION ${vstsdk_VERSION}.0
DESCRIPTION "Steinberg VST 3 Host Checker example"
)
set(COMPATIBILITY_FILE resource/vst_compatibility.json)
smtg_add_vst3plugin(host-checker
MODULEINFO_COMPATIBILITY
${COMPATIBILITY_FILE}
resource/hostchecker.uidesc
source/cids.h
source/editorsizecontroller.cpp
source/editorsizecontroller.h
source/eventlistcheck.cpp
source/eventlistcheck.h
source/eventlogdatabrowsersource.cpp
source/eventlogdatabrowsersource.h
source/eventlogger.cpp
source/eventlogger.h
source/factory.cpp
source/hostcheck.cpp
source/hostcheck.h
source/hostcheckercontroller.cpp
source/hostcheckercontroller.h
source/hostcheckerprocessor.cpp
source/hostcheckerprocessor.h
source/logevents.h
source/parameterchangescheck.cpp
source/parameterchangescheck.h
source/processcontextcheck.cpp
source/processcontextcheck.h
source/processsetupcheck.cpp
source/processsetupcheck.h
source/version.h
)
target_link_libraries(host-checker
PRIVATE
vstgui_support
)
smtg_target_add_plugin_resources(host-checker
RESOURCES
resource/hostchecker.uidesc
resource/bypass.png
resource/knob.png
)
smtg_target_setup_as_vst3_example(host-checker)
@@ -0,0 +1,18 @@
# VST 3 Host Checker
## Introduction
The VST 3 Host Checker plug-in can test a VST 3 host application. It tracks all incoming function calls, monitors calling sequences and performs various other tests.
> See also: [Online Documentation](https://steinbergmedia.github.io/vst3_dev_portal/pages/What+is+the+VST+3+SDK/Plug-in+Examples.html?highlight=host%20checker#hostchecker).
## 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)**
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

File diff suppressed because it is too large Load Diff
@@ -0,0 +1,49 @@
#include <windows.h>
#include "../source/version.h"
#define APSTUDIO_READONLY_SYMBOLS
knob.png PNG "knob.png"
bypass.png PNG "bypass.png"
hostchecker.uidesc DATA "../resource/hostchecker.uidesc"
/////////////////////////////////////////////////////////////////////////////
// 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
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

@@ -0,0 +1,8 @@
[
{
"New": "23FC190E02DD4499A8D2230E50617DA3", // VST3 Host Checker
"Old": [
"84E8DE5F92554F5396FAE4133C935A18", // AGain
],
},
]
@@ -0,0 +1,51 @@
//------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/again/source/cids.h
// Created by : Steinberg, 12/2007
// Description : define the class IDs for AGain
//
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
#pragma once
namespace Steinberg {
namespace Vst {
// Here are defined the UIDs for the processor and 1 controller
static const FUID HostCheckerProcessorUID (0x23FC190E, 0x02DD4499, 0xA8D2230E, 0x50617DA3);
static const FUID HostCheckerControllerUID (0x35AC5652, 0xC7D24CB1, 0xB1427D38, 0xEB690DAF);
#define PlugVST3Category "Spatial|Fx|Instrument|Up-Downmix"
//------------------------------------------------------------------------
} // namespace Vst
} // namespace Steinberg
@@ -0,0 +1,115 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/hostchecker.h
// Created by : Steinberg, 04/2012
// 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 "editorsizecontroller.h"
#include "vstgui/lib/controls/ccontrol.h"
//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
EditorSizeController::EditorSizeController (EditController* /*editController*/,
const SizeFunc& sizeFunc, double currentSizeFactor)
: sizeFunc (sizeFunc)
{
const auto kMaxValue = static_cast<ParamValue> (kSizeFactors.size () - 1);
sizeParameter = new RangeParameter (STR ("EditorSize"), kSizeParamTag, nullptr, 0, kMaxValue, 1,
static_cast<int32> (kMaxValue));
setSizeFactor (currentSizeFactor);
sizeParameter->addDependent (this);
}
//------------------------------------------------------------------------
EditorSizeController::~EditorSizeController ()
{
if (sizeParameter)
sizeParameter->removeDependent (this);
}
//------------------------------------------------------------------------
void PLUGIN_API EditorSizeController::update (FUnknown* changedUnknown, int32 /*message*/)
{
auto* param = FCast<Parameter> (changedUnknown);
if (param && param->getInfo ().id == kSizeParamTag)
{
auto index = static_cast<size_t> (param->toPlain (param->getNormalized ()));
if (sizeFunc)
sizeFunc (kSizeFactors.at (index));
}
}
//------------------------------------------------------------------------
VSTGUI::CView* EditorSizeController::verifyView (VSTGUI::CView* view,
const VSTGUI::UIAttributes& /*attributes*/,
const VSTGUI::IUIDescription* /*description*/)
{
auto* control = dynamic_cast<VSTGUI::CControl*> (view);
if (control)
{
sizeControl = control;
sizeControl->setValueNormalized (static_cast<float> (sizeParameter->getNormalized ()));
sizeControl->setListener (this);
sizeParameter->deferUpdate ();
}
return view;
}
//------------------------------------------------------------------------
void EditorSizeController::valueChanged (VSTGUI::CControl* pControl)
{
if (!pControl)
return;
auto normValue = static_cast<ParamValue> (pControl->getValue ());
sizeParameter->setNormalized (normValue);
}
//------------------------------------------------------------------------
void EditorSizeController::controlBeginEdit (VSTGUI::CControl* pControl)
{
if (!pControl)
return;
}
//------------------------------------------------------------------------
void EditorSizeController::controlEndEdit (VSTGUI::CControl* pControl)
{
if (!pControl)
return;
}
//------------------------------------------------------------------------
void EditorSizeController::setSizeFactor (double factor)
{
if (!sizeParameter)
return;
auto iter = std::find (kSizeFactors.begin (), kSizeFactors.end (), factor);
if (iter != kSizeFactors.end ())
{
sizeParameter->setNormalized (
sizeParameter->toNormalized (static_cast<ParamValue> (iter - kSizeFactors.begin ())));
if (sizeControl)
sizeControl->setValueNormalized (static_cast<float> (sizeParameter->getNormalized ()));
}
}
//------------------------------------------------------------------------
} // Vst
} // Steinberg
@@ -0,0 +1,63 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/hostchecker.h
// Created by : Steinberg, 04/2012
// 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 "vstgui/lib/vstguifwd.h"
#include "vstgui/uidescription/icontroller.h"
#include "public.sdk/source/vst/vsteditcontroller.h"
#include "public.sdk/source/vst/vstparameters.h"
#include "base/source/fobject.h"
#include <functional>
#include <vector>
//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
using SizeFactors = std::vector<float>;
static const SizeFactors kSizeFactors = {0.75f, 1.f, 1.5f};
class EditorSizeController : public FObject, public VSTGUI::IController
{
public:
//------------------------------------------------------------------------
using SizeFunc = std::function<void (float)>;
EditorSizeController (EditController* editController, const SizeFunc& sizeFunc, double currentSizeFactor);
~EditorSizeController () override;
static const int32_t kSizeParamTag = 2000;
void PLUGIN_API update (FUnknown* changedUnknown, int32 message) override;
VSTGUI::CView* verifyView (VSTGUI::CView* view, const VSTGUI::UIAttributes& attributes,
const VSTGUI::IUIDescription* description) override;
void valueChanged (VSTGUI::CControl* pControl) override;
void controlBeginEdit (VSTGUI::CControl* pControl) override;
void controlEndEdit (VSTGUI::CControl* pControl) override;
void setSizeFactor (double factor);
OBJ_METHODS (EditorSizeController, FObject)
//------------------------------------------------------------------------
private:
VSTGUI::CControl* sizeControl = nullptr;
RangeParameter* sizeParameter = nullptr;
SizeFunc sizeFunc;
};
//------------------------------------------------------------------------
} // Vst
} // Steinberg
@@ -0,0 +1,263 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/eventlistcheck.cpp
// Created by : Steinberg, 12/2012
// Description : Event List check
//
//-----------------------------------------------------------------------------
// 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 "eventlistcheck.h"
#include "eventlogger.h"
#include "logevents.h"
#include "pluginterfaces/vst/ivstcomponent.h"
#include "pluginterfaces/vst/ivstevents.h"
//------------------------------------------------------------------------
// EventListCheck
//------------------------------------------------------------------------
EventListCheck::EventListCheck () : mEventLogger (nullptr), mComponent (nullptr)
{
}
//------------------------------------------------------------------------
void EventListCheck::check (Steinberg::Vst::IEventList* events)
{
if (events)
{
if (!checkEventCount (events))
mEventLogger->addLogEvent (kLogIdNumInputEventExceedsLimit);
Steinberg::int32 lastSampleOffset = 0;
Steinberg::Vst::TQuarterNotes lastPpqPosition = 0;
Steinberg::int32 eventCount = events->getEventCount ();
for (Steinberg::int32 eventIdx = 0; eventIdx < eventCount; ++eventIdx)
{
Steinberg::Vst::Event event = {};
Steinberg::tresult tResult = events->getEvent (eventIdx, event);
if (tResult != Steinberg::kResultOk)
{
mEventLogger->addLogEvent (kLogIdCouldNotGetAnInputEvent);
continue;
}
if (event.sampleOffset < lastSampleOffset)
{
mEventLogger->addLogEvent (kLogIdEventsAreNotSortedBySampleOffset);
lastSampleOffset = event.sampleOffset;
}
if (event.ppqPosition < lastPpqPosition)
{
mEventLogger->addLogEvent (kLogIdEventsAreNotSortedByPpqPosition);
event.ppqPosition = lastPpqPosition;
}
checkEventProperties (event);
}
}
}
//------------------------------------------------------------------------
bool EventListCheck::checkEventCount (Steinberg::Vst::IEventList* events)
{
if (events)
{
return events->getEventCount () >= 0 || events->getEventCount () < kMaxEvents;
}
return true;
}
//------------------------------------------------------------------------
void EventListCheck::checkEventProperties (const Steinberg::Vst::Event& event)
{
//! TODO: Make this method smaller
if (!checkEventBusIndex (event.busIndex))
{
mEventLogger->addLogEvent (kLogIdInvalidEventBusIndex);
return;
}
if (!checkEventSampleOffset (event.sampleOffset))
{
mEventLogger->addLogEvent (kLogIdInvalidEventSampleOffset);
}
switch (event.type)
{
case Steinberg::Vst::Event::kNoteOnEvent:
{
if (!checkEventChannelIndex (event.busIndex, event.noteOn.channel))
mEventLogger->addLogEvent (kLogIdInvalidNoteOnChannelIndex);
if (!isNormalized (event.noteOn.velocity))
mEventLogger->addLogEvent (kLogIdInvalidEventVelocityValue);
if (!checkValidPitch (event.noteOn.pitch))
mEventLogger->addLogEvent (kLogIdInvalidEventPitchValue);
if (mNotePitches.find (event.noteOn.pitch) != mNotePitches.end ())
{
mEventLogger->addLogEvent (kLogIdNoteOnWithPitchAlreadyTriggered);
}
mNotePitches.insert (event.noteOn.pitch);
if (event.noteOn.noteId >= 0)
{
if (mNoteIDs.find (event.noteOn.noteId) != mNoteIDs.end ())
mEventLogger->addLogEvent (kLogIdNoteOnWithIdAlreadyTriggered);
}
mNoteIDs.insert (event.noteOn.noteId);
break;
}
case Steinberg::Vst::Event::kNoteOffEvent: ///< is \ref NoteOffEvent
{
if (!checkEventChannelIndex (event.busIndex, event.noteOff.channel))
mEventLogger->addLogEvent (kLogIdInvalidNoteOffChannelIndex);
if (!isNormalized (event.noteOff.velocity))
mEventLogger->addLogEvent (kLogIdInvalidEventVelocityValue);
if (!checkValidPitch (event.noteOff.pitch))
mEventLogger->addLogEvent (kLogIdInvalidEventPitchValue);
if (mNotePitches.find (event.noteOff.pitch) == mNotePitches.end ())
{
mEventLogger->addLogEvent (kLogIdNoteOffWithPitchNeverTriggered);
}
mNotePitches.erase (event.noteOff.pitch);
if (event.noteOff.noteId >= 0)
{
if (mNoteIDs.find (event.noteOff.noteId) == mNoteIDs.end ())
{
mEventLogger->addLogEvent (kLogIdNoteOffWithIdNeverTriggered);
}
}
mNoteIDs.erase (event.noteOff.noteId);
break;
}
case Steinberg::Vst::Event::kDataEvent: ///< is \ref DataEvent
{
break;
}
case Steinberg::Vst::Event::kPolyPressureEvent: ///< is \ref PolyPressureEvent
{
if (!checkEventChannelIndex (event.busIndex, event.polyPressure.channel))
mEventLogger->addLogEvent (kLogIdInvalidPolyPressChannelIndex);
break;
}
case Steinberg::Vst::Event::kNoteExpressionValueEvent: ///< is \ref NoteExpressionValueEvent
{
if (!isNormalized (event.noteExpressionValue.value))
mEventLogger->addLogEvent (kLogIdNoteExpressValNotNormalized);
checkNoteExpressionValueEvent (event.noteExpressionValue.typeId,
event.noteExpressionValue.noteId,
event.noteExpressionValue.value);
break;
}
default:
{
mEventLogger->addLogEvent (kLogIdUnknownEventType);
break;
}
}
}
//------------------------------------------------------------------------
bool EventListCheck::checkEventBusIndex (Steinberg::int32 busIndex)
{
if (mComponent)
{
Steinberg::int32 busCount =
mComponent->getBusCount (Steinberg::Vst::kEvent, Steinberg::Vst::kInput);
return busCount >= 0 && busIndex < busCount;
}
return false;
}
//------------------------------------------------------------------------
bool EventListCheck::checkEventSampleOffset (Steinberg::int32 sampleOffset)
{
return sampleOffset >= 0 && sampleOffset < mSetup.maxSamplesPerBlock;
}
//------------------------------------------------------------------------
bool EventListCheck::checkEventChannelIndex (Steinberg::int32 busIndex,
Steinberg::int32 channelIndex)
{
if (mComponent)
{
Steinberg::int32 busCount =
mComponent->getBusCount (Steinberg::Vst::kEvent, Steinberg::Vst::kInput);
if (busCount >= 0 && busIndex < busCount)
{
Steinberg::Vst::BusInfo busInfo = {};
Steinberg::tresult tResult = mComponent->getBusInfo (
Steinberg::Vst::kEvent, Steinberg::Vst::kInput, busIndex, busInfo);
if (tResult == Steinberg::kResultOk)
{
return channelIndex >= 0 && channelIndex < busInfo.channelCount;
}
}
}
return false;
}
//------------------------------------------------------------------------
bool EventListCheck::checkValidPitch (Steinberg::int16 pitch)
{
return pitch >= 0 && pitch <= 127;
}
//------------------------------------------------------------------------
bool EventListCheck::isNormalized (double normVal) const
{
return normVal >= 0. && normVal <= 1.;
}
//------------------------------------------------------------------------
void EventListCheck::checkNoteExpressionValueEvent (
Steinberg::Vst::NoteExpressionTypeID /*type*/, Steinberg::int32 /*id*/,
Steinberg::Vst::NoteExpressionValue exprVal) const
{
if (!isNormalized (exprVal))
{
//! Todo
}
}
//------------------------------------------------------------------------
void EventListCheck::setProcessSetup (Steinberg::Vst::ProcessSetup setup)
{
mSetup = setup;
}
//------------------------------------------------------------------------
void EventListCheck::setEventLogger (EventLogger* eventLogger)
{
mEventLogger = eventLogger;
}
@@ -0,0 +1,70 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/eventlistcheck.h
// Created by : Steinberg, 12/2012
// Description : Event List check
//
//-----------------------------------------------------------------------------
// 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/ftypes.h"
#include "pluginterfaces/vst/ivstaudioprocessor.h"
#include "pluginterfaces/vst/ivstnoteexpression.h"
#include <set>
class EventLogger;
namespace Steinberg {
namespace Vst {
class IEventList;
class IComponent;
struct ProcessSetup;
struct Event;
}
}
//------------------------------------------------------------------------
// EventListCheck
//------------------------------------------------------------------------
class EventListCheck
{
public:
//------------------------------------------------------------------------
EventListCheck ();
static const Steinberg::int32 kMaxEvents = 2048;
using Notes = std::set<Steinberg::int32>;
void check (Steinberg::Vst::IEventList* events);
void setComponent (Steinberg::Vst::IComponent* component) { mComponent = component; }
void setProcessSetup (Steinberg::Vst::ProcessSetup setup);
void setEventLogger (EventLogger* eventLogger);
//------------------------------------------------------------------------
protected:
bool checkEventCount (Steinberg::Vst::IEventList* events);
void checkEventProperties (const Steinberg::Vst::Event& event);
bool checkEventBusIndex (Steinberg::int32 busIndex);
bool checkEventSampleOffset (Steinberg::int32 sampleOffset);
bool checkEventChannelIndex (Steinberg::int32 busIndex, Steinberg::int32 channelIndex);
bool checkValidPitch (Steinberg::int16 pitch);
bool isNormalized (double normVal) const;
void checkNoteExpressionValueEvent (Steinberg::Vst::NoteExpressionTypeID type,
Steinberg::int32 id,
Steinberg::Vst::NoteExpressionValue exprVal) const;
EventLogger* mEventLogger;
Steinberg::Vst::IComponent* mComponent;
Steinberg::Vst::ProcessSetup mSetup;
Notes mNotePitches;
Notes mNoteIDs;
};
@@ -0,0 +1,272 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/eventlogdatabrowsersource.cpp
// Created by : Steinberg, 12/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 "eventlogdatabrowsersource.h"
#include "pluginterfaces/base/ustring.h"
#include "logevents.h"
using namespace Steinberg;
using namespace Steinberg::Vst;
namespace VSTGUI {
//-----------------------------------------------------------------------------
EventLogDataBrowserSource::EventLogDataBrowserSource (EditControllerEx1* /*editController*/)
{
mLogEvents.resize (kNumLogEvents);
for (Steinberg::uint32 i = 0; i < mLogEvents.size (); ++i)
mLogEvents[i].id = i;
}
//-----------------------------------------------------------------------------
EventLogDataBrowserSource::~EventLogDataBrowserSource () {}
//-----------------------------------------------------------------------------
int32_t EventLogDataBrowserSource::dbGetNumRows (CDataBrowser* browser) { (void)browser; return kNumLogEvents; }
//-----------------------------------------------------------------------------
int32_t EventLogDataBrowserSource::dbGetNumColumns (CDataBrowser* browser) { (void)browser; return kNumColumns; }
//-----------------------------------------------------------------------------
bool EventLogDataBrowserSource::dbGetColumnDescription (int32_t index, CCoord& minWidth,
CCoord& maxWidth, CDataBrowser* browser)
{
(void)index;
(void)minWidth;
(void)maxWidth;
(void)browser;
return false;
}
//-----------------------------------------------------------------------------
CCoord EventLogDataBrowserSource::dbGetCurrentColumnWidth (int32_t index, CDataBrowser* browser)
{
static const CCoord typeWidth = 40;
static const int32 countWidth = 80;
if (index == kType)
return typeWidth;
if (index == kCount)
return countWidth;
return browser->getWidth () - (typeWidth + countWidth);
}
//-----------------------------------------------------------------------------
void EventLogDataBrowserSource::dbSetCurrentColumnWidth (int32_t index, const CCoord& width,
CDataBrowser* browser)
{
(void)index;
(void)width;
(void)browser;
}
//-----------------------------------------------------------------------------
CCoord EventLogDataBrowserSource::dbGetRowHeight (CDataBrowser* browser) { (void)browser;return 18; }
//-----------------------------------------------------------------------------
bool EventLogDataBrowserSource::dbGetLineWidthAndColor (CCoord& width, CColor& color,
CDataBrowser* browser)
{
(void)browser;
width = 1.;
color = kGreyCColor;
return true;
}
//-----------------------------------------------------------------------------
void EventLogDataBrowserSource::dbDrawHeader (CDrawContext* context, const CRect& size,
int32_t column, int32_t flags, CDataBrowser* browser)
{
(void)flags;
(void)browser;
context->setDrawMode (kAliasing);
context->setFillColor (kGreyCColor);
context->drawRect (size, kDrawFilled);
UTF8String name;
switch (column)
{
case kType: name = "Type"; break;
case kCount: name = "Count"; break;
case kDescription: name = "Description"; break;
}
context->setFont (kNormalFont);
context->setFontColor (kBlackCColor);
context->drawString (name, size);
}
//-----------------------------------------------------------------------------
void EventLogDataBrowserSource::dbDrawCell (CDrawContext* context, const CRect& size, int32_t row,
int32_t column, int32_t flags, CDataBrowser* browser)
{
(void)flags;
(void)browser;
CColor cellColor (kWhiteCColor);
bool oddRow = row % 2 != 0;
if (oddRow)
{
cellColor = kBlackCColor;
cellColor.alpha /= 16;
}
UTF8String cellValue;
LogEvent& logEvent = mLogEvents.at (row);
if (logEvent.count > 0)
{
if (UTF8String (LOG_ERR) == logEventSeverity[logEvent.id])
cellColor = kRedCColor;
else if (UTF8String (LOG_WARN) == logEventSeverity[logEvent.id])
cellColor = kYellowCColor;
else if (UTF8String (LOG_INFO) == logEventSeverity[logEvent.id])
cellColor = kBlueCColor;
if (oddRow)
cellColor.alpha /= 2;
else
cellColor.alpha /= 3;
}
context->setFillColor (cellColor);
context->drawRect (size, kDrawFilled);
switch (column)
{
case kType:
{
if (logEvent.count > 0)
cellValue = logEventSeverity[logEvent.id];
break;
}
case kDescription:
{
cellValue = logEventDescriptions[row];
break;
}
case kCount:
{
char txt[32];
snprintf (txt, 32, "%" FORMAT_INT64A, logEvent.count);
cellValue = txt;
break;
}
}
CRect cellSize (size);
cellSize.inset (5, 0);
context->setFont (kNormalFontSmall);
context->setFontColor (kBlackCColor);
context->drawString (cellValue, cellSize, kLeftText);
}
//-----------------------------------------------------------------------------
CMouseEventResult EventLogDataBrowserSource::dbOnMouseDown (const CPoint& where,
const CButtonState& buttons,
int32_t row, int32_t column,
CDataBrowser* browser)
{
(void)browser;
(void)column;
(void)row;
(void)buttons;
(void)where;
return kMouseDownEventHandledButDontNeedMovedOrUpEvents;
}
//-----------------------------------------------------------------------------
CMouseEventResult EventLogDataBrowserSource::dbOnMouseMoved (const CPoint& where,
const CButtonState& buttons,
int32_t row, int32_t column,
CDataBrowser* browser)
{
(void)browser;
(void)column;
(void)row;
(void)buttons;
(void)where;
return kMouseEventNotHandled;
}
//-----------------------------------------------------------------------------
CMouseEventResult EventLogDataBrowserSource::dbOnMouseUp (const CPoint& where,
const CButtonState& buttons, int32_t row,
int32_t column, CDataBrowser* browser)
{
(void)browser;
(void)column;
(void)row;
(void)buttons;
(void)where;
return kMouseEventNotHandled;
}
//-----------------------------------------------------------------------------
void EventLogDataBrowserSource::dbSelectionChanged (CDataBrowser* browser) { (void)browser; }
//-----------------------------------------------------------------------------
void EventLogDataBrowserSource::dbCellTextChanged (int32_t row, int32_t column,
UTF8StringPtr newText, CDataBrowser* browser)
{
(void)browser;
(void)column;
(void)row;
(void)newText;
}
//-----------------------------------------------------------------------------
void EventLogDataBrowserSource::dbCellSetupTextEdit (int32_t row, int32_t column,
CTextEdit* textEditControl,
CDataBrowser* browser)
{
(void)browser;
(void)column;
(void)row;
textEditControl->setBackColor (kWhiteCColor);
textEditControl->setFont (kNormalFontSmall);
textEditControl->setFontColor (kRedCColor);
textEditControl->setTextInset (CPoint (5, 0));
textEditControl->setHoriAlign (kLeftText);
}
//-----------------------------------------------------------------------------
int32_t EventLogDataBrowserSource::dbOnKeyDown (const VstKeyCode& key, CDataBrowser* browser)
{
(void)key;
(void)browser;
return -1;
}
//-----------------------------------------------------------------------------
bool EventLogDataBrowserSource::updateLog (const LogEvent& logEvent, bool incrementCount)
{
bool bResult = mLogEvents[logEvent.id].count != logEvent.count;
LogEvent& tmpEvent = mLogEvents.at (logEvent.id);
if (incrementCount)
{
tmpEvent.count += logEvent.count;
return true;
}
tmpEvent.count = logEvent.count;
return bResult;
}
//-----------------------------------------------------------------------------
} // namespace
@@ -0,0 +1,80 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/eventlogdatabrowsersource.h
// Created by : Steinberg, 04/2012
// 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"
#include "vstgui/vstgui.h"
#include "logevents.h"
namespace VSTGUI {
//-----------------------------------------------------------------------------
class EventLogDataBrowserSource : public CBaseObject, public DataBrowserDelegateAdapter
{
public:
EventLogDataBrowserSource (Steinberg::Vst::EditControllerEx1* editController);
~EventLogDataBrowserSource () override;
using LogEvents = std::vector<LogEvent>;
enum eColoumns
{
kType = 0,
kDescription,
kCount,
kNumColumns
};
int32_t dbGetNumRows (CDataBrowser* browser) SMTG_OVERRIDE;
int32_t dbGetNumColumns (CDataBrowser* browser) SMTG_OVERRIDE;
bool dbGetColumnDescription (int32_t index, CCoord& minWidth, CCoord& maxWidth,
CDataBrowser* browser) SMTG_OVERRIDE;
CCoord dbGetCurrentColumnWidth (int32_t index, CDataBrowser* browser) SMTG_OVERRIDE;
void dbSetCurrentColumnWidth (int32_t index, const CCoord& width,
CDataBrowser* browser) SMTG_OVERRIDE;
CCoord dbGetRowHeight (CDataBrowser* browser) SMTG_OVERRIDE;
bool dbGetLineWidthAndColor (CCoord& width, CColor& color, CDataBrowser* browser) SMTG_OVERRIDE;
void dbDrawHeader (CDrawContext* context, const CRect& size, int32_t column, int32_t flags,
CDataBrowser* browser) SMTG_OVERRIDE;
void dbDrawCell (CDrawContext* context, const CRect& size, int32_t row, int32_t column,
int32_t flags, CDataBrowser* browser) SMTG_OVERRIDE;
CMouseEventResult dbOnMouseDown (const CPoint& where, const CButtonState& buttons, int32_t row,
int32_t column, CDataBrowser* browser) SMTG_OVERRIDE;
CMouseEventResult dbOnMouseMoved (const CPoint& where, const CButtonState& buttons, int32_t row,
int32_t column, CDataBrowser* browser) SMTG_OVERRIDE;
CMouseEventResult dbOnMouseUp (const CPoint& where, const CButtonState& buttons, int32_t row,
int32_t column, CDataBrowser* browser) SMTG_OVERRIDE;
void dbSelectionChanged (CDataBrowser* browser) SMTG_OVERRIDE;
void dbCellTextChanged (int32_t row, int32_t column, UTF8StringPtr newText,
CDataBrowser* browser) SMTG_OVERRIDE;
void dbCellSetupTextEdit (int32_t row, int32_t column, CTextEdit* textEditControl,
CDataBrowser* browser) SMTG_OVERRIDE;
int32_t dbOnKeyDown (const VstKeyCode& key, CDataBrowser* browser) SMTG_OVERRIDE;
bool updateLog (const LogEvent& logEvent, bool incrementCount = false);
const LogEvents& getLogEvents () const { return mLogEvents; }
protected:
LogEvents mLogEvents;
};
} // namespace VSTGUI
@@ -0,0 +1,56 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/eventlogger.cpp
// Created by : Steinberg, 12/2012
// Description : Event List check
//
//-----------------------------------------------------------------------------
// 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 "eventlogger.h"
#include "logevents.h"
//------------------------------------------------------------------------
// EventLogger
//------------------------------------------------------------------------
EventLogger::EventLogger ()
{
mLogEvents.resize (kNumLogEvents);
for (Steinberg::uint32 i = 0; i < mLogEvents.size (); ++i)
{
mLogEvents[i].id = i;
mLogEvents[i].fromProcessor = logEventContext[i];
}
}
//------------------------------------------------------------------------
void EventLogger::clearLogEvents ()
{
mLogEvents.clear ();
}
//------------------------------------------------------------------------
void EventLogger::resetLogEvents ()
{
for (auto& mLogEvent : mLogEvents)
{
mLogEvent.count = 0;
}
}
//------------------------------------------------------------------------
const EventLogger::Codes& EventLogger::getLogEvents () const { return mLogEvents; }
//------------------------------------------------------------------------
void EventLogger::addLogEvent (Steinberg::int32 logId)
{
LogEvent& logEvent = mLogEvents.at (logId);
logEvent.count++;
}
@@ -0,0 +1,42 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/eventlogger.h
// Created by : Steinberg, 12/2012
// Description : Event List check
//
//-----------------------------------------------------------------------------
// 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/ftypes.h"
#include <vector>
//------------------------------------------------------------------------
// EventLogger
//------------------------------------------------------------------------
class EventLogger
{
public:
//------------------------------------------------------------------------
EventLogger ();
using Codes = std::vector<struct LogEvent>;
void clearLogEvents ();
void resetLogEvents ();
const Codes& getLogEvents () const;
void addLogEvent (Steinberg::int32 logId);
bool empty () const { return mLogEvents.empty (); }
//------------------------------------------------------------------------
protected:
Codes mLogEvents;
};
@@ -0,0 +1,41 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/factory.cpp
// Created by : Steinberg, 04/2012
// 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 "public.sdk/source/main/pluginfactory.h"
#include "hostcheckerprocessor.h"
#include "hostcheckercontroller.h"
#include "cids.h"
#include "version.h" // for versioning
BEGIN_FACTORY_DEF (stringCompanyName, stringCompanyWeb, stringCompanyEmail)
//---First plug-in included in this factory-------
// its kVstAudioEffectClass component
DEF_CLASS2 (INLINE_UID_FROM_FUID (Steinberg::Vst::HostCheckerProcessorUID),
PClassInfo::kManyInstances, kVstAudioEffectClass, stringPluginName, Vst::kDistributable,
"Fx|Instrument", /*"Fx",*/ /*"Spatial|Fx|Instrument|Up-Downmix",*/
FULL_VERSION_STR, // Plug-in version (to be changed)
kVstVersionString, Steinberg::Vst::HostCheckerProcessor::createInstance)
DEF_CLASS2 (INLINE_UID_FROM_FUID (Steinberg::Vst::HostCheckerControllerUID),
PClassInfo::kManyInstances, kVstComponentControllerClass,
stringPluginName, // 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::HostCheckerController::createInstance)
END_FACTORY
@@ -0,0 +1,148 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/hostcheck.cpp
// Created by : Steinberg, 04/2012
// 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 "hostcheck.h"
#include "logevents.h"
#include "pluginterfaces/vst/ivstaudioprocessor.h"
#include "pluginterfaces/vst/ivstevents.h"
#include "pluginterfaces/vst/ivstnoteexpression.h"
#include "pluginterfaces/vst/ivstparameterchanges.h"
//------------------------------------------------------------------------
HostCheck::HostCheck ()
{
mProcessSetupCheck.setEventLogger (&mEventLogger);
mProcessContextCheck.setEventLogger (&mEventLogger);
mEventListCheck.setEventLogger (&mEventLogger);
mParamChangesCheck.setEventLogger (&mEventLogger);
mParamChangesCheck.setParamIDs (&mParameterIds);
}
//------------------------------------------------------------------------
void HostCheck::addParameter (Steinberg::Vst::ParamID paramId)
{
mParameterIds.insert (paramId);
mParamChangesCheck.updateParameterIDs ();
}
//------------------------------------------------------------------------
void HostCheck::addLogEvent (Steinberg::int32 logId)
{
mEventLogger.addLogEvent (logId);
}
//------------------------------------------------------------------------
bool HostCheck::validate (Steinberg::Vst::ProcessData& data, Steinberg::int32 minInputBufferCount,
Steinberg::int32 minOutputBufferCount)
{
mProcessSetupCheck.check (data);
mProcessContextCheck.check (data.processContext);
mEventListCheck.check (data.inputEvents);
mParamChangesCheck.checkParameterChanges (data.inputParameterChanges);
checkAudioBuffers (data.inputs, data.numInputs, Steinberg::Vst::kInput, data.symbolicSampleSize,
minInputBufferCount);
checkAudioBuffers (data.outputs, data.numOutputs, Steinberg::Vst::kOutput,
data.symbolicSampleSize, minOutputBufferCount);
return mEventLogger.empty ();
}
//------------------------------------------------------------------------
void HostCheck::checkAudioBuffers (Steinberg::Vst::AudioBusBuffers* buffers,
Steinberg::int32 numBuffers, Steinberg::Vst::BusDirection dir,
Steinberg::int32 symbolicSampleSize,
Steinberg::int32 minBufferCount)
{
if (mComponent)
{
if (numBuffers > 0)
{
bool isValid = minBufferCount <= numBuffers;
if (!isValid)
{
addLogEvent (kLogIdAudioBufNotMatchComponentBusCount);
}
// check only output, an instrument could have side chain input not activated
if (dir == Steinberg::Vst::BusDirections::kOutput && minBufferCount == 0)
{
addLogEvent (kLogIdNoBusActivated);
}
}
}
if (numBuffers > 0)
{
if (!buffers)
{
addLogEvent (kLogIdNullPointerToAudioBusBuffer);
return;
}
for (Steinberg::int32 bufferIdx = 0; bufferIdx < numBuffers; ++bufferIdx)
{
Steinberg::Vst::BusInfo busInfo = {};
mComponent->getBusInfo (Steinberg::Vst::kAudio, dir, bufferIdx, busInfo);
Steinberg::Vst::AudioBusBuffers& tmpBuffers = buffers[bufferIdx];
if (tmpBuffers.numChannels != busInfo.channelCount)
{
addLogEvent (kLogIdInvalidAudioBufNumOfChannels);
}
if (symbolicSampleSize == Steinberg::Vst::kSample32)
{
for (Steinberg::int32 chIdx = 0; chIdx < tmpBuffers.numChannels; ++chIdx)
{
if (!tmpBuffers.channelBuffers32 || !tmpBuffers.channelBuffers32[chIdx])
{
if (busInfo.busType == Steinberg::Vst::kAux)
addLogEvent (kLogIdNullPointerToAuxChannelBuf);
else
addLogEvent (kLogIdNullPointerToChannelBuf);
}
}
}
else
{
for (Steinberg::int32 chIdx = 0; chIdx < tmpBuffers.numChannels; ++chIdx)
{
if (!tmpBuffers.channelBuffers64 || !tmpBuffers.channelBuffers64[chIdx])
{
if (busInfo.busType == Steinberg::Vst::kAux)
addLogEvent (kLogIdNullPointerToAuxChannelBuf);
else
addLogEvent (kLogIdNullPointerToChannelBuf);
}
}
}
}
}
}
//------------------------------------------------------------------------
void HostCheck::setComponent (Steinberg::Vst::IComponent* component)
{
mEventListCheck.setComponent (component);
mComponent = component;
}
//------------------------------------------------------------------------
void HostCheck::setProcessSetup (Steinberg::Vst::ProcessSetup& setup)
{
mProcessSetupCheck.setProcessSetup (setup);
mEventListCheck.setProcessSetup (setup);
mProcessContextCheck.setSampleRate (setup.sampleRate);
}
@@ -0,0 +1,81 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostcheck/source/hostcheck.h
// Created by : Steinberg, 04/2012
// 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 "pluginterfaces/vst/ivstaudioprocessor.h"
#include "pluginterfaces/vst/ivstevents.h"
#include <vector>
#include <set>
#include "logevents.h"
#include "eventlogger.h"
#include "processsetupcheck.h"
#include "processcontextcheck.h"
#include "eventlistcheck.h"
#include "parameterchangescheck.h"
namespace Steinberg {
namespace Vst {
class IEventList;
class IComponent;
}
}
//------------------------------------------------------------------------
// ProcessDataValidator
//------------------------------------------------------------------------
class HostCheck
{
public:
//------------------------------------------------------------------------
static HostCheck& Instance ()
{
static HostCheck instance;
return instance;
}
using ParamIDs = std::set<Steinberg::Vst::ParamID>;
HostCheck ();
void addParameter (Steinberg::Vst::ParamID paramId);
void setProcessSetup (Steinberg::Vst::ProcessSetup& setup);
void setComponent (Steinberg::Vst::IComponent* component);
bool validate (Steinberg::Vst::ProcessData& data, Steinberg::int32 minInputBufferCount,
Steinberg::int32 minOutputBufferCount);
const EventLogger::Codes& getEventLogs () const { return mEventLogger.getLogEvents (); }
EventLogger& getEventLogger ()
{
return mEventLogger;
} /// Caution logger is used by audio thread...!!!
//------------------------------------------------------------------------
private:
void addLogEvent (Steinberg::int32 logId);
void checkAudioBuffers (Steinberg::Vst::AudioBusBuffers* buffers, Steinberg::int32 numBuffers,
Steinberg::Vst::BusDirection dir, Steinberg::int32 symbolicSampleSize,
Steinberg::int32 minBufferCount);
Steinberg::Vst::IComponent* mComponent {nullptr};
ParamIDs mParameterIds;
ProcessSetupCheck mProcessSetupCheck;
ProcessContextCheck mProcessContextCheck;
EventListCheck mEventListCheck;
ParameterChangesCheck mParamChangesCheck;
EventLogger mEventLogger;
};
//------------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,300 @@
//-----------------------------------------------------------------------------
// Flags : clang-format SMTGSequencer
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/hostcheckercontroller.h
// Created by : Steinberg, 04/2012
// 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 "eventlogdatabrowsersource.h"
#include "hostcheck.h"
#include "logevents.h"
#include "vstgui/lib/cvstguitimer.h"
#include "vstgui/plugin-bindings/vst3editor.h"
#include "public.sdk/source/common/threadchecker.h"
#include "public.sdk/source/vst/utility/dataexchange.h"
#include "public.sdk/source/vst/vstaudioeffect.h"
#include "public.sdk/source/vst/vsteditcontroller.h"
#include "base/source/fstring.h"
#include "pluginterfaces/vst/ivstautomationstate.h"
#include "pluginterfaces/vst/ivstchannelcontextinfo.h"
#include "pluginterfaces/vst/ivstmidilearn.h"
#include "pluginterfaces/vst/ivstnoteexpression.h"
#include "pluginterfaces/vst/ivstparameterfunctionname.h"
#include "pluginterfaces/vst/ivstphysicalui.h"
#include "pluginterfaces/vst/ivstprefetchablesupport.h"
#include "pluginterfaces/vst/ivstremapparamid.h"
#include "pluginterfaces/vst/ivstrepresentation.h"
namespace Steinberg {
namespace HostChecker {
const double kMaxLatencyInSeconds = 10.; // this is quite big for a latency (max used by Cubase)
const uint32 kParamWarnCount = 8;
const uint32 kParamWarnBitCount = 24;
const uint32 kParamWarnStepCount = 1 << kParamWarnBitCount;
const uint32 kParamUnitStruct1Count = 4;
const uint32 kParamUnitStruct2Count = 4;
const uint32 kParamUnitStruct3Count = 2;
const uint32 kParamUnitStructCount =
2 * (kParamUnitStruct1Count * kParamUnitStruct2Count * kParamUnitStruct3Count + 1);
}
namespace Vst {
enum
{
// for Parameters
kProcessingLoadTag = 1000,
kGeneratePeaksTag,
kLatencyTag,
kBypassTag,
kCanResizeTag,
kScoreTag,
kParamWhichCouldBeHiddenTag,
kTriggerHiddenTag,
kTriggerProgressTag,
kProgressValueTag,
kCopy2ClipboardTag,
kRestartNoteExpressionChangedTag,
kRestartKeyswitchChangedTag,
kRestartParamValuesChangedTag,
kRestartParamTitlesChangedTag,
kProcessContextProjectTimeSamplesTag,
kProcessContextProjectTimeMusicTag,
kProcessContextTempoTag,
kProcessContextStateTag,
kProcessContextSystemTimeTag,
kProcessContextContinousTimeSamplesTag,
kProcessContextTimeSigNumeratorTag,
kProcessContextTimeSigDenominatorTag,
kProcessContextBarPositionMusicTag,
kParamLowLatencyTag,
kParamRandomizeTag,
kParamProcessModeTag,
kProcessWarnTag,
kLastTag = kProcessWarnTag + HostChecker::kParamWarnCount,
kParamUnitStructStart,
kParamUnitStructEnd = kParamUnitStructStart + HostChecker::kParamUnitStructCount,
// for Units
kUnitId = 1234,
kUnit2Id = 1235,
kUnitParamIdStart = 2345,
};
class EditorSizeController;
//-----------------------------------------------------------------------------
class HostCheckerController : public EditControllerEx1,
public VSTGUI::VST3EditorDelegate,
public ChannelContext::IInfoListener,
public IXmlRepresentationController,
public IAutomationState,
public IEditControllerHostEditing,
public IMidiMapping,
public IMidiLearn,
public INoteExpressionController,
public INoteExpressionPhysicalUIMapping,
public IKeyswitchController,
public IParameterFunctionName,
public IDataExchangeReceiver,
public IRemapParamID
{
public:
using UTF8StringPtr = VSTGUI::UTF8StringPtr;
using IController = VSTGUI::IController;
using IUIDescription = VSTGUI::IUIDescription;
using VST3Editor = VSTGUI::VST3Editor;
HostCheckerController ();
tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE;
tresult PLUGIN_API terminate () SMTG_OVERRIDE;
tresult PLUGIN_API setComponentState (IBStream* state) SMTG_OVERRIDE;
tresult PLUGIN_API getUnitByBus (MediaType type, BusDirection dir, int32 busIndex,
int32 channel, UnitID& unitId /*out*/) SMTG_OVERRIDE;
tresult PLUGIN_API setComponentHandler (IComponentHandler* handler) SMTG_OVERRIDE;
int32 PLUGIN_API getUnitCount () SMTG_OVERRIDE;
tresult PLUGIN_API setParamNormalized (ParamID tag, ParamValue value) SMTG_OVERRIDE;
tresult beginEdit (ParamID tag) SMTG_OVERRIDE;
tresult endEdit (ParamID tag) SMTG_OVERRIDE;
IPlugView* PLUGIN_API createView (FIDString name) SMTG_OVERRIDE;
tresult PLUGIN_API notify (IMessage* message) SMTG_OVERRIDE;
tresult PLUGIN_API connect (IConnectionPoint* other) SMTG_OVERRIDE;
//---from VST3EditorDelegate --------------------
VSTGUI::CView* createCustomView (VSTGUI::UTF8StringPtr name,
const VSTGUI::UIAttributes& attributes,
const VSTGUI::IUIDescription* description,
VSTGUI::VST3Editor* editor) SMTG_OVERRIDE;
void willClose (VSTGUI::VST3Editor* editor) SMTG_OVERRIDE;
//---from IEditController2-------
tresult PLUGIN_API setKnobMode (KnobMode mode) SMTG_OVERRIDE;
tresult PLUGIN_API openHelp (TBool /*onlyCheck*/) SMTG_OVERRIDE;
tresult PLUGIN_API openAboutBox (TBool /*onlyCheck*/) SMTG_OVERRIDE;
tresult PLUGIN_API setState (IBStream* state) SMTG_OVERRIDE;
tresult PLUGIN_API getState (IBStream* state) SMTG_OVERRIDE;
//---ChannelContext::IInfoListener-------
tresult PLUGIN_API setChannelContextInfos (IAttributeList* list) SMTG_OVERRIDE;
//---IXmlRepresentationController--------
tresult PLUGIN_API getXmlRepresentationStream (RepresentationInfo& info /*in*/,
IBStream* stream /*out*/) SMTG_OVERRIDE;
//---IMidiMapping---------------------------
tresult PLUGIN_API getMidiControllerAssignment (int32 busIndex, int16 channel,
CtrlNumber midiControllerNumber,
ParamID& id /*out*/) SMTG_OVERRIDE;
//---IMidiLearn-----------------------------
tresult PLUGIN_API onLiveMIDIControllerInput (int32 busIndex, int16 channel,
CtrlNumber midiCC) SMTG_OVERRIDE;
//---INoteExpressionController----------------------
int32 PLUGIN_API getNoteExpressionCount (int32 busIndex, int16 channel) SMTG_OVERRIDE;
tresult PLUGIN_API getNoteExpressionInfo (int32 busIndex, int16 channel,
int32 noteExpressionIndex,
NoteExpressionTypeInfo& info /*out*/) SMTG_OVERRIDE;
tresult PLUGIN_API getNoteExpressionStringByValue (int32 busIndex, int16 channel,
NoteExpressionTypeID id,
NoteExpressionValue valueNormalized /*in*/,
String128 string /*out*/) SMTG_OVERRIDE;
tresult PLUGIN_API getNoteExpressionValueByString (
int32 busIndex, int16 channel, NoteExpressionTypeID id, const TChar* string /*in*/,
NoteExpressionValue& valueNormalized /*out*/) SMTG_OVERRIDE;
//---INoteExpressionPhysicalUIMapping-----------------
tresult PLUGIN_API getPhysicalUIMapping (int32 busIndex, int16 channel,
PhysicalUIMapList& list) SMTG_OVERRIDE;
//--- IKeyswitchController ---------------------------
int32 PLUGIN_API getKeyswitchCount (int32 busIndex, int16 channel) SMTG_OVERRIDE;
tresult PLUGIN_API getKeyswitchInfo (int32 busIndex, int16 channel, int32 keySwitchIndex,
KeyswitchInfo& info /*out*/) SMTG_OVERRIDE;
//---IAutomationState---------------------------------
tresult PLUGIN_API setAutomationState (int32 state) SMTG_OVERRIDE;
//---IEditControllerHostEditing-----------------------
tresult PLUGIN_API beginEditFromHost (ParamID paramID) SMTG_OVERRIDE;
tresult PLUGIN_API endEditFromHost (ParamID paramID) SMTG_OVERRIDE;
//---IParameterFunctionName---------------------------
tresult PLUGIN_API getParameterIDFromFunctionName (UnitID unitID, FIDString functionName,
ParamID& paramID) SMTG_OVERRIDE;
//---IDataExchangeReceiver----------------------------
void PLUGIN_API queueOpened (DataExchangeUserContextID userContextID, uint32 blockSize,
TBool& dispatchOnBackgroundThread) override;
void PLUGIN_API queueClosed (DataExchangeUserContextID userContextID) override;
void PLUGIN_API onDataExchangeBlocksReceived (DataExchangeUserContextID userContextID,
uint32 numBlocks, DataExchangeBlock* block,
TBool onBackgroundThread) override;
//---IRemapParamID -----------------------------------
tresult PLUGIN_API getCompatibleParamID (const TUID pluginToReplaceUID /*in*/,
Vst::ParamID oldParamID /*in*/,
Vst::ParamID& newParamID /*out*/) override;
//--- --------------------------------------------------------------------------
void editorAttached (EditorView* editor) SMTG_OVERRIDE;
void editorRemoved (EditorView* editor) SMTG_OVERRIDE;
void editorDestroyed (EditorView* editor) SMTG_OVERRIDE;
IController* createSubController (UTF8StringPtr name, const IUIDescription* description,
VST3Editor* editor) override;
tresult PLUGIN_API queryInterface (const Steinberg::TUID iid, void** obj) override;
REFCOUNT_METHODS (EditControllerEx1)
static FUnknown* createInstance (void*)
{
return (IEditController*)new HostCheckerController ();
}
void addFeatureLog (int64 iD, int32 count = 1, bool addToLastCount = true);
bool getSavedSize (ViewRect& size) const
{
if (sizeFactor <= 0)
return false;
ViewRect rect (0, 0, width, height);
size = rect;
return true;
}
protected:
void extractCurrentInfo (EditorView* editor);
float updateScoring (int64 iD);
void onProgressTimer (VSTGUI::CVSTGUITimer*);
std::map<VSTGUI::VST3Editor*, VSTGUI::SharedPointer<VSTGUI::CDataBrowser>> mDataBrowserMap;
VSTGUI::SharedPointer<VSTGUI::EventLogDataBrowserSource> mDataSource;
bool mLatencyInEdit {false};
ParamValue mWantedLatency {0.0};
using EditorVector = std::vector<Steinberg::Vst::EditorView*>;
EditorVector editors;
using EditorMap = std::map<Steinberg::Vst::EditorView*, EditorSizeController*>;
EditorMap editorsSubCtlerMap;
uint32 width {0};
uint32 height {0};
double sizeFactor {0};
using EditFromHostMap = std::map<Steinberg::Vst::ParamID, int32>;
EditFromHostMap mEditFromHost;
std::unique_ptr<ThreadChecker> threadChecker {ThreadChecker::create ()};
int32 mNumKeyswitch {1};
DataExchangeReceiverHandler dataExchange {this};
struct ScoreEntry
{
ScoreEntry (float factor = 1.f) : factor (factor) {}
float factor {1.f};
bool use {false};
};
using ScoreMap = std::map<int64, ScoreEntry>;
ScoreMap mScoreMap;
VSTGUI::CVSTGUITimer* mProgressTimer {nullptr};
IProgress::ID mProgressID;
bool mInProgress {false};
};
//------------------------------------------------------------------------
} // namespace Vst
} // namespace Steinberg
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,158 @@
//-----------------------------------------------------------------------------
// Flags : clang-format SMTGSequencer
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/hostcheckerprocessor.h
// Created by : Steinberg, 04/2012
// 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 "hostcheck.h"
#include "logevents.h"
#include "public.sdk/source/common/threadchecker.h"
#include "public.sdk/source/vst/utility/dataexchange.h"
#include "public.sdk/source/vst/vstaudioeffect.h"
#include "public.sdk/source/vst/vstbypassprocessor.h"
#include "base/thread/include/flock.h"
#include "pluginterfaces/vst/ivstprefetchablesupport.h"
#include <list>
namespace Steinberg {
namespace Vst {
static constexpr DataExchangeBlock InvalidDataExchangeBlock = {nullptr, 0,
InvalidDataExchangeBlockID};
//-----------------------------------------------------------------------------
class HostCheckerProcessor : public AudioEffect,
public IAudioPresentationLatency,
public IPrefetchableSupport
{
public:
HostCheckerProcessor ();
tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE;
tresult PLUGIN_API terminate () SMTG_OVERRIDE;
tresult PLUGIN_API process (ProcessData& data) SMTG_OVERRIDE;
tresult PLUGIN_API setupProcessing (ProcessSetup& setup) SMTG_OVERRIDE;
tresult PLUGIN_API setActive (TBool state) SMTG_OVERRIDE;
tresult PLUGIN_API notify (IMessage* message) SMTG_OVERRIDE;
uint32 PLUGIN_API getLatencySamples () SMTG_OVERRIDE;
uint32 PLUGIN_API getTailSamples () SMTG_OVERRIDE;
tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize) SMTG_OVERRIDE;
tresult PLUGIN_API setProcessing (TBool state) SMTG_OVERRIDE;
tresult PLUGIN_API setState (IBStream* state) SMTG_OVERRIDE;
tresult PLUGIN_API getState (IBStream* state) SMTG_OVERRIDE;
tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo) SMTG_OVERRIDE;
tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index,
TBool state) SMTG_OVERRIDE;
tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns,
SpeakerArrangement* outputs,
int32 numOuts) SMTG_OVERRIDE;
tresult PLUGIN_API getBusArrangement (BusDirection dir, int32 busIndex,
SpeakerArrangement& arr) SMTG_OVERRIDE;
static FUnknown* createInstance (void*)
{
return (IAudioProcessor*)new HostCheckerProcessor ();
}
tresult PLUGIN_API connect (IConnectionPoint* other) SMTG_OVERRIDE;
tresult PLUGIN_API disconnect (IConnectionPoint* other) SMTG_OVERRIDE;
//---IAudioPresentationLatency-------------------------
tresult PLUGIN_API setAudioPresentationLatencySamples (BusDirection dir, int32 busIndex,
uint32 latencyInSamples) SMTG_OVERRIDE;
//---IPrefetchableSupport------------------------------
tresult PLUGIN_API getPrefetchableSupport (PrefetchableSupport& prefetchable /*out*/)
SMTG_OVERRIDE;
//---IProcessContextRequirements-----------------------
uint32 PLUGIN_API getProcessContextRequirements () SMTG_OVERRIDE;
DEFINE_INTERFACES
DEF_INTERFACE (IAudioPresentationLatency)
DEF_INTERFACE (IPrefetchableSupport)
END_DEFINE_INTERFACES (AudioEffect)
REFCOUNT_METHODS (AudioEffect)
enum class State : uint32
{
kUninitialized = 0,
kInitialized,
kSetupDone,
kActivated,
kProcessing
};
protected:
void addLogEvent (Steinberg::int32 logId);
void informLatencyChanged ();
void sendLatencyChanged ();
void addLogEventMessage (const LogEvent& logEvent);
void sendLogEventMessage (const LogEvent& logEvent);
void sendNowAllLogEvents ();
ProcessContext* getCurrentExchangeData ();
HostCheck mHostCheck;
BypassProcessor<Vst::Sample32> mBypassProcessorFloat;
BypassProcessor<Vst::Sample64> mBypassProcessorDouble;
DataExchangeBlock mCurrentExchangeBlock {InvalidDataExchangeBlock};
float mLastBlockMarkerValue {-0.5f};
int32 mNumNoteOns {0};
uint32 mLatency {0}; // in samples
uint32 mWantedLatency {0}; // in samples
float mGeneratePeaks {0.f};
float mProcessingLoad {0.f};
State mCurrentState {State::kUninitialized};
uint32 mMinimumOfInputBufferCount {0};
uint32 mMinimumOfOutputBufferCount {0};
TSamples mLastContinuousProjectTimeSamples {kMinInt64};
TSamples mLastProjectTimeSamples {kMinInt64};
int32 mLastNumSamples {0};
uint32 mLastState {0};
std::unique_ptr<ThreadChecker> threadChecker {ThreadChecker::create ()};
Steinberg::Base::Thread::FLock msgQueueLock;
std::list<LogEvent*> msgQueue;
DataExchangeHandler* dataExchangeHandler {nullptr};
int64 mLastExchangeBlockSendSystemTime {0};
int32 mLastProcessMode {-1};
bool mBypass {false};
bool mSetActiveCalled {false};
bool mCheckGetLatencyCall {true};
bool mGetLatencyCalled {false};
bool mGetLatencyCalledAfterSetActive {false};
};
//------------------------------------------------------------------------
} // namespace Vst
} // namespace Steinberg
@@ -0,0 +1,290 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/logevents.h
// Created by : Steinberg, 04/2012
// 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 "pluginterfaces/base/ftypes.h"
#include "base/source/fstring.h"
#include <map>
//------------------------------------------------------------------------
struct LogEvent
{
LogEvent () : id (-1), count (0), fromProcessor (false) {}
LogEvent (const LogEvent& other)
: id (other.id), count (other.count), fromProcessor (other.fromProcessor)
{
}
Steinberg::int64 id;
Steinberg::int64 count;
bool fromProcessor;
};
//------------------------------------------------------------------------
// Categories
#define SETUP_CONTEXT "SetupContext"
#define STATE "State"
#define AUDIO_BUFFER "AudioBuffer"
#define EVENT_LIST "EventList"
#define PARAM_CHANGE "ParameterChanges"
#define PROCESS_DATA "ProcessData"
#define PROCESS_CONTEXT "ProcessContext"
#define THREAD_CONTEXT "ThreadContext"
#define FEATURE_SUPPORT "FeatureSupport"
#define HOST_FEATURE_SUPPORT "HostFeatureSupport"
#define FEATURE_PROCESSOR_SUPPORT "FeatureProcessSupport"
#define OTHER "Other"
#define PROCESS true
#define CONTROL false
// Severity
#define LOG_ERR "Error"
#define LOG_WARN "Warn"
#define LOG_INFO "Info"
#define LOG_EVENT_LIST(LOG_DEF) \
LOG_DEF(kLogIdProcessorControllerConnection,CONTROL, LOG_WARN, SETUP_CONTEXT, "Processor and controller are directly connected (direct pointers no wrapper)."), \
LOG_DEF(kLogIdInvalidActivateAuxBus, PROCESS, LOG_ERR, SETUP_CONTEXT, "Unknown bus to activate!"),\
LOG_DEF(kLogIdInvalidStateInitializedMissing,PROCESS, LOG_ERR, STATE, "Missing State: Uninitialized => Initialized."), \
LOG_DEF(kLogIdInvalidStateSetupMissing, PROCESS, LOG_ERR, STATE, "Missing State: Initialized => Setup Done."), \
LOG_DEF(kLogIdInvalidStateActivatedMissing, PROCESS, LOG_ERR, STATE, "Missing State: Setup Done => Activated."), \
LOG_DEF(kLogIdInvalidStateProcessingMissing,PROCESS, LOG_ERR, STATE, "Missing State: Activated => Processing."), \
LOG_DEF(kLogIdInvalidStateSetActiveWrong, PROCESS, LOG_ERR, STATE, "Wrong Call Order: setActive () called in a Processing State."), \
LOG_DEF(kLogIdInvalidStateSetProcessingWrong,PROCESS, LOG_ERR, STATE, "Wrong Call Order: setProcessing () called in not Activated State."), \
LOG_DEF(kLogIdGetLatencyCalledbeforeSetActive,PROCESS, LOG_ERR, STATE, "Wrong Call Order: getLatencySamples () should be called after each setActive (true)."), \
LOG_DEF(kLogIdsetActiveFalseRedundant, PROCESS, LOG_WARN, STATE, "Redondant Call: setActive (false)!"), \
LOG_DEF(kLogIdsetActiveTrueRedundant, PROCESS, LOG_WARN, STATE, "Redondant Call: setActive (true)!"), \
LOG_DEF(kLogIdsetProcessingFalseRedundant, PROCESS, LOG_WARN, STATE, "Redondant Call: setProcessing (false)!"), \
LOG_DEF(kLogIdsetProcessingTrueRedundant, PROCESS, LOG_WARN, STATE, "Redondant Call: setProcessing (true)!"), \
LOG_DEF(kLogIdgetLatencyNotCalled, PROCESS, LOG_WARN, STATE, "Missing Call: getLatencySamples ()!"), \
LOG_DEF(kLogIdProcessContextPointerNull, PROCESS, LOG_WARN, PROCESS_DATA, "Pointer to ProcessContext struct is null."),\
LOG_DEF(kLogIdInvalidSymbolicSampleSize, PROCESS, LOG_ERR, PROCESS_DATA, "Symbolic sample size does not match the one in ProcessSetup."), \
LOG_DEF(kLogIdInvalidProcessMode, PROCESS, LOG_ERR, PROCESS_DATA, "Process mode does not match the one in ProcessSetup."),\
LOG_DEF(kLogIdInvalidBlockSize, PROCESS, LOG_ERR, PROCESS_DATA, "Block size is either < 1 or >= max block size."),\
LOG_DEF(kLogIdProcessPlaybackChangedDiscontinuityDetected, PROCESS, LOG_INFO, PROCESS_DATA, "Discontinuity in projectTimeSamples detected due to Start/Stop."),\
LOG_DEF(kLogIdProcessDiscontinuityDetected, PROCESS, LOG_INFO, PROCESS_DATA, "Discontinuity in projectTimeSamples detected during playback or pause."),\
LOG_DEF(kLogIdProcessPlaybackChangedContinuousDiscontinuityDetected, PROCESS, LOG_INFO, PROCESS_DATA, "Discontinuity in continousTimeSamples detected due to Start/Stop."),\
LOG_DEF(kLogIdProcessContinuousDiscontinuityDetected, PROCESS, LOG_INFO, PROCESS_DATA, "Discontinuity in continousTimeSamples detected during playback or pause."),\
\
LOG_DEF(kLogIdInvalidProcessContextSampleRate, PROCESS, LOG_ERR, PROCESS_CONTEXT, "The sampleRate does not match the one in ProcessSetup."),\
LOG_DEF(kLogIdInvalidProcessContextSystemTime, PROCESS, LOG_ERR, PROCESS_CONTEXT, "The given systemTime is not increasing continuously."),\
LOG_DEF(kLogIdNullPointerToChannelBuf, PROCESS, LOG_ERR, AUDIO_BUFFER, "A pointer to a channel buffer is null although the index is valid."),\
LOG_DEF(kLogIdNullPointerToAuxChannelBuf, PROCESS, LOG_ERR, AUDIO_BUFFER, "A pointer to a SideChain channel buffer is null although the index is valid."),\
LOG_DEF(kLogIdNullPointerToAudioBusBuffer, PROCESS, LOG_ERR, AUDIO_BUFFER, "A pointer to an audio bus buffer is null although the index is valid."),\
LOG_DEF(kLogIdAudioBufNotMatchComponentBusCount,PROCESS, LOG_ERR, AUDIO_BUFFER, "Number of Audio Buffers does not match the number of busses defined by IComponent."),\
LOG_DEF(kLogIdNoBusActivated, PROCESS, LOG_ERR, AUDIO_BUFFER, "No output audio bus activated, but process is called with Audio Buffers."),\
LOG_DEF(kLogIdInvalidAudioBufNumOfChannels, PROCESS, LOG_ERR, AUDIO_BUFFER, "An audio bus number of channels is different from the one specified by IComponent."),\
LOG_DEF(kLogIdUnknownEventType, PROCESS, LOG_ERR, EVENT_LIST, "Event has a type which is not specified."),\
LOG_DEF(kLogIdInvalidEventVelocityValue, PROCESS, LOG_ERR, EVENT_LIST, "Event velocity is either < 0.0 or > 1.0."),\
LOG_DEF(kLogIdInvalidEventPitchValue, PROCESS, LOG_ERR, EVENT_LIST, "Event pitch is either < 0 or > 127."),\
LOG_DEF(kLogIdInvalidEventSampleOffset, PROCESS, LOG_ERR, EVENT_LIST, "Event sample offset either < 0 or >= max block size."),\
LOG_DEF(kLogIdInvalidEventBusIndex, PROCESS, LOG_ERR, EVENT_LIST, "Event has a bus index which is different from the one specified by IComponent."),\
LOG_DEF(kLogIdInvalidNoteOnChannelIndex, PROCESS, LOG_ERR, EVENT_LIST, "Note On event has a channel index which was not specified by IComponent."),\
LOG_DEF(kLogIdInvalidNoteOffChannelIndex, PROCESS, LOG_ERR, EVENT_LIST, "Note Off event has a channel index which was not specified by IComponent."),\
LOG_DEF(kLogIdInvalidPolyPressChannelIndex, PROCESS, LOG_ERR, EVENT_LIST, "Poly pressure event has a channel index which was not specified by IComponent."),\
LOG_DEF(kLogIdNumInputEventExceedsLimit, PROCESS, LOG_WARN, EVENT_LIST, "List contains more than 2048 events."),\
LOG_DEF(kLogIdCouldNotGetAnInputEvent, PROCESS, LOG_WARN, EVENT_LIST, "Getting an event returned an error code."),\
LOG_DEF(kLogIdEventsAreNotSortedBySampleOffset, PROCESS, LOG_WARN, EVENT_LIST, "Events are not sorted by sample offset."),\
LOG_DEF(kLogIdEventsAreNotSortedByPpqPosition, PROCESS, LOG_WARN, EVENT_LIST, "Events are not sorted by PPQ position."),\
LOG_DEF(kLogIdNoteOnWithPitchAlreadyTriggered, PROCESS, LOG_INFO, EVENT_LIST, "An event occurred with a pitch currently already triggered."),\
LOG_DEF(kLogIdNoteOnWithIdAlreadyTriggered, PROCESS, LOG_WARN, EVENT_LIST, "An event occurred with an ID currently already triggered."),\
LOG_DEF(kLogIdNoteOffWithIdNeverTriggered, PROCESS, LOG_WARN, EVENT_LIST, "A Note Off event with no matching note On (ID)"),\
LOG_DEF(kLogIdNoteOffWithPitchNeverTriggered, PROCESS, LOG_WARN, EVENT_LIST, "A Note Off event with no matching note On (pitch)."),\
LOG_DEF(kLogIdNoteExpressValNotNormalized, PROCESS, LOG_ERR, EVENT_LIST, "A note expression event value is either < 0.0 or > 1.0."),\
LOG_DEF(kLogIdInvalidParamValue, PROCESS, LOG_ERR, PARAM_CHANGE, "Parameter value is < 0.0 or > 1.0."),\
LOG_DEF(kLogIdInvalidParameterCount, PROCESS, LOG_ERR, PARAM_CHANGE, "The number of changes is bigger than the number of parameters specified by IEditController."),\
LOG_DEF(kLogIdInvalidParameterID, PROCESS, LOG_ERR, PARAM_CHANGE, "A parameter change queue has a parameter ID which was not specified by IEditController."),\
LOG_DEF(kLogIdParameterIDMoreThanOneTimeinList, PROCESS, LOG_ERR, PARAM_CHANGE, "A parameter ID is more than 1 time in the IParameterChanges list."),\
LOG_DEF(kLogIdParameterChangesPointerIsNull, PROCESS, LOG_WARN, PARAM_CHANGE, "Pointer to parameter changes interface is null."),\
LOG_DEF(kLogIdParameterQueueIsNullForValidIndex, PROCESS, LOG_ERR, PARAM_CHANGE, "Pointer to parameter value queue interface is null (index is valid!)."),\
LOG_DEF(kLogIdParametersAreNotSortedBySampleOffset, PROCESS, LOG_ERR, PARAM_CHANGE, "Parameter changes (for a ID) are not sorted by sample offset."),\
LOG_DEF(kLogIdParametersHaveSameSampleOffset, PROCESS, LOG_WARN, PARAM_CHANGE, "Parameter changes (for a ID) have more than 2 time the same sample offset."),\
LOG_DEF(kLogIdInformLatencyChanged, PROCESS, LOG_INFO, PARAM_CHANGE, "InformLatencyChanged called from processor."),\
\
LOG_DEF (kLogWrongCOMBehaviorFUnknown1, CONTROL, LOG_WARN, OTHER, "U::cast<FUnknown> (U::cast<IHostApplication> (hostContext)) does not work correctly!"), \
LOG_DEF (kLogWrongCOMBehaviorFUnknown2, CONTROL, LOG_WARN, OTHER, "U::cast<IHostApplication> (U::cast<FUnknown> (U::cast<IHostApplication> (hostContext))) does not work correctly!"), \
\
LOG_DEF(kLogIdinitializeCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::initialize is called in wrong Thread!"),\
LOG_DEF(kLogIdterminateCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::terminate is called in wrong Thread!"),\
LOG_DEF(kLogIdQueryInterfaceCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::queryInterface is called in wrong Thread!"),\
LOG_DEF(kLogIdSetComponentHandlerCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::setComponentHandler is called in wrong Thread!"),\
LOG_DEF(kLogIdSetComponentStateCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::setComponentState is called in wrong Thread!"),\
LOG_DEF(kLogIdConnectCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::connect is called in wrong Thread!"),\
LOG_DEF(kLogIdsetStateCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::setState is called in wrong Thread!"),\
LOG_DEF(kLogIdgetStateCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getState is called in wrong Thread!"),\
LOG_DEF(kLogIdnotifyCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::notify is called in wrong Thread!"),\
LOG_DEF(kLogIdGetUnitByBusCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getUnitByBus is called in wrong Thread!"),\
LOG_DEF(kLogIdGetUnitCountCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getUnitCount is called in wrong Thread!"),\
LOG_DEF(kLogIdSetParamNormalizedCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::setParamNormalized is called in wrong Thread!"),\
LOG_DEF(kLogIdBeginEditCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::beginEdit is called in wrong Thread!"),\
LOG_DEF(kLogIdEndEditCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::endEdit is called in wrong Thread!"),\
LOG_DEF(kLogIdBeginEditFromHostCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::beginEditFromHost is called in wrong Thread!"),\
LOG_DEF(kLogIdEndEditFromHostCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::endEditFromHost is called in wrong Thread!"),\
LOG_DEF(kLogIdCreateViewCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::createView is called in wrong Thread!"),\
LOG_DEF(kLogIdOnLiveMIDIControllerInputCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::onLiveMIDIControllerInput is called in wrong Thread!"),\
LOG_DEF(kLogIdgetNoteExpressionCountCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getNoteExpressionCount is called in wrong Thread!"),\
LOG_DEF(kLogIdgetNoteExpressionInfoCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getNoteExpressionInfo is called in wrong Thread!"),\
LOG_DEF(kLogIdgetNoteExpressionValueByStringCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getNoteExpressionValueByString is called in wrong Thread!"),\
LOG_DEF(kLogIdgetNoteExpressionStringByValueCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getNoteExpressionStringByValue is called in wrong Thread!"),\
LOG_DEF(kLogIdgetPhysicalUIMappingCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getPhysicalUIMapping is called in wrong Thread!"),\
LOG_DEF(kLogIdgetKeyswitchCountCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getKeyswitchCount is called in wrong Thread!"),\
LOG_DEF(kLogIdgetKeyswitchInfoCalledinWrongThread, CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getKeyswitchInfo is called in wrong Thread!"),\
LOG_DEF(kLogIdsetAutomationStateCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::setAutomationState is called in wrong Thread!"),\
LOG_DEF(kLogIdsetKnobModeCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::setKnob is called in wrong Thread!"),\
LOG_DEF(kLogIdopenHelpCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::openHelp is called in wrong Thread!"),\
LOG_DEF(kLogIdopenAboutBoxCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::openAbout is called in wrong Thread!"),\
LOG_DEF(kLogIdsetChannelContextInfosCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::setChannelContextInfos is called in wrong Thread!"),\
LOG_DEF(kLogIdgetMidiControllerAssignmentCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getMidiControllerAssignment is called in wrong Thread!"),\
LOG_DEF(kLogIdgetXmlRepresentationStreamCalledinWrongThread,CONTROL, LOG_ERR, THREAD_CONTEXT, "IEditController::getXmlRepresentationStream is called in wrong Thread!"),\
LOG_DEF(kLogIdSetActiveCalledinWrongThread, PROCESS, LOG_ERR, THREAD_CONTEXT, "IComponent::setActive is called in wrong Thread!"),\
LOG_DEF(kLogIdProcessorSetStateCalledinWrongThread, PROCESS, LOG_ERR, THREAD_CONTEXT, "IComponent::setState is called in wrong Thread!"),\
LOG_DEF(kLogIdProcessorGetStateCalledinWrongThread, PROCESS, LOG_ERR, THREAD_CONTEXT, "IComponent::getState is called in wrong Thread!"),\
LOG_DEF(kLogIdactivateBusCalledinWrongThread, PROCESS, LOG_ERR, THREAD_CONTEXT, "IComponent::activateBus is called in wrong Thread!"),\
\
LOG_DEF(kLogIdSetActiveCalledSupported, PROCESS, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponent::setActive (true) called."), \
LOG_DEF(kLogIdIAttributeListInSetStateSupported, PROCESS, LOG_INFO, HOST_FEATURE_SUPPORT, "IAttributeList in setState supported!"), \
LOG_DEF(kLogIdIAttributeListInGetStateSupported, PROCESS, LOG_INFO, HOST_FEATURE_SUPPORT, "IAttributeList in getState supported!"), \
\
LOG_DEF (kLogIdRestartParamValuesChangedSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler::restartComponent (kParamValuesChanged) supported!"), \
LOG_DEF (kLogIdRestartParamTitlesChangedSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler::restartComponent (kParamTitlesChanged) supported!"), \
LOG_DEF (kLogIdRestartNoteExpressionChangedSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler::restartComponent (kNoteExpressionChanged) supported!"), \
LOG_DEF (kLogIdRestartKeyswitchChangedSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler::restartComponent (kKeyswitchChanged) supported!"), \
\
LOG_DEF (kLogIdIComponentHandler2Supported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler2 supported!"), \
LOG_DEF (kLogIdIComponentHandler2SetDirtySupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler2::setDirty supported!"), \
LOG_DEF (kLogIdIComponentHandler2RequestOpenEditorSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler2::requestOpenEditor supported!"), \
LOG_DEF (kLogIdIComponentHandler3Supported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandler3 (contextMenu) supported!"), \
LOG_DEF (kLogIdIComponentHandlerBusActivationSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IComponentHandlerBusActivation supported!"), \
\
LOG_DEF (kLogIdIProgressSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IProgress supported!"), \
LOG_DEF (kLogIdIPlugInterfaceSupportSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IPlugInterfaceSupport supported!"), \
LOG_DEF (kLogIdIPlugInterfaceSupportNotSupported, CONTROL, LOG_ERR, HOST_FEATURE_SUPPORT, "IPlugInterfaceSupport not supported!"), \
LOG_DEF (kLogIdIPlugFrameonResizeViewSupported, CONTROL, LOG_INFO, HOST_FEATURE_SUPPORT, "IPlugFrame::resizeView supported!"), \
LOG_DEF (kLogIdIPrefetchableSupportSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IPrefetchableSupport supported!"), \
LOG_DEF (kLogIdAudioPresentationLatencySamplesSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioPresentationLatency supported!"), \
LOG_DEF (kLogIdIProcessContextRequirementsSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IProcessContextRequirements supported!"), \
\
LOG_DEF (kLogIdProcessModeOfflineSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessMode::kOffline supported!"), \
LOG_DEF (kLogIdProcessModeRealtimeSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessMode::kRealtime supported!"), \
LOG_DEF (kLogIdProcessModePrefetchSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessMode::kPrefetch supported!"), \
\
LOG_DEF (kLogIdProcessContextPlayingSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kPlaying supported!"), \
LOG_DEF (kLogIdProcessContextRecordingSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kRecording supported!"), \
LOG_DEF (kLogIdProcessContextCycleActiveSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kCycleActive supported!"), \
LOG_DEF (kLogIdProcessContextSystemTimeSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kSystemTimeValid supported!"), \
LOG_DEF (kLogIdProcessContextContTimeSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kContTimeValid supported!"), \
LOG_DEF (kLogIdProcessContextTimeMusicSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kProjectTimeMusicValid supported!"), \
LOG_DEF (kLogIdProcessContextBarPositionSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kBarPositionValid supported!"), \
LOG_DEF (kLogIdProcessContextCycleSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kCycleValid supported!"), \
LOG_DEF (kLogIdProcessContextTempoSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kTempoValid supported!"), \
LOG_DEF (kLogIdProcessContextTimeSigSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kTimeSigValid supported!"), \
LOG_DEF (kLogIdProcessContextChordSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kChordValid supported!"), \
LOG_DEF (kLogIdProcessContextSmpteSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kSmpteValid supported!"), \
LOG_DEF (kLogIdProcessContextClockSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "ProcessContext::kClockValid supported!"), \
\
LOG_DEF (kLogIdCanProcessSampleSize32, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::canProcessSampleSize for kSample32 supported!"), \
LOG_DEF (kLogIdCanProcessSampleSize64, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::canProcessSampleSize for kSample64 supported!"), \
LOG_DEF (kLogIdGetTailSamples, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::getTailSamples supported!"), \
LOG_DEF (kLogIdGetLatencySamples, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::getLatencySamples supported!"), \
LOG_DEF (kLogIdGetBusArrangements, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::getBusArrangements supported!"), \
LOG_DEF (kLogIdSetBusArrangements, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::setBusArrangements supported!"), \
LOG_DEF (kLogIdGetRoutingInfo, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IComponent::getRoutingInfo supported!"), \
LOG_DEF (kLogIdActivateAuxBus, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IComponent::activateBus for SideChain supported!"), \
LOG_DEF (kLogIdParametersFlushSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::process called for flush parameter supported!"), \
LOG_DEF (kLogIdSilentFlagsSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::process: silent flags for Main Input supported!"), \
LOG_DEF (kLogIdSilentFlagsSCSupported, PROCESS, LOG_INFO, FEATURE_PROCESSOR_SUPPORT, "IAudioProcessor::process: silent flags for SideChain-In supported!"), \
\
LOG_DEF (kLogIdIEditController2Supported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IEditController2 supported!"), \
LOG_DEF (kLogIdSetKnobModeSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IEditController2::setKnobMode supported!"), \
LOG_DEF (kLogIdOpenHelpSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IEditController2::openHelp supported!"), \
LOG_DEF (kLogIdOpenAboutBoxSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IEditController2::openAboutBox supported!"), \
\
LOG_DEF (kLogIdIMidiMappingSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IMidiMapping supported!"), \
LOG_DEF (kLogIdUnitSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "Unit supported!"), \
LOG_DEF (kLogIdGetUnitByBusSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IUnitInfo::getUnitByBus supported!"), \
LOG_DEF (kLogIdChannelContextSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "ChannelContext::IInfoListener supported!"), \
\
LOG_DEF (kLogIdINoteExpressionControllerSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "INoteExpressionController supported!"), \
LOG_DEF (kLogIdGetNoteExpressionStringByValueSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "INoteExpressionController::getNoteExpressionStringByValue supported!"), \
LOG_DEF (kLogIdGetNoteExpressionValueByStringSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "INoteExpressionController::getNoteExpressionValueByString supported!"), \
LOG_DEF (kLogIdINoteExpressionPhysicalUIMappingSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "INoteExpressionPhysicalUIMapping supported!"), \
LOG_DEF (kLogIdIKeyswitchControllerSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IKeyswitchController supported!"), \
\
LOG_DEF (kLogIdIMidiLearnSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IMidiLearn supported!"), \
LOG_DEF (kLogIdIMidiLearn_onLiveMIDIControllerInputSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IMidiLearn::onLiveMIDIControllerInput supported!"), \
\
LOG_DEF (kLogIdIXmlRepresentationControllerSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "XmlRepresentation supported!"), \
LOG_DEF (kLogIdIAutomationStateSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IAutomationState supported!"), \
LOG_DEF (kLogIdIEditControllerHostEditingSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IEditControllerHostEditing supported!"), \
LOG_DEF (kLogIdIEditControllerHostEditingMisused, CONTROL, LOG_ERR, FEATURE_SUPPORT, "IEditControllerHostEditing::beginEdit/endEditFromHost not correctly used!"), \
\
LOG_DEF (kLogIdIPlugViewonSizeSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::onSize supported!"), \
LOG_DEF (kLogIdIPlugViewcanResizeSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::canResize supported!"), \
LOG_DEF (kLogIdIPlugViewcheckSizeConstraintSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::checkSizeConstraint supported!"), \
LOG_DEF (kLogIdIPlugViewsetFrameSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::setFrame supported!"), \
LOG_DEF (kLogIdIPlugViewOnWheelCalled, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::onWheel supported!"), \
LOG_DEF (kLogIdIPlugViewOnKeyDownSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::onKeyDown supported!"), \
LOG_DEF (kLogIdIPlugViewOnKeyUpSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::onKeyUp supported!"), \
LOG_DEF (kLogIdIPlugViewOnFocusCalled, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::onFocus supported!"), \
LOG_DEF (kLogIdIPlugViewsetContentScaleFactorSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugViewContentScaleSupport::setContentScaleFactor supported!"), \
\
LOG_DEF (kLogIdIPlugViewmultipleAttachSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::attached-removed called multiple time."), \
LOG_DEF (kLogIdIPlugViewCalledSync, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::onSize is called sync during a resizeView."), \
LOG_DEF (kLogIdIPlugViewCalledBeforeOpen, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IPlugView::onSize is called before attached."), \
\
LOG_DEF (kLogIdIPlugViewKeyCalledBeforeAttach, CONTROL, LOG_ERR, FEATURE_SUPPORT, "IPlugView::onKeyUp or onKeyDown or onWheel is called before attached!"), \
LOG_DEF (kLogIdIPlugViewNotCalled, CONTROL, LOG_ERR, FEATURE_SUPPORT, "IPlugView::onSize not called after a resizeView!"), \
LOG_DEF (kLogIdIPlugViewCalledAsync, CONTROL, LOG_ERR, FEATURE_SUPPORT, "IPlugView::onSize is called async after a resizeView. Should be Sync!"), \
LOG_DEF (kLogIdIPlugViewattachedWithoutRemoved, CONTROL, LOG_ERR, FEATURE_SUPPORT, "IPlugView::attached is called without removed first!"), \
LOG_DEF (kLogIdIPlugViewremovedWithoutAttached, CONTROL, LOG_ERR, FEATURE_SUPPORT, "IPlugView::removed is called without attached first!"), \
\
LOG_DEF (kLogIdIParameterFinderSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IParameterFinder supported!"), \
LOG_DEF (kLogIdIParameterFunctionNameSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IParameterFunctionName supported!"), \
LOG_DEF (kLogIdIParameterFunctionNameDryWetSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IParameterFunctionName => kDryWetMix supported!"), \
LOG_DEF (kLogIdIParameterFunctionNameRandomizeSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IParameterFunctionName => kRandomize supported!"), \
LOG_DEF (kLogIdIParameterFunctionNameLowLatencySupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IParameterFunctionName => kLowLatency supported!"), \
\
LOG_DEF (kLogIdIComponentHandlerSystemTimeSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IComponentHandlerSystemTime supported!"), \
LOG_DEF (kLogIdIDataExchangeHandlerSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IDataExchangeHandler supported!"), \
LOG_DEF (kLogIdIDataExchangeReceiverSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IDataExchangeReceiver supported!"), \
\
LOG_DEF (kLogIdIRemapParamIDSupported, CONTROL, LOG_INFO, FEATURE_SUPPORT, "IRemapParamID supported!")
#define LOG_ID(a, b, c, d, e) a
#define LOG_SEVER(a, b, c, d, e) c
#define LOG_DESC(a, b, c, d, e) ("[" d "] " e) // "[category] description"
#define LOG_CONTEXT(a, b, c, d, e) b
// enum of all IDs
enum eLogIds
{
LOG_EVENT_LIST (LOG_ID),
kNumLogEvents,
};
// array of bool process : 'true' or controller : 'false'
static const bool logEventContext[] = {LOG_EVENT_LIST (LOG_CONTEXT)};
// array of log descriptions
static const char* logEventDescriptions[] = {LOG_EVENT_LIST (LOG_DESC)};
// array of string 'error' or 'warning'
static const char* logEventSeverity[] = {LOG_EVENT_LIST (LOG_SEVER)};
@@ -0,0 +1,181 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/parameterchangescheck.cpp
// Created by : Steinberg, 12/2012
// Description : ParameterChanges check
//
//-----------------------------------------------------------------------------
// 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 "parameterchangescheck.h"
#include "eventlogger.h"
#include "logevents.h"
#include "pluginterfaces/vst/ivstparameterchanges.h"
//------------------------------------------------------------------------
// ParameterChangesCheck
//------------------------------------------------------------------------
ParameterChangesCheck::ParameterChangesCheck () : mEventLogger (nullptr), mParameterIds (nullptr) {}
//------------------------------------------------------------------------
void ParameterChangesCheck::checkParameterChanges (Steinberg::Vst::IParameterChanges* paramChanges)
{
if (!paramChanges)
{
mEventLogger->addLogEvent (kLogIdParameterChangesPointerIsNull);
return;
}
checkParameterCount (paramChanges->getParameterCount ());
checkAllChanges (paramChanges);
}
//------------------------------------------------------------------------
void ParameterChangesCheck::checkAllChanges (Steinberg::Vst::IParameterChanges* paramChanges)
{
for (Steinberg::int32 paramIdx = 0; paramIdx < paramChanges->getParameterCount (); ++paramIdx)
{
Steinberg::Vst::IParamValueQueue* paramQueue = paramChanges->getParameterData (paramIdx);
if (checkParameterQueue (paramQueue))
{
bool found = false;
auto id = paramQueue->getParameterId ();
for (auto item : mTempUsedId)
{
if (item == id)
{
mEventLogger->addLogEvent (kLogIdParameterIDMoreThanOneTimeinList);
found = true;
break;
}
}
if (!found)
mTempUsedId.emplace_back (id);
checkParameterId (id);
checkPoints (paramQueue);
}
}
mTempUsedId.clear ();
}
//------------------------------------------------------------------------
void ParameterChangesCheck::checkPoints (Steinberg::Vst::IParamValueQueue* paramQueue)
{
Steinberg::int32 lastLastSampleOffset = -1;
Steinberg::int32 lastSampleOffset = -1;
for (Steinberg::int32 pointIdx = 0; pointIdx < paramQueue->getPointCount (); ++pointIdx)
{
Steinberg::int32 sampleOffset = 0;
Steinberg::Vst::ParamValue paramValue = 0;
if (paramQueue->getPoint (pointIdx, sampleOffset, paramValue) == Steinberg::kResultOk)
{
checkNormalized (paramValue);
checkSampleOffset (sampleOffset, lastSampleOffset);
lastLastSampleOffset = lastSampleOffset;
lastSampleOffset = sampleOffset;
// here we have more than 3 points at the same sample position
if (lastLastSampleOffset == sampleOffset)
mEventLogger->addLogEvent (kLogIdParametersHaveSameSampleOffset);
}
}
}
//------------------------------------------------------------------------
void ParameterChangesCheck::setEventLogger (EventLogger* eventLogger)
{
mEventLogger = eventLogger;
}
//------------------------------------------------------------------------
void ParameterChangesCheck::setParamIDs (ParamIDs* parameterID)
{
mParameterIds = parameterID;
updateParameterIDs ();
}
//------------------------------------------------------------------------
void ParameterChangesCheck::updateParameterIDs ()
{
if (mParameterIds)
mTempUsedId.resize (mParameterIds->size ());
}
//------------------------------------------------------------------------
void ParameterChangesCheck::checkParameterCount (Steinberg::int32 paramCount)
{
if (!isValidParamCount (paramCount))
{
mEventLogger->addLogEvent (kLogIdInvalidParameterCount);
}
}
//------------------------------------------------------------------------
bool ParameterChangesCheck::isValidParamCount (Steinberg::int32 paramCount) const
{
return paramCount <= (Steinberg::int32)mParameterIds->size ();
}
//------------------------------------------------------------------------
void ParameterChangesCheck::checkParameterId (Steinberg::Vst::ParamID paramId)
{
if (!isValidParamID (paramId))
{
mEventLogger->addLogEvent (kLogIdInvalidParameterID);
}
}
//------------------------------------------------------------------------
bool ParameterChangesCheck::isValidParamID (Steinberg::Vst::ParamID paramId) const
{
return mParameterIds->find (paramId) != mParameterIds->end ();
}
//------------------------------------------------------------------------
void ParameterChangesCheck::checkNormalized (double normVal)
{
if (!isNormalized (normVal))
{
mEventLogger->addLogEvent (kLogIdInvalidParamValue);
}
}
//------------------------------------------------------------------------
void ParameterChangesCheck::checkSampleOffset (Steinberg::int32 sampleOffset,
Steinberg::int32 lastSampleOffset)
{
if (!isValidSampleOffset (sampleOffset, lastSampleOffset))
{
mEventLogger->addLogEvent (kLogIdParametersAreNotSortedBySampleOffset);
}
}
//------------------------------------------------------------------------
bool ParameterChangesCheck::isNormalized (double normVal) const
{
return normVal >= 0. && normVal <= 1.;
}
//------------------------------------------------------------------------
bool ParameterChangesCheck::isValidSampleOffset (Steinberg::int32 sampleOffset, Steinberg::int32 lastSampleOffset) const
{
return sampleOffset >= lastSampleOffset;
}
//------------------------------------------------------------------------
bool ParameterChangesCheck::checkParameterQueue (Steinberg::Vst::IParamValueQueue* paramQueue)
{
if (!paramQueue)
{
mEventLogger->addLogEvent (kLogIdParameterQueueIsNullForValidIndex);
}
return paramQueue != nullptr;
}
@@ -0,0 +1,66 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/parameterchangescheck.h
// Created by : Steinberg, 12/2012
// Description : ParameterChanges check
//
//-----------------------------------------------------------------------------
// 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/ftypes.h"
#include "pluginterfaces/vst/ivstaudioprocessor.h"
#include "pluginterfaces/vst/ivstnoteexpression.h"
#include <set>
#include <vector>
class EventLogger;
namespace Steinberg {
namespace Vst {
class IParamValueQueue;
}
}
//------------------------------------------------------------------------
// EventListCheck
//------------------------------------------------------------------------
class ParameterChangesCheck
{
public:
//------------------------------------------------------------------------
ParameterChangesCheck ();
using ParamIDs = std::set<Steinberg::Vst::ParamID>;
void checkParameterChanges (Steinberg::Vst::IParameterChanges* paramChanges);
void setEventLogger (EventLogger* eventLogger);
void setParamIDs (ParamIDs* parameterID);
void updateParameterIDs ();
//------------------------------------------------------------------------
protected:
void checkAllChanges (Steinberg::Vst::IParameterChanges* paramChanges);
void checkParameterCount (Steinberg::int32 paramCount);
void checkParameterId (Steinberg::Vst::ParamID paramId);
void checkNormalized (double normVal);
void checkSampleOffset (Steinberg::int32 sampleOffset, Steinberg::int32 lastSampleOffset);
bool checkParameterQueue (Steinberg::Vst::IParamValueQueue* paramQueue);
void checkPoints (Steinberg::Vst::IParamValueQueue* paramQueue);
bool isNormalized (double normVal) const;
bool isValidSampleOffset (Steinberg::int32 sampleOffset, Steinberg::int32 lastSampleOffset) const;
bool isValidParamID (Steinberg::Vst::ParamID paramId) const;
bool isValidParamCount (Steinberg::int32 paramCount) const;
EventLogger* mEventLogger;
ParamIDs* mParameterIds;
std::vector<Steinberg::Vst::ParamID> mTempUsedId;
};
@@ -0,0 +1,55 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/processcontextcheck.cpp
// Created by : Steinberg, 12/2012
// Description : Process Context check
//
//-----------------------------------------------------------------------------
// 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 "pluginterfaces/vst/ivstprocesscontext.h"
#include "processcontextcheck.h"
#include "eventlogger.h"
#include "logevents.h"
using namespace Steinberg::Vst;
//------------------------------------------------------------------------
// ProcessContextCheck
//------------------------------------------------------------------------
ProcessContextCheck::ProcessContextCheck () : mEventLogger (nullptr), mSampleRate (0) {}
//------------------------------------------------------------------------
void ProcessContextCheck::setEventLogger (EventLogger* eventLogger) { mEventLogger = eventLogger; }
//------------------------------------------------------------------------
void ProcessContextCheck::check (ProcessContext* context)
{
if (!context)
{
mEventLogger->addLogEvent (kLogIdProcessContextPointerNull);
return;
}
if (context->sampleRate != mSampleRate)
{
mEventLogger->addLogEvent (kLogIdInvalidProcessContextSampleRate);
}
if (context->state & ProcessContext::StatesAndFlags::kSystemTimeValid)
{
if (mLastSystemTime >= context->systemTime)
{
mEventLogger->addLogEvent (kLogIdInvalidProcessContextSystemTime);
}
mLastSystemTime = context->systemTime;
}
}
//------------------------------------------------------------------------
void ProcessContextCheck::setSampleRate (double sampleRate) { mSampleRate = sampleRate; }
@@ -0,0 +1,40 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/processcontextcheck.h
// Created by : Steinberg, 12/2012
// Description : Process Context check
//
//-----------------------------------------------------------------------------
// 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/vst/ivstaudioprocessor.h"
class EventLogger;
//------------------------------------------------------------------------
// ProcessContextCheck
//------------------------------------------------------------------------
class ProcessContextCheck
{
public:
//------------------------------------------------------------------------
ProcessContextCheck ();
void setEventLogger (EventLogger* eventLogger);
void setSampleRate (double sampleRate);
void check (Steinberg::Vst::ProcessContext* context);
//------------------------------------------------------------------------
protected:
EventLogger* mEventLogger;
double mSampleRate;
Steinberg::int64 mLastSystemTime {0};
};
@@ -0,0 +1,53 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/processsetupcheck.cpp
// Created by : Steinberg, 12/2012
// Description : VST::ProcessSetup check
//
//-----------------------------------------------------------------------------
// 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 "processsetupcheck.h"
#include "logevents.h"
//------------------------------------------------------------------------
// ProcessSetupCheck
//------------------------------------------------------------------------
ProcessSetupCheck::ProcessSetupCheck () : mEventLogger (nullptr) {}
//------------------------------------------------------------------------
void ProcessSetupCheck::setProcessSetup (Steinberg::Vst::ProcessSetup setup) { mSetup = setup; }
//------------------------------------------------------------------------
void ProcessSetupCheck::check (const Steinberg::Vst::ProcessData& data)
{
if (data.symbolicSampleSize != mSetup.symbolicSampleSize)
{
mEventLogger->addLogEvent (kLogIdInvalidSymbolicSampleSize);
}
if (data.processMode != mSetup.processMode)
{
// exception toggle between kRealtime kPrefetch
if (!((mSetup.processMode == Steinberg::Vst::kRealtime &&
data.processMode == Steinberg::Vst::kPrefetch) ||
(mSetup.processMode == Steinberg::Vst::kPrefetch &&
data.processMode == Steinberg::Vst::kRealtime)))
mEventLogger->addLogEvent (kLogIdInvalidProcessMode);
}
if (data.numSamples < 0 || data.numSamples > mSetup.maxSamplesPerBlock)
{
mEventLogger->addLogEvent (kLogIdInvalidBlockSize);
}
}
//------------------------------------------------------------------------
void ProcessSetupCheck::setEventLogger (EventLogger* eventLogger) { mEventLogger = eventLogger; }
@@ -0,0 +1,39 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/processsetupcheck.h
// Created by : Steinberg, 12/2012
// Description : VST::ProcessSetup check
//
//-----------------------------------------------------------------------------
// 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 "eventlogger.h"
#include "pluginterfaces/vst/ivstaudioprocessor.h"
//------------------------------------------------------------------------
// ProcessSetupCheck
//------------------------------------------------------------------------
class ProcessSetupCheck
{
public:
//------------------------------------------------------------------------
ProcessSetupCheck ();
void setProcessSetup (Steinberg::Vst::ProcessSetup setup);
void setEventLogger (EventLogger* eventLogger);
void check (const Steinberg::Vst::ProcessData& data);
//------------------------------------------------------------------------
protected:
Steinberg::Vst::ProcessSetup mSetup;
EventLogger* mEventLogger;
};
@@ -0,0 +1,36 @@
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/hostchecker/source/version.h
// Created by : Steinberg, 04/2012
// 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 "pluginterfaces/base/fplatform.h"
// Plain project version file generated by cmake
#include "projectversion.h"
#define stringPluginName "VST3 Host Checker"
#define stringOriginalFilename "HostChecker.vst3"
#if SMTG_PLATFORM_64
#define stringFileDescription "HostChecker VST3-SDK (64Bit)"
#else
#define stringFileDescription "HostChecker 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"