Subversion Repositories svn.mios32

Rev

Rev 2617 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2617 Rev 2635
Line 1... Line 1...
1
// $Id: seq_terminal.c 2617 2018-12-20 00:02:42Z tk $
1
// $Id: seq_terminal.c 2635 2019-01-06 17:14:01Z tk $
2
/*
2
/*
3
 * MIDIbox SEQ MIDI Terminal
3
 * MIDIbox SEQ MIDI Terminal
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 54... Line 54...
54
#include "seq_file_g.h"
54
#include "seq_file_g.h"
55
#include "seq_file_c.h"
55
#include "seq_file_c.h"
56
#include "seq_file_t.h"
56
#include "seq_file_t.h"
57
#include "seq_file_gc.h"
57
#include "seq_file_gc.h"
58
#include "seq_file_bm.h"
58
#include "seq_file_bm.h"
-
 
59
#include "seq_file_presets.h"
59
#include "seq_file_hw.h"
60
#include "seq_file_hw.h"
60
61
61
#include "seq_ui.h"
62
#include "seq_ui.h"
62
63
63
#include "seq_statistics.h"
64
#include "seq_statistics.h"
Line 88... Line 89...
88
  UPLOADING_FILE_HW,
89
  UPLOADING_FILE_HW,
89
  UPLOADING_FILE_C,
90
  UPLOADING_FILE_C,
90
  UPLOADING_FILE_GC,
91
  UPLOADING_FILE_GC,
91
  UPLOADING_FILE_G,
92
  UPLOADING_FILE_G,
92
  UPLOADING_FILE_BM,
93
  UPLOADING_FILE_BM,
-
 
94
  UPLOADING_FILE_PRESETS,
93
} uploading_file_t;
95
} uploading_file_t;
94
96
95
static uploading_file_t uploading_file;
97
static uploading_file_t uploading_file;
96
98
97
/////////////////////////////////////////////////////////////////////////////
99
/////////////////////////////////////////////////////////////////////////////
Line 218... Line 220...
218
//! For the auto-load function
220
//! For the auto-load function
219
/////////////////////////////////////////////////////////////////////////////
221
/////////////////////////////////////////////////////////////////////////////
220
static s32 TERMINAL_BrowserUploadCallback(char *filename)
222
static s32 TERMINAL_BrowserUploadCallback(char *filename)
221
{
223
{
222
  if( filename ) {
224
  if( filename ) {
-
 
225
    size_t len = strlen(filename);
-
 
226
223
    // check for MBSEQ_HW.V4
227
    // check for various filenames
224
    uploading_file = UPLOADING_FILE_NONE;
228
    uploading_file = UPLOADING_FILE_NONE;
225
    if( strcasecmp(filename, "/mbseq_hw.v4") == 0 )
229
    if( strcasecmp(filename, "/mbseq_hw.v4") == 0 )
226
      uploading_file = UPLOADING_FILE_HW;
230
      uploading_file = UPLOADING_FILE_HW;
227
    if( strcasecmp(filename, "/mbseq_hw.v4l") == 0 )
231
    if( strcasecmp(filename, "/mbseq_hw.v4l") == 0 )
228
      uploading_file = UPLOADING_FILE_HW;
232
      uploading_file = UPLOADING_FILE_HW;
Line 232... Line 236...
232
      uploading_file = UPLOADING_FILE_GC;
236
      uploading_file = UPLOADING_FILE_GC;
233
    else if( strcasestr(filename, "/mbseq_g.v4") != NULL )
237
    else if( strcasestr(filename, "/mbseq_g.v4") != NULL )
234
      uploading_file = UPLOADING_FILE_G;
238
      uploading_file = UPLOADING_FILE_G;
235
    else if( strcasestr(filename, "/mbseq_bm.v4") != NULL )
239
    else if( strcasestr(filename, "/mbseq_bm.v4") != NULL )
236
      uploading_file = UPLOADING_FILE_BM;
240
      uploading_file = UPLOADING_FILE_BM;
-
 
241
    else if( strcasestr(filename, "/presets/") != 0 &&
-
 
242
         filename[len-4] == '.' &&
-
 
243
         (filename[len-3] == 'v' || filename[len-3] == 'V') &&
-
 
244
         (filename[len-2] == '4') &&
-
 
245
         (filename[len-1] == 'p' || filename[len-1] == 'P')
-
 
246
         )
-
 
247
      uploading_file = UPLOADING_FILE_PRESETS;
237
  } else {
248
  } else {
238
    switch( uploading_file ) {
249
    switch( uploading_file ) {
239
250
240
    case UPLOADING_FILE_HW: {
251
    case UPLOADING_FILE_HW: {
241
      DEBUG_MSG("AUTOLOAD '/MBSEQ_HW.V4'\n");
252
      DEBUG_MSG("AUTOLOAD '/MBSEQ_HW.V4'\n");
Line 263... Line 274...
263
      DEBUG_MSG("AUTOLOAD 'MBSEQ_BM.V4'\n");
274
      DEBUG_MSG("AUTOLOAD 'MBSEQ_BM.V4'\n");
264
      SEQ_FILE_BM_Load(seq_file_session_name, 1); // global
275
      SEQ_FILE_BM_Load(seq_file_session_name, 1); // global
265
      SEQ_FILE_BM_Load(seq_file_session_name, 0); // session
276
      SEQ_FILE_BM_Load(seq_file_session_name, 0); // session
266
    } break;
277
    } break;
267
278
-
 
279
    case UPLOADING_FILE_PRESETS: {
-
 
280
      DEBUG_MSG("AUTOLOAD 'PRESETS/*.V4P'\n");
-
 
281
      SEQ_FILE_PRESETS_Load();
-
 
282
    } break;
268
283
269
    }
284
    }
270
  }
285
  }
271
286
272
  return 0; // no error
287
  return 0; // no error
Line 395... Line 410...
395
      SEQ_TERMINAL_PrintGrooveTemplates(out);
410
      SEQ_TERMINAL_PrintGrooveTemplates(out);
396
    } else if( strcmp(parameter, "msd") == 0 ) {
411
    } else if( strcmp(parameter, "msd") == 0 ) {
397
      out("Mass Storage Device Mode not supported by this application!");
412
      out("Mass Storage Device Mode not supported by this application!");
398
    } else if( strcmp(parameter, "tpd") == 0 ) {
413
    } else if( strcmp(parameter, "tpd") == 0 ) {
399
      SEQ_TPD_PrintString(brkt); // easter egg ;-)
414
      SEQ_TPD_PrintString(brkt); // easter egg ;-)
-
 
415
#ifndef MBSEQV4L
400
    } else if( strcmp(parameter, "lcd") == 0 ) {
416
    } else if( strcmp(parameter, "lcd") == 0 ) {
401
      SEQ_LCD_LOGO_ScreenSaver_Disable(); // ensure that screen saver disabled
417
      SEQ_LCD_LOGO_ScreenSaver_Disable(); // ensure that screen saver disabled
402
      SEQ_UI_Msg(SEQ_UI_MSG_USER, 2000, "From MIOS Terminal:", brkt); // could be useful?
418
      SEQ_UI_Msg(SEQ_UI_MSG_USER, 2000, "From MIOS Terminal:", brkt); // could be useful?
-
 
419
#endif
403
    } else if( strcmp(parameter, "set") == 0 ) {
420
    } else if( strcmp(parameter, "set") == 0 ) {
404
      if( (parameter = strtok_r(NULL, separators, &brkt)) ) {
421
      if( (parameter = strtok_r(NULL, separators, &brkt)) ) {
405
    if( strcmp(parameter, "router") == 0 ) {
422
    if( strcmp(parameter, "router") == 0 ) {
406
      char *arg;
423
      char *arg;
407
      if( !(arg = strtok_r(NULL, separators, &brkt)) ) {
424
      if( !(arg = strtok_r(NULL, separators, &brkt)) ) {
Line 885... Line 902...
885
  out("  song:           print current song info");
902
  out("  song:           print current song info");
886
  out("  grooves:        print groove templates");
903
  out("  grooves:        print groove templates");
887
  out("  bookmarks:      print bookmarks");
904
  out("  bookmarks:      print bookmarks");
888
  out("  router:         print MIDI router info");
905
  out("  router:         print MIDI router info");
889
  out("  tpd <string>:   print a scrolled text on the TPD");
906
  out("  tpd <string>:   print a scrolled text on the TPD");
-
 
907
#ifndef MBSEQV4L
890
  out("  lcd <string>:   print a message on LCD");
908
  out("  lcd <string>:   print a message on LCD");
-
 
909
#endif
891
  out("  set router <node> <in-port> <off|channel|all> <out-port> <off|channel|all>: change router setting");
910
  out("  set router <node> <in-port> <off|channel|all> <out-port> <off|channel|all>: change router setting");
892
  out("  set mclk_in  <in-port>  <on|off>: change MIDI IN Clock setting");
911
  out("  set mclk_in  <in-port>  <on|off>: change MIDI IN Clock setting");
893
  out("  set mclk_out <out-port> <on|off>: change MIDI OUT Clock setting");
912
  out("  set mclk_out <out-port> <on|off>: change MIDI OUT Clock setting");
894
  out("  set din_testmode <on|off>: change DIN (button/encoder) testmode (current: %s)", app_din_testmode ? "on" : "off");
913
  out("  set din_testmode <on|off>: change DIN (button/encoder) testmode (current: %s)", app_din_testmode ? "on" : "off");
895
  out("  set blm_port <off|in-port>: change BLM input port (same port is used for output)");
914
  out("  set blm_port <off|in-port>: change BLM input port (same port is used for output)");