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

Commit

Permalink
handle GStrings in $ARGS assignments
Browse files Browse the repository at this point in the history
show command in pmsencoder.log
  • Loading branch information
chocolateboy committed Sep 8, 2010
1 parent 496fe86 commit 4a487a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main/groovy/com/chocolatey/pmsencoder/Engine.java
Expand Up @@ -84,6 +84,8 @@ public ProcessWrapper launchTranscode(String uri, DLNAMediaInfo media, OutputPar
args.add(outfile);
}

log.info("command: " + args);

params.input_pipes[0] = pipe;
params.minBufferSize = params.minFileSize;
params.secondread_minsize = 100000;
Expand Down
14 changes: 11 additions & 3 deletions src/main/groovy/com/chocolatey/pmsencoder/PMSEncoder.groovy
Expand Up @@ -145,7 +145,13 @@ class Matcher extends Logger {
config.$DEFAULT_MENCODER_ARGS.each { command.args << it.toString() }
}

config.match(command) // we could use the @Delegate annotation, but this is cleaner/clearer
def matched = config.match(command) // we could use the @Delegate annotation, but this is cleaner/clearer

if (matched) {
log.debug("command: $command")
}

return matched
}
}

Expand Down Expand Up @@ -346,8 +352,10 @@ public class CommandDelegate extends ConfigDelegate {
}

// DSL accessor ($ARGS): read-write
@Typed(TypePolicy.DYNAMIC) // try to handle GStrings
// FIXME: test this!
protected List<String> set$ARGS(List<String> args) {
command.args = args
command.args = args.collect { it.toString() } // handle GStrings
}

// DSL accessor ($MATCHES): read-only
Expand Down Expand Up @@ -523,7 +531,7 @@ class Action extends CommandDelegate {
@Typed(TypePolicy.DYNAMIC) // XXX try to handle GStrings
void set(Map<String, String> map) {
// the sort order is predictable (for tests) as long as we (and Groovy) use LinkedHashMap
map.each { name, value -> setArg(name, value) }
map.each { name, value -> setArg(name.toString(), value.toString()) }
}

// set an MEncoder option - create it if it doesn't exist
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/log4j.xml
Expand Up @@ -43,7 +43,7 @@
-->

<root>
<priority value ="info" />
<priority value="INFO" />
<appender-ref ref="logfile" />
</root>
</log4j:configuration>

0 comments on commit 4a487a2

Please sign in to comment.