[libbluray-devel] Add missing javax.tv.util classes

hpi1 git at videolan.org
Wed Apr 6 09:36:36 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Apr  5 12:17:50 2016 +0300| [f1bb94f229bca2948921d4dc3130f33dad769d37] | committer: hpi1

Add missing javax.tv.util classes

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

 src/libbluray/bdj/java/javax/tv/util/TVTimer.java  |   39 ++++++++
 .../tv/util/TVTimerScheduleFailedException.java    |   30 ++++++
 .../bdj/java/javax/tv/util/TVTimerSpec.java        |  104 ++++++++++++++++++++
 .../java/javax/tv/util/TVTimerWentOffEvent.java    |   36 +++++++
 .../java/javax/tv/util/TVTimerWentOffListener.java |   25 +++++
 5 files changed, 234 insertions(+)

diff --git a/src/libbluray/bdj/java/javax/tv/util/TVTimer.java b/src/libbluray/bdj/java/javax/tv/util/TVTimer.java
new file mode 100644
index 0000000..a1232f3
--- /dev/null
+++ b/src/libbluray/bdj/java/javax/tv/util/TVTimer.java
@@ -0,0 +1,39 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2016  VideoLAN
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package javax.tv.util;
+
+import org.videolan.Logger;
+
+public abstract class TVTimer
+{
+    public static TVTimer getTimer() {
+        Logger.unimplemented(TVTimer.class.getName(), "getTimer");
+        return null;
+    }
+
+    public abstract TVTimerSpec scheduleTimerSpec(TVTimerSpec paramTVTimerSpec)
+        throws TVTimerScheduleFailedException;
+
+    public abstract long getGranularity();
+
+    public abstract long getMinRepeatInterval();
+
+    public abstract void deschedule(TVTimerSpec paramTVTimerSpec);
+}
diff --git a/src/libbluray/bdj/java/javax/tv/util/TVTimerScheduleFailedException.java b/src/libbluray/bdj/java/javax/tv/util/TVTimerScheduleFailedException.java
new file mode 100644
index 0000000..4f88d69
--- /dev/null
+++ b/src/libbluray/bdj/java/javax/tv/util/TVTimerScheduleFailedException.java
@@ -0,0 +1,30 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2016  VideoLAN
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package javax.tv.util;
+
+public class TVTimerScheduleFailedException extends Exception
+{
+    public TVTimerScheduleFailedException() {
+    }
+
+    public TVTimerScheduleFailedException(String param) {
+        super(param);
+    }
+}
diff --git a/src/libbluray/bdj/java/javax/tv/util/TVTimerSpec.java b/src/libbluray/bdj/java/javax/tv/util/TVTimerSpec.java
new file mode 100644
index 0000000..ed12a7d
--- /dev/null
+++ b/src/libbluray/bdj/java/javax/tv/util/TVTimerSpec.java
@@ -0,0 +1,104 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2016  VideoLAN
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package javax.tv.util;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+import org.videolan.Logger;
+
+public class TVTimerSpec
+{
+    private boolean absolute;
+    private boolean regular;
+    private boolean repeat;
+    private long    time;
+
+    public TVTimerSpec() {
+        absolute = true;
+        repeat = false;
+        regular = true;
+        time = 0L;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public boolean isAbsolute() {
+        return absolute;
+    }
+
+    public boolean isRegular() {
+        return regular;
+    }
+
+    public boolean isRepeat() {
+        return repeat;
+    }
+
+    public void addTVTimerWentOffListener(TVTimerWentOffListener l) {
+        Logger.unimplemented(TVTimer.class.getName(), "addTVTimerWentOffListener");
+    }
+
+    public void removeTVTimerWentOffListener(TVTimerWentOffListener l) {
+        Logger.unimplemented(TVTimer.class.getName(), "removeTVTimerWentOffListener");
+    }
+
+    public void notifyListeners(TVTimer source) {
+        Logger.unimplemented(TVTimer.class.getName(), "notifyListeners");
+    }
+
+    public void setAbsolute(boolean absolute) {
+        this.absolute = absolute;
+    }
+
+    public void setAbsoluteTime(long when) {
+        if (when < 0L) {
+            throw new IllegalArgumentException();
+        }
+        setAbsolute(true);
+        setTime(when);
+        setRepeat(false);
+    }
+
+    public void setDelayTime(long delay) {
+        if (delay < 0L) {
+            throw new IllegalArgumentException();
+        }
+        setAbsolute(false);
+        setTime(delay);
+        setRepeat(false);
+    }
+
+    public void setRegular(boolean regular) {
+        this.regular = regular;
+    }
+
+    public void setRepeat(boolean repeat) {
+        this.repeat = repeat;
+    }
+
+    public void setTime(long time) {
+        if (time < 0L)
+            throw new IllegalArgumentException();
+        this.time = time;
+    }
+}
diff --git a/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffEvent.java b/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffEvent.java
new file mode 100644
index 0000000..2decd03
--- /dev/null
+++ b/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffEvent.java
@@ -0,0 +1,36 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2016  VideoLAN
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package javax.tv.util;
+
+import java.util.EventObject;
+
+public class TVTimerWentOffEvent extends EventObject
+{
+    public TVTimerWentOffEvent(TVTimer source, TVTimerSpec spec) {
+        super(source);
+        this.spec = spec;
+    }
+
+    public TVTimerSpec getTimerSpec() {
+        return spec;
+    }
+
+    private TVTimerSpec spec = null;
+}
diff --git a/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffListener.java b/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffListener.java
new file mode 100644
index 0000000..6713b98
--- /dev/null
+++ b/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffListener.java
@@ -0,0 +1,25 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2016  VideoLAN
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package javax.tv.util;
+
+public abstract interface TVTimerWentOffListener
+{
+    public abstract void timerWentOff(TVTimerWentOffEvent paramTVTimerWentOffEvent);
+}



More information about the libbluray-devel mailing list