- All Superinterfaces:
TrackSupplier
Represents a line in a
weights expression. Each entry is something that can supply a track, as it
implements TrackSupplier. This also holds additional options for the weight, such as the amount and unit.
Weight entries all begin with a separator, either | |! or |~, each providing
different behavior. See the Weight Separator docs for more info.-
Method Summary
Modifier and TypeMethodDescriptionbooleanGets if the weight entry can repeat tracks.booleanGets if the weight entry can repeat if chosen twice in a row while playing a collection.Gets a string representation of the track supplier.Gets what supplier the weight entry uses, in the form of theWeightTrackType.doubleGets the amount of weight for this entry.Gets the unit this weight entry was assigned, through the syntax of12xor12%.voidsetCanRepeat(boolean canRepeatTrack) If the weight unit can repeat tracks.voidsetCanRepeatWeight(boolean canRepeatWeight) Sets if the weight entry can repeat if chosen twice in a row while playing a collection.voidsetWeightAmount(double weightAmount) Sets the weight amount fromgetWeightAmount().voidsetWeightUnit(WeightUnit weightUnit) Sets the weight unit fromgetWeightUnit().Methods inherited from interface dev.qilletni.api.music.supplier.TrackSupplier
getAllTracks, getTrack, isInconsistent
-
Method Details
-
getWeightAmount
double getWeightAmount()Gets the amount of weight for this entry. This pairs with the unit fromgetWeightUnit(). If the unit isWeightUnit.MULTIPLIER, the track will be played this many times more than normal in the collection. If it is aWeightUnit.PERCENT, it will play the track this number of percent of times any track is played.- Returns:
- The weight amount
-
setWeightAmount
void setWeightAmount(double weightAmount) Sets the weight amount fromgetWeightAmount().- Parameters:
weightAmount- The amount to set the weight to
-
getWeightUnit
WeightUnit getWeightUnit()Gets the unit this weight entry was assigned, through the syntax of12xor12%.- Returns:
- The unit of the weight entry
-
setWeightUnit
Sets the weight unit fromgetWeightUnit().- Parameters:
weightUnit- The unit of the weight entry
-
setCanRepeat
void setCanRepeat(boolean canRepeatTrack) If the weight unit can repeat tracks. This is true if the separator used is|!- Parameters:
canRepeatTrack- If the track can be repeated
-
getCanRepeatTrack
boolean getCanRepeatTrack()Gets if the weight entry can repeat tracks. This is true if the separator used is|!- Returns:
- If the track can be repeated
-
setCanRepeatWeight
void setCanRepeatWeight(boolean canRepeatWeight) Sets if the weight entry can repeat if chosen twice in a row while playing a collection. This is true if the separator used is|or|!- Parameters:
canRepeatWeight- If the weight entry can be repeated
-
getCanRepeatWeight
boolean getCanRepeatWeight()Gets if the weight entry can repeat if chosen twice in a row while playing a collection. This is true if the separator used is|or|!- Returns:
- If the weight entry can be repeated
-
getTrackType
WeightTrackType getTrackType()Gets what supplier the weight entry uses, in the form of theWeightTrackType.- Returns:
- The type of track supplier
-
getTrackStringValue
String getTrackStringValue()Gets a string representation of the track supplier. This is typically only used for logging or display purposes. It may not include all information about the track supplier.- Returns:
- A string representation of the track supplier
-