Subversion Repositories svn.mios32

Rev

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

Rev 1261 Rev 1264
Line 1... Line 1...
1
// $Id: midio_patch.c 1261 2011-07-17 18:21:45Z tk $
1
// $Id: midio_patch.c 1264 2011-07-19 21:59:04Z tk $
2
/*
2
/*
3
 * Patch Layer for MIDIO128 V3
3
 * Patch Layer for MIDIO128 V3
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 381... Line 381...
381
  midio_patch_cfg.flags.ALL = 0;
381
  midio_patch_cfg.flags.ALL = 0;
382
  midio_patch_cfg.flags.FORWARD_IO = 1;
382
  midio_patch_cfg.flags.FORWARD_IO = 1;
383
  midio_patch_cfg.flags.INVERSE_DIN = 1;
383
  midio_patch_cfg.flags.INVERSE_DIN = 1;
384
384
385
  // load first patch
385
  // load first patch
386
  MIDIO_PATCH_Load(0, 0); // bank, patch
386
  MIDIO_PATCH_Load("DEFAULT");
387
387
388
  return 0; // no error
388
  return 0; // no error
389
}
389
}
390
390
391
391
Line 504... Line 504...
504
  return -2; // value not mapped
504
  return -2; // value not mapped
505
}
505
}
506
506
507
507
508
/////////////////////////////////////////////////////////////////////////////
508
/////////////////////////////////////////////////////////////////////////////
509
// This function loads the patch structure from EEPROM/BankStick
509
// This function loads the patch from SD Card
510
// Returns != 0 if Load failed (e.g. BankStick not connected)
510
// Returns != 0 if Load failed
511
/////////////////////////////////////////////////////////////////////////////
511
/////////////////////////////////////////////////////////////////////////////
512
s32 MIDIO_PATCH_Load(u8 bank, u8 patch)
512
s32 MIDIO_PATCH_Load(char *filename)
513
{
513
{
514
  MUTEX_SDCARD_TAKE;
514
  MUTEX_SDCARD_TAKE;
515
  s32 status = MIDIO_FILE_P_Read();
515
  s32 status = MIDIO_FILE_P_Read(filename);
516
  MUTEX_SDCARD_GIVE;
516
  MUTEX_SDCARD_GIVE;
517
517
518
  return status;
518
  return status;
519
}
519
}
520
520
521
521
522
/////////////////////////////////////////////////////////////////////////////
522
/////////////////////////////////////////////////////////////////////////////
523
// This function stores the patch structure into EEPROM/BankStick
523
// This function stores the patch on SD Card
524
// Returns != 0 if Store failed (e.g. BankStick not connected)
524
// Returns != 0 if Store failed
525
/////////////////////////////////////////////////////////////////////////////
525
/////////////////////////////////////////////////////////////////////////////
526
s32 MIDIO_PATCH_Store(u8 bank, u8 patch)
526
s32 MIDIO_PATCH_Store(char *filename)
527
{
527
{
528
  MUTEX_SDCARD_TAKE;
528
  MUTEX_SDCARD_TAKE;
529
  s32 status = MIDIO_FILE_P_Write();
529
  s32 status = MIDIO_FILE_P_Write(filename);
530
  MUTEX_SDCARD_GIVE;
530
  MUTEX_SDCARD_GIVE;
531
531
532
  return status;
532
  return status;
533
}
533
}