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