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

#include <audio_instrument.hpp>

Inheritance diagram for neogfx::audio_instrument:
neogfx::audio_bitstream< i_audio_instrument > neolib::reference_counted< Base, DeallocateOnRelease >

Public Member Functions

 audio_instrument (audio_sample_rate aSampleRate, neogfx::instrument aInstrument, float aAmplitude=1.0f)
 
 audio_instrument (i_audio_device const &aDevice, neogfx::instrument aInstrument, float aAmplitude=1.0f)
 
time_point play_note (note aNote, std::chrono::duration< double > const &aDuration, float aAmplitude=1.0f) final
 
time_point play_note (std::chrono::duration< double > const &aWhen, note aNote, std::chrono::duration< double > const &aDuration, float aAmplitude=1.0f) final
 
time_point play_note (time_point aWhen, note aNote, std::chrono::duration< double > const &aDuration, float aAmplitude=1.0f) final
 
time_point rest (std::chrono::duration< double > const &aDuration) 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_instrument >
 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_instrument >
float apply_envelope (audio_sample_index aIndex, audio_sample_count aLength) const
 

Detailed Description

Definition at line 29 of file audio_instrument.hpp.

Constructor & Destructor Documentation

◆ audio_instrument() [1/2]

neogfx::audio_instrument::audio_instrument ( audio_sample_rate  aSampleRate,
neogfx::instrument  aInstrument,
float  aAmplitude = 1.0f 
)

◆ audio_instrument() [2/2]

neogfx::audio_instrument::audio_instrument ( i_audio_device const &  aDevice,
neogfx::instrument  aInstrument,
float  aAmplitude = 1.0f 
)

Member Function Documentation

◆ generate()

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

◆ generate_from()

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

◆ length()

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

◆ play_note() [1/3]

time_point neogfx::audio_instrument::play_note ( note  aNote,
std::chrono::duration< double > const &  aDuration,
float  aAmplitude = 1.0f 
)
final

◆ play_note() [2/3]

time_point neogfx::audio_instrument::play_note ( std::chrono::duration< double > const &  aWhen,
note  aNote,
std::chrono::duration< double > const &  aDuration,
float  aAmplitude = 1.0f 
)
final

◆ play_note() [3/3]

time_point neogfx::audio_instrument::play_note ( time_point  aWhen,
note  aNote,
std::chrono::duration< double > const &  aDuration,
float  aAmplitude = 1.0f 
)
final

◆ rest()

time_point neogfx::audio_instrument::rest ( std::chrono::duration< double > const &  aDuration)
final

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