Quellcode durchsuchen

Fixes issue 1487.


git-svn-id: http://svn.dmdirc.com/trunk@4639 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6.3m1rc1
Shane Mc Cormack vor 16 Jahren
Ursprung
Commit
e9602f87c5

+ 13
- 0
src/com/dmdirc/addons/mediasource_dcop/AmarokSource.java Datei anzeigen

55
         return Boolean.parseBoolean(result);
55
         return Boolean.parseBoolean(result);
56
     }
56
     }
57
     
57
     
58
+    /** {@inheritDoc} */
59
+    @Override
60
+    public boolean isStopped() {
61
+        final String result = DcopPlugin.getDcopResult(
62
+                "dcop amarok player status").get(0);
63
+        
64
+        try {
65
+            return (Integer.parseInt(result) == 0);
66
+        } catch (NumberFormatException nfe) {
67
+            return false;
68
+        }
69
+    }
70
+    
58
     /** {@inheritDoc} */
71
     /** {@inheritDoc} */
59
     @Override
72
     @Override
60
     public String getAppName() {
73
     public String getAppName() {

+ 9
- 1
src/com/dmdirc/addons/mediasource_dcop/KaffeineSource.java Datei anzeigen

38
     }
38
     }
39
     
39
     
40
     /** {@inheritDoc} */
40
     /** {@inheritDoc} */
41
-    public boolean isRunning() {        
41
+    public boolean isRunning() {
42
         return DcopPlugin.getDcopResult("dcop kaffeine KaffeineIface isPlaying").size() > 0;
42
         return DcopPlugin.getDcopResult("dcop kaffeine KaffeineIface isPlaying").size() > 0;
43
     }
43
     }
44
     
44
     
45
     /** {@inheritDoc} */
45
     /** {@inheritDoc} */
46
     public boolean isPlaying() {
46
     public boolean isPlaying() {
47
+        // This also returns true for paused, which makes it rather useless!
48
+        final String result = DcopPlugin.getDcopResult("dcop kaffeine KaffeineIface isPlaying").get(0);
49
+        
50
+        return Boolean.parseBoolean(result);
51
+    }
52
+    
53
+    /** {@inheritDoc} */
54
+    public boolean isStopped() {
47
         final String result = DcopPlugin.getDcopResult("dcop kaffeine KaffeineIface isPlaying").get(0);
55
         final String result = DcopPlugin.getDcopResult("dcop kaffeine KaffeineIface isPlaying").get(0);
48
         
56
         
49
         return Boolean.parseBoolean(result);
57
         return Boolean.parseBoolean(result);

+ 8
- 0
src/com/dmdirc/addons/mediasource_dcop/NoatunSource.java Datei anzeigen

50
         return "2".equals(result.trim());
50
         return "2".equals(result.trim());
51
     }
51
     }
52
     
52
     
53
+    /** {@inheritDoc} */
54
+    public boolean isStopped() {
55
+        final String result = DcopPlugin.getDcopResult(
56
+                "dcop noatun Noatun state").get(0);
57
+        
58
+        return "0".equals(result.trim());
59
+    }
60
+    
53
     /** {@inheritDoc} */
61
     /** {@inheritDoc} */
54
     public String getAppName() {
62
     public String getAppName() {
55
         return "Noatun";
63
         return "Noatun";

+ 7
- 0
src/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePlugin.java Datei anzeigen

60
     public boolean isPlaying() {
60
     public boolean isPlaying() {
61
         return information.get("state").equalsIgnoreCase("playing");
61
         return information.get("state").equalsIgnoreCase("playing");
62
     }
62
     }
63
+    
64
+
65
+    /** {@inheritDoc} */
66
+    @Override    
67
+    public boolean isStopped() {
68
+        return information.get("state").equalsIgnoreCase("stop");
69
+    }
63
 
70
 
64
     /** {@inheritDoc} */
71
     /** {@inheritDoc} */
65
     @Override    
72
     @Override    

+ 5
- 0
src/com/dmdirc/addons/mediasource_windows/DllSource.java Datei anzeigen

83
 		return getOutput("getPlayState").equalsIgnoreCase("playing");
83
 		return getOutput("getPlayState").equalsIgnoreCase("playing");
84
 	}
84
 	}
85
 	
85
 	
86
+	/** {@inheritDoc} */
87
+	public boolean isStopped() {
88
+		return getOutput("getPlayState").equalsIgnoreCase("stopped");
89
+	}
90
+	
86
 	/** {@inheritDoc} */
91
 	/** {@inheritDoc} */
87
 	public String getArtist() {
92
 	public String getArtist() {
88
 		if (useArtistTitle) {
93
 		if (useArtistTitle) {

+ 6
- 0
src/com/dmdirc/addons/nowplaying/ConfigPanel.java Datei anzeigen

256
             return true;
256
             return true;
257
         }
257
         }
258
 
258
 
259
+        /** {@inheritDoc} */
260
+        @Override
261
+        public boolean isStopped() {
262
+            return false;
263
+        }
264
+
259
         /** {@inheritDoc} */
265
         /** {@inheritDoc} */
260
         @Override
266
         @Override
261
         public String getAppName() {
267
         public String getAppName() {

+ 8
- 0
src/com/dmdirc/addons/nowplaying/MediaSource.java Datei anzeigen

44
      */
44
      */
45
     boolean isPlaying();
45
     boolean isPlaying();
46
     
46
     
47
+    /**
48
+     * Determine if this source is stopped or not.
49
+     * 
50
+     * @return True if this source is stopped, false otherwise
51
+     * @since 0.6.3
52
+     */
53
+    boolean isStopped();
54
+    
47
     /**
55
     /**
48
      * Retrieves the name of the application that this source is for.
56
      * Retrieves the name of the application that this source is for.
49
      * 
57
      * 

Laden…
Abbrechen
Speichern