c++ - RtMidi-MidiInDummy:此类未提供任何功能

标签 c++

我想使用Rtmidi从启动板获取输入。
但是,尽管连接了启动板,但0舱可用。
“MidiInDummy:此类未提供任何功能。”
还有这个短语,所以似乎是错误。

资源:

//Source : http://www.music.mcgill.ca/~gary/rtmidi/index.html#probing
#define __WINDOWS_MM__
#include <iostream>
#include <cstdlib>
#include "RtMidi.h"
int main()
{
    RtMidiIn* midiin = 0;
    RtMidiOut* midiout = 0;
    // RtMidiIn constructor
    try {
        midiin = new RtMidiIn();
    }
    catch (RtMidiError& error) {
        error.printMessage();
        exit(EXIT_FAILURE);
    }
    // Check inputs.
    unsigned int nPorts = midiin->getPortCount();
    std::cout << "\nThere are " << nPorts << " MIDI input sources available.\n";
    std::string portName;
    for (unsigned int i = 0; i < nPorts; i++) {
        try {
            portName = midiin->getPortName(i);
        }
        catch (RtMidiError& error) {
            error.printMessage();
            goto cleanup;
        }
        std::cout << "  Input Port #" << i + 1 << ": " << portName << '\n';
    }
    // RtMidiOut constructor
    try {
        midiout = new RtMidiOut();
    }
    catch (RtMidiError& error) {
        error.printMessage();
        exit(EXIT_FAILURE);
    }
    // Check outputs.
    nPorts = midiout->getPortCount();
    std::cout << "\nThere are " << nPorts << " MIDI output ports available.\n";
    for (unsigned int i = 0; i < nPorts; i++) {
        try {
            portName = midiout->getPortName(i);
        }
        catch (RtMidiError& error) {
            error.printMessage();
            goto cleanup;
        }
        std::cout << "  Output Port #" << i + 1 << ": " << portName << '\n';
    }
    std::cout << '\n';
    // Clean up
cleanup:
    delete midiin;
    delete midiout;
    return 0;
}

输出:
MidiInDummy: This class provides no functionality.
There are 0 MIDI input sources available.
MidiOutDummy: This class provides no functionality.
There are 0 MIDI output ports available.

我怎么解决这个问题?

最佳答案

关于c++ - RtMidi-MidiInDummy:此类未提供任何功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62294964/

相关文章:

c++ - Dyld 库未加载 : Reason: Image not found

c++ - 错误 : expected constructor, 析构函数,或 '(' token 之前的类型转换

c++ - glGenFramebuffers 或 glGenFramebuffersEXT?

c++ - 简单的 C++ vector 用法

C++ 标量变量设置为零值

c++ - 仅输出重载 C++

c++ - 在函数模板中使用静态局部变量的地址作为类型标识符是否安全?

C++ 通用类链接错误

c++ - Linux 上 C++ 中的串行端口。串行端口上的读取和写入可以同时发生吗..?

c++ - C++中的简单加密/解密