added LoopState.RepeatAgain() function
This commit is contained in:
		@ -7,6 +7,9 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"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
 | 
					type LoopState int
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@ -64,3 +67,8 @@ func (s LoopState) String() string {
 | 
				
			|||||||
		return strconv.Itoa(int(s))
 | 
							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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user