quicktime.std.sg
Class SequenceGrabber

java.lang.Object
  |
  +--quicktime.QTObject
        |
        +--quicktime.std.comp.ComponentIdentifier
              |
              +--quicktime.std.comp.Component
                    |
                    +--quicktime.std.sg.SequenceGrabber
All Implemented Interfaces:
quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public final class SequenceGrabber
extends Component
implements quicktime.jdirect.QuickTimeLib

Assists in importing sound and video into a movie. The SeqGrabComponent implements methods for a corresponding QuickTime ComponentInstance structure. refer to SeqGrabComponent in QuickTime


Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Constructor Summary
SequenceGrabber()
          Opens the specified movie export component,'barg', with any subType.
SequenceGrabber(int subType)
          Opens the specified movie export component,'barg', with the given subType.
SequenceGrabber(int type, int subType)
          Opens the specified Sequence grabber component based on the type and Subtype

QuickTime::OpenADefaultComponent



QuickTime::SGInitialize

 
Method Summary
 void disposeChannel(SGChannel c)
          Removes a channel from a sequence grabber component.
 void disposeOutput(SGOutput output)
          Disposes of an output associated with a sequence grabber.
 QTFile getDataOutputFile()
          Allows you to determine the movie file that is currently assigned to a sequence grabber component.
 int getDataOutputFlags()
          Allows you to determine the record control flags that is currently assigned to a sequence grabber component.
 DataRef getDataRef()
          Determines the data reference that is currently assigned to a sequence grabber component.
 int getDataRefFlags()
          Determines the data reference flags that control the record operation.
 QDGraphics getGWorld()
          Returns the QDGraphics of the sequence grabber.
 GDevice getGWorldDevice()
          Returns the current device of the sequence grabber.
 SGChannel getIndChannel(int index)
          Allows you to obtain the channel type currently in use by a sequence grabber component.
 int getIndChannelType(int index)
          Allows you to obtain info on the channel type currently in use by a sequence grabber component.
 int getMaximumRecordTime()
          Allows you to retrieve the time limit you have set for recording.
 Movie getMovie()
          Determines a reference to the movie that contains the data collected during a record operation.
 int getPause()
          Specifies control information about the current operation to the sequence grabber component.
 UserData getSettings()
          Retrieves the current settings of all channels used by the sequence grabber.
 int getStorageSpaceRemaining()
          Allows you to monitor the amount of space remaining for use during a record operation.
 TimeBase getTimeBase()
          Returns the SequenceGrabbers's current time Base.
 int getTimeRemaining()
          Allows you to obtain an estimate of the amount of recording time that remains for the current recording operation.
 Pict grabPict(QDRect bounds, int offscreenDepth, int grabPictFlags)
          Provides a simple interface to obtain a QuickDraw picture from a sequence grabber component.
 void idle()
          Provides processing time to the sequence grabber component and its channel components.
 boolean idleMore()
          Provides processing time to the sequence grabber component and its channel components.
 boolean isPreviewMode()
          Determines whether the particular sequence grabber is in preview mode.
 boolean isRecordMode()
          Determines whether the particular sequence grabber is in Record mode.
 SGOutput newOutput(DataRef dataRef, int whereFlags)
          The SGNewOutput function creates a new sequence grabber output.
 void pause(int pause)
          You can suspend or restart a record or preview operation by calling the pause function.
 void prepare(boolean prepareForPreview, boolean prepareForRecord)
          Instructs the sequence grabber to get ready to begin a preview or record operation.
 void release()
          Instructs the sequence grabber to release any system resources it allocated previously.
 void removeDataProc()
          Remove the currently registered data proc.
 void setDataOutput(QTFile movieFile, int whereFlags)
          Specifies the movie file for a record operation and other options that govern the operation.
 void setDataProc(SGDataProc proc)
          Specify a data function for use by the sequence grabber.
 void setDataRef(DataRef dataRef, int whereFlags)
          Determines control information flags for the current operation.
 void setGWorld(QDGraphics port, GDevice gdh)
          Establishes the graphics port and device for a sequence grabber.
 void setMaximumRecordTime(int ticks)
          Allows you to set the time limit for recording.
 void setSettings(UserData ud)
          Configures a sequence grabber.
 void startPreview()
          Instructs the sequence grabber to begin processing data from its channels.
 void startRecord()
          Instructs the sequence grabber component to begin collecting data from its channels.
 void stop()
          Stops a preview or record operation.
 void update(Region updateRgn)
          The SGUpdate function allows you to tell the sequence grabber that it must refresh its display.
 void writeExtendedMovieData(SGChannel c, int p, int len, long offset, SGOutput sgOut)
          Allows your channel component to add data to a movie.
 
Methods inherited from class quicktime.std.comp.Component
count
 
Methods inherited from class quicktime.std.comp.ComponentIdentifier
find, find, getInfo, toString
 
Methods inherited from class quicktime.QTObject
disposeQTObject, equals, ID
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceGrabber

public SequenceGrabber()
                throws QTException
Opens the specified movie export component,'barg', with any subType.

QuickTime::OpenADefaultComponent



QuickTime::SGInitialize


SequenceGrabber

public SequenceGrabber(int subType)
                throws QTException
Opens the specified movie export component,'barg', with the given subType.

QuickTime::OpenADefaultComponent



QuickTime::SGInitialize

Parameters:
subType - The movie export component sub type

SequenceGrabber

public SequenceGrabber(int type,
                       int subType)
                throws QTException
Opens the specified Sequence grabber component based on the type and Subtype

QuickTime::OpenADefaultComponent



QuickTime::SGInitialize

Parameters:
Type - The movie export component type
subType - The movie export component sub type
Method Detail

setGWorld

public void setGWorld(QDGraphics port,
                      GDevice gdh)
               throws StdQTException
Establishes the graphics port and device for a sequence grabber. The sequence grabber component displays the recorded or previewed data in this graphics world.

QuickTime::SGSetGWorld QuickTime::SGSetGWorld

Parameters:
port - Specifies the destination graphics port. The specified graphics port must be a color graphics port.
gdh - Specifies the destination graphics device. Set this parameter to null to use the current device. If the gp parameter specifies a graphics world, set this parameter to null to use that graphics world's graphics device.

getGWorld

public QDGraphics getGWorld()
                     throws StdQTException
Returns the QDGraphics of the sequence grabber.

QuickTime::SGGetGWorld

Returns:
The current graf port of the sequence grabber.

getGWorldDevice

public GDevice getGWorldDevice()
                        throws StdQTException
Returns the current device of the sequence grabber.

QuickTime::SGGetGWorld

Returns:
The current device of the sequence grabber.

disposeChannel

public void disposeChannel(SGChannel c)
                    throws StdQTException
Removes a channel from a sequence grabber component.

QuickTime::SGDisposeChannel

Parameters:
c - the channel you want to dispose

newOutput

public SGOutput newOutput(DataRef dataRef,
                          int whereFlags)
                   throws StdQTException
The SGNewOutput function creates a new sequence grabber output. You specify the outputÕs destination container using a data reference. Once you have created the sequence grabber output, you can use the SGSetChannelOutput function to assign the output to a sequence grabber channel.

QuickTime::SGNewOutput

Parameters:
owner - Specifies the type of channel.
dataRef - Specifies the type of channel.
dataRefType - Specifies the type of channel.
whereFlags - Specifies the type of channel.

disposeOutput

public void disposeOutput(SGOutput output)
                   throws QTException
Disposes of an output associated with a sequence grabber.

QuickTime::SGDisposeOutput

Parameters:
c - the output you want to dispose

writeExtendedMovieData

public void writeExtendedMovieData(SGChannel c,
                                   int p,
                                   int len,
                                   long offset,
                                   SGOutput sgOut)
                            throws StdQTException
Allows your channel component to add data to a movie.

QuickTime::SGWriteExtendedMovieData(

Parameters:
p -  
len -  
offset - offset to the new data in the movie. If the movie is in memory, the returned offset reflects the location the data will have in the movie on a permanent storage device.
sgOut - output to which the data was written. associated with the sequence grabber output.

startPreview

public void startPreview()
                  throws StdQTException
Instructs the sequence grabber to begin processing data from its channels.

QuickTime::SGStartPreview QuickTime::SGStartPreview


startRecord

public void startRecord()
                 throws StdQTException
Instructs the sequence grabber component to begin collecting data from its channels.

QuickTime::SGStartRecord QuickTime::SGStartRecord


idle

public void idle()
          throws StdQTException
Provides processing time to the sequence grabber component and its channel components. After starting a preview or record operation, you should call this function as often as possible, until you stop the operation by calling stop.

QuickTime::SGIdle QuickTime::SGIdle


idleMore

public boolean idleMore()
                 throws StdQTException
Provides processing time to the sequence grabber component and its channel components. After starting a preview or record operation, you should call this function as often as possible, until you stop the operation by calling stop. If the sequence grabber has a stop time set, then this method will return false when the sequence grabber has captured media for the specified time. At that point the application should stop the sequence grabber and not call idle until restarted. It will return true when further idling is required.

QuickTime::SGIdle QuickTime::SGIdle

Returns:
true if requires more idling, false if comleted.

update

public void update(Region updateRgn)
            throws StdQTException
The SGUpdate function allows you to tell the sequence grabber that it must refresh its display.

QuickTime::SGUpdate

Parameters:
updateRgn - Indicates the part of the QDGraphics that has been changed. If you set this parameter to null, the sequence grabber uses the windowÕs current visible region

stop

public void stop()
          throws StdQTException
Stops a preview or record operation.

QuickTime::SGStop QuickTime::SGStop


pause

public void pause(int pause)
           throws StdQTException
You can suspend or restart a record or preview operation by calling the pause function. You supply a byte value that instructs the sequence grabber whether to pause or restart the current operation.

QuickTime::SGPause QuickTime::SGPause

Parameters:
pause - Instructs whether to suspend or restart the current operation.

getPause

public int getPause()
             throws StdQTException
Specifies control information about the current operation to the sequence grabber component.

QuickTime::SGGetPause

Parameters:
sgFlags - The control flags for the current operation.

prepare

public void prepare(boolean prepareForPreview,
                    boolean prepareForRecord)
             throws StdQTException
Instructs the sequence grabber to get ready to begin a preview or record operation. May commence both operations. You specify the operations.

QuickTime::SGPrepare QuickTime::SGPrepare

Parameters:
prepareForPreview - The preview operation.
prepareForRecord - The record operation.

release

public void release()
             throws StdQTException
Instructs the sequence grabber to release any system resources it allocated previously. You should call release whenever you call SGPrepare without subsequently starting a record or preview operation.

QuickTime::SGRelease QuickTime::SGRelease


getMovie

public Movie getMovie()
Determines a reference to the movie that contains the data collected during a record operation. You can use this movie identifier with Movie Toolbox functions.

QuickTime::SGGetMovie

Returns:
The Movie or null if there is no movie.

setSettings

public void setSettings(UserData ud)
                 throws StdQTException
Configures a sequence grabber. You provide this configuration information in a Movie Toolbox user data list. Typically, you obtain this configuration data from the getSettings method. Note that the sequence grabber disposes of any of its current channels before applying this configuration information. It then opens connections to new channels as appropriate. You can restore saved settings by using the Movie Toolbox's NewUserDataFromHandle function.

QuickTime::SGSetSettings

Parameters:
ud - Specifies a user data list with configuration information for the sequence grabber.

getSettings

public UserData getSettings()
                     throws StdQTException
Retrieves the current settings of all channels used by the sequence grabber. The sequence grabber places all of this configuration information into a Movie Toolbox user data list.

QuickTime::SGGetSettings

Returns:
A Movie Toolbox user data list that contains the configuration information.

grabPict

public Pict grabPict(QDRect bounds,
                     int offscreenDepth,
                     int grabPictFlags)
              throws QTException
Provides a simple interface to obtain a QuickDraw picture from a sequence grabber component. The sequence grabber can display the picture directly, or it can write the picture to an offscreen buffer. This function is limited in scope, however, and does not allow you to control all of the parameters that govern the operation. When you call this function, the sequence grabber component obtains and configures appropriate sequence grabber channel components (if necessary), grabs the data, and then releases any components it obtained.

QuickTime::SGGrabPict

Parameters:
bounds - The bounding rectangle.
offscreenDepth - The bit depth of the Pict.
grabPictFlags - The flags for the operation.
Returns:
The Pict.

setDataOutput

public void setDataOutput(QTFile movieFile,
                          int whereFlags)
                   throws QTException
Specifies the movie file for a record operation and other options that govern the operation. The sequence grabber component stores the data that is obtained during the record operation as a QuickTime movie in this file. This function also allows you to control some aspects of the record operation, which are related to output, by specifying control flags.

QuickTime::SGSetDataOutput

Parameters:
movieFile - Specifies which movie file to access.
whereFlags -  

getDataOutputFile

public QTFile getDataOutputFile()
                         throws QTException
Allows you to determine the movie file that is currently assigned to a sequence grabber component.

QuickTime::SGGetDataOutput

Returns:
The QTFile movie file.

getDataOutputFlags

public int getDataOutputFlags()
                       throws QTException
Allows you to determine the record control flags that is currently assigned to a sequence grabber component.

QuickTime::SGGetDataOutput

Returns:
The record control flags.

setDataRef

public void setDataRef(DataRef dataRef,
                       int whereFlags)
                throws StdQTException
Determines control information flags for the current operation.

QuickTime::SGSetDataRef

Parameters:
dataRef - information that identifies the destination container
flags - that control the record operation

getDataRef

public DataRef getDataRef()
                   throws StdQTException
Determines the data reference that is currently assigned to a sequence grabber component.

QuickTime::SGGetDataRef

Returns:
the dataRef

getDataRefFlags

public int getDataRefFlags()
                    throws StdQTException
Determines the data reference flags that control the record operation.

QuickTime::SGGetDataRef

Returns:
the record flags

setMaximumRecordTime

public void setMaximumRecordTime(int ticks)
                          throws StdQTException
Allows you to set the time limit for recording.

QuickTime::SGSetMaximumRecordTime

Returns:
the ticks of recording time. If 0 then no limit has been set

getMaximumRecordTime

public int getMaximumRecordTime()
                         throws StdQTException
Allows you to retrieve the time limit you have set for recording.

QuickTime::SGGetMaximumRecordTime

Returns:
the ticks of recording time. If 0 then no limit has been set

getStorageSpaceRemaining

public int getStorageSpaceRemaining()
                             throws StdQTException
Allows you to monitor the amount of space remaining for use during a record operation.

QuickTime::SGGetStorageSpaceRemaining

Returns:
the number of bytes left for the current record operation.

getTimeRemaining

public int getTimeRemaining()
                     throws StdQTException
Allows you to obtain an estimate of the amount of recording time that remains for the current recording operation.

QuickTime::SGGetTimeRemaining

Returns:
the ticks of recording time remaining

isPreviewMode

public boolean isPreviewMode()
                      throws StdQTException
Determines whether the particular sequence grabber is in preview mode.

QuickTime::SGGetMode


isRecordMode

public boolean isRecordMode()
                     throws StdQTException
Determines whether the particular sequence grabber is in Record mode.

QuickTime::SGGetMode


getTimeBase

public TimeBase getTimeBase()
                     throws StdQTException
Returns the SequenceGrabbers's current time Base.

QuickTime::SGGetTimeBase

Returns:
the TimeBase

getIndChannelType

public int getIndChannelType(int index)
                      throws StdQTException
Allows you to obtain info on the channel type currently in use by a sequence grabber component.

QuickTime::SGGetIndChannel

Parameters:
index - identifies the channel to be queried
Returns:
the channel type (e.g VideoMediaType, SoundMediaType etc..)

getIndChannel

public SGChannel getIndChannel(int index)
                        throws QTException
Allows you to obtain the channel type currently in use by a sequence grabber component.

QuickTime::SGGetIndChannel

Parameters:
index - identifies the channel to be queried
Returns:
the connection to the channel.

setDataProc

public void setDataProc(SGDataProc proc)
                 throws StdQTException
Specify a data function for use by the sequence grabber. Whenever any channel assigned to the sequence grabber writes data, your data function is called as well. Your data function may then write the data to another destination.
Parameters:
proc - the callback that will be called by the SequenceGrabber

removeDataProc

public void removeDataProc()
                    throws StdQTException
Remove the currently registered data proc.