[vlma-devel] commit: Add an adapter for the streamChannels. (Adrien Maglo )

git version control git at videolan.org
Tue May 20 14:38:04 CEST 2008


vlma | branch: master | Adrien Maglo <magsoft at videolan.org> | Tue May 20 14:10:33 2008 +0200| [02222222a3c626db9a73ab5eff2a11c01cdd2849]

Add an adapter for the streamChannels.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=02222222a3c626db9a73ab5eff2a11c01cdd2849
---

 .../videolan/vlma/model/adapter/StreamAdapter.java |   67 ++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/vlma-model/src/main/java/org/videolan/vlma/model/adapter/StreamAdapter.java b/vlma-model/src/main/java/org/videolan/vlma/model/adapter/StreamAdapter.java
new file mode 100755
index 0000000..212321f
--- /dev/null
+++ b/vlma-model/src/main/java/org/videolan/vlma/model/adapter/StreamAdapter.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2006-2008 the VideoLAN team
+ *
+ * This file is part of VLMa.
+ *
+ * VLMa is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * VLMa 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with VLMa. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.videolan.vlma.model.adapter;
+
+import org.videolan.vlma.model.exception.AdapterParameterDoesNotExistException;
+import org.videolan.vlma.model.media.StreamChannel;
+import org.videolan.vlma.model.media.Media;
+
+/**
+ * This class represents a file adapter.
+ * In fact, this class is added to a server if it has to broadcast files
+ *
+ * @author MagSoft
+ *
+ */
+public class StreamAdapter extends AbstractAdapter {
+
+    /**
+     * Returns the name describing the adapter type.
+     *
+     * @return the adapter type name
+     */
+    public String getType() {
+        return "Stream-Adapter";
+    }
+
+    public void setParameter(String parameter, Object value)
+            throws AdapterParameterDoesNotExistException {
+        {
+            throw new AdapterParameterDoesNotExistException("Le paramètre "
+                    + parameter
+                    + " n'existe pas dans les périphériques du type "
+                    + this.getClass().getSimpleName());
+        }
+    }
+
+    @Override
+    public boolean canRead(Media media) {
+        if (media.getClass().equals(StreamChannel.class)) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashType() {
+        return StreamChannel.class.hashCode();
+    }
+}



More information about the vlma-devel mailing list