[libbluray-devel] Implement DiscManager.{add, remove}DiscStatusEventListener
hpi1
git at videolan.org
Sun Mar 10 21:07:36 CET 2013
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Mar 10 22:05:50 2013 +0200| [00ac510efdd4170811e6dbe372fa6db9d8f00253] | committer: hpi1
Implement DiscManager.{add,remove}DiscStatusEventListener
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=00ac510efdd4170811e6dbe372fa6db9d8f00253
---
src/libbluray/bdj/java/org/bluray/ti/DiscManager.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/java/org/bluray/ti/DiscManager.java b/src/libbluray/bdj/java/org/bluray/ti/DiscManager.java
index 6ea131c..2e30af9 100644
--- a/src/libbluray/bdj/java/org/bluray/ti/DiscManager.java
+++ b/src/libbluray/bdj/java/org/bluray/ti/DiscManager.java
@@ -19,6 +19,8 @@
package org.bluray.ti;
+import java.util.LinkedList;
+
public class DiscManager {
public static synchronized DiscManager getDiscManager() {
if (instance == null)
@@ -35,17 +37,22 @@ public class DiscManager {
}
public void addDiscStatusEventListener(DiscStatusListener listener) {
- org.videolan.Logger.unimplemented(DiscManager.class.getName(), "addDiscStatusEventListener");
+ synchronized(listeners) {
+ listeners.add(listener);
+ }
}
public void removeDiscStatusEventListener(DiscStatusListener listener) {
- org.videolan.Logger.unimplemented(DiscManager.class.getName(), "removeDiscStatusEventListener");
+ synchronized(listeners) {
+ listeners.remove(listener);
+ }
}
public void setCurrentDisc(String id) {
disc = new DiscImpl(id);
}
+ private LinkedList listeners = new LinkedList();
private static DiscManager instance;
private DiscImpl disc = null;
}
More information about the libbluray-devel
mailing list