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 : public CameraEventListener {
public:
    void imageAdded(const std::shared_ptr<const CameraDevice>& sender,
                    const std::shared_ptr<const CameraImage>& image) override
    {
        std::cout << "Image Added. Name: " << image->getName()
                  << ", Type: " << static_cast<int>(image->getType())
                  << ", Format: " << static_cast<int>(image->getFormat())
                  << ", Size: " << image->getSize()
                  << ", ID: " << image->getId() << std::endl;
    }

    void imageStored(const std::shared_ptr<const CameraDevice>& sender,
                     const std::shared_ptr<const CameraImage>& image) override
    {
        std::cout << "Image Stored. Name: " << image->getName()
                  << ", Type: " << static_cast<int>(image->getType())
                  << ", Format: " << static_cast<int>(image->getFormat())
                  << ", Size: " << image->getSize()
                  << ", ID: " << image->getId() << std::endl;
    }

    void captureComplete(const std::shared_ptr<const CameraDevice>& sender,
                         const std::shared_ptr<const Capture>& capture) override
    {
        std::cout << "Capture Complete. Capture ID: " << capture->getId()
                  << std::endl;
    }

    void deviceDisconnected(const std::shared_ptr<const CameraDevice>& sender,
                            DeviceInterface inf) override
    {
        std::cout << "Device Disconnected." << std::endl;
    }

    void captureSettingsChanged(const std::shared_ptr<const CameraDevice>& sender,
                                const std::vector<std::shared_ptr<const CaptureSetting>>& newSettings) override
    {
        std::cout << "Capture Settings Changed." << std::endl;
        for (auto setting : newSettings) {
            std::cout << " " << setting->toString() << std::endl;
        }
    }
};

And register the event listener as follows:

std::shared_ptr<CameraEventListener> userEventListener =
    std::make_shared<UserEventListener>();
cameraDevice->addEventListener(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