Author: jerome
Date: 2009-03-11 18:05:46 +0100 (Wed, 11 Mar 2009)
New Revision: 3961

Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/com/kysoh/tuxdroid/Configuration.java
Log:
* Added a filter while creating the playlist ( do not include unusual files ).

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/com/kysoh/tuxdroid/Configuration.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/com/kysoh/tuxdroid/Configuration.java
  2009-03-11 15:42:20 UTC (rev 3960)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/com/kysoh/tuxdroid/Configuration.java
  2009-03-11 17:05:46 UTC (rev 3961)
@@ -33,6 +33,7 @@
     private String mediaPath = "";
     private boolean userPlaylist = true;
     private boolean stopWMPToo = true;
+    private String[] accept = new String[]{".avi", ".flv", ".mpg", ".mp4", 
".wmv", ".wma" ,".mp3", ".ogg", ".m3u"};
 
     /**
         * This method set the local variable mediaPath. 
@@ -54,8 +55,17 @@
                //List files into directory to prepare the command line.
                for(File musicFile : dir.listFiles())
                {
-                       if(musicFile.getAbsolutePath().contains("."))
+                       boolean canAdd = false;
+                       for(String str : accept)
                        {
+                               if(musicFile.getAbsolutePath().endsWith(str))
+                               {
+                                       canAdd = true;
+                                       break;
+                               }
+                       }
+                       if(canAdd)
+                       {
                                args.add("\"" + musicFile.getAbsolutePath() + 
"\"");
                        }
                }


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to