提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
import com.iailab.netsdk.lib.structure.*; |
|
4 |
|
|
5 |
/** |
|
6 |
* 录播主机组合通道操作 |
|
7 |
* |
|
8 |
* @author : 47040 |
|
9 |
* @since : Created in 2020/9/28 19:49 |
|
10 |
*/ |
|
11 |
public enum EM_COURSECOMPOSITE_OPERATE_TYPE { |
|
12 |
/** |
|
13 |
* 控制组合通道与逻辑通道,对应结构体 |
|
14 |
* pInParam = {@link NET_IN_COURSECOMPOSITE_LOCK_CONTROL} |
|
15 |
* pOutParam = {@link NET_OUT_COURSECOMPOSITE_LOCK_CONTROL} |
|
16 |
*/ |
|
17 |
EM_COURSECOMPOSITE_TYPE_LOCK_CONTROL(0, "控制组合通道与逻辑通道"), |
|
18 |
/** |
|
19 |
* 获取组合通道与逻辑通道的锁定信息,对应结构体 |
|
20 |
* pInParam = {@link NET_IN_COURSECOMPOSITE_GET_LOCKINFO} |
|
21 |
* pOutParam = {@link NET_OUT_COURSECOMPOSITE_GET_LOCKINFO} |
|
22 |
*/ |
|
23 |
EM_COURSECOMPOSITE_TYPE_GET_LOCKINFO(1, "获取组合通道与逻辑通道的锁定信息"), |
|
24 |
/** |
|
25 |
* 获取组合通道信息,对应结构体 |
|
26 |
* pInParam = {@link NET_IN_COURSECOMPOSITE_GET_INFO} |
|
27 |
* pOutParam = {@link NET_OUT_COURSECOMPOSITE_GET_INFO} |
|
28 |
*/ |
|
29 |
EM_COURSECOMPOSITE_TYPE_GET_INFO(2, "获取组合通道信息"), |
|
30 |
/** |
|
31 |
* 设置组合通道信息,对应结构体 |
|
32 |
* pInParam = {@link NET_IN_COURSECOMPOSITE_SET_INFO} |
|
33 |
* pOutParam = {@link NET_OUT_COURSECOMPOSITE_SET_INFO} |
|
34 |
*/ |
|
35 |
EM_COURSECOMPOSITE_TYPE_SET_INFO(3, "设置组合通道信息"), |
|
36 |
/** |
|
37 |
* 将组合通道信息更新到time时的信息,对应结构体 |
|
38 |
* pInParam = {@link NET_IN_COURSECOMPOSITE_UPDATE_INFO} |
|
39 |
* pOutParam = {@link NET_OUT_COURSECOMPOSITE_UPDATE_INFO} |
|
40 |
*/ |
|
41 |
EM_COURSECOMPOSITE_TYPE_UPDATE_INFO(4, "将组合通道信息更新到time时的信息"); |
|
42 |
|
|
43 |
private int value; |
|
44 |
private String note; |
|
45 |
|
|
46 |
EM_COURSECOMPOSITE_OPERATE_TYPE(int givenValue, String note) { |
|
47 |
this.value = givenValue; |
|
48 |
this.note = note; |
|
49 |
} |
|
50 |
|
|
51 |
public String getNote() { |
|
52 |
return note; |
|
53 |
} |
|
54 |
|
|
55 |
public int getValue() { |
|
56 |
return value; |
|
57 |
} |
|
58 |
|
|
59 |
public static String getNoteByValue(int givenValue) { |
|
60 |
for (EM_COURSECOMPOSITE_OPERATE_TYPE enumType : EM_COURSECOMPOSITE_OPERATE_TYPE.values()) { |
|
61 |
if (givenValue == enumType.getValue()) { |
|
62 |
return enumType.getNote(); |
|
63 |
} |
|
64 |
} |
|
65 |
return null; |
|
66 |
} |
|
67 |
|
|
68 |
public static int getValueByNote(String givenNote) { |
|
69 |
for (EM_COURSECOMPOSITE_OPERATE_TYPE enumType : EM_COURSECOMPOSITE_OPERATE_TYPE.values()) { |
|
70 |
if (givenNote.equals(enumType.getNote())) { |
|
71 |
return enumType.getValue(); |
|
72 |
} |
|
73 |
} |
|
74 |
return -1; |
|
75 |
} |
|
76 |
|
|
77 |
public static EM_COURSECOMPOSITE_OPERATE_TYPE getEnum(int value) { |
|
78 |
for (EM_COURSECOMPOSITE_OPERATE_TYPE e : EM_COURSECOMPOSITE_OPERATE_TYPE.values()) { |
|
79 |
if (e.getValue() == value) |
|
80 |
return e; |
|
81 |
} |
|
82 |
return EM_COURSECOMPOSITE_OPERATE_TYPE.EM_COURSECOMPOSITE_TYPE_LOCK_CONTROL; |
|
83 |
} |
|
84 |
} |