Formatted and resolved issues in browserwindow.ts
This commit is contained in:
parent
c1d7548169
commit
24a5d1111f
1 changed files with 25 additions and 27 deletions
|
@ -14,11 +14,8 @@ import {utils} from './utils';
|
|||
import {Plugins} from "./plugins";
|
||||
import {watch} from "chokidar";
|
||||
import * as os from "os";
|
||||
const wallpaper = require('wallpaper');
|
||||
|
||||
// @ts-ignore
|
||||
import wallpaper from "wallpaper";
|
||||
import * as AdmZip from "adm-zip";
|
||||
import * as util from "util";
|
||||
|
||||
/**
|
||||
* @file Creates the BrowserWindow
|
||||
|
@ -325,7 +322,7 @@ export class BrowserWindow {
|
|||
this.options.transparent = true;
|
||||
}
|
||||
this.options.autoHideMenuBar = true
|
||||
if(utils.getStoreValue("visual.nativeTitleBar")) {
|
||||
if (utils.getStoreValue("visual.nativeTitleBar")) {
|
||||
this.options.titleBarStyle = "visible";
|
||||
this.options.frame = true
|
||||
}
|
||||
|
@ -333,7 +330,7 @@ export class BrowserWindow {
|
|||
case "linux":
|
||||
this.options.backgroundColor = "#1E1E1E";
|
||||
this.options.autoHideMenuBar = true
|
||||
if(utils.getStoreValue("visual.nativeTitleBar")) {
|
||||
if (utils.getStoreValue("visual.nativeTitleBar")) {
|
||||
this.options.titleBarStyle = "visible";
|
||||
this.options.frame = true
|
||||
}
|
||||
|
@ -552,7 +549,7 @@ export class BrowserWindow {
|
|||
remote.use(express.static(join(utils.getPath('srcPath'), "./web-remote/")))
|
||||
remote.set("views", join(utils.getPath('srcPath'), "./web-remote/views"));
|
||||
remote.set("view engine", "ejs");
|
||||
getPort({port: 6942}).then((port) => {
|
||||
getPort({port: 6942}).then((port: number) => {
|
||||
this.remotePort = port;
|
||||
// Start Remote Discovery
|
||||
this.broadcastRemote()
|
||||
|
@ -611,19 +608,20 @@ export class BrowserWindow {
|
|||
}
|
||||
if (details.url.includes("https://qq.com")) {
|
||||
details.requestHeaders['Accept'] = '*/*',
|
||||
details.requestHeaders['Accept-Encoding'] = 'gzip, deflate, br',
|
||||
details.requestHeaders['Accept-Language'] = 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
||||
details.requestHeaders['Referer'] = 'https://y.qq.com/',
|
||||
details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 ('
|
||||
'KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) '}
|
||||
if (details.url.includes("https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg")) {
|
||||
details.requestHeaders['Accept-Encoding'] = 'gzip, deflate, br',
|
||||
details.requestHeaders['Accept-Language'] = 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
||||
details.requestHeaders['Referer'] = 'https://y.qq.com/',
|
||||
details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 ('
|
||||
'KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) '
|
||||
}
|
||||
if (details.url.includes("https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg")) {
|
||||
details.requestHeaders['Accept'] = '*/*',
|
||||
details.requestHeaders['Accept-Encoding'] = 'gzip, deflate, br',
|
||||
details.requestHeaders['Accept-Language'] = 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
||||
details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 ('
|
||||
'KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) '
|
||||
details.requestHeaders['Referer'] = "https://y.qq.com/portal/player.html"
|
||||
}
|
||||
details.requestHeaders['Accept-Encoding'] = 'gzip, deflate, br',
|
||||
details.requestHeaders['Accept-Language'] = 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
||||
details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 ('
|
||||
'KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) '
|
||||
details.requestHeaders['Referer'] = "https://y.qq.com/portal/player.html"
|
||||
}
|
||||
callback({requestHeaders: details.requestHeaders});
|
||||
}
|
||||
);
|
||||
|
@ -1053,21 +1051,21 @@ export class BrowserWindow {
|
|||
return Math.max(-32768, Math.min(32768, v)); // clamp
|
||||
}
|
||||
|
||||
function bitratechange(e: any){
|
||||
function bitratechange(e: any) {
|
||||
var t = e.length;
|
||||
let sampleRate = 96.0;
|
||||
let outputSampleRate = 48.0;
|
||||
var s = 0,
|
||||
o = sampleRate / outputSampleRate,
|
||||
u = Math.ceil(t * outputSampleRate / sampleRate),
|
||||
a = new Int16Array(u);
|
||||
o = sampleRate / outputSampleRate,
|
||||
u = Math.ceil(t * outputSampleRate / sampleRate),
|
||||
a = new Int16Array(u);
|
||||
for (let i = 0; i < u; i++) {
|
||||
a[i] = e[Math.floor(s)];
|
||||
s += o;
|
||||
a[i] = e[Math.floor(s)];
|
||||
s += o;
|
||||
}
|
||||
|
||||
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
let newaudio = quantization(leftpcm, rightpcm);
|
||||
//let newaudio = [leftpcm, rightpcm];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue