Klang C++
Language Reference (draft)
Loading...
Searching...
No Matches
klang::Stereo::frame

Stereo sample frame. More...

#include <klang.h>

Public Member Functions

 frame (mono::signal &left, mono::signal &right)
 
 frame (signal &signal)
 
frameoperator+= (const frame &x)
 
frameoperator-= (const frame &x)
 
frameoperator*= (const frame &x)
 
frameoperator/= (const frame &x)
 
frameoperator+= (const signal x)
 
frameoperator-= (const signal x)
 
frameoperator*= (const signal x)
 
frameoperator/= (const signal x)
 
frameoperator+= (const mono::signal x)
 
frameoperator-= (const mono::signal x)
 
frameoperator*= (const mono::signal x)
 
frameoperator/= (const mono::signal x)
 
frameoperator+= (float x)
 
frameoperator-= (float x)
 
frameoperator*= (float x)
 
frameoperator/= (float x)
 
frameoperator+= (double x)
 
frameoperator-= (double x)
 
frameoperator*= (double x)
 
frameoperator/= (double x)
 
frameoperator+= (int x)
 
frameoperator-= (int x)
 
frameoperator*= (int x)
 
frameoperator/= (int x)
 
signal operator+ (const signal x) const
 
signal operator- (const signal x) const
 
signal operator* (const signal x) const
 
signal operator/ (const signal x) const
 
signal operator+ (const mono::signal x) const
 
signal operator- (const mono::signal x) const
 
signal operator* (const mono::signal x) const
 
signal operator/ (const mono::signal x) const
 
signal operator+ (float x) const
 
signal operator- (float x) const
 
signal operator* (float x) const
 
signal operator/ (float x) const
 
signal operator+ (double x) const
 
signal operator- (double x) const
 
signal operator* (double x) const
 
signal operator/ (double x) const
 
signal operator+ (int x) const
 
signal operator- (int x) const
 
signal operator* (int x) const
 
signal operator/ (int x) const
 
frameoperator= (const signal &signal)
 
mono::signal mono () const
 

Public Attributes

mono::signall
 
mono::signalr
 

Detailed Description

Definition at line 3311 of file klang.h.

Constructor & Destructor Documentation

◆ frame() [1/2]

klang::Stereo::frame::frame ( mono::signal & left,
mono::signal & right )
inline

Definition at line 3315 of file klang.h.

3315: l(left), r(right) { }
mono::signal & l
Definition klang.h:3312
mono::signal & r
Definition klang.h:3313

References l, and r.

Referenced by klang::Stereo::buffer::operator frame(), klang::Stereo::buffer::operator++(), klang::Stereo::buffer::operator=(), and klang::Stereo::buffer::operator[]().

◆ frame() [2/2]

klang::Stereo::frame::frame ( signal & signal)
inline

Definition at line 3316 of file klang.h.

3316: l(signal.l), r(signal.r) { }
signals< 2 > signal
Stereo audio signal.
Definition klang.h:3308

References l, and r.

Member Function Documentation

◆ mono()

mono::signal klang::Stereo::frame::mono ( ) const
inline

Definition at line 3379 of file klang.h.

3379 {
3380 return (l + r) * 0.5f;
3381 }

References l, klang::signal::operator*(), klang::signal::operator+(), and r.

◆ operator*() [1/5]

signal klang::Stereo::frame::operator* ( const mono::signal x) const
inline

Definition at line 3355 of file klang.h.

3355{ return { l * x, r * x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator*(), and r.

◆ operator*() [2/5]

signal klang::Stereo::frame::operator* ( const signal x) const
inline

Definition at line 3350 of file klang.h.

3350{ return { l * x.l, r * x.r }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator*(), and r.

◆ operator*() [3/5]

signal klang::Stereo::frame::operator* ( double x) const
inline

Definition at line 3365 of file klang.h.

3365{ return { l * (float)x, r * (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator*(), and r.

◆ operator*() [4/5]

signal klang::Stereo::frame::operator* ( float x) const
inline

Definition at line 3360 of file klang.h.

3360{ return { l * x, r * x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator*(), and r.

◆ operator*() [5/5]

signal klang::Stereo::frame::operator* ( int x) const
inline

Definition at line 3370 of file klang.h.

3370{ return { l * (float)x, r * (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator*(), and r.

◆ operator*=() [1/6]

frame & klang::Stereo::frame::operator*= ( const frame & x)
inline

Definition at line 3320 of file klang.h.

3320{ l *= x.l; r *= x.r; return *this; }

References l, klang::signal::operator*=(), and r.

◆ operator*=() [2/6]

frame & klang::Stereo::frame::operator*= ( const mono::signal x)
inline

Definition at line 3330 of file klang.h.

3330{ l *= x; r *= x; return *this; }

References l, klang::signal::operator*=(), and r.

◆ operator*=() [3/6]

frame & klang::Stereo::frame::operator*= ( const signal x)
inline

Definition at line 3325 of file klang.h.

3325{ l *= x.l; r *= x.r; return *this; }

References l, klang::signal::operator*=(), and r.

◆ operator*=() [4/6]

frame & klang::Stereo::frame::operator*= ( double x)
inline

Definition at line 3340 of file klang.h.

3340{ l *= (float)x; r *= (float)x; return *this; }

References l, klang::signal::operator*=(), and r.

◆ operator*=() [5/6]

frame & klang::Stereo::frame::operator*= ( float x)
inline

Definition at line 3335 of file klang.h.

3335{ l *= x; r *= x; return *this; }

References l, klang::signal::operator*=(), and r.

◆ operator*=() [6/6]

frame & klang::Stereo::frame::operator*= ( int x)
inline

Definition at line 3345 of file klang.h.

3345{ l *= (float)x; r *= (float)x; return *this; }

References l, klang::signal::operator*=(), and r.

◆ operator+() [1/5]

signal klang::Stereo::frame::operator+ ( const mono::signal x) const
inline

Definition at line 3353 of file klang.h.

3353{ return { l + x, r + x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator+(), and r.

◆ operator+() [2/5]

signal klang::Stereo::frame::operator+ ( const signal x) const
inline

Definition at line 3348 of file klang.h.

3348{ return { l + x.l, r + x.r }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator+(), and r.

◆ operator+() [3/5]

signal klang::Stereo::frame::operator+ ( double x) const
inline

Definition at line 3363 of file klang.h.

3363{ return { l + (float)x, r + (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator+(), and r.

◆ operator+() [4/5]

signal klang::Stereo::frame::operator+ ( float x) const
inline

Definition at line 3358 of file klang.h.

3358{ return { l + x, r + x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator+(), and r.

◆ operator+() [5/5]

signal klang::Stereo::frame::operator+ ( int x) const
inline

Definition at line 3368 of file klang.h.

3368{ return { l + (float)x, r + (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator+(), and r.

◆ operator+=() [1/6]

frame & klang::Stereo::frame::operator+= ( const frame & x)
inline

Definition at line 3318 of file klang.h.

3318{ l += x.l; r += x.r; return *this; }

References l, klang::signal::operator+=(), and r.

◆ operator+=() [2/6]

frame & klang::Stereo::frame::operator+= ( const mono::signal x)
inline

Definition at line 3328 of file klang.h.

3328{ l += x; r += x; return *this; }

References l, klang::signal::operator+=(), and r.

◆ operator+=() [3/6]

frame & klang::Stereo::frame::operator+= ( const signal x)
inline

Definition at line 3323 of file klang.h.

3323{ l += x.l; r += x.r; return *this; }

References l, klang::signal::operator+=(), and r.

◆ operator+=() [4/6]

frame & klang::Stereo::frame::operator+= ( double x)
inline

Definition at line 3338 of file klang.h.

3338{ l += (float)x; r += (float)x; return *this; }

References l, klang::signal::operator+=(), and r.

◆ operator+=() [5/6]

frame & klang::Stereo::frame::operator+= ( float x)
inline

Definition at line 3333 of file klang.h.

3333{ l += x; r += x; return *this; }

References l, klang::signal::operator+=(), and r.

◆ operator+=() [6/6]

frame & klang::Stereo::frame::operator+= ( int x)
inline

Definition at line 3343 of file klang.h.

3343{ l += (float)x; r += (float)x; return *this; }

References l, klang::signal::operator+=(), and r.

◆ operator-() [1/5]

signal klang::Stereo::frame::operator- ( const mono::signal x) const
inline

Definition at line 3354 of file klang.h.

3354{ return { l - x, r - x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator-(), and r.

◆ operator-() [2/5]

signal klang::Stereo::frame::operator- ( const signal x) const
inline

Definition at line 3349 of file klang.h.

3349{ return { l - x.l, r - x.r }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator-(), and r.

◆ operator-() [3/5]

signal klang::Stereo::frame::operator- ( double x) const
inline

Definition at line 3364 of file klang.h.

3364{ return { l - (float)x, r - (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator-(), and r.

◆ operator-() [4/5]

signal klang::Stereo::frame::operator- ( float x) const
inline

Definition at line 3359 of file klang.h.

3359{ return { l - x, r - x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator-(), and r.

◆ operator-() [5/5]

signal klang::Stereo::frame::operator- ( int x) const
inline

Definition at line 3369 of file klang.h.

3369{ return { l - (float)x, r - (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator-(), and r.

◆ operator-=() [1/6]

frame & klang::Stereo::frame::operator-= ( const frame & x)
inline

Definition at line 3319 of file klang.h.

3319{ l -= x.l; r -= x.r; return *this; }

References l, klang::signal::operator-=(), and r.

◆ operator-=() [2/6]

frame & klang::Stereo::frame::operator-= ( const mono::signal x)
inline

Definition at line 3329 of file klang.h.

3329{ l -= x; r -= x; return *this; }

References l, klang::signal::operator-=(), and r.

◆ operator-=() [3/6]

frame & klang::Stereo::frame::operator-= ( const signal x)
inline

Definition at line 3324 of file klang.h.

3324{ l -= x.l; r -= x.r; return *this; }

References l, klang::signal::operator-=(), and r.

◆ operator-=() [4/6]

frame & klang::Stereo::frame::operator-= ( double x)
inline

Definition at line 3339 of file klang.h.

3339{ l -= (float)x; r -= (float)x; return *this; }

References l, klang::signal::operator-=(), and r.

◆ operator-=() [5/6]

frame & klang::Stereo::frame::operator-= ( float x)
inline

Definition at line 3334 of file klang.h.

3334{ l -= x; r -= x; return *this; }

References l, klang::signal::operator-=(), and r.

◆ operator-=() [6/6]

frame & klang::Stereo::frame::operator-= ( int x)
inline

Definition at line 3344 of file klang.h.

3344{ l -= (float)x; r -= (float)x; return *this; }

References l, klang::signal::operator-=(), and r.

◆ operator/() [1/5]

signal klang::Stereo::frame::operator/ ( const mono::signal x) const
inline

Definition at line 3356 of file klang.h.

3356{ return { l / x, r / x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator/(), and r.

◆ operator/() [2/5]

signal klang::Stereo::frame::operator/ ( const signal x) const
inline

Definition at line 3351 of file klang.h.

3351{ return { l / x.l, r / x.r }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator/(), and r.

◆ operator/() [3/5]

signal klang::Stereo::frame::operator/ ( double x) const
inline

Definition at line 3366 of file klang.h.

3366{ return { l / (float)x, r / (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator/(), and r.

◆ operator/() [4/5]

signal klang::Stereo::frame::operator/ ( float x) const
inline

Definition at line 3361 of file klang.h.

3361{ return { l / x, r / x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator/(), and r.

◆ operator/() [5/5]

signal klang::Stereo::frame::operator/ ( int x) const
inline

Definition at line 3371 of file klang.h.

3371{ return { l / (float)x, r / (float)x }; }

References klang::signals< CHANNELS >::signals(), l, klang::signal::operator/(), and r.

◆ operator/=() [1/6]

frame & klang::Stereo::frame::operator/= ( const frame & x)
inline

Definition at line 3321 of file klang.h.

3321{ l /= x.l; r /= x.r; return *this; }

References l, klang::signal::operator/=(), and r.

◆ operator/=() [2/6]

frame & klang::Stereo::frame::operator/= ( const mono::signal x)
inline

Definition at line 3331 of file klang.h.

3331{ l /= x; r /= x; return *this; }

References l, klang::signal::operator/=(), and r.

◆ operator/=() [3/6]

frame & klang::Stereo::frame::operator/= ( const signal x)
inline

Definition at line 3326 of file klang.h.

3326{ l /= x.l; r /= x.r; return *this; }

References l, klang::signal::operator/=(), and r.

◆ operator/=() [4/6]

frame & klang::Stereo::frame::operator/= ( double x)
inline

Definition at line 3341 of file klang.h.

3341{ l /= (float)x; r /= (float)x; return *this; }

References l, klang::signal::operator/=(), and r.

◆ operator/=() [5/6]

frame & klang::Stereo::frame::operator/= ( float x)
inline

Definition at line 3336 of file klang.h.

3336{ l /= x; r /= x; return *this; }

References l, klang::signal::operator/=(), and r.

◆ operator/=() [6/6]

frame & klang::Stereo::frame::operator/= ( int x)
inline

Definition at line 3346 of file klang.h.

3346{ l /= (float)x; r /= (float)x; return *this; }

References l, klang::signal::operator/=(), and r.

◆ operator=()

frame & klang::Stereo::frame::operator= ( const signal & signal)
inline

Definition at line 3373 of file klang.h.

3373 {
3374 l = signal.l;
3375 r = signal.r;
3376 return *this;
3377 }

References l, and r.

Referenced by klang::Stereo::Effect::process(), and klang::Stereo::Note::process().

Member Data Documentation

◆ l

◆ r