|
@@ -1,6 +1,6 @@
|
|
|
package com.wdkl.app.ncs.callingdoor.fragment
|
|
|
|
|
|
-import android.os.Build
|
|
|
+import android.app.zhyl.ZhylManager
|
|
|
import android.os.Handler
|
|
|
import android.os.Looper
|
|
|
import android.os.SystemClock
|
|
@@ -14,10 +14,11 @@ import com.wdkl.app.ncs.callingdoor.R
|
|
|
import com.wdkl.app.ncs.callingdoor.activity.CallingdoorActivity
|
|
|
import com.wdkl.app.ncs.callingdoor.helper.DoorLightHelper
|
|
|
import com.wdkl.app.ncs.callingdoor.helper.SerialPortHelper
|
|
|
-import com.wdkl.ncs.android.lib.utils.RingPlayHelper
|
|
|
import com.wdkl.app.ncs.callingdoor.helper.VoiceManagerUtil
|
|
|
+import com.wdkl.ncs.android.lib.base.BaseApplication
|
|
|
import com.wdkl.ncs.android.lib.settings.SettingConfig
|
|
|
import com.wdkl.ncs.android.lib.utils.AppTool
|
|
|
+import com.wdkl.ncs.android.lib.utils.RingPlayHelper
|
|
|
import com.wdkl.ncs.android.lib.utils.showMessage
|
|
|
import com.wdkl.ncs.android.middleware.common.Constant
|
|
|
import com.wdkl.ncs.android.middleware.common.MessageEvent
|
|
@@ -67,6 +68,9 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
private var speakerMute = false
|
|
|
private var micMute: Boolean = false // 是否关闭麦克风
|
|
|
private var volume = 60
|
|
|
+ private var mic_num = 24
|
|
|
+ private var horn_num = 140
|
|
|
+
|
|
|
|
|
|
override fun getLayId(): Int {
|
|
|
return R.layout.sky_voice_call_layout
|
|
@@ -80,12 +84,21 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
initCountDownTimer(sky_voice_call_timeout)
|
|
|
|
|
|
volume = SettingConfig.getExtensionCallVolume(activity)
|
|
|
+
|
|
|
+ mic_num = ZhylManager.getInstance(BaseApplication.appContext).sys_getMic1gain(BaseApplication.appContext)
|
|
|
+ horn_num = ZhylManager.getInstance(BaseApplication.appContext).sys_getDacVolume(BaseApplication.appContext)
|
|
|
if (volume < 0 || volume > 100) {
|
|
|
volume = 60
|
|
|
}
|
|
|
call_volume_bar.progress = volume/10
|
|
|
tv_volume.text = "" + volume/10
|
|
|
|
|
|
+ call_mic_bar.progress = mic_num
|
|
|
+ tv_mic.text = mic_num.toString()
|
|
|
+
|
|
|
+ call_lab_bar.progress = horn_num
|
|
|
+ tv_lab.text = horn_num.toString()
|
|
|
+
|
|
|
VoiceManagerUtil.setCallVoice(activity, volume)
|
|
|
|
|
|
//tcp参数
|
|
@@ -212,7 +225,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
|
|
|
sky_voice_call_speaker.setOnClickListener {
|
|
|
speakerMute = !speakerMute
|
|
|
- Log.d(TAG,"Speaker enable: $speakerMute")
|
|
|
+ Log.d(TAG, "Speaker enable: $speakerMute")
|
|
|
|
|
|
WebRTCEngine.getInstance().setVolumeMute(speakerMute)
|
|
|
sky_voice_call_speaker.isSelected = speakerMute
|
|
@@ -220,13 +233,13 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
|
|
|
sky_voice_call_mute.setOnClickListener {
|
|
|
micMute = !micMute
|
|
|
- Log.d(TAG,"静音切换: $micMute")
|
|
|
+ Log.d(TAG, "静音切换: $micMute")
|
|
|
|
|
|
WebRTCEngine.getInstance().muteAudio(micMute)
|
|
|
sky_voice_call_mute.isSelected = micMute
|
|
|
}
|
|
|
|
|
|
- call_volume_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
|
+ call_volume_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
|
|
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
|
|
tv_volume.text = "" + progress
|
|
|
if (seekBar!!.progress <= 1) {
|
|
@@ -244,7 +257,54 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
if (seekBar!!.progress <= 2) {
|
|
|
VoiceManagerUtil.setCallVoice(activity, 20)
|
|
|
} else {
|
|
|
- VoiceManagerUtil.setCallVoice(activity, seekBar.progress*10)
|
|
|
+ VoiceManagerUtil.setCallVoice(activity, seekBar.progress * 10)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ call_mic_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
|
|
+ override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
|
|
+ tv_mic.text = "" + progress
|
|
|
+ if (seekBar!!.progress <= 1) {
|
|
|
+ tv_mic.text = "1"
|
|
|
+ } else {
|
|
|
+ tv_mic.text = "" + progress
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStartTrackingTouch(seekBar: SeekBar?) {
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStopTrackingTouch(seekBar: SeekBar?) {
|
|
|
+ if (seekBar!!.progress <= 2) {
|
|
|
+ ZhylManager.getInstance(BaseApplication.appContext).sys_setMic1gain(BaseApplication.appContext, 2)
|
|
|
+ } else {
|
|
|
+ ZhylManager.getInstance(BaseApplication.appContext).sys_setMic1gain(BaseApplication.appContext, seekBar.progress)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ call_lab_bar.progress = horn_num
|
|
|
+ tv_lab.text = horn_num.toString()
|
|
|
+ call_lab_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
|
|
+ override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
|
|
+ tv_lab.text = "" + progress
|
|
|
+ if (seekBar!!.progress <= 1) {
|
|
|
+ tv_lab.text = "1"
|
|
|
+ } else {
|
|
|
+ tv_lab.text = "" + progress
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStartTrackingTouch(seekBar: SeekBar?) {
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStopTrackingTouch(seekBar: SeekBar?) {
|
|
|
+ if (seekBar!!.progress <= 2) {
|
|
|
+ ZhylManager.getInstance(BaseApplication.appContext).sys_setDacVolume(BaseApplication.appContext, 2)
|
|
|
+ } else {
|
|
|
+ ZhylManager.getInstance(BaseApplication.appContext).sys_setDacVolume(BaseApplication.appContext, seekBar.progress)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -614,7 +674,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
|
|
|
}
|
|
|
|
|
|
override fun didUserLeave(userId: BigInteger?) {
|
|
|
- Log.w(TAG, "didUserLeave:"+userId)
|
|
|
+ Log.w(TAG, "didUserLeave:" + userId)
|
|
|
handler.post {
|
|
|
callEnd(true)
|
|
|
}
|