
please help with MCI control
Quote:
>I'm currently trying to use MCI control but have encountered some
>problems and I hope someone can help me with me.
I've have just programmed a small MIDI player (like a thousand others), so
I've struggled with all these questions... :-)
Quote:
>How do I know that the audio file has finished playing?
>[...] when its finished playing, what event will be invoked?
There is an event called MMControl.Done. However, I never got it to work.
Instead, I use the Timer control, and with an interval of 1000 ms, I check
like this
If MMControl.Mode = mciModePlay Then
' is playing (move slidebar etc.)
Else If MMControl.Mode = mciModeStop And Not Stopped Then
' is finished (play next or something)
End If
You'll need a global variable (or perhaps a property) called Stopped
declared as boolean. Set it to true when you start to play
(MMControl.PlayClick) and false when you stop (MMControl.StopClick). The
pause command makes no impact.
Quote:
>What is Length property timescale for Sequencer (Midi) ?
Use the MMControl.Timeformat property to set this. The help says:
==============================================
Specifies the time format used to report all position information.
Syntax
[form.]MMControl.TimeFormat[ = format&]
Remarks
The following table lists the TimeFormat property settings for the
Multimedia MCI control.
Value Setting/Time format
0 mciFormatMilliseconds
Milliseconds are stored as a 4-byte integer variable.
1 mciFormatHms
Hours, minutes, and seconds are packed into a 4-byte integer. From least
significant byte to most significant byte, the individual data values are:
Hours (least significant byte)
Minutes
Seconds
Unused (most significant byte)
2 mciFormatMsf
Minutes, seconds, and frames are packed into a 4-byte integer. From least
significant byte to most significant byte, the individual data values are:
Minutes (least significant byte)
Seconds
Frames
Unused (most significant byte)
3 mciFormatFrames
Frames are stored as a 4-byte integer variable.
4 mciFormatSmpte24
24-frame SMPTE packs the following values in a 4-byte variable from least
significant byte to most significant byte:
Hours (least significant byte)
Minutes
Seconds
Frames (most significant byte)
SMPTE (Society of Motion Picture and Television Engineers) time is an
absolute time format expressed in hours, minutes, seconds, and frames. The
standard SMPTE division types are 24, 25, and 30 frames per second.
5 mciFormatSmpte25
25-frame SMPTE packs data into the 4-byte variable in the same order as
24-frame SMPTE.
6 mciFormatSmpte30
30-frame SMPTE packs data into the 4-byte variable in the same order as
24-frame SMPTE.
7 mciFormatSmpte30Drop
30-drop-frame SMPTE packs data into the 4-byte variable in the same order as
24-frame SMPTE.
8 mciFormatBytes
Bytes are stored as a 4-byte integer variable.
9 mciFormatSamples
Samples are stored as a 4-byte integer variable.
10 mciFormatTmsf
Tracks, minutes, seconds, and frame are packed in the 4-byte variable from
least significant byte to most significant byte:
Tracks (least significant byte)
Minutes
Seconds
Frames (most significant byte)
Note MCI uses continuous track numbering.
Note Not all formats are supported by every device. If you try to set an
invalid format, the assignment is ignored.
[...] Properties that access or send information in the current time format
are: From, Length, Position, Start, To, TrackLength, TrackPosition.
Data Type: Long (Enumerated)
==============================================
You probably want to use format 0 which means milliseconds. Then you can
convert it like you do for waves now.
Quote:
> For wave, I've found it is in miliseconds.
I don't think that's absolutely correct. It's number of frames or so.
// Thomas Raneland