AutoStepper system

This commit is contained in:
2022-09-18 22:42:57 +00:00
parent f5df653db4
commit adf5d5c85b
11 changed files with 56 additions and 0 deletions

Binary file not shown.

View 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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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)

View 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 {}

View 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)
})))))