|
@@ -428,7 +428,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
public static CallingBedFragment mCallingBedFragment;
|
|
public static CallingBedFragment mCallingBedFragment;
|
|
|
|
|
|
//是否开启TTS语音播报
|
|
//是否开启TTS语音播报
|
|
- private boolean enableTTS = (Constants.TTS_STATUS == 2 && SharedPreferencesUtil.getIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.TtsOn)==1);
|
|
|
|
|
|
+ //private boolean enableTTS = false;
|
|
|
|
|
|
private CallATimeoutThread callATimeoutThread;
|
|
private CallATimeoutThread callATimeoutThread;
|
|
private List<CallListEntity> callListEntityList;
|
|
private List<CallListEntity> callListEntityList;
|
|
@@ -522,7 +522,8 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
serialPortUtil.setOnDataReceiveListener(this, this);
|
|
serialPortUtil.setOnDataReceiveListener(this, this);
|
|
setVolumePA(false);
|
|
setVolumePA(false);
|
|
setPowerLed("1");
|
|
setPowerLed("1");
|
|
- if (enableTTS) {
|
|
|
|
|
|
+
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().startSpeechThread();
|
|
SpeechUtil.getInstance().startSpeechThread();
|
|
} else {
|
|
} else {
|
|
startPalyPhonetics();
|
|
startPalyPhonetics();
|
|
@@ -650,6 +651,10 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
rvImportantMessage.setAdapter(importantMessageAdapter);
|
|
rvImportantMessage.setAdapter(importantMessageAdapter);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private boolean enableTTS() {
|
|
|
|
+ return Constants.TTS_STATUS == 2 && SharedPreferencesUtil.getIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.TtsOn)==1;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 删除指定的条目(change by waderson 20191108)
|
|
* 删除指定的条目(change by waderson 20191108)
|
|
* @param deleteEntity 被删除的实体
|
|
* @param deleteEntity 被删除的实体
|
|
@@ -674,7 +679,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -726,7 +731,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1030,7 +1035,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (null != loopVoice) {
|
|
if (null != loopVoice) {
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
//String sipAddress = callingEntity.getSipAddress();
|
|
//String sipAddress = callingEntity.getSipAddress();
|
|
@@ -1052,7 +1057,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
endCall();
|
|
endCall();
|
|
@@ -1082,7 +1087,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (null != loopVoice) {
|
|
if (null != loopVoice) {
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
if (StringUtils.notEmpty(sipAddress)) {
|
|
if (StringUtils.notEmpty(sipAddress)) {
|
|
@@ -1196,7 +1201,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (vRightCallInfo.getVisibility() == View.VISIBLE && sickBedInfo.equals(sickbedInformationList.get(position))) {
|
|
if (vRightCallInfo.getVisibility() == View.VISIBLE && sickBedInfo.equals(sickbedInformationList.get(position))) {
|
|
if (null == sickBedInfo || !StringUtils.listNotEmpty(sickbedInformationList)) return;
|
|
if (null == sickBedInfo || !StringUtils.listNotEmpty(sickbedInformationList)) return;
|
|
if (filterSipToast()) {
|
|
if (filterSipToast()) {
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
@@ -1286,7 +1291,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (vRightCallListInfo.getVisibility() == View.VISIBLE && callItemChooseEntity != null && callItemChooseEntity.equals(MyApplication.callEntityList.get(position))) {
|
|
if (vRightCallListInfo.getVisibility() == View.VISIBLE && callItemChooseEntity != null && callItemChooseEntity.equals(MyApplication.callEntityList.get(position))) {
|
|
//if (null == callItemChooseEntity) return;
|
|
//if (null == callItemChooseEntity) return;
|
|
if (filterSipToast() && !MyApplication.callEntityList.get(position).getType().equals(Constants.WSHROOM_CALL) && !MyApplication.callEntityList.get(position).getType().equals(Constants.ROOMHELP_CALL)) {
|
|
if (filterSipToast() && !MyApplication.callEntityList.get(position).getType().equals(Constants.WSHROOM_CALL) && !MyApplication.callEntityList.get(position).getType().equals(Constants.ROOMHELP_CALL)) {
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
@@ -1371,7 +1376,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (null != loopVoice) {
|
|
if (null != loopVoice) {
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1445,7 +1450,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
loopVoice.setVolumes(0f);
|
|
loopVoice.setVolumes(0f);
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
//安卓端接通电话,通知点阵屏,但要排除固定列表
|
|
//安卓端接通电话,通知点阵屏,但要排除固定列表
|
|
@@ -1499,7 +1504,8 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
case "call_4"://增援呼叫护士主机
|
|
case "call_4"://增援呼叫护士主机
|
|
case "call_6": //门口机呼叫护士主机
|
|
case "call_6": //门口机呼叫护士主机
|
|
if (isMySelfMachine(nurseHostID)) {//只有属于自己管的机器才能加进列表
|
|
if (isMySelfMachine(nurseHostID)) {//只有属于自己管的机器才能加进列表
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ LogUtil.d("speech", "enableTTS: " + enableTTS());
|
|
|
|
+ if (enableTTS()) {
|
|
//使用TTS播报
|
|
//使用TTS播报
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
startSpeak(udpEntity);
|
|
startSpeak(udpEntity);
|
|
@@ -1532,7 +1538,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
break;
|
|
break;
|
|
case "call_12": //总控制室呼叫护士主机
|
|
case "call_12": //总控制室呼叫护士主机
|
|
if (isMySelfMachine(nurseHostID)) {
|
|
if (isMySelfMachine(nurseHostID)) {
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
//使用TTS播报
|
|
//使用TTS播报
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
startSpeak(udpEntity);
|
|
startSpeak(udpEntity);
|
|
@@ -1558,7 +1564,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
case "call_14": //医生主机呼叫护士主机
|
|
case "call_14": //医生主机呼叫护士主机
|
|
Log.e("qqqq","nurseHostID "+nurseHostID);
|
|
Log.e("qqqq","nurseHostID "+nurseHostID);
|
|
if (isMySelfMachine(nurseHostID)) {
|
|
if (isMySelfMachine(nurseHostID)) {
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
//使用TTS播报
|
|
//使用TTS播报
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
|
|
startSpeak(udpEntity);
|
|
startSpeak(udpEntity);
|
|
@@ -1710,7 +1716,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (null != loopVoice) {
|
|
if (null != loopVoice) {
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1793,7 +1799,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
//if (null != loopVoice) {
|
|
//if (null != loopVoice) {
|
|
// loopVoice.setPalyDismiss(true);
|
|
// loopVoice.setPalyDismiss(true);
|
|
//}
|
|
//}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
for (int i = 0; i < PalyPhonetics.speakEntityList.size(); i++) {
|
|
for (int i = 0; i < PalyPhonetics.speakEntityList.size(); i++) {
|
|
@@ -1956,7 +1962,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (null != loopVoice) {
|
|
if (null != loopVoice) {
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1993,7 +1999,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
if (null != loopVoice) {
|
|
if (null != loopVoice) {
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -2386,7 +2392,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
endCall(); //否则就挂断电话!
|
|
endCall(); //否则就挂断电话!
|
|
@@ -2412,7 +2418,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
|
|
loopVoice.setPalyDismiss(true);
|
|
loopVoice.setPalyDismiss(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (enableTTS) {
|
|
|
|
|
|
+ if (enableTTS()) {
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
SpeechUtil.getInstance().stopSpeak();
|
|
}
|
|
}
|
|
endCall(); //挂断电话!
|
|
endCall(); //挂断电话!
|