KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inzyme > jmds > DSCaptureDeviceInfo


1 package com.inzyme.jmds;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5
6 /**
7  * DSCaptureDeviceInfo contains metadata about a particular DirectShow
8  * capture device.
9  *
10  * @author Mike Schrag
11  */

12 public class DSCaptureDeviceInfo {
13     private String JavaDoc myName;
14     private String JavaDoc myDevicePath;
15     private DSCapturePin[] myPins;
16     
17     /**
18      * Constructs a DSCaptureDeviceInfo.
19      *
20      * @param _devicePath the Windows device path to the capture device
21      * @param _name the display name of this device (only used for cosmetics)
22      */

23     public DSCaptureDeviceInfo(String JavaDoc _devicePath, String JavaDoc _name) {
24         myDevicePath = _devicePath;
25         myName = _name;
26     }
27     
28     /**
29      * Returns the device path of this capture device.
30      *
31      * @return the device path of this capture device
32      */

33     public String JavaDoc getDevicePath() {
34         return myDevicePath;
35     }
36     
37     /**
38      * Returns the displayable name of this capture device.
39      *
40      * @return the displayable name of this capture device
41      */

42     public String JavaDoc getName() {
43         return myName;
44     }
45     
46     /**
47      * Returns an array of pins that are available on this capture device.
48      *
49      * @return this capture device's pins
50      */

51     public DSCapturePin[] getPins() {
52         if (myPins == null) {
53             List JavaDoc pinsList = new ArrayList JavaDoc();
54             fillInPins(pinsList);
55             myPins = (DSCapturePin[])pinsList.toArray(new DSCapturePin[pinsList.size()]);
56         }
57         return myPins;
58     }
59     
60     private native void fillInPins(List JavaDoc _pinsList);
61     
62     public String JavaDoc toString() {
63         return "[DSCaptureDeviceInfo: devicePath = " + myDevicePath + "; name = " + myName + "]";
64     }
65 }
66
Popular Tags