neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neogfx::audio_oscillator Class Reference

#include <audio_oscillator.hpp>

Inheritance diagram for neogfx::audio_oscillator:
neolib::reference_counted< Base, DeallocateOnRelease >

Public Member Functions

 audio_oscillator (audio_sample_rate aSampleRate, float aFrequency, float aAmplitude=1.0f, oscillator_function aFunction=oscillator_function::Sine)
 
 audio_oscillator (audio_sample_rate aSampleRate, float aFrequency, float aAmplitude, std::function< float(float)> const &aFunction)
 
audio_sample_rate sample_rate () const final
 
void set_sample_rate (audio_sample_rate aSampleRate) final
 
float frequency () const final
 
void set_frequency (float aFrequency) final
 
float amplitude () const final
 
void set_amplitude (float aAmplitude) final
 
oscillator_function function () const final
 
void set_function (oscillator_function aFunction) final
 
void set_function (std::function< float(float)> const &aFunction) final
 Note: not plugin-safe.
 
void generate (audio_sample_count aSampleCount, float *aOutputSamples) final
 
void generate_from (audio_sample_index aSampleFrom, audio_sample_count aSampleCount, float *aOutputSamples) final
 
- Public Member Functions inherited from neolib::reference_counted< Base, DeallocateOnRelease >
 reference_counted () noexcept
 
 reference_counted (const reference_counted &aOther) noexcept
 
 ~reference_counted ()
 
reference_countedoperator= (const reference_counted &)
 
void add_ref () const noexcept override
 
void release () const override
 
int32_t use_count () const noexcept override
 
const base_type * release_and_take_ownership () const override
 
base_type * release_and_take_ownership () override
 
void pin () const noexcept override
 
void unpin () const override
 
i_ref_control_blockcontrol_block () override
 

Detailed Description

Definition at line 27 of file audio_oscillator.hpp.

Constructor & Destructor Documentation

◆ audio_oscillator() [1/2]

neogfx::audio_oscillator::audio_oscillator ( audio_sample_rate  aSampleRate,
float  aFrequency,
float  aAmplitude = 1.0f,
oscillator_function  aFunction = oscillator_function::Sine 
)

◆ audio_oscillator() [2/2]

neogfx::audio_oscillator::audio_oscillator ( audio_sample_rate  aSampleRate,
float  aFrequency,
float  aAmplitude,
std::function< float(float)> const &  aFunction 
)

Member Function Documentation

◆ amplitude()

float neogfx::audio_oscillator::amplitude ( ) const
final

◆ frequency()

float neogfx::audio_oscillator::frequency ( ) const
final

◆ function()

oscillator_function neogfx::audio_oscillator::function ( ) const
final

◆ generate()

void neogfx::audio_oscillator::generate ( audio_sample_count  aSampleCount,
float *  aOutputSamples 
)
final

◆ generate_from()

void neogfx::audio_oscillator::generate_from ( audio_sample_index  aSampleFrom,
audio_sample_count  aSampleCount,
float *  aOutputSamples 
)
final

◆ sample_rate()

audio_sample_rate neogfx::audio_oscillator::sample_rate ( ) const
final

◆ set_amplitude()

void neogfx::audio_oscillator::set_amplitude ( float  aAmplitude)
final

◆ set_frequency()

void neogfx::audio_oscillator::set_frequency ( float  aFrequency)
final

◆ set_function() [1/2]

void neogfx::audio_oscillator::set_function ( oscillator_function  aFunction)
final

◆ set_function() [2/2]

void neogfx::audio_oscillator::set_function ( std::function< float(float)> const &  aFunction)
final

Note: not plugin-safe.

◆ set_sample_rate()

void neogfx::audio_oscillator::set_sample_rate ( audio_sample_rate  aSampleRate)
final

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