Subversion Repositories svn.mios32

Rev

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

Rev 1420 Rev 1794
Line 1... Line 1...
1
// $Id: seq_ui_pattern.c 1420 2012-02-08 20:08:35Z tk $
1
// $Id: seq_ui_pattern.c 1794 2013-05-31 19:25:43Z tk $
2
/*
2
/*
3
 * Pattern page
3
 * Pattern page
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 22... Line 22...
22
22
23
#include "seq_file.h"
23
#include "seq_file.h"
24
#include "seq_file_b.h"
24
#include "seq_file_b.h"
25
#include "seq_bpm.h"
25
#include "seq_bpm.h"
26
#include "seq_core.h"
26
#include "seq_core.h"
-
 
27
#include "seq_midi_in.h"
27
28
28
29
29
/////////////////////////////////////////////////////////////////////////////
30
/////////////////////////////////////////////////////////////////////////////
30
// Local definitions
31
// Local definitions
31
/////////////////////////////////////////////////////////////////////////////
32
/////////////////////////////////////////////////////////////////////////////
Line 144... Line 145...
144
  int group;
145
  int group;
145
  for(group=0; group<SEQ_CORE_NUM_GROUPS; ++group) {
146
  for(group=0; group<SEQ_CORE_NUM_GROUPS; ++group) {
146
    if( seq_ui_button_state.CHANGE_ALL_STEPS || group == ui_selected_group ) {
147
    if( seq_ui_button_state.CHANGE_ALL_STEPS || group == ui_selected_group ) {
147
      if( encoder & 1 ) {
148
      if( encoder & 1 ) {
148
    selected_pattern[group].pattern = pattern->pattern;
149
    selected_pattern[group].pattern = pattern->pattern;
-
 
150
149
      } else {
151
      } else {
150
    // in order to avoid accidents the bank won't be changed
152
    // in order to avoid accidents the bank won't be changed
151
    // because normally each group has it's dedicated bank
153
    // because normally each group has it's dedicated bank
152
#if 0
154
#if 0
153
    selected_pattern[group].bank = pattern->bank;
155
    selected_pattern[group].bank = pattern->bank;
Line 157... Line 159...
157
      SEQ_PATTERN_Change(group, selected_pattern[group], 0);
159
      SEQ_PATTERN_Change(group, selected_pattern[group], 0);
158
    }
160
    }
159
  }
161
  }
160
  if( is_critical )
162
  if( is_critical )
161
    portEXIT_CRITICAL();
163
    portEXIT_CRITICAL();
-
 
164
-
 
165
  // send to external
-
 
166
  {
-
 
167
    int group;
-
 
168
    for(group=0; group<SEQ_CORE_NUM_GROUPS; ++group) {
-
 
169
      if( seq_ui_button_state.CHANGE_ALL_STEPS || group == ui_selected_group ) {
-
 
170
    SEQ_MIDI_IN_ExtCtrlSend(SEQ_MIDI_IN_EXT_CTRL_PATTERN_G1 + group, selected_pattern[group].pattern);
-
 
171
    SEQ_MIDI_IN_ExtCtrlSend(SEQ_MIDI_IN_EXT_CTRL_BANK_G1 + group, selected_pattern[group].bank);
-
 
172
      }
-
 
173
    }
-
 
174
  }
-
 
175
162
176
163
  return 1; // value as been changed
177
  return 1; // value as been changed
164
}
178
}
165
179
166
180
Line 206... Line 220...
206
  if( button >= SEQ_UI_BUTTON_GP9 && button <= SEQ_UI_BUTTON_GP16 ) {
220
  if( button >= SEQ_UI_BUTTON_GP9 && button <= SEQ_UI_BUTTON_GP16 ) {
207
    int group;
221
    int group;
208
    for(group=0; group<SEQ_CORE_NUM_GROUPS; ++group) {
222
    for(group=0; group<SEQ_CORE_NUM_GROUPS; ++group) {
209
      if( seq_ui_button_state.CHANGE_ALL_STEPS || group == ui_selected_group ) {
223
      if( seq_ui_button_state.CHANGE_ALL_STEPS || group == ui_selected_group ) {
210
    selected_pattern[group].num = button-8;
224
    selected_pattern[group].num = button-8;
-
 
225
-
 
226
    // send to external
-
 
227
    SEQ_MIDI_IN_ExtCtrlSend(SEQ_MIDI_IN_EXT_CTRL_PATTERN_G1 + group, selected_pattern[group].pattern);
-
 
228
    SEQ_MIDI_IN_ExtCtrlSend(SEQ_MIDI_IN_EXT_CTRL_BANK_G1 + group, selected_pattern[group].bank);
-
 
229
211
    SEQ_PATTERN_Change(group, selected_pattern[group], 0);
230
    SEQ_PATTERN_Change(group, selected_pattern[group], 0);
212
      }
231
      }
213
    }
232
    }
214
233
215
    return 1; // value always changed
234
    return 1; // value always changed