Package com.tagtraum.audiokern.beats
Class SteadyBeats
- java.lang.Object
-
- com.tagtraum.audiokern.beats.SteadyBeats
-
-
Constructor Summary
Constructors Constructor Description SteadyBeats(long anchorBeat, long microSecondsPerBeat, long duration)Steady beats with unknown time signature (beats per measure).SteadyBeats(long anchorBeat, long microSecondsPerBeat, long duration, int beatsPerMeasure)Steady beats with known time signature (beats per measure).SteadyBeats(org.json.simple.JSONObject jsonObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BeatschangeTime(TimeSignature timeSignature)Provide a view that reflects the given time signature and adjust beat numbers accordingly.Objectclone()booleanequals(Object o)longgetAnchorBeat()intgetBeatsPerMeasure()Beats per measure.longgetDuration()longgetMicroSecondsPerBeat()inthashCode()Iterator<Beat>iterator()Beats.ListIterator<Beat>listIterator()Beats.StringtoJSONString()StringtoString()-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
SteadyBeats
public SteadyBeats(long anchorBeat, long microSecondsPerBeat, long duration, int beatsPerMeasure)Steady beats with known time signature (beats per measure).- Parameters:
anchorBeat- one beat defined in microsecondsmicroSecondsPerBeat- microseconds per beatduration- duration of the songbeatsPerMeasure- beats per measure, i.e. numerator inTimeSignature
-
SteadyBeats
public SteadyBeats(long anchorBeat, long microSecondsPerBeat, long duration)Steady beats with unknown time signature (beats per measure).- Parameters:
anchorBeat- one beat defined in microsecondsmicroSecondsPerBeat- microseconds per beatduration- duration of the song
-
SteadyBeats
public SteadyBeats(org.json.simple.JSONObject jsonObject)
-
-
Method Detail
-
getBeatsPerMeasure
public int getBeatsPerMeasure()
Description copied from interface:BeatsBeats per measure.- Specified by:
getBeatsPerMeasurein interfaceBeats- Returns:
- beats per measure or
1if unknown
-
getAnchorBeat
public long getAnchorBeat()
-
getDuration
public long getDuration()
-
getMicroSecondsPerBeat
public long getMicroSecondsPerBeat()
-
listIterator
public ListIterator<Beat> listIterator()
Description copied from interface:BeatsBeats.- Specified by:
listIteratorin interfaceBeats- Returns:
- iterator over beats
-
changeTime
public Beats changeTime(TimeSignature timeSignature)
Description copied from interface:BeatsProvide a view that reflects the given time signature and adjust beat numbers accordingly. If no beat number information is available at all, the provided view may be identical to the original view.- Specified by:
changeTimein interfaceBeats- Parameters:
timeSignature- time signature- Returns:
- beat number adjusted view on the same beats
-
toJSONString
public String toJSONString()
- Specified by:
toJSONStringin interfaceorg.json.simple.JSONAware
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-