0
0

Hello, I am writing kind of a wierd app that needs to write a short MIDI file, play it, and then be able to change the file, reload it, and play it again. I have tried to do this using the API calls as follows:

FMUSIC_MODULE *mod;
// create the MIDI file and save it to disk
mod = FMUSIC_LoadSong(“filename.mid”);
// start playing it, then create another midi file and save it,
// overwriting the original disk file
FMUSIC_StopSong(mod);
FMUSIC_FreeSong(mod);
mod = FMUSIC_LoadSong(“filename.mid”);
// start playing again

Unfortunately, the first version file is played again, even though the “new” version of the file on the disk is completely different. Does the MIDI file loader cache the files it loads somewhere, and not look at the disk again? This would make sense for nearly all apps, but is there a workaround that I could use to force it to load from the disk again? Or is the file being cached by Windows somehow? (i’m using WinXP Home, if that makes a difference, and making an MFC app with MS VC++ 6.0) I hope I described the problem in enough detail. Thanks!

  • You must to post comments
0
0

You might want to verify that you are ‘flushing’ the data to disk when you save the new file. Although, I believe closing the file handle invokes an implicit ‘flush’.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.