Builder
public final class Builder
A class which encapsulates the stateful construction of a PerformanceContext
.
-
Creates an empty
PerformanceContext.Builder
.Declaration
Swift
public init()
-
Adds the given
Performer
to thePerformanceContext
.Declaration
Return Value
The identifier for the given
performer
. -
Adds the given
instrument
to thePerformanceContext
.Declaration
Swift
@discardableResult public func addInstrument(_ instrument: Instrument) -> Instrument.ID
Return Value
The identifier for the given
instrument
. -
Adds a new voice for the given
performer
andinstrument
, with a givennumber
, if the voices already exists. Otherwise, a new voice will be generated for the performer-instrument pair.Declaration
Swift
@discardableResult public func addVoice(_ voice: Voice? = nil, performer: Performer, instrument: Instrument) -> Voice.ID
-
Declaration
Swift
public func build() -> PerformanceContext
Return Value
A completed
PerformanceContext
.