Marsyas  0.5.0-beta1
Public Member Functions | Friends
TimeLine Class Reference

TimeLine is a list of TimeRegions. More...

#include <TimeLine.h>

Public Member Functions

void clear ()
mrs_string filename () const
std::vector< mrs_stringgetRegionNames () const
void info () const
mrs_natural lineSize () const
bool load (mrs_string filename, mrs_string lexicon_labels)
mrs_natural numClasses () const
mrs_natural numRegions () const
void print (FILE *fp)
void printnew (FILE *fp)
void receive (Communicator *com)
mrs_real regionClass (mrs_natural regionNum) const
mrs_natural regionEnd (mrs_natural regionNum) const
mrs_string regionName (mrs_natural regionNum) const
mrs_natural regionStart (mrs_natural regionNum) const
void regular (mrs_natural spacing, mrs_natural size, mrs_natural lineSize=MRS_DEFAULT_SLICE_NSAMPLES)
void removeRegion (mrs_natural regionNum)
mrs_natural sampleClass (mrs_natural sample) const
void segment (realvec segmentation, mrs_natural lineSize=MRS_DEFAULT_SLICE_NSAMPLES)
void send (Communicator *com)
void setRegionClass (mrs_natural regionNum, mrs_natural classId)
void setRegionName (mrs_natural regionNum, mrs_string name)
mrs_bool setSampleRate (mrs_real srate)
mrs_natural size () const
void smooth (mrs_natural smoothSize)
 TimeLine ()
void write (mrs_string filename)
 ~TimeLine ()


std::ostream & operator<< (std::ostream &, const TimeLine &)

Detailed Description

TimeLine is a list of TimeRegions.

TimeLine is a list of TimeRegions. It represents a segmentation in time of sound. Each region is defined by its boundaries, a class id and a name. The units used to define the boundaries of each segment can be arbitrary integer multiples of one sample and are defined by lineSize (e.g. if lineSize is set to 1024, if the start of a region is set to 2, it means that it starts at sample 2*1024 = 2048).

TimeLines can be saved and loaded from files. The current format is as follows:

Nr. of Regions (mrs_natural) lineSize (in samples - mrs_natural) size (in lineSize units - mrs_natural) region1 start (mrs_natural) region1 classid (mrs_natura) region1 end (mrs_natural) region1 name (mrs_string) region2 start (mrs_natural) region2 classid (mrs_natura) region2 end (mrs_natural) region2 name (mrs_string) ...

Definition at line 73 of file TimeLine.h.

Constructor & Destructor Documentation

TimeLine ( )

Definition at line 26 of file TimeLine.cpp.

~TimeLine ( )

Definition at line 36 of file TimeLine.cpp.

Member Function Documentation

void clear ( )

Definition at line 41 of file TimeLine.cpp.

mrs_string filename ( ) const [inline]

Definition at line 94 of file TimeLine.h.

vector< mrs_string > getRegionNames ( ) const

Definition at line 185 of file TimeLine.cpp.

void info ( ) const

Definition at line 481 of file TimeLine.cpp.

mrs_natural lineSize ( ) const [inline]

Definition at line 96 of file TimeLine.h.

bool load ( mrs_string  filename,
mrs_string  lexicon_labels 

Definition at line 329 of file TimeLine.cpp.

mrs_natural numClasses ( ) const

Definition at line 159 of file TimeLine.cpp.

mrs_natural numRegions ( ) const [inline]

Definition at line 98 of file TimeLine.h.

void print ( FILE *  fp)

Definition at line 551 of file TimeLine.cpp.

void printnew ( FILE *  fp)

Definition at line 499 of file TimeLine.cpp.

void receive ( Communicator com)

Definition at line 623 of file TimeLine.cpp.

mrs_real regionClass ( mrs_natural  regionNum) const

Definition at line 303 of file TimeLine.cpp.

mrs_natural regionEnd ( mrs_natural  regionNum) const

Definition at line 246 of file TimeLine.cpp.

mrs_string regionName ( mrs_natural  regionNum) const

Definition at line 222 of file TimeLine.cpp.

mrs_natural regionStart ( mrs_natural  regionNum) const

Definition at line 214 of file TimeLine.cpp.

void regular ( mrs_natural  spacing,
mrs_natural  size,
mrs_natural  lineSize = MRS_DEFAULT_SLICE_NSAMPLES 

Definition at line 76 of file TimeLine.cpp.

void removeRegion ( mrs_natural  regionNum)

Definition at line 292 of file TimeLine.cpp.

mrs_natural sampleClass ( mrs_natural  sample) const

Definition at line 314 of file TimeLine.cpp.

void segment ( realvec  segmentation,
mrs_natural  lineSize = MRS_DEFAULT_SLICE_NSAMPLES 

Definition at line 115 of file TimeLine.cpp.

void send ( Communicator com)

Definition at line 647 of file TimeLine.cpp.

void setRegionClass ( mrs_natural  regionNum,
mrs_natural  classId 

Definition at line 237 of file TimeLine.cpp.

void setRegionName ( mrs_natural  regionNum,
mrs_string  name 

Definition at line 230 of file TimeLine.cpp.

mrs_bool setSampleRate ( mrs_real  srate)

Definition at line 54 of file TimeLine.cpp.

mrs_natural size ( ) const [inline]

Definition at line 95 of file TimeLine.h.

void smooth ( mrs_natural  smoothSize)

Definition at line 254 of file TimeLine.cpp.

void write ( mrs_string  filename)

Definition at line 525 of file TimeLine.cpp.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const TimeLine tline 
) [friend]

Definition at line 533 of file TimeLine.cpp.

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