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

#include <audio_waveform.hpp>

Inheritance diagram for neogfx::audio_waveform:
neogfx::audio_bitstream< i_audio_waveform > neolib::reference_counted< Base, DeallocateOnRelease >

Public Member Functions

 audio_waveform (audio_sample_rate aSampleRate, float aAmplitude=1.0f)
 
 audio_waveform (i_audio_device const &aDevice, float aAmplitude=1.0f)
 
 ~audio_waveform ()
 
void set_sample_rate (audio_sample_rate aSampleRate) override
 
i_audio_oscillatorcreate_oscillator (float aFrequency, float aAmplitude=1.0f, oscillator_function aFunction=oscillator_function::Sine) final
 
i_audio_oscillatorcreate_oscillator (float aFrequency, float aAmplitude, std::function< float(float)> const &aFunction) final
 Note: not plugin-safe.
 
i_audio_oscillatoradd_oscillator (i_audio_oscillator &aOscillator) final
 
i_audio_oscillatoradd_oscillator (i_ref_ptr< i_audio_oscillator > const &aOscillator) final
 
void remove_oscillator (i_audio_oscillator const &aOscillator) final
 
audio_frame_count length () const final
 
void generate (audio_channel aChannel, audio_frame_count aFrameCount, float *aOutputFrames) final
 
void generate_from (audio_channel aChannel, audio_frame_index aFrameFrom, audio_frame_count aFrameCount, float *aOutputFrames) final
 
- Public Member Functions inherited from neogfx::audio_bitstream< i_audio_waveform >
 audio_bitstream (audio_sample_rate aSampleRate, float aAmplitude=1.0f)
 
 audio_bitstream (i_audio_device const &aDevice, float aAmplitude=1.0f)
 
 ~audio_bitstream ()
 
audio_sample_rate sample_rate () const final
 
void set_sample_rate (audio_sample_rate aSampleRate) override
 
float amplitude () const final
 
void set_amplitude (float aAmplitude) final
 
bool has_envelope () const final
 
adsr_envelope const & envelope () const final
 
void clear_envelope () final
 
void set_envelope (adsr_envelope const &aEnvelope) 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
 

Additional Inherited Members

- Protected Member Functions inherited from neogfx::audio_bitstream< i_audio_waveform >
float apply_envelope (audio_sample_index aIndex, audio_sample_count aLength) const
 

Detailed Description

Definition at line 29 of file audio_waveform.hpp.

Constructor & Destructor Documentation

◆ audio_waveform() [1/2]

neogfx::audio_waveform::audio_waveform ( audio_sample_rate  aSampleRate,
float  aAmplitude = 1.0f 
)

◆ audio_waveform() [2/2]

neogfx::audio_waveform::audio_waveform ( i_audio_device const &  aDevice,
float  aAmplitude = 1.0f 
)

◆ ~audio_waveform()

neogfx::audio_waveform::~audio_waveform ( )

Member Function Documentation

◆ add_oscillator() [1/2]

i_audio_oscillator & neogfx::audio_waveform::add_oscillator ( i_audio_oscillator aOscillator)
final

◆ add_oscillator() [2/2]

i_audio_oscillator & neogfx::audio_waveform::add_oscillator ( i_ref_ptr< i_audio_oscillator > const &  aOscillator)
final

◆ create_oscillator() [1/2]

i_audio_oscillator & neogfx::audio_waveform::create_oscillator ( float  aFrequency,
float  aAmplitude,
std::function< float(float)> const &  aFunction 
)
final

Note: not plugin-safe.

◆ create_oscillator() [2/2]

i_audio_oscillator & neogfx::audio_waveform::create_oscillator ( float  aFrequency,
float  aAmplitude = 1.0f,
oscillator_function  aFunction = oscillator_function::Sine 
)
final

◆ generate()

void neogfx::audio_waveform::generate ( audio_channel  aChannel,
audio_frame_count  aFrameCount,
float *  aOutputFrames 
)
final

◆ generate_from()

void neogfx::audio_waveform::generate_from ( audio_channel  aChannel,
audio_frame_index  aFrameFrom,
audio_frame_count  aFrameCount,
float *  aOutputFrames 
)
final

◆ length()

audio_frame_count neogfx::audio_waveform::length ( ) const
final

◆ remove_oscillator()

void neogfx::audio_waveform::remove_oscillator ( i_audio_oscillator const &  aOscillator)
final

◆ set_sample_rate()

void neogfx::audio_waveform::set_sample_rate ( audio_sample_rate  aSampleRate)
override

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