|
ape
0.5.0
Audio Programming Environment
|
Go to the documentation of this file.
3 #ifndef CPPAPE_PROCESSOR_H
4 #define CPPAPE_PROCESSOR_H
64 process(inputs, outputs, frames);
84 const auto newC = *e->event.eIOChanged;
85 configuration.
inputs = newC.inputs;
86 configuration.
outputs = newC.outputs;
116 return configuration;
161 for (std::size_t c = 0; c < shared; ++c)
163 for (std::size_t n = 0; n < frames; ++n)
164 outputs[c][n] = inputs[c][n];
167 clear(outputs, shared);
199 detail::PluginResource resource;
212 if (e->eventType ==
PlayStateChanged && !e->event.ePlayStateChanged->isPlaying)
256 void processingHook()
override
258 bool wasTransportPlaying = position.
isPlaying;
261 if (wasTransportPlaying && !position.
isPlaying)
265 else if (!wasTransportPlaying && position.
isPlaying)
279 template<
class TProcessor>
284 static_assert(std::is_base_of<Processor, TProcessor>::value,
"Embedded processors must derive from Processor");
366 typedef Processor * (*ProcessorCreater)();
367 static void SetCreater(ProcessorCreater factory);
371 template<
class ProcessorType>
372 class ProcessorFactory
376 static Processor * create()
378 return new ProcessorType();
383 template<
class ProcessorType>
384 static int registerClass(ProcessorType* formal_null);
395 #define GlobalData(type, str) \
397 int __ ## type ## __unneeded = ape::detail::registerClass((type*)0);
virtual void start(const IOConfig &config)
Start processing with a certain configuration. Resources can be allocated here.
Definition: processor.h:174
APE_SharedInterface & getInterface()
Acquire the low-level C API.
Configuration structure with information needed for running a plugin.
Definition: processor.h:15
APE_EventType eventType
Definition: Events.h:71
union APE_Event::@0 event
virtual void stop()
Stop processing. Here's a good place to release any large resources.
Definition: processor.h:179
std::size_t inputs
How many inputs this plugin is initialized with
Definition: processor.h:21
TProcessor processor
Definition: processor.h:358
size_t blockSize
Definition: Events.h:50
Guaranteed to be mutually exclusive to any concurrent processing.
Definition: Events.h:57
void setTriggeringChannel(int channel)
Request the oscilloscope to trigger on a specific channel (default is the first output channel from t...
Definition: processor.h:146
Base traits class for all classes that are displayed in the GUI.
Definition: baselib.h:62
EmbeddedProcessor()
Initializes the processor. Processor::init()
Definition: processor.h:290
TProcessor * operator->()
Access the wrapped TProcessor instance.
Definition: processor.h:351
void processFrames(umatrix< const float > inputs, umatrix< float > outputs, size_t frames)
Trigger processing of the inputs into the outputs . EmbeddedEffect::process, EmbeddedGenerator::proc...
Definition: processor.h:59
void close()
Called just before any destructor is run.
Definition: processor.h:52
virtual void processingHook()
Internal use only
Definition: processor.h:137
Status onEvent(Event *e) override
Send an event to this processor.
Definition: processor.h:210
static constexpr APE_Status NotImplemented
No support for operation.
Definition: baselib.h:106
virtual Status onEvent(Event *e)
Send an event to this processor.
Definition: processor.h:77
static constexpr APE_Status Handled
Operation handled.
Definition: baselib.h:102
~EmbeddedProcessor()
Initializes the processor. Processor::init()
Definition: processor.h:299
virtual void process(umatrix< const float > inputs, umatrix< float > outputs, size_t frames)
Callback for processing a buffer switch in real-time.
Definition: processor.h:193
double sampleRate
The sample rate this plugin is running at.
Definition: processor.h:38
virtual void play()
Callback when the projects starts to "play". stop()
Definition: processor.h:233
Definition: audiofile.h:7
juce::AudioPlayHead::CurrentPositionInfo
Definition: SharedInterface.h:100
virtual ~Processor()
Polymorphically destruct this processor
Definition: processor.h:106
size_t inputs
Definition: Events.h:48
bool isPlaying
Definition: Events.h:59
void init()
Called after every constructor in the inheritance chain has run
Definition: processor.h:48
std::size_t sharedChannels() const noexcept
Returns the minimum number of shared channels between inputs and outputs.
Definition: processor.h:122
APE_Event_IOChanged * eIOChanged
Definition: Events.h:75
virtual void pause()
Callback when the project stops playback. play()
Definition: processor.h:241
APE_Event_PlayStateChanged * ePlayStateChanged
Definition: Events.h:76
const APE_PlayHeadPosition & getPlayHeadPosition()
Returns current position info about the playhead.
Definition: processor.h:249
A Processor with additional access to the transport / playhead of the host.
Definition: processor.h:206
void defaultProcess(umatrix< const float > inputs, umatrix< float > outputs, size_t frames)
Copy the number of shared channels from inputs to outputs , clearing any extra outputs in outputs ....
Definition: processor.h:157
void stop()
Stops the processor. Processor::stop()
Definition: processor.h:335
std::size_t maxBlockSize
The maximum amount of sample frames that can be requested at any given time.
Definition: processor.h:21
Guaranteed to be mutually exclusive to any concurrent processing.
Definition: Events.h:46
Definition: processor.h:41
bool isPlaying
Definition: SharedInterface.h:135
void clear(std::vector< T > &arr) noexcept
Clear a uarray of non-const qualified T elements to a default-initialized value.
Definition: misc.h:652
const IOConfig & config() const
Return the configuration this processor is initialized with.
Definition: processor.h:114
size_t outputs
Definition: Events.h:49
std::size_t outputs
How many outputs this plugin is initialized with
Definition: processor.h:21
Class for easily embedding processors within your processor. Base functionality for EmbeddedEffect an...
Definition: processor.h:280
void start(const IOConfig &cfg)
Starts the processor with a specific configuration. Processor::start()
Definition: processor.h:308
double sampleRate
Definition: Events.h:51
Processor()
Definition: processor.h:129