MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostlyharmless_IEngine.h
Go to the documentation of this file.
1//
2// Created by Syl Morrison on 20/10/2024.
3//
4
5#ifndef MOSTLYHARMLESS_MOSTLYHARMLESS_IENGINE_H
6#define MOSTLYHARMLESS_MOSTLYHARMLESS_IENGINE_H
9#include <mostly_harmless/mostlyharmless_Concepts.h>
12namespace mostly_harmless::core {
13
17 struct InitContext {
21 double sampleRate;
25 std::uint32_t minBufferSize;
29 std::uint32_t maxBufferSize;
30 };
31
43 std::optional<mostly_harmless::TransportState> transportState;
44 };
45
56 class IEngine {
57 public:
61 virtual ~IEngine() noexcept = default;
62
68 virtual void initialise(InitContext context) noexcept = 0;
69
75 virtual void process(ProcessContext context) noexcept = 0;
76
80 virtual void reset() noexcept = 0;
81
90 virtual void handleNoteOn([[maybe_unused]] std::uint16_t portIndex, [[maybe_unused]] std::uint8_t channel, [[maybe_unused]] std::uint8_t note, [[maybe_unused]] double velocity) {}
91
100 virtual void handleNoteOff([[maybe_unused]] std::uint16_t portIndex, [[maybe_unused]] std::uint8_t channel, [[maybe_unused]] std::uint8_t note, [[maybe_unused]] double velocity) {}
101 };
102} // namespace mostly_harmless::core
103#endif // MOSTLYHARMLESS_MOSTLYHARMLESS_IENGINE_H
Interface for the plugin's audio processing functionality.
Definition mostlyharmless_IEngine.h:56
virtual ~IEngine() noexcept=default
virtual void process(ProcessContext context) noexcept=0
virtual void reset() noexcept=0
virtual void initialise(InitContext context) noexcept=0
virtual void handleNoteOff(std::uint16_t portIndex, std::uint8_t channel, std::uint8_t note, double velocity)
Definition mostlyharmless_IEngine.h:100
virtual void handleNoteOn(std::uint16_t portIndex, std::uint8_t channel, std::uint8_t note, double velocity)
Definition mostlyharmless_IEngine.h:90
Contains core functionality of the framework.
Definition mostlyharmless_PluginBase.h:15
Trivially copyable view into a preallocated SampleType**.
Definition marvin_BufferView.h:22
Container for context passed to IEngine::initialise.
Definition mostlyharmless_IEngine.h:17
double sampleRate
Definition mostlyharmless_IEngine.h:21
std::uint32_t maxBufferSize
Definition mostlyharmless_IEngine.h:29
std::uint32_t minBufferSize
Definition mostlyharmless_IEngine.h:25
Container for context passed to IEngine::process.
Definition mostlyharmless_IEngine.h:35
std::optional< mostly_harmless::TransportState > transportState
Definition mostlyharmless_IEngine.h:43
marvin::containers::BufferView< float > buffer
Definition mostlyharmless_IEngine.h:39