本文整理汇总了C++中MIDIDevice类的典型用法代码示例。如果您正苦于以下问题:C++ MIDIDevice类的具体用法?C++ MIDIDevice怎么用?C++ MIDIDevice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MIDIDevice类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmd
void ConfigureMIDIOut::slotEditClicked()
{
QTreeWidgetItem* item;
MIDIDevice* device;
item = m_list->currentItem();
if (item == NULL)
return;
device = m_plugin->device(item->text(KColumnNumber).toInt() - 1);
if (device == NULL)
return;
ConfigureMIDIDevice cmd(this, device);
if (cmd.exec() == QDialog::Accepted)
{
/* Update the tree item */
item->setText(KColumnMIDIChannel,
QString("%1").arg(device->midiChannel() + 1));
item->setText(KColumnMode,
MIDIDevice::modeToString(device->mode()));
/* Save as global settings */
device->saveSettings();
}
}
示例2: QString
QString MIDIOut::infoText(quint32 output)
{
QString str;
str += QString("<HTML>");
str += QString("<HEAD>");
str += QString("<TITLE>%1</TITLE>").arg(name());
str += QString("</HEAD>");
str += QString("<BODY>");
if (output == QLCOutPlugin::invalidOutput())
{
str += QString("<H3>%1</H3>").arg(name());
str += QString("<P>");
str += tr("This plugin provides DMX output support for various MIDI devices.");
str += QString("</P>");
}
else
{
MIDIDevice* dev = device(output);
if (dev != NULL)
str += dev->infoText();
}
str += QString("</BODY>");
str += QString("</HTML>");
return str;
}
示例3: device
void MIDIOut::close(quint32 output)
{
MIDIDevice* dev = device(output);
if (dev != NULL)
dev->open();
else
qWarning() << name() << "has no output number:" << output;
}
示例4: Q_UNUSED
void MIDIOut::writeRange(t_output output, t_channel address, t_value* values,
t_channel num)
{
Q_UNUSED(address);
MIDIDevice* dev = device(output);
if (dev != NULL)
dev->writeRange(values, num);
}
示例5: feedBack
void MIDIInput::feedBack(t_input input, t_input_channel channel,
t_input_value value)
{
MIDIDevice* dev;
dev = device(input);
if (dev == NULL)
return;
else
dev->feedBack(channel, value);
}
示例6: device
void MIDIInput::open(t_input input)
{
MIDIDevice* dev = device(input);
if (dev != NULL)
{
connect(dev, SIGNAL(valueChanged(MIDIDevice*,
t_input_channel,
t_input_value)),
this, SLOT(slotDeviceValueChanged(MIDIDevice*,
t_input_channel,
t_input_value)));
dev->open();
}
示例7: it
MIDIDevice* MIDIOut::device(const snd_seq_addr_t* address)
{
QListIterator <MIDIDevice*> it(m_devices);
while (it.hasNext() == true)
{
MIDIDevice* dev = it.next();
Q_ASSERT(dev != NULL);
Q_ASSERT(dev->address() != NULL);
if (dev->address()->client == address->client &&
dev->address()->port == address->port)
{
return dev;
}
}
return NULL;
}
示例8: QString
QString MIDIOut::infoText(t_output output)
{
QString str;
str += QString("<HTML>");
str += QString("<HEAD>");
str += QString("<TITLE>%1</TITLE>").arg(name());
str += QString("</HEAD>");
str += QString("<BODY>");
if (output == KOutputInvalid)
{
str += QString("<H3>%1</H3>").arg(name());
str += QString("<P>");
str += QString("This plugin provides DMX output support thru ");
str += QString("various MIDI devices.");
str += QString("</P>");
}
else
{
MIDIDevice* dev = device(output);
if (dev != NULL)
{
str += dev->infoText();
}
else
{
str += QString("<P><I>");
str += QString("Unable to find device. Please go to ");
str += QString("the configuration dialog and click ");
str += QString("the refresh button.");
str += QString("</I></P>");
}
}
str += QString("</BODY>");
str += QString("</HTML>");
return str;
}
示例9: it
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()));
}
}
示例10: destroyList
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());
}