71std::any
safe_get_parameter(
const std::string& parameter_name,
const std::map<std::string, std::any> parameters);
81 return frames / frame_rate;
91 return std::chrono::milliseconds(1000 / frame_rate);
101 return std::chrono::microseconds(1000000 / frame_rate);
112 return std::chrono::milliseconds((num_frames * 1000) / frame_rate);
123 return std::chrono::microseconds((num_frames * 1000000) / frame_rate);
133 return samples / sample_rate;
145 return (frames * sample_rate) / frame_rate;
157 return (samples * frame_rate) / sample_rate;
168 return static_cast<uint64_t
>(seconds * sample_rate);
179 return static_cast<uint64_t
>(seconds * frame_rate);
190 return static_cast<uint64_t
>(seconds * rate);
201 return static_cast<double>(units) / rate;
uint64_t frames_to_seconds(uint64_t frames, uint32_t frame_rate)
Convert frames to seconds at a given frame rate.
std::chrono::microseconds frames_duration_us(uint64_t num_frames, uint32_t frame_rate)
Get duration for N frames at given frame rate (high precision)
double units_to_seconds(uint64_t units, uint32_t rate)
Convert processing units to seconds for any rate.
std::any safe_get_parameter(const std::string ¶meter_name, const std::map< std::string, std::any > parameters)
uint64_t samples_to_frames(uint64_t samples, uint32_t sample_rate, uint32_t frame_rate)
Convert samples to frames at a given sample rate and frame rate.
NodeChainSemantics
Defines how to handle existing nodes when creating a new chain.
@ PRESERVE_BOTH
Preserve both nodes in the chain, add new chain node to root, i.e doubling the target signal.
@ REPLACE_TARGET
Unregister the target and register with the new chain node.
@ ONLY_CHAIN
Only keep the new chain node, unregistering the source and target.
@ KEEP
Preserve both nodes in the binary op, add new binary op node to root, i.e doubling the signal.
@ REPLACE
Unregister both nodes and register with the new binary op node.
std::chrono::milliseconds frames_duration_ms(uint64_t num_frames, uint32_t frame_rate)
Get duration for N frames at given frame rate.
std::chrono::milliseconds frame_duration_ms(uint32_t frame_rate)
Get duration of a single frame at given frame rate.
uint64_t seconds_to_units(double seconds, uint32_t rate)
Convert seconds to processing units for any rate.
@ PENDING_REMOVAL
Node is marked for removal.
@ EXTERMAL_PROCESSED
External source has processed this node.
@ INACTIVE
Engine is not processing this node.
@ ENGINE_MOCK_PROCESSED
Engine has mock processed this node.
@ ACTIVE
Engine is processing this node.
@ MOCK_PROCESS
Node should be processed but output ignored.
@ ENGINE_PROCESSED
Engine has processed this node.
@ PROCESSED
Node has been processed this cycle.
std::chrono::microseconds frame_duration_us(uint32_t frame_rate)
Get duration of a single frame at given frame rate (high precision)
uint64_t seconds_to_samples(double seconds, uint32_t sample_rate)
Convert seconds to samples at a given sample rate.
uint64_t seconds_to_frames(double seconds, uint32_t frame_rate)
Convert seconds to frames at a given frame rate.
uint64_t frames_to_samples(uint64_t frames, uint32_t sample_rate, uint32_t frame_rate)
Convert frames to samples at a given sample rate and frame rate.
ComplexConversionStrategy
Strategy for converting complex numbers to real values.
@ SQUARED_MAGNITUDE
|z|² = real² + imag²
@ MAGNITUDE
|z| = sqrt(real² + imag²)
uint64_t samples_to_seconds(uint64_t samples, uint32_t sample_rate)
Convert samples to seconds at a given sample rate.