CLAM-Development
1.4.0
|
#include <SegmentTransformation.hxx>
Public Member Functions | |
void | AttachIn (Segment &data) |
void | AttachOut (Segment &data) |
void | WrapFrameTransformation (FrameTransformation *) |
virtual bool | ConcreteConfigure (const ProcessingConfig &c) |
Configuration change method. | |
const ProcessingConfig & | GetConfig () const |
Configuration getter. | |
SegmentTransformation () | |
Base constructor of class. | |
SegmentTransformation (const SegmentTransformationConfig &c) | |
Constructor with an object of SegmentTransformationConfig class by parameter. | |
virtual | ~SegmentTransformation () |
virtual bool | DoWithSegments (void) |
Supervised Do() function. | |
virtual bool | UpdateControlValueFromBPF (TData pos) |
Method to update the Amount control from an existing BPF configured in the configuration phase. | |
virtual bool | IsLastFrame () |
Returns true if there are no more frames to read from input. | |
bool | ConcreteStart () |
Overriding default method to initialize input frame counter. | |
![]() | |
bool | Configure (const ProcessingConfig &config) |
Configuration change method. | |
void | Start (void) |
Method to turn the object into running state. | |
void | Stop (void) |
Method to put the object out of running state When in execution mode, this method must be called before any further call to Configure() methods. | |
Processing () | |
virtual | ~Processing () |
virtual bool | CanProcessInplace () |
Override this method if your processing cannot process inplace. | |
bool | CanConsumeAndProduce () |
Check that Supervised Do() can be safely called. | |
void | ConsumeAndProduce () |
Acknoledges data tokens in published ports as read/writen by calling Produce() for all registered OutPorts and Consume() to all registered InPorts. | |
std::string | GetExecStateString () const |
bool | IsConfigured () const |
bool | IsRunning () const |
void | RegisterOutPort (OutPortBase *out) |
void | RegisterInPort (InPortBase *in) |
void | RegisterOutControl (OutControlBase *out) |
void | RegisterInControl (InControlBase *in) |
void | SetParent (Processing *p) |
void | SetNetworkBackLink (Network *network) |
virtual bool | ModifiesPortsAndControlsAtConfiguration () |
This method is used to determine if a given processing can change its interface of ports/controls after its construction (i.e. | |
bool | HasInPort (const std::string &name) |
bool | HasOutPort (const std::string &name) |
bool | HasInControl (const std::string &name) |
bool | HasOutControl (const std::string &name) |
InPortBase & | GetInPort (const std::string &name) |
OutPortBase & | GetOutPort (const std::string &name) |
InControlBase & | GetInControl (const std::string &name) |
OutControlBase & | GetOutControl (const std::string &name) |
InPortBase & | GetInPort (unsigned index) |
OutPortBase & | GetOutPort (unsigned index) |
InControlBase & | GetInControl (unsigned index) |
OutControlBase & | GetOutControl (unsigned index) |
unsigned | GetNInPorts () const |
unsigned | GetNOutPorts () const |
unsigned | GetNInControls () const |
unsigned | GetNOutControls () const |
const std::string & | GetConfigErrorMessage () const |
Returns a string describing configuration errors if any. | |
virtual bool | IsSyncSource () const |
Wether the processing is a sync source such as audio i/o device, or an audio callback hook (i.e. | |
virtual bool | SupportsVariableAudioSize () const |
This method reports whether the processing supports dynamic buffer-size host. |
Public Attributes | |
InControlPublisher | mAmountCtrl |
Control for the amount of the concrete transformation that will be applied. |
Protected Member Functions | |
virtual bool | Do (const Frame &in, Frame &out) |
bool | Do () |
Supervised mode execution method (using ports) | |
const char * | GetClassName () const |
Override it in every subclass and retur the name of that class. | |
void | AddFramesToOutputIfInputIsLonger (int frameindex, const Segment &in, Segment &out) |
virtual bool | Do (const Segment &in, Segment &out) |
Unsupervised Do function, receives a Segment as input and output. | |
virtual const Frame & | GetCurrentFrame (const Segment &in) |
formerly corresponded to UnwrappedProcessingData | |
virtual Frame & | GetCurrentFrame (Segment &out) |
formerly corresponded to UnwrappedProcessingData | |
![]() | |
virtual bool | ConcreteStop () |
Processing objects have to redefine this method when stoping them implies some internal changes. | |
unsigned | BackendBufferSize () |
Given by the NetworkPlayer (backend) if exists. | |
unsigned | BackendSampleRate () |
Given by the NetworkPlayer (backend) if exists. | |
InControlRegistry & | GetInControls () |
Accessor to published Controls manager. | |
OutControlRegistry & | GetOutControls () |
Accessor to published Controls manager. | |
InPortRegistry & | GetInPorts () |
Accessor to published Ports manager. | |
OutPortRegistry & | GetOutPorts () |
Accessor to published Portss manager. | |
bool | AddConfigErrorMessage (const std::string &msg) |
Use this method to append a configuration errors to the processing when implementing ConcreteConfigure. | |
bool | AbleToExecute (void) const |
In debug-mode checks that the processing is configured and started. | |
template<typename ConcreteConfig > | |
void | CopyAsConcreteConfig (ConcreteConfig &concrete, const ProcessingConfig &abstract) const |
Helper template to convert a reference to a ProcessingConfig to the concrete ProcessingConfig specified on the first parameter. | |
void | SetExecState (ExecState state) |
Protected Attributes | |
SegmentTransformationConfig | mConfig |
Internally stored configuration. | |
bool | mUseTemporalBPF |
Boolean member that indicates whether BPF or single value is to be used. | |
FloatInControl | mOnCtrl |
Control to state whether a particular transformation is on or off. | |
Segment * | mInput |
Segment * | mOutput |
int | mCurrentInputFrame |
![]() | |
ProcessingComposite * | mpParent |
Pointer to the parent (composite) processing object, or 0. | |
Network * | _network |
The parent network if any. |
Additional Inherited Members | |
![]() | |
enum | ExecState { Unconfigured = 0, Ready, Running } |
Processing Object possible execution states. More... | |
typedef NullProcessingConfig | Config |
Definition at line 42 of file SegmentTransformation.hxx.
CLAM::SegmentTransformation::SegmentTransformation | ( | ) |
Base constructor of class.
Calls Configure method with a SegmentTransformationConfig initialised by default
Definition at line 32 of file SegmentTransformation.cxx.
References mCurrentInputFrame, mInput, mOutput, and mUseTemporalBPF.
CLAM::SegmentTransformation::SegmentTransformation | ( | const SegmentTransformationConfig & | c | ) |
Constructor with an object of SegmentTransformationConfig class by parameter.
c | SegmentTransformationConfig object created by the user |
Definition at line 43 of file SegmentTransformation.cxx.
References CLAM::Processing::Configure(), mCurrentInputFrame, mInput, mOutput, and mUseTemporalBPF.
|
virtual |
Definition at line 55 of file SegmentTransformation.cxx.
|
inlineprotected |
Definition at line 128 of file SegmentTransformation.hxx.
References CLAM::Segment::AddFrame(), CLAM::Segment::GetFrame(), and CLAM::Segment::GetnFrames().
Referenced by Do().
|
inline |
Definition at line 73 of file SegmentTransformation.hxx.
References mInput.
Referenced by CLAM::SMSTransformationChain::ConcreteStart().
|
inline |
Definition at line 74 of file SegmentTransformation.hxx.
References mOutput.
Referenced by CLAM::SMSTransformationChain::ConcreteStart().
|
virtual |
Configuration change method.
Note that the Amount Control is initialized from the the values in the configuration. Appart from that the member boolean variable that indicates whether a BPF is used is also initialized and the On/Off control also.
The | ProcessingConfig object |
Reimplemented from CLAM::Processing.
Reimplemented in CLAM::SegmentSMSMorph, and CLAM::SegmentSMSTimeStretch.
Definition at line 94 of file SegmentTransformation.cxx.
References CLAM::Processing::CopyAsConcreteConfig(), CLAM::InControlPublisher::DoControl(), mAmountCtrl, mConfig, and mUseTemporalBPF.
|
virtual |
Overriding default method to initialize input frame counter.
Reimplemented from CLAM::Processing.
Reimplemented in CLAM::SegmentSMSMorph, and CLAM::SegmentSMSTimeStretch.
Definition at line 139 of file SegmentTransformation.cxx.
|
inlineprotectedvirtual |
Reimplemented in CLAM::SMSTransformationChainIO, CLAM::SegmentSMSMorph, and CLAM::SegmentSMSTimeStretch.
Definition at line 123 of file SegmentTransformation.hxx.
|
inlineprotectedvirtual |
Supervised mode execution method (using ports)
Implements CLAM::Processing.
Reimplemented in CLAM::SegmentSMSMorph, CLAM::SMSTransformationChainIO, and CLAM::SegmentSMSTimeStretch.
Definition at line 124 of file SegmentTransformation.hxx.
Referenced by Do(), and DoWithSegments().
Unsupervised Do function, receives a Segment as input and output.
This overload is the one called from the supervised Do(). Note that if BPF parameter is used, the Amount control is also updated.
input | the Segment that is input to the transformation |
out | the Segment that is output from the transformation. |
Reimplemented in CLAM::SegmentSMSMorph, and CLAM::SegmentSMSTimeStretch.
Definition at line 61 of file SegmentTransformation.cxx.
References AddFramesToOutputIfInputIsLonger(), CLAM_ASSERT, CLAM::FrameTransformation::Do(), Do(), CLAM::Segment::GetFrame(), CLAM::Segment::GetnFrames(), CLAM::Segment::mCurrentFrameIndex, mCurrentInputFrame, mInput, mUseTemporalBPF, and UpdateControlValueFromBPF().
|
inlinevirtual |
Supervised Do() function.
It calls the non-supervised Do that receives Segment as input and output.
Definition at line 104 of file SegmentTransformation.hxx.
References Do(), mInput, and mOutput.
Referenced by CLAM::SMSTransformationChain::DoChildren().
|
inlineprotectedvirtual |
Override it in every subclass and retur the name of that class.
Implements CLAM::Processing.
Reimplemented in CLAM::SegmentSMSMorph, and CLAM::SegmentSMSTimeStretch.
Definition at line 125 of file SegmentTransformation.hxx.
|
inlinevirtual |
Configuration getter.
Gets the configuration parameters used to create the object.
Reimplemented from CLAM::Processing.
Reimplemented in CLAM::SegmentSMSMorph.
Definition at line 86 of file SegmentTransformation.hxx.
References mConfig.
|
inlineprotectedvirtual |
formerly corresponded to UnwrappedProcessingData
Reimplemented in CLAM::SegmentSMSTimeStretch.
Definition at line 145 of file SegmentTransformation.hxx.
References CLAM::Segment::GetFrame(), and mCurrentInputFrame.
formerly corresponded to UnwrappedProcessingData
Reimplemented in CLAM::SegmentSMSTimeStretch.
Definition at line 151 of file SegmentTransformation.hxx.
References CLAM::Segment::AddFrame(), CLAM::Segment::GetFrame(), CLAM::Segment::GetnFrames(), mCurrentInputFrame, and mInput.
|
virtual |
Returns true if there are no more frames to read from input.
Reimplemented in CLAM::SegmentSMSTimeStretch.
Definition at line 125 of file SegmentTransformation.cxx.
References CLAM::Segment::DeleteFrame(), CLAM::Segment::GetnFrames(), CLAM::Segment::mCurrentFrameIndex, mInput, and mOutput.
|
virtual |
Method to update the Amount control from an existing BPF configured in the configuration phase.
Reimplemented in CLAM::SegmentSMSMorph.
Definition at line 114 of file SegmentTransformation.cxx.
References CLAM::InControlPublisher::DoControl(), mAmountCtrl, and mConfig.
Referenced by CLAM::SegmentSMSTimeStretch::Do(), and Do().
void CLAM::SegmentTransformation::WrapFrameTransformation | ( | FrameTransformation * | trans | ) |
Definition at line 26 of file SegmentTransformation.cxx.
References CLAM_ASSERT.
InControlPublisher CLAM::SegmentTransformation::mAmountCtrl |
Control for the amount of the concrete transformation that will be applied.
This control value can be manually updated or automatically from the values in the BPF envelope-like configuration parameter.
Definition at line 69 of file SegmentTransformation.hxx.
Referenced by ConcreteConfigure(), and UpdateControlValueFromBPF().
|
protected |
Internally stored configuration.
Reimplemented in CLAM::SegmentSMSMorph.
Definition at line 50 of file SegmentTransformation.hxx.
Referenced by ConcreteConfigure(), GetConfig(), and UpdateControlValueFromBPF().
|
protected |
Definition at line 159 of file SegmentTransformation.hxx.
Referenced by CLAM::SegmentSMSTimeStretch::ConcreteStart(), CLAM::SegmentSMSTimeStretch::Do(), Do(), CLAM::SegmentSMSTimeStretch::GetCurrentFrame(), GetCurrentFrame(), CLAM::SegmentSMSTimeStretch::HaveFinished(), CLAM::SegmentSMSTimeStretch::SegmentSMSTimeStretch(), SegmentTransformation(), and CLAM::SegmentSMSTimeStretch::UpdateTimeAndIndex().
|
protected |
Definition at line 62 of file SegmentTransformation.hxx.
Referenced by AttachIn(), Do(), DoWithSegments(), GetCurrentFrame(), CLAM::SegmentSMSTimeStretch::HaveFinished(), IsLastFrame(), and SegmentTransformation().
|
protected |
Control to state whether a particular transformation is on or off.
This control may be used as a bypass when the transformation is connected in a Chain.
Definition at line 60 of file SegmentTransformation.hxx.
|
protected |
Definition at line 63 of file SegmentTransformation.hxx.
Referenced by AttachOut(), DoWithSegments(), CLAM::SegmentSMSTimeStretch::IsLastFrame(), IsLastFrame(), and SegmentTransformation().
|
protected |
Boolean member that indicates whether BPF or single value is to be used.
This is not a control because it is not supposed to change un run-time. It is rather a configuration parameter that can be automatically extracted from mConfig but it is placed here to make it more explicit.
Definition at line 56 of file SegmentTransformation.hxx.
Referenced by CLAM::SegmentSMSTimeStretch::ConcreteConfigure(), ConcreteConfigure(), Do(), CLAM::SegmentSMSMorph::SegmentSMSMorph(), and SegmentTransformation().