Remove unnecessary uses of "takeScreenshot" (#349)
This commit is contained in:
@@ -73,15 +73,29 @@ abstract class Tracker<T : Envelope>(val clock: Clock) {
|
||||
|
||||
class ADSRTracker(clock: Clock) : Tracker<ADSR>(clock) {
|
||||
|
||||
/**
|
||||
* The time it takes to transition to 1.0 when calling [triggerOn], usually in seconds.
|
||||
*/
|
||||
@DoubleParameter("attack", 0.0, 20.0, order = 1)
|
||||
var attack: Double = 0.1
|
||||
|
||||
/**
|
||||
* The time it takes to transition from 1.0 to the [sustain] level, usually in seconds.
|
||||
* The decay happens immediately after the attack.
|
||||
*/
|
||||
@DoubleParameter("decay", 0.0, 20.0, order = 2)
|
||||
var decay: Double = 0.1
|
||||
|
||||
/**
|
||||
* The sustain level, between 0.0 and 1.0.
|
||||
* The tracker will keep this value until [triggerOff] is called.
|
||||
*/
|
||||
@DoubleParameter("sustain", 0.0, 1.0, order = 3)
|
||||
var sustain: Double = 0.9
|
||||
|
||||
/**
|
||||
* The time it takes to transition back to 0.0 when calling [triggerOff], usually in seconds.
|
||||
*/
|
||||
@DoubleParameter("release", 0.0, 20.0, order = 4)
|
||||
var release: Double = 0.9
|
||||
|
||||
|
||||
@@ -210,6 +210,11 @@ For example `(M0 (h1 m1)[3])[2]` expands to `M0 h1 m1 h1 m1 h1 m1 M0 h1 m1 h1 m1
|
||||
|
||||

|
||||
|
||||
### DemoFCurve03
|
||||
[source code](src/jvmDemo/kotlin/DemoFCurve03.kt)
|
||||
|
||||

|
||||
|
||||
### DemoFCurveSheet01
|
||||
[source code](src/jvmDemo/kotlin/DemoFCurveSheet01.kt)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.colorBuffer
|
||||
import org.openrndr.draw.createEquivalent
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.fx.distort.FluidDistort
|
||||
import org.openrndr.extra.fx.patterns.Checkers
|
||||
|
||||
@@ -15,8 +16,14 @@ fun main() {
|
||||
checkers.size = 64.0
|
||||
checkers.apply(emptyArray(), image)
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
||||
it.delayFrames = 150
|
||||
}
|
||||
}
|
||||
extend {
|
||||
fd.blend = mouse.position.x/width
|
||||
// Ensure >0.01 for a better screenshot
|
||||
fd.blend = (mouse.position.x / width).coerceAtLeast(0.01)
|
||||
fd.apply(image, distorted)
|
||||
drawer.image(distorted)
|
||||
}
|
||||
|
||||
@@ -20,12 +20,6 @@
|
||||
// }
|
||||
//
|
||||
// program {
|
||||
// if (System.getProperty("takeScreenshot") == "true") {
|
||||
// extend(SingleScreenshot()) {
|
||||
// this.outputFile = System.getProperty("screenshotPath")
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// val gui = GUI()
|
||||
// val c = compose {
|
||||
// layer {
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
//
|
||||
//fun main() = application {
|
||||
// program {
|
||||
// if (System.getProperty("takeScreenshot") == "true") {
|
||||
// extend(SingleScreenshot()) {
|
||||
// this.outputFile = System.getProperty("screenshotPath")
|
||||
// }
|
||||
// }
|
||||
// val ga = extend(GitArchiver()) {
|
||||
// commitOnRun = true
|
||||
// commitOnRequestAssets = false
|
||||
|
||||
@@ -12,13 +12,6 @@ import org.openrndr.shape.Circle
|
||||
*/
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val gui = GUI(GUIAppearance(baseColor = ColorRGBa.GRAY.opacify(0.9), barWidth = 400))
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
|
||||
|
||||
@@ -11,11 +11,6 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-envelope-01.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, 100.0)
|
||||
|
||||
@@ -14,11 +14,6 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-full-01.json")), format = KeyframerFormat.FULL)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.fill = animation.color
|
||||
|
||||
@@ -30,11 +30,6 @@ fun main() = application {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(cm)
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
|
||||
@@ -11,11 +11,6 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-01.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, 100.0)
|
||||
|
||||
@@ -13,11 +13,6 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-02.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.fill = animation.color
|
||||
|
||||
@@ -14,11 +14,6 @@ fun main() = application {
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-expressions-01.json")),
|
||||
parameters = mapOf("cycleDuration" to 2.0))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, animation.radius)
|
||||
|
||||
@@ -12,12 +12,6 @@ import org.openrndr.panel.style.*
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val cm = controlManager {
|
||||
styleSheet(has class_ "horizontal") {
|
||||
paddingLeft = 10.px
|
||||
|
||||
@@ -8,12 +8,6 @@ import org.openrndr.panel.style.*
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val cm = controlManager {
|
||||
styleSheet(has class_ "side-bar") {
|
||||
this.height = 100.percent
|
||||
|
||||
@@ -41,12 +41,6 @@ fun main() = application {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val programState = ProgramState()
|
||||
val cm = controlManager {
|
||||
layout {
|
||||
|
||||
@@ -17,12 +17,6 @@ fun main() = application {
|
||||
var z = 0
|
||||
}
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val programState = State()
|
||||
val cm = controlManager {
|
||||
layout {
|
||||
|
||||
@@ -15,13 +15,6 @@ fun main() = application {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val rabbit = RabbitControlServer()
|
||||
val font = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 20.0)
|
||||
val settings = object {
|
||||
|
||||
@@ -12,13 +12,6 @@ fun main() = application {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val rabbit = RabbitControlServer(showQRUntilClientConnects = false)
|
||||
|
||||
val settings = object {
|
||||
|
||||
@@ -15,13 +15,6 @@ fun main() = application {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start RabbitControlServer with a Rabbithole with key 'orxtest'
|
||||
* Please visit https://rabbithole.rabbitcontrol.cc for more information.
|
||||
|
||||
@@ -11,11 +11,6 @@ fun main() {
|
||||
val size = Envelope(50.0, 400.0, 0.5, 0.5)
|
||||
val rotation = Envelope(easingFactor = 0.4)
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(TimeOperators()) {
|
||||
track(size, rotation)
|
||||
}
|
||||
|
||||
@@ -12,9 +12,8 @@ fun main() {
|
||||
val size = LFO()
|
||||
val rotation = LFO(LFOWave.Sine)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.delayFrames = 10
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
||||
it.delayFrames = 10
|
||||
}
|
||||
}
|
||||
extend(TimeOperators()) {
|
||||
|
||||
@@ -33,19 +33,6 @@ fun main() = application {
|
||||
Note that drawing inside the `repeat` action has no effect. Have a look at the demos listed below for an example of
|
||||
`repeat` triggered drawing.
|
||||
|
||||
## Demos
|
||||
|
||||
* [Simple `repeat` demonstration](src/demo/kotlin/DemoRepeat01.kt)
|
||||
* [A `repeat` demonstration with drawing](src/demo/kotlin/DemoRepeat02.kt)
|
||||
* [Simple `timeOut` demonstration](src/demo/kotlin/DemoTimeOut01.kt)
|
||||
<!-- __demos__ >
|
||||
# Demos
|
||||
[DemoRepeat01Kt](src/demo/kotlin/DemoRepeat01Kt.kt
|
||||
 = application {
|
||||
@@ -7,13 +6,5 @@ fun main() = application {
|
||||
repeat(2.0) {
|
||||
println("hello there $seconds")
|
||||
}
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.events.Event
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.timer.repeat
|
||||
|
||||
/**
|
||||
@@ -19,11 +18,6 @@ fun main() = application {
|
||||
// -- we can not draw here, so we relay the repeat signal to the event
|
||||
event.trigger(null)
|
||||
}
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
// -- by explicitly calling deliver we know that the drawing code in the listener will be
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.timer.timeOut
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
timeOut(2.0) {
|
||||
println("hello there $seconds")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user