Subversion Repositories svn.mios32

Rev

Rev 2545 | Rev 2550 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2545 Rev 2547
Line 1... Line 1...
1
// $Id: seq_ui.c 2545 2017-11-05 17:22:36Z tk $
1
// $Id: seq_ui.c 2547 2017-12-19 19:44:30Z tk $
2
/*
2
/*
3
 * User Interface Routines
3
 * User Interface Routines
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 3101... Line 3101...
3101
    return 0; // no error
3101
    return 0; // no error
3102
3102
3103
  // ignore as long as hardware config hasn't been read
3103
  // ignore as long as hardware config hasn't been read
3104
  if( !SEQ_FILE_HW_ConfigLocked() )
3104
  if( !SEQ_FILE_HW_ConfigLocked() )
3105
    return -1;
3105
    return -1;
-
 
3106
-
 
3107
  // for special LED handling of Antilog Frontpanel
-
 
3108
  u8 selbuttons_available = seq_hwcfg_blm8x8.dout_gp_mapping == 3;
3106
3109
3107
  // track LEDs
3110
  // track LEDs
3108
  // in pattern page: track buttons are used as group buttons
3111
  // in pattern page: track buttons are used as group buttons
3109
  if( ui_page == SEQ_UI_PAGE_PATTERN ) {
3112
  if( ui_page == SEQ_UI_PAGE_PATTERN ) {
3110
    SEQ_LED_PinSet(seq_hwcfg_led.track[0], (ui_selected_group == 0));
3113
    SEQ_LED_PinSet(seq_hwcfg_led.track[0], (ui_selected_group == 0));
Line 3123... Line 3126...
3123
    SEQ_LED_PinSet(seq_hwcfg_led.track[1], (selected_tracks & (1 << 1)));
3126
    SEQ_LED_PinSet(seq_hwcfg_led.track[1], (selected_tracks & (1 << 1)));
3124
    SEQ_LED_PinSet(seq_hwcfg_led.track[2], (selected_tracks & (1 << 2)));
3127
    SEQ_LED_PinSet(seq_hwcfg_led.track[2], (selected_tracks & (1 << 2)));
3125
    SEQ_LED_PinSet(seq_hwcfg_led.track[3], (selected_tracks & (1 << 3)));
3128
    SEQ_LED_PinSet(seq_hwcfg_led.track[3], (selected_tracks & (1 << 3)));
3126
  }
3129
  }
3127
3130
3128
  SEQ_LED_PinSet(seq_hwcfg_led.track_sel, ui_page == SEQ_UI_PAGE_TRACKSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_TRACKS);
3131
  SEQ_LED_PinSet(seq_hwcfg_led.track_sel, ui_page == SEQ_UI_PAGE_TRACKSEL || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_TRACKS));
3129
 
3132
 
3130
  // parameter layer LEDs
3133
  // parameter layer LEDs
3131
  // in song page: layer buttons are used to select the cursor position
3134
  // in song page: layer buttons are used to select the cursor position
3132
  if( ui_page == SEQ_UI_PAGE_SONG ) {
3135
  if( ui_page == SEQ_UI_PAGE_SONG ) {
3133
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[0], ui_selected_item == 0);
3136
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[0], ui_selected_item == 0);
Line 3136... Line 3139...
3136
  } else {
3139
  } else {
3137
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[0], (ui_selected_par_layer == 0));
3140
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[0], (ui_selected_par_layer == 0));
3138
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[1], (ui_selected_par_layer == 1));
3141
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[1], (ui_selected_par_layer == 1));
3139
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[2], (ui_selected_par_layer >= 2) || seq_ui_button_state.PAR_LAYER_SEL);
3142
    SEQ_LED_PinSet(seq_hwcfg_led.par_layer[2], (ui_selected_par_layer >= 2) || seq_ui_button_state.PAR_LAYER_SEL);
3140
  }
3143
  }
3141
  SEQ_LED_PinSet(seq_hwcfg_led.par_layer_sel, ui_page == SEQ_UI_PAGE_PARSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_PAR);
3144
  SEQ_LED_PinSet(seq_hwcfg_led.par_layer_sel, ui_page == SEQ_UI_PAGE_PARSEL || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_PAR));
3142
 
3145
 
3143
  // group LEDs
3146
  // group LEDs
3144
  // in song page: track and group buttons are used to select the cursor position
3147
  // in song page: track and group buttons are used to select the cursor position
3145
  if( ui_page == SEQ_UI_PAGE_SONG ) {
3148
  if( ui_page == SEQ_UI_PAGE_SONG ) {
3146
    SEQ_LED_PinSet(seq_hwcfg_led.group[0], (ui_selected_item == 3));
3149
    SEQ_LED_PinSet(seq_hwcfg_led.group[0], (ui_selected_item == 3));
Line 3156... Line 3159...
3156
 
3159
 
3157
  // trigger layer LEDs
3160
  // trigger layer LEDs
3158
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[0], (ui_selected_trg_layer == 0));
3161
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[0], (ui_selected_trg_layer == 0));
3159
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[1], (ui_selected_trg_layer == 1));
3162
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[1], (ui_selected_trg_layer == 1));
3160
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[2], (ui_selected_trg_layer >= 2) || seq_ui_button_state.TRG_LAYER_SEL);
3163
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[2], (ui_selected_trg_layer >= 2) || seq_ui_button_state.TRG_LAYER_SEL);
3161
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer_sel, ui_page == SEQ_UI_PAGE_TRGSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_TRG);
3164
  SEQ_LED_PinSet(seq_hwcfg_led.trg_layer_sel, ui_page == SEQ_UI_PAGE_TRGSEL || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_TRG));
3162
3165
3163
  // instrument layer LEDs
3166
  // instrument layer LEDs
3164
  SEQ_LED_PinSet(seq_hwcfg_led.ins_sel, ui_page == SEQ_UI_PAGE_INSSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_INS);
3167
  SEQ_LED_PinSet(seq_hwcfg_led.ins_sel, ui_page == SEQ_UI_PAGE_INSSEL || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_INS));
3165
 
3168
 
3166
  // remaining LEDs
3169
  // remaining LEDs
3167
  SEQ_LED_PinSet(seq_hwcfg_led.edit, ui_page == SEQ_UI_PAGE_EDIT);
3170
  SEQ_LED_PinSet(seq_hwcfg_led.edit, ui_page == SEQ_UI_PAGE_EDIT);
3168
  SEQ_LED_PinSet(seq_hwcfg_led.mute, ui_page == SEQ_UI_PAGE_MUTE || seq_ui_sel_view == SEQ_UI_SEL_VIEW_MUTE);
3171
  SEQ_LED_PinSet(seq_hwcfg_led.mute, ui_page == SEQ_UI_PAGE_MUTE || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_MUTE));
3169
  SEQ_LED_PinSet(seq_hwcfg_led.pattern, ui_page == SEQ_UI_PAGE_PATTERN);
3172
  SEQ_LED_PinSet(seq_hwcfg_led.pattern, ui_page == SEQ_UI_PAGE_PATTERN);
3170
  if( SEQ_SONG_ActiveGet() )
3173
  if( SEQ_SONG_ActiveGet() )
3171
    SEQ_LED_PinSet(seq_hwcfg_led.song, 1);
3174
    SEQ_LED_PinSet(seq_hwcfg_led.song, 1);
3172
  else
3175
  else
3173
    SEQ_LED_PinSet(seq_hwcfg_led.song, ui_cursor_flash ? 0 : (ui_page == SEQ_UI_PAGE_SONG));
3176
    SEQ_LED_PinSet(seq_hwcfg_led.song, ui_cursor_flash ? 0 : (ui_page == SEQ_UI_PAGE_SONG));
3174
  SEQ_LED_PinSet(seq_hwcfg_led.phrase, seq_ui_button_state.PHRASE_PRESSED || seq_ui_sel_view == SEQ_UI_SEL_VIEW_PHRASE);
3177
  SEQ_LED_PinSet(seq_hwcfg_led.phrase, seq_ui_button_state.PHRASE_PRESSED || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_PHRASE));
3175
  SEQ_LED_PinSet(seq_hwcfg_led.mixer, ui_page == SEQ_UI_PAGE_MIXER);
3178
  SEQ_LED_PinSet(seq_hwcfg_led.mixer, ui_page == SEQ_UI_PAGE_MIXER);
3176
3179
3177
  SEQ_LED_PinSet(seq_hwcfg_led.track_mode, ui_page == SEQ_UI_PAGE_TRKMODE);
3180
  SEQ_LED_PinSet(seq_hwcfg_led.track_mode, ui_page == SEQ_UI_PAGE_TRKMODE);
3178
  SEQ_LED_PinSet(seq_hwcfg_led.track_groove, ui_page == SEQ_UI_PAGE_TRKGRV);
3181
  SEQ_LED_PinSet(seq_hwcfg_led.track_groove, ui_page == SEQ_UI_PAGE_TRKGRV);
3179
  SEQ_LED_PinSet(seq_hwcfg_led.track_length, ui_page == SEQ_UI_PAGE_TRKLEN);
3182
  SEQ_LED_PinSet(seq_hwcfg_led.track_length, ui_page == SEQ_UI_PAGE_TRKLEN);
Line 3197... Line 3200...
3197
  SEQ_LED_PinSet(seq_hwcfg_led.fwd, seq_ui_button_state.FWD);
3200
  SEQ_LED_PinSet(seq_hwcfg_led.fwd, seq_ui_button_state.FWD);
3198
3201
3199
  SEQ_LED_PinSet(seq_hwcfg_led.loop, seq_core_state.LOOP);
3202
  SEQ_LED_PinSet(seq_hwcfg_led.loop, seq_core_state.LOOP);
3200
  SEQ_LED_PinSet(seq_hwcfg_led.follow, seq_core_state.FOLLOW);
3203
  SEQ_LED_PinSet(seq_hwcfg_led.follow, seq_core_state.FOLLOW);
3201
 
3204
 
3202
  SEQ_LED_PinSet(seq_hwcfg_led.step_view, ui_page == SEQ_UI_PAGE_STEPSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_STEPS);
3205
  SEQ_LED_PinSet(seq_hwcfg_led.step_view, ui_page == SEQ_UI_PAGE_STEPSEL || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_STEPS));
3203
3206
3204
  SEQ_LED_PinSet(seq_hwcfg_led.select, seq_ui_button_state.SELECT_PRESSED);
3207
  SEQ_LED_PinSet(seq_hwcfg_led.select, seq_ui_button_state.SELECT_PRESSED);
3205
  SEQ_LED_PinSet(seq_hwcfg_led.menu, seq_ui_button_state.MENU_PRESSED);
3208
  SEQ_LED_PinSet(seq_hwcfg_led.menu, seq_ui_button_state.MENU_PRESSED);
3206
  SEQ_LED_PinSet(seq_hwcfg_led.bookmark, ui_page == SEQ_UI_PAGE_BOOKMARKS || seq_ui_sel_view == SEQ_UI_SEL_VIEW_BOOKMARKS);
3209
  SEQ_LED_PinSet(seq_hwcfg_led.bookmark, ui_page == SEQ_UI_PAGE_BOOKMARKS || (selbuttons_available && seq_ui_sel_view == SEQ_UI_SEL_VIEW_BOOKMARKS));
3207
3210
3208
  // handle double functions
3211
  // handle double functions
3209
  if( seq_ui_button_state.MENU_PRESSED ) {
3212
  if( seq_ui_button_state.MENU_PRESSED ) {
3210
    SEQ_LED_PinSet(seq_hwcfg_led.scrub, seq_core_state.LOOP);
3213
    SEQ_LED_PinSet(seq_hwcfg_led.scrub, seq_core_state.LOOP);
3211
    SEQ_LED_PinSet(seq_hwcfg_led.exit, seq_core_state.FOLLOW);
3214
    SEQ_LED_PinSet(seq_hwcfg_led.exit, seq_core_state.FOLLOW);