Subversion Repositories svn.mios32

Rev

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

Rev 2308 Rev 2322
Line 1... Line 1...
1
// $Id: seq_ui.c 2308 2016-02-14 19:30:07Z tk $
1
// $Id: seq_ui.c 2322 2016-03-15 19:08:38Z tk $
2
/*
2
/*
3
 * User Interface Routines
3
 * User Interface Routines
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 804... Line 804...
804
}
804
}
805
805
806
static s32 SEQ_UI_Button_Record(s32 depressed)
806
static s32 SEQ_UI_Button_Record(s32 depressed)
807
{
807
{
808
  if( depressed ) return -1; // ignore when button depressed
808
  if( depressed ) return -1; // ignore when button depressed
-
 
809
-
 
810
  // enable/disable recording
-
 
811
  SEQ_RECORD_Enable(seq_record_state.ENABLED ? 0 : 1, 1);
-
 
812
-
 
813
  return 0; // no error
-
 
814
}
-
 
815
-
 
816
static s32 SEQ_UI_Button_JamLive(s32 depressed)
-
 
817
{
-
 
818
  if( depressed ) return -1; // ignore when button depressed
-
 
819
-
 
820
  // enable live recording
-
 
821
  seq_record_options.STEP_RECORD = 0;
-
 
822
-
 
823
  // change to record page
-
 
824
  SEQ_UI_PageSet(SEQ_UI_PAGE_TRKJAM);
-
 
825
-
 
826
  return 0; // no error
-
 
827
}
-
 
828
-
 
829
static s32 SEQ_UI_Button_JamStep(s32 depressed)
-
 
830
{
-
 
831
  if( depressed ) return -1; // ignore when button depressed
-
 
832
-
 
833
  // enable step recording
-
 
834
  seq_record_options.STEP_RECORD = 1;
809
835
810
  // change to record page
836
  // change to record page
811
  SEQ_UI_PageSet(SEQ_UI_PAGE_TRKJAM);
837
  SEQ_UI_PageSet(SEQ_UI_PAGE_TRKJAM);
812
838
813
  return 0; // no error
839
  return 0; // no error
Line 815... Line 841...
815
841
816
static s32 SEQ_UI_Button_Live(s32 depressed)
842
static s32 SEQ_UI_Button_Live(s32 depressed)
817
{
843
{
818
  if( depressed ) return -1; // ignore when button depressed
844
  if( depressed ) return -1; // ignore when button depressed
819
845
820
  // change to live page
846
  // switch live mode
821
  SEQ_UI_PageSet(SEQ_UI_PAGE_TRKLIVE);
847
  seq_record_options.FWD_MIDI = seq_record_options.FWD_MIDI ? 0 : 1;
822
848
823
  return 0; // no error
849
  return 0; // no error
824
}
850
}
825
851
826
static s32 SEQ_UI_Button_Utility(s32 depressed)
852
static s32 SEQ_UI_Button_Utility(s32 depressed)
Line 2129... Line 2155...
2129
  if( pin == seq_hwcfg_button.metronome )
2155
  if( pin == seq_hwcfg_button.metronome )
2130
    return SEQ_UI_Button_Metronome(pin_value);
2156
    return SEQ_UI_Button_Metronome(pin_value);
2131
2157
2132
  if( pin == seq_hwcfg_button.record )
2158
  if( pin == seq_hwcfg_button.record )
2133
    return SEQ_UI_Button_Record(pin_value);
2159
    return SEQ_UI_Button_Record(pin_value);
-
 
2160
  if( pin == seq_hwcfg_button.jam_live )
-
 
2161
    return SEQ_UI_Button_JamLive(pin_value);
-
 
2162
  if( pin == seq_hwcfg_button.jam_step )
-
 
2163
    return SEQ_UI_Button_JamStep(pin_value);
2134
  if( pin == seq_hwcfg_button.live )
2164
  if( pin == seq_hwcfg_button.live )
2135
    return SEQ_UI_Button_Live(pin_value);
2165
    return SEQ_UI_Button_Live(pin_value);
2136
2166
2137
  if( pin == seq_hwcfg_button.stop )
2167
  if( pin == seq_hwcfg_button.stop )
2138
    return SEQ_UI_Button_Stop(pin_value);
2168
    return SEQ_UI_Button_Stop(pin_value);
Line 2921... Line 2951...
2921
    SEQ_LED_PinSet(seq_hwcfg_led.exit, ui_page == SEQ_UI_PAGE_MENU);
2951
    SEQ_LED_PinSet(seq_hwcfg_led.exit, ui_page == SEQ_UI_PAGE_MENU);
2922
    SEQ_LED_PinSet(seq_hwcfg_led.metronome, seq_core_state.METRONOME);
2952
    SEQ_LED_PinSet(seq_hwcfg_led.metronome, seq_core_state.METRONOME);
2923
  }
2953
  }
2924
2954
2925
  SEQ_LED_PinSet(seq_hwcfg_led.record, seq_record_state.ENABLED);
2955
  SEQ_LED_PinSet(seq_hwcfg_led.record, seq_record_state.ENABLED);
2926
  SEQ_LED_PinSet(seq_hwcfg_led.live, ui_page == SEQ_UI_PAGE_TRKLIVE);
2956
  SEQ_LED_PinSet(seq_hwcfg_led.live, seq_record_options.FWD_MIDI);
-
 
2957
  SEQ_LED_PinSet(seq_hwcfg_led.jam_live, ui_page == SEQ_UI_PAGE_TRKJAM && !seq_record_options.STEP_RECORD);
-
 
2958
  SEQ_LED_PinSet(seq_hwcfg_led.jam_step, ui_page == SEQ_UI_PAGE_TRKJAM && seq_record_options.STEP_RECORD);
2927
2959
2928
  SEQ_LED_PinSet(seq_hwcfg_led.utility, ui_page == SEQ_UI_PAGE_UTIL);
2960
  SEQ_LED_PinSet(seq_hwcfg_led.utility, ui_page == SEQ_UI_PAGE_UTIL);
2929
  SEQ_LED_PinSet(seq_hwcfg_led.copy, seq_ui_button_state.COPY);
2961
  SEQ_LED_PinSet(seq_hwcfg_led.copy, seq_ui_button_state.COPY);
2930
  SEQ_LED_PinSet(seq_hwcfg_led.paste, seq_ui_button_state.PASTE);
2962
  SEQ_LED_PinSet(seq_hwcfg_led.paste, seq_ui_button_state.PASTE);
2931
  SEQ_LED_PinSet(seq_hwcfg_led.undo, seq_ui_button_state.UNDO);
2963
  SEQ_LED_PinSet(seq_hwcfg_led.undo, seq_ui_button_state.UNDO);