|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectprocessing.core.PImage
jmcvideo.JMC
public abstract class JMC
JMC is an abstract class which provides the base functionality for Processing to interact with the JMC rendering callbacks. You should either use JMCMovie to access the video framss as a PImage pixel buffer or JMCMovieGL to render the frames to a openGL texture. Or you can extend from this class to create your own renderer.
| Field Summary | |
|---|---|
int |
bounces
|
double |
bounceStart
|
double |
bounceStop
|
java.awt.image.BufferedImage |
bufferedImage
|
boolean |
forward
|
float |
h
|
int |
imageType
|
boolean |
isBouncing
|
int |
numBounces
|
int |
pixelFormat
|
double |
progress
|
double |
rate
|
boolean |
stopVideoAfterBouncing
|
int |
vh
|
int |
vw
|
float |
w
|
float |
x
|
float |
y
|
| Fields inherited from class processing.core.PImage |
|---|
cacheMap, format, height, modified, mx1, mx2, my1, my2, parent, pixels, saveImageFormats, width |
| Fields inherited from interface processing.core.PConstants |
|---|
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z |
| Constructor Summary | |
|---|---|
JMC()
|
|
| Method Summary | |
|---|---|
void |
bounce()
Begins video playback, playing forwards and then backwards forever if backward playback is supported. |
void |
bounce(double bounceStart,
double bounceStop)
Begins video playback, playing forwards and then backwards forever from the specified start time to the specified end time. |
void |
bounce(int numBounces)
Begins video playback, playing forwards and then backwards a specified number of times. |
void |
bounce(int numBounces,
double bounceStart,
double bounceStop)
Begins video playback, playing forwards and then backwards a specified number of times from the specified start time to the specified end time. |
void |
centerVideo()
|
void |
centerVideo(float inset)
|
void |
centerVideo(float frameWidth,
float frameHeight,
float inset)
|
void |
changeBalance(float amt)
|
void |
changeRate(double amt)
Increase or decrease the rate of video playback by a specified amount. |
void |
changeVolume(float amt)
Increase or decrease the volume by a specified amount. |
int |
currentLoop()
Gets the current loop iteration. |
void |
dispose()
Dispose of native resources. |
void |
frameVideo(float frameWidth,
float frameHeight,
float inset)
Sets the bounds |
float |
getBalance()
|
double |
getCurrentTime()
Gets the current video playback position. |
double |
getDuration()
Gets the duration of the video. |
java.lang.String |
getDurationString()
Gets a nicely formatted version of the duration of the video. |
float |
getFader()
|
int |
getImageType()
|
java.lang.String |
getLoopString()
Gets info about the loop settings. |
double |
getPlaybackPercentage()
Gets the position of the video playback as a percentage between the start time and the end time of the video. |
double |
getProgress()
Gets the download progress of the video. |
java.lang.String |
getProgressString()
Gets a nicely formatted version of the download progress of the video. |
double |
getRate()
Gets the current rate of video playback. |
double |
getStartTime()
|
double |
getStopTime()
|
java.lang.String |
getTimeString()
Gets a nicely formatted version of the current playback position of the video. |
float |
getVolume()
Gets the current volume. |
void |
handleBouncingBehavior()
|
void |
initializeVideo(processing.core.PApplet parent,
java.net.URI uri,
int pixelFormat)
|
boolean |
isLooping()
Determines whether or not the video is looping. |
boolean |
isMuted()
Determine if the video is muted or not. |
boolean |
isPlaying()
Determine if the video is currently playing. |
boolean |
isReady()
Checks to make sure that the video has a legitimate duration and that we are not trying to play past what has been downloaded. |
void |
loop()
Begins video playback, looping forever |
void |
loop(double start,
double stop)
Begins video playback, looping forever from the specified start time to the specified end time. |
void |
loop(int numRepeats)
Begins video playback, looping a specified number of times. |
void |
loop(int numRepeats,
double start,
double stop)
Begins video playback, looping a specified number of times from the specified start time to the specified end time. |
void |
mediaDownloadProgressChanged(com.sun.media.jmc.event.BufferDownloadedProgressChangedEvent bde)
|
void |
paintBufferedImage()
Paints the newest video frame onto a BufferedImage. |
void |
pause()
Pauses the video playback. |
void |
play()
Begins video playback. |
void |
play(double start,
double stop)
|
void |
setBalance(float balance)
|
void |
setBounds(float x,
float y,
float w,
float h)
Explicitly sets the bounds of this PImage. |
void |
setCurrentTime(double time)
Sets the current video playback position. |
void |
setFader(float fader)
|
void |
setImageType(int imageType)
Sets the imageType of the bufferedImage that the frame is painted on. |
void |
setMute(boolean mute)
Mutes or unmutes the video. |
void |
setPlaybackPercentage(double perc)
Sets the position of the video playback using a percentage between the start time and the end time of the video. |
void |
setRate(double rate)
Sets the rate of video playback |
void |
setStartTime(double start)
|
void |
setStopTime(double stop)
|
void |
setupBufferedImage()
Creates a BufferedImage the same size as the video and initializes the PImage pixel buffer. |
void |
setVideo(java.net.URI uri)
Sets the video for this MediaProvider. |
void |
setVolume(float vol)
Sets the volume to the specified volume. |
void |
stop()
Stops and rewinds the movie to the beginning. |
void |
switchVideo(java.io.File file)
Switch to a new video. |
void |
switchVideo(java.lang.String filename)
Switch to a new video. |
void |
switchVideo(java.net.URI uri)
Switch to a new video. |
void |
switchVideo(java.net.URL url)
Switch to a new video. |
void |
toggleMute()
Make the video mute if it is not, or unmutes it if it is. |
int |
totalLoops()
Gets the total number of loops that has been set. |
| Methods inherited from class processing.core.PImage |
|---|
blend, blend, blendColor, blurAlpha, blurARGB, blurRGB, buildBlurKernel, checkAlpha, clone, copy, copy, dilate, filter, filter, get, get, get, getCache, getImage, getImpl, init, isModified, loadPixels, loadTIFF, mask, mask, removeCache, resize, save, saveImageIO, saveTGA, saveTIFF, set, set, setCache, setImpl, setModified, setModified, updatePixels, updatePixels, updatePixelsImpl |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.media.jmc.event.VideoRendererListener |
|---|
videoFrameUpdated |
| Field Detail |
|---|
public int vw
public int vh
public double rate
public boolean isBouncing
public int numBounces
public int bounces
public double bounceStart
public double bounceStop
public boolean forward
public boolean stopVideoAfterBouncing
public double progress
public int imageType
public int pixelFormat
public java.awt.image.BufferedImage bufferedImage
public float x
public float y
public float w
public float h
| Constructor Detail |
|---|
public JMC()
| Method Detail |
|---|
public void initializeVideo(processing.core.PApplet parent,
java.net.URI uri,
int pixelFormat)
public void mediaDownloadProgressChanged(com.sun.media.jmc.event.BufferDownloadedProgressChangedEvent bde)
mediaDownloadProgressChanged in interface com.sun.media.jmc.event.BufferDownloadListenerpublic void switchVideo(java.lang.String filename)
filename - The name of the new video file in the data directory.public void switchVideo(java.io.File file)
file - A video file.public void switchVideo(java.net.URL url)
url - The URL of a video file.public void switchVideo(java.net.URI uri)
uri - The URI of a video file.public void setImageType(int imageType)
imageType - public int getImageType()
public void handleBouncingBehavior()
public void paintBufferedImage()
public void setupBufferedImage()
public void setBounds(float x,
float y,
float w,
float h)
x - y - w - h -
public void frameVideo(float frameWidth,
float frameHeight,
float inset)
frameWidth - frameHeight - inset - public void centerVideo()
public void centerVideo(float inset)
public void centerVideo(float frameWidth,
float frameHeight,
float inset)
public java.lang.String getTimeString()
public java.lang.String getDurationString()
public java.lang.String getProgressString()
public java.lang.String getLoopString()
public double getStartTime()
public void setStartTime(double start)
public double getStopTime()
public void setStopTime(double stop)
public double getDuration()
public double getProgress()
public void changeRate(double amt)
amt - Amount by which to change the rate.public void setRate(double rate)
rate - The rate to set the playback to.public double getRate()
public void pause()
public void play()
public void play(double start,
double stop)
public void loop()
public void loop(int numRepeats)
numRepeats -
public void loop(double start,
double stop)
start - stop -
public void loop(int numRepeats,
double start,
double stop)
start - stop - public void bounce()
public void bounce(int numBounces)
numBounces -
public void bounce(double bounceStart,
double bounceStop)
bounceStart - bounceStop -
public void bounce(int numBounces,
double bounceStart,
double bounceStop)
numBounces - bounceStart - bounceStop - public boolean isReady()
public boolean isPlaying()
public void changeVolume(float amt)
amt - Amount by which to change the volume.public void setVolume(float vol)
vol - public float getVolume()
public void setMute(boolean mute)
public boolean isMuted()
public void toggleMute()
public void changeBalance(float amt)
public void setBalance(float balance)
public float getBalance()
public void setFader(float fader)
public float getFader()
public double getCurrentTime()
public void setCurrentTime(double time)
time - public double getPlaybackPercentage()
public void setPlaybackPercentage(double perc)
perc - A number between 0.0 and 1.0, where 0.0 is the start of the video and 1.0 is the end of the video.public boolean isLooping()
public int totalLoops()
public int currentLoop()
public void stop()
public void dispose()
public void setVideo(java.net.URI uri)
uri - The URI of the video.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||