implement ability to jump by queue position/id
This commit is contained in:
parent
669bf3f4b8
commit
eda55a01bb
@ -1898,4 +1898,19 @@ public final class PlaybackService extends Service
|
|||||||
{
|
{
|
||||||
return mTimeline.getLength();
|
return mTimeline.getLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns 'Song' with given id from timeline
|
||||||
|
*/
|
||||||
|
public Song getSongByQueuePosition(int id) {
|
||||||
|
return mTimeline.getSongByQueuePosition(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void jumpToQueuePosition(int id) {
|
||||||
|
pause();
|
||||||
|
mTimeline.setCurrentQueuePosition(id);
|
||||||
|
setCurrentSong(0);
|
||||||
|
play();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -558,6 +558,21 @@ public final class SongTimeline {
|
|||||||
mShuffledSongs = null;
|
mShuffledSongs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hard-Jump to given queue position
|
||||||
|
*/
|
||||||
|
public Song setCurrentQueuePosition(int pos) {
|
||||||
|
mCurrentPos = pos;
|
||||||
|
return getSong(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns 'Song' at given position in queue
|
||||||
|
*/
|
||||||
|
public Song getSongByQueuePosition(int id) {
|
||||||
|
return mSongs.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move to the next or previous song or album.
|
* Move to the next or previous song or album.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user