cmMidiFile.h/c _cmMidiFileClose() is now called by cmMidiFileOpen() on the incoming handle.
This commit is contained in:
parent
fdf1a7c15a
commit
d32c47be4c
@ -459,6 +459,10 @@ cmMfRC_t cmMidiFileOpen( const char* fn, cmMidiFileH_t* hPtr, cmCtx_t* ctx )
|
||||
unsigned short trkIdx = 0;
|
||||
cmErr_t err;
|
||||
|
||||
if( cmMidiFileIsValid(*hPtr) )
|
||||
if((rc = _cmMidiFileClose(_cmMidiFileHandleToPtr(*hPtr))) != kOkMfRC )
|
||||
return rc;
|
||||
|
||||
cmErrSetup(&err,&ctx->rpt,"MIDI File");
|
||||
|
||||
// allocate the midi file object
|
||||
@ -600,6 +604,9 @@ cmMfRC_t cmMidiFileClose( cmMidiFileH_t* h )
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool cmMidiFileIsValid( cmMidiFileH_t h )
|
||||
{ return !cmMidiFileIsNull(h); }
|
||||
|
||||
unsigned cmMidiFileTrackCount( cmMidiFileH_t h )
|
||||
{
|
||||
_cmMidiFile_t* mfp;
|
||||
|
@ -107,6 +107,8 @@ extern "C" {
|
||||
cmMfRC_t cmMidiFileOpen( const char* fn, cmMidiFileH_t* hPtr, cmCtx_t* ctx );
|
||||
cmMfRC_t cmMidiFileClose( cmMidiFileH_t* hp );
|
||||
|
||||
bool cmMidiFileIsValid( cmMidiFileH_t h );
|
||||
|
||||
// Returns track count or kInvalidCnt if 'h' is invalid.
|
||||
unsigned cmMidiFileTrackCount( cmMidiFileH_t h );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user