From d35a9d954fbe638546f95f0122b8c083ee4bd809 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Sun, 4 Feb 2024 13:31:00 +0100 Subject: GLMediaPlayer.Chapter: Add duration() --- src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java index 191b96e56..6eab3fd6f 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java @@ -285,6 +285,8 @@ public interface GLMediaPlayer extends TextureSequence { public Chapter(final int i, final int s, final int e, final String t) { id = i; start = s; end = e; title = t; } + /** Returns chapter duration, i.e. {@code end - start + 1}. */ + public int duration() { return end - start + 1; } @Override public String toString() { return String.format("%02d: [%s .. %s] %s", id, PTS.toTimeStr(start), PTS.toTimeStr(end), title); -- cgit v1.2.3