windoze media

Wilhelm Sanke sanke at hrz.uni-kassel.de
Tue Sep 23 04:01:01 EDT 2003


   On Mon, 22 Sep 2003 Ken Norris <pixelbird at interisland.net> wrote:

(snip)

> >>>> Correction: These formats might be playable via "MCIsendString" in
> >>>> RR...
>
> >>> Really? That'd be cool...How about a clue on instructions.
>
> >> I'd love to, if i had any  [;-)]
> > Here you go:
> > http://www.tactilemedia.com/info/MCI_Control_Info.html
>
> ---------
> Thanks. Certainly worth investigating. It'd be nice to have a set of script
> controls for MediaPlayer.
>
> Ken N.
>

The "MciSendstring" entry in the Transcript Dictionary is rather
general  and not helpful here.
Neither is the stack "mcisendstring.mc" that -among other things - can
list the media devices on your Windows computer

(sample script:
on mouseUp
  put mciSendString("sysinfo all quantity") into xMax
  put empty into fld "deviceNames"
  repeat with x = 1 to xMax
    put "sysinfo all name" && x into commandString
    put mciSendString(commandString) & return after fld
"deviceNames"
  end repeat
end mouseUp).

I think this stack once could be found on the Metacard ftp site, but is
no longer there.

MciSendstring functions to control video and sound clips were already
used on Windows with Toolbook 1.5 - more than ten years ago - before
Asymetrix developed "Multimedia" Toolbook with the "stage" object
(comparable to the Metacard player object) and before Scott Raney
created Metacard.

Here is a script to play a video clip in Revolution:

on mouseup
get mciSendstring("open c:\Quest\Tutorial\Video.avi alias Film")
get mciSendstring("put Film destination at 300 90 160 120")
get mciSendstring("window FILM handle"&& the windowId of this stack)
get mciSendstring("play Film wait")
get mciSendstring("close Film")
end mouseup

A similar script to play a sound file:

on mouseup
get mciSendstring("open c:\mao\gong.wav type waveaudio alias Mao")
get mciSendstring("play Mao wait")
get mciSendstring("close Mao")
end mouseup

Another script to play an "avi" file where a "screen" is pulled down
before the film starts:

on mouseUp
  get mciSendString("open C:\Windows\Desktop\Meta2.5.B3\asym01.avi alias
Film")
  get mciSendstring("put Film destination at 250 90 260 220")
  get mciSendstring("window FILM handle"&&the windowID of this stack)

  show fld "frame" with visual effect reveal down
  wait 1 second
  get mciSendstring("play Film from 1")

  wait 5 seconds
  get mciSendstring("close Film")
  hide fld "frame"  with visual effect reveal up
end mouseup

There are of course a number of other commands to be used with
MciSendstring that enable a detailed control of video and audio files -
similar to the possibilities of the player object. and maybe with some
commands even more detailed.

Regards,

Wilhelm Sanke




More information about the use-livecode mailing list