本文整理汇总了C++中Hydrogen::setSelectedPatternNumberWithoutGuiEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ Hydrogen::setSelectedPatternNumberWithoutGuiEvent方法的具体用法?C++ Hydrogen::setSelectedPatternNumberWithoutGuiEvent怎么用?C++ Hydrogen::setSelectedPatternNumberWithoutGuiEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hydrogen
的用法示例。
在下文中一共展示了Hydrogen::setSelectedPatternNumberWithoutGuiEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleAction
//.........这里部分代码省略.........
pEngine->setSelectedPatternNumber( row );
return true;
}
if( sActionString == "SELECT_PREV_PATTERN_RELATIVE" ){
bool ok;
if(!Preferences::get_instance()->patternModePlaysSelected())
return true;
int row = pEngine->getSelectedPatternNumber() - pAction->getParameter1().toInt(&ok,10);
if( row < 0 )
return false;
pEngine->setSelectedPatternNumber( row );
return true;
}
if( sActionString == "SELECT_NEXT_PATTERN_CC_ABSOLUT" ){
bool ok;
int row = pAction->getParameter2().toInt(&ok,10);
if( row> pEngine->getSong()->get_pattern_list()->size() -1 )
return false;
if(Preferences::get_instance()->patternModePlaysSelected())
pEngine->setSelectedPatternNumber( row );
else
return true;// only usefully in normal pattern mode
return true;
}
if( sActionString == "SELECT_NEXT_PATTERN_PROMPTLY" ){// obsolete, use SELECT_NEXT_PATTERN_CC_ABSOLUT instead
bool ok;
int row = pAction->getParameter2().toInt(&ok,10);
pEngine->setSelectedPatternNumberWithoutGuiEvent( row );
return true;
}
if( sActionString == "SELECT_AND_PLAY_PATTERN"){
bool ok;
int row = pAction->getParameter1().toInt(&ok,10);
pEngine->setSelectedPatternNumber( row );
pEngine->sequencer_setNextPattern( row, false, true );
int nState = pEngine->getState();
if ( nState == STATE_READY ){
pEngine->sequencer_play();
}
return true;
}
if( sActionString == "SELECT_INSTRUMENT" ){
bool ok;
int instrument_number = pAction->getParameter2().toInt(&ok,10) ;
if ( pEngine->getSong()->get_instrument_list()->size() < instrument_number )
instrument_number = pEngine->getSong()->get_instrument_list()->size() -1;
pEngine->setSelectedInstrumentNumber( instrument_number );
return true;
}
if( sActionString == "EFFECT1_LEVEL_ABSOLUTE" ){
bool ok;
int nLine = pAction->getParameter1().toInt(&ok,10);
int fx_param = pAction->getParameter2().toInt(&ok,10);
setAbsoluteFXLevel( nLine, 0 , fx_param );
}