2020-03-05 11:16:47 +01:00
|
|
|
// SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
|
|
|
|
|
// This code is part of the sfizz library and is licensed under a BSD 2-clause
|
|
|
|
|
// license. You should have receive a LICENSE.md file along with the code.
|
|
|
|
|
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include "SfizzVstState.h"
|
2021-02-04 02:48:49 +01:00
|
|
|
#include "SfizzVstUpdates.h"
|
2020-03-05 11:16:47 +01:00
|
|
|
#include "public.sdk/source/vst/vsteditcontroller.h"
|
|
|
|
|
#include "public.sdk/source/vst/vstparameters.h"
|
2021-02-08 20:12:48 +01:00
|
|
|
#include "pluginterfaces/vst/ivstmidicontrollers.h"
|
2020-03-05 11:16:47 +01:00
|
|
|
#include "vstgui/plugin-bindings/vst3editor.h"
|
2020-10-19 02:58:01 +02:00
|
|
|
#include <sfizz_message.h>
|
2020-12-07 09:41:36 +01:00
|
|
|
#include <mutex>
|
2020-03-05 11:16:47 +01:00
|
|
|
class SfizzVstState;
|
2020-11-24 07:24:24 +01:00
|
|
|
class SfizzVstEditor;
|
2020-03-05 11:16:47 +01:00
|
|
|
|
|
|
|
|
using namespace Steinberg;
|
|
|
|
|
using namespace VSTGUI;
|
|
|
|
|
|
|
|
|
|
class SfizzVstControllerNoUi : public Vst::EditController,
|
|
|
|
|
public Vst::IMidiMapping {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~SfizzVstControllerNoUi() {}
|
|
|
|
|
|
|
|
|
|
tresult PLUGIN_API initialize(FUnknown* context) override;
|
|
|
|
|
tresult PLUGIN_API terminate() override;
|
|
|
|
|
|
|
|
|
|
tresult PLUGIN_API getMidiControllerAssignment(int32 busIndex, int16 channel, Vst::CtrlNumber midiControllerNumber, Vst::ParamID& id) override;
|
|
|
|
|
|
2020-03-06 11:55:52 +01:00
|
|
|
tresult PLUGIN_API getParamStringByValue(Vst::ParamID tag, Vst::ParamValue valueNormalized, Vst::String128 string) override;
|
|
|
|
|
tresult PLUGIN_API getParamValueByString(Vst::ParamID tag, Vst::TChar* string, Vst::ParamValue& valueNormalized) override;
|
|
|
|
|
|
2021-02-04 02:48:49 +01:00
|
|
|
tresult setParam(Vst::ParamID tag, float value);
|
|
|
|
|
tresult PLUGIN_API setParamNormalized(Vst::ParamID tag, Vst::ParamValue value) override;
|
|
|
|
|
tresult PLUGIN_API setComponentState(IBStream* stream) override;
|
|
|
|
|
tresult PLUGIN_API notify(Vst::IMessage* message) override;
|
2020-03-06 11:55:52 +01:00
|
|
|
|
2020-03-05 11:16:47 +01:00
|
|
|
// interfaces
|
|
|
|
|
OBJ_METHODS(SfizzVstControllerNoUi, Vst::EditController)
|
|
|
|
|
DEFINE_INTERFACES
|
|
|
|
|
DEF_INTERFACE(Vst::IMidiMapping)
|
|
|
|
|
END_DEFINE_INTERFACES(Vst::EditController)
|
|
|
|
|
REFCOUNT_METHODS(Vst::EditController)
|
2021-02-04 02:48:49 +01:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
Steinberg::IPtr<OSCUpdate> oscUpdate_;
|
2021-02-23 09:27:20 +01:00
|
|
|
Steinberg::IPtr<NoteUpdate> noteUpdate_;
|
2021-02-04 02:48:49 +01:00
|
|
|
Steinberg::IPtr<FilePathUpdate> sfzPathUpdate_;
|
|
|
|
|
Steinberg::IPtr<FilePathUpdate> scalaPathUpdate_;
|
|
|
|
|
Steinberg::IPtr<ProcessorStateUpdate> processorStateUpdate_;
|
|
|
|
|
Steinberg::IPtr<PlayStateUpdate> playStateUpdate_;
|
2021-02-08 20:12:48 +01:00
|
|
|
Vst::ParamID midiMapping_[Vst::kCountCtrlNumber] {};
|
2020-03-05 11:16:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SfizzVstController : public SfizzVstControllerNoUi, public VSTGUI::VST3EditorDelegate {
|
|
|
|
|
public:
|
|
|
|
|
IPlugView* PLUGIN_API createView(FIDString name) override;
|
|
|
|
|
|
|
|
|
|
static FUnknown* createInstance(void*);
|
|
|
|
|
|
|
|
|
|
static FUID cid;
|
|
|
|
|
};
|