| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import de.uhilger.tango.PlaylistListener; |
| | | import de.uhilger.tango.Server; |
| | | import de.uhilger.tango.entity.Abspielvorgang; |
| | | import de.uhilger.tango.entity.Abspieler; |
| | |
| | | import java.io.IOException; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | |
| | | * @author Ulrich Hilger |
| | | * @version 1, 9.4.2021 |
| | | */ |
| | | public class MediaSteuerung extends AbstractHandler { |
| | | public class MediaSteuerung extends AbstractHandler implements PlaylistListener { |
| | | |
| | | private static final Logger logger = Logger.getLogger(MediaSteuerung.class.getName()); |
| | | |
| | |
| | | setReturnCode(code); |
| | | return text; |
| | | } |
| | | |
| | | /* ------- PlaylistListener implementation ------ */ |
| | | |
| | | @Override |
| | | public void titleRemoved(String listName, int titleIndex) { |
| | | Set keys = spielt.keySet(); |
| | | Iterator<String> keyIterator = keys.iterator(); |
| | | boolean found = false; |
| | | while(keyIterator.hasNext() && !found) { |
| | | String abspielerName = keyIterator.next(); |
| | | Abspielvorgang av = (Abspielvorgang) spielt.get(abspielerName); |
| | | if(av.getListe().equals(listName)) { |
| | | found = true; |
| | | int tnr = av.getTitelNr(); |
| | | if(tnr > titleIndex) { |
| | | av.setTitelNr(--tnr); |
| | | logger.info("Abspieler " + abspielerName + " Liste " + av.getListe() + " titelnr jetzt " + tnr); |
| | | spielt.put(abspielerName, av); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |