Author: ulhume
Date: 2008-08-02 13:14:45 +0200 (Sat, 02 Aug 2008)
New Revision: 1444

Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/gadgets.xml
   
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/sources/net/karmaLab/tuxDroid/gadgets/MPDGadget.java
Log:
removed service behavior
removed deprecated calls

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/gadgets.xml
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/gadgets.xml
        2008-08-02 11:14:20 UTC (rev 1443)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/gadgets.xml
        2008-08-02 11:14:45 UTC (rev 1444)
@@ -10,7 +10,6 @@
                        <author>Y. Brault (C) http://artisan.karma-lab.net 
2008</author>
                        <version>1.0</version>
                        <iconFile>resources/MPDGadget.png</iconFile>
-                       <executionMode>service</executionMode>
                        <uuid>f63af23e-7ae0-4389-b89b-bc5a8185b0b4</uuid>
                </description>
                <parameters>
@@ -25,5 +24,9 @@
                                type="integer"
                                defaultValue="6600" />
                </parameters>
+               <commands>
+                       <command name="play" description="Play"/>
+                       <command name="stop" description="Stop playing"/>
+               </commands>
        </gadget>
 </gadgets>
\ No newline at end of file

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/sources/net/karmaLab/tuxDroid/gadgets/MPDGadget.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/sources/net/karmaLab/tuxDroid/gadgets/MPDGadget.java
       2008-08-02 11:14:20 UTC (rev 1443)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-mpd/trunk/tuxdroid-gadget-mpd/sources/net/karmaLab/tuxDroid/gadgets/MPDGadget.java
       2008-08-02 11:14:45 UTC (rev 1444)
@@ -22,9 +22,6 @@
 
 package net.karmaLab.tuxDroid.gadgets;
 
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
 import org.bff.javampd.MPD;
 import org.bff.javampd.MPDPlayer;
 
@@ -62,28 +59,21 @@
        }
 
        public static void main(String[] args) throws Exception {
-               new MPDGadget().boot(new Configuration());
+               new MPDGadget().boot(args, new Configuration());
        }
 
        @Override
        public void start() throws SimpleGadgetException {
                try {
+                       throwTrace("Command : " + getCommand());
+                       throwTrace(configuration().host + ":" + 
configuration().port);
                        MPD mpd = new MPD(configuration().host, 
configuration().port);
                        MPDPlayer client = mpd.getMPDPlayer();
 
-                       throwTrace(configuration().host + ":" + 
configuration().port);
-                       BufferedReader reader = new BufferedReader(new 
InputStreamReader(System.in));
-                       while (true) {
-                               throwTrace("Waiting for command");
-                               String command = reader.readLine();
-                               throwTrace("New command " + command);
-                               if (command.equals("play")) {
-                                       client.play();
-                               } else if (command.equals("stop")) {
-                                       client.stop();
-                               } else if (command.equals("quit")) {
-                                       System.exit(0);
-                               }
+                       if (getCommand().equals("play")) {
+                               client.play();
+                       } else if (getCommand().equals("stop")) {
+                               client.stop();
                        }
 
                } catch (Exception e) {


-------------------------------------------------------------------------
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