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


C++ Hydrogen::sequencer_setNextPatternCategory方法代码示例

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


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

示例1: handleAction


//.........这里部分代码省略.........
		return true;
	}

	if( sActionString == "TAP_TEMPO" ){
		pEngine->onTapTempoAccelEvent();
		return true;
	}

	if( sActionString == "SELECT_NEXT_PATTERN" ){
		bool ok;
		int row = pAction->getParameter1().toInt(&ok,10);
		if( row> pEngine->getSong()->get_pattern_list()->size() -1 )
			return false;
		if(Preferences::get_instance()->patternModePlaysSelected())
			pEngine->setSelectedPatternNumber( row );
		else
			pEngine->sequencer_setNextPattern( row, false, true );
		return true;
	}

	if( sActionString == "SELECT_NEXT_PATTERN_CATEGORY" ){
		bool ok;
		int par = pAction->getParameter1().toInt(&ok,10);
		QString cat = pAction->getParameter3();
		INFOLOG( QString( "midaction SELECT_NEXT_PATTERN_CATEGORY with par1=%1 and par2=%2" )
				  .arg( par ).arg( cat ) );
		if( par > pEngine->getSong()->get_pattern_list()->size() -1 )
			return false;
		if(Preferences::get_instance()->patternModePlaysSelected()) {
			// TODO: improve warninglog
			WARNINGLOG("triggered midiaction SELECT_NEXT_PATTERN_CATEGORY with patternModePlaysSelected")
			pEngine->setSelectedPatternNumber( par );
		} else
			pEngine->sequencer_setNextPatternCategory(par, cat );
		return true;
	}

	if( sActionString == "SELECT_NEXT_PATTERN_RELATIVE" ){
		bool ok;
		if(!Preferences::get_instance()->patternModePlaysSelected())
			return true;
		int row = pEngine->getSelectedPatternNumber() + pAction->getParameter1().toInt(&ok,10);
		if( row> pEngine->getSong()->get_pattern_list()->size() -1 )
			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;
开发者ID:IARI,项目名称:hydrogen-live,代码行数:67,代码来源:midi_action.cpp


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