Skip to content
Closed
55 changes: 54 additions & 1 deletion Promptly/Models/Script.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation
import SwiftData
import SwiftUI

@Model
class Script: Identifiable {
Expand Down Expand Up @@ -167,6 +168,27 @@ enum CueOffset: String, Codable, CaseIterable {
case after = "after"
}

enum StageLocation: String, Codable, CaseIterable {
case pit = "pit"
case leftWing = "left_wing"
case rightWing = "right_wing"
case upstage = "upstage"
case downstage = "downstage"
case stageLeft = "stage_left"
case stageRight = "stage_right"
case upstageLeft = "upstage_left"
case upstageRight = "upstage_right"
case downstageLeft = "downstage_left"
case downstageRight = "downstage_right"
case centerStage = "center_stage"

}

struct CueHapticConfig: Codable {
var location: StageLocation // where are they (if someone is away used for quick swapping)
var crewId: Int // unique id (goes from 0, 1, 2 etc) for the crew member, regardless of position
}

enum CueType: String, Codable, CaseIterable {
case lightingStandby = "lighting_standby"
case lightingGo = "lighting_go"
Expand All @@ -176,6 +198,7 @@ enum CueType: String, Codable, CaseIterable {
case flyGo = "fly_go"
case automationStandby = "automation_standby"
case automationGo = "automation_go"
case setWarning = "set_warning"
case setStandby = "set_standby"
case setGo = "set_go"
case cuelightStandby = "cuelight_standby"
Expand All @@ -191,6 +214,7 @@ enum CueType: String, Codable, CaseIterable {
case .flyGo: return "Fly GO"
case .automationStandby: return "Auto Standby"
case .automationGo: return "Auto GO"
case .setWarning: return "Set Warning"
case .setStandby: return "Set Standby"
case .setGo: return "Set GO"
case .cuelightStandby: return "Cuelight Standby"
Expand All @@ -204,10 +228,39 @@ enum CueType: String, Codable, CaseIterable {
case .soundStandby, .soundGo: return "#FF6B6B"
case .flyStandby, .flyGo: return "#4ECDC4"
case .automationStandby, .automationGo: return "#45B7D1"
case .setStandby, .setGo: return "#944ECD"
case .setStandby, .setGo, .setWarning: return "#944ECD"
case .cuelightStandby, .cuelightGo: return "#CD4EBC"
}
}

var cueStackColor: String {
switch self {
case .lightingStandby, .soundStandby, .flyStandby, .automationStandby, .setStandby, .setWarning, .cuelightStandby: return Color.orange
case .lightingGo, .soundGo, .flyGo, .automationGo, .setGo, .cuelightGo: return Color.green
}
}

var generalName: String {
switch self {
case .lightingStandby, .soundStandby, .flyStandby, .automationStandby, .setStandby, .cuelightStandby: return "STANDBY"
case .lightingGo, .soundGo, .flyGo, .automationGo, .setGo, .cuelightGo: return "GO"
case .setWarning: return "WARNING"
}
}

var canHaptic: Bool {
switch self {
case .lightingStandby, .soundStandby, .flyStandby, .automationStandby, .cuelightStandby, .lightingGo, .soundGo, .flyGo, .automationGo, .cuelightGo: return false
case .setWarning, .setStandby, .setGo: return true
}
}

var isStandby: Bool {
switch self {
case .lightingStandby, .soundStandby, .flyStandby, .automationStandby, .setStandby, .cuelightStandby, .setWarning: return true
case .lightingGo, .soundGo, .flyGo, .automationGo, .setGo, .cuelightGo: return false
}
}
}

enum MarkColor: String, Codable, CaseIterable {
Expand Down
28 changes: 10 additions & 18 deletions Promptly/Views/Performance Mode/LivePerforemanceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1070,15 +1070,15 @@ struct DSMCueBoxView: View {

Spacer()

Button(cue.type.isStandby ? "STANDBY" : "GO") {
Button(cue.type.generalName) {
onExecute()
}
.font(.caption)
.fontWeight(.bold)
.foregroundColor(.white)
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(isCalled ? Color.gray : (cue.type.isStandby ? Color.orange : Color.green))
.background(isCalled ? Color.gray : (cue.type.cueStackColor))
.cornerRadius(6)
.disabled(isCalled)
}
Expand Down Expand Up @@ -1577,8 +1577,10 @@ extension DSMPerformanceView {
}

private func executeCue(_ cue: Cue) {
if cue.type.isStandby {
if cue.type.generalName == "STANDBY" {
logCall("STANDBY: \(cue.label)", type: .call)
} else if cue.type.generalName == "WARNING" {
logCall("WARNING: \(cue.label)", type: .call)
} else {
logCall("GO: \(cue.label)", type: .action)
}
Expand Down Expand Up @@ -1644,13 +1646,15 @@ extension DSMPerformanceView {
executionMethod: "Remote Control"
)
cueExecutions.append(execution)

if cue.hasAlert {
showCueAlert()
}
if cue.type.isStandby {

if cue.type.generalName == "STANDBY" {
logCall("REMOTE STANDBY: \(cue.label)", type: .call)
} else if cue.type.generalName == "WARNING" {
logCall("REMOTE WARNING: \(cue.label)", type: .call)
} else {
logCall("REMOTE GO: \(cue.label)", type: .action)
}
Expand Down Expand Up @@ -1748,18 +1752,6 @@ extension PerformanceState {
}
}

extension CueType {
var isStandby: Bool {
switch self {
case .lightingStandby, .soundStandby, .flyStandby, .automationStandby:
return true
default:
return false
}
}
}


extension View {
func applyDSMModifiers(
isViewFocused: FocusState<Bool>.Binding,
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
- Create, update, read and delete color-coded cues for LX, SFX and STAGE.
- Run shows live.
- Use an open source 3d ESP based project to integrate line-syncing across devices.
- Everything's local, so no worries about internet loss
- And more!
-
## Planned Major Features
- Multi-user shows with informative views for Lighting, Sound, Props, Stage Crew (on Apple Watch)
- Automatic on-the-fly cue updates on the aforementioned devices
- Preshow checks from each user, ensuring everyone's ready, even off the comms link!

## Line syncing?
- Yep! By connecting to a MQTT server running on a WiFi network, experiece line by line sync between the DSM and anybody else! Cues are synced also - so everynody is on the same page. No longer are the days where you need to ask the DSM where the show currently is!


## How do I contribute?
- Please fork the repo, and commit to a new branch
- Then PR into this repo with your feature
Expand Down
Loading