#!/bin/sh # MetaCard 2.1 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" mciSendString,mci.mc mciSendStringp---------------------------------------------------- -- mciSendString stack -- created for MetaCard Corporation -- by Phil Davis and Associates -- 1997 Phil Davis ---------------------------------------------------- on preOpenStack lock screen end preOpenStack on openStack global kWindowsVersion put empty into kWindowsVersion get the systemVersion if the platform is "Win32" then switch case ("NT" is in it) -- Windows NT put 3 into kWindowsVersion break case (4 is in it) -- Windows 95 put 2 into kWindowsVersion break case (3 is in it) -- Windows 3.1 put 1 into kWindowsVersion break end switch else modal "notWindows" setCommandsEnabled (kWindowsVersion is not empty) end openStack on openCard set the menuHistory of btn "topics" to the number of this card unlock screen end openCard on closeCard lock screen end closeCard on setCommandsEnabled newStatus get the text of btn "device" of card "Commands" repeat with x = 1 to the number of lines in it set the traversalOn of fld (line x of it) of card "Commands" of this stack to newStatus end repeat end setCommandsEnabled wBlackffffffwhite darkgraySm WTNJZNHNVU HelveticaW HelveticaU HelveticaW HelveticaU HelveticaU HelveticaW Helvetica U HelveticaU Helvetica U Helvetica W Helvetica W HelveticaUArialWArialWArialUArialUArialWArialUArialUArialUCourier UCourierU Arial Black UCourier WCourier U Courier New U Helvetica Introduction @ltabLoc55,30%G*) ( Commands Pon doCommand if the traversalOn of the target is false then exit doCommand set the cursor to busy put mciSendString(the selectedText of the target) into returnValue get the result put returnValue into fld "mciReturnValue" put it into fld "mciResult" end doCommand ltabLoc144,30%RXZ\^JTNQcijSMgknuYour MCI Devices PCon preOpenCard put empty into fld "deviceNames" end preOpenCard ltabLoc250,30%QuickTime for Windows @m%  deviceNames h%   `Devicesi( t cdaudio`D h  avivideo`D h  wavaudio`D h  sequencer`D Rh qtwin`D 7h   text1 h4?S Definition   %The Microsoft Media Control Interface (MCI) is the Windows OS communication channel to and from its media players/recorders. MCI defines requirements and provides support for runtime communication between applications and media devices known to the OS. All versions of the Windows OS use MCI.   " #   Several media players (such as the MIDI Sequencer and the ActiveMovie Player) are included in the OS. Other players (such as videodisc players and QuickTime for Windows) can be added. MetaCard's mciSendString function enables you to create applications that control all of these devices.  O  mciSendString causes media to play outside your stack through an external device. This can create a different effect than playing media through the play command, which causes the media to appear as part of the stack.   @(navion changeText increment global gVisibleText if gVisibleText is empty then put 1 into gVisibleText get (increment + gVisibleText) if it < 1 then get 4 else if it > 4 then get 1 end if lock screen set the visible of fld ("text" & it) to true set the visible of fld ("text" & gVisibleText) to false put it into gVisibleText put gVisibleText && "of 4" into fld "pageNumber" unlock screen end changeText X.prev C(on mouseUp changeText -1 end mouseUp white\,&View Previous Paragraph@ next S'on mouseUp changeText 1 end mouseUp white\\,&View Next ParagraphA ' pageNumber  cP 1 of 4 )text2h4?S How It Works   aDuring development, MCI-compliant device drivers are programmed to support certain MCI commands.  hDuring system configuration, each driver is given a device type in the system.ini and/or win.ini files.  At run time, the user application (your MetaCard stack) sends a command to the MCI system (not to the device driver). If it is an MCI system command, MCI issues a response. If it is a device command, MCI uses the .ini files mentioned above to map the requested device type to a specific device driver. It then passes the command to that driver. The driver executes the command if possible and sends a response back to the MCI system. MCI then forwards the response to the user application. d dW       *text3h4?S Device Types   MCI refers to a device by its type. Every MCI device has a device type. Device types can be defined as the need arises, making the MCI system flexible and extensible. Some common device types are:  cdaudio  digitalvideo scanner  sequencer  videodisc  waveaudio %tabsietopics)};on menuPick newPick, oldPick go cd newPick end menuPick blue]=Introduction Commands Your MCI Devices QuickTime for Windows  Gtext4h4?S Command Categories   LSystem commands request information or services from the MCI system itself.  ;  vRequired commands are supported by all MCI devices. Each command has a defined set of options that must be supported.  c  Basic commands are optionally supported by some MCI devices. A device may support one basic command and not support the others. A device that supports a basic command must support a defined set of options for that command.    Extended commands are optional. They may provide access to device-specific functions or may simply extend the options of another command.  w Jcd audio commands!x$on mouseUp doCommand end mouseUp rdefaultMediaFiles;(plays an audio CD) (plays an audio CD) (plays an audio CD) mediaFile(plays an audio CD) commandSetopen cdaudio info cdaudio product capability cdaudio can eject status cdaudio mode set cdaudio time format tmsf set cdaudio door open set cdaudio door closed play cdaudio pause cdaudio stop cdaudio close cdaudio open cdaudio info cdaudio product capability cdaudio can eject status cdaudio mode set cdaudio time format tmsf set cdaudio door open set cdaudio door closed play cdaudio pause cdaudio stop cdaudio close cdaudioK `r N mciResult (40"W&Value of "the result" after execution  QEdit the ListEx3on mouseUp put the label of btn "device" into tDevice get the listBehavior of fld tDevice if it is true then set the name of me to "Stop Editing" else set the name of me to "Edit the List" set the listBehavior of fld tDevice to not it set the locktext of fld tDevice to not it end mouseUp Sp-Toggle the list behavior of the command list R H\ $Click a command line to execute it: T H4 The result: Xsystem commands)x$on mouseUp doCommand end mouseUp rdefaultMediaFiles8(no file required) (no file required) (no file required) mediaFile(no file required) commandSetusysinfo sequencer quantity sysinfo cdaudio quantity sysinfo all quantity sysinfo all name 1 sysinfo cdaudio quantity  sysinfo sequencer quantity sysinfo cdaudio quantity sysinfo all quantity sysinfo all name 1 sysinfo cdaudio quantity Y `r Zquicktime commands!x$on mouseUp doCommand end mouseUp rdefaultMediaFiles C:/WINDOWS/Sample.mov mediaFileC:/WINDOWS/Sample.mov commandSetcapability QTWVideo compound device capability QTWVideo can record capability QTWVideo has audio capability QTWVideo uses files capability QTWVideo device type capability QTWVideo can eject capability QTWVideo can play capability QTWVideo can lock capability QTWVideo can reverse capability QTWVideo can save capability QTWVideo can stretch capability QTWVideo can stretch input capability QTWVideo can test capability QTWVideo test capability QTWVideo has still capability QTWVideo can freeze capability QTWVideo uses palettes info QTWVideo window text info QTWVideo audio algorithm open QTWVideo! alias demo1 open type QTWVideo alias demo1 window demo1 state show status demo1 speed status demo1 time format set demo1 time format ms status demo1 time format set demo1 time format frames status demo1 time format seek demo1 to 160 play demo1 from 100 to 200 pause demo1 resume demo1 play demo1 reverse stop demo1 capability demo1 can reverse status demo1 time format status demo1 length close demo1 $capability QTWVideo compound device capability QTWVideo can record capability QTWVideo has audio capability QTWVideo uses files capability QTWVideo device type capability QTWVideo can eject capability QTWVideo can play capability QTWVideo can lock capability QTWVideo can reverse capability QTWVideo can save capability QTWVideo can stretch &capability QTWVideo can stretch input capability QTWVideo can test capability QTWVideo test capability QTWVideo has still capability QTWVideo can freeze "capability QTWVideo uses palettes info QTWVideo window text info QTWVideo audio algorithm 2open QTWVideo!"C:\WINDOWS\Sample.mov" alias demo1 7open "C:\WINDOWS\Sample.mov" type QTWVideo alias demo1 window demo1 state show status demo1 speed status demo1 time format set demo1 time format ms status demo1 time format set demo1 time format frames status demo1 time format seek demo1 to 160 play demo1 from 100 to 200 pause demo1 resume demo1 play demo1 reverse stop demo1 capability demo1 can reverse status demo1 time format status demo1 length close demo1[ `rf aS \activeMovie commands!x$on mouseUp doCommand end mouseUp rdefaultMediaFiles C:/WINDOWS/HELP/Scroll.avi mediaFileC:/WINDOWS/HELP/Scroll.avi commandSetopen avivideo status avivideo mode close avivideo open type avivideo alias tutorial play tutorial close tutorial stop tutorial pause tutorial resume tutorial status tutorial mode  open avivideo status avivideo mode close avivideo ?open "C:\WINDOWS\HELP\Scroll.avi" type avivideo alias tutorial play tutorial close tutorial stop tutorial pause tutorial resume tutorial status tutorial mode ] `rp aS ^wave audio commands!x$on mouseUp doCommand end mouseUp rdefaultMediaFiles) C:/WINDOWS/MEDIA/The Microsoft Sound.wav mediaFile(C:/WINDOWS/MEDIA/The Microsoft Sound.wav commandSetcapability waveaudio can play capability waveaudio can record capability waveaudio can save capability waveaudio uses files capability waveaudio device type capability waveaudio compound device info waveaudio product open type waveaudio play pause resume status close open type waveaudio alias myAudio play myAudio close myAudio close all open record stop close open play close  capability waveaudio can play capability waveaudio can record capability waveaudio can save capability waveaudio uses files !capability waveaudio device type %capability waveaudio compound device info waveaudio product ?open "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" type waveaudio 0play "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 1pause "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 2resume "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 2status "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 1close "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" Mopen "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" type waveaudio alias myAudio play myAudio close myAudio close all 0open "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 2record "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 0stop "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 1close "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 0open "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 0play "C:\WINDOWS\MEDIA\The Microsoft Sound.wav" 1close "C:\WINDOWS\MEDIA\The Microsoft Sound.wav"_ `ro aScdevice}on mouseDown global gOldCommandSet put the label of me into gOldCommandSet set the mediaFile of fld gOldCommandSet to fld "fileName" pass mouseDown end mouseDown on mouseUp global gOldCommandSet put the label of me into tNewCommandSet if tNewCommandSet = gOldCommandSet then exit mouseUp set the lockScreen to true set the visible of fld gOldCommandSet to false set the visible of fld tNewCommandSet to true put the mediaFile of fld tNewCommandSet into fld "fileName" put empty into fld "mciReturnValue" put empty into fld "mciResult" get ("(" is in fld "fileName") set the disabled of btn "Browse..." to it set the disabled of btn "Apply" to it set the lockScreen to false end mouseUp 4The MCI device categorySystem CommandsvSystem Commands QuickTime Commands ActiveMovie Commands MIDI Sequencer Commands Wave Audio Commands CD Audio Commands iKS?WTWjKT? XTX midi sequencer commands!x$on mouseUp doCommand end mouseUp rdefaultMediaFiles C:/WINDOWS/MEDIA/Canyon.mid mediaFileC:/WINDOWS/MEDIA/Canyon.mid commandSetcapability sequencer can play capability sequencer can record capability sequencer can save capability sequencer uses files capability sequencer device type capability sequencer compound device info sequencer product open type sequencer play pause resume status close open type sequencer alias myAudio play myAudio close myAudio close all open record stop close open play close  capability sequencer can play capability sequencer can record capability sequencer can save capability sequencer uses files !capability sequencer device type %capability sequencer compound device info sequencer product 2open "C:\WINDOWS\MEDIA\Canyon.mid" type sequencer #play "C:\WINDOWS\MEDIA\Canyon.mid" $pause "C:\WINDOWS\MEDIA\Canyon.mid" %resume "C:\WINDOWS\MEDIA\Canyon.mid" %status "C:\WINDOWS\MEDIA\Canyon.mid" $close "C:\WINDOWS\MEDIA\Canyon.mid" @open "C:\WINDOWS\MEDIA\Canyon.mid" type sequencer alias myAudio play myAudio close myAudio close all #open "C:\WINDOWS\MEDIA\Canyon.mid" #stop "C:\WINDOWS\MEDIA\Canyon.mid" $close "C:\WINDOWS\MEDIA\Canyon.mid" #open "C:\WINDOWS\MEDIA\Canyon.mid" #play "C:\WINDOWS\MEDIA\Canyon.mid" $close "C:\WINDOWS\MEDIA\Canyon.mid" `r aS List DevicesExon 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 c# )$S0  LPress the button below to list the MCI devices that reside on this machine. MmciReturnValue (4"5)Result code or message returned from MCI   S H4 "mciSendString" return value: g fileName)h4q"  (no file required)k Browse...Exon mouseUp answer file "Play which media file?" if it is empty then exit mouseUp put it into fld "fileName" end mouseUp \Look for a media file nDefaultExon mouseUp pMouseButton global kWindowsVersion put the label of btn "device" into tDevice if pMouseButton = 1 then put line kWindowsVersion of the defaultMediaFiles of fld tDevice into fld "fileName" else get the defaultMediaFiles of fld tDevice put fld "fileName" into line kWindowsVersion of it set the defaultMediaFiles of fld tDevice to it end if end mouseUp [!Show the default media file name uApplyExZon mouseUp -- convert slashes to native Windows backslashes put quote & fld "fileName" & quote into tFileName repeat while "/" is in tFileName put "\" into char offset("/",tFileName) of tFileName end repeat -- get the "template" command set for this device type put the label of btn "device" into tDevice get the commandSet of fld tDevice -- replace "" with actual media file name repeat while "<" is in it put offset("<",it) into x put tFileName into char x to x+9 of it end repeat -- display the command set put it into fld tDevice end mouseUp 4[0Use the current media file name in the commands  H4^ Media file:See Button Script...Ep@on mouseUp edit the script of btn "List Devices" end mouseUp c qtw1 h4?S@ qQuickTime's MCI compliance makes it controllable from MetaCard scripts, as demonstrated in the Commands section. _ @Blue_ @Blackg   Obtaining QTW   ]The QuickTime for Windows installer is available free from Apple Computer and other sources:   E ftp://ftp.info.apple.com/Apple.Support.Area/Apple.Software.Updates/ D & ftp://ftp.metacard.com/MetaCard/QTW/ %  jThe table below (taken from QTW Q&A #75 - "Matching QTW 2.1 Access Methods To Your Targetted Windows Platform" at the Apple support site listed below) shows the version of QTW 2.1 you'll need on your Windows OS, depending on which access method you plan to use (MetaCard's play command supports 32-bit access; the mciSendString function supports 16-bit access). E       % : G H!   Windows 3.1x via API via MCI     * 16-bit app 16-bit QTW 2.1 16-bit QTW 2.1  32-bit app NA 16-bit QTW 2.1   Windows 95 via API via MCI     * 16-bit app 16-bit QTW 2.1 16-bit QTW 2.1 * 32-bit app 32-bit QTW 2.1 16-bit QTW 2.1   Windows NT via API via MCI     * 16-bit app 16-bit QTW 2.1 32-bit QTW 2.1 * 32-bit app 32-bit QTW 2.1 32-bit QTW 2.1  wWin32s does not support the multimedia extensions required by QTW and thus does not support use of the 32-bit QTW API.  If your MetaCard stack/standalone accesses QTW via MCI, you must install the 16-bit version of QTW under Windows 3.1 and 95, and the 32-bit version under Windows NT. Although Windows 95 supports 32-bit apps, it only recognizes 16-bit MCI drivers. P    Support and Information   NApple Computer provides information and support on QTW and other products at: 4 http://devworld.apple.com/ngs/lpp/adrpub/docs/dev/ 3  ,The QuickTime VR component is available at: 3 ftp://ftp.quicktime.apple.com/software/QuickTime/ 2  3You can find the QuickTime Developers listserv at: + http://www.solutions.apple.com/listadmin/ *  ,Frequently Asked Questions are answered at:  http://www.QuickTimeFAQ.org  `B4S notWindows pon preOpenStack -- trap message end preOpenStack on openStack -- trap message end openStack on preOpenCard -- trap message end preOpenCard on openCard -- trap message end openCard on closeCard -- trap message end closeCard on closeStack -- trap message end closeStack  WTNJZNHNV Not a Microsoft Windows System!  X U HelveticaW Helvetica W Helvetica U HelveticaUArialU Arial BlackUMS Sans SerifU HelveticaW HelveticaW Helvetica ppon enterKey click at loc of btn "Okay" end enterKey on returnKey click at loc of btn "Okay" end returnKey   HGq  EThe MCI command examples in this stack will not work on this system.  HYou can read the information but you won't be able to try the commands.   D  ?????F????????????????x?????????OkayMx+on mouseUp close this stack end mouseUp