AutoStepper system
This commit is contained in:
BIN
apps/autostepper/AutoStepper.jar
Normal file
BIN
apps/autostepper/AutoStepper.jar
Normal file
Binary file not shown.
9
apps/autostepper/LICENSE.md
Normal file
9
apps/autostepper/LICENSE.md
Normal file
@@ -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.
|
BIN
apps/autostepper/lib/jl1.0.1.jar
Normal file
BIN
apps/autostepper/lib/jl1.0.1.jar
Normal file
Binary file not shown.
BIN
apps/autostepper/lib/jsoup-1.11.2.jar
Normal file
BIN
apps/autostepper/lib/jsoup-1.11.2.jar
Normal file
Binary file not shown.
BIN
apps/autostepper/lib/mp3spi1.9.5.jar
Normal file
BIN
apps/autostepper/lib/mp3spi1.9.5.jar
Normal file
Binary file not shown.
BIN
apps/autostepper/lib/tritonus_aos.jar
Normal file
BIN
apps/autostepper/lib/tritonus_aos.jar
Normal file
Binary file not shown.
BIN
apps/autostepper/lib/tritonus_share.jar
Normal file
BIN
apps/autostepper/lib/tritonus_share.jar
Normal file
Binary file not shown.
BIN
apps/autostepper/lib/trove-3.0.3.jar
Normal file
BIN
apps/autostepper/lib/trove-3.0.3.jar
Normal file
Binary file not shown.
@@ -205,6 +205,7 @@
|
|||||||
(archive.addSystem (new ImageAttachmentSystem))
|
(archive.addSystem (new ImageAttachmentSystem))
|
||||||
(archive.addSystem (new KeyShortcutSystem this))
|
(archive.addSystem (new KeyShortcutSystem this))
|
||||||
(archive.addSystem (new DLSystem))
|
(archive.addSystem (new DLSystem))
|
||||||
|
(archive.addSystem (new AutoStepperSystem))
|
||||||
(whenLet [ps (ui.playgroundSystem)]
|
(whenLet [ps (ui.playgroundSystem)]
|
||||||
(set playgroundSystem ps)
|
(set playgroundSystem ps)
|
||||||
(archive.addSystem ps)
|
(archive.addSystem ps)
|
||||||
|
18
src/nat/systems/AutoStepperSystem.hx
Normal file
18
src/nat/systems/AutoStepperSystem.hx
Normal file
@@ -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 {}
|
28
src/nat/systems/AutoStepperSystem.kiss
Normal file
28
src/nat/systems/AutoStepperSystem.kiss
Normal file
@@ -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)
|
||||||
|
})))))
|
Reference in New Issue
Block a user