本文整理汇总了C++中MidiDevice::getDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiDevice::getDirection方法的具体用法?C++ MidiDevice::getDirection怎么用?C++ MidiDevice::getDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiDevice
的用法示例。
在下文中一共展示了MidiDevice::getDirection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Device
MidiDevice::MidiDevice(DeviceId id,
InstrumentId ibase,
const MidiDevice &dev) :
Device(id, dev.getName(), Device::Midi),
m_programList(dev.m_programList),
m_bankList(dev.m_bankList),
m_controlList(0),
m_keyMappingList(dev.m_keyMappingList),
m_metronome(0),
m_direction(dev.getDirection()),
m_variationType(dev.getVariationType()),
m_librarian(dev.getLibrarian()),
m_allocator(new AllocateChannels(ChannelSetup::MIDI))
{
createInstruments(ibase);
// Populate device and Instrument with Controllers.
ControlList::const_iterator cIt = dev.m_controlList.begin();
for(; cIt != dev.m_controlList.end(); ++cIt) {
addControlParameter(*cIt, true);
}
// Create and assign a metronome if required
//
if (dev.getMetronome()) {
m_metronome = new MidiMetronome(*dev.getMetronome());
}
generatePresentationList();
}
示例2: return
// From a user selection (from a "Presentation" list) return
// the matching Instrument
//
Instrument*
Studio::getInstrumentFromList(int index)
{
std::vector<Device*>::iterator it;
InstrumentList list;
InstrumentList::iterator iit;
int count = 0;
for (it = m_devices.begin(); it != m_devices.end(); ++it)
{
MidiDevice *midiDevice = dynamic_cast<MidiDevice*>(*it);
if (midiDevice)
{
// skip read-only devices
if (midiDevice->getDirection() == MidiDevice::Record)
continue;
}
list = (*it)->getPresentationInstruments();
for (iit = list.begin(); iit != list.end(); ++iit)
{
if (count == index)
return (*iit);
count++;
}
}
return 0;
}
示例3:
bool
ManageMetronomeDialog::isSuitable(Device *dev, bool *hasConnectionReturn)
{
MidiDevice *md = dynamic_cast<MidiDevice *>(dev);
if (md && md->getDirection() == MidiDevice::Play) {
if (hasConnectionReturn) {
QString conn = RosegardenSequencer::getInstance()->getConnection
(md->getId());
if (conn == "") *hasConnectionReturn = false;
else *hasConnectionReturn = true;
}
return true;
}
if (dynamic_cast<SoftSynthDevice *>(dev)) {
if (hasConnectionReturn) *hasConnectionReturn = true;
return true;
}
return false;
}
示例4: NamedCommand
CreateOrDeleteDeviceCommand::CreateOrDeleteDeviceCommand(Studio *studio,
DeviceId id) :
NamedCommand(getGlobalName(true)),
m_studio(studio),
m_deviceId(id),
m_deviceCreated(true)
{
Device *device = m_studio->getDevice(m_deviceId);
if (device) {
m_name = device->getName();
m_type = device->getType();
m_direction = MidiDevice::Play;
MidiDevice *md = dynamic_cast<MidiDevice *>(device);
if (md) m_direction = md->getDirection();
m_connection = qstrtostr(RosegardenSequencer::getInstance()
->getConnection(md->getId()));
} else {
RG_DEBUG << "CreateOrDeleteDeviceCommand: No such device as "
<< m_deviceId << endl;
}
}
示例5: QDialog
SplitByRecordingSrcDialog::SplitByRecordingSrcDialog(QWidget *parent, RosegardenDocument *doc) :
QDialog(parent)
{
setModal(true);
setWindowTitle(tr("Split by Recording Source"));
QGridLayout *metagrid = new QGridLayout;
setLayout(metagrid);
QWidget *vBox = new QWidget(this);
QVBoxLayout *vBoxLayout = new QVBoxLayout;
metagrid->addWidget(vBox, 0, 0);
QGroupBox *groupBox = new QGroupBox( tr("Recording Source"), vBox );
groupBox->setContentsMargins(10, 10, 10, 10);
QGridLayout *layout = new QGridLayout(groupBox);
layout->setSpacing(5);
vBoxLayout->addWidget(groupBox);
vBox->setLayout(vBoxLayout);
layout->addWidget(new QLabel( tr("Channel:"), groupBox ), 0, 0);
m_channel = new QComboBox( groupBox );
m_channel->setMaxVisibleItems( 17 );
layout->addWidget(m_channel, 0, 1);
QSpacerItem *spacer = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout->addItem( spacer, 0, 2 );
m_channel->addItem(tr("any"));
for (int i = 1; i < 17; ++i) {
m_channel->addItem(QString::number(i));
}
layout->addWidget(new QLabel( tr("Device:"), groupBox ), 1, 0);
m_device = new QComboBox( groupBox );
layout->addWidget( m_device, 1, 1, 0+1, 2 - 1+1);
m_deviceIds.clear();
m_deviceIds.push_back( -1);
m_device->addItem(tr("any"));
DeviceList *devices = doc->getStudio().getDevices();
DeviceListConstIterator it;
for (it = devices->begin(); it != devices->end(); it++) {
MidiDevice *dev =
dynamic_cast<MidiDevice*>(*it);
if (dev && dev->getDirection() == MidiDevice::Record) {
QString label = QString::number(dev->getId());
label += ": ";
label += strtoqstr(dev->getName());
QString connection = RosegardenSequencer::getInstance()->getConnection
(dev->getId());
label += " - ";
if (connection == "")
label += tr("No connection");
else
label += connection;
m_device->addItem(label);
m_deviceIds.push_back(dev->getId());
}
}
m_channel->setCurrentIndex(0);
m_device->setCurrentIndex(0);
groupBox->setLayout(layout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
metagrid->addWidget(buttonBox, 1, 0);
metagrid->setRowStretch(0, 10);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}