Example: Here is a small sample to play MPG movie inside the mbd project in the position (100,50,100,100):
MCICommand("open <SrcDir>\sample.mpg alias MPEG style child parent <This>")
MCICommand("put MPEG window at 100 50 200 200")
MCICommand("window MPEG state hide")
MCICommand("play MPEG")
Example:(Open and close door on CD (beer holder))
MCICommand("set cdaudio door open")
MCICommand("set cdaudio door closed"
Some of the MCICommand functions can return a value (for example number of tracks on CD)
The variable MCIResult will have the result (integer) number.
Example: (returns number of tracks on CD)
MCICommand("status cdaudio number of tracks")
DisplayValue("Text","MCIResult")
Example2: (returns length (in seconds) of track 1)
MCICommand("status cdaudio length track 1")
DisplayValue("Text_totalsec","MCIResult")
Example3: (returns status of CD audio)
MCICommand("status cdaudio mode")
If (MCIResult=-2) Then
Show("Playing")
End
If (MCIResult=-1) Then
Show("Stopped")
End
For a complete understanding and the syntax, consult Microsoft Documentation or Mcistr.hlp already installed in MMB folder.
WARNING! MCICommand accessing the device directly – be prepare for crashing if you are going to experiment!
NOTE: MCI device has a path-length limit of 128 characters! If your media files are buried inside the nested subfolders and the path is longer than 128 characters, your media won't play.
Also, if the path has some spaces inside, don't forget to enclose the path inside the double quotes like in this example...
file$='<SrcDir>\sample.mpg'
open$='open "' + file$ + '" alias MPEG style child parent <This>' MCICommand("open$")
|