Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
klang::Outputabstract

Language Guide / Signal Flow

Output

klang::Output

Base class for objects that produce mono samples.

Implement process() to write to out. Routing an output object with >> or reading it as a mutable signal runs that method. Read out directly to retrieve the last output without advancing the processor.

Example · Route the next sample

This runs the source’s process() once and sends the result to out.

source >> out;

Example · Read the last sample

Read the stored output when you want to inspect or reuse the sample that has already been generated.

const signal last = source.out;

Audio output object (mono) More...

#include <klang.h>

+ Inheritance diagram for klang::Output:

Public Member Functions

virtual const signal & output () const
 
TYPE & operator>> (TYPE &destination)
 
virtual operator const signal & ()
 
virtual operator const signal & () const
 
signal operator+ (TYPE &other)
 
signal operator* (TYPE &other)
 
signal operator- (TYPE &other)
 
signal operator/ (TYPE &other)
 
void reset ()
 

Public Attributes

signal out
 

Detailed Description

Definition at line 3678 of file klang.h.

Member Function Documentation

◆ operator const signal &() [1/2]

virtual klang::Generic::Output< signal >::operator const signal & ( )
inlinevirtualinherited

Reimplemented in klang::Generic::Generator< signal >, and klang::Generic::Modifier< signal >.

Definition at line 2972 of file klang.h.

2972{ this->process(); return out; } // return processed output

◆ operator const signal &() [2/2]

virtual klang::Generic::Output< signal >::operator const signal & ( ) const
inlinevirtualinherited

Reimplemented in klang::Generic::Generator< signal >, and klang::Generic::Modifier< signal >.

Definition at line 2973 of file klang.h.

2973{ return out; } // return last output

◆ operator*()

signal klang::Generic::Output< signal >::operator* ( TYPE & other)
inlineinherited

Definition at line 2977 of file klang.h.

2977{ this->process(); return out * SIGNAL(other); }

◆ operator+()

signal klang::Generic::Output< signal >::operator+ ( TYPE & other)
inlineinherited

Definition at line 2976 of file klang.h.

2976{ this->process(); return out + SIGNAL(other); }

◆ operator-()

signal klang::Generic::Output< signal >::operator- ( TYPE & other)
inlineinherited

Definition at line 2978 of file klang.h.

2978{ this->process(); return out - SIGNAL(other); }

◆ operator/()

signal klang::Generic::Output< signal >::operator/ ( TYPE & other)
inlineinherited

Definition at line 2979 of file klang.h.

2979{ this->process(); return out / SIGNAL(other); }

◆ operator>>()

TYPE & klang::Generic::Output< signal >::operator>> ( TYPE & destination)
inlineinherited

Definition at line 2969 of file klang.h.

2969{ this->process(); return destination = out; }

◆ output()

virtual const signal & klang::Generic::Output< signal >::output ( ) const
inlinevirtualinherited

Definition at line 2964 of file klang.h.

2964{ return out; }

◆ process()

◆ reset()

void klang::Generic::Output< signal >::reset ( )
inlineinherited

Definition at line 2981 of file klang.h.

2981{ out = 0; }

Member Data Documentation

◆ out

Definition at line 2961 of file klang.h.

2961{ 0.f };