Class MediaSegment
java.lang.Object
ca.phon.extensions.ExtendableObject
ca.phon.session.MediaSegment
- All Implemented Interfaces:
IExtendable
Media segment
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquals will return true if start/end times are the same.floatReturn end time in secondsfloatGet end valuelongReturn end time in millisecondsfloatReturn segment length in secondslongReturn segment length in millisecondsfloatReturn start time in secondsfloatGet start value as a floating point numberlongReturn start time in millisecondsGet media unit represented by getStartValue() and getEndValue()booleanisPoint()Is the media segment a single pointbooleanIs the media segment a single point at the origin (0.0f)overlaps(MediaSegment seg) Does this segment overlap the given segmentvoidsetEndTime(float endTime) Set end time in secondsvoidsetEndTimeMs(long endTime) Set end time in millisecondsvoidsetEndValue(float end) Set end valuevoidsetSegment(float startValue, float endValue) voidsetSegment(float startValue, float endValue, MediaUnit unit) voidsetSegment(MediaSegment seg) voidsetStartTime(float startTime) Set start time in secondsvoidsetStartTimeMs(long startTime) Set start time in millisecondsvoidsetStartValue(float start) Set start value, unit is specified by getUnitType()voidsetUnitType(MediaUnit mediaUnit) Set media unit for segmenttoString()Methods inherited from class ca.phon.extensions.ExtendableObject
getExtension, getExtensions, putExtension, removeExtension
-
Method Details
-
getStartValue
public float getStartValue()Get start value as a floating point number- Returns:
- start value
-
setStartValue
public void setStartValue(float start) Set start value, unit is specified by getUnitType()- Parameters:
start-
-
getEndValue
public float getEndValue()Get end value- Returns:
- end value
-
setEndValue
public void setEndValue(float end) Set end value- Parameters:
end-
-
getUnitType
Get media unit represented by getStartValue() and getEndValue()- Returns:
- media unit
-
getStartTime
public float getStartTime()Return start time in seconds- Returns:
- start time in seconds
-
setStartTime
public void setStartTime(float startTime) Set start time in seconds- Parameters:
startTime-
-
getStartValueMs
public long getStartValueMs()Return start time in milliseconds- Returns:
- start time in milliseconds
-
setStartTimeMs
public void setStartTimeMs(long startTime) Set start time in milliseconds- Parameters:
startTime-
-
getEndTime
public float getEndTime()Return end time in seconds- Returns:
- end time in seconds
-
setEndTime
public void setEndTime(float endTime) Set end time in seconds- Parameters:
endTime-
-
getEndValueMs
public long getEndValueMs()Return end time in milliseconds- Returns:
- end time in milliseconds
-
setEndTimeMs
public void setEndTimeMs(long endTime) Set end time in milliseconds- Parameters:
endTime-
-
getLength
public float getLength()Return segment length in seconds- Returns:
- length in seconds
-
getLengthMs
public long getLengthMs()Return segment length in milliseconds- Returns:
- length in milliseconds
-
setUnitType
-
setSegment
public void setSegment(float startValue, float endValue) -
isPoint
public boolean isPoint()Is the media segment a single point- Returns:
- true if getStartValue() == getEndValue()
-
isPointAtOrigin
public boolean isPointAtOrigin()Is the media segment a single point at the origin (0.0f)- Returns:
- true if isPoint() == true invalid input: '&'invalid input: '&' getStartValue() == 0.0f
-
setSegment
-
setSegment
-
equals
-
toString
-
overlaps
Does this segment overlap the given segment- Parameters:
seg- the segment to check against- Returns:
- the overlap type of the two segments
-