[Android] Add the ignore types option in browser

Geoffrey Métais git at videolan.org
Tue Jun 30 10:36:15 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jun 30 09:51:51 2015 +0200| [89edfc61a35c9c762849a5568ec41c7ecec609e2] | committer: Geoffrey Métais

Add the ignore types option in browser

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

 libvlc/src/org/videolan/libvlc/util/MediaBrowser.java |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java b/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java
index 69677f0..bf62fd8 100644
--- a/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java
+++ b/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java
@@ -48,6 +48,9 @@ public class MediaBrowser {
     private EventListener mEventListener;
     private boolean mAlive;
 
+    private static final String IGNORE_LIST_OPTION =  ":ignore-filetypes=";
+    private String mIgnoreList = "db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv,txt,sub,idx,srt,cue,ssa";
+
     /**
      * Listener called when medias are added or removed.
      */
@@ -174,6 +177,7 @@ public class MediaBrowser {
          * so increment ref count in order to don't clean it with the medialist
          */
         media.retain();
+        media.addOption(IGNORE_LIST_OPTION+mIgnoreList);
         reset();
         mBrowserMediaList = media.subItems();
         mBrowserMediaList.setEventListener(mBrowserMediaListEventListener);
@@ -200,6 +204,10 @@ public class MediaBrowser {
         return media;
     }
 
+    public synchronized void setIgnoreFileTypes(String list){
+        mIgnoreList = list;
+    }
+
     private final MediaList.EventListener mBrowserMediaListEventListener = new MediaList.EventListener() {
         @Override
         public void onEvent(MediaList.Event event) {



More information about the Android mailing list