149 lines
4.3 KiB
C++
149 lines
4.3 KiB
C++
/**
|
|
* Copyright (c) 2021 Enzien Audio, Ltd.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
* are permitted provided that the following conditions are met:
|
|
*
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
* this list of conditions, and the following disclaimer.
|
|
*
|
|
* 2. Redistributions in binary form must reproduce the phrase "powered by heavy",
|
|
* the heavy logo, and a hyperlink to https://enzienaudio.com, all in a visible
|
|
* form.
|
|
*
|
|
* 2.1 If the Application is distributed in a store system (for example,
|
|
* the Apple "App Store" or "Google Play"), the phrase "powered by heavy"
|
|
* shall be included in the app description or the copyright text as well as
|
|
* the in the app itself. The heavy logo will shall be visible in the app
|
|
* itself as well.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
*/
|
|
|
|
#ifndef _HEAVY_LV2_DPF_MIDI_THRU_
|
|
#define _HEAVY_LV2_DPF_MIDI_THRU_
|
|
|
|
#include "DistrhoPlugin.hpp"
|
|
#include "DistrhoPluginInfo.h"
|
|
#include "Heavy_dpf_midi_thru.hpp"
|
|
|
|
START_NAMESPACE_DISTRHO
|
|
|
|
static void hvSendHookFunc(HeavyContextInterface *c, const char *sendName, uint32_t sendHash, const HvMessage *m);
|
|
static void hvPrintHookFunc(HeavyContextInterface *c, const char *printLabel, const char *msgString, const HvMessage *m);
|
|
|
|
class HeavyDPF_dpf_midi_thru : public Plugin
|
|
{
|
|
public:
|
|
enum Parameters
|
|
{
|
|
|
|
};
|
|
|
|
HeavyDPF_dpf_midi_thru();
|
|
~HeavyDPF_dpf_midi_thru() override;
|
|
|
|
void handleMidiInput(uint32_t curEventIndex, const MidiEvent* midiEvents);
|
|
void handleMidiSend(uint32_t sendHash, const HvMessage *m);
|
|
|
|
protected:
|
|
// -------------------------------------------------------------------
|
|
// Information
|
|
|
|
const char* getLabel() const noexcept override
|
|
{
|
|
return "dpf_midi_thru";
|
|
}
|
|
|
|
|
|
const char* getDescription() const override
|
|
{
|
|
return "super simple midi thru patch";
|
|
}
|
|
|
|
|
|
const char* getMaker() const noexcept override
|
|
{
|
|
|
|
return "dreamer";
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* getLicense() const noexcept override
|
|
{
|
|
|
|
return "WTFPL";
|
|
|
|
}
|
|
|
|
uint32_t getVersion() const noexcept override
|
|
{
|
|
|
|
return d_version(6, 6, 6);
|
|
|
|
}
|
|
|
|
int64_t getUniqueId() const noexcept override
|
|
{
|
|
return int64_t( 0xDB8D6E0D );
|
|
}
|
|
|
|
// -------------------------------------------------------------------
|
|
// Init
|
|
|
|
void initParameter(uint32_t index, Parameter& parameter) override;
|
|
|
|
// -------------------------------------------------------------------
|
|
// Internal data
|
|
|
|
float getParameterValue(uint32_t index) const override;
|
|
void setParameterValue(uint32_t index, float value) override;
|
|
|
|
// -------------------------------------------------------------------
|
|
// Process
|
|
|
|
// void activate() override;
|
|
// void deactivate() override;
|
|
|
|
#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
|
|
void run(const float** inputs, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
|
|
#else
|
|
void run(const float** inputs, float** outputs, uint32_t frames) override;
|
|
#endif
|
|
|
|
// -------------------------------------------------------------------
|
|
// Callbacks
|
|
|
|
void sampleRateChanged(double newSampleRate) override;
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
private:
|
|
|
|
|
|
// heavy context
|
|
HeavyContextInterface *_context;
|
|
|
|
// HeavyDPF_dpf_midi_thru<float> fdpf_midi_thru;
|
|
|
|
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(HeavyDPF_dpf_midi_thru)
|
|
};
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
END_NAMESPACE_DISTRHO
|
|
|
|
#endif // _HEAVY_LV2_DPF_MIDI_THRU_
|