FQLab
A spectral audio sandbox
 
Loading...
Searching...
No Matches
FQLab.UIController Class Reference

A core class of the program's UI. Keeps the state of the AudioEngine and processes requests to it made by individual Views. Ensures that all tasks on the engine finish and all resources are disposed of properly. More...

Collaboration diagram for FQLab.UIController:
Collaboration graph

Public Member Functions

 UIController (IAudioEngineFactory engineFactory)
 
bool TryPlayFile (string filePath)
 Takes a file and if successful starts the audio pipeline.
 
void UpdateEq (EqSettings settings)
 Pushes EQ changes to the audio engine.
 
void PauseTrack ()
 Pauses the engine.
 
void ResumeTrack ()
 Resumes the engine.
 
void KillTrack ()
 Aborts the audio pipeline.
 
void UpdateVolume (int option)
 Takes volume selection and handles proper conversion for the engine.
 
int GetCurrentVolume ()
 Returns the current volume factor of the audio engine.
 
List< PluginInstance >? GetPlugins ()
 

Private Member Functions

async Task StartPlayback (IAudioStream audioStream)
 Manages lifetime of an audioStream and an audioEngine. Waits for all tasks on the engine to finish.
 

Private Attributes

Task? _playbackTask
 
readonly IAudioEngineFactory _engineFactory
 
AudioEngine_audioEngine
 

Detailed Description

A core class of the program's UI. Keeps the state of the AudioEngine and processes requests to it made by individual Views. Ensures that all tasks on the engine finish and all resources are disposed of properly.

Constructor & Destructor Documentation

◆ UIController()

FQLab.UIController.UIController ( IAudioEngineFactory  engineFactory)
inline

Member Function Documentation

◆ GetCurrentVolume()

int FQLab.UIController.GetCurrentVolume ( )
inline

Returns the current volume factor of the audio engine.

Returns
Volume factor normalized for a slider.
Here is the caller graph for this function:

◆ GetPlugins()

List< PluginInstance >? FQLab.UIController.GetPlugins ( )
inline
Here is the caller graph for this function:

◆ KillTrack()

void FQLab.UIController.KillTrack ( )

Aborts the audio pipeline.

Here is the caller graph for this function:

◆ PauseTrack()

void FQLab.UIController.PauseTrack ( )

Pauses the engine.

Here is the caller graph for this function:

◆ ResumeTrack()

void FQLab.UIController.ResumeTrack ( )

Resumes the engine.

Here is the caller graph for this function:

◆ StartPlayback()

async Task FQLab.UIController.StartPlayback ( IAudioStream  audioStream)
inlineprivate

Manages lifetime of an audioStream and an audioEngine. Waits for all tasks on the engine to finish.

Parameters
audioStream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryPlayFile()

bool FQLab.UIController.TryPlayFile ( string  filePath)
inline

Takes a file and if successful starts the audio pipeline.

Parameters
filePathPath to file to-be opened.
Returns
Boolean value based on whether the operation was successful.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateEq()

void FQLab.UIController.UpdateEq ( EqSettings  settings)
inline

Pushes EQ changes to the audio engine.

Parameters
settingsExported EQ settings.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateVolume()

void FQLab.UIController.UpdateVolume ( int  option)
inline

Takes volume selection and handles proper conversion for the engine.

Parameters
optionUnconverted integer value of a slider.
Here is the caller graph for this function:

Member Data Documentation

◆ _audioEngine

AudioEngine? FQLab.UIController._audioEngine
private

◆ _engineFactory

readonly IAudioEngineFactory FQLab.UIController._engineFactory
private

◆ _playbackTask

Task? FQLab.UIController._playbackTask
private

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