added LoopState.RepeatAgain() function

This commit is contained in:
2025-08-30 15:39:17 +02:00
parent 6fc6cec502
commit 96013554e0

View File

@ -7,6 +7,9 @@ import (
"strings"
)
// LoopState is an integer representing the amount of loops.
// Specially handled values are LoopInfinite, LoopForced and LoopInvalid.
// There is also the alias value LoopNo which is equal to 1
type LoopState int
const (
@ -64,3 +67,8 @@ func (s LoopState) String() string {
return strconv.Itoa(int(s))
}
}
// RepeatAgain returns true if the song will be repeated again after the end of the song is reached
func (s LoopState) RepeatAgain() bool {
return s == LoopInfinite || s == LoopForced || s > LoopNo
}