January 2005
Intermediate to advanced
256 pages
6h 34m
English
I hope
that by this point
you’re at least a little interested in what other
kinds of components are available in QuickTime. It’s
easy to discover them all, in much the same way we discovered the
various MovieExporters and
GraphicExporters: by providing a
ComponentDescription template and using
ComponentIdentifier.find( ). With a
“blank” template, all components
can be revealed.
Example 4-4 discovers all installed components and logs their type, subtype, and description to standard out.
Example 4-4. Discovering all installed components
package com.oreilly.qtjnotebook.ch04;
import quicktime.*;
import quicktime.std.*;
import quicktime.std.comp.*;
import quicktime.util.QTUtils;
import com.oreilly.qtjnotebook.ch01.QTSessionCheck;
public class ComponentTour {
public static void main (String[ ] args) {
try {
QTSessionCheck.check( );
/* use this wildcard to show all components in QT
*/
ComponentDescription wildcard =
new ComponentDescription( );
ComponentIdentifier ci = null;
while ( (ci = ComponentIdentifier.find(ci, wildcard)) != null) {
ComponentDescription cd = ci.getInfo( );
System.out.println (cd.getName( ) +
" (" +
QTUtils.fromOSType (cd.getType( )) +
"/" +
QTUtils.fromOSType (cd.getSubType( )) +
") " +
cd.getInformationString( ));
}
} catch (QTException qte) {
qte.printStackTrace( );
}
}
}The resulting output is hundreds of lines long, looking something like this:
run-ch04-componenttour: [java] Apple MP3 Decoder (adec/.mp3) An ...
Read now
Unlock full access