    internal static func getSystemSources(for entity: MIDIEntityRef) -> [OutputEndpoint] {
        
        let srcCount = MIDIEntityGetNumberOfSources(entity)
        
        var endpoints: [OutputEndpoint] = []
        endpoints.reserveCapacity(srcCount)
        
        for i in 0..<srcCount {
            let endpoint = MIDIEntityGetSource(entity, i)
            
            endpoints.append(.init(endpoint))