CLAM::InControl< ControlDataType > Class Template Reference

An InControl receives values of the template type in an asyncronous pace. More...

#include <InControl.hxx>

List of all members.

Classes

class  Callback
class  MethodCallback
 Processing method callback wrapper. Calls a processing method that receives the value as const reference.
class  MethodCallbackByCopy
 Processing method callback wrapper by copy. Calls a processing method that receives the control value by copy. To use with basic (cheap copy) objects (ints, bools, floats...).
class  MethodCallbackByCopyWithId
 Processing method callback wrapper by copy with control id. Calls a processing method that receives the control value by copy. To use with basic (cheap copy) objects (ints, bools, floats...) The id enables reusing the same callback for different controls, but still knowing the originating control.
class  MethodCallbackWithId
 Processing method callback wrapper with control id. Calls a processing method that receives the value as const reference. The id enables reusing the same callback for different controls, but still knowing the originating control.
class  NullCallback
 Null control callback wrapper. Just do nothing.

Public Member Functions

 InControl (const std::string &name="unnamed in control", Processing *proc=0)
 Constructor to use when no callback is used.
template<typename ProcessingType , typename ParameterType >
 InControl (const std::string &name, ProcessingType *proc, void(ProcessingType::*callback)(const ParameterType &))
 Constructor to use a callback by const reference.
template<typename ProcessingType , typename ParameterType >
 InControl (unsigned id, const std::string &name, ProcessingType *proc, void(ProcessingType::*callback)(unsigned, const ParameterType &))
 Constructor to use a callback by const reference plus a port id to distinguish different caller controls in a single serving callback.
template<typename ProcessingType , typename ParameterType >
 InControl (const std::string &name, ProcessingType *proc, void(ProcessingType::*callback)(ParameterType))
 Constructor to use a callback by copy.
template<typename ProcessingType , typename ParameterType >
 InControl (unsigned id, const std::string &name, ProcessingType *proc, void(ProcessingType::*callback)(unsigned, ParameterType))
 Constructor to use a callback by copy plus a port id to distinguish different caller controls in a single serving callback.
virtual ~InControl ()
virtual void DoControl (const ControlDataType &val)
 The control receives a value when this method gets called. Associated callback if any, gets triggered on result. Connected OutControl may trigger it but it also may be called directly, for example to set the initial value.
virtual const ControlDataType & GetLastValue () const
 Returns the last received value.
const std::string GetLastValueAsString ()
 Convenience method to get the string representation of the last value. This just works if the token is storable as XML leaf, if not a "Not printable" string is given.
virtual const std::type_info & GetTypeId () const
 Concrete InControls must overload this method by returning the typeid of the kind of data they communicate.
template<>
const std::string GetLastValueAsString ()

Protected Attributes

ControlDataType mLastValue

Detailed Description

template<class ControlDataType>
class CLAM::InControl< ControlDataType >

An InControl receives values of the template type in an asyncronous pace.

A processing method can be set as callback to respond to incoming events. You can also consult GetLastValue to get the last received value.

Definition at line 46 of file InControl.hxx.


Constructor & Destructor Documentation

template<class ControlDataType>
CLAM::InControl< ControlDataType >::InControl ( const std::string &  name = "unnamed in control",
Processing proc = 0 
) [inline]

Constructor to use when no callback is used.

Definition at line 56 of file InControl.hxx.

template<class ControlDataType>
template<typename ProcessingType , typename ParameterType >
CLAM::InControl< ControlDataType >::InControl ( const std::string &  name,
ProcessingType *  proc,
void(ProcessingType::*)(const ParameterType &)  callback 
) [inline]

Constructor to use a callback by const reference.

Definition at line 63 of file InControl.hxx.

template<class ControlDataType>
template<typename ProcessingType , typename ParameterType >
CLAM::InControl< ControlDataType >::InControl ( unsigned  id,
const std::string &  name,
ProcessingType *  proc,
void(ProcessingType::*)(unsigned, const ParameterType &)  callback 
) [inline]

Constructor to use a callback by const reference plus a port id to distinguish different caller controls in a single serving callback.

Definition at line 70 of file InControl.hxx.

template<class ControlDataType>
template<typename ProcessingType , typename ParameterType >
CLAM::InControl< ControlDataType >::InControl ( const std::string &  name,
ProcessingType *  proc,
void(ProcessingType::*)(ParameterType)  callback 
) [inline]

Constructor to use a callback by copy.

Definition at line 77 of file InControl.hxx.

template<class ControlDataType>
template<typename ProcessingType , typename ParameterType >
CLAM::InControl< ControlDataType >::InControl ( unsigned  id,
const std::string &  name,
ProcessingType *  proc,
void(ProcessingType::*)(unsigned, ParameterType)  callback 
) [inline]

Constructor to use a callback by copy plus a port id to distinguish different caller controls in a single serving callback.

Definition at line 84 of file InControl.hxx.

template<class ControlDataType>
virtual CLAM::InControl< ControlDataType >::~InControl (  )  [inline, virtual]

Definition at line 91 of file InControl.hxx.


Member Function Documentation

template<class ControlDataType>
virtual void CLAM::InControl< ControlDataType >::DoControl ( const ControlDataType &  val  )  [inline, virtual]

The control receives a value when this method gets called. Associated callback if any, gets triggered on result. Connected OutControl may trigger it but it also may be called directly, for example to set the initial value.

Reimplemented in CLAM::InControlPublisher.

Definition at line 100 of file InControl.hxx.

Referenced by CLAM::TokenDelay< T >::ConcreteConfigure(), CLAM::SpectralDelay::ConcreteConfigure(), CLAM::SMSTranspose::ConcreteConfigure(), CLAM::SMSSinusoidalGain::ConcreteConfigure(), CLAM::SMSResidualGain::ConcreteConfigure(), CLAM::SMSPitchShift::ConcreteConfigure(), CLAM::SMSGenderChange::ConcreteConfigure(), CLAM::SimpleOscillator::ConcreteConfigure(), CLAM::SegmentSMSHarmonizer::ConcreteConfigure(), CLAM::Robotization::ConcreteConfigure(), CLAM::OscillatingSpectralNotch::ConcreteConfigure(), CLAM::Control2Data::ConcreteConfigure(), CLAM::CircularShift::ConcreteConfigure(), CLAM::AudioBufferAmplifier::ConcreteConfigure(), CLAM::AudioAmplifier::ConcreteConfigure(), CLAM::ThreeBandFilter::ConcreteConfigure(), CLAM::SMSPitchShift::Do(), CLAM::FrameInterpolator::Do(), CLAM::InControlPublisher::DoControl(), CLAM::FDCombFilter::FDCombFilter(), CLAM::SMSHarmonizer::IgnoreResidual(), CLAM::SegmentSMSHarmonizer::IgnoreResidual(), CLAM::Vocoder::InitControls(), CLAM::SpectralSpread::InitControls(), CLAM::SpectralRingModulation::InitControls(), CLAM::SpectralReverse::InitControls(), CLAM::SpectralPhaseModulation::InitControls(), CLAM::SpectralNotch::InitControls(), CLAM::SpectralGate::InitControls(), CLAM::SpectralFocus::InitControls(), CLAM::SpectralExciter::InitControls(), CLAM::SpectralCombTriang::InitControls(), CLAM::SpectralCombDelta::InitControls(), CLAM::SpectralAverage::InitControls(), CLAM::SpectralAmplitudeModulation::InitControls(), CLAM::SampleAndHold::InitControls(), CLAM::Peakalizer::InitControls(), CLAM::Partializer::InitControls(), CLAM::HumRemover::InitControls(), CLAM::FrameTransformation::InitControls(), CLAM::Deesser::InitControls(), CLAM::ThreeBandAM::InitControls(), CLAM::ThreeBandGate::InitControls(), CLAM::ThreeBandCompressor::InitControls(), CLAM::OutControl< ControlDataType >::SendControl(), CLAM::CircularShift::SetAmount(), and CLAM::WindowGenerator::SetSize().

template<class ControlDataType>
virtual const ControlDataType& CLAM::InControl< ControlDataType >::GetLastValue (  )  const [inline, virtual]
template<>
const std::string CLAM::InControl< MIDI::Message >::GetLastValueAsString (  )  [inline, virtual]

Reimplemented from CLAM::InControlBase.

Definition at line 33 of file InControl.cxx.

template<class ControlDataType>
const std::string CLAM::InControl< ControlDataType >::GetLastValueAsString (  )  [inline, virtual]

Convenience method to get the string representation of the last value. This just works if the token is storable as XML leaf, if not a "Not printable" string is given.

Reimplemented from CLAM::InControlBase.

Definition at line 116 of file InControl.hxx.

Referenced by CLAM::InControl< MIDI::Message >::GetLastValueAsString().

template<class ControlDataType>
virtual const std::type_info& CLAM::InControl< ControlDataType >::GetTypeId (  )  const [inline, virtual]

Concrete InControls must overload this method by returning the typeid of the kind of data they communicate.

This method is used internanlly in order to assure type compatibility between an input an an output control. There are some other uses like the NetworkEditor assigning different colors to connectors depending on this type.

Todo:
Add a link to the

Implements CLAM::InControlBase.

Definition at line 121 of file InControl.hxx.


Member Data Documentation

template<class ControlDataType>
ControlDataType CLAM::InControl< ControlDataType >::mLastValue [protected]

The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.3