当前位置: 首页>>代码示例>>C++>>正文


C++ MidiDevice::getDirection方法代码示例

本文整理汇总了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();
}
开发者ID:EQ4,项目名称:RosegardenW,代码行数:31,代码来源:MidiDevice.cpp

示例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;

}
开发者ID:tedfelix,项目名称:rosegarden,代码行数:36,代码来源:Studio.cpp

示例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;
}
开发者ID:tedfelix,项目名称:rosegarden,代码行数:19,代码来源:ManageMetronomeDialog.cpp

示例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;
    }
}
开发者ID:UIKit0,项目名称:rosegarden,代码行数:22,代码来源:CreateOrDeleteDeviceCommand.cpp

示例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()));
}
开发者ID:UIKit0,项目名称:rosegarden,代码行数:72,代码来源:SplitByRecordingSrcDialog.cpp


注:本文中的MidiDevice::getDirection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。