Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Ase::ClapAudioProcessor Class Reference
Inheritance diagram for Ase::ClapAudioProcessor:
[legend]

Public Member Functions

 ClapAudioProcessor (const ProcessorSetup &psetup)
 
void initialize (SpeakerArrangement busses) override
 
void reset (uint64 target_stamp) override
 Reset all state variables.
 
void convert_clap_events (const clap_process_t &process, bool as_clapnotes)
 
void enqueue_events (ClapEventParamS *pevents)
 
bool start_processing (const ClapParamInfoMap *param_info_map, const ClapParamInfoImpl *map_start, size_t map_size)
 
void stop_processing ()
 
void update_transportinfo ()
 
void render (uint n_frames) override
 
bool apply_param_value_event (const clap_event_param_value &e)
 
bool dequeue_events (size_t nframes)
 
- Public Member Functions inherited from Ase::AudioProcessor
AtomicBits::Iter atomic_bits_iter (size_t pos=0) const
 Allow iterations over the atomic bits.
 
float note_to_freq (int note) const
 Convert MIDI note to Hertz according to the current MusicalTuning.
 
String debug_name () const
 
AudioEngineengine () const
 Retrieve AudioEngine handle for this AudioProcessor.
 
const AudioTransporttransport () const
 Sample rate mixing frequency in Hz as unsigned, used for render().
 
uint sample_rate () const
 
double nyquist () const
 Half the sample rate in Hz as double, used for render().
 
double inyquist () const
 Inverse Nyquist frequency, i.e. 1.0 / nyquist().
 
double get_param (Id32 paramid)
 Fetch value of parameter id.
 
bool send_param (Id32 paramid, double value)
 Set parameter id to value within ParamInfo.get_minmax().
 
ParameterC parameter (Id32 paramid) const
 Retrieve supplemental information for parameters, usually to enhance the user interface.
 
MaybeParamId find_param (const String &identifier) const
 Return the ParamId for parameter identifier or else 0.
 
MinMax param_range (Id32 paramid) const
 Retrieve the minimum / maximum values for a parameter.
 
bool check_dirty (Id32 paramid) const
 
void adjust_all_params ()
 
virtual String param_value_to_text (uint32_t paramid, double value) const
 
virtual double param_value_from_text (uint32_t paramid, const String &text) const
 
virtual double value_to_normalized (Id32 paramid, double value) const
 
virtual double value_from_normalized (Id32 paramid, double normalized) const
 
double get_normalized (Id32 paramid)
 Get param value normalized into 0…1.
 
bool set_normalized (Id32 paramid, double normalized)
 Set param value normalized into 0…1.
 
bool is_initialized () const
 Check if AudioProcessor has been properly intiialized (so the parameter set is fixed).
 
uint text_param_to_quark (uint32_t paramid, const String &text)
 Ase main-thread helper for temporary string<->uint conversions.
 
String text_param_from_quark (uint32_t paramid, uint vint)
 Helper for temporary uint<->string conversions.
 
IBusId find_ibus (const String &name) const
 Return the IBusId for input bus uilabel or else 0.
 
OBusId find_obus (const String &name) const
 Return the OBusId for output bus uilabel or else 0.
 
uint n_ibuses () const
 Number of input buses configured for this AudioProcessor.
 
uint n_obuses () const
 Number of output buses configured for this AudioProcessor.
 
uint n_ichannels (IBusId busid) const
 Number of channels of input bus busid configured for this AudioProcessor.
 
uint n_ochannels (OBusId busid) const
 Number of channels of output bus busid configured for this AudioProcessor.
 
BusInfo bus_info (IBusId busid) const
 Retrieve BusInfo for an input bus.
 
BusInfo bus_info (OBusId busid) const
 Retrieve BusInfo for an output bus.
 
bool connected (OBusId obusid) const
 
const floatifloats (IBusId b, uint c) const
 Access readonly float buffer of input bus b, channel c, see also ofloats().
 
const floatofloats (OBusId b, uint c) const
 Access readonly float buffer of output bus b, channel c, see also oblock().
 
DeviceP get_device () const
 Gain access to the Device handle of this AudioProcessor.
 
bool has_event_input () const
 Returns true if this AudioProcessor has an event input stream.
 
bool has_event_output () const
 Returns true if this AudioProcessor has an event output stream.
 
void connect_event_input (AudioProcessor &oproc)
 Connect event input to event output of AudioProcessor oproc.
 
void disconnect_event_input ()
 Disconnect event input if a connection is present.
 
void enable_engine_output (bool onoff)
 Configure if the main output of this module is mixed into the engine output.
 
- Public Member Functions inherited from std::enable_shared_from_this< AudioProcessor >
enable_shared_from_this (T... args)
 
operator= (T... args)
 
shared_from_this (T... args)
 
weak_from_this (T... args)
 
~enable_shared_from_this (T... args)
 
- Public Member Functions inherited from Ase::FastMemory::NewDeleteBase
void * operator new (std::size_t sz)
 
void * operator new[] (std::size_t sz)
 
void * operator new (std::size_t sz, std::align_val_t al)
 
void * operator new[] (std::size_t sz, std::align_val_t al)
 
void operator delete (void *ptr, std::size_t sz)
 
void operator delete[] (void *ptr, std::size_t sz)
 
void operator delete (void *ptr, std::size_t sz, std::align_val_t al)
 
void operator delete[] (void *ptr, std::size_t sz, std::align_val_t al)
 

Static Public Member Functions

static void static_info (AudioProcessorInfo &info)
 
static uint32_t input_events_size (const clap_input_events *evlist)
 
static const clap_event_header_t * input_events_get (const clap_input_events *evlist, uint32_t index)
 
static bool output_events_try_push (const clap_output_events *evlist, const clap_event_header_t *event)
 
- Static Public Member Functions inherited from Ase::AudioProcessor
static uint64 timestamp ()
 The current timestamp in sample frames.
 
static double param_peek_mt (const AudioProcessorP proc, Id32 paramid)
 
static void registry_add (CString aseid, StaticInfo, MakeProcessorP)
 
static DeviceP registry_create (CString aseid, AudioEngine &engine, const MakeDeviceP &)
 
static void registry_foreach (const std::function< void(const String &aseid, StaticInfo)> &fun)
 Iterate over the known AudioProcessor types.
 
template<class AudioProc , class ... Args>
static std::shared_ptr< AudioProc > create_processor (AudioEngine &engine, const Args &...args)
 

Public Attributes

std::vector< ClapEventUnioninput_events_
 
std::vector< ClapEventUnionoutput_events_
 
const clap_input_events_t plugin_input_events
 
const clap_output_events_t plugin_output_events
 
const ClapParamInfoMapparam_info_map_
 
const ClapParamInfoImplparam_info_map_start_
 
clap_process_t processinfo
 
clap_event_transport_t transportinfo
 
std::vector< ClapEventParamS * > enqueued_events_
 

Additional Inherited Members

- Public Types inherited from Ase::AudioProcessor
using MakeProcessor = AudioProcessorP(*)(AudioEngine &)
 
using MaybeParamId = std::pair< ParamId, bool >
 
using StaticInfo = void(*)(AudioProcessorInfo &)
 
using MakeDeviceP = std::function< DeviceP(const String &, StaticInfo, AudioProcessorP)>
 
using MakeProcessorP = AudioProcessorP(*)(CString, AudioEngine &)
 
- Static Public Attributes inherited from Ase::AudioProcessor
static const String GUIONLY
 ":G:r:w:" - GUI READABLE WRITABLE
 
static const String STANDARD
 ":G:S:r:w:" - GUI STORAGE READABLE WRITABLE
 
static const String STORAGEONLY
 ":S:r:w:" - STORAGE READABLE WRITABLE
 
- Protected Types inherited from Ase::AudioProcessor
enum  {
  INITIALIZED , SCHEDULED , PARAMCHANGE , BUSCONNECT ,
  BUSDISCONNECT , INSERTION , REMOVAL , ENGINE_OUTPUT
}
 
using MinMax = std::pair< double, double >
 
using MidiEventInput = MidiEventReader< 2 >
 
- Protected Member Functions inherited from Ase::AudioProcessor
 AudioProcessor (const ProcessorSetup &)
 Constructor for AudioProcessor.
 
virtual ~AudioProcessor ()
 The destructor is called when the last std::shared_ptr<> reference drops.
 
void enotify_enqueue_mt (uint32 pushmask)
 
uint schedule_processor ()
 Schedule this node and its dependencies for engine rendering.
 
void reschedule ()
 Request recreation of the audio engine rendering schedule.
 
virtual uint schedule_children ()
 
void install_params (const AudioParams::Map &params)
 Reset list of parameters, enqueues parameter value initializaiton events.
 
void apply_event (const MidiEvent &event)
 Assign MidiEvent::PARAM_VALUE event values to parameters.
 
void apply_input_events ()
 
virtual void adjust_param (uint32_t paramid)
 
double peek_param_mt (Id32 paramid) const
 
IBusId add_input_bus (CString uilabel, SpeakerArrangement speakerarrangement, const String &hints="", const String &blurb="")
 Add an input bus with uilabel and channels configured via speakerarrangement.
 
OBusId add_output_bus (CString uilabel, SpeakerArrangement speakerarrangement, const String &hints="", const String &blurb="")
 Add an output bus with uilabel and channels configured via speakerarrangement.
 
void remove_all_buses ()
 Remove existing bus configurations, useful at the start of configure().
 
IOBusiobus (OBusId busid)
 Get internal output bus handle.
 
IOBusiobus (IBusId busid)
 Get internal input bus handle.
 
const IOBusiobus (OBusId busid) const
 
const IOBusiobus (IBusId busid) const
 
void disconnect_ibuses ()
 Reset input bus buffer data.
 
void disconnect_obuses ()
 Disconnect inputs of all Processors that are connected to outputs of this.
 
void disconnect (IBusId ibus)
 Disconnect input ibusid.
 
void connect (IBusId ibus, AudioProcessor &oproc, OBusId obus)
 Connect input ibusid to output obusid of AudioProcessor prev.
 
floatoblock (OBusId b, uint c)
 
void assign_oblock (OBusId b, uint c, float val)
 Fill the output buffer of bus b, channel c with v.
 
void redirect_oblock (OBusId b, uint c, const float *block)
 Redirect output buffer of bus b, channel c to point to block, or zeros if block==nullptr.
 
void prepare_event_input ()
 
void prepare_event_output ()
 
MidiEventInput midi_event_input ()
 Access the current MidiEvent inputs during render(), needs prepare_event_input().
 
MidiEventOutputmidi_event_output ()
 Access the current output EventStream during render(), needs prepare_event_output().
 
void atomic_bits_resize (size_t count)
 Prepare count bits for atomic notifications.
 
bool atomic_bit_notify (size_t nth)
 Set the nth atomic notification bit, return if enotify_enqueue_mt() is needed.
 
- Static Protected Member Functions inherited from Ase::AudioProcessor
static uint schedule_processor (AudioProcessor &p)
 
- Protected Attributes inherited from Ase::AudioProcessor
std::atomic< uint32flags_
 
AudioEngineengine_
 
CString aseid_
 

Detailed Description

Definition at line 221 of file clapplugin.cc.

Constructor & Destructor Documentation

◆ ClapAudioProcessor()

Ase::ClapAudioProcessor::ClapAudioProcessor ( const ProcessorSetup psetup)

Definition at line 238 of file clapplugin.cc.

◆ ~ClapAudioProcessor()

Ase::ClapAudioProcessor::~ClapAudioProcessor ( )

Definition at line 241 of file clapplugin.cc.

Member Function Documentation

◆ apply_param_value_event()

bool Ase::ClapAudioProcessor::apply_param_value_event ( const clap_event_param_value &  e)

Definition at line 463 of file clapplugin.cc.

◆ convert_clap_events()

void Ase::ClapAudioProcessor::convert_clap_events ( const clap_process_t &  process,
bool  as_clapnotes 
)

Definition at line 539 of file clapplugin.cc.

◆ dequeue_events()

bool Ase::ClapAudioProcessor::dequeue_events ( size_t  nframes)

Definition at line 482 of file clapplugin.cc.

◆ enqueue_events()

void Ase::ClapAudioProcessor::enqueue_events ( ClapEventParamS pevents)

Definition at line 350 of file clapplugin.cc.

◆ initialize()

void Ase::ClapAudioProcessor::initialize ( SpeakerArrangement  busses)
overridevirtual

◆ input_events_get()

static const clap_event_header_t * Ase::ClapAudioProcessor::input_events_get ( const clap_input_events *  evlist,
uint32_t  index 
)
static

Definition at line 319 of file clapplugin.cc.

◆ input_events_size()

static uint32_t Ase::ClapAudioProcessor::input_events_size ( const clap_input_events *  evlist)
static

Definition at line 310 of file clapplugin.cc.

◆ output_events_try_push()

static bool Ase::ClapAudioProcessor::output_events_try_push ( const clap_output_events *  evlist,
const clap_event_header_t *  event 
)
static

Definition at line 330 of file clapplugin.cc.

◆ render()

void Ase::ClapAudioProcessor::render ( uint  n_frames)
overridevirtual

Method called for every audio buffer to be processed. Each connected output bus needs to be filled with n_frames, i.e. n_frames many floating point samples per channel. Using the AudioSignal::OBusId (see add_output_bus()), the floating point sample buffers can be addressed via the BusConfig structure as: bus[obusid].channel[nth].buffer, see FloatBuffer for further details. The AudioSignal::IBusId (see add_input_bus()) can be used correspondingly to retrieve input channel values.

Implements Ase::AudioProcessor.

Definition at line 433 of file clapplugin.cc.

References assert_return, Ase::AudioProcessor::enotify_enqueue_mt(), Ase::AudioProcessor::ifloats(), Ase::AudioProcessor::n_ichannels(), Ase::AudioProcessor::n_ochannels(), and Ase::AudioProcessor::oblock().

◆ reset()

void Ase::ClapAudioProcessor::reset ( uint64  target_stamp)
overridevirtual

Reset all state variables.

Implements Ase::AudioProcessor.

Definition at line 304 of file clapplugin.cc.

◆ start_processing()

bool Ase::ClapAudioProcessor::start_processing ( const ClapParamInfoMap param_info_map,
const ClapParamInfoImpl map_start,
size_t  map_size 
)

Definition at line 363 of file clapplugin.cc.

◆ static_info()

static void Ase::ClapAudioProcessor::static_info ( AudioProcessorInfo info)
static

Definition at line 234 of file clapplugin.cc.

◆ stop_processing()

void Ase::ClapAudioProcessor::stop_processing ( )

Definition at line 394 of file clapplugin.cc.

◆ update_transportinfo()

void Ase::ClapAudioProcessor::update_transportinfo ( )

Definition at line 406 of file clapplugin.cc.

Member Data Documentation

◆ enqueued_events_

std::vector<ClapEventParamS*> Ase::ClapAudioProcessor::enqueued_events_

Definition at line 348 of file clapplugin.cc.

◆ input_events_

std::vector<ClapEventUnion> Ase::ClapAudioProcessor::input_events_

Definition at line 307 of file clapplugin.cc.

◆ output_events_

std::vector<ClapEventUnion> Ase::ClapAudioProcessor::output_events_

Definition at line 308 of file clapplugin.cc.

◆ param_info_map_

const ClapParamInfoMap* Ase::ClapAudioProcessor::param_info_map_

Definition at line 344 of file clapplugin.cc.

◆ param_info_map_start_

const ClapParamInfoImpl* Ase::ClapAudioProcessor::param_info_map_start_

Definition at line 345 of file clapplugin.cc.

◆ plugin_input_events

const clap_input_events_t Ase::ClapAudioProcessor::plugin_input_events

Definition at line 335 of file clapplugin.cc.

◆ plugin_output_events

const clap_output_events_t Ase::ClapAudioProcessor::plugin_output_events

Definition at line 340 of file clapplugin.cc.

◆ processinfo

clap_process_t Ase::ClapAudioProcessor::processinfo

Definition at line 346 of file clapplugin.cc.

◆ transportinfo

clap_event_transport_t Ase::ClapAudioProcessor::transportinfo

Definition at line 347 of file clapplugin.cc.


The documentation for this class was generated from the following file: