Psdk_Ui.c
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "Psdk_Ui.h"
#include "JZsdkLib.h"
#include "ExtensionAPI/JZsdk_ExpansionApi.h"
/****************
*
* 控件设置
*
* *************/
static T_JZsdkReturnCode UI_control_WidgetArraySet(int index, int value)
{
T_JZsdkToPsdkHandler *handle = ExpansionApi_JZsdkToPsdk_GetHandler();
if (handle != NULL && handle->Set_UI_Widget_Value != NULL)
{
//将控件值设置到psdk的ui控件
handle->Set_UI_Widget_Value(index, value);
}
}
/****************
*
* 二级控件设置
*
* *************/
static T_JZsdkReturnCode UI_control_SecondaryWidgetArraySet(int type, int value)
{
T_JZsdkToPsdkHandler *handle = ExpansionApi_JZsdkToPsdk_GetHandler();
if (handle == NULL)
{
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
switch (type)
{
case PSDK_UI_SECONDARY_WIDGET_PLAYSTATUS:
if (handle->Set_UI_SpeakerWidget_PlayState != NULL)
{
return handle->Set_UI_SpeakerWidget_PlayState(value);
}
break;
case PSDK_UI_SECONDARY_WIDGET_LOOPPLAY:
if (handle->Set_UI_SpeakerWidget_LoopMode != NULL)
{
return handle->Set_UI_SpeakerWidget_LoopMode(value);
}
break;
case JZSDK_WIDGET_VOLUME://音量
if (handle->Set_UI_SpeakerWidget_Volume != NULL)
{
return handle->Set_UI_SpeakerWidget_Volume(value);
}
break;
default:
break;
}
}
static T_JZsdkReturnCode JZsdk_UI_DJIpsdk_Widget_set(JZsdk_Widget_Control index, int value)
{
switch (index)
{
case JZSDK_WIDGET_VOLUME:
{
//1、大疆音量控件需要去设置喊话器控件内的音量
UI_control_WidgetArraySet(3, value);
UI_control_WidgetArraySet(4, value);
//2、大疆音量控件需要去设置悬浮窗的音量
UI_control_SecondaryWidgetArraySet(JZSDK_WIDGET_VOLUME, value);
}
break;
default:
break;
}
}
T_JZsdkReturnCode JZsdk_UI_value_set(JZsdk_Widget_Control index, int value)
{
JZsdk_UI_DJIpsdk_Widget_set(index, value);
}