<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          DrumstickALSA的C++封裝庫

          聯(lián)合創(chuàng)作 · 2023-09-29 21:25

          Drumstick 是一個ALSA的音序器 (MIDI 接口)的C++封裝庫

          示例代碼:

          #include <QApplication>
          #include <drumstick.h>

          int main(int argc, char **argv) {
          QApplication app(argc, argv, false);

          // create a client object on the heap
          drumstick::MidiClient *client = new drumstick::MidiClient;
          client->open();
          client->setClientName( "MyClient" );

          // create the port
          drumstick::MidiPort *port = client->createPort();
          port->setPortName( "MyPort" );
          port->setCapability( SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ );
          port->setPortType( SND_SEQ_PORT_TYPE_MIDI_GENERIC );
          // subscribe the port to some other client:port
          port->subscribeTo( "20:0" ); // or "name:port", like in "KMidimon:0"

          // create an event object on the stack, to send a note on message
          drumstick::NoteOnEvent ev( 0, 66, 100 ); // (channel, note number, velocity)
          ev.setSource( port->getPortId() );
          ev.setSubscribers(); // deliver to all the connected ports
          ev.setDirect(); // not scheduled, deliver immediately
          client->output( &ev ); // or outputDirect() if you prefer not buffered
          client->drainOutput(); // flush the buffer

          // close and clean
          client->close();
          delete client;
          return 0;
          }
          瀏覽 17
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  67194亚洲| 91电影成人 | 亚洲国产另类无码日韩 | 日本a天堂 | 日韩欧美高清视频 |