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

XSS跨站脚本攻击剖析与防御

XSS跨站脚本攻击剖析与防御

邱永华 / 人民邮电出版社 / 2013-9-1 / 49.00元

《XSS跨站脚本攻击剖析与防御》是一本专门剖析XSS安全的专业书,总共8章,主要包括的内容如下。第1章 XSS初探,主要阐述了XSS的基础知识,包括XSS的攻击原理和危害。第2章 XSS利用方式,就当前比较流行的XSS利用方式做了深入的剖析,这些攻击往往基于客户端,从挂马、窃取Cookies、会话劫持到钓鱼欺骗,各种攻击都不容忽视。第3章 XSS测试和利用工具,介绍了一些常见的XSS测试工具。第4......一起来看看 《XSS跨站脚本攻击剖析与防御》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具