CLAM-Development
1.4.0
|
#include <DiscontinuousSegmentation.hxx>
Classes | |
class | InsertedOutOfBounds |
class | MissplacedOffset |
class | MissplacedOnset |
class | OffsetMissing |
Public Types | |
typedef std::vector< double > | TimePositions |
![]() |
Public Member Functions | |
DiscontinuousSegmentation (double maxPosition=0) | |
DiscontinuousSegmentation (double maxPosition, const TData *begin, const TData *end) | |
It will create a discontinuous segmentation where the onsets and offsets are specified on the ordered list of bounds [begin,end) | |
void | takeArray (const TData *begin, const TData *end) |
take data from an array. | |
unsigned | insert (double timePosition) |
Inserts a new border at timePosition. | |
unsigned | insert (double timePosition, std::string label) |
Inserts a new border at timePosition and adds a label to the new segment. | |
void | remove (unsigned segment) |
Removes the specified segment. | |
unsigned | pickOffset (double timePosition, double tolerance) const |
Returns the index of the segment whose offset is nearest to the given time position, and within the tolerance. | |
unsigned | pickOnset (double timePosition, double tolerance) const |
Returns the index of the segment whose onset is nearest to the given time position, and within the tolerance. | |
unsigned | pickSegmentBody (double timePosition) const |
Returns the index of the segment which body is on timePosition. | |
void | dragOnset (unsigned segment, double newTimePosition) |
Performs a dragging movement for the Onset of the given segment in order to move it to the newTimePosition. | |
void | dragOffset (unsigned segment, double newTimePosition) |
Performs a dragging movement for the Offset of the given segment in order to move it to the newTimePosition. | |
void | fillArray (DataArray &segmentation) const |
Fills a DataArray with the segmentation markers. | |
const char * | GetClassName () const |
Return the class name. | |
![]() | |
Segmentation () | |
Segmentation (double maxPosition) | |
virtual | ~Segmentation () |
void | StoreOn (Storage &storage) const |
Stores component's subitems on the given Storage. | |
void | LoadFrom (Storage &storage) |
Loads component's subitems from the given Storage. | |
void | select (unsigned segment) |
void | deselect (unsigned segment) |
void | clearSelection () |
std::string | boundsAsString () const |
Testing method for the unit tests. | |
const TimePositions & | onsets () const |
Returns a vector of time position of the segment onsets. | |
const TimePositions & | offsets () const |
Returns a vector of time position of the segment offsets. | |
const std::vector< std::string > & | labels () const |
Returns a vector of segment labels. | |
void | setLabel (unsigned segment, std::string label) |
Sets the label for a particular segment. | |
const std::vector< bool > & | selections () const |
Returns a vector of time position of the segment selections. | |
unsigned | current () const |
Returns the current segmentation. | |
void | current (unsigned index) |
Changes teh current segmentation. | |
double | maxPosition () const |
virtual void | maxPosition (double maxPosition) |
void | xUnits (const std::string &units) |
const std::string & | xUnits () const |
![]() | |
virtual | ~Component () |
virtual Component * | ShallowCopy () const |
virtual Component * | DeepCopy () const |
Additional Inherited Members | |
![]() | |
TimePositions | _onsets |
TimePositions | _offsets |
std::vector< std::string > | _labels |
std::vector< bool > | _selection |
unsigned | _current |
double | _maxPosition |
std::string | _xUnits |
Definition at line 8 of file DiscontinuousSegmentation.hxx.
typedef std::vector<double> CLAM::DiscontinuousSegmentation::TimePositions |
Reimplemented from CLAM::Segmentation.
Definition at line 55 of file DiscontinuousSegmentation.hxx.
|
inline |
Definition at line 57 of file DiscontinuousSegmentation.hxx.
|
inline |
It will create a discontinuous segmentation where the onsets and offsets are specified on the ordered list of bounds [begin,end)
Definition at line 67 of file DiscontinuousSegmentation.hxx.
References takeArray().
|
inlinevirtual |
Performs a dragging movement for the Offset of the given segment in order to move it to the newTimePosition.
Constraints for the segmentation mode are applied.
Implements CLAM::Segmentation.
Definition at line 218 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_maxPosition, CLAM::Segmentation::_offsets, and CLAM::Segmentation::_onsets.
Referenced by Simac::ChordSegmentator::closeLastSegment(), Simac::ChordSegmentator::closeSegment(), CLAM::TonalAnalysis::Do(), Simac::ChordSegmentator::doItSimilarity(), Simac::ChordSegmentator::doItSimple(), and Simac::ChordSegmentator::mergeSegmentIfIdenticalChordInPreviousSegment().
|
inlinevirtual |
Performs a dragging movement for the Onset of the given segment in order to move it to the newTimePosition.
Constraints for the segmentation mode are applied.
Implements CLAM::Segmentation.
Definition at line 196 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_offsets, and CLAM::Segmentation::_onsets.
|
inlinevirtual |
Fills a DataArray with the segmentation markers.
Implements CLAM::Segmentation.
Definition at line 237 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_offsets, CLAM::Segmentation::_onsets, CLAM::Array< T >::Resize(), and CLAM::Array< T >::SetSize().
|
inlinevirtual |
Return the class name.
Reimplemented from CLAM::Segmentation.
Definition at line 249 of file DiscontinuousSegmentation.hxx.
|
inlinevirtual |
Inserts a new border at timePosition.
Implements CLAM::Segmentation.
Definition at line 99 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_current, CLAM::Segmentation::_labels, CLAM::Segmentation::_maxPosition, CLAM::Segmentation::_offsets, CLAM::Segmentation::_onsets, and CLAM::Segmentation::_selection.
Referenced by insert(), and Simac::ChordSegmentator::openSegment().
|
inline |
Inserts a new border at timePosition and adds a label to the new segment.
Definition at line 138 of file DiscontinuousSegmentation.hxx.
References insert(), and CLAM::Segmentation::setLabel().
|
inlinevirtual |
Returns the index of the segment whose offset is nearest to the given time position, and within the tolerance.
If no end of segment within the tolerance range an invalid segment is returned (nSegments)
Implements CLAM::Segmentation.
Definition at line 164 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_offsets.
|
inlinevirtual |
Returns the index of the segment whose onset is nearest to the given time position, and within the tolerance.
If no end of segment within the tolerance range an invalid segment is returned (nSegments)
Implements CLAM::Segmentation.
Definition at line 174 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_onsets.
|
inlinevirtual |
Returns the index of the segment which body is on timePosition.
Implements CLAM::Segmentation.
Definition at line 181 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_offsets, and CLAM::Segmentation::_onsets.
|
inlinevirtual |
Removes the specified segment.
The previous segment is expanded to cover the region. When removing the first segment, the next segment is the one expanded to start at 0. When just a single element, no efect at all.
Implements CLAM::Segmentation.
Definition at line 150 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_current, CLAM::Segmentation::_labels, CLAM::Segmentation::_offsets, CLAM::Segmentation::_onsets, and CLAM::Segmentation::_selection.
Referenced by Simac::ChordSegmentator::eraseAllSegments(), and Simac::ChordSegmentator::mergeSegmentIfIdenticalChordInPreviousSegment().
|
inlinevirtual |
take data from an array.
Implements CLAM::Segmentation.
Definition at line 75 of file DiscontinuousSegmentation.hxx.
References CLAM::Segmentation::_labels, CLAM::Segmentation::_maxPosition, CLAM::Segmentation::_offsets, CLAM::Segmentation::_onsets, and CLAM::Segmentation::_selection.
Referenced by DiscontinuousSegmentation().