de.pxlab.pxl.display
Class MediaPlayer

java.lang.Object
  extended by de.pxlab.pxl.DisplaySupport
      extended by de.pxlab.pxl.Display
          extended by de.pxlab.pxl.display.MediaPlayer
All Implemented Interfaces:
ExParTypeCodes, TimerBitCodes, Topics
Direct Known Subclasses:
MediaPlayerOpen, MediaPlayerStart, MediaPlayerStop, MediaPlayerSync, Movie

public class MediaPlayer
extends Display

Superclass for showing time based audiovisual media data. This class relies on the Java Media Framework (JMF) package being installed. Media support depends on the set of codecs which are installed in the system. Look into the JMF documentation for supported formats or simply try it out.

This Display object does not have a background such that it always behaves as if it had the TRANSPARENT overlay property. The Display is not preloadable and thus it also behaves as if it had the JustInTime flag set.

Version:
0.1.1
Author:
H. Irtel

Field Summary
 ExPar Cycle
          Flag to make the media file play repeatedly until the player is stopped.
 ExPar Directory
          Movie directory path name.
 ExPar FastStart
          Flag to optimize the movie startup time.
 ExPar FileName
          Media file name.
 ExPar Height
          Movie frame height.
 ExPar LocationX
          Horizontal frame position.
 ExPar LocationY
          Vertical frame position.
protected  java.lang.String mpKey
          The key for entering the media player into the runtime registry.
 ExPar ReferencePoint
          Reference point for the frame.
protected  MediaPlayerElement staticMediaPlayer
           
 ExPar Width
          Movie frame width.
 
Fields inherited from class de.pxlab.pxl.Display
activeTimingGroup, activeTimingGroupIndex, axisDeltas, backgroundFieldIndex, boundingBox, changedPolledButtonIndex, displayComponent, displayDevice, displayElementList, Duration, Execute, frameIncrement, framesPerCycle, graphics, graphics2D, height, JustInTime, next, Overlay, pointerActivationButton, pointerActivationX, pointerActivationY, pointerActive, pointerCurrentButton, pointerCurrentX, pointerCurrentY, pointerEventTime, pointerReleaseButton, pointerReleaseX, pointerReleaseY, pointerResponseEvent, polledButtonStates, presentationManager, ResponseChar, ResponseCode, ResponsePosition, ResponseSet, ResponseTime, Screen, screenButton, startAdjustable, STEREO_LEFT, STEREO_NONE, STEREO_RIGHT, TimeControl, TimeError, Timer, transparentOverlayFollows, width
 
Fields inherited from class de.pxlab.pxl.DisplaySupport
exParFields, group, instanceName, node, timingGroupLimit
 
Fields inherited from interface de.pxlab.pxl.ExParTypeCodes
ANGLE, COLOR, COLOR_EDITOR, DEPCOLOR, DOUBLE, DURATION, editor, EXPARNAME, EXPFACTOR, FLAG, FONTNAME, GEOMETRY_EDITOR, HORSCREENPOS, HORSCREENSIZE, INT_8_BIT, INTEGER, KEYCODE, PROPORT, PROPORTION, RTDATA, SCREENPOS, SCREENSIZE, SIGNED_PROPORTION, SMALL_DOUBLE, SMALL_INT, SMALL_SCREENSIZE, SMALL_VISUAL_ANGLE, SPECTRUM, STRING, TIMING_EDITOR, UNKNOWN, VERSCREENPOS, VERSCREENSIZE, VISUAL_ANGLE
 
Fields inherited from interface de.pxlab.pxl.Topics
ADAPTATION_DSP, APPARENT_MOTION_DSP, ASSIMILATION_DSP, ATTEND_DSP, AUDIO_DSP, CLEAR_DSP, COLOR_CONTRAST_DSP, COLOR_DISCRIMINATION_DSP, COLOR_SPACES_DSP, COMPLEX_COLOR_MATCHING_DSP, COMPLEX_GEOMETRY_DSP, CONTROL_DSP, DATA, DEMO, DISPLAY_TEST_DSP, EXP, EXTERNAL_DSP, FEEDBACK_DSP, GRATING_DSP, GUI_COMPONENT_DSP, INTRO_DSP, LATERAL_INHIBITION_DSP, LETTER_MATRIX_DSP, MEDIA_DSP, PATTERN_IMAGE_DSP, PHOTOMETRY_DSP, PICTURE_DSP, PROBLEM_SOLVING_DSP, PROC_MESSAGE_DSP, QUESTIONNAIRE_DSP, RANDOM_DOT_DSP, SEARCH_DSP, SERIAL_TEXT_DSP, SIMPLE_COLOR_MATCHING_DSP, SIMPLE_GEOMETRY_DSP, SPECTRAL_COLOR_DSP, TEXT_PAR_DSP, topicDescription, VISUAL_GAMMA_DSP
 
Fields inherited from interface de.pxlab.pxl.TimerBitCodes
AXIS_TRACKING_BIT, CLOCK_TIMER_BIT, DOWN_TIMER_BIT, END_OF_MEDIA_TIMER_BIT, FIXED_DELAY_BIT, KEY_TIMER_BIT, MOUSE_BUTTON_TIMER_BIT, MOUSE_TRACKING_BIT, NO_TIMER_BIT, SERIAL_LINE_TIMER_BIT, START_RESPONSE_TIMER_BIT, STOP_KEY_TIMER_BIT, STOP_RESPONSE_TIMER_BIT, STORE_TIMER_BIT, SYNC_TO_MEDIA_TIMER_BIT, UP_TIMER_BIT, VIDEO_SYNCHRONIZATION_BIT, VOICE_KEY_TIMER_BIT, WATCH_SPURIOUS_RESPONSES_BIT, WHEEL_TRACKING_BIT, XBUTTON_TIMER_BIT
 
Constructor Summary
protected MediaPlayer()
          This class should not be instantiated by experimental design files.
 
Method Summary
protected  void computeGeometry()
          A Display's computeGeometry() method is called whenever the size of the receiving display panel is initialized or has been changed, or a geometry parameter of the display has been adjusted.
protected  int create()
          Create the display element list and the timing element list for this display.
 boolean getCanPreload()
          Get this Display object's preload flag.
 boolean isGraphic()
          Return true if this display object requires graphic screen resources for being shown.
 
Methods inherited from class de.pxlab.pxl.Display
axisDeltasChanged, buttonsPolled, canShowSpectralDistributions, canStep, check4MediaTimer, clearBoundingBox, clearCurrentTimingGroup, clearNextTimingGroupImagePreload, clearTimingGroup, computeAnimationFrame, computeBackgroundField, computeColors, computeStereographicGeometry, computeTiming, createInstance, defaultTiming, defaultTiming, destroy, destroyInstance, displayElementCount, displayListControlState, disposeGraphicsContext, enterBackgroundField, enterDisplayElement, enterDisplayElement, enterTiming, enterTiming, enterTiming, enterTiming, enterTiming, finished, getActiveTimingElement, getAdjustable, getAllowTimerStop, getBoundingBox, getColorParOfDisplayElement, getDisplayElement, getDisplayElementAt, getDisplayElementList, getDisplayListControl, getDisplayTiming, getDynExPar, getFrameIncrement, getFramesPerCycle, getFullRecompute, getIndexOf, getInitialDisplayElement, getLastTimingGroup, getLastTimingGroupIndex, getScreenButton, getTiming, getTimingElement, getTimingGroupCount, getTimingGroupPattern, getTransparentOverlayFollows, getVisible, hasSpectralDistributions, isAnimated, isClearListOverlay, isJoinOverlay, isListOverlay, isNoOverlay, isStereo, isTransparentOverlay, keyResponse, nextDisplayElementIndex, nextTimingElementIndex, nextTimingGroup, pointerActivated, pointerDragged, pointerMoved, pointerReleased, preloadTimingGroupImage, printTiming, recompute, recompute, recomputeColors, recomputeGeometry, recomputeGeometry, recomputeTiming, removeDisplayElements, removeDisplayElements, removeTimingElements, removeTimingElements, screenButtonPressed, screenButtonReleased, setAdjustable, setAxisDeltas, setBackgroundColorPar, setCanPreload, setDisplayListControl, setDynExPar, setFrameIncrement, setFramesPerCycle, setFullRecompute, setGraphicsContext, setKeyResponse, setListOverlay, setPointerActivationState, setPointerDraggedState, setPointerMovedState, setPointerReleaseState, setPolledButtonStates, setScreenButton, setTimeControl, setTimingGroup, setTransparentOverlayFollows, setVisible, show, show, showAnimationFrame, showAnimationFrame, showBackgroundElement, showCurrentTimingGroup, showGroup, showGroup, showGroupStereo, showStereo, timingGroupFinished, toString, updateBoundingBox
 
Methods inherited from class de.pxlab.pxl.DisplaySupport
centeredRect, centeredSquare, createExParFields, firstSquareOfTwo, getClassName, getColorPars, getExDesignNode, getExParFields, getExParName, getGeometryPars, getGroup, getInstanceName, getTimingPars, getTitle, getTopic, getXPars, hugeSquare, hugeSquareSize, inner3rdRect, innerRect, largeSquare, largeSquareSize, load, mediumSquare, mediumSquareSize, rectPattern, rectPattern, rectPattern, relSquareSize, reportPars, secondSquareOfTwo, setExDesignNode, setExParFields, setExParFields, setInstanceName, setTitleAndTopic, smallSquare, smallSquareSize, squareSizeOfTwo, tinySquare, tinySquareSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FileName

public ExPar FileName
Media file name.


Directory

public ExPar Directory
Movie directory path name.

Note that the PXLab design file grammar uses the '\'-character in a string as an escape sequence. This means that strings like 'c:\Images' are NOT allowed and MUST be written as 'c:/Images'.


LocationX

public ExPar LocationX
Horizontal frame position.


LocationY

public ExPar LocationY
Vertical frame position.


Width

public ExPar Width
Movie frame width. If both Width and Height are set to 0 then the movie will be shown in its predefined size. If both are larger than the available display device then the movie is shown in full-window size.


Height

public ExPar Height
Movie frame height. If both Width and Height are set to 0 then the movie will be shown in its predefined size. If both are larger than the available display device then the movie is shown in full-window size.


ReferencePoint

public ExPar ReferencePoint
Reference point for the frame. See PositionReferenceCodes for a description. By default the frame center is used as the reference position.


FastStart

public ExPar FastStart
Flag to optimize the movie startup time. If this is set to 1 then everything is done in order to optimize the movie startup time. This includes prefetching movie file data, attaching the movie display frame to the display device window, and showing the first video frame as a static image in the movie display frame. All this is already done before the display list which contains the movie display is started. By default this flag is set to 0 since attaching the movie display frame to the display device before the movie display starts will overwrite the display window content created by earlier display objects. Using this flag is only then safe when preceding display objects do not create screen content in the movie display frame area and it is acceptable that the first movie frame is visible before the movie actually starts running. Depending on the underlying hardware speed setting this parameter may have no noticable effect.


Cycle

public ExPar Cycle
Flag to make the media file play repeatedly until the player is stopped.


mpKey

protected java.lang.String mpKey
The key for entering the media player into the runtime registry.


staticMediaPlayer

protected MediaPlayerElement staticMediaPlayer
Constructor Detail

MediaPlayer

protected MediaPlayer()
This class should not be instantiated by experimental design files.

Method Detail

getCanPreload

public boolean getCanPreload()
Description copied from class: Display
Get this Display object's preload flag.

Overrides:
getCanPreload in class Display
Returns:
true if this Display object can have an image which is preloaded at runtime and false if this Display must be computed at runtime immediately before it is shown.

isGraphic

public boolean isGraphic()
Description copied from class: Display
Return true if this display object requires graphic screen resources for being shown. This is not the case for acoustic and other non-graphic Display objects.

Overrides:
isGraphic in class Display

create

protected int create()
Description copied from class: Display
Create the display element list and the timing element list for this display. This method is called only once per instance. Its task is to create the list of display and timing elements. Colors and timing properties are associated with their respective experimental parameter names here but are not yet initialized from the experimental parameter table. This is done later.

Specified by:
create in class Display

computeGeometry

protected void computeGeometry()
Description copied from class: Display
A Display's computeGeometry() method is called whenever the size of the receiving display panel is initialized or has been changed, or a geometry parameter of the display has been adjusted. This method does not recompute the background.

Specified by:
computeGeometry in class Display