[libbluray-devel] EventManager: add correct time to emitted UserEvent objects.

hpi1 git at videolan.org
Sat Dec 21 08:52:25 CET 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Dec 19 10:29:50 2013 +0200| [f1ab88b66870f93cb935ee14eb3744fbbbbc046b] | committer: hpi1

EventManager: add correct time to emitted UserEvent objects.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=f1ab88b66870f93cb935ee14eb3744fbbbbc046b
---

 src/libbluray/bdj/java/org/dvb/event/EventManager.java |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/libbluray/bdj/java/org/dvb/event/EventManager.java b/src/libbluray/bdj/java/org/dvb/event/EventManager.java
index 3b89f0a..8364b67 100644
--- a/src/libbluray/bdj/java/org/dvb/event/EventManager.java
+++ b/src/libbluray/bdj/java/org/dvb/event/EventManager.java
@@ -131,8 +131,11 @@ public class EventManager implements ResourceServer {
     }
 
     public boolean receiveKeyEventN(int type, int modifiers, int keyCode) {
+
+        UserEvent ue = new UserEvent(this, 1, type, keyCode, modifiers, System.currentTimeMillis());
         HScene focusHScene = GUIManager.getInstance().getFocusHScene();
         boolean result = false;
+
         if (focusHScene != null) {
             BDJXletContext context = focusHScene.getXletContext();
             for (Iterator it = exclusiveAWTEventListener.iterator(); it.hasNext(); ) {
@@ -163,7 +166,7 @@ public class EventManager implements ResourceServer {
                     (evt.getCode() == keyCode) &&
                     (evt.getType() == type)) {
 
-                    BDJActionManager.getInstance().putCallback(new UserEventAction(item, i));
+                    BDJActionManager.getInstance().putCallback(new UserEventAction(item, ue));
                     return true;
                 }
             }
@@ -179,7 +182,7 @@ public class EventManager implements ResourceServer {
                 if ((evt.getFamily() == UserEvent.UEF_KEY_EVENT) &&
                     (evt.getCode() == keyCode) &&
                     (evt.getType() == type)) {
-                    BDJActionManager.getInstance().putCallback(new UserEventAction(item, i));
+                    BDJActionManager.getInstance().putCallback(new UserEventAction(item, ue));
                     result = true;
                 }
             }
@@ -245,18 +248,18 @@ public class EventManager implements ResourceServer {
     }
 
     private class UserEventAction extends BDJAction {
-        public UserEventAction(UserEventItem item, int event) {
+        public UserEventAction(UserEventItem item, UserEvent event) {
             super(item.context);
             this.item = item;
             this.event = event;
         }
 
         protected void doAction() {
-            item.listener.userEventReceived(item.userEvents.getUserEvent()[event]);
+            item.listener.userEventReceived(event);
         }
 
         private UserEventItem item;
-        private int event;
+        private UserEvent event;
     }
 
     private LinkedList exclusiveUserEventListener = new LinkedList();



More information about the libbluray-devel mailing list