Skip to content

Commit

Permalink
Convert AudioHandle::Config to an aggregate type but keep default values
Browse files Browse the repository at this point in the history
  • Loading branch information
stellar-aria committed Feb 21, 2024
1 parent 9d93eea commit f0e3514
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/hid/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,18 @@ class AudioHandle
struct Config
{
/** number of samples to process per callback */
size_t blocksize;
size_t blocksize = 48;

/**< Sample rate of audio */
SaiHandle::Config::SampleRate samplerate;
SaiHandle::Config::SampleRate samplerate = SaiHandle::Config::SampleRate::SAI_48KHZ;

/** factor for adjustment before and after callback for hardware that may have extra headroom */
float postgain;
float postgain = 1.f;

/** factor for additional one-sided compensation to audio path for hardware that may
* have unequal input/output ranges
*/
float output_compensation;

/** Sets default values for config struct */
Config()
: blocksize(48),
samplerate(SaiHandle::Config::SampleRate::SAI_48KHZ),
postgain(1.f),
output_compensation(1.f)
{
}
float output_compensation = 1.f;
};

enum class Result
Expand Down

0 comments on commit f0e3514

Please sign in to comment.