Important: The information in this document is obsolete and should not be used for new development.
QuickTime for Java APIs have been updated to match the latest QuickTime 5 APIs, Toolbox calls, and headers.
QuickTime for Java includes the addition of a new idling mechanism for time-based callbacks, as well as other new services and classes, discussed in this section.
Idling Mechanism Re-Worked
Support for New Services
QTDrawing Listener and Notification Services
The way in which time-based callbacks work in QuickTime for
Java has been re-engineered. These callbacks are now triggered off
interrupts or very high priority native threads, in the case of
Mac OS X and Windows, rather than as previously triggered explicitly
by QuickTime for Java calls to MoviesTask,
which meant that QuickTime for Java had to create idling threads
in order to make the callbacks fire.
Timing callbacks are used in the QuickTime for Java compositing services, like the Compositor Class, and are used to render frames when you set the rate of the Compositor to a rate that is not equal to zero. This gives QuickTime for Java much better performance because the callbacks are delivered executing Java code much closer to when they should be. This also means that you don't have to have an idling thread running in order to have these callbacks fire in the first place. If your application is using the time callbacks themselves, you don’t have to instantiate any sort of idling mechanism, as you would have done in the past. These callbacks will just fire when the time conditions are met. This results in a much more responsive system.
QuickTime for Java also provides support for a number of new QuickTime services, including
The Broadcasting APIsthat are new in QuickTime 5 (see the quicktime.streaming package).
These classes will only work on the Mac OS because that feature
is only supported by QuickTime on Mac OS.
APIs forXML Event-Based Parsing that are also new with QuickTime 5 (see
the quicktime.std.qtcomponents package).
Enhanced API support for Sound Manager services. Asynchronous
recording is now supported. SndChannels can be instantiated with
a callback, enabling asynchronous playback, use of the soundCmd (like bufferCmd).
SndChannels can also be queried for equalization settings, and Spectral
Data, including a new EQ component in QuickTime 5 that allows up
to 64 bands of spectral data to be obtained.
In response to requests from developers, the QTFilter and QTTransition classes
now support movies, compositors as sources, as well as still images.
There are, in addition, a number of minor enhancements and bug fixes in this release.
The JavaDoc for all of these new APIs in QuickTime for Java can be perused at:
http://developer.apple.com/quicktime/qtjava
Two new classes have been added to QuickTime for Java that
provide notification services for DynamicImage classes upon completion
of drawing operations. For notification of drawing operations, the DrawingNotifier interface
is used, and the DrawingListener interface
is used to register interest in drawing complete notifications.
Several QTJ classes were modified to use the DrawingNotifier interface: MoviePlayer, MoviePresenter, QTEffectPresenter,
and SWCompositor. These
classes provide a method addDrawingListener() that
you may call to register your class.
Once your class that implements the DrawingListener interface
is registered, you will get called whenever a drawing operation
occurs on the Notifier object. This is useful, for example, if you
want to know when a frame has been rendered in a Movie.
To make a class that uses the DrawingListener interface,
you need to do the following:
public class MyListener implements DrawingListener { |
public void drawingComplete (QTDrawable drawable) { |
// do something cool when notification is received |
} |
} |
And then register your class with the component:
MyListener listener = new MyListener(); |
// register MyListener w/ SWCompositor |
theCompositor.addDrawingListener (listener); |
When you no longer want to receive drawing notifications,
call removeDrawingListener() with
your DrawingListener object
from the component you are no longer interested in.
Last updated: 2001-10-01