本文整理汇总了C++中ProgramList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramList::push_back方法的具体用法?C++ ProgramList::push_back怎么用?C++ ProgramList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramList
的用法示例。
在下文中一共展示了ProgramList::push_back方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFromXml
void Bank::createFromXml( istringstream& is, ProgramList& list )
{
Document doc;
try
{
doc.Parse( is.str(), true );
Node* moduleNode = doc.FirstChild( "Module", false );
if( moduleNode != NULL )
{
Program* program = new Program();
createFromXml( is, *program );
list.push_back( program );
}
else {
Iterator< Element > it( "Program" );
for( it = it.begin( &doc ); it != it.end(); it++ )
{
Program* program = new Program();
Element* programElement = it.Get();
readProgram( programElement, program );
list.push_back( program );
}
}
}
catch( const exception& e ) {
TRACE( e.what() );
}
}
示例2:
OnsetDetector::ProgramList
OnsetDetector::getPrograms() const
{
ProgramList programs;
programs.push_back("");
programs.push_back("General purpose");
programs.push_back("Soft onsets");
programs.push_back("Percussive onsets");
return programs;
}
示例3: getPrograms
TemplateDetector::ProgramList TemplateDetector::getPrograms() const {
ProgramList list;
list.push_back("blow1");
list.push_back("blow2");
// If you have no programs, return an empty list (or simply don't
// implement this function or getCurrentProgram/selectProgram)
return list;
}
示例4:
PluginHostAdapter::ProgramList
PluginHostAdapter::getPrograms() const
{
ProgramList list;
for (unsigned int i = 0; i < m_descriptor->programCount; ++i) {
list.push_back(m_descriptor->programs[i]);
}
return list;
}
示例5:
ProgramList
MidiDevice::getPrograms(const MidiBank &bank) const
{
ProgramList programs;
for (ProgramList::const_iterator it = m_programList.begin();
it != m_programList.end(); ++it) {
if (it->getBank() == bank) programs.push_back(*it);
}
return programs;
}
示例6:
ProgramList
MidiProgramsEditor::getBankSubset(const MidiBank &bank)
{
ProgramList program;
ProgramList::iterator it;
for (it = m_programList.begin(); it != m_programList.end(); ++it) {
if (it->getBank() == bank)
program.push_back(*it);
}
return program;
}
示例7: program
void
MIDIInstrumentParameterPanel::updateVariationComboBox()
{
RG_DEBUG << "updateVariationComboBox() begin...";
if (!getSelectedInstrument())
return;
MidiDevice *md =
dynamic_cast<MidiDevice *>(getSelectedInstrument()->getDevice());
if (!md) {
std::cerr << "WARNING: MIDIInstrumentParameterPanel::updateVariationComboBox(): No MidiDevice for Instrument " << getSelectedInstrument()->getId() << '\n';
return;
}
RG_DEBUG << "updateVariationComboBox(): Variation type is " << md->getVariationType();
if (md->getVariationType() == MidiDevice::NoVariations) {
showVariation(false);
return;
}
// Get the variations.
bool useMSB = (md->getVariationType() == MidiDevice::VariationFromMSB);
MidiByteList variationBanks;
if (useMSB) {
MidiByte lsb = getSelectedInstrument()->getLSB();
variationBanks = md->getDistinctMSBs(getSelectedInstrument()->isPercussion(),
lsb);
RG_DEBUG << "updateVariationComboBox(): Have " << variationBanks.size() << " variations for LSB " << lsb;
} else {
MidiByte msb = getSelectedInstrument()->getMSB();
variationBanks = md->getDistinctLSBs(getSelectedInstrument()->isPercussion(),
msb);
RG_DEBUG << "updateVariationComboBox(): Have " << variationBanks.size() << " variations for MSB " << msb;
}
// Convert variationBanks to a ProgramList.
ProgramList variations;
// For each variation
for (size_t i = 0; i < variationBanks.size(); ++i) {
// Assemble the program for the variation.
MidiBank bank;
if (useMSB) {
bank = MidiBank(getSelectedInstrument()->isPercussion(),
variationBanks[i],
getSelectedInstrument()->getLSB());
} else {
bank = MidiBank(getSelectedInstrument()->isPercussion(),
getSelectedInstrument()->getMSB(),
variationBanks[i]);
}
MidiProgram program(bank, getSelectedInstrument()->getProgramChange());
// Skip any programs without names.
if (md->getProgramName(program) == "")
continue;
variations.push_back(program);
}
// Compute the current variation.
// ??? This might be combined into the previous for loop.
int currentVariation = -1;
// For each variation
for (size_t i = 0; i < variations.size(); ++i) {
if (getSelectedInstrument()->getProgram().partialCompare(variations[i])) {
currentVariation = i;
break;
}
}
// If the variations have changed, repopulate the combobox.
if (!partialCompareWithName(variations, m_variations)) {
RG_DEBUG << "updateVariationComboBox(): Repopulating the combobox";
// Update the cache.
m_variations = variations;
// Copy from m_variations to m_variationComboBox.
m_variationComboBox->clear();
for (size_t i = 0; i < m_variations.size(); ++i) {
std::string programName = md->getProgramName(m_variations[i]);
// Pick the correct bank number.
MidiBank bank = m_variations[i].getBank();
MidiByte variationBank = useMSB ? bank.getMSB() : bank.getLSB();
m_variationComboBox->addItem(QObject::tr("%1. %2")
.arg(variationBank)
.arg(QObject::tr(programName.c_str())));
}
//.........这里部分代码省略.........