Grabber::saveDeviceState Method

Saves the state of the opened device. A saved state can be restored using loadDeviceState.
Syntax:
std::string saveDeviceState( bool bDevice = true, bool bGrabberDeviceSetup = true, bool bVCDProperties = true ) const;
std::wstring    saveDeviceStateW( bool bDevice = true, bool bGrabberDeviceSetup = true, bool bVCDProperties = true ) const;

Parameter Description
bDevice

When this parameter is set to true, the currently opened device's name and serial number are saved.

bGrabberDeviceSetup

When this parameter is set to true, the currently selected Video Norm, Video Format, Input Channel, FPS, FlipH and FlipV are saved.

bVCDProperties

When this parameter is set to true, the VCDProperties of the currently opened device are saved.

Return value:

Returns a string that contains the device settings. The string is formatted in XML. On error, an empty string is returned. Use Grabber::getLastError to verify whether or not an error occurred.

Information:

Introduced in version 2.0

Sample:

// Retrieve the device state.
std::wstring deviceState = m_Grabber.saveDeviceStateW();
MessageBox( deviceState.c_str(), L"Saved device state" );
// Close the device.
m_Grabber.closeDev();
// The device is now closed. Open the saved device.
m_Grabber.loadDeviceState( deviceState );
// Show live video again.
m_Grabber.startLive();

See also: loadDeviceState

<< Grabber