/////////////////////////////////////////////////////////////////////////////// Local LED handler function/////////////////////////////////////////////////////////////////////////////static s32 LED_Handler(u16 *gp_leds){if( SEQ_FILE_FormattingRequired())return0;// no LED action as long as files not available

/////////////////////////////////////////////////////////////////////////////// Local encoder callback function// Should return:// 1 if value has been changed// 0 if value hasn't been changed// -1 if invalid or unsupported encoder/////////////////////////////////////////////////////////////////////////////static s32 Encoder_Handler(seq_ui_encoder_t encoder, s32 incrementer){if( SEQ_FILE_FormattingRequired())return0;// no encoder action as long as files not available

// in phrase mode and no song pos selected: fetch patterns immediately if SynchChange not setif(!SEQ_SONG_ActiveGet()){
u8 force_immediate_change = seq_core_options.SYNCHED_PATTERN_CHANGE?0:1;
SEQ_SONG_FetchPos(force_immediate_change);
SEQ_CORE_ManualSynchToMeasure(0xffff);// ensure that the new selection is in sync}return1;// value has been changed}return0;// no change}

/////////////////////////////////////////////////////////////////////////////// Local button callback function// Should return:// 1 if value has been changed// 0 if value hasn't been changed// -1 if invalid or unsupported button/////////////////////////////////////////////////////////////////////////////static s32 Button_Handler(seq_ui_button_t button, s32 depressed){if( SEQ_FILE_FormattingRequired())return0;// no button action as long as files not available

/////////////////////////////////////////////////////////////////////////////// Local Display Handler function// IN: <high_prio>: if set, a high-priority LCD update is requested/////////////////////////////////////////////////////////////////////////////static s32 LCD_Handler(u8 high_prio){// 00000000001111111111222222222233333333330000000000111111111122222222223333333333// 01234567890123456789012345678901234567890123456789012345678901234567890123456789// <--------------------------------------><-------------------------------------->// No Songs available as long as theSession hasn't been created! // Please press EXIT and create a new Session!

if( SEQ_FILE_FormattingRequired()){if( high_prio )return0;

SEQ_LCD_CursorSet(0,0);
SEQ_LCD_PrintString(" No Songs available as long as theSession hasn't been created! ");
SEQ_LCD_CursorSet(0,1);
SEQ_LCD_PrintString(" Please press EXIT and create a new Session! ");return0;}

/////////////////////////////////////////////////////////////////////////////// Local exit function/////////////////////////////////////////////////////////////////////////////static s32 EXIT_Handler(void){// save song (function exits automatically if no position has been changed)
SEQ_SONG_Save(SEQ_SONG_NumGet());

/////////////////////////////////////////////////////////////////////////////// Create new mixer map and patterns, store together with mutes into song position/////////////////////////////////////////////////////////////////////////////static s32 createNewPatterns(u8 slot){// new song edit pos depending on slot
ui_song_edit_pos =8*slot;