本文整理汇总了C++中Hydrogen::setSelectedInstrumentNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ Hydrogen::setSelectedInstrumentNumber方法的具体用法?C++ Hydrogen::setSelectedInstrumentNumber怎么用?C++ Hydrogen::setSelectedInstrumentNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hydrogen
的用法示例。
在下文中一共展示了Hydrogen::setSelectedInstrumentNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: soloClicked
void Mixer::soloClicked(MixerLine* ref)
{
Hydrogen *pEngine = Hydrogen::get_instance();
Song *pSong = pEngine->getSong();
InstrumentList *pInstrList = pSong->get_instrument_list();
int nInstruments = pInstrList->size();
int nLine = findMixerLineByRef(ref);
pEngine->setSelectedInstrumentNumber( nLine );
bool isSoloClicked = ref->isSoloClicked();
if (isSoloClicked) {
for ( int i = 0; i < nInstruments; ++i ) {
m_pMixerLine[i]->setSoloClicked( false );
m_pMixerLine[i]->setMuteClicked( true );
pInstrList->get( i )->set_muted( true );
}
m_pMixerLine[nLine]->setSoloClicked( true );
m_pMixerLine[nLine]->setMuteClicked( false );
pInstrList->get( nLine )->set_muted( false );
}
else {
for ( int i = 0; i < nInstruments; ++i ) {
m_pMixerLine[i]->setMuteClicked( false );
m_pMixerLine[i]->setSoloClicked( false );
pInstrList->get( i )->set_muted( false );
}
}
Hydrogen::get_instance()->setSelectedInstrumentNumber(nLine);
}
示例2: muteClicked
void Mixer::muteClicked(MixerLine* ref)
{
int nLine = findMixerLineByRef(ref);
bool isMuteClicked = ref->isMuteClicked();
Hydrogen *pEngine = Hydrogen::get_instance();
CoreActionController* pController = pEngine->getCoreActionController();
pEngine->setSelectedInstrumentNumber( nLine );
pController->setStripIsMuted( nLine, isMuteClicked );
}
示例3: moveUpBtnClicked
void PatternEditorPanel::moveUpBtnClicked(Button *)
{
Hydrogen *engine = Hydrogen::get_instance();
int nSelectedInstrument = engine->getSelectedInstrumentNumber();
AudioEngine::get_instance()->lock( RIGHT_HERE );
Song *pSong = engine->getSong();
InstrumentList *pInstrumentList = pSong->get_instrument_list();
if ( ( nSelectedInstrument - 1 ) >= 0 ) {
pInstrumentList->swap( nSelectedInstrument -1, nSelectedInstrument );
AudioEngine::get_instance()->unlock();
engine->setSelectedInstrumentNumber( nSelectedInstrument - 1 );
pSong->set_is_modified( true );
}
else {
AudioEngine::get_instance()->unlock();
}
}
示例4: handleAction
//.........这里部分代码省略.........
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 );
}
if( sActionString == "EFFECT2_LEVEL_ABSOLUTE" ){
bool ok;
int nLine = pAction->getParameter1().toInt(&ok,10);
int fx_param = pAction->getParameter2().toInt(&ok,10);
setAbsoluteFXLevel( nLine, 1 , fx_param );
}
if( sActionString == "EFFECT3_LEVEL_ABSOLUTE" ){
bool ok;
int nLine = pAction->getParameter1().toInt(&ok,10);
int fx_param = pAction->getParameter2().toInt(&ok,10);
setAbsoluteFXLevel( nLine, 2 , fx_param );
}
if( sActionString == "EFFECT4_LEVEL_ABSOLUTE" ){
bool ok;
int nLine = pAction->getParameter1().toInt(&ok,10);
int fx_param = pAction->getParameter2().toInt(&ok,10);
setAbsoluteFXLevel( nLine, 3 , fx_param );
}
if( sActionString == "MASTER_VOLUME_RELATIVE" ){