Miscellaneous improvements
This commit is contained in:
@@ -117,6 +117,14 @@ public class ITPlaylist extends ITObject {
|
||||
Dispatch.put(object, "SongRepeat", repeatMode.ordinal());
|
||||
}
|
||||
|
||||
/**
|
||||
* Cycle repeat modes.
|
||||
*/
|
||||
public void cycleSongRepeat() {
|
||||
int repeat = Dispatch.get(object, "SongRepeat").getInt();
|
||||
Dispatch.put(object, "SongRepeat", (repeat + 1) % 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the playback repeat mode.
|
||||
* @return Returns the playback repeat mode.
|
||||
@@ -150,4 +158,23 @@ public class ITPlaylist extends ITObject {
|
||||
Dispatch tracks = Dispatch.get(object, "Tracks").toDispatch();
|
||||
return new ITTrackCollection(tracks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shuffle state.
|
||||
* @return true if current state is shuffle.
|
||||
*/
|
||||
public boolean getShuffle() {
|
||||
return Dispatch.get(object, "Shuffle").getBoolean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the shuffle state.
|
||||
*/
|
||||
public void toggleShuffle() {
|
||||
setShuffle(!getShuffle());
|
||||
}
|
||||
|
||||
public boolean containsTrack(ITTrack track) {
|
||||
return getTracks().containsTrack(track);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user