Workbench Library
0.1b
|
Configuration settings and utility functions for Workbench audio and MIDI applications. More...
Data Structures | |
struct | Config |
Defines the structure for configuration settings. More... | |
Macros | |
#define | DEFAULT_IN_CHANNELS_COUNT 1 |
Defines the default number of audio input channels. | |
#define | DEFAULT_OUT_CHANNELS_COUNT 2 |
Defines the default number of audio output channels. | |
#define | FLAGS(FLAG) |
Defines a list of feature flags and their bitwise representations. More... | |
#define | CONFIG(FIELD) |
Defines configuration fields and their default values using the X-macro technique. More... | |
Enumerations | |
enum | flag_bits { FLAGS =(WORKBENCH_FLAG_ENUMERATE) } |
Enumeration of flag bits for feature flags. | |
enum | flags { FLAGS =(WORKBENCH_FLAG_ENUMERATE) } |
Enumeration of feature flags. | |
Functions | |
Config * | config_init (int argc, char **argv, AudioCallback audio_cb, MidiCallback midi_cb, void *user_data) |
Initializes the configuration with the specified audio and MIDI callbacks. More... | |
void | config_deinit () |
void | config_print () |
Prints the current configuration settings to the standard output. | |
Config * | config_get () |
Retrieves the current configuration. More... | |
uint8_t | get_log_level () |
Retrieves the log level. More... | |
Configuration settings and utility functions for Workbench audio and MIDI applications.
This header file defines the configuration structure and related macros for managing audio and MIDI settings in Workbench applications. It includes default values, flag enumerations, and function prototypes for initializing and managing the configuration.
#define CONFIG | ( | FIELD | ) |
Defines configuration fields and their default values using the X-macro technique.
The CONFIG
macro uses the X-macro technique to define a list of configuration fields along with their types and default values. By passing a FIELD
macro to CONFIG
, you can generate different pieces of code, such as structure definitions, initializers, or setters, based on the same set of configuration fields.
FIELD | A macro that takes three parameters: type, name, and default value of a field. |
Example Usage: To define a structure with the configuration fields:
To generate setter functions for the configuration fields:
#define FLAGS | ( | FLAG | ) |
Defines a list of feature flags and their bitwise representations.
The FLAGS
macro is used to list various feature flags that can be enabled or disabled in the configuration. Each feature flag corresponds to a specific functionality (e.g., MIDI, audio) and has associated enable/disable options for input and output.
Config* config_get | ( | ) |
Retrieves the current configuration.
Config* config_init | ( | int | argc, |
char ** | argv, | ||
AudioCallback | audio_cb, | ||
MidiCallback | midi_cb, | ||
void * | user_data | ||
) |
Initializes the configuration with the specified audio and MIDI callbacks.
audio_cb | The audio callback function. |
midi_cb | The MIDI callback function. |
user_data | A pointer to the cistom user data. |
uint8_t get_log_level | ( | ) |
Retrieves the log level.
Log level determines the verbosity of the logging. The higher the value, the more verbose the logging: