danli020797
asked on
Use mmio to handle multiple files played by MCI?
Hi,
I try to play video from a CDrom using MCI commands, Under VC++4.2 and Win95. I know the MCI driver I have uses mmio functions to read data. My question is, since there are more than one video file in a disk(like a Video CD), how I can play video seamlessly? I know I need to define my own mmio procedure(mmioProc), but does one mmioProc only refers to one opened mmio file? Because the handle is in the MMIOINFO. In order to handle multiple file, which is the right approch?
a. detecting the end of file, close mmio then open the next file. I think it's too slow.
b. open all video files, each has its own handle, while changing file, assign the new handle to MMIOINFO, then call mmioProc.
c. other method. Please do tell me more.
I am a newbie in this area, please help.
I try to play video from a CDrom using MCI commands, Under VC++4.2 and Win95. I know the MCI driver I have uses mmio functions to read data. My question is, since there are more than one video file in a disk(like a Video CD), how I can play video seamlessly? I know I need to define my own mmio procedure(mmioProc), but does one mmioProc only refers to one opened mmio file? Because the handle is in the MMIOINFO. In order to handle multiple file, which is the right approch?
a. detecting the end of file, close mmio then open the next file. I think it's too slow.
b. open all video files, each has its own handle, while changing file, assign the new handle to MMIOINFO, then call mmioProc.
c. other method. Please do tell me more.
I am a newbie in this area, please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you buffer things correctly, you shouldn't have any problems opening that many files. If you have the time to program, however, I would think about just keeping 3 or 4 open at once. Then you could just start a thread to open up another one while you were playing.
In regards to detecting the end of the file:
1. Keep a counter of how many records you've read.
2. Determine from file size how many records are possible.
3. compare
In regards to resources opening a file:
1. If you use CFile, expect to use about 1K per open request
2. If you use FILE*, expect to use about 100 bytes.
3. In either case, you should have plenty of room.
Hasta,
V
In regards to detecting the end of the file:
1. Keep a counter of how many records you've read.
2. Determine from file size how many records are possible.
3. compare
In regards to resources opening a file:
1. If you use CFile, expect to use about 1K per open request
2. If you use FILE*, expect to use about 100 bytes.
3. In either case, you should have plenty of room.
Hasta,
V
ASKER
Thank you