ALSA的C++封装库 Drumstick

码农软件 · 软件分类 · 多媒体处理 · 2019-09-15 09:57:22

软件介绍

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;
}

本文地址:https://codercto.com/soft/d/14636.html

SRE

SRE

贝特西 拜尔 (Betsy Beyer)、等 / 孙宇聪 / 电子工业出版社 / 2016-10-1 / CNY 108.00

大型软件系统生命周期的绝大部分都处于“使用”阶段,而非“设计”或“实现”阶段。那么为什么我们却总是认为软件工程应该首要关注设计和实现呢?在《SRE:Google运维解密》中,Google SRE的关键成员解释了他们是如何对软件进行生命周期的整体性关注的,以及为什么这样做能够帮助Google成功地构建、部署、监控和运维世界上现存最大的软件系统。通过阅读《SRE:Google运维解密》,读者可以学习到......一起来看看 《SRE》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

MD5 加密
MD5 加密

MD5 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器