Vital
Loading...
Searching...
No Matches
main.cpp File Reference
#include "JuceHeader.h"
#include "border_bounds_constrainer.h"
#include "full_interface.h"
#include "load_save.h"
#include "startup.h"
#include "synth_editor.h"
#include "tuning.h"

Classes

class  SynthApplication
 The main application class for Vital's standalone version. More...
 
class  SynthApplication::MainWindow
 The main window of the Vital standalone application. More...
 

Functions

void handleVitalCrash (void *data)
 Handles a crash in Vital by writing the current stack backtrace to a crash log file.
 
String getArgumentValue (const StringArray &args, const String &flag, const String &full_flag)
 Parses command-line arguments to find the value associated with a given flag.
 
int loadAudioFile (AudioSampleBuffer &destination, InputStream *audio_stream)
 Loads an audio file from an InputStream into an AudioSampleBuffer.
 
FileSource::FadeStyle getFadeStyleFromWavetableString (String data)
 Determines the fading style to use when interpreting a wavetable from data strings.
 

Function Documentation

◆ getArgumentValue()

String getArgumentValue ( const StringArray & args,
const String & flag,
const String & full_flag )

Parses command-line arguments to find the value associated with a given flag.

Parameters
argsThe array of command-line arguments.
flagA short flag (e.g., "-m").
full_flagA long flag (e.g., "--midi").
Returns
The value associated with the given flag if found, or an empty string otherwise.

◆ getFadeStyleFromWavetableString()

FileSource::FadeStyle getFadeStyleFromWavetableString ( String data)

Determines the fading style to use when interpreting a wavetable from data strings.

This function looks for special markers in the wavetable data and returns a corresponding FileSource::FadeStyle to indicate how frames should be interpolated.

Parameters
dataThe wavetable data string.
Returns
The appropriate FileSource::FadeStyle derived from the data.

◆ handleVitalCrash()

void handleVitalCrash ( void * data)

Handles a crash in Vital by writing the current stack backtrace to a crash log file.

Parameters
dataUnused pointer parameter, required by the system crash handler signature.

◆ loadAudioFile()

int loadAudioFile ( AudioSampleBuffer & destination,
InputStream * audio_stream )

Loads an audio file from an InputStream into an AudioSampleBuffer.

The function attempts to read the audio data using available AudioFormatReaders. On success, the destination buffer is resized and populated with the file's samples.

Parameters
destinationThe AudioSampleBuffer to load data into.
audio_streamA pointer to the input stream containing audio data.
Returns
The sample rate of the loaded file if successful, or 0 if loading failed.