Acoustics Relacs Plugins
0.9.8
|
#include <loudspeaker.h>
Public Member Functions | |
LoudSpeaker (void) | |
virtual | ~LoudSpeaker (void) |
double | gain (double frequency) const |
double | offset (double frequency) const |
void | gain (double &gain, double &offset, double &frequency) const |
void | setGain (double gain, double offset, double frequency) |
void | reset (double frequency) |
void | setSamplingRate (double rate) |
void | load (void) |
void | saveCalibration (const string &file, const string &date) const |
virtual void | save (const string &path) const |
void | save (void) const |
void | clear (void) |
virtual void | setDeviceIdent (const string &ident) |
virtual void | config (void) |
Public Member Functions inherited from Attenuate | |
Attenuate (void) | |
Attenuate (const string &deviceclass, const string &intensityname="intensity", const string &intensityunit="dB", const string &intensityformat="%6.2f", const string &frequencyname="", const string &frequencyunit="Hz", const string &frequencyformat="%7.0f") | |
virtual | ~Attenuate (void) |
int | open (Device &att, int line) |
virtual int | open (Device &att) override |
virtual int | open (const string &device) override |
virtual bool | isOpen (void) const |
virtual void | close (void) |
void | clear (void) |
double | minIntensity (double frequency=0.0) const |
double | maxIntensity (double frequency=0.0) const |
void | intensities (vector< double > &ints, double frequency=0.0) const |
virtual void | init (void) |
int | write (double &intensity, double frequency, double &level) |
int | testWrite (double &intensity, double frequency, double &level) |
int | mute (void) |
int | testMute (void) |
int | attenuate (double &level) |
int | testAttenuate (double &level) |
string | intensityName (void) const |
void | setIntensityName (const string &name) |
string | intensityUnit (void) const |
void | setIntensityUnit (const string &unit) |
string | intensityFormat (void) const |
void | setIntensityFormat (const string &format) |
string | frequencyName (void) const |
void | setFrequencyName (const string &name) |
string | frequencyUnit (void) const |
void | setFrequencyUnit (const string &unit) |
string | frequencyFormat (void) const |
void | setFrequencyFormat (const string &format) |
int | aoChannel (void) const |
void | setAOChannel (int channel) |
string | aoDevice (void) const |
void | setAODevice (const string &deviceid) |
Attenuator * | attenuator (void) |
const Attenuator * | attenuator (void) const |
bool | noAttenuator (void) const |
virtual int | reset (void) |
Public Member Functions inherited from ConfigClass | |
ConfigClass (const string &ident, int group=0, int mode=0xffff, int selectmask=0) | |
ConfigClass (const ConfigClass &C) | |
virtual | ~ConfigClass (void) |
const string & | configIdent (void) const |
void | setConfigIdent (const string &ident) |
int | configGroup (void) const |
void | setConfigGroup (int group) |
int | configMode (void) const |
void | setConfigMode (int mode) |
void | addConfigMode (int mode) |
void | delConfigMode (int mode) |
int | configSelectMask (void) const |
void | setConfigSelectMask (int mask) |
void | addConfig (void) |
void | readConfig (void) |
virtual void | readConfig (StrQueue &sq) |
virtual void | saveConfig (ofstream &str) |
virtual int | configSize (void) const |
virtual void | preConfig (void) |
Protected Member Functions | |
virtual int | decibel (double intensity, double frequency, double &db) const |
virtual void | intensity (double &intens, double frequency, double decibel) const |
Protected Member Functions inherited from Attenuate | |
virtual void | initOptions () override |
Additional Inherited Members | |
Public Types inherited from ConfigClass | |
enum | Action |
Static Public Member Functions inherited from ConfigClass | |
static void | setConfigureClasses (ConfigureClasses *cfg) |
Static Public Attributes inherited from Attenuate | |
static const double | MuteAttenuationLevel |
static const double | MuteIntensity |
static const int | NotOpen |
static const int | InvalidDevice |
static const int | ReadError |
static const int | WriteError |
static const int | Underflow |
static const int | Overflow |
static const int | IntensityUnderflow |
static const int | IntensityOverflow |
static const int | IntensityError |
[Attenuate] Direct conversion to attenuation level depending on carrier frequency.
line:
the line on the attenuatoraodevice:
the identifier analog output deviceaochannel:
the channel of the analog output device LoudSpeaker | ( | void | ) |
Constructor.
References Attenuate::initOptions().
|
virtual |
Destructor.
double gain | ( | double | frequency | ) | const |
Returns the gain factor used for a signal with carrier frequency frequency.
Referenced by LoudSpeaker::decibel(), LoudSpeaker::gain(), LoudSpeaker::intensity(), CalibSpeakers::main(), LoudSpeaker::offset(), and LoudSpeaker::setGain().
double offset | ( | double | frequency | ) | const |
Returns the offset used for a signal with carrier frequency frequency.
References LoudSpeaker::gain().
Referenced by LoudSpeaker::gain(), and LoudSpeaker::setGain().
void gain | ( | double & | gain, |
double & | offset, | ||
double & | frequency | ||
) | const |
Returns the gain factor in gain and the offset in offset used for a signal with carrier frequency frequency. frequency is set to the closest value found in the calibration table. gain and offset are linearly interpolated.
References LoudSpeaker::gain(), and LoudSpeaker::offset().
void setGain | ( | double | gain, |
double | offset, | ||
double | frequency | ||
) |
Set the gain factor for a signal with carrier frequency frequency to gain and the offset to offset.
References LoudSpeaker::gain(), and LoudSpeaker::offset().
Referenced by CalibSpeakers::main(), and LoudSpeaker::reset().
void reset | ( | double | frequency | ) |
Reset the gain factor and the offset for a signal with carrier frequency frequency to the default values.
References LoudSpeaker::setGain().
Referenced by CalibSpeakers::main().
void setSamplingRate | ( | double | rate | ) |
Set the sampling rate that was used while determining the gain() and offset() to rate. It is just saved in the calibration file.
Referenced by CalibSpeakers::main().
void load | ( | void | ) |
void saveCalibration | ( | const string & | file, |
const string & | date | ||
) | const |
Save the calibration data to file, using date.
References TableKey::addNumber(), Attenuate::aoChannel(), Attenuate::aoDevice(), Attenuate::frequencyFormat(), Attenuate::frequencyName(), Attenuate::frequencyUnit(), TableKey::save(), and TableKey::saveKey().
Referenced by LoudSpeaker::save().
|
virtual |
Save the calibration data in directory path.
Reimplemented from Attenuate.
References LoudSpeaker::saveCalibration().
Referenced by CalibSpeakers::main().
void save | ( | void | ) | const |
Save the calibration data to the default file.
References Str::format(), and LoudSpeaker::saveCalibration().
void clear | ( | void | ) |
Clear the calibration table.
Referenced by CalibSpeakers::main().
|
virtual |
Set the device and the config identifier string to ident.
References ConfigClass::setConfigIdent().
|
virtual |
Load the configuration file.
Reimplemented from ConfigClass.
References Attenuate::aoChannel(), Attenuate::aoDevice(), and LoudSpeaker::load().
|
protectedvirtual |
Transform the requested sound intensity intensity for the carrier frequency frequency of the signal into db decibel which are used to set the attenuation level. If intensity is set to MuteIntensity, the attenuator is muted.
Implements Attenuate.
References LoudSpeaker::gain(), Attenuate::MuteAttenuationLevel, and Attenuate::MuteIntensity.
|
protectedvirtual |
Transform the attenuation level decibel for the carrier frequency frequency of the signal into the intensity intens. If decibel is set to MuteAttenuationLevel, then MuteIntensity is returned in intens. This is the inverse function of decibel().
Implements Attenuate.
References LoudSpeaker::gain(), Attenuate::MuteAttenuationLevel, and Attenuate::MuteIntensity.