FileDocCategorySizeDatePackage
Handler.javaAPI DocJMF 2.1.1e5480Mon May 12 12:21:20 BST 2003com.sun.media.content.video.mpeg

Handler

public class Handler extends BasicPlayer
A MPEG player implementation for windows that runs on top of Active Movie.

Fields Summary
private DefaultControlPanel
controlPanel
Variables
protected AMController
amController
private boolean
justDeallocated
Constructors Summary
public Handler()
Methods


    //private TimeBase masterTimeBase = mixerTimeBase;

          
    
      
    
Methods Summary
public booleanaudioEnabled()

	return amController.audioEnabled();
    
protected booleanconnectNodes()

	//addControls(amController.getControls());
	return true;
    
protected voidcreateGainControl()

	// called by MediaPlayer.doRealize()
    
public voiddoClose()

	/*
	if (controlPanel != null)
	    controlPanel.dispose();
	controlPanel = null;
	*/
	super.doClose();
	amController = null;
    
protected voiddoDeallocate()

	super.doDeallocate();
	justDeallocated = true;
    
protected booleandoPrefetch()

	if (justDeallocated) {
	    setMediaTime(new Time(0));
	    justDeallocated = false;
	}
	return super.doPrefetch();
    
protected synchronized booleandoRealize()

	boolean returnVal = super.doRealize();

	if (!returnVal)
	    return false;
	/*
	if (audioEnabled()) {
	    gainControl = new GainCA(false);
	    gainControl.addGainChangeListener( this );
	}
	// set rate control to null if player plays only AUDIO since
	// we dont support audio rate control  
	if ((rateControl != null) && (audioEnabled()) && (!videoEnabled()))
	    rateControl = null;
	
	if (regionControl != null)
	    regionControl.setEnable(false);
	Time dur = amController.getDuration();
	if (dur != null)
	    setMediaLength(dur.getNanoseconds());
	*/
	return true;
    
public java.awt.ComponentgetControlPanelComponent()
Get the Component with the default user interface for controlling this player. If this player has no default control panel null is returned.

return
the default control panel GUI.

	return super.getControlPanelComponent();
    
public javax.media.GainControlgetGainControl()
Get the object for controlling audio gain. Returns null if this player does not have a GainControl (e.g. no audio).

return
the GainControl object for this player.

	return super.getGainControl();
    
protected javax.media.TimeBasegetMasterTimeBase()

	return amController.getTimeBase();
    
public java.awt.ComponentgetVisualComponent()
Get the Component this player will output its visual media to. If this player has no visual component (e.g. audio only) getVisualComponent() will return null.

return
the media display component.

	if (state == Unrealized || state == Realizing)
	    throw new javax.media.NotRealizedError("Cannot get visual component from an unrealized player.");
	return amController.getVisualComponent();
    
public voidsetSource(javax.media.protocol.DataSource source)

	//if (BuildInfo.usePureJava()) {
	//  throw new IncompatibleSourceException(this + " : does not support mpeg on this platform.");
	//}
	super.setSource(source);
	try {
	    if (amController == null) {
		amController = new AMController(this);
		amController.setSource(source);
		manageController(amController);
	    }
	} catch (Exception e) {
	    throw new IncompatibleSourceException(e.getMessage());
	}
    
public voidupdateStats()

    
public booleanvideoEnabled()

	return amController.videoEnabled();