diff --git a/Promptly/Models/Script.swift b/Promptly/Models/Script.swift index 6ee6b42..3b8964c 100644 --- a/Promptly/Models/Script.swift +++ b/Promptly/Models/Script.swift @@ -7,6 +7,7 @@ import Foundation import SwiftData +import SwiftUI @Model class Script: Identifiable { @@ -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" @@ -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" @@ -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" @@ -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 { diff --git a/Promptly/Views/Performance Mode/LivePerforemanceView.swift b/Promptly/Views/Performance Mode/LivePerforemanceView.swift index 72943bb..6203a24 100644 --- a/Promptly/Views/Performance Mode/LivePerforemanceView.swift +++ b/Promptly/Views/Performance Mode/LivePerforemanceView.swift @@ -1070,7 +1070,7 @@ struct DSMCueBoxView: View { Spacer() - Button(cue.type.isStandby ? "STANDBY" : "GO") { + Button(cue.type.generalName) { onExecute() } .font(.caption) @@ -1078,7 +1078,7 @@ struct DSMCueBoxView: View { .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) } @@ -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) } @@ -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) } @@ -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.Binding, diff --git a/README.md b/README.md index 4801d33..625c615 100644 --- a/README.md +++ b/README.md @@ -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