* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-05 15:20:02
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-06 16:30:51
+ * @LastEditTime: 2024-08-10 14:31:56
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/VolumeSettingPresenter.h
*/
#define VOLUME_VIEW "volumeview"
typedef enum : uint16_t {
- VOLUMEPHONE = 1,
- VOLUMEPLAYERS = 3,
+ VOLUMEPHONE = 1, //声音系数为:手机
+ VOLUMEPLAYERS = 3,//声音系数为音乐播放器
VOLUMEPHONENOTIFY = 4,
} VolumeFactor;
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-05 15:20:02
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-07 15:25:29
+ * @LastEditTime: 2024-08-10 14:29:29
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/VolumeSettingView.h
*/
public:
VolumeSettingView();
~VolumeSettingView();
- int16_t sounding{0};
+ int16_t sounding{0}; //音量值
UISlider *GetProgress(void);
bool SetUpVolume(void);
#include "notification_manager.h"
#include "BluetoothHeadsetEvent.h"
#include "bts_avrcp_controller.h"
+#include "ConfigModel.h"
namespace OHOS {
if (playerCoefficients == VOLUMEPLAYERS) {
BtAndLocalVolumeSet(volumeSettingView->sounding);
+ ConfigModel::GetInstance()->SetSystemVolume(volumeSettingView->sounding);/*将设置的音量保存到系统音量*/
}
if (playerCoefficients == VOLUMEPHONE || playerCoefficients == VOLUMEPHONENOTIFY) {
unsigned char volumeValue = (unsigned char) ((double) (volumeSettingView->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换
SetSpeakerVolume(volumeValue);
+ ConfigModel::GetInstance()->SetCallVolume(volumeSettingView->sounding);/*将设置的音量保存到通话音量*/
}
}
void VolumeSliderEventListener::OnChange(int32_t value)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnChange %d", value);
- ChangeVolume(VOLUMEDRAG);
+ // ChangeVolume(VOLUMEDRAG);
}
bool VolumeSliderEventListener::OnDrag(UIView& view, const DragEvent& event)