mv_plugin_config.h File Reference

API functions for plugin configuration. More...

Functions

MVLibExport MVCode_t MV_PluginUserParameterDescription_AddUserParameter (MVPluginUserParameterDescription_t description, const char *parameter, MVValue_t value)
 Adds a user parameter with the unique identifier param to description. More...
 
MVLibExport MVCode_t MV_PluginUserParameterDescription_SetPresentationProperty (MVPluginUserParameterDescription_t description, const char *parameter, MVPluginParameterPresentationProperty_t property, MVValue_t value)
 Specifies how the user parameter is presented to the user in the configuration interface. More...
 
MVLibExport MVCode_t MV_PluginUserParameterDescription_ImposeConstraint (MVPluginUserParameterDescription_t description, const char *parameter, MVPluginParameterConstraint_t constraint, MVValue_t value)
 Enforces the user parameter values to meet certain requirements. More...
 
MVLibExport MVCode_t MV_PluginConfig_GetParameter (MVPluginConfig_t config, uint32_t parameter, MVValue_t *pValue)
 Gets a parameter value from a plug-in configuration. More...
 
MVLibExport MVCode_t MV_PluginConfig_GetUserParameter (MVPluginConfig_t config, const char *parameter, MVValue_t *pValue)
 Retrieves the currently set value of a user parameter stored in the given configuration. More...
 
MVLibExport MVCode_t MV_PluginConfigValidation_SetMessage (MVPluginConfigValidation_t validation, MVPluginConfigValidationErrorState_t level, const char *message)
 Sets a message for the configuration. More...
 
MVLibExport MVCode_t MV_PluginConfigValidation_DisableUserParameter (MVPluginConfigValidation_t validation, const char *parameter)
 Marks a user parameter as disabled. More...
 
MVLibExport MVCode_t MV_PluginConfigValidation_SetUserParameterErrorState (MVPluginConfigValidation_t validation, const char *parameter, MVPluginConfigValidationErrorState_t level)
 Sets the error state of a user parameter. More...
 

Detailed Description

API functions for plugin configuration.

Function Documentation

◆ MV_PluginConfig_GetParameter()

MVLibExport MVCode_t MV_PluginConfig_GetParameter ( MVPluginConfig_t  config,
uint32_t  parameter,
MVValue_t pValue 
)

Gets a parameter value from a plug-in configuration.

Parameters
[in]configis the MVPluginConfig_t that is queried.
[in]parameteridentifies the parameter which is retrieved from the plug-in's configuration. Currently, only the plug-in access level can be retrieved through MV_PARAM_CONFIG_ACCESS_LEVEL.
[out]pValuepoints to a MVValue_t which is then initialized to a copy of the desired plug-in configuration parameter.
Returns
  • MV_CODE_OK pValue was successfully initialized to a copy of the specified parameter. It is the caller's obligation to destroy the value by MV_Value_Clear().
  • MV_CODE_INV_HANDLE One of the following:
    • The config is NULL. Make sure to pass the handle which has been retrieved from MV_Plugin_GetConfig().
    • The pointer pValue is NULL. Make sure it points to an uninitialized variable of type MVValue_t.
  • MV_CODE_INV_PARAM The queried parameter key does not apply to plug-in configurations.

◆ MV_PluginConfig_GetUserParameter()

MVLibExport MVCode_t MV_PluginConfig_GetUserParameter ( MVPluginConfig_t  config,
const char *  parameter,
MVValue_t pValue 
)

Retrieves the currently set value of a user parameter stored in the given configuration.

Parameters
[in]configis the MVPluginConfig_t that is queried.
[in]parameteridentifies the user parameter whose value is retrieved.
[out]pValuepoints to the MVValue_t in which the parameter value is stored.
Returns

◆ MV_PluginConfigValidation_DisableUserParameter()

MVLibExport MVCode_t MV_PluginConfigValidation_DisableUserParameter ( MVPluginConfigValidation_t  validation,
const char *  parameter 
)

Marks a user parameter as disabled.

Disabled parameters cannot be interacted with. They are commonly displayed grayed out. This could be used, for example, when the value of a different parameter invalidates this parameter or when the parameter in question only applies to certain models of a hardware device and does not apply to the connected device.

Parameters
[in]validationis the validation structure accumulating the validation results.
[in]parameteris the identifier of the parameter that is marked as disabled.
Returns
  • MV_CODE_OK The specified user parameter is now marked as disabled.
  • MV_CODE_INV_HANDLE The validation is NULL. Make sure to pass the handle which MVValidate has been called with.
  • MV_CODE_UNK_USERPARAM The queried user parameter has not been exposed to the user parameter description.

◆ MV_PluginConfigValidation_SetMessage()

MVLibExport MVCode_t MV_PluginConfigValidation_SetMessage ( MVPluginConfigValidation_t  validation,
MVPluginConfigValidationErrorState_t  level,
const char *  message 
)

Sets a message for the configuration.

The message refers to the plug-in configuration in its entirety. A faulty plug-in configuration, involving one or multiple parameter values, is marked with with a warning or error symbol in the configuration interface.

Parameters
[in]validationis the validation structure accumulating the validation results.
[in]levelis the error level.
[in]messageis the UTF-8 encoded string representing the message.
Returns
  • MV_CODE_OK The message was successfully stored in the validation object.
  • MV_CODE_INV_HANDLE The validation is NULL. Make sure to pass the handle which MVValidate has been called with.
  • MV_CODE_FAILED The error level is not valid.

◆ MV_PluginConfigValidation_SetUserParameterErrorState()

MVLibExport MVCode_t MV_PluginConfigValidation_SetUserParameterErrorState ( MVPluginConfigValidation_t  validation,
const char *  parameter,
MVPluginConfigValidationErrorState_t  level 
)

Sets the error state of a user parameter.

Erroneous parameters are marked with a warning or error symbol in the configuration interface.

It is recommended to subsequently call MV_PluginConfigValidation_SetMessage() with the same error level to give a detailed explanation about the issue.

Parameters
[in]validationis the validation structure accumulating the validation results.
[in]parameteris the identifier of the user parameter that is marked as erroneous.
[in]levelis the error level.
Returns
  • MV_CODE_OK The specified user parameter's error state was successfully set.
  • MV_CODE_INV_HANDLE The validation is NULL. Make sure to pass the handle which MVValidate has been called with.
  • MV_CODE_FAILED The error level is not valid.
  • MV_CODE_UNK_USERPARAM The queried user parameter has not been exposed to the user parameter description.

◆ MV_PluginUserParameterDescription_AddUserParameter()

MVLibExport MVCode_t MV_PluginUserParameterDescription_AddUserParameter ( MVPluginUserParameterDescription_t  description,
const char *  parameter,
MVValue_t  value 
)

Adds a user parameter with the unique identifier param to description.

The operation is performed instantly and the parameter description is changed accordingly.

Parameters
[in]descriptionis the MVPluginUserParameterDescription_t to which the parameter is added.
[in]parameteris the unique identifier for the parameter.
[in]valueis the default value for the parameter. Only scalar values of numeric types, boolean, or string are supported.
Returns

◆ MV_PluginUserParameterDescription_ImposeConstraint()

MVLibExport MVCode_t MV_PluginUserParameterDescription_ImposeConstraint ( MVPluginUserParameterDescription_t  description,
const char *  parameter,
MVPluginParameterConstraint_t  constraint,
MVValue_t  value 
)

Enforces the user parameter values to meet certain requirements.

Remarks
Note that imposing a constraint replaces any existing constraint.
Parameters
[in]descriptionis the MVPluginUserParameterDescription_t containing the parameter
[in]parameteris the unique identifier for the parameter.
[in]constraintis the type of constraint that is enforced.
[in]valuecontains the value(s) for the constraint. The exact format depends on the constraint. See the documentation of MVPluginParameterConstraint_t for the required format.
Returns

◆ MV_PluginUserParameterDescription_SetPresentationProperty()

MVLibExport MVCode_t MV_PluginUserParameterDescription_SetPresentationProperty ( MVPluginUserParameterDescription_t  description,
const char *  parameter,
MVPluginParameterPresentationProperty_t  property,
MVValue_t  value 
)

Specifies how the user parameter is presented to the user in the configuration interface.

Depending on the enum value of the property parameter, one of the following presentation properties can be manipulated:

  • eMVPluginParameterPresentationProperty_DisplayName: The user-facing name of the parameter which is displayed in a graphical configuration window. value is a scalar String value.
  • eMVPluginParameterPresentationProperty_Prefix: The text of a label which is supposed to be displayed in front of the actual parameter value. Can be used for currency symbols. value is a scalar String value.
  • eMVPluginParameterPresentationProperty_Suffix: The text of a label which is supposed to be displayed after the actual parameter value. Can be used for units. value is a scalar String value.
  • eMVPluginParameterPresentationProperty_Category: The category under which the parameter should be grouped. value is a scalar String value.
  • eMVPluginParameterPresentationProperty_PreferredWidget: The widget which should be used in the configuration UI to represent the parameter. value is a scalar UInt32 value corresponding to an enumerator in MVPluginParameterWidget_t.
Remarks
Repeatedly setting the same presentation property within the same call to MVExpose will replace its previous value.
Parameters
[in]descriptionis the MVPluginUserParameterDescription_t containing the parameter.
[in]parameteris the unique identifier for the parameter.
[in]propertyis the presentation property that is changed
[in]valuecontains the value for the presentation property. The exact format depends on the property. See documentation of MVPluginParameterPresentationProperty_t for the required format.
Returns