public int adjustState(int currentIndex){
        if(playHeadMode == PLAYHEAD_FORWARD){
            currentIndex++;
            if(currentIndex >= CHREditorModel.MAX_FRAMES){
                if(mode == PLAYHEAD_LOOP_MODE){
                    currentIndex = 0;
                } else if(mode == PLAYHEAD_OSCILLATE_MODE){
                    currentIndex--;
                    playHeadMode = PLAYHEAD_BACKWARD;
                } else {
                    currentIndex--;
                    playHeadMode = PLAYHEAD_STOP;
                    _animationRunning = false;
                }
            }
        } else if(playHeadMode == PLAYHEAD_BACKWARD){
            currentIndex--;
            if(currentIndex < 0){
                if(mode == PLAYHEAD_LOOP_MODE){
                    currentIndex = CHREditorModel.MAX_FRAMES;
                } else if(mode == PLAYHEAD_OSCILLATE_MODE){
                    currentIndex++;
                    playHeadMode = PLAYHEAD_FORWARD;
                } else {
                    currentIndex++;
                    playHeadMode = PLAYHEAD_STOP;
                    _animationRunning = false;
                }
            }
        }
        return currentIndex;
    }