Relacs Core Library  0.9.8
Public Member Functions | Static Public Attributes | List of all members
AttSim Class Reference

#include <attsim.h>

Inheritance diagram for AttSim:
Inheritance graph
[legend]
Collaboration diagram for AttSim:
Collaboration graph
[legend]

Public Member Functions

 AttSim (void)
 
 ~AttSim (void)
 
int open (const string &device) override
 
bool isOpen (void) const
 
void close (void)
 
virtual const Optionssettings (void) const
 
virtual int lines (void) const
 
virtual double minLevel (void) const
 
virtual double maxLevel (void) const
 
virtual void levels (vector< double > &l) const
 
int attenuate (int di, double &decibel)
 
int testAttenuate (int di, double &decibel)
 
- Public Member Functions inherited from Attenuator
 Attenuator (void)
 
 Attenuator (const string &deviceclass)
 
virtual ~Attenuator (void)
 
virtual int mute (int di)
 
virtual int testMute (int di)
 
virtual int open (Device &device)
 

Static Public Attributes

static const int MaxDevices = 2
 
static double Decibel [MaxDevices] = { 0, 0 }
 
- Static Public Attributes inherited from Attenuator
static const double MuteAttenuationLevel
 
static const int Underflow
 
static const int Overflow
 

Additional Inherited Members

- Protected Member Functions inherited from Attenuator
void setInfo (void)
 

Detailed Description

Implementation of the Attenuator class for simulating an attenuator.

Author
Jan Benda
Version
1.1 The attenuation levels are stored in the global variable AttSimDecibel.

Constructor & Destructor Documentation

AttSim ( void  )

Constructs an AttSim.

~AttSim ( void  )

Close the attenuator simulation.

Member Function Documentation

int open ( const string &  device)
overridevirtual

Open the attenuator device driver specified by device.

Reimplemented from Attenuator.

References Attenuator::setInfo().

bool isOpen ( void  ) const
virtual

Returns true if the attenuator device driver was succesfully opened.

Implements Attenuator.

void close ( void  )
virtual

Close the attenuator device driver.

Implements Attenuator.

const Options & settings ( void  ) const
virtual
int lines ( void  ) const
virtual

Returns the number of attenuator devices the driver handles.

Implements Attenuator.

References AttSim::MaxDevices.

double minLevel ( void  ) const
virtual

Returns the minimum possible attenuation level in decibel. This number can be negative, indicating amplification.

Implements Attenuator.

double maxLevel ( void  ) const
virtual

Returns the maximum possible attenuation level in decibel.

Implements Attenuator.

void levels ( vector< double > &  l) const
virtual

Returns in l all possible attenuation levels sorted by increasing attenuation levels (highest last).

Implements Attenuator.

References relacs::ceil().

int attenuate ( int  di,
double &  decibel 
)
virtual

Set the attenuation level of the subdevice specified by its index di to decibel decibel. Returns the actually set level in decibel.

Implements Attenuator.

References AttSim::Decibel, relacs::floor(), AttSim::MaxDevices, Attenuator::MuteAttenuationLevel, Attenuator::Overflow, and Attenuator::Underflow.

int testAttenuate ( int  di,
double &  decibel 
)
virtual

Tests setting the attenuation level of the subdevice specified by its index di to decibel decibel. Returns the actually set level in decibel.

Implements Attenuator.

References relacs::floor(), AttSim::MaxDevices, Attenuator::MuteAttenuationLevel, Attenuator::Overflow, and Attenuator::Underflow.

Member Data Documentation

const int MaxDevices = 2
static
double Decibel = { 0, 0 }
static

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