Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Commit

Permalink
Made the AviSynth script instructions separate to the input box
Browse files Browse the repository at this point in the history
  • Loading branch information
SubJunk committed Jun 30, 2012
1 parent 12418aa commit 609a3ad
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/main/external-resources/UMS.conf
Expand Up @@ -743,7 +743,7 @@ avisynth_convertfps = true

# The template for the AviSynth script. The script string may contain the
# character "\u0001", which will be treated as newline character.
avisynth_script = # AviSynth script is now fully customisable\u0001# The following variables are available:\u0001# <movie>: The complete DirectShowSource instruction, e.g. DirectShowSource(filename, convertfps)\u0001# <sub>: The complete subtitle instruction if there's any detected (SRT/SUB/IDX/ASS/SSA)\u0001# <moviefilename>: The video filename for if you want to do all this by yourself\u0001<movie>\u0001<sub>
avisynth_script = <movie>\u0001<sub>

# Default value is "-g 1 -qscale 1 -qmin 2"
ffmpeg = -g 1 -q:v 1 -qmin 2
Expand Down
9 changes: 1 addition & 8 deletions src/main/java/net/pms/configuration/PmsConfiguration.java
Expand Up @@ -390,14 +390,7 @@ public PmsConfiguration(boolean loadFile) throws ConfigurationException, IOExcep
Locale.setDefault(new Locale(getLanguage()));

// Set DEFAULT_AVI_SYNTH_SCRIPT according to language
DEFAULT_AVI_SYNTH_SCRIPT =
Messages.getString("MEncoderAviSynth.4") +
Messages.getString("MEncoderAviSynth.5") +
Messages.getString("MEncoderAviSynth.6") +
Messages.getString("MEncoderAviSynth.7") +
Messages.getString("MEncoderAviSynth.8") +
Messages.getString("MEncoderAviSynth.10") +
Messages.getString("MEncoderAviSynth.11");
DEFAULT_AVI_SYNTH_SCRIPT = "<movie>\n<sub>\n";

long usableMemory = (Runtime.getRuntime().maxMemory() / 1048576) - BUFFER_MEMORY_FACTOR;
if (usableMemory > MAX_MAX_MEMORY_DEFAULT_SIZE) {
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/net/pms/encoders/MEncoderAviSynth.java
Expand Up @@ -22,6 +22,7 @@
import com.jgoodies.forms.factories.Borders;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
Expand Down Expand Up @@ -116,6 +117,18 @@ public void itemStateChanged(ItemEvent e) {
});
builder.add(convertfps, cc.xy(2, 9));

String aviSynthScriptInstructions = Messages.getString("MEncoderAviSynth.4") +
Messages.getString("MEncoderAviSynth.5") +
Messages.getString("MEncoderAviSynth.6") +
Messages.getString("MEncoderAviSynth.7") +
Messages.getString("MEncoderAviSynth.8");
JTextArea aviSynthScriptInstructionsContainer = new JTextArea(aviSynthScriptInstructions);
aviSynthScriptInstructionsContainer.setEditable(false);
aviSynthScriptInstructionsContainer.setBorder(BorderFactory.createEtchedBorder());
aviSynthScriptInstructionsContainer.setBackground(new Color(255, 255, 192));
aviSynthScriptInstructionsContainer.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(new Color(130, 135, 144)), BorderFactory.createEmptyBorder(3, 5, 3, 5)));
builder.add(aviSynthScriptInstructionsContainer, cc.xy(2, 11));

String clip = PMS.getConfiguration().getAvisynthScript();
if (clip == null) {
clip = "";
Expand Down Expand Up @@ -158,7 +171,7 @@ public void keyReleased(KeyEvent e) {

JScrollPane pane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
pane.setPreferredSize(new Dimension(500, 350));
builder.add(pane, cc.xy(2, 11));
builder.add(pane, cc.xy(2, 13));


return builder.getPanel();
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/net/pms/messages.properties
Expand Up @@ -59,13 +59,11 @@ LooksFrame.25=About
LooksFrame.26=FOR TESTING ONLY, POSSIBLY UNSTABLE
MEncoderAviSynth.2=Video decoder settings for AviSynth engine only
MEncoderAviSynth.3=Enable AviSynth variable framerate change into a constant framerate (convertfps=true)
MEncoderAviSynth.4=# AviSynth script is now fully customisable\n
MEncoderAviSynth.5=# The following variables are available:\n
MEncoderAviSynth.6=# <movie>: The complete DirectShowSource instruction, e.g. DirectShowSource(filename, convertfps)\n
MEncoderAviSynth.7=# <sub>: The complete subtitle instruction if there's any detected (SRT/SUB/IDX/ASS/SSA)\n
MEncoderAviSynth.8=# <moviefilename>: The video filename for if you want to do all this by yourself\n
MEncoderAviSynth.10=<movie>\n
MEncoderAviSynth.11=<sub>\n
MEncoderAviSynth.4=AviSynth script is fully customisable\n
MEncoderAviSynth.5=The following variables are available:\n
MEncoderAviSynth.6=<movie>: The complete DirectShowSource instruction, e.g. DirectShowSource(filename, convertfps)\n
MEncoderAviSynth.7=<sub>: The complete subtitle instruction if there's any detected (SRT/SUB/IDX/ASS/SSA)\n
MEncoderAviSynth.8=<moviefilename>: The video filename for if you want to do all this by yourself
MEncoderAviSynth.13=Enable True Motion motion interpolation via InterFrame
MEncoderAviSynth.14=Enable multithreading
MEncoderAviSynth.15=Enable GPU use with True Motion. Recommended if you have a video card
Expand Down

0 comments on commit 609a3ad

Please sign in to comment.