Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate core and contributed libraries #43

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {
ext.kotlin_version = '1.3.50'
ext.koin_version = '2.0.0-beta-1'
ext.lib_dir = properties.getProperty('libraries.dir')
ext.processing_core_dir = properties.getProperty('processing_core.dir')

repositories {
mavenCentral()
Expand All @@ -30,16 +31,14 @@ repositories {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

// Processing libs
compile fileTree(dir: 'library', include: '*.jar')
compile fileTree(dir: 'library/minim/library', include: '*.jar')
compile fileTree(dir: 'library/serial/library', include: '*.jar')
compile fileTree(dir: 'library/controlP5/library', include: '*.jar')
compile fileTree(dir: 'library/themidibus/library', include: '*.jar')
compile fileTree(dir: 'library/videoexport/library', include: '*.jar')
compile fileTree(dir: 'library/box2d_processing/library', include: '*.jar')
compile fileTree(dir: 'library/video/library', include: '*.jar')
compile fileTree(dir: 'library/extruder/library', include: '*.jar')
// Processing
compile fileTree(dir: "$processing_core_dir", include: '*.jar')
compile fileTree(dir: "$lib_dir/minim/library", include: '*.jar')
compile fileTree(dir: "$lib_dir/themidibus/library", include: '*.jar')
compile fileTree(dir: "$lib_dir/VideoExport/library", include: '*.jar')
compile fileTree(dir: "$lib_dir/box2d_processing/library", include: '*.jar')
compile fileTree(dir: "$lib_dir/video/library", include: '*.jar')
compile fileTree(dir: "$lib_dir/extruder/library", include: '*.jar')
compile fileTree(dir: "$lib_dir/geomerative/library", include: '*.jar')
compile fileTree(dir: "$lib_dir/PostFX/library", include: '*.jar')

Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed library/controlP5/library/controlP5.jar
Binary file not shown.
Binary file removed library/core.jar
Binary file not shown.
12 changes: 0 additions & 12 deletions library/export.txt

This file was deleted.

Binary file removed library/extruder/library/extruder.jar
Binary file not shown.
Binary file removed library/gluegen-rt-natives-linux-aarch64.jar
Binary file not shown.
Binary file removed library/gluegen-rt-natives-linux-amd64.jar
Binary file not shown.
Binary file removed library/gluegen-rt-natives-linux-armv6hf.jar
Binary file not shown.
Binary file removed library/gluegen-rt-natives-linux-i586.jar
Binary file not shown.
Binary file removed library/gluegen-rt-natives-macosx-universal.jar
Binary file not shown.
Binary file removed library/gluegen-rt-natives-windows-amd64.jar
Binary file not shown.
Binary file removed library/gluegen-rt-natives-windows-i586.jar
Binary file not shown.
Binary file removed library/gluegen-rt.jar
Binary file not shown.
Binary file removed library/jogl-all-natives-linux-aarch64.jar
Binary file not shown.
Binary file removed library/jogl-all-natives-linux-amd64.jar
Binary file not shown.
Binary file removed library/jogl-all-natives-linux-armv6hf.jar
Binary file not shown.
Binary file removed library/jogl-all-natives-linux-i586.jar
Binary file not shown.
Binary file removed library/jogl-all-natives-macosx-universal.jar
Binary file not shown.
Binary file removed library/jogl-all-natives-windows-amd64.jar
Binary file not shown.
Binary file removed library/jogl-all-natives-windows-i586.jar
Binary file not shown.
Binary file removed library/jogl-all.jar
Binary file not shown.
1 change: 0 additions & 1 deletion library/minim/library/export.txt

This file was deleted.

Binary file removed library/minim/library/jl1.0.1.jar
Binary file not shown.
Binary file removed library/minim/library/jsminim.jar
Binary file not shown.
Binary file removed library/minim/library/minim.jar
Binary file not shown.
Binary file removed library/minim/library/mp3spi1.9.5.jar
Binary file not shown.
Binary file removed library/minim/library/tritonus_aos.jar
Binary file not shown.
Binary file removed library/minim/library/tritonus_share.jar
Binary file not shown.
Binary file removed library/serial/library/jssc.jar
Binary file not shown.
4 changes: 0 additions & 4 deletions library/serial/library/jssc.txt

This file was deleted.

Binary file removed library/serial/library/linux-arm64/libjSSC-2.8.so
Binary file not shown.
Binary file removed library/serial/library/linux-armv6hf/libjSSC-2.8.so
Binary file not shown.
Binary file removed library/serial/library/linux32/libjSSC-2.8.so
Binary file not shown.
Binary file removed library/serial/library/linux64/libjSSC-2.8.so
Binary file not shown.
Binary file removed library/serial/library/macosx/libjSSC-2.8.jnilib
Binary file not shown.
Binary file removed library/serial/library/serial.jar
Binary file not shown.
Binary file removed library/serial/library/windows32/jSSC-2.8.dll
Binary file not shown.
Binary file removed library/serial/library/windows64/jSSC-2.8.dll
Binary file not shown.
Binary file removed library/themidibus/library/themidibus.jar
Binary file not shown.
Binary file removed library/videoexport/library/VideoExport.jar
Binary file not shown.
Binary file removed library/videoexport/library/jna-platform.jar
Binary file not shown.
Binary file removed library/videoexport/library/jna.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions src/main/kotlin/dev/matsem/astral/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import dev.matsem.astral.di.appModule
import org.koin.core.context.startKoin

fun main(args: Array<String>) {
println("args:")
args.forEach {
println(it)
}

startKoin {
logger()
modules(appModule)
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/dev/matsem/astral/di/koin_modules.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.matsem.astral.di

import com.hamoid.VideoExport
import controlP5.ControlP5
import ddf.minim.Minim
import dev.matsem.astral.Config
import dev.matsem.astral.sketches.SketchLoader
Expand Down Expand Up @@ -41,7 +40,6 @@ val appModule = module {
// Controllers
single { KontrolF1() }
single { Galaxy() }
single { ControlP5(get()).apply { isAutoDraw = false } }

// Midi tools
single { MidiFileParser(get()) }
Expand Down
21 changes: 19 additions & 2 deletions src/main/kotlin/dev/matsem/astral/sketches/SketchLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import processing.core.PConstants
import processing.core.PVector
import processing.event.KeyEvent
import java.io.BufferedReader
import java.io.File
import java.io.IOException
import java.io.PrintWriter

Expand Down Expand Up @@ -437,7 +438,7 @@ class SketchLoader : PApplet(), KoinComponent {
// The first L and R values in each row are low frequencies (bass)
// and they go towards high frequency as we advance towards
// the end of the line.
val msg = StringBuilder(PApplet.nf(chunkStartIndex / sampleRate, 0, 3).replace(',', '.'))
val msg = StringBuilder(nf(chunkStartIndex / sampleRate, 0, 3).replace(',', '.'))
val beat = when {
beatDetect.isKick -> 1
beatDetect.isSnare -> 2
Expand All @@ -456,6 +457,22 @@ class SketchLoader : PApplet(), KoinComponent {
track.close()
output.flush()
output.close()
PApplet.println("Sound analysis done")
println("Sound analysis done")
}

/**
* Sketch data path override. It's wrong when using local Processing installation core jars.
* Sketch folder path cannot be passed as an argument, does not play well with DI.
*/
override fun dataPath(where: String): String {
return System.getProperty("user.dir") + "/data/" + where
}

/**
* Sketch data path override. It's wrong when using local Processing installation core jars.
* Sketch folder path cannot be passed as an argument, does not play well with DI.
*/
override fun dataFile(where: String): File {
return File(System.getProperty("user.dir") + "/data/" + where)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.matsem.astral.sketches.gameoflife

import controlP5.ControlP5Constants.CENTER
import dev.matsem.astral.Config
import dev.matsem.astral.sketches.BaseSketch
import dev.matsem.astral.sketches.SketchLoader
Expand All @@ -16,6 +15,7 @@ import org.koin.core.inject
import processing.core.PApplet.constrain
import processing.core.PApplet.lerp
import processing.core.PConstants
import processing.core.PConstants.CENTER
import processing.core.PFont
import processing.core.PGraphics
import processing.core.PImage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class VideoSketch : BaseSketch() {
private val audioProcessor: AudioProcessor by inject()
private val galaxy: Galaxy by inject()

private val movie1 = Movie(sketch, "movies/astral03_BACKGROUND.mp4")
private val movie2 = Movie(sketch, "movies/astral04_BACKGROUND.mp4")
private val astralLogo = sketch.loadImage("images/astrallogo_clean.png").apply {
private val movie1 = Movie(sketch, sketch.dataPath("movies/astral03_BACKGROUND.mp4"))
private val movie2 = Movie(sketch, sketch.dataPath("movies/astral04_BACKGROUND.mp4"))
private val astralLogo = sketch.loadImage(sketch.dataPath("images/astrallogo_clean.png")).apply {
resizeRatioAware(height = sketch.shorterDimension() / 2)
}

Expand Down