From 792b21b74e40320c85e9a193c8fa8218851010e6 Mon Sep 17 00:00:00 2001
From: undisclosed
Date: Mon, 02 Jan 2023 21:43:55 +0000
Subject: [PATCH] UI fuer Seek in Vorbereitung

---
 src/de/uhilger/tango/api/MediaSteuerung.java |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/de/uhilger/tango/api/MediaSteuerung.java b/src/de/uhilger/tango/api/MediaSteuerung.java
index 2e5e9dc..441eba7 100644
--- a/src/de/uhilger/tango/api/MediaSteuerung.java
+++ b/src/de/uhilger/tango/api/MediaSteuerung.java
@@ -53,6 +53,7 @@
  *
  * HTTP GET /mz/api/strg/abspieler/pause 
  * HTTP GET /mz/api/strg/abspieler/stop 
+ * HTTP GET /mz/api/strg/abspieler/seek/[sekunden]
  * 
  * Faustregel: Anzahl Elemente eines URL plus 1 ist die Anzahl der Elemente des 
  * Ergebnisses von String.split.
@@ -66,14 +67,19 @@
   private static final Logger logger = Logger.getLogger(MediaSteuerung.class.getName());
 
   public static final String PL_CMD_PLAY = "play";
+  public static final String PL_CMD_SEEK = "seek";
   public static final String PL_DEFAULT_PARAMS = "?titel=";
   public static final String PL_PARAM_RUECK = "&r=";
   public static final String PL_API_STRG = "api/strg/"; 
   public static final String PL_CMD_ENDE = "ende";
   public static final String PL_CMD_STOP = "stop";
+  public static final String PL_CMD_VOLDN = "voldn";
+  public static final String PL_CMD_VOLUP = "volup";
   public static final String PL_CMD_PAUSE = "pause";
   public static final String PL_CMD_PLAYON = "weiter";
   public static final String PL_CMD_CALYPSO_STOP = "stop";
+  public static final String PL_CMD_CALYPSO_VOL_INC = "vol-inc";
+  public static final String PL_CMD_CALYPSO_VOL_DEC = "vol-dec";
   public static final String PL_CMD_CALYPSO_PAUSE = "pause";
   public static final String PL_CMD_CALYPSO_PLAYON = "playon";
   public static final String DEFAULT_HOST = "http://localhost:9090";
@@ -106,6 +112,10 @@
         } else if(elems[5].equalsIgnoreCase(PL_CMD_STOP)) {
           spielt.remove(elems[4]);
           response = kommandoSenden(fs, elems[4], PL_CMD_CALYPSO_STOP);
+        } else if(elems[5].equalsIgnoreCase(PL_CMD_VOLDN)) {
+          response = kommandoSenden(fs, elems[4], PL_CMD_CALYPSO_VOL_DEC);
+        } else if(elems[5].equalsIgnoreCase(PL_CMD_VOLUP)) {
+          response = kommandoSenden(fs, elems[4], PL_CMD_CALYPSO_VOL_INC);
         } else if(elems[5].equalsIgnoreCase(PL_CMD_PAUSE)) {
           response = kommandoSenden(fs, elems[4], PL_CMD_CALYPSO_PAUSE);
         //} else if(elems[5].equalsIgnoreCase(PL_CMD_PLAYON)) {
@@ -114,6 +124,14 @@
           response = meldung("Ungueltiges Kommando: " + elems[5], AbstractHandler.RTC_NOT_FOUND);
         }
         break;
+      case 7:
+        if (elems[5].equalsIgnoreCase(PL_CMD_SEEK)) {
+          // /calypso/seek?pos=[sekunden]
+          response = kommandoSenden(fs, elems[4], "seek?pos=" + elems[6]);
+        } else {
+          response = meldung("Ungueltiges Kommando: " + elems[5], AbstractHandler.RTC_NOT_FOUND);
+        }
+        break;
       case 8:
         response = ersterTitel(fs, elems[4], elems[7]);
         break;

--
Gitblit v1.9.3