Razer Chroma SDK
Razer Chroma SDK Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
RzChromaSDK.h File Reference

Exported APIs. More...

#include "RzErrors.h"
#include "RzChromaSDKDefines.h"
#include "RzChromaSDKTypes.h"

Go to the source code of this file.

Functions

RZRESULT Init (void)
 
RZRESULT UnInit (void)
 
RZRESULT CreateEffect (RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId)
 
RZRESULT CreateKeyboardEffect (ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId)
 
RZRESULT CreateMouseEffect (ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId)
 
RZRESULT CreateHeadsetEffect (ChromaSDK::Headset::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId)
 
RZRESULT CreateMousepadEffect (ChromaSDK::Mousepad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId)
 
RZRESULT CreateKeypadEffect (ChromaSDK::Keypad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId)
 
RZRESULT DeleteEffect (RZEFFECTID EffectId)
 
RZRESULT SetEffect (RZEFFECTID EffectId)
 
RZRESULT RegisterEventNotification (HWND hWnd)
 
RZRESULT UnregisterEventNotification ()
 
RZRESULT QueryDevice (RZDEVICEID DeviceId, DEVICE_INFO_TYPE &DeviceInfo)
 

Detailed Description

Exported APIs.

Function Documentation

RZRESULT CreateEffect ( RZDEVICEID  DeviceId,
ChromaSDK::EFFECT_TYPE  Effect,
PRZPARAM  pParam,
RZEFFECTID pEffectId 
)

Create generic effect for specific or all devices.

Parameters
[in]DeviceIdDevice Id defined in RzChromaSDKDefines.h
[in]EffectStandard effect type.
[in]pParamPointer to a parameter type specified by Effect.
[in,out]pEffectIdValid effect Id if successful. Set it to NULL if not required.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_INVALID_PARAMETER: Invalid parameter.
RZRESULT_DEVICE_NOT_AVAILABLE: Device not supported.
RZRESULT_NOT_SUPPORTED: Effect not supported for this device.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT CreateHeadsetEffect ( ChromaSDK::Headset::EFFECT_TYPE  Effect,
PRZPARAM  pParam,
RZEFFECTID pEffectId 
)

Create headset effect.

Parameters
[in]EffectHeadset effect type.
[in]pParamPointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h
[in,out]pEffectIdValid effect Id if successful. Set it to NULL if not required.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_INVALID_PARAMETER: Invalid parameter.
RZRESULT_NOT_SUPPORTED: Effect not supported for this device.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT CreateKeyboardEffect ( ChromaSDK::Keyboard::EFFECT_TYPE  Effect,
PRZPARAM  pParam,
RZEFFECTID pEffectId 
)

Create keyboard effect.

Parameters
[in]EffectKeyboard effect type.
[in]pParamPointer to a parameter type specified by Effect.
[in,out]pEffectIdValid effect Id if successful. Set it to NULL if not required.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_INVALID_PARAMETER: Invalid parameter.
RZRESULT_NOT_SUPPORTED: Effect not supported for this device.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT CreateKeypadEffect ( ChromaSDK::Keypad::EFFECT_TYPE  Effect,
PRZPARAM  pParam,
RZEFFECTID pEffectId 
)

Create keypad effect.

Parameters
[in]EffectKeypad effect type.
[in]pParamPointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h
[in,out]pEffectIdValid effect Id if successful. Set it to NULL if not required.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_INVALID_PARAMETER: Invalid parameter.
RZRESULT_NOT_SUPPORTED: Effect not supported for this device.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT CreateMouseEffect ( ChromaSDK::Mouse::EFFECT_TYPE  Effect,
PRZPARAM  pParam,
RZEFFECTID pEffectId 
)

Create mouse effect.

Parameters
[in]EffectMouse effect type.
[in]pParamPointer to a parameter type specified by Effect.
[in,out]pEffectIdValid effect Id if successful. Set it to NULL if not required.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_INVALID_PARAMETER: Invalid parameter.
RZRESULT_NOT_SUPPORTED: Effect not supported for this device.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT CreateMousepadEffect ( ChromaSDK::Mousepad::EFFECT_TYPE  Effect,
PRZPARAM  pParam,
RZEFFECTID pEffectId 
)

Create mousepad effect.

Parameters
[in]EffectMousemat effect type.
[in]pParamPointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h
[in,out]pEffectIdValid effect Id if successful. Set it to NULL if not required.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_INVALID_PARAMETER: Invalid parameter.
RZRESULT_NOT_SUPPORTED: Effect not supported for this device.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT DeleteEffect ( RZEFFECTID  EffectId)

Delete effect

Parameters
[in]EffectIdId of the effect that needs to be deleted.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_NOT_FOUND: Effect Id not found.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT Init ( void  )

Initialize Chroma SDK.

Returns
RZRESULT_SERVICE_NOT_ACTIVE: Chroma SDK Service not running.
RZRESULT_ALREADY_INITIALIZED: Chroma SDK has already been initialized.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT QueryDevice ( RZDEVICEID  DeviceId,
DEVICE_INFO_TYPE DeviceInfo 
)

Query for device information.

Parameters
[in]DeviceIdDevice id found in RzChromaSDKDefines.h
[out]DeviceInfoContains device information specified by DeviceId.
Returns
RZRESULT_DEVICE_NOT_AVAILABLE: Device not supported.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT RegisterEventNotification ( HWND  hWnd)

Register for event notification.

Parameters
[in]hWndApplication window handle.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_ALREADY_INITIALIZED: Invalid Windows handle.
RZRESULT_INVALID_PARAMETER: Invalid parameter.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Remarks
WM_CHROMA_EVENT will be sent if there is an event.
  • wParam = 1 : Chroma SDK support.
    • lParam = 1 : Enabled.
    • lParam = 0 : Disabled.
  • wParam = 2 : Access to device.
    • lParam = 1 : Granted accessible.
    • lParam = 0 = Access revoked.
  • wParam = 3 : Application state.
    • lParam = 1 : Enabled.
    • lParam = 0 = Disabled.
RZRESULT SetEffect ( RZEFFECTID  EffectId)

Set effect.

Parameters
[in]EffectIdId of the effect that needs to be set.
Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()?
RZRESULT_ACCESS_DENIED: No permision to access device.
RZRESULT_NOT_FOUND: Effect Id not found.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT UnInit ( void  )

UnInitialize Chroma SDK.

Returns
RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. For every Init() call there should be a corresponding UnInit().
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).
Examples:
ChromaSDKImpl.cpp.
RZRESULT UnregisterEventNotification ( )

Un-register for event notification.

Returns
RZRESULT_NOT_VALID_STATE: Internal state is not valid. There was no event registered.
For other error codes, please refer to Windows System Error Codes from Windows SDK (WinError.h).