This commit is contained in:
Moritz Ruth 2023-06-16 16:28:00 +02:00
parent c8c4b6e175
commit af75b41df1
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
12 changed files with 43 additions and 23 deletions

View file

@ -1,17 +1,15 @@
package de.moritzruth.lampenfieber
import de.moritzruth.lampenfieber.device.bar
import de.moritzruth.lampenfieber.device.Washs
import de.moritzruth.lampenfieber.device.devices
import de.moritzruth.theaterdsl.dmx.EnttecOpenDmxUsb
import de.moritzruth.theaterdsl.dmx.PerDeviceDmxDataWriter
import de.moritzruth.theaterdsl.value.degrees
import de.moritzruth.theaterdsl.value.percent
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlin.math.roundToLong
import kotlin.system.measureTimeMillis
import kotlin.time.Duration.Companion.seconds
suspend fun main() = coroutineScope {
EnttecOpenDmxUsb.start()
@ -36,6 +34,8 @@ suspend fun main() = coroutineScope {
}
suspend fun test() = coroutineScope {
bar.brightness.static(100.percent)
bar.color.fadeRandomAround(245.degrees, 180.degrees, 5.seconds)
Washs.right.let {
it.brightness.static(50.percent)
it.pointAtGuests()
}
}

View file

@ -167,6 +167,7 @@ fun ShowBuilderContext.secondAct() = act("Zweiter Akt") {
}
step(StepCue.MusicEnd) {
sideLight.brightness.off()
}
}
}

View file

@ -26,6 +26,7 @@ fun ShowBuilderContext.thirdAct() = act("Dritter Akt") {
}
onRun {
sideLight.brightness.off()
FrontLights.all.forEach { it.brightness.fade(75.percent, 10.seconds) }
}
}
@ -170,6 +171,8 @@ fun ShowBuilderContext.thirdAct() = act("Dritter Akt") {
onRun {
Tops.both.forEach {
it.pointAtStageMiddleOffCenterMarking()
it.prismMode.static(FuturelightDmh160.PrismMode.OPEN)
it.prismRotationSpeed.off()
it.colorWheelMode.static(FuturelightDmh160.ColorWheelMode.White)
}
}

View file

@ -12,7 +12,7 @@ class AdjFogFury3000(override val firstChannel: DmxAddress) : Device {
override fun writeDmxData(writer: DmxDataWriter) {
writer.writePercentage(power.getCurrentValue())
writer.writeRaw(DmxValue(0u)) // interval (ignored)
writer.writeRaw(DmxValue(255u)) // interval (ignored)
writer.writeRaw(DmxValue(255u)) // duration = constant
}

View file

@ -84,7 +84,7 @@ class CoemarProWash(override val firstChannel: DmxAddress, private val isRight:
fun pointAtStageCenter() {
tilt.static(55.degrees)
pan.static(if (isRight) 193.degrees else 80.degrees)
pan.static(if (isRight) 280.degrees else 80.degrees)
}
fun pointAtCeiling(fadeDuration: Duration = Duration.ZERO) {
@ -94,6 +94,6 @@ class CoemarProWash(override val firstChannel: DmxAddress, private val isRight:
fun pointAtGuests() {
tilt.static(240.degrees)
pan.static(0.degrees)
pan.static(if (isRight) 0.degrees else 180.degrees)
}
}

View file

@ -33,7 +33,7 @@ class StairvilleClb4(override val firstChannel: DmxAddress) : Device {
writer.writePercentage(brightness.getCurrentValue())
}
val brightness = PercentageDV()
val brightness = PercentageDV(0.percent)
val strobeSpeed = PercentageDV()
val color1 = ColorDV(Color(0.degrees, brightness = 0.percent))

View file

@ -1,7 +1,7 @@
<template>
<button
class="px-5 py-2 active:bg-green-800 transition duration-200 font-bold text-5"
:class="isActive ? 'bg-green-800' : 'bg-green-600'"
:class="[$style.root, isActive ? 'bg-green-800' : 'bg-green-600']"
@click="e => emit('click', e)"
>
<slot/>
@ -9,7 +9,9 @@
</template>
<style module>
.root {
user-select: none;
}
</style>
<script setup lang="ts">

View file

@ -1,10 +1,10 @@
<template>
<div class="flex items-center gap-3">
<span>Nebel: </span>
<span>Nebel:</span>
<Button
v-for="p in buttonPowers"
@mousedown="onButtonActive(p[0])"
@mouseup="onButtonInactive(p[0])"
@pointerdown="e => onButtonActive(e, p[0])"
@pointerup="e => onButtonInactive(e)"
:is-active="isActive && p[0] === power"
>
{{ p[0] * 100 }}%
@ -25,20 +25,25 @@
const isActive = computed(() => activation.value !== null)
const power = ref(0)
function onButtonActive(p: number) {
function onButtonActive(e: PointerEvent, p: number) {
// @ts-ignore
e.target.setPointerCapture(e.pointerId)
activation.value = "button"
power.value = p
}
function onButtonInactive(p: number) {
if (activation.value === "button" && power.value === p) {
function onButtonInactive(e: PointerEvent) {
// @ts-ignore
e.target.releasePointerCapture(e.pointerId)
activation.value = null
power.value = 0
}
useEventListener(document.body, "pointerup", () => {
if (activation.value === "button") {
activation.value = null
power.value = 0
}
}
useEventListener(document.body, "mouseup", () => {
if (activation.value === "button") activation.value = null
})
const buttonPowers: Array<[number, string]> = [[0.1, "7"], [0.25, "8"], [0.5, "9"], [1, "0"]]

View file

@ -38,7 +38,7 @@
</div>
</div>
</div>
<div v-if="step.hasChangedProps" class="flex space-x-2 pt-0.5">
<div v-if="step.hasChangedProps" class="flex space-x-2 pt-0.5 text-6">
<BarricadeIcon class="mt-0.5"/>
<span>Umbau</span>
</div>

View file

@ -12,6 +12,12 @@
</div>
</template>
<style>
html {
user-select: none;
}
</style>
<script setup lang="ts">
import { current, getNextValidPosition, getPreviousValidPosition, state } from "../state"
import { goToPosition } from "../syncing"

View file

@ -7,6 +7,7 @@
<StepSelection class="w-1/2"/>
<div class="w-1/2 flex flex-col space-y-4">
<MessageEdit class="h-1/2"/>
<div class="text-4">Vorhang: {{ current.step.curtainState === "open" ? "auf" : "geschlossen"}}</div>
<ActorsOnStageBox class="flex-grow"/>
<FogControl/>
</div>

View file

@ -21,6 +21,7 @@ export interface Step {
hasChangedProps: boolean
leftSpotTarget: string | null
rightSpotTarget: string | null
curtainState: "open" | "closed"
}
export type StepCue = {
@ -99,7 +100,8 @@ export const START_STEP: Step = {
actorEntrances: [],
actorExits: [],
leftSpotTarget: null,
rightSpotTarget: null
rightSpotTarget: null,
curtainState: "closed"
}
const START_SCENE: Scene = {