diff --git a/app/cmScore.c b/app/cmScore.c index f5186e6..ab2b8ca 100644 --- a/app/cmScore.c +++ b/app/cmScore.c @@ -2424,7 +2424,7 @@ cmScRC_t cmScoreFileFromMidi( cmCtx_t* ctx, const cmChar_t* midiFn, const c cmErrSetup(&err,&ctx->rpt,"MIDI to Score"); - if( cmMidiFileOpen(midiFn, &mfH, ctx ) != kOkMfRC ) + if( cmMidiFileOpen(ctx, &mfH, midiFn ) != kOkMfRC ) return cmErrMsg(&err,kMidiFileFailScRC,"Unable to open the MIDI file '%s'.",midiFn); if( cmCsvInitialize(&csvH,ctx) != kOkCsvRC ) @@ -2658,7 +2658,7 @@ void cmScoreFix( cmCtx_t* ctx ) if( cmCsvParseFile(csvH, crfn, 0 ) != kOkCsvRC ) goto errLabel; - if( cmMidiFileOpen(mfn,&mfH,ctx) != kOkMfRC ) + if( cmMidiFileOpen(ctx,&mfH,mfn) != kOkMfRC ) goto errLabel; mn = cmMidiFileMsgCount(mfH); diff --git a/app/cmTakeSeqBldr.c b/app/cmTakeSeqBldr.c index 6d1a9a6..1b000d3 100644 --- a/app/cmTakeSeqBldr.c +++ b/app/cmTakeSeqBldr.c @@ -949,7 +949,7 @@ cmTsbRC_t cmTakeSeqBldrLoadTake( cmTakeSeqBldrH_t h, unsigned tlMarkUid, bool ov } // open the MIDI file - if( cmMidiFileOpen( cmMidiFileName(mf->h), &mfH, &p->ctx ) != kOkMfRC ) + if( cmMidiFileOpen( &p->ctx, &mfH, cmMidiFileName(mf->h) ) != kOkMfRC ) { rc = cmErrMsg(&p->err,kInvalidArgTsbRC,"The MIDI file '%s' could not be opened.", cmStringNullGuard(cmMidiFileName(mf->h))); goto errLabel; diff --git a/app/cmTimeLine.c b/app/cmTimeLine.c index b40cbef..bc381d0 100644 --- a/app/cmTimeLine.c +++ b/app/cmTimeLine.c @@ -720,7 +720,7 @@ cmTlRC_t _cmTlAllocMidiFileRecd( _cmTl_t* p, const cmChar_t* nameStr, const cmCh fn = cmFsMakeFn( p->prefixPath, fn, NULL, NULL ); // open the midi file - if( cmMidiFileOpen(fn, &mfH, &p->ctx ) != kOkMfRC ) + if( cmMidiFileOpen(&p->ctx, &mfH, fn ) != kOkMfRC ) return cmErrMsg(&p->err,kMidiFileFailTlRC,"The time line midi file '%s' could not be opened.",cmStringNullGuard(fn)); // force the first msg to occurr one quarter note into the file diff --git a/cmMidiFile.c b/cmMidiFile.c index 2476aa1..65fabef 100644 --- a/cmMidiFile.c +++ b/cmMidiFile.c @@ -445,7 +445,7 @@ cmMfRC_t _cmMidiFileClose( _cmMidiFile_t* mfp ) } -cmMfRC_t cmMidiFileOpen( const char* fn, cmMidiFileH_t* hPtr, cmCtx_t* ctx ) +cmMfRC_t cmMidiFileOpen( cmCtx_t* ctx, cmMidiFileH_t* hPtr, const char* fn ) { cmMfRC_t rc = kOkMfRC; _cmMidiFile_t* mfp = NULL; @@ -1445,7 +1445,7 @@ void cmMidiFilePrintControlNumbers( cmCtx_t* ctx, const char* fn ) cmMidiFileH_t h = cmMidiFileNullHandle; cmMfRC_t rc; - if((rc = cmMidiFileOpen(fn, &h, ctx )) != kOkMfRC ) + if((rc = cmMidiFileOpen(ctx, &h, fn )) != kOkMfRC ) { cmErrMsg(&ctx->err,rc,"MIDI file open failed on '%s'.",fn); goto errLabel; @@ -1475,7 +1475,7 @@ void cmMidiFileTest( const char* fn, cmCtx_t* ctx ) cmMfRC_t rc; cmMidiFileH_t h = cmMidiFileNullHandle; - if((rc = cmMidiFileOpen(fn,&h,ctx)) != kOkMfRC ) + if((rc = cmMidiFileOpen(ctx,&h,fn)) != kOkMfRC ) { printf("Error:%i Unable to open the cmMidi file: %s\n",rc,fn); return; diff --git a/cmMidiFile.h b/cmMidiFile.h index 7dfcd93..286efc9 100644 --- a/cmMidiFile.h +++ b/cmMidiFile.h @@ -106,7 +106,7 @@ extern "C" { extern cmMidiFileH_t cmMidiFileNullHandle; - cmMfRC_t cmMidiFileOpen( const char* fn, cmMidiFileH_t* hPtr, cmCtx_t* ctx ); + cmMfRC_t cmMidiFileOpen( cmCtx_t* ctx, cmMidiFileH_t* hPtr, const char* fn ); cmMfRC_t cmMidiFileClose( cmMidiFileH_t* hp ); cmMfRC_t cmMidiFileWrite( cmMidiFileH_t h, const char* fn ); diff --git a/cmMidiFilePlay.c b/cmMidiFilePlay.c index 56b1ea4..7a2d2f1 100644 --- a/cmMidiFilePlay.c +++ b/cmMidiFilePlay.c @@ -107,7 +107,7 @@ cmMfpRC_t cmMfpLoadFile( cmMfpH_t h, const char* fn ) cmMfp_t* p = _cmMfpHandleToPtr(h); cmMidiFileH_t mfH = cmMidiFileNullHandle; - if((rc = cmMidiFileOpen( fn, &mfH, &p->ctx )) != kOkMfRC ) + if((rc = cmMidiFileOpen( &p->ctx, &mfH, fn )) != kOkMfRC ) return _cmMfpError(p,kFileOpenFailMfpRC); if((rc= cmMfpLoadHandle( h, mfH )) == kOkMfpRC ) diff --git a/dsp/cmDspKr.c b/dsp/cmDspKr.c index e47e8cb..a63b31a 100644 --- a/dsp/cmDspKr.c +++ b/dsp/cmDspKr.c @@ -773,7 +773,7 @@ cmDspRC_t _cmDspMidiFilePlayOpen(cmDspCtx_t* ctx, cmDspInst_t* inst ) if( fn==NULL || strlen(fn)==0 ) return rc; - if( cmMidiFileOpen( fn, &p->mfH, ctx->cmCtx ) != kOkFileRC ) + if( cmMidiFileOpen( ctx->cmCtx, &p->mfH, fn ) != kOkFileRC ) rc = cmErrMsg(&inst->classPtr->err, kInstResetFailDspRC, "MIDI file open failed."); else {