de.pxlab.pxl.display
Class MediaPlayerSync

java.lang.Object
  extended by de.pxlab.pxl.DisplaySupport
      extended by de.pxlab.pxl.Display
          extended by de.pxlab.pxl.display.MediaPlayer
              extended by de.pxlab.pxl.display.MediaPlayerSync
All Implemented Interfaces:
ExParTypeCodes, TimerBitCodes, Topics

public class MediaPlayerSync
extends MediaPlayer

Synchronize to the media time of a media data file played by the media player. Two types of synchronization are possible: (1) wait until a certain media time is reached and (2) wait until the end of the media data file has been found. In order to wait for the end of the media data stream the Timer parameter of this object must be set to END_OF_MEDIA_TIMER. If the synchronization object should wait until a certain media time has been reached its Timer must be set to SYNC_TO_MEDIA_TIMER and the parameter MediaTime has to be set to the respective media time. The media time is given in milliseconds relative to the start of the media stream. Thus in order to synchronize to the start of the 10th frame of a 25 Hz video stream MediaTime must be set to 9*40 = 360 ms.

Version:
0.1.1
Author:
H. Irtel

Field Summary
 ExPar MediaTime
          The media synchronization time in milliseconds.
 
Fields inherited from class de.pxlab.pxl.display.MediaPlayer
Cycle, Directory, FastStart, FileName, Height, LocationX, LocationY, mpKey, ReferencePoint, staticMediaPlayer, 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
MediaPlayerSync()
           
 
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.
 void show()
          Draws all objects in the list of DisplayElements but the background.
 void show(java.awt.Graphics g)
          Draws the background if it has been defined and then draws all objects in the list of DisplayElements.
 void showGroup()
          Here is where the music plays.
 void showGroup(java.awt.Graphics g)
          This method is not used for non-graphic display objects.
protected  void timingGroupFinished(int group)
          This method is called when the display of the currently active timing group has been finished.
 
Methods inherited from class de.pxlab.pxl.display.MediaPlayer
create, getCanPreload, isGraphic
 
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, showAnimationFrame, showAnimationFrame, showBackgroundElement, showCurrentTimingGroup, showGroupStereo, showStereo, 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

MediaTime

public ExPar MediaTime
The media synchronization time in milliseconds. This is the media time relative to the start of the media which is currently playing.

Constructor Detail

MediaPlayerSync

public MediaPlayerSync()
Method Detail

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.

Overrides:
computeGeometry in class MediaPlayer

show

public void show(java.awt.Graphics g)
Description copied from class: Display
Draws the background if it has been defined and then draws all objects in the list of DisplayElements. This method ignores the timing group patterns. Drawing is delegated to the DisplayElement objects.

Overrides:
show in class Display
Parameters:
g - a currently valid Graphics context for painting.

show

public void show()
Description copied from class: Display
Draws all objects in the list of DisplayElements but the background. Drawing is delegated to the DisplayElement objects.

Overrides:
show in class Display

showGroup

public void showGroup()
Here is where the music plays.

Overrides:
showGroup in class Display

showGroup

public void showGroup(java.awt.Graphics g)
This method is not used for non-graphic display objects.

Overrides:
showGroup in class Display
Parameters:
g - the Graphics context for painting.

timingGroupFinished

protected void timingGroupFinished(int group)
Description copied from class: Display
This method is called when the display of the currently active timing group has been finished. It may be overridden by Display objects which need to do some clean up after a timing group has been finished.

Overrides:
timingGroupFinished in class Display
Parameters:
group - the index of the timing group which has been run.