mirror of
https://github.com/AndroidAudioMods/ViPERFX_RE.git
synced 2026-10-12 02:18:07 +08:00
Pass disable reason to the app
This commit is contained in:
1 parent
173222774f
commit
01029501e2
3 files changed
+19
-3
No files matched your search
@@ -16,6 +16,8 @@ extern "C" {
|
||||
#define PARAM_GET_CONVOLUTION_KERNEL_ID 5
|
||||
#define PARAM_GET_DRIVER_VERSION_CODE 6
|
||||
#define PARAM_GET_DRIVER_VERSION_NAME 7
|
||||
#define PARAM_GET_DISABLE_REASON 8
|
||||
#define PARAM_GET_DISABLE_REASON_MESSAGE 9
|
||||
|
||||
// Param set
|
||||
#define PARAM_SET_UPDATE_STATUS 0x9002
|
||||
|
||||
@@ -214,6 +214,20 @@ int32_t ViperContext::handleGetParam(effect_param_t *pCmdParam, effect_param_t *
|
||||
*pReplySize = sizeof(effect_param_t) + pReplyParam->psize + vOffset + pReplyParam->vsize;
|
||||
return 0;
|
||||
}
|
||||
case PARAM_GET_DISABLE_REASON: {
|
||||
pReplyParam->status = 0;
|
||||
pReplyParam->vsize = sizeof(int32_t);
|
||||
*(int32_t *) (pReplyParam->data + vOffset) = static_cast<int32_t>(disableReason);
|
||||
*pReplySize = sizeof(effect_param_t) + pReplyParam->psize + vOffset + pReplyParam->vsize;
|
||||
return 0;
|
||||
}
|
||||
case PARAM_GET_DISABLE_REASON_MESSAGE: {
|
||||
pReplyParam->status = 0;
|
||||
pReplyParam->vsize = disableReasonMessage.size();
|
||||
memcpy(pReplyParam->data + vOffset, disableReasonMessage.c_str(), pReplyParam->vsize);
|
||||
*pReplySize = sizeof(effect_param_t) + pReplyParam->psize + vOffset + pReplyParam->vsize;
|
||||
return 0;
|
||||
}
|
||||
default: {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+3
-3
@@ -8,9 +8,9 @@
|
||||
|
||||
class ViperContext {
|
||||
public:
|
||||
enum class DisableReason {
|
||||
NONE,
|
||||
UNKNOWN,
|
||||
enum class DisableReason : int32_t {
|
||||
UNKNOWN = -1,
|
||||
NONE = 0,
|
||||
INVALID_FRAME_COUNT,
|
||||
INVALID_SAMPLING_RATE,
|
||||
INVALID_CHANNEL_COUNT,
|
||||
|
||||
Reference in new issue
Block a user