コード例 #1
0
	void DeviceSettings::RestoreFromDictionary(Device& device, const CFDictionaryRef dictionary, const ControlInfo* controlsToRestore, UInt32 numberControlsToRestore)
	{

		if (dictionary != NULL)
		{
			// Take and hold the device's state guard while we do this to prevent notifications from Interupting the full completion of this routine.
			CAMutex::Locker deviceStateMutex(device.GetStateMutex());
		
			CACFDictionary settings(dictionary, false);
			
			// Restore the device settings
			DeviceSettings_RestoreDeviceSettings(device, settings, kCMIODevicePropertyScopeInput, controlsToRestore, numberControlsToRestore);
			DeviceSettings_RestoreDeviceSettings(device, settings, kCMIODevicePropertyScopeOutput, controlsToRestore, numberControlsToRestore);
		
			// Restore the stream settings
			DeviceSettings_RestoreStreamSettings(device, settings, kCMIODevicePropertyScopeInput, controlsToRestore, numberControlsToRestore);
			DeviceSettings_RestoreStreamSettings(device, settings, kCMIODevicePropertyScopeOutput, controlsToRestore, numberControlsToRestore);
		}
	}