Model emotional arc and production directions
This commit is contained in:
@@ -186,6 +186,46 @@ public extension SongProject {
|
||||
maqam = ManualAutoValue(mode: .auto)
|
||||
}
|
||||
|
||||
func emotionalArcPoint(for pointID: String) -> EmotionalArcPoint? {
|
||||
emotionalArc.first { $0.id == pointID }
|
||||
}
|
||||
|
||||
func emotionalArcPoints(forSectionID sectionID: String) -> [EmotionalArcPoint] {
|
||||
emotionalArc.filter { $0.sectionID == sectionID }
|
||||
}
|
||||
|
||||
mutating func upsertEmotionalArcPoint(_ point: EmotionalArcPoint) {
|
||||
if let index = emotionalArc.firstIndex(where: { $0.id == point.id }) {
|
||||
emotionalArc[index] = point
|
||||
} else {
|
||||
emotionalArc.append(point)
|
||||
}
|
||||
}
|
||||
|
||||
mutating func removeEmotionalArcPoint(id pointID: String) {
|
||||
emotionalArc.removeAll { $0.id == pointID }
|
||||
}
|
||||
|
||||
func productionDirection(for directionID: String) -> ProductionDirection? {
|
||||
productionDirections.first { $0.id == directionID }
|
||||
}
|
||||
|
||||
func productionDirections(forSectionID sectionID: String) -> [ProductionDirection] {
|
||||
productionDirections.filter { $0.sectionID == sectionID }
|
||||
}
|
||||
|
||||
mutating func upsertProductionDirection(_ direction: ProductionDirection) {
|
||||
if let index = productionDirections.firstIndex(where: { $0.id == direction.id }) {
|
||||
productionDirections[index] = direction
|
||||
} else {
|
||||
productionDirections.append(direction)
|
||||
}
|
||||
}
|
||||
|
||||
mutating func removeProductionDirection(id directionID: String) {
|
||||
productionDirections.removeAll { $0.id == directionID }
|
||||
}
|
||||
|
||||
var selectedInstrumentTracks: [InstrumentTrack] {
|
||||
instruments.filter(\.selected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user