Events

You can receive camera events of the connected camera using the CameraEventListener class.

Contents

Supported Camera Events

RICOH Camera USB SDK supports the following camera events:

Register Events

Override the virtual method corresponding to the event you want to receive in your derived class of CameraEventListener. You can also see Live View for an example of LiveViewFrameUpdated.

class UserEventListener : CameraEventListener
{
    public override void ImageAdded(CameraDevice sender, CameraImage image)
    {
        Console.WriteLine(
            "Image Added. Name: {0}, Type: {1}, Format: {2}, Size: {3}, " +
            "ID: {4}", image.Name, image.Type, image.Format, image.Size,
            image.ID);
    }
    public override void ImageStored(CameraDevice sender, CameraImage image)
    {
        Console.WriteLine(
            "Image Stored. Name: {0}, Type: {1}, Format: {2}, Size: {3}, " +
            "ID: {4}", image.Name, image.Type, image.Format, image.Size,
            image.ID);
    }
    public override void CaptureComplete(CameraDevice sender, Capture capture)
    {
        Console.WriteLine("Capture Complete. Capture ID: {0}", capture.ID);
    }
    public override void DeviceDisconnected(
        CameraDevice sender,
        DeviceInterface deviceInterface)
    {
        Console.WriteLine("Device Disconnected.");
    }
    public override void CaptureSettingsChanged(CameraDevice sender,
        List<CaptureSetting> newSettings)
    {
        Console.WriteLine("CaptureSettingsChanged:");
        foreach (var setting in newSettings)
        {
            if (setting is ShutterSpeed) {
                Console.WriteLine("  {0}", setting.ToString()); }
            else if (setting is WhiteBalance) {
                Console.WriteLine("  {0}", setting.ToString()); }
            else if (setting is FNumber) {
                Console.WriteLine("  {0}", setting.ToString()); }
            else if (setting is ISO) { 
                Console.WriteLine("  {0}", setting.ToString()); }
            else if (setting is ExposureCompensation) { 
                Console.WriteLine("  {0}", setting.ToString()); }
            else if (setting is ExposureProgram) { 
                Console.WriteLine("  {0}", setting.ToString()); }
            else if (setting is HyperOperationEnable) { 
                Console.WriteLine("  {0}", setting.ToString()); }
            else if (setting is UserCaptureSettingsMode) { 
                Console.WriteLine("  {0}", setting.ToString()); }
        }
    }
}

And register the event listener as follows:

CameraEventListener userEventListener = new UserEventListener();
cameraDevice.EventListeners.Add(userEventListener);

Registered events are called when corresponding events occur at CameraDevice.

Capture Settings Supported by CaptureSettingsChanged

The Capture Settings to be notified are as follows.

  • Aperture Value
  • Exposure Compensation
  • ISO Sensitivity Value
  • White Balance
  • Shutter Speed
  • Exposure Program
  • Hyper Operation Settings
  • User Capture Settings Mode

See Also