本文整理汇总了C++中MIDIDevice::name方法的典型用法代码示例。如果您正苦于以下问题:C++ MIDIDevice::name方法的具体用法?C++ MIDIDevice::name怎么用?C++ MIDIDevice::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MIDIDevice
的用法示例。
在下文中一共展示了MIDIDevice::name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refreshList
void ConfigureMIDIOut::refreshList()
{
QTreeWidgetItem* item;
MIDIDevice* dev;
int i = 1;
m_list->clear();
QListIterator <MIDIDevice*> it(m_plugin->m_devices);
while (it.hasNext() == true)
{
dev = it.next();
item = new QTreeWidgetItem(m_list);
item->setText(KColumnNumber, QString("%1").arg(i++));
item->setText(KColumnName, dev->name());
item->setText(KColumnMIDIChannel,
QString("%1").arg(dev->midiChannel() + 1));
item->setText(KColumnMode,
MIDIDevice::modeToString(dev->mode()));
}
}
示例2: rescanDevices
void MIDIOut::rescanDevices()
{
snd_seq_client_info_t* clientInfo = NULL;
snd_seq_port_info_t* portInfo = NULL;
/* Don't do anything if the ALSA sequencer interface is not open */
if (m_alsa == NULL)
return;
/* Copy all device pointers to a destroy list */
QList <MIDIDevice*> destroyList(m_devices);
/* Allocate these from stack */
snd_seq_client_info_alloca(&clientInfo);
snd_seq_port_info_alloca(&portInfo);
/* Find out what kinds of clients and ports there are */
snd_seq_client_info_set_client(clientInfo, 0); // TODO: -1 ?????
while (snd_seq_query_next_client(m_alsa, clientInfo) == 0)
{
int client;
/* Get the client ID */
client = snd_seq_client_info_get_client(clientInfo);
/* Ignore our own client */
if (m_address->client == client)
continue;
/* Go thru all available ports in the client */
snd_seq_port_info_set_client(portInfo, client);
snd_seq_port_info_set_port(portInfo, -1);
while (snd_seq_query_next_port(m_alsa, portInfo) == 0)
{
const snd_seq_addr_t* address;
MIDIDevice* dev;
address = snd_seq_port_info_get_addr(portInfo);
if (address == NULL)
continue;
dev = device(address);
if (dev == NULL)
{
/* New address. Create a new device for it. */
dev = new MIDIDevice(this, address);
Q_ASSERT(dev != NULL);
/* Don't show QLC's internal ALSA ports */
if (dev->name().contains("__QLC__") == false)
addDevice(dev);
else
delete dev;
}
else
{
/* This device is still alive. Do not destroy
it at the end of this function. */
destroyList.removeAll(dev);
}
}
}
/* All devices that were not found during rescan are clearly no longer
in our presence and must be destroyed. */
while (destroyList.isEmpty() == false)
removeDevice(destroyList.takeFirst());
}