Subversion Repositories svn.mios32

Rev

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

Rev 1492 Rev 1653
Line 1... Line 1...
1
// $Id: app.cpp 1492 2012-07-29 20:41:49Z tk $
1
// $Id: app.cpp 1653 2013-01-09 23:08:59Z tk $
2
/*
2
/*
3
 * MIDIbox CV V2
3
 * MIDIbox CV V2
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 372... Line 372...
372
    MBCV_FILE_StatusMsgSet("No SD Card");
372
    MBCV_FILE_StatusMsgSet("No SD Card");
373
      } else if( !FILE_VolumeAvailable() ) {
373
      } else if( !FILE_VolumeAvailable() ) {
374
    DEBUG_MSG("ERROR: SD Card contains invalid FAT!\n");
374
    DEBUG_MSG("ERROR: SD Card contains invalid FAT!\n");
375
    MBCV_FILE_StatusMsgSet("No FAT");
375
    MBCV_FILE_StatusMsgSet("No FAT");
376
      } else {
376
      } else {
377
    // check if patch file exists
-
 
378
    if( !MBCV_FILE_P_Valid() ) {
-
 
379
      // create new one
-
 
380
      DEBUG_MSG("Creating initial DEFAULT.CV2 file\n");
-
 
381
     
-
 
382
      if( (status=MBCV_FILE_P_Write("DEFAULT")) < 0 ) {
-
 
383
        DEBUG_MSG("Failed to create file! (status: %d)\n", status);
-
 
384
      }
-
 
385
    }
-
 
386
-
 
387
    // check if bank files exist
377
    // create the default files if they don't exist on SD Card
388
    for(int bank=0; bank<MBCV_FILE_B_NUM_BANKS; ++bank) {
-
 
389
      if( !MBCV_FILE_B_NumPatches(bank) ) {
-
 
390
        // create new one
-
 
391
        DEBUG_MSG("Creating MBCV_B%d.V2 file\n", bank+1);
-
 
392
     
-
 
393
        if( (status=MBCV_FILE_B_Create(bank)) < 0 ) {
-
 
394
          DEBUG_MSG("Failed to create file! (status: %d)\n", status);
-
 
395
        } else {
-
 
396
          for(int patch=0; patch<MBCV_FILE_B_NumPatches(bank); ++patch) {
-
 
397
        DEBUG_MSG("Creating MBCV_B%d.V2 patch %c%03d\n", bank+1, 'A'+bank, patch);
-
 
398
        if( (status=MBCV_FILE_B_PatchWrite(bank, patch, 0)) < 0 ) {
-
 
399
          DEBUG_MSG("Failed to create patch! (status: %d)\n", status);
-
 
400
        }
-
 
401
          }
-
 
402
        }
-
 
403
      }
-
 
404
    }
-
 
405
-
 
406
    MBCV_FILE_B_LoadAllBanks();
378
    MBCV_FILE_CreateDefaultFiles();
407
379
408
    // disable status message and print patch
380
    // disable status message and print patch
409
    MBCV_FILE_StatusMsgSet(NULL);
381
    MBCV_FILE_StatusMsgSet(NULL);
410
      }
382
      }
411
    }
383
    }