CLAM::Segment Class Reference

#include <Segment.hxx>

Inheritance diagram for CLAM::Segment:

CLAM::ProcessingData CLAM::DynamicType CLAM::Component

List of all members.


Detailed Description

Processing Data class to encapsulate a CLAM segment.

A Segment is basically an ordered list of Frames (

See also:
Frame). It also has a BeginTime and EndTime time tags, an associated Audio (usually a large audio chunk from which smaller Audio Frames are obtained) and a global SamplingRate. Note: time unit is miliseconds. Appart from these internal Processing Data, a Segment also holds a list of child segments named Children. These are usually smaller segments that result from applying some sort of segmentation algorithm to the original Segment. These children do not hold data (namely Frames and Audio. The boolean value HoldsData gives account whether the segment has data (i.e. is the parent) or not. The Id string may be used for different purposes such as classifying different kinds of segments. Finally the child segments also have a pointer to their parent to be able to access the data.

Audio, Frame, ProcessingData, List

Definition at line 50 of file Segment.hxx.


Public Member Functions

 DYNAMIC_TYPE_USING_INTERFACE (Segment, 8, ProcessingData)
 DYN_ATTRIBUTE (0, public, TTime, BeginTime)
 Begin time in miliseconds.
 DYN_ATTRIBUTE (1, public, TTime, EndTime)
 End time in miliseconds.
 DYN_ATTRIBUTE (2, private, bool, prHoldsData)
 DYN_ATTRIBUTE (3, private, List< Frame >, prFramesArray)
 DYN_ATTRIBUTE (4, public, Audio, Audio)
 DYN_ATTRIBUTE (5, public, List< Segment >, Children)
 DYN_ATTRIBUTE (6, public, TData, SamplingRate)
 DYN_ATTRIBUTE (7, public, std::string, Id)
void AddFramesArray ()
void RemoveFramesArray ()
void SetFramesArray (const List< Frame > &frames)
const List< Frame > & GetFramesArray () const
List< Frame > & GetFramesArray ()
SegmentGetpParent ()
 Getter for accessing parent segment.
void SetpParent (Segment *newParent)
 Setter for parent segment.
void DefaultInit ()
 The concrete dynamic type constructor calls DefaultInit().
void CopyInit (const Segment &prototype)
int GetnFrames () const
 Returns the number of frames in segment.
FrameGetFrame (TIndex pos)
 Returns a reference to the frame found in a given position.
const FrameGetFrame (TIndex pos) const
 Returns a constant reference to the frame found in a given position.
void AddFrame (Frame &newFrame)
 Adds a new frame at the end of the segment.
void DeleteFrame (TIndex pos)
 Deletes frame in a given position.
TIndex FindFrame (TTime time) const
 Finds frame with center time closest to the one given.
FrameGetFrame (TTime time)
 Returns a reference to the frame with center time closest to the one passed.
const FrameGetFrame (TTime time) const
 Returns a reference to the frame with center time closest to the one passed.
void DeleteFrame (TTime time)
 Deletes frame with center time closest to the one passed.
void SetHoldsData (bool HoldsData)
 Interface for setting the prHoldData member and configuring the Segment accordingly.
bool GetHoldsData () const
 Interface for accessing the prHoldData private member.

Public Attributes

TIndex mCurrentFrameIndex
 Index used when processing for keeeping trace of current location in Frame list.

Member Function Documentation

CLAM::Segment::DYNAMIC_TYPE_USING_INTERFACE ( Segment  ,
,
ProcessingData   
)

CLAM::Segment::DYN_ATTRIBUTE ( ,
public  ,
TTime  ,
BeginTime   
)

Begin time in miliseconds.

CLAM::Segment::DYN_ATTRIBUTE ( ,
public  ,
TTime  ,
EndTime   
)

End time in miliseconds.

CLAM::Segment::DYN_ATTRIBUTE ( ,
private  ,
bool  ,
prHoldsData   
)

CLAM::Segment::DYN_ATTRIBUTE ( ,
private  ,
List< Frame ,
prFramesArray   
)

CLAM::Segment::DYN_ATTRIBUTE ( ,
public  ,
Audio  ,
Audio   
)

CLAM::Segment::DYN_ATTRIBUTE ( ,
public  ,
List< Segment ,
Children   
)

CLAM::Segment::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
SamplingRate   
)

CLAM::Segment::DYN_ATTRIBUTE ( ,
public  ,
std::string  ,
Id   
)

void CLAM::Segment::AddFramesArray (  )  [inline]

Definition at line 73 of file Segment.hxx.

Referenced by SetHoldsData().

void CLAM::Segment::RemoveFramesArray (  )  [inline]

Definition at line 77 of file Segment.hxx.

Referenced by SetHoldsData().

void CLAM::Segment::SetFramesArray ( const List< Frame > &  frames  )  [inline]

Definition at line 82 of file Segment.hxx.

const List<Frame>& CLAM::Segment::GetFramesArray (  )  const [inline]

Definition at line 87 of file Segment.hxx.

Referenced by AddFrame(), CopyInit(), DeleteFrame(), GetFrame(), GetnFrames(), and SetHoldsData().

List<Frame>& CLAM::Segment::GetFramesArray (  )  [inline]

Definition at line 88 of file Segment.hxx.

Segment* CLAM::Segment::GetpParent (  )  [inline]

Getter for accessing parent segment.

Definition at line 93 of file Segment.hxx.

void CLAM::Segment::SetpParent ( Segment newParent  )  [inline]

Setter for parent segment.

Definition at line 95 of file Segment.hxx.

void CLAM::Segment::DefaultInit ( void   ) 

The concrete dynamic type constructor calls DefaultInit().

This allows user to initialize his/her object. But we define DefaultInit() here because we don't want to force writting one DefaultInit() function for each concrete dynamic type. If a dynamic type concrete class defines some (not-default) constructors, this should also call the DefaultInit().

See also:
CopyInit()

Reimplemented from CLAM::DynamicType.

Definition at line 35 of file Segment.cxx.

References mCurrentFrameIndex, NULL, and CLAM::DynamicType::UpdateData().

void CLAM::Segment::CopyInit ( const Segment prototype  ) 

Definition at line 57 of file Segment.cxx.

References GetFramesArray(), mCurrentFrameIndex, mFramesSearch, and pParent.

int CLAM::Segment::GetnFrames (  )  const

Frame & CLAM::Segment::GetFrame ( TIndex  pos  ) 

const Frame & CLAM::Segment::GetFrame ( TIndex  pos  )  const

Returns a constant reference to the frame found in a given position.

Definition at line 105 of file Segment.cxx.

References CLAM_ASSERT, GetFrame(), GetFramesArray(), and GetHoldsData().

void CLAM::Segment::AddFrame ( Frame newFrame  ) 

void CLAM::Segment::DeleteFrame ( TIndex  pos  ) 

TIndex CLAM::Segment::FindFrame ( TTime  time  )  const

Finds frame with center time closest to the one given.

Time in miliseconds

Returns:
position of frame in segment

Definition at line 170 of file Segment.cxx.

References CLAM_ASSERT, FindFrame(), GetHoldsData(), and GetnFrames().

Referenced by DeleteFrame(), FindFrame(), GetFrame(), and GetnFrames().

Frame & CLAM::Segment::GetFrame ( TTime  time  ) 

Returns a reference to the frame with center time closest to the one passed.

Time in miliseconds.

See also:
const Frame& GetFrame(TTime time) const

GetFrame(TIndex pos)

Definition at line 184 of file Segment.cxx.

References FindFrame(), and GetFrame().

const Frame & CLAM::Segment::GetFrame ( TTime  time  )  const

Returns a reference to the frame with center time closest to the one passed.

Time in miliseconds.

See also:
Frame& GetFrame(TTime time)

Definition at line 189 of file Segment.cxx.

References FindFrame(), and GetFrame().

void CLAM::Segment::DeleteFrame ( TTime  time  ) 

Deletes frame with center time closest to the one passed.

Time in miliseconds

See also:
DeletFrame(TIndex pos)

Definition at line 194 of file Segment.cxx.

References DeleteFrame(), and FindFrame().

void CLAM::Segment::SetHoldsData ( bool  HoldsData  ) 

Interface for setting the prHoldData member and configuring the Segment accordingly.

Definition at line 199 of file Segment.cxx.

References AddFramesArray(), GetFramesArray(), NULL, RemoveFramesArray(), and CLAM::DynamicType::UpdateData().

bool CLAM::Segment::GetHoldsData (  )  const [inline]

Interface for accessing the prHoldData private member.

Definition at line 147 of file Segment.hxx.

Referenced by AddFrame(), DeleteFrame(), FindFrame(), GetFrame(), and GetnFrames().


Member Data Documentation


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

Generated on Tue Aug 12 22:33:47 2008 for CLAM by  doxygen 1.5.5