protected boolean doTickEvents ( ) { // Global Fade Out if ( doFadeOut ) { fadeOutValue -= fadeOutSub ; if ( fadeOutValue <= 0 ) return true ; // We did a fadeout and are finished now } final int nChannels = maxChannels ; if ( patternTicksDelayCount > 0 ) { for ( int c = 0 ; c < nChannels ; c ++ ) { final ChannelMemory aktMemo = channelMemory [ c ] ; processEffekts ( true , aktMemo ) ; } patternTicksDelayCount -- ; } else { currentTick -- ; if ( currentTick <= 0 ) { currentTick = currentTempo ; // if PatternDelay, do it and return if ( patternDelayCount > 0 ) { for ( int c = 0 ; c < nChannels ; c ++ ) { final ChannelMemory aktMemo = channelMemory [ c ] ; processEffekts ( false , aktMemo ) ; } patternDelayCount -- ; } else if ( currentArrangement >= mod . getSongLength ( ) ) { return true ; // Ticks finished and no new row --> FINITO! } else { // Do the row events doRowEvent ( ) ; // and step to the next row... Even if there are no more - we will find out later! currentRow ++ ; if ( patternJumpPatternIndex != - 1 ) // Do not check infinit Loops here, this is never infinit { currentRow = patternJumpPatternIndex ; patternJumpPatternIndex = - 1 ; } if ( currentRow >= currentPattern . getRowCount ( ) || patternBreakRowIndex != - 1 || patternBreakJumpPatternIndex != - 1 ) { mod . setArrangementPositionPlayed ( currentArrangement ) ; if ( patternBreakJumpPatternIndex != - 1 ) { final int checkRow = ( patternBreakRowIndex != - 1 ) ? patternBreakRowIndex : currentRow - 1 ; final boolean infinitLoop = isInfinitLoop ( patternBreakJumpPatternIndex , checkRow ) ; if ( infinitLoop && doNoLoops == Helpers . PLAYER_LOOP_IGNORE ) { patternBreakRowIndex = patternBreakJumpPatternIndex = - 1 ; resetJumpPositionSet ( ) ; currentArrangement ++ ; } else { currentArrangement = patternBreakJumpPatternIndex ; } patternBreakJumpPatternIndex = - 1 ; // and activate fadeout, if wished if ( infinitLoop && doNoLoops == Helpers . PLAYER_LOOP_FADEOUT ) doFadeOut = true ; } else { resetJumpPositionSet ( ) ; currentArrangement ++ ; } if ( patternBreakRowIndex != - 1 ) { currentRow = patternBreakRowIndex ; patternBreakRowIndex = - 1 ; } else currentRow = 0 ; // End of song? Fetch new pattern if not... if ( currentArrangement < mod . getSongLength ( ) ) { currentPatternIndex = mod . getArrangement ( ) [ currentArrangement ] ; currentPattern = mod . getPatternContainer ( ) . getPattern ( currentPatternIndex ) ; } else { currentPatternIndex = - 1 ; currentPattern = null ; } } } } else { // Do all Tickevents, 'cause we are in a Tick... for ( int c = 0 ; c < nChannels ; c ++ ) { final ChannelMemory aktMemo = channelMemory [ c ] ; processEffekts ( true , aktMemo ) ; } } } return false ; }
Do the events during a Tick .