Commit 7ac5c603 authored by martin hou's avatar martin hou

feat: adding recording switch when vibe mode

parent 0093aef1
......@@ -225,14 +225,17 @@ declare class Jensen {
getTime: (time?: number) => Promise<{ time: string }>;
// 获取设备设置项,注意:不同型号的设备有不同的设置项
getSettings: (time?: number) => Promise<{ autoRecord: boolean; autoPlay: boolean; notification?: boolean } | null>;
getSettings: (time?: number) => Promise<{ autoRecord: boolean; autoPlay: boolean; notification?: boolean, recordOnVibe?: boolean } | null>;
// 设备Auto Record开关
setAutoRecord: (enable: boolean, time?: number) => Promise<ReturnStruct['common']>;
// 设置Recording Notification提示音开关,录音开始时是否播放Start Recording
setAutoPlay: (enable: boolean, time?: number) => Promise<ReturnStruct['common']>;
// 设置Vibe模式下的Whisper录音开关
setRecordOnVibe: (enable: boolean, time?: number) => Promise<ReturnStruct['common']>;
// 设置WebUSB设备接入提示(Windows电脑右下角的弹窗)
setNotification: (state: boolean, time?: number) => Promise<ReturnStruct['common']>;
......
......@@ -1366,6 +1366,14 @@ Jensen.prototype.setAutoRecord = function (enable, seconds) {
return this.send(new Command(SET_SETTINGS).body([0, 0, 0, enable ? 1 : 2]), seconds);
};
Jensen.prototype.setRecordOnVibe = function (enable, seconds) {
if (this.model == 'hidock-p1' && this.versionNumber >= 0x010404)
{
return this.send(new Command(SET_SETTINGS).body([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, enable ? 1 : 2]), seconds);
}
else return { result: false };
}
Jensen.prototype.setAutoPlay = function (enable, seconds) {
if ((this.model == 'hidock-h1' || this.model == 'hidock-h1e') && this.versionNumber < 327714) return { result: false };
return this.send(new Command(SET_SETTINGS).body([0, 0, 0, 0, 0, 0, 0, enable ? 1 : 2]), seconds);
......@@ -1638,6 +1646,10 @@ Jensen.registerHandler(GET_SETTINGS, (msg) => {
let r3 = msg.body[11] === 1;
rst['notification'] = r3;
}
if (msg.body.length >= 19) {
let r5 = msg.body[19];
rst['recordOnVibe'] = r5 === 1;
}
return rst;
});
Jensen.registerHandler(SET_SETTINGS, commonMessageParser);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment