Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
metal_mix.h File Reference

Metal-friendly mixer subset (linear + crossfade) with split fallback. More...

#include "mixer.h"
#include "oakfield/operator_split.h"
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for metal_mix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimMetalMixOperatorConfig
 Configuration for the metal_mix operator. More...
 

Typedefs

typedef struct SimMetalMixOperatorConfig SimMetalMixOperatorConfig
 Configuration for the metal_mix operator.
 

Functions

const char * metal_mix_mode_name (SimMixerMode mode)
 Return the schema name for a metal-mix mode.
 
bool metal_mix_mode_from_name (const char *name, SimMixerMode *out_mode)
 Parse a metal-mix mode name.
 
SimResult sim_add_metal_mix_operator (struct SimContext *context, const SimMetalMixOperatorConfig *config, size_t *out_index)
 Register a metal-friendly mixer subset operator.
 
SimResult sim_metal_mix_config (struct SimContext *context, size_t operator_index, SimMetalMixOperatorConfig *out_config)
 Copy the current metal-mix configuration from a registered operator.
 
SimResult sim_metal_mix_update (struct SimContext *context, size_t operator_index, const SimMetalMixOperatorConfig *config)
 Replace or renormalize a registered metal-mix configuration.
 

Detailed Description

Metal-friendly mixer subset (linear + crossfade) with split fallback.

Typedef Documentation

◆ SimMetalMixOperatorConfig

Configuration for the metal_mix operator.

Supports only SIM_MIXER_MODE_LINEAR and SIM_MIXER_MODE_CROSSFADE.

Function Documentation

◆ metal_mix_mode_from_name()

bool metal_mix_mode_from_name ( const char *  name,
SimMixerMode out_mode 
)

Parse a metal-mix mode name.

Only SIM_MIXER_MODE_LINEAR and SIM_MIXER_MODE_CROSSFADE are accepted.

Parameters
nameSchema mode name.
[out]out_modeReceives the parsed mode on success.
Returns
true when name maps to a supported metal-mix mode.

◆ metal_mix_mode_name()

const char * metal_mix_mode_name ( SimMixerMode  mode)

Return the schema name for a metal-mix mode.

Parameters
modeMixer mode value.
Returns
Stable lowercase mode name.

◆ sim_add_metal_mix_operator()

SimResult sim_add_metal_mix_operator ( struct SimContext context,
const SimMetalMixOperatorConfig config,
size_t *  out_index 
)

Register a metal-friendly mixer subset operator.

Parameters
contextSimulation context that will own the operator.
configOptional metal-mix configuration; NULL selects normalized defaults.
[out]out_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, mode validation, field compatibility checks, allocation, or registration.

◆ sim_metal_mix_config()

SimResult sim_metal_mix_config ( struct SimContext context,
size_t  operator_index,
SimMetalMixOperatorConfig out_config 
)

Copy the current metal-mix configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_metal_mix_operator().
[out]out_configReceives the normalized configuration.
Returns
SIM_RESULT_OK on success, SIM_RESULT_INVALID_ARGUMENT for NULL pointers, SIM_RESULT_NOT_FOUND for a missing operator, or SIM_RESULT_INVALID_STATE when the operator has no metal-mix state.

◆ sim_metal_mix_update()

SimResult sim_metal_mix_update ( struct SimContext context,
size_t  operator_index,
const SimMetalMixOperatorConfig config 
)

Replace or renormalize a registered metal-mix configuration.

Passing NULL for config keeps the current configuration and reapplies normalization. A successful update refreshes symbolic state and invalidates the scheduler plan.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the metal-mix operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code from lookup, mode validation, field compatibility checks, or state validation.