FileDocCategorySizeDatePackage
DataSource.javaAPI DocJMF 2.1.1e3715Mon May 12 12:21:20 BST 2003com.sun.media.protocol.dsound

DataSource

public class DataSource extends BasicPushBufferDataSource implements CaptureDevice, RateConfigureable

Fields Summary
PushBufferStream[]
streams
DirectSoundStream
sourceStream
String
contentType
Time
duration
boolean
started
public static String
NAME
static String
ContentType
Constructors Summary
public DataSource()


      
	com.sun.media.JMFSecurityManager.checkCapture();
	contentType = ContentType;
	duration = DURATION_UNBOUNDED;
	sourceStream = new DirectSoundStream(this);
	streams = new PushBufferStream[1];
	streams[0] = sourceStream;
    
Methods Summary
public voidconnect()

	//	System.err.println("JavaSoundDataSource.connect()");
	if (sourceStream.isConnected())
	    return;

	if (getLocator() != null)
	    sourceStream.setFormat(DirectSoundStream.parseLocator(getLocator()));
	sourceStream.connect();
    
public voiddisconnect()

	//	System.err.println("JavaSoundDataSource.disconnect()");
	sourceStream.disconnect();
    
public javax.media.CaptureDeviceInfogetCaptureDeviceInfo()

	CaptureDeviceInfo cdi = CaptureDeviceManager.getDevice(NAME);
	return cdi;
    
public java.lang.StringgetContentType()

	//	System.err.println("JavaSoundDataSource.getContentType() ");
	return contentType;
    
public java.lang.ObjectgetControl(java.lang.String name)

	//	System.err.println("JavaSoundDataSource.getControl(): " + name);
	return sourceStream.getControl(name);
    
public java.lang.Object[]getControls()

	//	System.err.println("JavaSoundDataSource.getControls()");
	Object o[] = sourceStream.getControls();
	return o;
    
public javax.media.TimegetDuration()

	//	System.err.println("JavaSoundDataSource.getDuration()");
	return duration;
    
public javax.media.control.FormatControl[]getFormatControls()

	FormatControl fc[] = new FormatControl[1];
	fc[0] = (FormatControl)sourceStream.getControl("javax.media.control.FormatControl");
	return fc;
    
public javax.media.protocol.RateConfiguration[]getRateConfigurations()
Methods for the RateConfigurable interface.

	RateConfiguration config [] = { new OneRateConfig() };
	return config;
    
booleangetStarted()

	//	System.err.println("JavaSoundDataSource.getStarted()");
	return started;
    
public javax.media.protocol.PushBufferStream[]getStreams()

	//	System.err.println("JavaSoundDataSource.getStreams()");
	if (streams == null)
	    System.err.println(
		"DataSource needs to be connected before calling getStreams");
	return streams;
    
public javax.media.protocol.RateConfigurationsetRateConfiguration(javax.media.protocol.RateConfiguration config)

	return config;
    
public voidstart()

	//	System.err.println("JavaSoundDataSource.start()");
	sourceStream.start();
    
public voidstop()

	//	System.err.println("JavaSoundDataSource.stop()");
	sourceStream.stop();