OSDN Git Service

MediaInfoを使用してサイズを取得する master
authoryukihane <yukihane.feather@gmail.com>
Mon, 1 Aug 2011 17:50:42 +0000 (02:50 +0900)
committeryukihane <yukihane.feather@gmail.com>
Mon, 1 Aug 2011 17:50:42 +0000 (02:50 +0900)
build.xml [new file with mode: 0644]
manifest.mf [new file with mode: 0644]
nbproject/build-impl.xml [new file with mode: 0644]
nbproject/genfiles.properties [new file with mode: 0644]
nbproject/project.properties [new file with mode: 0644]
nbproject/project.xml [new file with mode: 0644]
src/yukihane/mediainfowrapper/Info.java [new file with mode: 0644]
src/yukihane/mediainfowrapper/MediaInfo.java [new file with mode: 0644]
src/yukihane/mediainfowrapper/Size.java [new file with mode: 0644]

diff --git a/build.xml b/build.xml
new file mode 100644 (file)
index 0000000..7b0a4c6
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- You may freely edit this file. See commented blocks below for -->\r
+<!-- some examples of how to customize the build. -->\r
+<!-- (If you delete it and reopen the project it will be recreated.) -->\r
+<!-- By default, only the Clean and Build commands use this build script. -->\r
+<!-- Commands such as Run, Debug, and Test only use this build script if -->\r
+<!-- the Compile on Save feature is turned off for the project. -->\r
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->\r
+<!-- in the project's Project Properties dialog box.-->\r
+<project name="MediaInfoWrapper" default="default" basedir=".">\r
+    <description>Builds, tests, and runs the project MediaInfoWrapper.</description>\r
+    <import file="nbproject/build-impl.xml"/>\r
+    <!--\r
+\r
+    There exist several targets which are by default empty and which can be \r
+    used for execution of your tasks. These targets are usually executed \r
+    before and after some main targets. They are: \r
+\r
+      -pre-init:                 called before initialization of project properties\r
+      -post-init:                called after initialization of project properties\r
+      -pre-compile:              called before javac compilation\r
+      -post-compile:             called after javac compilation\r
+      -pre-compile-single:       called before javac compilation of single file\r
+      -post-compile-single:      called after javac compilation of single file\r
+      -pre-compile-test:         called before javac compilation of JUnit tests\r
+      -post-compile-test:        called after javac compilation of JUnit tests\r
+      -pre-compile-test-single:  called before javac compilation of single JUnit test\r
+      -post-compile-test-single: called after javac compilation of single JUunit test\r
+      -pre-jar:                  called before JAR building\r
+      -post-jar:                 called after JAR building\r
+      -post-clean:               called after cleaning build products\r
+\r
+    (Targets beginning with '-' are not intended to be called on their own.)\r
+\r
+    Example of inserting an obfuscator after compilation could look like this:\r
+\r
+        <target name="-post-compile">\r
+            <obfuscate>\r
+                <fileset dir="${build.classes.dir}"/>\r
+            </obfuscate>\r
+        </target>\r
+\r
+    For list of available properties check the imported \r
+    nbproject/build-impl.xml file. \r
+\r
+\r
+    Another way to customize the build is by overriding existing main targets.\r
+    The targets of interest are: \r
+\r
+      -init-macrodef-javac:     defines macro for javac compilation\r
+      -init-macrodef-junit:     defines macro for junit execution\r
+      -init-macrodef-debug:     defines macro for class debugging\r
+      -init-macrodef-java:      defines macro for class execution\r
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)\r
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)\r
+      run:                      execution of project \r
+      -javadoc-build:           Javadoc generation\r
+      test-report:              JUnit report generation\r
+\r
+    An example of overriding the target for project execution could look like this:\r
+\r
+        <target name="run" depends="MediaInfoWrapper-impl.jar">\r
+            <exec dir="bin" executable="launcher.exe">\r
+                <arg file="${dist.jar}"/>\r
+            </exec>\r
+        </target>\r
+\r
+    Notice that the overridden target depends on the jar target and not only on \r
+    the compile target as the regular run target does. Again, for a list of available \r
+    properties which you can use, check the target you are overriding in the\r
+    nbproject/build-impl.xml file. \r
+\r
+    -->\r
+</project>\r
diff --git a/manifest.mf b/manifest.mf
new file mode 100644 (file)
index 0000000..1574df4
--- /dev/null
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0\r
+X-COMMENT: Main-Class will be added automatically by build\r
+\r
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
new file mode 100644 (file)
index 0000000..1c6283b
--- /dev/null
@@ -0,0 +1,1041 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+*** GENERATED FROM project.xml - DO NOT EDIT  ***\r
+***         EDIT ../build.xml INSTEAD         ***\r
+\r
+For the purpose of easier reading the script\r
+is divided into following sections:\r
+\r
+  - initialization\r
+  - compilation\r
+  - jar\r
+  - execution\r
+  - debugging\r
+  - javadoc\r
+  - junit compilation\r
+  - junit execution\r
+  - junit debugging\r
+  - applet\r
+  - cleanup\r
+\r
+        -->\r
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="MediaInfoWrapper-impl">\r
+    <fail message="Please build using Ant 1.7.1 or higher.">\r
+        <condition>\r
+            <not>\r
+                <antversion atleast="1.7.1"/>\r
+            </not>\r
+        </condition>\r
+    </fail>\r
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>\r
+    <!-- \r
+                ======================\r
+                INITIALIZATION SECTION \r
+                ======================\r
+            -->\r
+    <target name="-pre-init">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="-pre-init" name="-init-private">\r
+        <property file="nbproject/private/config.properties"/>\r
+        <property file="nbproject/private/configs/${config}.properties"/>\r
+        <property file="nbproject/private/private.properties"/>\r
+    </target>\r
+    <target depends="-pre-init,-init-private" name="-init-user">\r
+        <property file="${user.properties.file}"/>\r
+        <!-- The two properties below are usually overridden -->\r
+        <!-- by the active platform. Just a fallback. -->\r
+        <property name="default.javac.source" value="1.4"/>\r
+        <property name="default.javac.target" value="1.4"/>\r
+    </target>\r
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">\r
+        <property file="nbproject/configs/${config}.properties"/>\r
+        <property file="nbproject/project.properties"/>\r
+    </target>\r
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">\r
+        <available file="${manifest.file}" property="manifest.available"/>\r
+        <condition property="splashscreen.available">\r
+            <and>\r
+                <not>\r
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>\r
+                </not>\r
+                <available file="${application.splash}"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="main.class.available">\r
+            <and>\r
+                <isset property="main.class"/>\r
+                <not>\r
+                    <equals arg1="${main.class}" arg2="" trim="true"/>\r
+                </not>\r
+            </and>\r
+        </condition>\r
+        <condition property="manifest.available+main.class">\r
+            <and>\r
+                <isset property="manifest.available"/>\r
+                <isset property="main.class.available"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="do.archive">\r
+            <not>\r
+                <istrue value="${jar.archive.disabled}"/>\r
+            </not>\r
+        </condition>\r
+        <condition property="do.mkdist">\r
+            <and>\r
+                <isset property="do.archive"/>\r
+                <isset property="libs.CopyLibs.classpath"/>\r
+                <not>\r
+                    <istrue value="${mkdist.disabled}"/>\r
+                </not>\r
+            </and>\r
+        </condition>\r
+        <condition property="manifest.available+main.class+mkdist.available">\r
+            <and>\r
+                <istrue value="${manifest.available+main.class}"/>\r
+                <isset property="do.mkdist"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="do.archive+manifest.available">\r
+            <and>\r
+                <isset property="manifest.available"/>\r
+                <istrue value="${do.archive}"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="do.archive+main.class.available">\r
+            <and>\r
+                <isset property="main.class.available"/>\r
+                <istrue value="${do.archive}"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="do.archive+splashscreen.available">\r
+            <and>\r
+                <isset property="splashscreen.available"/>\r
+                <istrue value="${do.archive}"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="do.archive+manifest.available+main.class">\r
+            <and>\r
+                <istrue value="${manifest.available+main.class}"/>\r
+                <istrue value="${do.archive}"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="manifest.available-mkdist.available">\r
+            <or>\r
+                <istrue value="${manifest.available}"/>\r
+                <isset property="do.mkdist"/>\r
+            </or>\r
+        </condition>\r
+        <condition property="manifest.available+main.class-mkdist.available">\r
+            <or>\r
+                <istrue value="${manifest.available+main.class}"/>\r
+                <isset property="do.mkdist"/>\r
+            </or>\r
+        </condition>\r
+        <condition property="have.tests">\r
+            <or>\r
+                <available file="${test.src.dir}"/>\r
+            </or>\r
+        </condition>\r
+        <condition property="have.sources">\r
+            <or>\r
+                <available file="${src.dir}"/>\r
+            </or>\r
+        </condition>\r
+        <condition property="netbeans.home+have.tests">\r
+            <and>\r
+                <isset property="netbeans.home"/>\r
+                <isset property="have.tests"/>\r
+            </and>\r
+        </condition>\r
+        <condition property="no.javadoc.preview">\r
+            <and>\r
+                <isset property="javadoc.preview"/>\r
+                <isfalse value="${javadoc.preview}"/>\r
+            </and>\r
+        </condition>\r
+        <property name="run.jvmargs" value=""/>\r
+        <property name="javac.compilerargs" value=""/>\r
+        <property name="work.dir" value="${basedir}"/>\r
+        <condition property="no.deps">\r
+            <and>\r
+                <istrue value="${no.dependencies}"/>\r
+            </and>\r
+        </condition>\r
+        <property name="javac.debug" value="true"/>\r
+        <property name="javadoc.preview" value="true"/>\r
+        <property name="application.args" value=""/>\r
+        <property name="source.encoding" value="${file.encoding}"/>\r
+        <property name="runtime.encoding" value="${source.encoding}"/>\r
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">\r
+            <and>\r
+                <isset property="javadoc.encoding"/>\r
+                <not>\r
+                    <equals arg1="${javadoc.encoding}" arg2=""/>\r
+                </not>\r
+            </and>\r
+        </condition>\r
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>\r
+        <property name="includes" value="**"/>\r
+        <property name="excludes" value=""/>\r
+        <property name="do.depend" value="false"/>\r
+        <condition property="do.depend.true">\r
+            <istrue value="${do.depend}"/>\r
+        </condition>\r
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>\r
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">\r
+            <length length="0" string="${endorsed.classpath}" when="greater"/>\r
+        </condition>\r
+        <condition else="false" property="jdkBug6558476">\r
+            <and>\r
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>\r
+                <not>\r
+                    <os family="unix"/>\r
+                </not>\r
+            </and>\r
+        </condition>\r
+        <property name="javac.fork" value="${jdkBug6558476}"/>\r
+        <property name="jar.index" value="false"/>\r
+        <property name="jar.index.metainf" value="${jar.index}"/>\r
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>\r
+    </target>\r
+    <target name="-post-init">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">\r
+        <fail unless="src.dir">Must set src.dir</fail>\r
+        <fail unless="test.src.dir">Must set test.src.dir</fail>\r
+        <fail unless="build.dir">Must set build.dir</fail>\r
+        <fail unless="dist.dir">Must set dist.dir</fail>\r
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>\r
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>\r
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>\r
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>\r
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>\r
+        <fail unless="dist.jar">Must set dist.jar</fail>\r
+    </target>\r
+    <target name="-init-macrodef-property">\r
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">\r
+            <attribute name="name"/>\r
+            <attribute name="value"/>\r
+            <sequential>\r
+                <property name="@{name}" value="${@{value}}"/>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">\r
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">\r
+            <attribute default="${src.dir}" name="srcdir"/>\r
+            <attribute default="${build.classes.dir}" name="destdir"/>\r
+            <attribute default="${javac.classpath}" name="classpath"/>\r
+            <attribute default="${javac.processorpath}" name="processorpath"/>\r
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>\r
+            <attribute default="${includes}" name="includes"/>\r
+            <attribute default="${excludes}" name="excludes"/>\r
+            <attribute default="${javac.debug}" name="debug"/>\r
+            <attribute default="${empty.dir}" name="sourcepath"/>\r
+            <attribute default="${empty.dir}" name="gensrcdir"/>\r
+            <element name="customize" optional="true"/>\r
+            <sequential>\r
+                <property location="${build.dir}/empty" name="empty.dir"/>\r
+                <mkdir dir="${empty.dir}"/>\r
+                <mkdir dir="@{apgeneratedsrcdir}"/>\r
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">\r
+                    <src>\r
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">\r
+                            <include name="*"/>\r
+                        </dirset>\r
+                    </src>\r
+                    <classpath>\r
+                        <path path="@{classpath}"/>\r
+                    </classpath>\r
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>\r
+                    <compilerarg line="${javac.compilerargs}"/>\r
+                    <compilerarg value="-processorpath"/>\r
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>\r
+                    <compilerarg line="${ap.processors.internal}"/>\r
+                    <compilerarg line="${annotation.processing.processor.options}"/>\r
+                    <compilerarg value="-s"/>\r
+                    <compilerarg path="@{apgeneratedsrcdir}"/>\r
+                    <compilerarg line="${ap.proc.none.internal}"/>\r
+                    <customize/>\r
+                </javac>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">\r
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">\r
+            <attribute default="${src.dir}" name="srcdir"/>\r
+            <attribute default="${build.classes.dir}" name="destdir"/>\r
+            <attribute default="${javac.classpath}" name="classpath"/>\r
+            <attribute default="${javac.processorpath}" name="processorpath"/>\r
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>\r
+            <attribute default="${includes}" name="includes"/>\r
+            <attribute default="${excludes}" name="excludes"/>\r
+            <attribute default="${javac.debug}" name="debug"/>\r
+            <attribute default="${empty.dir}" name="sourcepath"/>\r
+            <attribute default="${empty.dir}" name="gensrcdir"/>\r
+            <element name="customize" optional="true"/>\r
+            <sequential>\r
+                <property location="${build.dir}/empty" name="empty.dir"/>\r
+                <mkdir dir="${empty.dir}"/>\r
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">\r
+                    <src>\r
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">\r
+                            <include name="*"/>\r
+                        </dirset>\r
+                    </src>\r
+                    <classpath>\r
+                        <path path="@{classpath}"/>\r
+                    </classpath>\r
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>\r
+                    <compilerarg line="${javac.compilerargs}"/>\r
+                    <customize/>\r
+                </javac>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">\r
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">\r
+            <attribute default="${src.dir}" name="srcdir"/>\r
+            <attribute default="${build.classes.dir}" name="destdir"/>\r
+            <attribute default="${javac.classpath}" name="classpath"/>\r
+            <sequential>\r
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">\r
+                    <classpath>\r
+                        <path path="@{classpath}"/>\r
+                    </classpath>\r
+                </depend>\r
+            </sequential>\r
+        </macrodef>\r
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">\r
+            <attribute default="${build.classes.dir}" name="destdir"/>\r
+            <sequential>\r
+                <fail unless="javac.includes">Must set javac.includes</fail>\r
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">\r
+                    <path>\r
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>\r
+                    </path>\r
+                    <globmapper from="*.java" to="*.class"/>\r
+                </pathconvert>\r
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>\r
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>\r
+                <delete>\r
+                    <files includesfile="${javac.includesfile.binary}"/>\r
+                </delete>\r
+                <delete>\r
+                    <fileset file="${javac.includesfile.binary}"/>\r
+                </delete>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target name="-init-macrodef-junit">\r
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">\r
+            <attribute default="${includes}" name="includes"/>\r
+            <attribute default="${excludes}" name="excludes"/>\r
+            <attribute default="**" name="testincludes"/>\r
+            <sequential>\r
+                <property name="junit.forkmode" value="perTest"/>\r
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">\r
+                    <batchtest todir="${build.test.results.dir}">\r
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">\r
+                            <filename name="@{testincludes}"/>\r
+                        </fileset>\r
+                    </batchtest>\r
+                    <classpath>\r
+                        <path path="${run.test.classpath}"/>\r
+                    </classpath>\r
+                    <syspropertyset>\r
+                        <propertyref prefix="test-sys-prop."/>\r
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>\r
+                    </syspropertyset>\r
+                    <formatter type="brief" usefile="false"/>\r
+                    <formatter type="xml"/>\r
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>\r
+                    <jvmarg value="-ea"/>\r
+                    <jvmarg line="${run.jvmargs}"/>\r
+                </junit>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>\r
+    <target name="-profile-pre-init">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target name="-profile-post-init">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target name="-profile-init-macrodef-profile">\r
+        <macrodef name="resolve">\r
+            <attribute name="name"/>\r
+            <attribute name="value"/>\r
+            <sequential>\r
+                <property name="@{name}" value="${env.@{value}}"/>\r
+            </sequential>\r
+        </macrodef>\r
+        <macrodef name="profile">\r
+            <attribute default="${main.class}" name="classname"/>\r
+            <element name="customize" optional="true"/>\r
+            <sequential>\r
+                <property environment="env"/>\r
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>\r
+                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">\r
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>\r
+                    <jvmarg line="${profiler.info.jvmargs}"/>\r
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>\r
+                    <arg line="${application.args}"/>\r
+                    <classpath>\r
+                        <path path="${run.classpath}"/>\r
+                    </classpath>\r
+                    <syspropertyset>\r
+                        <propertyref prefix="run-sys-prop."/>\r
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>\r
+                    </syspropertyset>\r
+                    <customize/>\r
+                </java>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">\r
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>\r
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>\r
+    </target>\r
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">\r
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">\r
+            <attribute default="${main.class}" name="name"/>\r
+            <attribute default="${debug.classpath}" name="classpath"/>\r
+            <attribute default="" name="stopclassname"/>\r
+            <sequential>\r
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">\r
+                    <classpath>\r
+                        <path path="@{classpath}"/>\r
+                    </classpath>\r
+                </nbjpdastart>\r
+            </sequential>\r
+        </macrodef>\r
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">\r
+            <attribute default="${build.classes.dir}" name="dir"/>\r
+            <sequential>\r
+                <nbjpdareload>\r
+                    <fileset dir="@{dir}" includes="${fix.classes}">\r
+                        <include name="${fix.includes}*.class"/>\r
+                    </fileset>\r
+                </nbjpdareload>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target name="-init-debug-args">\r
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>\r
+        <condition property="have-jdk-older-than-1.4">\r
+            <or>\r
+                <contains string="${version-output}" substring="java version &quot;1.0"/>\r
+                <contains string="${version-output}" substring="java version &quot;1.1"/>\r
+                <contains string="${version-output}" substring="java version &quot;1.2"/>\r
+                <contains string="${version-output}" substring="java version &quot;1.3"/>\r
+            </or>\r
+        </condition>\r
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">\r
+            <istrue value="${have-jdk-older-than-1.4}"/>\r
+        </condition>\r
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">\r
+            <os family="windows"/>\r
+        </condition>\r
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">\r
+            <isset property="debug.transport"/>\r
+        </condition>\r
+    </target>\r
+    <target depends="-init-debug-args" name="-init-macrodef-debug">\r
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">\r
+            <attribute default="${main.class}" name="classname"/>\r
+            <attribute default="${debug.classpath}" name="classpath"/>\r
+            <element name="customize" optional="true"/>\r
+            <sequential>\r
+                <java classname="@{classname}" dir="${work.dir}" fork="true">\r
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>\r
+                    <jvmarg line="${debug-args-line}"/>\r
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>\r
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>\r
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>\r
+                    <jvmarg line="${run.jvmargs}"/>\r
+                    <classpath>\r
+                        <path path="@{classpath}"/>\r
+                    </classpath>\r
+                    <syspropertyset>\r
+                        <propertyref prefix="run-sys-prop."/>\r
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>\r
+                    </syspropertyset>\r
+                    <customize/>\r
+                </java>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target name="-init-macrodef-java">\r
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">\r
+            <attribute default="${main.class}" name="classname"/>\r
+            <attribute default="${run.classpath}" name="classpath"/>\r
+            <element name="customize" optional="true"/>\r
+            <sequential>\r
+                <java classname="@{classname}" dir="${work.dir}" fork="true">\r
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>\r
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>\r
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>\r
+                    <jvmarg line="${run.jvmargs}"/>\r
+                    <classpath>\r
+                        <path path="@{classpath}"/>\r
+                    </classpath>\r
+                    <syspropertyset>\r
+                        <propertyref prefix="run-sys-prop."/>\r
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>\r
+                    </syspropertyset>\r
+                    <customize/>\r
+                </java>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target name="-init-macrodef-copylibs">\r
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">\r
+            <attribute default="${manifest.file}" name="manifest"/>\r
+            <element name="customize" optional="true"/>\r
+            <sequential>\r
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>\r
+                <pathconvert property="run.classpath.without.build.classes.dir">\r
+                    <path path="${run.classpath}"/>\r
+                    <map from="${build.classes.dir.resolved}" to=""/>\r
+                </pathconvert>\r
+                <pathconvert pathsep=" " property="jar.classpath">\r
+                    <path path="${run.classpath.without.build.classes.dir}"/>\r
+                    <chainedmapper>\r
+                        <flattenmapper/>\r
+                        <globmapper from="*" to="lib/*"/>\r
+                    </chainedmapper>\r
+                </pathconvert>\r
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>\r
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">\r
+                    <fileset dir="${build.classes.dir}"/>\r
+                    <manifest>\r
+                        <attribute name="Class-Path" value="${jar.classpath}"/>\r
+                        <customize/>\r
+                    </manifest>\r
+                </copylibs>\r
+            </sequential>\r
+        </macrodef>\r
+    </target>\r
+    <target name="-init-presetdef-jar">\r
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">\r
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">\r
+                <j2seproject1:fileset dir="${build.classes.dir}"/>\r
+            </jar>\r
+        </presetdef>\r
+    </target>\r
+    <target name="-init-ap-cmdline-properties">\r
+        <property name="annotation.processing.enabled" value="true"/>\r
+        <property name="annotation.processing.processors.list" value=""/>\r
+        <property name="annotation.processing.processor.options" value=""/>\r
+        <property name="annotation.processing.run.all.processors" value="true"/>\r
+        <property name="javac.processorpath" value="${javac.classpath}"/>\r
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>\r
+        <condition property="ap.supported.internal" value="true">\r
+            <not>\r
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>\r
+            </not>\r
+        </condition>\r
+    </target>\r
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">\r
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">\r
+            <isfalse value="${annotation.processing.run.all.processors}"/>\r
+        </condition>\r
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">\r
+            <isfalse value="${annotation.processing.enabled}"/>\r
+        </condition>\r
+    </target>\r
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">\r
+        <property name="ap.cmd.line.internal" value=""/>\r
+    </target>\r
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>\r
+    <!--\r
+                ===================\r
+                COMPILATION SECTION\r
+                ===================\r
+            -->\r
+    <target name="-deps-jar-init" unless="built-jar.properties">\r
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>\r
+        <delete file="${built-jar.properties}" quiet="true"/>\r
+    </target>\r
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">\r
+        <echo level="warn" message="Cycle detected: MediaInfoWrapper was already built"/>\r
+    </target>\r
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">\r
+        <mkdir dir="${build.dir}"/>\r
+        <touch file="${built-jar.properties}" verbose="false"/>\r
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>\r
+        <antcall target="-warn-already-built-jar"/>\r
+        <propertyfile file="${built-jar.properties}">\r
+            <entry key="${basedir}" value=""/>\r
+        </propertyfile>\r
+    </target>\r
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>\r
+    <target depends="init" name="-check-automatic-build">\r
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>\r
+    </target>\r
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">\r
+        <antcall target="clean"/>\r
+    </target>\r
+    <target depends="init,deps-jar" name="-pre-pre-compile">\r
+        <mkdir dir="${build.classes.dir}"/>\r
+    </target>\r
+    <target name="-pre-compile">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target if="do.depend.true" name="-compile-depend">\r
+        <pathconvert property="build.generated.subdirs">\r
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">\r
+                <include name="*"/>\r
+            </dirset>\r
+        </pathconvert>\r
+        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>\r
+    </target>\r
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">\r
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>\r
+        <copy todir="${build.classes.dir}">\r
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>\r
+        </copy>\r
+    </target>\r
+    <target if="has.persistence.xml" name="-copy-persistence-xml">\r
+        <mkdir dir="${build.classes.dir}/META-INF"/>\r
+        <copy todir="${build.classes.dir}/META-INF">\r
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>\r
+        </copy>\r
+    </target>\r
+    <target name="-post-compile">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>\r
+    <target name="-pre-compile-single">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">\r
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>\r
+        <j2seproject3:force-recompile/>\r
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>\r
+    </target>\r
+    <target name="-post-compile-single">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>\r
+    <!--\r
+                ====================\r
+                JAR BUILDING SECTION\r
+                ====================\r
+            -->\r
+    <target depends="init" name="-pre-pre-jar">\r
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>\r
+        <mkdir dir="${dist.jar.dir}"/>\r
+    </target>\r
+    <target name="-pre-jar">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">\r
+        <j2seproject1:jar/>\r
+    </target>\r
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">\r
+        <j2seproject1:jar manifest="${manifest.file}"/>\r
+    </target>\r
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">\r
+        <j2seproject1:jar manifest="${manifest.file}">\r
+            <j2seproject1:manifest>\r
+                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>\r
+            </j2seproject1:manifest>\r
+        </j2seproject1:jar>\r
+        <echo level="info">To run this application from the command line without Ant, try:</echo>\r
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>\r
+        <property location="${dist.jar}" name="dist.jar.resolved"/>\r
+        <pathconvert property="run.classpath.with.dist.jar">\r
+            <path path="${run.classpath}"/>\r
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>\r
+        </pathconvert>\r
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>\r
+    </target>\r
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">\r
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>\r
+        <touch file="${tmp.manifest.file}" verbose="false"/>\r
+    </target>\r
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">\r
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>\r
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>\r
+    </target>\r
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">\r
+        <manifest file="${tmp.manifest.file}" mode="update">\r
+            <attribute name="Main-Class" value="${main.class}"/>\r
+        </manifest>\r
+    </target>\r
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">\r
+        <basename file="${application.splash}" property="splashscreen.basename"/>\r
+        <mkdir dir="${build.classes.dir}/META-INF"/>\r
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>\r
+        <manifest file="${tmp.manifest.file}" mode="update">\r
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>\r
+        </manifest>\r
+    </target>\r
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">\r
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>\r
+        <echo level="info">To run this application from the command line without Ant, try:</echo>\r
+        <property location="${dist.jar}" name="dist.jar.resolved"/>\r
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>\r
+    </target>\r
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">\r
+        <delete>\r
+            <fileset file="${tmp.manifest.file}"/>\r
+        </delete>\r
+    </target>\r
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>\r
+    <target name="-post-jar">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>\r
+    <!--\r
+                =================\r
+                EXECUTION SECTION\r
+                =================\r
+            -->\r
+    <target depends="init,compile" description="Run a main class." name="run">\r
+        <j2seproject1:java>\r
+            <customize>\r
+                <arg line="${application.args}"/>\r
+            </customize>\r
+        </j2seproject1:java>\r
+    </target>\r
+    <target name="-do-not-recompile">\r
+        <property name="javac.includes.binary" value=""/>\r
+    </target>\r
+    <target depends="init,compile-single" name="run-single">\r
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>\r
+        <j2seproject1:java classname="${run.class}"/>\r
+    </target>\r
+    <target depends="init,compile-test-single" name="run-test-with-main">\r
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>\r
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>\r
+    </target>\r
+    <!--\r
+                =================\r
+                DEBUGGING SECTION\r
+                =================\r
+            -->\r
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">\r
+        <j2seproject1:nbjpdastart name="${debug.class}"/>\r
+    </target>\r
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">\r
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>\r
+    </target>\r
+    <target depends="init,compile" name="-debug-start-debuggee">\r
+        <j2seproject3:debug>\r
+            <customize>\r
+                <arg line="${application.args}"/>\r
+            </customize>\r
+        </j2seproject3:debug>\r
+    </target>\r
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>\r
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">\r
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>\r
+    </target>\r
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>\r
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">\r
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>\r
+        <j2seproject3:debug classname="${debug.class}"/>\r
+    </target>\r
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>\r
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">\r
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>\r
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>\r
+    </target>\r
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>\r
+    <target depends="init" name="-pre-debug-fix">\r
+        <fail unless="fix.includes">Must set fix.includes</fail>\r
+        <property name="javac.includes" value="${fix.includes}.java"/>\r
+    </target>\r
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">\r
+        <j2seproject1:nbjpdareload/>\r
+    </target>\r
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>\r
+    <!--\r
+                =================\r
+                PROFILING SECTION\r
+                =================\r
+            -->\r
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">\r
+        <nbprofiledirect>\r
+            <classpath>\r
+                <path path="${run.classpath}"/>\r
+            </classpath>\r
+        </nbprofiledirect>\r
+        <profile/>\r
+    </target>\r
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">\r
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>\r
+        <nbprofiledirect>\r
+            <classpath>\r
+                <path path="${run.classpath}"/>\r
+            </classpath>\r
+        </nbprofiledirect>\r
+        <profile classname="${profile.class}"/>\r
+    </target>\r
+    <!--\r
+                =========================\r
+                APPLET PROFILING  SECTION\r
+                =========================\r
+            -->\r
+    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">\r
+        <nbprofiledirect>\r
+            <classpath>\r
+                <path path="${run.classpath}"/>\r
+            </classpath>\r
+        </nbprofiledirect>\r
+        <profile classname="sun.applet.AppletViewer">\r
+            <customize>\r
+                <arg value="${applet.url}"/>\r
+            </customize>\r
+        </profile>\r
+    </target>\r
+    <!--\r
+                =========================\r
+                TESTS PROFILING  SECTION\r
+                =========================\r
+            -->\r
+    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">\r
+        <nbprofiledirect>\r
+            <classpath>\r
+                <path path="${run.test.classpath}"/>\r
+            </classpath>\r
+        </nbprofiledirect>\r
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">\r
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>\r
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>\r
+            <jvmarg line="${profiler.info.jvmargs}"/>\r
+            <test name="${profile.class}"/>\r
+            <classpath>\r
+                <path path="${run.test.classpath}"/>\r
+            </classpath>\r
+            <syspropertyset>\r
+                <propertyref prefix="test-sys-prop."/>\r
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>\r
+            </syspropertyset>\r
+            <formatter type="brief" usefile="false"/>\r
+            <formatter type="xml"/>\r
+        </junit>\r
+    </target>\r
+    <!--\r
+                ===============\r
+                JAVADOC SECTION\r
+                ===============\r
+            -->\r
+    <target depends="init" if="have.sources" name="-javadoc-build">\r
+        <mkdir dir="${dist.javadoc.dir}"/>\r
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">\r
+            <classpath>\r
+                <path path="${javac.classpath}"/>\r
+            </classpath>\r
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">\r
+                <filename name="**/*.java"/>\r
+            </fileset>\r
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">\r
+                <include name="**/*.java"/>\r
+            </fileset>\r
+        </javadoc>\r
+        <copy todir="${dist.javadoc.dir}">\r
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">\r
+                <filename name="**/doc-files/**"/>\r
+            </fileset>\r
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">\r
+                <include name="**/doc-files/**"/>\r
+            </fileset>\r
+        </copy>\r
+    </target>\r
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">\r
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>\r
+    </target>\r
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>\r
+    <!--\r
+                =========================\r
+                JUNIT COMPILATION SECTION\r
+                =========================\r
+            -->\r
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">\r
+        <mkdir dir="${build.test.classes.dir}"/>\r
+    </target>\r
+    <target name="-pre-compile-test">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target if="do.depend.true" name="-compile-test-depend">\r
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>\r
+    </target>\r
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">\r
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>\r
+        <copy todir="${build.test.classes.dir}">\r
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>\r
+        </copy>\r
+    </target>\r
+    <target name="-post-compile-test">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>\r
+    <target name="-pre-compile-test-single">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">\r
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>\r
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>\r
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>\r
+        <copy todir="${build.test.classes.dir}">\r
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>\r
+        </copy>\r
+    </target>\r
+    <target name="-post-compile-test-single">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>\r
+    <!--\r
+                =======================\r
+                JUNIT EXECUTION SECTION\r
+                =======================\r
+            -->\r
+    <target depends="init" if="have.tests" name="-pre-test-run">\r
+        <mkdir dir="${build.test.results.dir}"/>\r
+    </target>\r
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">\r
+        <j2seproject3:junit testincludes="**/*Test.java"/>\r
+    </target>\r
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">\r
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>\r
+    </target>\r
+    <target depends="init" if="have.tests" name="test-report"/>\r
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>\r
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>\r
+    <target depends="init" if="have.tests" name="-pre-test-run-single">\r
+        <mkdir dir="${build.test.results.dir}"/>\r
+    </target>\r
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">\r
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>\r
+        <j2seproject3:junit excludes="" includes="${test.includes}"/>\r
+    </target>\r
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">\r
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>\r
+    </target>\r
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>\r
+    <!--\r
+                =======================\r
+                JUNIT DEBUGGING SECTION\r
+                =======================\r
+            -->\r
+    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">\r
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>\r
+        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>\r
+        <delete file="${test.report.file}"/>\r
+        <mkdir dir="${build.test.results.dir}"/>\r
+        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">\r
+            <customize>\r
+                <syspropertyset>\r
+                    <propertyref prefix="test-sys-prop."/>\r
+                    <mapper from="test-sys-prop.*" to="*" type="glob"/>\r
+                </syspropertyset>\r
+                <arg value="${test.class}"/>\r
+                <arg value="showoutput=true"/>\r
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>\r
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>\r
+            </customize>\r
+        </j2seproject3:debug>\r
+    </target>\r
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">\r
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>\r
+    </target>\r
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>\r
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">\r
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>\r
+    </target>\r
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>\r
+    <!--\r
+                =========================\r
+                APPLET EXECUTION SECTION\r
+                =========================\r
+            -->\r
+    <target depends="init,compile-single" name="run-applet">\r
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>\r
+        <j2seproject1:java classname="sun.applet.AppletViewer">\r
+            <customize>\r
+                <arg value="${applet.url}"/>\r
+            </customize>\r
+        </j2seproject1:java>\r
+    </target>\r
+    <!--\r
+                =========================\r
+                APPLET DEBUGGING  SECTION\r
+                =========================\r
+            -->\r
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">\r
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>\r
+        <j2seproject3:debug classname="sun.applet.AppletViewer">\r
+            <customize>\r
+                <arg value="${applet.url}"/>\r
+            </customize>\r
+        </j2seproject3:debug>\r
+    </target>\r
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>\r
+    <!--\r
+                ===============\r
+                CLEANUP SECTION\r
+                ===============\r
+            -->\r
+    <target name="-deps-clean-init" unless="built-clean.properties">\r
+        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>\r
+        <delete file="${built-clean.properties}" quiet="true"/>\r
+    </target>\r
+    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">\r
+        <echo level="warn" message="Cycle detected: MediaInfoWrapper was already built"/>\r
+    </target>\r
+    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">\r
+        <mkdir dir="${build.dir}"/>\r
+        <touch file="${built-clean.properties}" verbose="false"/>\r
+        <property file="${built-clean.properties}" prefix="already.built.clean."/>\r
+        <antcall target="-warn-already-built-clean"/>\r
+        <propertyfile file="${built-clean.properties}">\r
+            <entry key="${basedir}" value=""/>\r
+        </propertyfile>\r
+    </target>\r
+    <target depends="init" name="-do-clean">\r
+        <delete dir="${build.dir}"/>\r
+        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>\r
+    </target>\r
+    <target name="-post-clean">\r
+        <!-- Empty placeholder for easier customization. -->\r
+        <!-- You can override this target in the ../build.xml file. -->\r
+    </target>\r
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>\r
+    <target name="-check-call-dep">\r
+        <property file="${call.built.properties}" prefix="already.built."/>\r
+        <condition property="should.call.dep">\r
+            <not>\r
+                <isset property="already.built.${call.subproject}"/>\r
+            </not>\r
+        </condition>\r
+    </target>\r
+    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">\r
+        <ant antfile="${call.script}" inheritall="false" target="${call.target}">\r
+            <propertyset>\r
+                <propertyref prefix="transfer."/>\r
+                <mapper from="transfer.*" to="*" type="glob"/>\r
+            </propertyset>\r
+        </ant>\r
+    </target>\r
+</project>\r
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
new file mode 100644 (file)
index 0000000..c6bf9f9
--- /dev/null
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=d35cfe9e\r
+build.xml.script.CRC32=31e56aca\r
+build.xml.stylesheet.CRC32=28e38971@1.43.1.45\r
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.\r
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.\r
+nbproject/build-impl.xml.data.CRC32=d35cfe9e\r
+nbproject/build-impl.xml.script.CRC32=16d6a9fc\r
+nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45\r
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644 (file)
index 0000000..b0abe23
--- /dev/null
@@ -0,0 +1,72 @@
+annotation.processing.enabled=true\r
+annotation.processing.enabled.in.editor=false\r
+annotation.processing.run.all.processors=true\r
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output\r
+application.title=MediaInfoWrapper\r
+application.vendor=yuki\r
+build.classes.dir=${build.dir}/classes\r
+build.classes.excludes=**/*.java,**/*.form\r
+# This directory is removed when the project is cleaned:\r
+build.dir=build\r
+build.generated.dir=${build.dir}/generated\r
+build.generated.sources.dir=${build.dir}/generated-sources\r
+# Only compile against the classpath explicitly listed here:\r
+build.sysclasspath=ignore\r
+build.test.classes.dir=${build.dir}/test/classes\r
+build.test.results.dir=${build.dir}/test/results\r
+# Uncomment to specify the preferred debugger connection transport:\r
+#debug.transport=dt_socket\r
+debug.classpath=\\r
+    ${run.classpath}\r
+debug.test.classpath=\\r
+    ${run.test.classpath}\r
+# This directory is removed when the project is cleaned:\r
+dist.dir=dist\r
+dist.jar=${dist.dir}/MediaInfoWrapper.jar\r
+dist.javadoc.dir=${dist.dir}/javadoc\r
+endorsed.classpath=\r
+excludes=\r
+includes=**\r
+jar.compress=false\r
+javac.classpath=\r
+# Space-separated list of extra javac options\r
+javac.compilerargs=\r
+javac.deprecation=false\r
+javac.processorpath=\\r
+    ${javac.classpath}\r
+javac.source=1.6\r
+javac.target=1.6\r
+javac.test.classpath=\\r
+    ${javac.classpath}:\\r
+    ${build.classes.dir}\r
+javac.test.processorpath=\\r
+    ${javac.test.classpath}\r
+javadoc.additionalparam=\r
+javadoc.author=false\r
+javadoc.encoding=${source.encoding}\r
+javadoc.noindex=false\r
+javadoc.nonavbar=false\r
+javadoc.notree=false\r
+javadoc.private=false\r
+javadoc.splitindex=true\r
+javadoc.use=true\r
+javadoc.version=false\r
+javadoc.windowtitle=\r
+main.class=mediainfowrapper.MediaInfoWrapper\r
+manifest.file=manifest.mf\r
+meta.inf.dir=${src.dir}/META-INF\r
+mkdist.disabled=false\r
+platform.active=default_platform\r
+run.classpath=\\r
+    ${javac.classpath}:\\r
+    ${build.classes.dir}\r
+# Space-separated list of JVM arguments used when running the project\r
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value\r
+# or test-sys-prop.name=value to set system properties for unit tests):\r
+run.jvmargs=\r
+run.test.classpath=\\r
+    ${javac.test.classpath}:\\r
+    ${build.test.classes.dir}\r
+source.encoding=UTF-8\r
+src.dir=src\r
+test.src.dir=test\r
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100644 (file)
index 0000000..307be8d
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project xmlns="http://www.netbeans.org/ns/project/1">\r
+    <type>org.netbeans.modules.java.j2seproject</type>\r
+    <configuration>\r
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">\r
+            <name>MediaInfoWrapper</name>\r
+            <source-roots>\r
+                <root id="src.dir"/>\r
+            </source-roots>\r
+            <test-roots>\r
+                <root id="test.src.dir"/>\r
+            </test-roots>\r
+        </data>\r
+    </configuration>\r
+</project>\r
diff --git a/src/yukihane/mediainfowrapper/Info.java b/src/yukihane/mediainfowrapper/Info.java
new file mode 100644 (file)
index 0000000..cde8165
--- /dev/null
@@ -0,0 +1,26 @@
+/* $Id: Info.java 44 2010-02-03 09:51:57Z yuki $ */
+package yukihane.mediainfowrapper;
+
+public class Info {
+
+    private final int width;
+    private final int height;
+
+    public Info(int width, int height) {
+        this.width = width;
+        this.height = height;
+    }
+
+    public int getHeight() {
+        return height;
+    }
+
+    public int getWidth() {
+        return width;
+    }
+
+    @Override
+    public String toString() {
+        return "Width:" + width + ", Height:" + height;
+    }
+}
diff --git a/src/yukihane/mediainfowrapper/MediaInfo.java b/src/yukihane/mediainfowrapper/MediaInfo.java
new file mode 100644 (file)
index 0000000..843fcda
--- /dev/null
@@ -0,0 +1,69 @@
+/* $Id: MediaInfo.java 57 2010-02-04 04:43:44Z yuki $ */
+package yukihane.mediainfowrapper;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class MediaInfo {
+
+    public static Info getInfo(File mediaInfoBin, File videoFile) throws IOException {
+        String[] command = new String[]{mediaInfoBin.getPath(), videoFile.getPath()};
+        Process process = Runtime.getRuntime().exec(command);
+        BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+        String line;
+        Pattern widthPattern = Pattern.compile("Width +:(.+)pixels");
+        Pattern heightPattern = Pattern.compile("Height +:(.+)pixels");
+        int width = -1;
+        int height = -1;
+        while ((line = reader.readLine()) != null) {
+            Matcher widthMatcher = widthPattern.matcher(line);
+            if (widthMatcher.find()) {
+                String str = widthMatcher.group(1).replaceAll(" ", "");
+                width = Integer.parseInt(str);
+                continue;
+            }
+
+            Matcher heightMatcher = heightPattern.matcher(line);
+            if (heightMatcher.find()) {
+                String str = heightMatcher.group(1).replaceAll(" ", "");
+                height = Integer.parseInt(str);
+                continue;
+            }
+        }
+        return new Info(width, height);
+    }
+
+    public static Size adjustSize(Info info, int maxWidth, int maxHeight) {
+        int nowWidth = info.getWidth();
+        int nowHeight = info.getHeight();
+
+        if (nowWidth <= maxWidth && nowHeight <= maxHeight) {
+            return new Size(nowWidth, nowHeight);
+        }
+
+        double widthRatio = calcRatio(nowWidth, maxWidth);
+        double heightRatio = calcRatio(nowHeight, maxHeight);
+
+        if (widthRatio >= heightRatio) {
+            int adjustedWidth = adjust(nowWidth, widthRatio);
+            int adjustedHeight = adjust(nowHeight, widthRatio);
+            return new Size(adjustedWidth, adjustedHeight);
+        } else {
+            int adjustedWidth = adjust(nowWidth, heightRatio);
+            int adjustedHeight = adjust(nowHeight, heightRatio);
+            return new Size(adjustedWidth, adjustedHeight);
+        }
+    }
+
+    private static double calcRatio(int now, int max) {
+        return (double) now / (double) max;
+    }
+
+    private static int adjust(int size, double ratio) {
+        return (int) (size / ratio);
+    }
+}
diff --git a/src/yukihane/mediainfowrapper/Size.java b/src/yukihane/mediainfowrapper/Size.java
new file mode 100644 (file)
index 0000000..8236204
--- /dev/null
@@ -0,0 +1,26 @@
+/* $Id: Size.java 44 2010-02-03 09:51:57Z yuki $ */
+
+package yukihane.mediainfowrapper;
+
+public class Size {
+    private final int width;
+    private final int height;
+
+    public Size(int width, int height) {
+        this.width = width;
+        this.height = height;
+    }
+
+    public int getHeight() {
+        return height;
+    }
+
+    public int getWidth() {
+        return width;
+    }
+
+    @Override
+    public String toString() {
+        return "Width:" + width + ", Height:" + height;
+    }
+}