[libbluray-devel] TitleContext: post PresentationChangedEvent when clip changes

hpi1 git at videolan.org
Tue Oct 21 10:08:43 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Oct 21 11:03:54 2014 +0300| [fd3412efd217378b2a836b5d3e2414ba91abd803] | committer: hpi1

TitleContext: post PresentationChangedEvent when clip changes

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

 .../bdj/java/org/bluray/ti/selection/TitleContextImpl.java     |    7 +++++++
 .../bdj/java/org/videolan/media/content/playlist/Handler.java  |    8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java b/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java
index cd89eff..1b7a956 100644
--- a/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java
+++ b/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java
@@ -26,6 +26,7 @@ import javax.tv.service.SIManager;
 import javax.tv.service.Service;
 import javax.tv.service.selection.InvalidServiceComponentException;
 import javax.tv.service.selection.NormalContentEvent;
+import javax.tv.service.selection.PresentationChangedEvent;
 import javax.tv.service.selection.PresentationTerminatedEvent;
 import javax.tv.service.selection.SelectionFailedEvent;
 import javax.tv.service.selection.ServiceContentHandler;
@@ -105,6 +106,12 @@ public class TitleContextImpl implements TitleContext {
         }
     }
 
+    public void presentationChanged() {
+        if (state == STATE_STARTED) {
+            postEvent(new PresentationChangedEvent(this));
+        }
+    }
+
     private void postEvent(ServiceContextEvent event)
     {
         listeners.putCallback(event);
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
index 7258fe2..e13661a 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
@@ -30,10 +30,12 @@ import javax.media.IncompatibleSourceException;
 import javax.media.Time;
 import javax.media.protocol.DataSource;
 import javax.tv.locator.InvalidLocatorException;
+import javax.tv.service.selection.ServiceContextFactory;
 
 import org.bluray.media.InvalidPlayListException;
 import org.bluray.net.BDLocator;
 import org.bluray.system.RegisterAccess;
+import org.bluray.ti.selection.TitleContextImpl;
 import org.videolan.BDJAction;
 import org.videolan.BDJActionManager;
 import org.videolan.Libbluray;
@@ -212,6 +214,12 @@ public class Handler extends BDHandler {
     protected void doPlayItemReach(int param) {
         ((PlaybackControlImpl)controls[9]).onPlayItemReach(param);
         ((UOMaskTableControlImpl)controls[16]).onPlayItemReach(param);
+
+        try {
+            ((TitleContextImpl)ServiceContextFactory.getInstance().getServiceContext(null)).presentationChanged();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
     protected void doAngleChange(int param) {



More information about the libbluray-devel mailing list