![]() |
Mixxx
|
#include <Segmentation.hxx>
Classes | |
class | InsertedOutOfBounds |
Public Types | |
typedef std::vector< double > | TimePositions |
Public Member Functions | |
Segmentation () | |
Segmentation (double maxPosition) | |
virtual | ~Segmentation () |
virtual unsigned | insert (double timePosition)=0 |
virtual void | remove (unsigned segment)=0 |
virtual unsigned | pickOffset (double timePosition, double tolerance) const =0 |
virtual unsigned | pickOnset (double timePosition, double tolerance) const =0 |
virtual unsigned | pickSegmentBody (double timePosition) const =0 |
virtual void | dragOnset (unsigned segment, double newTimePosition)=0 |
virtual void | dragOffset (unsigned segment, double newTimePosition)=0 |
virtual void | takeArray (const TData *begin, const TData *end)=0 |
const char * | GetClassName () const |
void | select (unsigned segment) |
void | deselect (unsigned segment) |
void | clearSelection () |
std::string | boundsAsString () const |
const TimePositions & | onsets () const |
const TimePositions & | offsets () const |
const std::vector< std::string > & | labels () const |
void | setLabel (unsigned segment, std::string label) |
const std::vector< bool > & | selections () const |
unsigned | current () const |
void | current (unsigned index) |
double | maxPosition () const |
virtual void | maxPosition (double maxPosition) |
void | xUnits (const std::string &units) |
const std::string & | xUnits () const |
Protected Attributes | |
TimePositions | _onsets |
TimePositions | _offsets |
std::vector< std::string > | _labels |
std::vector< bool > | _selection |
unsigned | _current |
double | _maxPosition |
std::string | _xUnits |
Definition at line 17 of file Segmentation.hxx.
typedef std::vector<double> CLAM::Segmentation::TimePositions |
Reimplemented in CLAM::DiscontinuousSegmentation.
Definition at line 25 of file Segmentation.hxx.
CLAM::Segmentation::Segmentation | ( | ) | [inline] |
Definition at line 27 of file Segmentation.hxx.
CLAM::Segmentation::Segmentation | ( | double | maxPosition | ) | [inline] |
Definition at line 32 of file Segmentation.hxx.
Segmentation< T >::~Segmentation | ( | ) | [virtual] |
Definition at line 6 of file Segmentation.cxx.
std::string CLAM::Segmentation::boundsAsString | ( | ) | const [inline] |
Testing method for the unit tests.
Definition at line 134 of file Segmentation.hxx.
void CLAM::Segmentation::clearSelection | ( | ) | [inline] |
Definition at line 125 of file Segmentation.hxx.
unsigned CLAM::Segmentation::current | ( | ) | const [inline] |
Returns the current segmentation.
Definition at line 184 of file Segmentation.hxx.
void CLAM::Segmentation::current | ( | unsigned | index | ) | [inline] |
Changes teh current segmentation
Definition at line 191 of file Segmentation.hxx.
void CLAM::Segmentation::deselect | ( | unsigned | segment | ) | [inline] |
Definition at line 121 of file Segmentation.hxx.
virtual void CLAM::Segmentation::dragOffset | ( | unsigned | segment, |
double | newTimePosition | ||
) | [pure virtual] |
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.
Implemented in CLAM::DiscontinuousSegmentation.
virtual void CLAM::Segmentation::dragOnset | ( | unsigned | segment, |
double | newTimePosition | ||
) | [pure virtual] |
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.
Implemented in CLAM::DiscontinuousSegmentation.
const char* CLAM::Segmentation::GetClassName | ( | ) | const [inline] |
Reimplemented in CLAM::DiscontinuousSegmentation.
Definition at line 86 of file Segmentation.hxx.
virtual unsigned CLAM::Segmentation::insert | ( | double | timePosition | ) | [pure virtual] |
Inserts a new border at timePosition.
Implemented in CLAM::DiscontinuousSegmentation.
const std::vector<std::string>& CLAM::Segmentation::labels | ( | ) | const [inline] |
Returns a vector of segment labels
Definition at line 162 of file Segmentation.hxx.
double CLAM::Segmentation::maxPosition | ( | ) | const [inline] |
virtual void CLAM::Segmentation::maxPosition | ( | double | maxPosition | ) | [inline, virtual] |
const TimePositions& CLAM::Segmentation::offsets | ( | ) | const [inline] |
Returns a vector of time position of the segment offsets.
Definition at line 155 of file Segmentation.hxx.
const TimePositions& CLAM::Segmentation::onsets | ( | ) | const [inline] |
Returns a vector of time position of the segment onsets.
Definition at line 148 of file Segmentation.hxx.
virtual unsigned CLAM::Segmentation::pickOffset | ( | double | timePosition, |
double | tolerance | ||
) | const [pure virtual] |
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)
Implemented in CLAM::DiscontinuousSegmentation.
virtual unsigned CLAM::Segmentation::pickOnset | ( | double | timePosition, |
double | tolerance | ||
) | const [pure virtual] |
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)
Implemented in CLAM::DiscontinuousSegmentation.
virtual unsigned CLAM::Segmentation::pickSegmentBody | ( | double | timePosition | ) | const [pure virtual] |
Returns the index of the segment which body is on timePosition.
Implemented in CLAM::DiscontinuousSegmentation.
virtual void CLAM::Segmentation::remove | ( | unsigned | segment | ) | [pure virtual] |
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.
Implemented in CLAM::DiscontinuousSegmentation.
void CLAM::Segmentation::select | ( | unsigned | segment | ) | [inline] |
Definition at line 117 of file Segmentation.hxx.
const std::vector<bool>& CLAM::Segmentation::selections | ( | ) | const [inline] |
Returns a vector of time position of the segment selections.
Definition at line 177 of file Segmentation.hxx.
void CLAM::Segmentation::setLabel | ( | unsigned | segment, |
std::string | label | ||
) | [inline] |
Sets the label for a particular segment
Definition at line 169 of file Segmentation.hxx.
virtual void CLAM::Segmentation::takeArray | ( | const TData * | begin, |
const TData * | end | ||
) | [pure virtual] |
take data from an array.
Implemented in CLAM::DiscontinuousSegmentation.
const std::string& CLAM::Segmentation::xUnits | ( | ) | const [inline] |
Definition at line 208 of file Segmentation.hxx.
void CLAM::Segmentation::xUnits | ( | const std::string & | units | ) | [inline] |
Definition at line 204 of file Segmentation.hxx.
unsigned CLAM::Segmentation::_current [protected] |
Definition at line 217 of file Segmentation.hxx.
std::vector<std::string> CLAM::Segmentation::_labels [protected] |
Definition at line 215 of file Segmentation.hxx.
double CLAM::Segmentation::_maxPosition [protected] |
Definition at line 218 of file Segmentation.hxx.
TimePositions CLAM::Segmentation::_offsets [protected] |
Definition at line 214 of file Segmentation.hxx.
TimePositions CLAM::Segmentation::_onsets [protected] |
Definition at line 213 of file Segmentation.hxx.
std::vector<bool> CLAM::Segmentation::_selection [protected] |
Definition at line 216 of file Segmentation.hxx.
std::string CLAM::Segmentation::_xUnits [protected] |
Definition at line 219 of file Segmentation.hxx.