Skip to content

Commit f713ca3

Browse files
authored
Remove unnecessary uses of "takeScreenshot" (#349)
1 parent 141d1fa commit f713ca3

File tree

25 files changed

+34
-141
lines changed

25 files changed

+34
-141
lines changed

orx-envelopes/src/commonMain/kotlin/Tracker.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,29 @@ abstract class Tracker<T : Envelope>(val clock: Clock) {
7373

7474
class ADSRTracker(clock: Clock) : Tracker<ADSR>(clock) {
7575

76+
/**
77+
* The time it takes to transition to 1.0 when calling [triggerOn], usually in seconds.
78+
*/
7679
@DoubleParameter("attack", 0.0, 20.0, order = 1)
7780
var attack: Double = 0.1
7881

82+
/**
83+
* The time it takes to transition from 1.0 to the [sustain] level, usually in seconds.
84+
* The decay happens immediately after the attack.
85+
*/
7986
@DoubleParameter("decay", 0.0, 20.0, order = 2)
8087
var decay: Double = 0.1
8188

89+
/**
90+
* The sustain level, between 0.0 and 1.0.
91+
* The tracker will keep this value until [triggerOff] is called.
92+
*/
8293
@DoubleParameter("sustain", 0.0, 1.0, order = 3)
8394
var sustain: Double = 0.9
8495

96+
/**
97+
* The time it takes to transition back to 0.0 when calling [triggerOff], usually in seconds.
98+
*/
8599
@DoubleParameter("release", 0.0, 20.0, order = 4)
86100
var release: Double = 0.9
87101

orx-fcurve/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
210210

211211
![DemoFCurve02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoFCurve02Kt.png)
212212

213+
### DemoFCurve03
214+
[source code](src/jvmDemo/kotlin/DemoFCurve03.kt)
215+
216+
![DemoFCurve03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoFCurve03Kt.png)
217+
213218
### DemoFCurveSheet01
214219
[source code](src/jvmDemo/kotlin/DemoFCurveSheet01.kt)
215220

orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
import org.openrndr.application
22
import org.openrndr.draw.colorBuffer
33
import org.openrndr.draw.createEquivalent
4+
import org.openrndr.extensions.SingleScreenshot
45
import org.openrndr.extra.fx.distort.FluidDistort
56
import org.openrndr.extra.fx.patterns.Checkers
67

78
fun main() {
89
application {
910
program {
1011
val fd = FluidDistort()
11-
val checkers = Checkers()
12+
val checkers = Checkers()
1213

1314
val image = colorBuffer(width, height)
1415
val distorted = image.createEquivalent()
1516
checkers.size = 64.0
1617
checkers.apply(emptyArray(), image)
1718

19+
if (System.getProperty("takeScreenshot") == "true") {
20+
extensions.filterIsInstance<SingleScreenshot>().forEach {
21+
it.delayFrames = 150
22+
}
23+
}
1824
extend {
19-
fd.blend = mouse.position.x/width
25+
// Ensure >0.01 for a better screenshot
26+
fd.blend = (mouse.position.x / width).coerceAtLeast(0.01)
2027
fd.apply(image, distorted)
2128
drawer.image(distorted)
2229
}

orx-fx/src/jvmDemo/kotlin/DemoLaserBlur01.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
// }
2121
//
2222
// program {
23-
// if (System.getProperty("takeScreenshot") == "true") {
24-
// extend(SingleScreenshot()) {
25-
// this.outputFile = System.getProperty("screenshotPath")
26-
// }
27-
// }
28-
//
2923
// val gui = GUI()
3024
// val c = compose {
3125
// layer {

orx-jvm/orx-git-archiver/src/demo/kotlin/GitArchiverDemo01.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
//
77
//fun main() = application {
88
// program {
9-
// if (System.getProperty("takeScreenshot") == "true") {
10-
// extend(SingleScreenshot()) {
11-
// this.outputFile = System.getProperty("screenshotPath")
12-
// }
13-
// }
149
// val ga = extend(GitArchiver()) {
1510
// commitOnRun = true
1611
// commitOnRequestAssets = false

orx-jvm/orx-gui/src/demo/kotlin/DemoAppearance01.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ import org.openrndr.shape.Circle
1212
*/
1313
fun main() = application {
1414
program {
15-
// -- this block is for automation purposes only
16-
if (System.getProperty("takeScreenshot") == "true") {
17-
extend(SingleScreenshot()) {
18-
this.outputFile = System.getProperty("screenshotPath")
19-
}
20-
}
21-
2215
val gui = GUI(GUIAppearance(baseColor = ColorRGBa.GRAY.opacify(0.9), barWidth = 400))
2316
gui.compartmentsCollapsedByDefault = false
2417

orx-jvm/orx-keyframer/src/demo/kotlin/DemoEvelope01.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ fun main() = application {
1111
}
1212
val animation = Animation()
1313
animation.loadFromJson(URL(resourceUrl("/demo-envelope-01.json")))
14-
if (System.getProperty("takeScreenshot") == "true") {
15-
extend(SingleScreenshot()) {
16-
this.outputFile = System.getProperty("screenshotPath")
17-
}
18-
}
1914
extend {
2015
animation(seconds)
2116
drawer.circle(animation.position, 100.0)

orx-jvm/orx-keyframer/src/demo/kotlin/DemoFull01.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ fun main() = application {
1414
}
1515
val animation = Animation()
1616
animation.loadFromJson(URL(resourceUrl("/demo-full-01.json")), format = KeyframerFormat.FULL)
17-
if (System.getProperty("takeScreenshot") == "true") {
18-
extend(SingleScreenshot()) {
19-
this.outputFile = System.getProperty("screenshotPath")
20-
}
21-
}
2217
extend {
2318
animation(seconds)
2419
drawer.fill = animation.color

orx-jvm/orx-keyframer/src/demo/kotlin/DemoScrub01.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ fun main() = application {
3030
}
3131
}
3232
}
33-
if (System.getProperty("takeScreenshot") == "true") {
34-
extend(SingleScreenshot()) {
35-
this.outputFile = System.getProperty("screenshotPath")
36-
}
37-
}
3833
extend(cm)
3934
class Animation: Keyframer() {
4035
val position by Vector2Channel(arrayOf("x", "y"))

orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple01.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ fun main() = application {
1111
}
1212
val animation = Animation()
1313
animation.loadFromJson(URL(resourceUrl("/demo-simple-01.json")))
14-
if (System.getProperty("takeScreenshot") == "true") {
15-
extend(SingleScreenshot()) {
16-
this.outputFile = System.getProperty("screenshotPath")
17-
}
18-
}
1914
extend {
2015
animation(seconds)
2116
drawer.circle(animation.position, 100.0)

0 commit comments

Comments
 (0)