MostlyHarmless 0.0.1
Loading...
Searching...
No Matches
mostly_harmless Namespace Reference

The top-level namespace, contains all things plugin-related. More...

Namespaces

namespace  core
 Contains core functionality of the framework.
namespace  internal
 Framework-Developer-Only documentation, for specific mechanisms within the framework.
namespace  events
 Contains classes and functions related to events.
namespace  gui
 Contains GUI related classes & functions.
namespace  utils
 Contains general purpose utility classes & functions.
namespace  data
 Contains classes and functions related to data management.
namespace  audio
 Contains audio helpers and utilities.

Classes

struct  TimeSignature
 Convenience struct holding the numerator and denominator of a time signature. Two ints in a trenchcoat. More...
struct  LoopInfo
 Convenience struct holding relevant positional info about a loop the host may currently be running. More...
struct  TransportState
 Contains info from the host about the current transport state. More...
struct  ParameterID
 Convenience class for generating a parameter id. More...
struct  Parameter
 Container class for a single parameter. More...

Enumerations

enum class  BusConfig { InputOutput , InputOnly , OutputOnly , None }
 Represents available IO configs, for both audio and midi. More...

Functions

clap_plugin_descriptor & getDescriptor ()
BusConfig getAudioBusConfig () noexcept
BusConfig getNoteBusConfig () noexcept
template<marvin::FloatType SampleType>
void runBlockDispatch (marvin::containers::BufferView< SampleType > buffer, mostly_harmless::events::InputEventContext eventContext, std::function< void(const clap_event_header *event)> &&eventCallback, std::function< void(marvin::containers::BufferView< SampleType >)> &&blockCallback)
 Splits an input buffer into chunks and dispatches them, allowing for block based processing.

Detailed Description

The top-level namespace, contains all things plugin-related.

Enumeration Type Documentation

◆ BusConfig

enum class mostly_harmless::BusConfig
strong

Represents available IO configs, for both audio and midi.

Enumerator
InputOutput 
InputOnly 
OutputOnly 
None 

Function Documentation

◆ getAudioBusConfig()

BusConfig mostly_harmless::getAudioBusConfig ( )
nodiscardnoexcept

Retrieves the current mostly_harmless::BusConfig in use for audio io.

◆ getDescriptor()

clap_plugin_descriptor & mostly_harmless::getDescriptor ( )
nodiscard

Retrieve the currently set clap_plugin_descriptor details. This is populated via the mostly_harmless_add_plugin cmake function.

◆ getNoteBusConfig()

BusConfig mostly_harmless::getNoteBusConfig ( )
nodiscardnoexcept

Retrieves the current mostly_harmless::BusConfig in use for midi io.

◆ runBlockDispatch()

template<marvin::FloatType SampleType>
void mostly_harmless::runBlockDispatch ( marvin::containers::BufferView< SampleType > buffer,
mostly_harmless::events::InputEventContext eventContext,
std::function< void(const clap_event_header *event)> && eventCallback,
std::function< void(marvin::containers::BufferView< SampleType >)> && blockCallback )

Splits an input buffer into chunks and dispatches them, allowing for block based processing.

As parameter and note events are sample accurate, and passed via a single queue, naively doing block based processing with the entire input buffer would mean only having one param / note update event per block. To get around this, this function handles chunking the audio between events, and calling some process function with that chunk. For example:

void Plugin::process(marvin::containers::ByfferView<float> buffer, mostly_harmless::events::InputEventContext context) {
runBlockDispatch(buffer, context,
[this](const clap_event_header* event) -> void {
handleEvent(event);
},
[this](marvin::containers::BufferView<float> chunk) -> void {
// assuming a member called m_processor
m_processor.process(chunk);
}
);
}
void runBlockDispatch(marvin::containers::BufferView< SampleType > buffer, mostly_harmless::events::InputEventContext eventContext, std::function< void(const clap_event_header *event)> &&eventCallback, std::function< void(marvin::containers::BufferView< SampleType >)> &&blockCallback)
Splits an input buffer into chunks and dispatches them, allowing for block based processing.
Definition mostlyharmless_AudioHelpers.h:37
Trivially copyable wrapper around the clap-api provided clap_input_events queue, for easier iterating...
Definition mostlyharmless_InputEventContext.h:9
Parameters
bufferThe entire buffer for this block
eventCallbackThe input event queue for this block.
eventCallbackA callback to invoke on a new event.
blockCallbackA callback to invoke on a new chunk.