本文整理汇总了C++中MidiDevice::setDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiDevice::setDirection方法的具体用法?C++ MidiDevice::setDirection怎么用?C++ MidiDevice::setDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiDevice
的用法示例。
在下文中一共展示了MidiDevice::setDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addDevice
void
CreateOrDeleteDeviceCommand::execute()
{
if (!m_deviceCreated) {
//!DEVPUSH: Not ideal; we probably just want to add it to the studio (and then trigger a re-push) rather than add it twice to studio and sequencer
// Create
// don't want to do this again on undo even if it fails -- only on redo
m_deviceCreated = true;
m_deviceId = m_studio->getSpareDeviceId(m_baseInstrumentId);
bool success = RosegardenSequencer::getInstance()->
addDevice(m_type, m_deviceId, m_baseInstrumentId, m_direction);
if (!success) {
SEQMAN_DEBUG << "CreateDeviceCommand::execute - "
<< "sequencer addDevice failed" << endl;
return ;
}
SEQMAN_DEBUG << "CreateDeviceCommand::execute - "
<< " added device " << m_deviceId
<< " with base instrument id " << m_baseInstrumentId
<< endl;
RosegardenSequencer::getInstance()->setConnection
(m_deviceId, strtoqstr(m_connection));
SEQMAN_DEBUG << "CreateDeviceCommand::execute - "
<< " reconnected device " << m_deviceId
<< " to " << m_connection << endl;
m_studio->addDevice(m_name, m_deviceId, m_baseInstrumentId, m_type);
Device *device = m_studio->getDevice(m_deviceId);
if (device) {
device->setConnection(m_connection);
MidiDevice *md = dynamic_cast<MidiDevice *>(device);
if (md) md->setDirection(m_direction);
}
/* update view automatically (without pressing refresh button) */
DeviceManagerDialog *dmd=RosegardenMainWindow::self()->getDeviceManager();
if (dmd!=NULL) {
dmd->slotResyncDevicesReceived();
}
} else {
// Delete
RosegardenSequencer::getInstance()->removeDevice(m_deviceId);
SEQMAN_DEBUG << "CreateDeviceCommand::unexecute - "
<< " removed device " << m_deviceId << endl;
m_studio->removeDevice(m_deviceId);
m_deviceId = Device::NO_DEVICE;
m_deviceCreated = false;
}
}