Commit f81819ff authored by Thomas Guillem's avatar Thomas Guillem
Browse files

libvlc: remove unused mPrimaryList

parent 15ecefcc
......@@ -68,7 +68,6 @@ public class LibVLC {
private long mInternalMediaPlayerInstance = 0; // Read-only, reserved for JNI
private MediaList mMediaList; // Pointer to media list being followed
private MediaList mPrimaryList; // Primary/default media list; see getPrimaryMediaList()
/** Buffer for VLC messages */
private StringBuffer mDebugLogBuffer;
......@@ -221,40 +220,6 @@ public class LibVLC {
return mMediaList;
}
/**
* Set the media list for LibVLC to follow.
*
* @param mediaList The media list object to follow
*/
public void setMediaList(MediaList mediaList) {
mMediaList = mediaList;
}
/**
* Sets LibVLC to follow the default media list (see below)
*/
public void setMediaList() {
mMediaList = mPrimaryList;
}
/**
* Gets the primary media list, or the "currently playing" list.
* Not to be confused with the media list pointer from above, which
* refers the the MediaList object that libVLC is currently following.
* This list is just one out of many lists that it can be pointed towards.
*
* This list will be used for lists of songs that are not user-defined.
* For example: selecting a song from the Songs list, or from the list
* displayed after selecting an album.
*
* It is loaded as the default list.
*
* @return The primary media list
*/
public MediaList getPrimaryMediaList() {
return mPrimaryList;
}
/**
* Give to LibVLC the surface to draw the video.
* @param f the surface to draw
......@@ -539,7 +504,7 @@ public class LibVLC {
File cacheDir = context.getCacheDir();
mCachePath = (cacheDir != null) ? cacheDir.getAbsolutePath() : null;
nativeInit();
mMediaList = mPrimaryList = new MediaList(this);
mMediaList = new MediaList(this);
setEventHandler(EventHandler.getInstance());
mIsInitialized = true;
}
......
......@@ -1183,8 +1183,7 @@ public class AudioService extends Service {
mEventHandler.addHandler(mVlcEventHandler);
mLibVLC.getMediaList().getEventHandler().removeHandler(mListEventHandler);
mLibVLC.setMediaList();
mLibVLC.getPrimaryMediaList().clear();
mLibVLC.getMediaList().clear();
MediaList mediaList = mLibVLC.getMediaList();
mPrevious.clear();
......
......@@ -56,18 +56,18 @@ public class HistoryAdapter extends BaseAdapter {
return;
}
EventHandler em = mLibVLC.getPrimaryMediaList().getEventHandler();
EventHandler em = mLibVLC.getMediaList().getEventHandler();
em.addHandler(new HistoryEventHandler(this));
}
@Override
public int getCount() {
return mLibVLC.getPrimaryMediaList().size();
return mLibVLC.getMediaList().size();
}
@Override
public Object getItem(int arg0) {
return mLibVLC.getPrimaryMediaList().getMRL(arg0);
return mLibVLC.getMediaList().getMRL(arg0);
}
@Override
......@@ -94,7 +94,7 @@ public class HistoryAdapter extends BaseAdapter {
holder = (DirectoryAdapter.DirectoryViewHolder) v.getTag();
String holderText = "";
Media m = mLibVLC.getPrimaryMediaList().getMedia(position);
Media m = mLibVLC.getMediaList().getMedia(position);
if (m == null )
return v;
......
......@@ -115,7 +115,6 @@ public class HistoryFragment extends ListFragment implements IBrowser, IRefresha
private void playListIndex(int position) {
AudioServiceController audioController = AudioServiceController.getInstance();
LibVLC.getExistingInstance().setMediaList();
audioController.playIndex(position);
}
......@@ -132,7 +131,7 @@ public class HistoryFragment extends ListFragment implements IBrowser, IRefresha
playListIndex(info.position);
return true;
} else if(id == R.id.history_view_delete) {
LibVLC.getExistingInstance().getPrimaryMediaList().remove(info.position);
LibVLC.getExistingInstance().getMediaList().remove(info.position);
mHistoryAdapter.refresh();
return true;
}
......
......@@ -2331,11 +2331,9 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
updateNavStatus();
} else if (savedIndexPosition > -1) {
AudioServiceController.getInstance().stop(); // Stop the previous playback.
mLibVLC.setMediaList();
mLibVLC.playIndex(savedIndexPosition);
} else if (mLocation != null && mLocation.length() > 0 && !dontParse) {
AudioServiceController.getInstance().stop(); // Stop the previous playback.
mLibVLC.setMediaList();
mLibVLC.getMediaList().add(new Media(mLibVLC, mLocation));
savedIndexPosition = mLibVLC.getMediaList().size() - 1;
mLibVLC.playIndex(savedIndexPosition);
......
Markdown is supported
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