MciOpenParms.lpstrDeviceType = "sequencer" //NULL MCI will attempt to choose the MIDI Mapper as the output port. Open the device by specifying the device name and device element. BuildPath() just adds the appropriate folder info for the file StopMusic() // stop any previously playing music MciSendCommand(MCIwDeviceID, MCI_CLOSE, MCI_WAIT, 0) MciSendCommand(MCIwDeviceID, MCI_STOP, MCI_WAIT, 0) Then, the main window handler handles the MM_MCINOTIFY message, and when MCI_NOTIFY_SUCCESSFUL is received, it queues a notification to my main code that the music finished, and that main code will then eventually make another call (if it wants to) to PlayMusic() to start a file playing again. I have two functions: PlayMusic(char *fname) and StopMusic() that start and stop a MIDI file playing, along with a global variable MusicPlaying that keeps track of whether a music file is currently playing or not. Yet if the program is exited and started up again, then the background MIDI can be made to play again. Returns a value of 343 (MCIERR_SEQ_NOMIDIPRESENT). ![]() I don't have a Windows 10 installation myself yet, but I've put together a couple of debug programs, and the second time the program tries to start a MIDI file playing, this call in PlayMusic(): mciSendCommand(MCIwDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)(LPVOID) &mciPlayParms) Now I've heard from several folks that have upgraded to Windows 10 that the background music will play the FIRST time (after starting the program), but once it finishes, it fails to start up again (or start the next MIDI file playing). Why does MIDI sequencer fail to play second time on Windows 10įor years I've been using the high-level MIDI interface in Windows to play MIDI files as background music in my games.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |