Commit 37564699 authored by Edward Wang's avatar Edward Wang
Browse files

src: Load the entire directory into the audio controller as a list

parent 83513e6a
......@@ -311,6 +311,13 @@ public class DirectoryAdapter extends BaseAdapter {
);
}
public ArrayList<String> getAllMediaLocations() {
ArrayList<String> a = new ArrayList<String>();
for(int i = 0; i < mCurrentNode.children.size(); i++)
a.add(getMediaLocation(i));
return a;
}
public void clear() {
for(DirectoryAdapter.Node n : this.mCurrentNode.children)
n.children.clear();
......
......@@ -21,7 +21,6 @@
package org.videolan.vlc.gui;
import java.io.IOException;
import java.util.ArrayList;
import org.videolan.vlc.AudioServiceController;
import org.videolan.vlc.LibVLC;
......@@ -70,9 +69,7 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
try {
if(!LibVLC.getExistingInstance().hasVideoTrack(mediaFile)) {
ArrayList<String> arrayList = new ArrayList<String>();
arrayList.add(mDirectoryAdapter.getMediaLocation(p));
audioController.load(arrayList, 0);
audioController.load(mDirectoryAdapter.getAllMediaLocations(), p);
Intent intent = new Intent(getActivity(), AudioPlayerActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment