Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Ase::AudioEngine Class Reference

#include "engine.hh"

Inheritance diagram for Ase::AudioEngine:
[legend]

Classes

class  JobQueue
 

Public Member Functions

void start_threads ()
 
void stop_threads ()
 
void wakeup_thread_mt ()
 
bool ipc_pending ()
 
void ipc_dispatch ()
 
AudioProcessorP get_event_source ()
 
void set_project (ProjectImplP project)
 
ProjectImplP get_project ()
 
uint64_t frame_counter () const
 
uint64_t block_size () const
 
const AudioTransporttransport () const
 
uint sample_rate () const
 
uint nyquist () const
 
double inyquist () const
 
SpeakerArrangement speaker_arrangement () const
 
void set_autostop (uint64_t nsamples)
 
void queue_capture_start (CallbackS &, const String &filename, bool needsrunning)
 
void queue_capture_stop (CallbackS &)
 
bool update_drivers (const String &pcm, uint latency_ms, const StringS &midis)
 
String engine_stats (uint64_t stats) const
 

Static Public Member Functions

static bool thread_is_engine ()
 

Public Attributes

JobQueue async_jobs
 Executed asynchronously, may modify AudioProcessor objects.
 
JobQueue const_jobs
 Blocks during execution, must treat AudioProcessor objects read-only.
 

Static Public Attributes

static const ThreadIdthread_id
 

Protected Member Functions

 AudioEngine (AudioEngineThread &, AudioTransport &)
 
void enable_output (AudioProcessor &aproc, bool onoff)
 
void schedule_queue_update ()
 
void schedule_add (AudioProcessor &aproc, uint level)
 

Protected Attributes

std::atomic< size_tprocessor_count_
 
std::atomic< uint64_trender_stamp_
 
AudioTransporttransport_
 
JobQueue synchronized_jobs
 

Friends

class AudioProcessor
 

Detailed Description

Main handle for AudioProcessor administration and audio rendering. Use make_audio_engine() to create a new engine and start_threads() to run its synthesis threads. AudioEngine objects cannot be deleted, because other ref-counted objects may hold AudioEngine& members until after main(). Use async_jobs to have the engine execute arbitrary code. Use const_jobs for synchronous read-only data gathering, this may take quite long. Use main_rt_jobs (see main.hh) for obstruction free enqueueing of main_loop callbacks.

Definition at line 21 of file engine.hh.

Constructor & Destructor Documentation

◆ AudioEngine()

Ase::AudioEngine::AudioEngine ( AudioEngineThread audio_engine_thread,
AudioTransport transport 
)
explicitprotected

Definition at line 568 of file engine.cc.

◆ ~AudioEngine()

Ase::AudioEngine::~AudioEngine ( )
protectedvirtual

Definition at line 572 of file engine.cc.

Member Function Documentation

◆ block_size()

uint64 Ase::AudioEngine::block_size ( ) const

Definition at line 588 of file engine.cc.

◆ enable_output()

void Ase::AudioEngine::enable_output ( AudioProcessor aproc,
bool  onoff 
)
protected

Definition at line 616 of file engine.cc.

◆ engine_stats()

String Ase::AudioEngine::engine_stats ( uint64_t  stats) const

Definition at line 579 of file engine.cc.

◆ frame_counter()

uint64_t Ase::AudioEngine::frame_counter ( ) const

Definition at line 43 of file engine.hh.

◆ get_event_source()

AudioProcessorP Ase::AudioEngine::get_event_source ( )

Definition at line 677 of file engine.cc.

◆ get_project()

ProjectImplP Ase::AudioEngine::get_project ( )

Definition at line 691 of file engine.cc.

◆ inyquist()

double Ase::AudioEngine::inyquist ( ) const

Definition at line 48 of file engine.hh.

◆ ipc_dispatch()

void Ase::AudioEngine::ipc_dispatch ( )

Definition at line 670 of file engine.cc.

◆ ipc_pending()

bool Ase::AudioEngine::ipc_pending ( )

Definition at line 663 of file engine.cc.

◆ nyquist()

uint Ase::AudioEngine::nyquist ( ) const

Definition at line 47 of file engine.hh.

◆ queue_capture_start()

void Ase::AudioEngine::queue_capture_start ( CallbackS callbacks,
const String filename,
bool  needsrunning 
)

Definition at line 637 of file engine.cc.

◆ queue_capture_stop()

void Ase::AudioEngine::queue_capture_stop ( CallbackS callbacks)

Definition at line 647 of file engine.cc.

◆ sample_rate()

uint Ase::AudioEngine::sample_rate ( ) const

Definition at line 46 of file engine.hh.

◆ schedule_add()

void Ase::AudioEngine::schedule_add ( AudioProcessor aproc,
uint  level 
)
protected

Definition at line 609 of file engine.cc.

◆ schedule_queue_update()

void Ase::AudioEngine::schedule_queue_update ( )
protected

Definition at line 602 of file engine.cc.

◆ set_autostop()

void Ase::AudioEngine::set_autostop ( uint64_t  nsamples)

Definition at line 595 of file engine.cc.

◆ set_project()

void Ase::AudioEngine::set_project ( ProjectImplP  project)

Definition at line 684 of file engine.cc.

◆ speaker_arrangement()

SpeakerArrangement Ase::AudioEngine::speaker_arrangement ( ) const

Definition at line 49 of file engine.hh.

◆ start_threads()

void Ase::AudioEngine::start_threads ( )

Definition at line 623 of file engine.cc.

◆ stop_threads()

void Ase::AudioEngine::stop_threads ( )

Definition at line 630 of file engine.cc.

◆ thread_is_engine()

static bool Ase::AudioEngine::thread_is_engine ( )
static

Definition at line 55 of file engine.hh.

◆ transport()

const AudioTransport & Ase::AudioEngine::transport ( ) const

Definition at line 45 of file engine.hh.

◆ update_drivers()

bool Ase::AudioEngine::update_drivers ( const String pcm,
uint  latency_ms,
const StringS midis 
)

Definition at line 712 of file engine.cc.

◆ wakeup_thread_mt()

void Ase::AudioEngine::wakeup_thread_mt ( )

Definition at line 656 of file engine.cc.

Friends And Related Symbol Documentation

◆ AudioProcessor

friend class AudioProcessor
friend

Definition at line 23 of file engine.hh.

Member Data Documentation

◆ async_jobs

JobQueue Ase::AudioEngine::async_jobs

Executed asynchronously, may modify AudioProcessor objects.

Definition at line 65 of file engine.hh.

Referenced by Ase::DeviceImpl::_disconnect_remove(), and Ase::NativeDeviceImpl::_disconnect_remove().

◆ const_jobs

JobQueue Ase::AudioEngine::const_jobs

Blocks during execution, must treat AudioProcessor objects read-only.

Definition at line 66 of file engine.hh.

◆ processor_count_

std::atomic<size_t> Ase::AudioEngine::processor_count_
protected

Definition at line 24 of file engine.hh.

◆ render_stamp_

std::atomic<uint64_t> Ase::AudioEngine::render_stamp_
protected

Definition at line 25 of file engine.hh.

◆ synchronized_jobs

JobQueue Ase::AudioEngine::synchronized_jobs
protected

Definition at line 68 of file engine.hh.

◆ thread_id

const ThreadId & Ase::AudioEngine::thread_id
static

Definition at line 56 of file engine.hh.

◆ transport_

AudioTransport& Ase::AudioEngine::transport_
protected

Definition at line 26 of file engine.hh.


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