[Android] A better name for realPlaylist

Edward Wang git at videolan.org
Wed Aug 29 02:47:51 CEST 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Tue Aug 28 20:47:38 2012 -0400| [558608b7343023ae83736e2faa21f3e32271452d] | committer: Edward Wang

A better name for realPlaylist

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=558608b7343023ae83736e2faa21f3e32271452d
---

 vlc-android/src/org/videolan/vlc/AudioService.java |   22 +++++++++++++-------
 .../org/videolan/vlc/AudioServiceController.java   |    4 ++--
 .../org/videolan/vlc/interfaces/IAudioService.aidl |    2 +-
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index c0e2fb3..b948ac8 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -86,7 +86,13 @@ public class AudioService extends Service {
     private long mHeadsetDownTime = 0;
     private long mHeadsetUpTime = 0;
 
-    private boolean mRealPlaylist = false;
+    /**
+     * Distinguish between the "fake" (Java-backed) playlist versus the "real"
+     * (LibVLC/LibVLCcore) backed playlist.
+     *
+     * True if being backed by LibVLC, false if "virtually" backed by Java.
+     */
+    private boolean mLibVLCPlaylistActive = false;
 
     @Override
     public void onCreate() {
@@ -423,7 +429,7 @@ public class AudioService extends Service {
                 return;
             }
         }
-        if(mRealPlaylist) {
+        if(mLibVLCPlaylistActive) {
             if(mRepeating == RepeatType.None)
                 mLibVLC.next();
             else if(mRepeating == RepeatType.Once)
@@ -446,7 +452,7 @@ public class AudioService extends Service {
             mCurrentMedia = mMediaList.get(index - 1);
         else
             return;
-        if(mRealPlaylist) {
+        if(mLibVLCPlaylistActive) {
             if(mRepeating == RepeatType.None)
                 mLibVLC.previous();
             else if(mRepeating == RepeatType.Once)
@@ -652,9 +658,9 @@ public class AudioService extends Service {
         }
 
         @Override
-        public void load(List<String> mediaPathList, int position, boolean realPlaylist)
+        public void load(List<String> mediaPathList, int position, boolean libvlcBacked)
                 throws RemoteException {
-            mRealPlaylist = realPlaylist;
+            mLibVLCPlaylistActive = libvlcBacked;
 
             Log.v(TAG, "Loading position " + ((Integer)position).toString() + " in " + mediaPathList.toString());
             mEventManager.addHandler(mEventHandler);
@@ -662,7 +668,7 @@ public class AudioService extends Service {
             mMediaList.clear();
             mPrevious.clear();
 
-            if(realPlaylist) {
+            if(mLibVLCPlaylistActive) {
                 for(int i = 0; i < mediaPathList.size(); i++)
                     mMediaList.add(new Media(mediaPathList.get(i), i));
             } else {
@@ -683,7 +689,7 @@ public class AudioService extends Service {
             }
 
             if (mCurrentMedia != null) {
-                if(realPlaylist) {
+                if(mLibVLCPlaylistActive) {
                     mLibVLC.playIndex(position);
                 } else {
                     mLibVLC.readMedia(mCurrentMedia.getLocation());
@@ -733,7 +739,7 @@ public class AudioService extends Service {
                 return;
             }
 
-            if(mRealPlaylist) {
+            if(mLibVLCPlaylistActive) {
                 return;
             }
             DatabaseManager db = DatabaseManager.getInstance(AudioService.this);
diff --git a/vlc-android/src/org/videolan/vlc/AudioServiceController.java b/vlc-android/src/org/videolan/vlc/AudioServiceController.java
index ab9fbb0..5adfad7 100644
--- a/vlc-android/src/org/videolan/vlc/AudioServiceController.java
+++ b/vlc-android/src/org/videolan/vlc/AudioServiceController.java
@@ -212,10 +212,10 @@ public class AudioServiceController implements IAudioPlayerControl {
         load(mediaPathList, position, false);
     }
 
-    public void load(List<String> mediaPathList, int position, boolean realPlaylist) {
+    public void load(List<String> mediaPathList, int position, boolean libvlcBacked) {
         remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "load",
                 new Class<?>[] { List.class, int.class, boolean.class },
-                new Object[] { mediaPathList, position, realPlaylist } );
+                new Object[] { mediaPathList, position, libvlcBacked } );
     }
 
     public void append(List<String> mediaPathList) {
diff --git a/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl b/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
index a91ac43..a6e043f 100644
--- a/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
+++ b/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
@@ -30,7 +30,7 @@ interface IAudioService {
     void shuffle();
     void setTime(long time);
     String getCurrentMediaLocation();
-    void load(in List<String> mediaPathList, int position, boolean realPlaylist);
+    void load(in List<String> mediaPathList, int position, boolean libvlcBacked);
     void append(in List<String> mediaPathList);
     List<String> getItems();
     String getItem();



More information about the Android mailing list