use of com.frostwire.android.core.player.PlaylistItem in project frostwire by frostwire.
the class Librarian method createEphemeralPlaylist.
public EphemeralPlaylist createEphemeralPlaylist(final Context context, FileDescriptor fd) {
List<FileDescriptor> fds = getFiles(context, Constants.FILE_TYPE_AUDIO, FilenameUtils.getPath(fd.filePath), false);
if (fds.size() == 0) {
// just in case
Log.w(TAG, "Logic error creating ephemeral playlist");
fds.add(fd);
}
EphemeralPlaylist playlist = new EphemeralPlaylist(fds);
playlist.setNextItem(new PlaylistItem(fd));
return playlist;
}
use of com.frostwire.android.core.player.PlaylistItem in project frostwire by frostwire.
the class ApolloMediaPlayer method play.
@Override
public void play(Playlist playlist) {
List<PlaylistItem> items = playlist.getItems();
idMap.clear();
long[] list = new long[items.size()];
int position = 0;
PlaylistItem currentItem = playlist.getCurrentItem();
for (int i = 0; i < items.size(); i++) {
PlaylistItem item = items.get(i);
list[i] = item.getFD().id;
idMap.put((long) item.getFD().id, item.getFD());
if (currentItem != null && currentItem.getFD().id == item.getFD().id) {
position = i;
}
}
MusicUtils.playAll(list, position, false);
}
Aggregations