Example #1
0
// unlock all tracks from memory
void CDiskImage::UnlockTrack(int forced)
{
	// cancel, if no track data
	if (!dti)
		return;

	// free all buffers
	for (int trk=0; trk < dticnt; trk++)
		FreeTrack(dti+trk, forced);
}
Example #2
0
// get track information and unlock track from memory
PDISKTRACKINFO CDiskImage::UnlockTrack(int cylinder, int head, int forced)
{
	// locate track information
	PDISKTRACKINFO pti=GetTrack(cylinder, head);

	// free buffers
	FreeTrack(pti, forced);

	return pti;
}
Example #3
0
void MIDI_FreeFile(midi_file_t *file)
{
    if (file->tracks)
    {
        unsigned int    i;

        for (i = 0; i < file->num_tracks; ++i)
            FreeTrack(&file->tracks[i]);

        free(file->tracks);
    }

    free(file);
}
Example #4
0
// load image file and test for erros
int CDiskImage::LoadImage(UDWORD flag, int free)
{
	int res=imgeOk;

	// cancel, if no track data
	if (!dti)
		return res;

	// try to load all tracks
	for (int trk=0; trk < dticnt; trk++) {
		PDISKTRACKINFO pt=dti+trk;

		// test only untested tracks
		switch (pt->type) {
			case dtitUndefined:
			case dtitError:
				continue;
		}

		// load and decode
		int read=AllocTrack(pt, flag);

		// free track only if requested
		if (free)
			FreeTrack(pt);

		// test load result
		switch (read) {
			// stop if image can't be read
			case imgeUnsupported:
			case imgeIncompatible:
				trk=dticnt;
				res=read;
				continue;

			// no errors
			case imgeOk:
				break;

			// set error
			default:
				res=imgeGeneric;
				break;
		}
	}

	return res;
}
Example #5
0
void MIDI_FreeFile(midi_file_t *file)
{
    int i;

    if (file->tracks != NULL)
    {
        for (i=0; i<file->num_tracks; ++i)
        {
            FreeTrack(&file->tracks[i]);
        }

        free(file->tracks);
    }

    free(file);
}
Example #6
0
// unlock track from memory
void CDiskImage::UnlockTrack(PDISKTRACKINFO pti, int forced)
{
	// free buffers
	FreeTrack(pti, forced);
}