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


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

本文整理汇总了C++中MidiDevice::getMetronome方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiDevice::getMetronome方法的具体用法?C++ MidiDevice::getMetronome怎么用?C++ MidiDevice::getMetronome使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MidiDevice的用法示例。


在下文中一共展示了MidiDevice::getMetronome方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Device

MidiDevice::MidiDevice(const MidiDevice &dev) :
    Device(dev.getId(), dev.getName(), dev.getType()),
    Controllable(),
    m_programList(dev.m_programList),
    m_bankList(dev.m_bankList),
    m_controlList(dev.m_controlList),
    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))
{
    // Create and assign a metronome if required
    //
    if (dev.getMetronome())
    {
        m_metronome = new MidiMetronome(*dev.getMetronome());
    }

    // Copy the instruments
    //
    InstrumentList insList = dev.getAllInstruments();
    InstrumentList::iterator iIt = insList.begin();
    for (; iIt != insList.end(); ++iIt)
    {
        Instrument *newInst = new Instrument(**iIt);
        newInst->setDevice(this);
        m_instruments.push_back(newInst);
    }

    // generate presentation instruments
    generatePresentationList();
}
开发者ID:EQ4,项目名称:RosegardenW,代码行数:34,代码来源:MidiDevice.cpp

示例2:

// Run through the Devices checking for MidiDevices and
// returning the first Metronome we come across
//
const MidiMetronome*
Studio::getMetronomeFromDevice(DeviceId id)
{
    std::vector<Device*>::iterator it;

    for (it = m_devices.begin(); it != m_devices.end(); ++it) {

        std::cerr << "Studio::getMetronomeFromDevice: Having a look at device " << (*it)->getId() << std::endl;

        MidiDevice *midiDevice = dynamic_cast<MidiDevice*>(*it);
        if (midiDevice &&
                midiDevice->getId() == id &&
                midiDevice->getMetronome()) {
            std::cerr << "Studio::getMetronomeFromDevice(" << id << "): device is a MIDI device" << std::endl;
            return midiDevice->getMetronome();
        }

        SoftSynthDevice *ssDevice = dynamic_cast<SoftSynthDevice *>(*it);
        if (ssDevice &&
                ssDevice->getId() == id &&
                ssDevice->getMetronome()) {
            std::cerr << "Studio::getMetronomeFromDevice(" << id << "): device is a soft synth device" << std::endl;
            return ssDevice->getMetronome();
        }
    }

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

示例3:

const MidiMetronome *
ManageMetronomeDialog::getMetronome(Device *dev)
{
    MidiDevice *md = dynamic_cast<MidiDevice *>(dev);
    if (md) {
        return md->getMetronome();
    }
    SoftSynthDevice *ssd = dynamic_cast<SoftSynthDevice *>(dev);
    if (ssd) {
        return ssd->getMetronome();
    }
    return 0;
}
开发者ID:tedfelix,项目名称:rosegarden,代码行数:13,代码来源:ManageMetronomeDialog.cpp


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