Copyright (c) 2002 - 2003, Junzo Sato. All rights reserved.
Jul 18th 2003
Jun 10th 2002
QuickTime for Java is available from the Apple computer's web site: http://www.apple.com/.
In this notebook, java2 (ver 1.4.1_01) and QuickTime for Java 6.0 is used.
![]()
![]()
![]()
![]()
![]()
![]()
Open QTSession
![]()
![]()
![]()
Create a ToneDescription of an instrument in General MIDI. The piano (#1) is chosen here.
![]()
![]()
NoteRequest and NoteChannel are prepared.
![]()
![]()
![]()
The function PlayNote[ ] is defined.
![LoadClass["java.lang.Thread"] ; PlayNote[n_, msec_] := ( notechannel @ playNote[n, 127] ; Thread`sleep[msec] ; notechannel @ playNote[n, 0])](HTMLFiles/index_15.gif)
![]()
![]()
![]()
![]()
![walk(β_) := Re(InverseFourier[Table[1/f^β^(1/2) gauss [[ f ]], {f, 1, 300}]])](HTMLFiles/index_20.gif)

![]()
![[Graphics:HTMLFiles/index_23.gif]](HTMLFiles/index_23.gif)
![]()
![]()
Objects are released.
![ReleaseObject[tonedesc] ReleaseObject[notechannel] ReleaseObject[noterequest]](HTMLFiles/index_26.gif)
QTSession‚ð•‚¶‚é
![]()
A movie specified by the URL is played using QTPlayer.
MovieController controls movie frames.
![[Graphics:HTMLFiles/index_28.gif]](HTMLFiles/index_28.gif)
![[Graphics:HTMLFiles/index_29.gif]](HTMLFiles/index_29.gif)
![]()
![]()
![]()
[Windows] c:\quicktime-for-java-sdk\media\jumps.mov
[MacOS X] /quicktime-for-java-sdk/media/jumps.mov
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![LoadClass["quicktime.app.display.QTCanvas"] ; <br /> qtcanvas = JavaNew["quicktime.app.display.QTCanvas"]](HTMLFiles/index_51.gif)
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![[Graphics:HTMLFiles/index_60.gif]](HTMLFiles/index_60.gif)
![[Graphics:HTMLFiles/index_61.gif]](HTMLFiles/index_61.gif)
Rewind to the beginning
![]()
Get time scale
![]()
![]()
Get total seconds
![]()
![]()
Calculate current second of the frame. If the beginning, the time is 0.
![]()
![]()
Forward the frames.
![[Graphics:HTMLFiles/index_69.gif]](HTMLFiles/index_69.gif)
![[Graphics:HTMLFiles/index_70.gif]](HTMLFiles/index_70.gif)
![]()
Now the current second is increased.
![]()
![]()
Play movie with the rate 1.0.
![]()
If the rate is set to 0.0 in the middle of the play, the movie is stopped.
![[Graphics:HTMLFiles/index_75.gif]](HTMLFiles/index_75.gif)
![[Graphics:HTMLFiles/index_76.gif]](HTMLFiles/index_76.gif)
![]()
Go to the end of the movie.
![[Graphics:HTMLFiles/index_78.gif]](HTMLFiles/index_78.gif)
![[Graphics:HTMLFiles/index_79.gif]](HTMLFiles/index_79.gif)
![]()
Get the current time information of a frame.
This information is set to the captureThis for later use.
![[Graphics:HTMLFiles/index_81.gif]](HTMLFiles/index_81.gif)
![]()
![]()
![]()
![]()
![[Graphics:HTMLFiles/index_86.gif]](HTMLFiles/index_86.gif)
![]()
![]()
![]()
![]()
Objects are released.
![]()
![]()
![ReleaseObject[frame] ReleaseObject[mc] ReleaseObject[m] ReleaseObject[myPlayer] ReleaseObject[urlMovie]](HTMLFiles/index_93.gif)
Close QTSession
![]()
Using the QTImageProducer, a frame of the movis is derived as a JavaImage.
![]()
![]()
![]()
![]()
![]()
![Switch[$MachineType, "PC", qtf = JavaNew["quicktime.io.QTFile", "C ... ac", qtf = JavaNew["quicktime.io.QTFile", "/QTJavaSDK/media/jumps.mov"]]](HTMLFiles/index_100.gif)
![]()
Get Movie and MoviePlayer by opening the file.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Get image size of the movie.
![]()
![]()
![]()
![LoadClass["java.awt.Dimension"] ; d = JavaNew["java.awt.Dimension", r @ getWidth[], r @ getHeight[]] d @ toString[]](HTMLFiles/index_112.gif)
![]()
![]()
Get time information
![]()
![]()
![]()
![]()
Specify the frame to be captured as a JavaImage. The captureThis was set by the previous example in this notebook.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Get the frame as the JavaImage
![]()
![]()
![]()
![]()
Show JavaImage on the MathCanvas.
![[Graphics:HTMLFiles/index_133.gif]](HTMLFiles/index_133.gif)
![[Graphics:HTMLFiles/index_134.gif]](HTMLFiles/index_134.gif)
![frame = JavaNew["com.wolfram.jlink.MathFrame", qtf @ getName[]] ; JavaBlock[frame @ ... jlink.MathCanvas"] ; mathCanvas @ setSize[d] ; frame @ add["Center", mathCanvas] ;](HTMLFiles/index_135.gif)
![]()
![frame @ layout[] ; frame @ setLocation[0, 48] ; JavaShow[frame]](HTMLFiles/index_137.gif)
If the user is using Java Photo Editor which is developed by the author, and Digital Image Processing package,
the captured JavaImage is ready to use for digital image processing operations.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![[Graphics:HTMLFiles/index_147.gif]](HTMLFiles/index_147.gif)
![]()
![TryFilters[data_] := Show[GraphicsArray[Graphics /@ { data, DiscreteConvolve[data, BoxFilter[ ... 15, 7], Centered -> True], DiscreteConvolve[data, LoGFilter[15, 15], Centered -> True] }]]](HTMLFiles/index_149.gif)
![]()
![[Graphics:HTMLFiles/index_151.gif]](HTMLFiles/index_151.gif)
![]()
Objects are released.
![ReleaseObject[mathCanvas] frame @ dispose[] ReleaseObject[frame]](HTMLFiles/index_153.gif)
![ReleaseObject[javaImage] ReleaseObject[tk] ReleaseObject[moviePlayer] ReleaseObject[imgProduce ... seObject[movie] ReleaseObject[openMovieFile] ReleaseObject[qtf] ReleaseObject[r] ReleaseObject[d]](HTMLFiles/index_154.gif)
Close QTSession
![]()
![]()
![]()
![]()
Converted by Mathematica (July 18, 2003)