[Android] AudioService: add remove

Edward Wang git at videolan.org
Thu Jan 23 23:42:01 CET 2014


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Jan 23 17:33:36 2014 -0500| [948f7db1fb280c3d3218ecb7be8dbdb0e369e07e] | committer: Edward Wang

AudioService: add remove

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

 vlc-android/src/org/videolan/vlc/AudioService.java          |   11 +++++++++++
 .../src/org/videolan/vlc/AudioServiceController.java        |    6 ++++++
 .../src/org/videolan/vlc/interfaces/IAudioService.aidl      |    3 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index f5840df..ea89852 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -503,12 +503,18 @@ public class AudioService extends Service {
                 index = msg.getData().getInt("item_index");
                 if(service.mCurrentIndex >= index && !expanding)
                     service.mCurrentIndex++;
+
+                service.determinePrevAndNextIndices();
+                service.executeUpdate();
                 break;
             case EventHandler.CustomMediaListItemDeleted:
                 Log.i(TAG, "CustomMediaListItemDeleted");
                 index = msg.getData().getInt("item_index");
                 if(service.mCurrentIndex >= index && !expanding)
                     service.mCurrentIndex--;
+
+                service.determinePrevAndNextIndices();
+                service.executeUpdate();
                 break;
             case EventHandler.CustomMediaListItemMoved:
                 Log.i(TAG, "CustomMediaListItemMoved");
@@ -1201,6 +1207,11 @@ public class AudioService extends Service {
         }
 
         @Override
+        public void remove(int position) {
+            mLibVLC.getMediaList().remove(position);
+        }
+
+        @Override
         public List<String> getMediaLocations() {
             ArrayList<String> medias = new ArrayList<String>();
             for (int i = 0; i < mLibVLC.getMediaList().size(); i++) {
diff --git a/vlc-android/src/org/videolan/vlc/AudioServiceController.java b/vlc-android/src/org/videolan/vlc/AudioServiceController.java
index 1e4b652..a375bef 100644
--- a/vlc-android/src/org/videolan/vlc/AudioServiceController.java
+++ b/vlc-android/src/org/videolan/vlc/AudioServiceController.java
@@ -255,6 +255,12 @@ public class AudioServiceController implements IAudioPlayerControl {
                 new Object[] { positionStart, positionEnd } );
     }
 
+    public void remove(int position) {
+        remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "remove",
+                new Class<?>[] { int.class },
+                new Object[] { position } );
+    }
+
     @SuppressWarnings("unchecked")
     public List<String> getMediaLocations() {
         List<String> def = new ArrayList<String>();
diff --git a/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl b/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
index a316c40..d03b015 100644
--- a/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
+++ b/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * IAudioService.aidl
  *****************************************************************************
- * Copyright © 2011-2012 VLC authors and VideoLAN
+ * Copyright © 2011-2014 VLC authors and VideoLAN
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@ interface IAudioService {
     void load(in List<String> mediaPathList, int position, boolean noVideo);
     void append(in List<String> mediaPathList);
     void moveItem(int positionStart, int positionEnd);
+    void remove(int position);
     List<String> getMediaLocations();
     String getCurrentMediaLocation();
     boolean isPlaying();



More information about the Android mailing list