![]() |
:)
|
Top-Level API to interact with RustyAudioLibrary (RustyAudioLib.hpp). More...
#include <RustyAudioLib.hpp>
Public Member Functions | |
| RustyAudioLibAPI () | |
| RustyAudioLibAPI constructor. | |
| ~RustyAudioLibAPI () | |
| RustyAudioLibAPI destructor. | |
| void | init () |
| Initialisation function for RustyAudioLib. | |
| void | cliCallback (std::vector< std::string > inputParsed) |
| Callback from CLI. | |
| void | printProcessors () |
| Prints instantiated processors. | |
| void | printModulators () |
| Prints instantiated modulators. | |
| void | setParam (std::string unit, std::string param, std::string value) |
| Set Parameters inside units at run time. | |
| void | addProcessorToSignalChain (RustyProcessor *processor) |
| Adds RustyProcessors to signal chain. | |
| RustyProcessor * | createGainUnit (std::string name, float gain) |
| Creation function for RustyGain. | |
| RustyProcessor * | createOverdriveUnit (std::string name, float drive) |
| Creation function for RustyOverdrive. | |
| RustyProcessor * | createFilterUnit (std::string name, RustyFilterType type, float frequency, float q) |
| Creation function for RustyFilter. | |
| RustyProcessor * | createCompressorUnit (std::string name, float threshold, float knee, float ratio, float attack, float release, float makeupGain) |
| Creation function for RustyCompressor. | |
| void | setModulator (std::string parameter, RustyProcessor *processor, RustyModulator *modulator) |
| Adds RustyModulator to RustyProcessor. | |
| RustyModulator * | createLFO (std::string name, float frequency, float min, float max) |
| Creation function for RustyLFO. | |
| void | setIO (std::string inputString, AudioType inputType, int inputIx, std::string outputString, AudioType outputType, int outputIx) |
| Defines IO devices for RustyAudioEngine to connect to. | |
Private Member Functions | |
| void | initCLI () |
| Initialise CLI and CLI thread. | |
Private Attributes | |
| std::map< std::string, std::unique_ptr< RustyProcessor > > | _processors |
| Map of all instantiated RustyProcessor units. | |
| std::map< std::string, std::unique_ptr< RustyModulator > > | _modulators |
| Map of all instantiated RustyModulator units. | |
| RustyAudioEngine | engine |
| RustyAudioEngine instance saved here. | |
| RustyCLI | cli |
| RustyCLI instance saved here. | |
| std::thread | cliThread |
| Dedicated thread to run RustyCLI on. | |
| SettingsIO | settings |
| RustyAudioLib IO settings. | |
Top-Level API to interact with RustyAudioLibrary (RustyAudioLib.hpp).
RustyAudioLibAPI follows a factory style top level implementation. Meaning instead of interacting with the library directly, instead there are creation functions. Creation functions will create instances of RustyAudioLibrary units. Creation functions will then return a pointer to the created unit allowing for further manipulation at runtime or within the user's main() code.
Must call init() function to open audio stream and start CLI. Call it at the end of main().
Audio-related heavy lifting is handled by RustyAudioEngine. CLI handled by RustyCLI.
Definition at line 47 of file RustyAudioLib.hpp.
|
inline |
RustyAudioLibAPI constructor.
Constructor creates relevant objects. No interaction from user needed.
Definition at line 56 of file RustyAudioLib.hpp.
|
inline |
RustyAudioLibAPI destructor.
Joins CLI thread before initialising shutdown. No interaction from user needed.
Definition at line 67 of file RustyAudioLib.hpp.
|
inline |
Initialisation function for RustyAudioLib.
RustyAudioLib initialise function calls the relevant functions inside RustyCLI and RustyAudioEngine to start them running.
For the RustyAudioEngine it starts the stream, opening it to the chosen output/input.
For RustyCLI it begins the loop needed to check the console for inputs.
RustyAudioEngine and RustyCLI also run on separate threads, this functions helps instantiate that.
Ensure this function is called at the END of your main.
Definition at line 93 of file RustyAudioLib.hpp.
|
inline |
Callback from CLI.
Function is called from RustyCLI when users input commands that need to interact with information only available in the RustyAudioLibAPI.
| inputParsed | Parsed user CLI commands. |
Definition at line 109 of file RustyAudioLib.hpp.
|
inline |
Prints instantiated processors.
Function is normally called by the CLI when user is interacting with RustyAudioTool at runtime.
This function will print to console all RustyProcessors that have been created. This will include RustyProcessors that have not been added to the processing chain in RustyAudioEngine.
Definition at line 147 of file RustyAudioLib.hpp.
|
inline |
Prints instantiated modulators.
Function is normally called by the CLI when user is interacting with RustyAudioTool at runtime.
This function will print to console all RustyModulators that have been created. This will include RustyModulators that have not been added to any RustyProcessors.
Definition at line 176 of file RustyAudioLib.hpp.
|
inline |
Set Parameters inside units at run time.
Function is normally called by the CLI when user is interacting with RustyAudioTool at runtime.
This function allows users to update parameters of units at runtime. This function is called via callback by RustyCLI::commandHandler();
| processor | Name given to unit when created. |
| param | Name of parameter to change. |
| value | New value for parameter. |
| BAD_UNIT_NAME | If given processor name doesn't match an existing unit. |
Definition at line 212 of file RustyAudioLib.hpp.
|
inline |
Adds RustyProcessors to signal chain.
This function will place the passed in processing unit into the signal chain, allowing the processor to affect the audio. You can add as many units as you want to the signal chain but bare in mind they will be used in the sequence you added them in. First in first used.
| processor | A pointer to an instantiated RustyProcessor unit. |
Definition at line 243 of file RustyAudioLib.hpp.
|
inline |
Creation function for RustyGain.
This function creates an instance of a RustyGain and stores it inside a map of instantiated processors.
| name | Name given to the created RustyProcessor. |
| drive | Float of gain multiplier. |
Definition at line 259 of file RustyAudioLib.hpp.
|
inline |
Creation function for RustyOverdrive.
This function creates an instance of a RustyOverdrive and stores it inside a map of instantiated processors.
| name | Name given to the created RustyProcessor. |
| drive | Float of distortion multiplier. |
Definition at line 278 of file RustyAudioLib.hpp.
|
inline |
Creation function for RustyFilter.
This function creates an instance of a RustyFilter and stores it inside a map of instantiated processors.
| name | Name given to the created RustyProcessor. |
| type | Selects filter mode from RustyFilterType. |
| frequency | Cutoff frequency of filter - Runtime adjustable. |
| q | Q of filter - Runtime adjustable. |
Definition at line 299 of file RustyAudioLib.hpp.
|
inline |
Creation function for RustyCompressor.
This function creates an instance of a RustyCompressor and stores it inside a map of instantiated processors.
| name | Name given to the created RustyProcessor. |
| threshold | Float of threshold in dB. |
| knee | Float of knee curve in dB. |
| ratio | Float of compression ratio. |
| attack | Float of attack speed in Ms. |
| release | Float of release speed in ms. |
| makeupGain | Float of gain makeup in dB. |
Definition at line 323 of file RustyAudioLib.hpp.
|
inline |
Adds RustyModulator to RustyProcessor.
This function allows you to add a RustyModulator unit to a RustyProcessor unit. You define the parameter you wish to manipulate and then the RustyModulator will affect the parameter at the rate defined during it's creation.
| parameter | Name of the RustyProcessor parameter to modulate . |
| processor | Pointer to RustyProcessor to affect. |
| modulator | Pointer to RustyModulator that will be used to affect parameter. |
Definition at line 343 of file RustyAudioLib.hpp.
|
inline |
Creation function for RustyLFO.
This function creates an instance of a RustyLFO and stores it inside a map of instantiated modulators.
| name | Name given to the created RustyModulator. |
| frequency | Frequency of LFO in Hz. |
| min | Minimum value to be oscillated between. |
| max | Maximum value to be oscillated between. |
Definition at line 361 of file RustyAudioLib.hpp.
|
inline |
Defines IO devices for RustyAudioEngine to connect to.
This function creates an objects of RustyCommonTypes::SettingsIO. This keeps all of the users selected IO in one neat place then passes it down to RustyAudioEngine so it can open streams to the appropriate devices.
| inputString | String of input device name. |
| inputType | AudioType of input (MONO or STEREO). |
| inputIx | Int of used channel index(s) within device (Channel 1 = index 0). |
| outputString | String of output device name. |
| outputType | AudioType of output (MONO or STEREO). |
| outputIx | Int of used channel index(s) within device (Channel 1 = index 0). |
Definition at line 387 of file RustyAudioLib.hpp.
|
inlineprivate |
Initialise CLI and CLI thread.
A simple initialisation function to start the CLI loop and start the CLI separate thread.
Definition at line 416 of file RustyAudioLib.hpp.
|
private |
Map of all instantiated RustyProcessor units.
Definition at line 400 of file RustyAudioLib.hpp.
|
private |
Map of all instantiated RustyModulator units.
Definition at line 401 of file RustyAudioLib.hpp.
|
private |
RustyAudioEngine instance saved here.
Definition at line 403 of file RustyAudioLib.hpp.
|
private |
RustyCLI instance saved here.
Definition at line 404 of file RustyAudioLib.hpp.
|
private |
Dedicated thread to run RustyCLI on.
Definition at line 405 of file RustyAudioLib.hpp.
|
private |
RustyAudioLib IO settings.
Definition at line 406 of file RustyAudioLib.hpp.