Skip to content
Browse files

initial commit

  • Loading branch information...
0 parents commit 53664a7c80b30cdfc8a9064c745be4d2681cfa43 @chocolateboy committed May 25, 2011
Showing with 243 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +49 −0 README.md
  3. +7 −0 build.gradle
  4. +1 −0 plugin
  5. +33 −0 src/main/java/com/chocolatey/pmsedl/Options.java
  6. +74 −0 src/main/java/com/chocolatey/pmsedl/Plugin.java
  7. +1 −0 src/main/resources/com/chocolatey/pmsedl/messages.properties
  8. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_ar.properties
  9. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_ca.properties
  10. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_cs.properties
  11. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_da.properties
  12. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_de.properties
  13. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_es.properties
  14. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_fa.properties
  15. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_fi.properties
  16. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_fr.properties
  17. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_hu.properties
  18. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_id.properties
  19. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_it.properties
  20. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_ja.properties
  21. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_ko.properties
  22. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_nl.properties
  23. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_no.properties
  24. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_pl.properties
  25. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_pt.properties
  26. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_ro.properties
  27. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_ru.properties
  28. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_sv.properties
  29. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_tr.properties
  30. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_uk.properties
  31. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_vi.properties
  32. +3 −0 src/main/resources/com/chocolatey/pmsedl/messages_zh.properties
3 .gitignore
@@ -0,0 +1,3 @@
+build/
+*.jar
+.gradle/
49 README.md
@@ -0,0 +1,49 @@
+# Synopsis <a name="Synopsis"></a>
+
+This is a plugin for [PS3 Media Server](http://code.google.com/p/ps3mediaserver/) that adds support for MEncoder edit decision lists (EDLs).
+
+# Prerequisites <a name="Prerequisites"></a>
+
+This plugin should work on all platforms supported by PS3 Media Server.
+
+These instructions assume you have the latest version of [PS3 Media Server](http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=3507&p=36904#p36904) (PMS) and the latest version of [Java](http://www.java.com/en/download/index.jsp).
+
+* Download and save the [plugin](https://github.com/downloads/chocolateboy/PMS-EDL/pmsedl-1.0.0.jar) to the PMS plugins directory
+* Restart PMS
+
+## Usage
+
+There are two ways to name an EDL: per-file and per-folder. Per-file EDLs taker precedence over per-folder EDLs.
+
+### Per-file
+
+To create file-specific EDLs, place each .edl file in the same folder as the video it applies to. The .edl file must have the same name as the video with an .edl extension e.g.
+
+* Big Buck Bunny.mp4
+* Big Buck Bunny.edl
+
+### Per-folder
+
+To create an EDL that applies to all videos in a folder, create a file called `folder.edl`.
+
+* Episode 1x01.mp4
+* Episode 1x02.mp4
+* folder.edl
+
+EDLs require MEncoder, so if it is not being used automatically, it will need to be invoked via the #--TRANSCODE--# folder.
+
+For information on creating EDL files, see [here](http://www.mplayerhq.hu/DOCS/HTML/en/edl.html).
+
+# Troubleshooting and Support <a name="Troubleshooting"></a>
+* Check the PMS `debug.log`
+* For more details, discussion and troubleshooting tips, see [this thread](http://ps3mediaserver.org/forum/viewtopic.php?f=4&t=6055)
+
+# Version <a name="Version"></a>
+
+1.0.0
+
+# License <a name="License"></a>
+
+Copyright 2011, [chocolateboy](mailto:chocolate@cpan.org).
+
+pms-edl is free software; you can redistribute it and/or modify it under the terms of the [Artistic License 2.0](http://www.opensource.org/licenses/artistic-license-2.0.php).
7 build.gradle
@@ -0,0 +1,7 @@
+apply plugin: 'java'
+
+defaultTasks 'clean', 'jar'
+
+dependencies {
+ compile fileTree(dir: 'lib', include: '*.jar')
+}
1 plugin
@@ -0,0 +1 @@
+com.chocolatey.pmsedl.Plugin
33 src/main/java/com/chocolatey/pmsedl/Options.java
@@ -0,0 +1,33 @@
+package com.chocolatey.pmsedl;
+
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyEvent;
+import java.util.ResourceBundle;
+
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+
+class Options extends JPanel implements ItemListener {
+ private boolean enabled = true;
+ private JCheckBox checkbox;
+ private static final ResourceBundle labels = ResourceBundle.getBundle("messages");
+ private static final String ENABLE = labels.getString("Options.Enable");
+
+ protected Options() {
+ checkbox = new JCheckBox(ENABLE, true);
+ checkbox.setMnemonic(KeyEvent.VK_E);
+ checkbox.addItemListener(this);
+ add(checkbox);
+ setVisible(true);
+ }
+
+ public void itemStateChanged(ItemEvent e) {
+ enabled = checkbox.isSelected();
+ Plugin.log(enabled ? "enabled" : "disabled");
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+}
74 src/main/java/com/chocolatey/pmsedl/Plugin.java
@@ -0,0 +1,74 @@
+package com.chocolatey.pmsedl;
+
+import net.pms.dlna.DLNAMediaInfo;
+import net.pms.dlna.DLNAResource;
+import net.pms.external.FinalizeTranscoderArgsListener;
+import net.pms.io.OutputParams;
+import net.pms.PMS;
+import net.pms.util.FileUtil;
+
+import java.io.File;
+import java.util.List;
+
+import javax.swing.JComponent;
+
+public class Plugin implements FinalizeTranscoderArgsListener {
+ private static final String VERSION = "1.0.0";
+ private static final String NAME = "PMS-EDL";
+ private Options options;
+
+ public Plugin() {
+ options = new Options();
+ log("Initialized PMS-EDL " + VERSION);
+ }
+
+ public String name() {
+ return NAME;
+ }
+
+ private static boolean fileExists(File file) {
+ return file.exists() && file.isFile();
+ }
+
+ public static void log(String msg) {
+ PMS.minimal(NAME + ": " + msg);
+ }
+
+ @Override
+ public List<String> finalizeTranscoderArgs(
+ String id,
+ String filename,
+ DLNAResource dlna,
+ DLNAMediaInfo media,
+ OutputParams params,
+ List<String> cmdList)
+ {
+ if (options.isEnabled() && id.equals("mencoder")) {
+ File file = new File(FileUtil.getFileNameWithoutExtension(filename) + ".edl");
+
+ if (!fileExists(file)) {
+ file = new File(file.getParentFile(), "folder.edl");
+ if (!fileExists(file)) {
+ file = null;
+ }
+ }
+
+ if (file != null) {
+ String path = file.getAbsolutePath();
+ log("detected EDL: " + path);
+ cmdList.add("-edl");
+ cmdList.add(path);
+ }
+ }
+
+ return cmdList;
+ }
+
+ public void shutdown() {
+ // nothing to do
+ }
+
+ public JComponent config() {
+ return options;
+ }
+}
1 src/main/resources/com/chocolatey/pmsedl/messages.properties
@@ -0,0 +1 @@
+Options.Enable=Enable
3 src/main/resources/com/chocolatey/pmsedl/messages_ar.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:05 2011
+
+Options.Enable=\u062a\u0645\u0643\u064a\u0646
3 src/main/resources/com/chocolatey/pmsedl/messages_ca.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:05 2011
+
+Options.Enable=Habilita
3 src/main/resources/com/chocolatey/pmsedl/messages_cs.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:05 2011
+
+Options.Enable=Umo\u017e\u0148uj\u00ed
3 src/main/resources/com/chocolatey/pmsedl/messages_da.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=Aktiver
3 src/main/resources/com/chocolatey/pmsedl/messages_de.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:05 2011
+
+Options.Enable=Enable
3 src/main/resources/com/chocolatey/pmsedl/messages_es.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=Habilitar
3 src/main/resources/com/chocolatey/pmsedl/messages_fa.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=\u0641\u0639\u0627\u0644
3 src/main/resources/com/chocolatey/pmsedl/messages_fi.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:05 2011
+
+Options.Enable=Avulla
3 src/main/resources/com/chocolatey/pmsedl/messages_fr.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=Activer
3 src/main/resources/com/chocolatey/pmsedl/messages_hu.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=Enged\u00e9lyez\u00e9se
3 src/main/resources/com/chocolatey/pmsedl/messages_id.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=Memungkinkan
3 src/main/resources/com/chocolatey/pmsedl/messages_it.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=Attiva
3 src/main/resources/com/chocolatey/pmsedl/messages_ja.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=\u6709\u52b9\u306b\u3059\u308b
3 src/main/resources/com/chocolatey/pmsedl/messages_ko.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:05 2011
+
+Options.Enable=\ud65c\uc131\ud654
3 src/main/resources/com/chocolatey/pmsedl/messages_nl.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:05 2011
+
+Options.Enable=Staat
3 src/main/resources/com/chocolatey/pmsedl/messages_no.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=Aktiver
3 src/main/resources/com/chocolatey/pmsedl/messages_pl.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=W\u0142\u0105cz
3 src/main/resources/com/chocolatey/pmsedl/messages_pt.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:02 2011
+
+Options.Enable=Habilitar
3 src/main/resources/com/chocolatey/pmsedl/messages_ro.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=Permite
3 src/main/resources/com/chocolatey/pmsedl/messages_ru.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c
3 src/main/resources/com/chocolatey/pmsedl/messages_sv.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=Aktivera
3 src/main/resources/com/chocolatey/pmsedl/messages_tr.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=Etkinle\u015ftirmek
3 src/main/resources/com/chocolatey/pmsedl/messages_uk.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:02 2011
+
+Options.Enable=\u0412\u043a\u043b\u044e\u0447\u0456\u0442\u044c
3 src/main/resources/com/chocolatey/pmsedl/messages_vi.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:03 2011
+
+Options.Enable=K\u00edch ho\u1ea1t t\u00ednh n\u0103ng
3 src/main/resources/com/chocolatey/pmsedl/messages_zh.properties
@@ -0,0 +1,3 @@
+# Thu May 26 00:27:04 2011
+
+Options.Enable=\u542f\u7528

0 comments on commit 53664a7

Please sign in to comment.
Something went wrong with that request. Please try again.