com.bruxton.sidx
Class SIDX

java.lang.Object
  extended by com.bruxton.sidx.SIDX

public class SIDX
extends java.lang.Object

Represent the entire SIDX interface.

Each instance of SIDX can handle multiple cameras.


Constructor Summary
SIDX()
           
 
Method Summary
 void close()
          Close the instance of SIDX.
 Camera configureCamera(java.lang.String settings)
          Open and configure a camera.
 Camera dialogCamera(Integer canceled)
          Display a dialog for choosing a camera from the available cameras list on the running system.
 java.lang.String getCameraID(int index)
          Given the index of a camera, the function returns the camera ID which can be used for setting up the connection to a camera.
 int getCameras()
          Return the number of cameras that are connected to the system from all vendors that SIDX supports, including a Bruxton Demonstration camera which is a software-emulated camera and requires no hardware.
 java.lang.String getStatusText(int error)
          Given an error code, the function returns the error message.
 Camera openCamera(java.lang.String cameraIdentification)
          Open a camera with the default settings.
 Camera restoreDefaultSettings()
          Restore the settings from the default settings file "default.sidx" from the file system directory that services as a common repository for the application-specific data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SIDX

public SIDX()
     throws Exception
Throws:
Exception
Method Detail

close

public void close()
Close the instance of SIDX. A call to this function should be explicitly made when terminating SIDX.

Throws:
Exception

openCamera

public Camera openCamera(java.lang.String cameraIdentification)
                  throws Exception
Open a camera with the default settings.

Parameters:
cameraIdentification - the identification for the camera to open. The identification indicates the driver that the camera uses and a specific camera index or name for the driver to locate the camera on the system. The format of a camera identification is shown in Camera identification in SIDX. If identification is not supplied, SIDX will look for a vendor and a camera chosen by using dialogCamera. The function will open the chosen camera. Or otherwise an exception will be thrown.
Returns:
the new camera object with the defualt settings. The application can use the camera object to control the corresponding camera.
Throws:
Exception

configureCamera

public Camera configureCamera(java.lang.String settings)
                       throws Exception
Open and configure a camera.

Parameters:
settings - the settings in XML format for the opening camera.
Returns:
the new camera object with the settings set to the specified values. The application can use the camera object to control the corresponding camera.
Throws:
Exception

dialogCamera

public Camera dialogCamera(Integer canceled)
                    throws Exception
Display a dialog for choosing a camera from the available cameras list on the running system.

Returns:
true if the dialog is canceled. Otherwise false.
Throws:
Exception

getCameras

public int getCameras()
               throws Exception
Return the number of cameras that are connected to the system from all vendors that SIDX supports, including a Bruxton Demonstration camera which is a software-emulated camera and requires no hardware.

Returns:
the number of cameras available.
Throws:
Exception

getCameraID

public java.lang.String getCameraID(int index)
                             throws Exception
Given the index of a camera, the function returns the camera ID which can be used for setting up the connection to a camera. The function should be called after the function getCameras. Both you and SIDX will not know how many cameras are available on the running system until the function getCameras is called.

Parameters:
index - the index of a camera. It has to be less than the camera count returned by getCameras.
Returns:
the camera ID as a string.
Throws:
Exception

restoreDefaultSettings

public Camera restoreDefaultSettings()
                              throws Exception
Restore the settings from the default settings file "default.sidx" from the file system directory that services as a common repository for the application-specific data. A typical path under Windows is c:\\Documents and Settings\\username\\Application Data.

Throws:
Exception

getStatusText

public java.lang.String getStatusText(int error)
                               throws Exception
Given an error code, the function returns the error message.

Parameters:
error - the error code.
Returns:
the error message regarding the error code.
Throws:
Exception