diff --git a/apps/autostepper/AutoStepper.jar b/apps/autostepper/AutoStepper.jar new file mode 100644 index 0000000..1309088 Binary files /dev/null and b/apps/autostepper/AutoStepper.jar differ diff --git a/apps/autostepper/LICENSE.md b/apps/autostepper/LICENSE.md new file mode 100644 index 0000000..99bb8c8 --- /dev/null +++ b/apps/autostepper/LICENSE.md @@ -0,0 +1,9 @@ +** LICENSING: Modified MIT license to restrict commercial use & require attribution ** + +Copyright (c) 2018 Phr00t's Software + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software with only commercial use restrictions & a requirement to attribute Phr00t's Software. You are free to to use, copy, modify, merge, publish, distribute this Software for private, personal & non-commercial uses as long as Phr00t's Software is attributed. + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/apps/autostepper/lib/jl1.0.1.jar b/apps/autostepper/lib/jl1.0.1.jar new file mode 100644 index 0000000..bb6b623 Binary files /dev/null and b/apps/autostepper/lib/jl1.0.1.jar differ diff --git a/apps/autostepper/lib/jsoup-1.11.2.jar b/apps/autostepper/lib/jsoup-1.11.2.jar new file mode 100644 index 0000000..e4be2ae Binary files /dev/null and b/apps/autostepper/lib/jsoup-1.11.2.jar differ diff --git a/apps/autostepper/lib/mp3spi1.9.5.jar b/apps/autostepper/lib/mp3spi1.9.5.jar new file mode 100644 index 0000000..0c74dae Binary files /dev/null and b/apps/autostepper/lib/mp3spi1.9.5.jar differ diff --git a/apps/autostepper/lib/tritonus_aos.jar b/apps/autostepper/lib/tritonus_aos.jar new file mode 100644 index 0000000..4a02386 Binary files /dev/null and b/apps/autostepper/lib/tritonus_aos.jar differ diff --git a/apps/autostepper/lib/tritonus_share.jar b/apps/autostepper/lib/tritonus_share.jar new file mode 100644 index 0000000..bb367d1 Binary files /dev/null and b/apps/autostepper/lib/tritonus_share.jar differ diff --git a/apps/autostepper/lib/trove-3.0.3.jar b/apps/autostepper/lib/trove-3.0.3.jar new file mode 100644 index 0000000..cd00f93 Binary files /dev/null and b/apps/autostepper/lib/trove-3.0.3.jar differ diff --git a/src/nat/ArchiveController.kiss b/src/nat/ArchiveController.kiss index efa0801..63e656a 100644 --- a/src/nat/ArchiveController.kiss +++ b/src/nat/ArchiveController.kiss @@ -205,6 +205,7 @@ (archive.addSystem (new ImageAttachmentSystem)) (archive.addSystem (new KeyShortcutSystem this)) (archive.addSystem (new DLSystem)) + (archive.addSystem (new AutoStepperSystem)) (whenLet [ps (ui.playgroundSystem)] (set playgroundSystem ps) (archive.addSystem ps) diff --git a/src/nat/systems/AutoStepperSystem.hx b/src/nat/systems/AutoStepperSystem.hx new file mode 100644 index 0000000..9314f07 --- /dev/null +++ b/src/nat/systems/AutoStepperSystem.hx @@ -0,0 +1,18 @@ +package nat.systems; + +import kiss.Prelude; +import kiss.List; +import nat.System; +import haxe.Json; +#if target.threaded +import sys.thread.Thread; +#end + +using haxe.io.Path; + +/** + * Base System that processes Entries based on whether they have file attachments + * which match a given set of extensions + */ +@:build(kiss.Kiss.build()) +class AutoStepperSystem extends AttachmentSystem {} diff --git a/src/nat/systems/AutoStepperSystem.kiss b/src/nat/systems/AutoStepperSystem.kiss new file mode 100644 index 0000000..793c930 --- /dev/null +++ b/src/nat/systems/AutoStepperSystem.kiss @@ -0,0 +1,28 @@ +(load "../Lib.kiss") + +(defNew [] + [:String jarPath (joinPath (libPath "nat-archive-tool") "apps/autostepper/AutoStepper.jar")] + (super + ["mp3"] + ->[archive e mp3Files &opt ui] + (unless (tagsMatch e "stepperProcessed") + (doFor file mp3Files + (localFunction runAutoStepper [] + (try + { + (ui.displayMessage "autoStepping $file") + ``` + java -jar "${jarPath}" input="$(archive.filePath file)" duration=130 hard=true + ``` + (ui.displayMessage "done autostepping $file") + // TODO attach the simfile and tag this as processed after ALL mp3 threads finish + **(addTags archive e ["stepperProcessed"]) + } + (catch [e] (ui.displayMessage "failed autostepping $file")))) + + (#if target.threaded + (Thread.create runAutoStepper) + { + (ui.displayMessage "threading unavailable -- the program will freeze while autostepping") + (runAutoStepper) + }))))) \ No newline at end of file