Author: jerome
Date: 2008-08-14 13:22:25 +0200 (Thu, 14 Aug 2008)
New Revision: 1486

Added:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/dll/
Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/.classpath
   
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/main/WMPlayer.java
Log:


Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/.classpath
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/.classpath
 2008-08-14 11:11:07 UTC (rev 1485)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/.classpath
 2008-08-14 11:22:25 UTC (rev 1486)
@@ -6,5 +6,6 @@
        <classpathentry kind="lib" path="X10Gimli/X10Gimli.jar"/>
        <classpathentry combineaccessrules="false" kind="src" 
path="/karmalab-commons"/>
        <classpathentry combineaccessrules="false" kind="src" 
path="/tuxdroid-gadget-framework"/>
+       <classpathentry combineaccessrules="false" kind="src" path="/TuxAPI"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/main/WMPlayer.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/main/WMPlayer.java
     2008-08-14 11:11:07 UTC (rev 1485)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-WMP/trunk/tuxdroid-gadget-WMP/src/main/WMPlayer.java
     2008-08-14 11:22:25 UTC (rev 1486)
@@ -6,26 +6,13 @@
 import java.awt.Toolkit;
 import java.awt.event.KeyEvent;
 import java.io.*;
-/*
-import java.io.File;
- 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter; 
- */
-import javax.swing.JOptionPane;
 
-import main.noDongleException;
-import main.noRadioException;
-import main.noConnectionException;
-
 import X10Gimli.Native.WindowsAPI;
 
 import com.kysoh.tuxdroid.gadget.framework.gadget.SimpleGadget;
 import com.kysoh.tuxdroid.gadget.framework.gadget.SimpleGadgetConfiguration;
 import com.tuxisalive.api.TuxAPI;
 import com.tuxisalive.api.TuxAPIConst;
-import com.tuxisalive.api.TuxAPIMisc;
 
 import net.karmaLab.po.*;
 
@@ -72,11 +59,6 @@
           public String getMediaPath(){
                   return this.mediaPath;
           }
-          
-
-          
-      
-          
        }
 
 
@@ -97,23 +79,14 @@
         
         
         try{
-            connectToServer("localhost", 270, "test", "myPasswd", 3.0);
+            connectToServer("127.0.0.1", 270, "media_gadget", "media", 3.0);
                        }
-               catch(noConnectionException e)
+               catch(Exception e)
                        {
-                       throwMessageNotification(i18n.tr("Error")+" 
"+e.getMessage());
-                       tux.destroy();
-                       System.exit(0);
+                               throwMessageNotification(i18n.tr("Error")+" 
"+e.getMessage());
+                               tux.destroy();
                        }
-               catch(noDongleException e){
-                       throwMessageNotification(i18n.tr("Warning")+": 
"+e.getMessage());
                
-                       }
-               catch(noRadioException e){
-                       throwMessageNotification(i18n.tr("Warning")+": 
"+e.getMessage());
-                       
-                       }
-               
                // We register an event handler on keypressed or released from 
tux
                
                tux.button.remote.registerEventOnPressed(this, 
"remote_button",null);
@@ -176,7 +149,7 @@
                        catch (Exception e) 
                        {
                                throwMessageNotification(i18n.tr("Error")+": 
("+e.getMessage()+")");
-                               return handle;
+                               System.exit(0);
                        }
                }
                
@@ -464,8 +437,6 @@
         * @param cmd The path and argument of the program
         * 
         */
-
-       
        private void launchExtProgram(String cmd){
                
                try
@@ -489,13 +460,13 @@
 
                } catch (IOException e) {
                        throwMessageNotification(i18n.tr("Error")+" 
("+e.getMessage()+")");
-               }
-               
+               }       
 }
 
 
        
-       public void connectToServer(String address, int port,String login, 
String password, double timeout) throws noConnectionException, 
noRadioException, noDongleException{
+       public void connectToServer(String address, int port,String login, 
String password, double timeout) 
+                                                                               
                                        throws Exception{
 
        
        tux = new TuxAPI(address,port);
@@ -522,30 +493,25 @@
                                        
                                }
                        else{
-                               throw new noRadioException(i18n.tr("Dongle 
isn't connected to Tuxdroid"));
+                               throw new Exception(i18n.tr("Dongle isn't 
connected to Tuxdroid"));
                                }
                                
                        
                        }
                else{
                        tux.access.acquire(TuxAPIConst.ACCESS_PRIORITY_HIGH);
-                       throw new noDongleException(i18n.tr("Server can't 
connect to the dongle"));
+                       throw new Exception(i18n.tr("Server can't connect to 
the dongle"));
                        }
                }
        else{
-               throw new noConnectionException(i18n.tr("Can't connect to the 
server"));
+               throw new Exception(i18n.tr("Can't connect to the server"));
                }
        }
        
        
        /**
-        * Function is called by a handler when a remote button is pressed
-        * 
-        *  
-        * 
+        * Function called by a handler when a remote button is pressed
         * */
-
-       
        public void remote_button(String value, Double delay)
        {
                //String str = String.format("OnRemoteButton %s %f", value, 
delay);
@@ -609,9 +575,7 @@
                }
                
        }
-
        
-       
        //HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Media\Windows Media 
Player\shell\open\command
        
          private static final String REGQUERY_UTIL = "reg query ";
@@ -671,37 +635,5 @@
                  }
          }    
            
-                       
-         
-       
 
-
-
-}
-
-
-
-class noConnectionException extends Exception{
-       
-       public noConnectionException(String message)
-       {
-               super(message); 
-       }
-}
-       
-class noRadioException extends Exception{
-               
-               public noRadioException(String message)
-               {
-                       super(message); 
-               }
-}
-
-class noDongleException extends Exception{
-       
-       public noDongleException(String message)
-       {
-               super(message); 
-       }
-}
-
+}
\ No newline at end of file


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to