Commit 4d2703ad authored by Petri Hintukainen's avatar Petri Hintukainen

Fix SubtitlingControl events

parent 80223268
......@@ -222,6 +222,13 @@ public class Handler extends BDHandler {
} catch (Exception e) {
System.err.println("" + e + "\n" + Logger.dumpStack(e));
}
if (pi != null) {
TIClip[] clips = pi.getClips();
if (clips != null && param >= 0 && param < clips.length) {
((SubtitlingControlImpl)controls[15]).onSubtitleAvailable(clips[param].getPgStreamCount() > 0);
}
}
}
protected void doAngleChanged(int param) {
......
......@@ -26,7 +26,11 @@ import org.bluray.media.SubtitleStyleNotAvailableException;
import org.bluray.media.SubtitlingControl;
import org.bluray.media.TextSubtitleNotAvailableException;
import org.bluray.ti.CodingType;
import org.dvb.media.SubtitleAvailableEvent;
import org.dvb.media.SubtitleListener;
import org.dvb.media.SubtitleNotAvailableEvent;
import org.dvb.media.SubtitleNotSelectedEvent;
import org.dvb.media.SubtitleSelectedEvent;
import org.videolan.BDJListeners;
import org.videolan.Libbluray;
import org.videolan.StreamInfo;
......@@ -118,8 +122,21 @@ public class SubtitlingControlImpl extends StreamControl implements SubtitlingCo
}
protected void onSubtitleChange(int param) {
listeners.putCallback(new EventObject(this));
if ((param & 0x80000000) != 0) {
listeners.putCallback(new SubtitleSelectedEvent(this));
} else {
listeners.putCallback(new SubtitleNotSelectedEvent(this));
}
}
protected void onSubtitleAvailable(boolean param) {
if (param) {
listeners.putCallback(new SubtitleAvailableEvent(this));
} else {
listeners.putCallback(new SubtitleNotAvailableEvent(this));
}
}
private BDJListeners listeners = new BDJListeners();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment