QTGrab
current version 0.9q
Copyright Geoff Smith 1999-2002
page last updated: 16th Feburary 2002


To purchase email sales@physicalbits.com

Description

This is a Macintosh only Xtra for Macromedia Director(TM) to allows capturing, display and saving to disk vieo and audio images.
For updates on this and my other XObjects/Xtras check out my web page:physicalbits

Release and Version history

Compatibility

OS
Version
Yes
No
Untested
Apple Macintosh Classic (OS9)
   
OSX    

 

Installation

There are two methods to install and use this Xtra for Macromedia Director.

Copy the QTGrab.xtr into the Xtras folder inside the folder with the Director main program. When you start Director it looks inside, and makes available, any xtras inside the Xtras folder.

The other method is to place the xtra in some folder, and use Directors openxlib command before trying to use it. I use this method in my demo movies. If you put the xtra in the Xtras folder you do not need to use the openxlib command. Refer to the Director documentation for further information.

To check that the xtra is loaded enter lingo "showxlib" command into Directors message window, this lists all the available xtras. If the xtra is not named in the list some error has occured. Check the location of the file or use the openxlib command (see above). The figure below shows the presence of the xtra, "-- Xtra: RecSndXtra", and because openxlib was used the name of the file that it was read from is shown.
Is the xtra is on the list use "put interface(xtra "QTGrab")" to list all the messages available in the xtra. It also shows the version of the xtra and if it can be used in a projector.

 

Commands

General  
 

new
mOpenVideoChannel
mOpenAudioChannel

mPreview

mUpdate

Video  
 

mSetRect
mSetCameraSubRect
mSetKeyColour

mConfigureVideoDialog
mGetCurrentVideoDigitiserInputFormat
mGetCurrentVideoDigitiserIndex
mSetCurrentVideoDigitiserIndex
mGetVideoDigitiserInfo
mIsDigitiserRecievingVideo

mGetVideoSettings/mSetVideoSettings
mGetVideoDeviceList

Audio  
  mConfigureAudioDialog
mSetAudioInputType
FindAllAudioDeviceNames
mSetAudioSampleSize
mSetAudioInputGain

mGetAudioSettings/mSetAudioSettings

mGetAudioDeviceList
Capture  
  mStartRecording
mPauseRecording
mStopRecording
mUpdate
mGrabCurrentFrameAsPicture
mGrabCurrentFrameAsPictureWithDither
Information  
  mGetLastMessage
No longer suppported  
 

mGetNumberOfVideoDigitiserInputs object me
mGetVideoDigitiserInputFormat object me , integer index
mGetGrabberSettings -- DO NOT USE.
mSetGrabberSettings -- DO NOT USE

Version release history

New

Command format new
Description Standard command to create a new instance of an object. It requires one parameter that indicates the audio input device to use
Parameters

deviceName: the name of the device to use.
The default audio input can be selected by using "" as the deviceName. To obtain a list of all the installed auddio input devices use the FindAudioCaptureDevices command.

Return value instance value or error number. Test with Lingo objectP command
Example set gAudio to new( xtra "RecSndXtra", "" )

mOpenVideoChannel

Command format mOpenVideoChannel object me , string deviceName
Description Open a video device for viewing of capturing
Parameters

deviceName:
The name of the device to use. If this is "" then the defualt device isused

Return value "ok" else an error message where the first word is "Error"
Example put mOpenVideoChannel( theXtra "")

mOpenAudioChannel

Command format mOpenAudioChannel object me , string deviceName
Description Open an audio device for viewing of capturing
Parameters

deviceName:
The name of the device to use. If this is "" then the defualt device isused

Return value "ok" else an error message where the first word is "Error"
Example put mOpenAudioChannel( theXtra "")

FindAllAudioDevices

Command format FindAllAudioDeviceNames
Description Find the names of all the audio devices presently installed on the machine - GLOBAL HANDLER (Does not need the instance created)
Parameters

None

Return value List of the devices or ""
Example put FindAllAudioDevices

mPreview

Command format mPreview object me , integer trueOrFalse
Description Once a video channel has been opened, the preview has to be enabled
Parameters

trueOrFalse
1 to enable the preview, 0 to disable

Return value "ok" else an error message where the first word is "Error"
Example put mPreview( theXtra, true)

mStartRecording

Command format mStartRecording object me , string fileAndPathname
Description Start recording the video/audio data to the specified file
Parameters

fileAndPathname
The name of the file to save the info into.

Return value "ok" else an error message where the first word is "Error"
Example put mStartRecodring( theXtra, the pathname && "hello")

mPauseRecording

Command format mPauseRecording object me , integer trueOrFalse
Description Pauses or unpauses the current recording
Parameters

trueOrFalse:
1 to enable pause, 0 to disable

Return value "ok" else an error message where the first word is "Error"
Example put mPauseRecording( theXtra, false).

mStopRecording

Command format mStopRecording object me
Description Stop a recording
Parameters

None:

Return value "ok" else an error message where the first word is "Error"
Example put mStopRecording( theXtra).

mGrabCurrentFrameAsPicture and mGrabCurrentFrameAsPictureWithDither

Command format mGrabCurrentFrameAsPicture object me , string castNameToSaveInto
mGrabCurrentFrameAsPictureWithDither object me , string castNameToSaveInto
Description Take the current video image and capture it into the named cast member, also with dither
Parameters

castNameToSaveInto:
The name of the cast member to save into.

Return value "ok" else an error message where the first word is "Error"
Example put mGrabCurrentFrameAsPicture( theXtra, "BigPicture" )

mUpdate

Command format mUpdate object me
Description This updates the image sent to either the stage or file. Call regularly to keep image refreshed.
Parameters

None:

Return value "ok" else an error message where the first word is "Error"
Example put mUpdate( theXtra )

mSetRect

Command format mSetRect object me, integer left , integer top , integer right , integer bottom
Description Set the capture size rect (need to check this).The camera may not support the new size
Parameters

left, top, right and bottom :
The point of the rectangle in stage co-ordinates

Return value "ok" else an error message where the first word is "Error"
Example put mSetRect( theXtra,10,15,100,200 )

mSetCameraSubRect

Command format mSetCameraSubRect object me, integer left , integer top , integer right , integer bottom
Description Some video capture devices have the ability to return only a portion o the image the are seeing, the sub rect. This command allows control over the segment that is returned. The camera may not support this feature.
Parameters

left, top, right and bottom :
The point of the rectangle in camera co-ordinates

Return value "ok" else an error message where the first word is "Error"
Example put mSetCameraSubRect( theXtra,10,15,100,200 )

mSetKeyColour

Command format mSetKeyColour object me, integer theColourIndex
Description So I have never got this one to work, I leave it in because it might wotk with some camera I do not have. As I understand it this is kind of like an alpha/keying channel. IF you get it to work please email me.
Parameters

theColourIndex:
the index, 0-255, of the new colour

Return value "ok" else an error message where the first word is "Error"
Example put mSetKetColour( theXtra,10 )

mConfigureVideoDialog and mConfigureAudioDialog

Command format mConfigureVideoDialog object me
mConfigureAudioDialog object me
Description Display the settings dialog for the video or audio
Parameters

None:

Return value "ok" or "Error" if user cancels the dialog
Example put mConfigureVideoDialog( theXtra)

mSetAudioInputType

Command format

mSetAudioInputType object me, string type --

Description Allows the setting of the audio input from lingo (see also mSetAudioSettings)
Parameters

type:
Examples are
imic,emic,dav,cd,tv,modem,mbay,rca or zvpc

Return value "ok" else an error message where the first word is "Error"
Example put mSetAudioInputType( theXtra,"rca")

mGetVideoSettings

Command format

mGetVideoSettings object me
mSetVideoSettings object me, string theData -- Use the data obtained from mGetVideoSettings

Description Most of the current video settings can be "saved" and "restored" using these commands. mGetVideoSettings returns a string you store, which you later give to mSetVideoSettings. This will most propably break if you try to get on one mac and set on another.
Parameters

theData:
The string obtained from mGetVideoSettings

Return value mGetVideoSettings:The string, or "" on error
mSetVideoSettings:"ok" else an error message where the first word is "Error"
Example

put mGetVideoSettings( theXtra) into currentState
put mSetVideoSettings(theXtra, currentState)

mGetAudioSettings

Command format

mGetAudioSettings object me
mSetAudioSettings object me, string theData -- Use the data obtained from mGetVideoSettings

Description Most of the current audio settings can be "saved" and "restored" using these commands. mGetAudioSettings returns a string you store, which you later give to mSetAudioSettings. This will most propably break if you try to get on one mac and set on another.
Parameters

theData:
The string obtained from mGetAudioSettings

Return value mGetAudioSettings:The string, or "" on error
mSetAudioSettings:"ok" else an error message where the first word is "Error"
Example

put mGetAudioSettings( theXtra) into currentState
put mSetAudioSettings(theXtra, currentState)

mSetAudioSampleSize

Command format

mSetAudioSampleSize object me , integer newSize

Description Allows the setting of the audio sample size, only 8 or 16 are valid
Parameters

newSize:
only 8 or 16 are valid

Return value "ok" else an error message where the first word is "Error"
Example put mSetAudioSampleSize( theXtra,16)

mSetAudioInputGain

Command format

mSetAudioInputGain object me , integer value

Description Allows the setting of the audio input gain level
Parameters

value:
0 is mute, 100 is full. You can overdrive the gain beyond 100

Return value "ok" else an error message where the first word is "Error"
Example put mSetAudioInputGain( theXtra,50)

mGetVideoDigitiserInfo

Command format

mGetVideoDigitiserInfo object me

Description Returns a, usefull, description of the capabilities of the current device.
Parameters

None:

Return value A string describing the capabilites of the current vieo input device
Example put mGetVideoDigitizerInfo( theXtra)

mGetCurrentVideoDigitiserIndex

Command format

mGetCurrentVideoDigitiserIndex object me
mSetCurrentVideoDigitiserIndex object me , integer index

Description When a system has multiple video input devices you can query the current one being used, then restore this later.
Parameters

index:
The index value obtained from mGetCurrentVideoDigitiserIndex (0 is the first device)

Return value

mGetCurrentVideoDigitiserIndex: the current index value or -1 on error
mSetCurrentVideoDigitiserIndex:"ok" else an error message where the first word is "Error"

Example

put mGetCurrentVideoDigitiserIndex( theXtra) into thisOne
put mGetCurrentVideoDigitiserIndex(theXtra, thisOne)

mGetCurrentVideoDigitiserInputFormat

Command format

mGetCurrentVideoDigitiserInputFormat object me

Description get the current input connector being used for input
Parameters

None:

Return value One of "composite", "S-video" or "RGB" else an error message where the first word is "Error"
Example put mGetCurrentVideoDigitiserInputFormat( theXtra)

mIsDigitiserRecievingVideo

Command format

mIsDigitiserRecievingVideo object me

Description Checks if the video digitiser is currently receiving a video signel, eg is camera connected
Parameters

None:

Return value "yes", "no" or "Error"..."
Example put mIsDigitiserRecievingVideo( theXtra)

mGetVideoDeviceList

Command format

mGetVideoDeviceList object me -- Video channel must be opened first
mGetAudioDeviceList object me -- Audio channel must be opened first

Description Returns the names of all the video/audio devices connected.
Parameters

None:

Return value Comma seperated string of all the available devices
Example put mGetVideoDeviceList( theXtra)

mGetLastMessage

Command format

mGetLastMessage object me

Description Gets the result message from the last call
Parameters

None:

Return value "ok" else an error message where the first word is "Error"
Example put mGetLastMessage( theXtra)


Version History

Version Date
Bug fix
Notes
0.9q 4/02
Aded mSetClip
0.9p 4/02
Added FindAllDeviceNames
0.9o 4/02
Stop not being called when record expires
0.9n 2/16
Added commands to play and stop playing a sound that has been recorded. The sound does not need to be saved to cast or file.
0.9m 1/02
Added protection to prevent saving a recording sound
0.9l 1/02
Changed FindAllAudioDecives to return full new form list
0.9k 11/01
Added SaveAsFile for the Windows platform
0.9d 11/01
Slight bug fix
0.9c 10/01
SaveAsFile for the Macintosh platform
0.9b 5/01
Added GetSoundInLevel to allow finding the volume level whilst recording
0.9a 7/00
Initial Xtra - conversion from XObject

 

Contact details

Email: supportQtGrab@physicalbits.com

 

Conditions of use

In this document Xtra refers to this Xtra, and me refers to Geoff Smith. All rights to the XObject/Xtra are retained by me. The XObject may be used in any MacroMedia Director document for personal use and given to your friends. All documentation must be included when passing on the XObject/Xtra. Unless licensed you may NOT do the following ·distribute for profit without prior permission. ·distribute for profit within a Director presentation without prior permission ·distribute by CD-ROM without prior permission. ·distribute as part of a collection without prior permission ·be used in a public presentation without prior permission.Financial liabilty for this product is limited to the purchase price or $1, whichever is greater.
All legal proceeding must be carried out under the auspices of the court of Santa Clara, California, USA. These conditions may be modified at any time. Please refer to the physicalbits website for the latest conditions.