【问题标题】:CoreMIDI app not showing in other softwareCoreMIDI 应用程序未在其他软件中显示
【发布时间】:2016-05-04 20:06:37
【问题描述】:

我在 OSX 上的 Swift 中使用 CoreMIDI 进行了一些尝试,并且大部分的东西都能正常工作。

我现在唯一的问题是其他软件和应用程序看不到我的应用程序,并且没有可用的输入/输出。 GarageBand、MIDIMonitor 和 VVMidi 测试应用程序就是这种情况。

我尝试了多种方法,包括这似乎是正确的方法:

let clientCreateResult = MIDIClientCreate("MIDIApp", { (notification, _) -> Void in
        print("Configuration Changed")
    }, nil, &midiClient)
if (clientCreateResult != noErr) {
    printError(clientCreateResult)
    return;
}

let inputCreateResult = MIDIInputPortCreateWithBlock(midiClient, "MIDIApp In", &inputPort, MyMIDIReadBlock)
if (inputCreateResult != noErr) {
    printError(inputCreateResult)
    return;
}
let outputCreateResult = MIDIOutputPortCreate(midiClient, "MIDIAPP Out", &outputPort)
if (outputCreateResult != noErr) {
    printError(inputCreateResult)
    return;
}

遗憾的是没有运气。我不确定我做错了什么,我尝试复制与现有框架完全相同的代码,但没有显着结果。

我真的可以使用一些指针来解释为什么我的应用没有在其他应用中列出。

谢谢!

【问题讨论】:

    标签: swift macos midi coremidi


    【解决方案1】:

    创建一个虚拟目的地。请参阅MIDIDestinationCreateWithBlock 的文档

    【讨论】:

    • 这会使您的应用在其他应用中显示为输入。如果您希望您的应用程序也成为其他应用程序可以连接到的输出,请使用 MIDISourceCreateMore details in this answer..
    • 是的。我不确定OP想要什么。您的链接答案更完整。
    • 好吧,我不敢相信我错过了...它工作得很好,我确定我试过这个,我想我搞砸了代码并继续前进。非常感谢!
    猜你喜欢
    • 2019-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-20
    • 2019-05-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多