Merge branch 'ciderapp:develop' into develop
This commit is contained in:
commit
75d3a43277
10 changed files with 196 additions and 89 deletions
24
package.json
24
package.json
|
@ -35,26 +35,26 @@
|
|||
"circle:append-bid": "node resources/appendCommitToVersion"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/electron": "^2.5.4",
|
||||
"@sentry/integrations": "^6.17.4",
|
||||
"@sentry/electron": "^3.0.2",
|
||||
"@sentry/integrations": "^6.18.1",
|
||||
"adm-zip": "^0.5.9",
|
||||
"castv2-client": "^1.2.0",
|
||||
"chokidar": "^3.5.3",
|
||||
"discord-rpc": "^4.0.1",
|
||||
"ejs": "^3.1.6",
|
||||
"electron-fetch": "^1.7.4",
|
||||
"electron-log": "^4.4.5",
|
||||
"electron-log": "^4.4.6",
|
||||
"electron-notarize": "^1.1.1",
|
||||
"electron-store": "^8.0.1",
|
||||
"electron-updater": "^4.6.1",
|
||||
"electron-updater": "^4.6.5",
|
||||
"electron-window-state": "^5.0.3",
|
||||
"express": "^4.17.2",
|
||||
"express": "^4.17.3",
|
||||
"get-port": "^5.1.1",
|
||||
"jsonc": "^2.0.0",
|
||||
"lastfmapi": "^0.1.1",
|
||||
"mdns-js": "git+https://github.com/ciderapp/node-mdns-js.git",
|
||||
"mpris-service": "^2.1.2",
|
||||
"music-metadata": "^7.11.4",
|
||||
"music-metadata": "^7.12.1",
|
||||
"node-gyp": "^8.4.1",
|
||||
"node-ssdp": "^4.0.1",
|
||||
"qrcode": "^1.5.0",
|
||||
|
@ -64,24 +64,24 @@
|
|||
"source-map-support": "^0.5.21",
|
||||
"typescript": "^4.5.5",
|
||||
"v8-compile-cache": "^2.3.0",
|
||||
"ws": "^8.4.2",
|
||||
"ws": "^8.5.0",
|
||||
"xml2js": "^0.4.23",
|
||||
"youtube-search-without-api-key": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.18.1",
|
||||
"@playwright/test": "^1.19.2",
|
||||
"@types/discord-rpc": "^4.0.0",
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/qrcode-terminal": "^0.12.0",
|
||||
"@types/ws": "^8.2.2",
|
||||
"@types/ws": "^8.5.1",
|
||||
"electron": "git+https://github.com/castlabs/electron-releases.git",
|
||||
"electron-builder": "^22.14.13",
|
||||
"electron-builder-notarize-pkg": "^1.1.0",
|
||||
"electron-builder-notarize-pkg": "^1.2.0",
|
||||
"electron-webpack": "^2.8.2",
|
||||
"musickit-typescript": "^1.2.4",
|
||||
"playwright": "^1.18.1",
|
||||
"playwright": "^1.19.2",
|
||||
"vue-devtools": "^5.1.4",
|
||||
"webpack": "~5.65.0"
|
||||
"webpack": "~5.69.1"
|
||||
},
|
||||
"fileAssociations": [
|
||||
{
|
||||
|
|
|
@ -176,3 +176,15 @@ Update 19/2/2022 21:00 UTC
|
|||
Update 25/02/2022 15:30 UTC
|
||||
|
||||
* `action.moveToTop`: Changed to `Move out of Folder` instead of `Move to top`
|
||||
|
||||
Update 27/02/2022 18:30 UTC
|
||||
|
||||
* `settings.notyf.updateCider.update-not-available`: Added for `en_US`
|
||||
* `settings.notyf.updateCider.update-timeout`: Added for `en_US`
|
||||
* `settings.notyf.updateCider.update-downloaded`: Added for `en_US`
|
||||
* `settings.notyf.updateCider.update-error`: Added for `en_US`
|
||||
|
||||
Update 28/02/2022 13:00 UTC
|
||||
|
||||
* `term.time.days`: Added for `en_US`
|
||||
* `term.time.day`: Added for `en_US`
|
|
@ -2,13 +2,14 @@
|
|||
"i18n.languageName": "English (UK)",
|
||||
"i18n.languageNameEnglish": "English (UK)",
|
||||
"i18n.category": "main",
|
||||
"i18n.authors": "Core, inalone",
|
||||
"i18n.authors": "Core, inalone, nosh118",
|
||||
"date.format": "${d} ${m}, ${y}",
|
||||
"term.equalizer": "Equaliser",
|
||||
"settings.option.audio.enableAdvancedFunctionality.description": "Enabling AudioContext functionality will allow for extended audio features like Audio Normalisation , Equalisers and Visualisers, however on some systems this may cause stuttering in audio tracks.",
|
||||
"settings.option.audio.enableAdvancedFunctionality.description": "Enabling AudioContext functionality will allow for extended audio features like Audio Normalisation, Equalisers and Visualisers - however on some systems this may cause stuttering in audio tracks.",
|
||||
"settings.option.audio.enableAdvancedFunctionality.audioNormalization": "Audio Normalisation",
|
||||
"settings.option.audio.enableAdvancedFunctionality.audioNormalization.description": "Normalises peak volume for individual tracks to create a more uniform listening experience.",
|
||||
"settings.option.audio.enableAdvancedFunctionality.audioSpatialization": "Audio Spatialisation",
|
||||
"settings.option.audio.enableAdvancedFunctionality.audioSpatialization.description": "Spatialise audio and make audio more 3-dimensional (note: This is not Dolby Atmos)",
|
||||
"spatial.notTurnedOn": "Audio Spatialisation is disabled. To use, please enable it first."
|
||||
"action.tray.minimize": "Minimise to Tray",
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"i18n.languageName": "English (US)",
|
||||
"i18n.languageNameEnglish": "English (US)",
|
||||
"i18n.category": "main",
|
||||
"i18n.authors": "@maikirakiwi @kyw504100",
|
||||
"i18n.authors": "@maikirakiwi @kyw504100 nosh118",
|
||||
"app.name": "Cider",
|
||||
"date.format": "${m} ${d}, ${y}",
|
||||
"dialog.cancel": "Cancel",
|
||||
|
@ -89,6 +89,8 @@
|
|||
"term.time.added": "Added",
|
||||
"term.time.released": "Released",
|
||||
"term.time.updated": "Updated",
|
||||
"term.time.days": "days",
|
||||
"term.time.day": "day",
|
||||
"term.time.hours": "hours",
|
||||
"term.time.hour": "hour",
|
||||
"term.time.minutes": "minutes",
|
||||
|
@ -115,6 +117,10 @@
|
|||
"term.equalizer": "Equalizer",
|
||||
"term.reset": "Reset",
|
||||
"term.tracks": "tracks",
|
||||
"term.track": {
|
||||
"one" : "track",
|
||||
"other" : "tracks"
|
||||
},
|
||||
"term.videos": "Videos",
|
||||
"term.menu": "Menu",
|
||||
"term.check": "Check",
|
||||
|
@ -157,7 +163,7 @@
|
|||
"home.recentlyPlayed": "Recently Played",
|
||||
"home.recentlyAdded": "Recently Added",
|
||||
"home.artistsFeed": "Your Artists Feed",
|
||||
"home.artistsFeed.noArtist": "Follow some artists first and their latest releases will be here",
|
||||
"home.artistsFeed.noArtist": "Follow some artists to see their latest releases",
|
||||
"home.madeForYou": "Made For You",
|
||||
"home.friendsListeningTo": "Friends Listening To",
|
||||
"home.followedArtists": "Followed Artists",
|
||||
|
@ -239,6 +245,10 @@
|
|||
"settings.option.general.updateCider.branch.description": "Select the branch to update Cider to",
|
||||
"settings.option.general.updateCider.branch.main": "Stable",
|
||||
"settings.option.general.updateCider.branch.develop": "Development",
|
||||
"settings.notyf.updateCider.update-not-available": "No update available",
|
||||
"settings.notyf.updateCider.update-downloaded": "Update has been downloaded, restart to apply",
|
||||
"settings.notyf.updateCider.update-error": "Error updating Cider",
|
||||
"settings.notyf.updateCider.update-timeout": "Update timed out",
|
||||
"settings.header.audio": "Audio",
|
||||
"settings.header.audio.description": "Adjust the audio settings for Cider.",
|
||||
"settings.option.audio.volumeStep": "Volume Step",
|
||||
|
@ -254,7 +264,7 @@
|
|||
"settings.header.audio.quality.standard.description": "64 kbps",
|
||||
"settings.option.audio.seamlessTransition": "Seamless Audio Transition",
|
||||
"settings.option.audio.enableAdvancedFunctionality": "Enable Advanced Functionality",
|
||||
"settings.option.audio.enableAdvancedFunctionality.description": "Enabling AudioContext functionality will allow for extended audio features like Audio Normalization , Equalizers and Visualizers, however on some systems this may cause stuttering in audio tracks.",
|
||||
"settings.option.audio.enableAdvancedFunctionality.description": "Enabling AudioContext functionality will allow for extended audio features like Audio Normalization, Equalizers and Visualizers - however on some systems this may cause stuttering in audio tracks.",
|
||||
"settings.option.audio.audioLab": "Cider Audio Lab",
|
||||
"settings.option.audio.audioLab.description": "An assortment of in-house developed audio effects for Cider.",
|
||||
"settings.warn.audioLab.withoutAF": "AudioContext (Advanced Functionality) is required to enable Cider Audio Laboratory.",
|
||||
|
|
|
@ -973,27 +973,9 @@ export class BrowserWindow {
|
|||
});
|
||||
|
||||
ipcMain.on('check-for-update', async (_event) => {
|
||||
const branch = utils.getStoreValue('general.update_branch')
|
||||
let latestbranch = await fetch(`https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=${branch}&filter=successful`)
|
||||
if (latestbranch.status != 200) {
|
||||
console.log(`Error fetching latest artifact from the **${branch}** branch`)
|
||||
return
|
||||
}
|
||||
|
||||
let latestbranchjson = await latestbranch.json()
|
||||
let base_url = latestbranchjson[0].url
|
||||
base_url = base_url.substring(0, base_url.lastIndexOf('/'))
|
||||
|
||||
const options: any = {
|
||||
provider: 'generic',
|
||||
url: `${base_url}`,
|
||||
allowDowngrade: true,
|
||||
}
|
||||
|
||||
// Have to handle the auto updaters seperatly until we can support macOS. electron-builder limitation -q
|
||||
if (process.platform === 'win32') await new NsisUpdater(options).checkForUpdatesAndNotify() //Windows
|
||||
if (process.platform === 'linux') await new AppImageUpdater(options).checkForUpdatesAndNotify() //Linux
|
||||
await utils.checkForUpdate();
|
||||
});
|
||||
|
||||
ipcMain.on('disable-update', (event) => {
|
||||
// Check if using app store builds so people don't get pissy wen button go bonk
|
||||
if (app.isPackaged && !process.mas || !process.windowsStore) {
|
||||
|
|
|
@ -3,6 +3,9 @@ import * as path from "path";
|
|||
import {Store} from "./store";
|
||||
import {BrowserWindow as bw} from "./browserwindow";
|
||||
import {app} from "electron";
|
||||
import fetch from "electron-fetch";
|
||||
import {AppImageUpdater, NsisUpdater} from "electron-updater";
|
||||
import * as log from "electron-log";
|
||||
|
||||
export class utils {
|
||||
|
||||
|
@ -107,4 +110,54 @@ export class utils {
|
|||
bw.win.webContents.executeJavaScript("MusicKitInterop.previous()")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the application for updates
|
||||
*/
|
||||
static async checkForUpdate(): Promise<void> {
|
||||
|
||||
// Get the artifacts
|
||||
const response = await fetch(`https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=${utils.getStoreValue('general.update_branch')}&filter=successful`)
|
||||
if (response.status != 200) {
|
||||
bw.win.webContents.send('update-response', 'update-timeout')
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the urls
|
||||
const jsonResponse = await response.json()
|
||||
let base_url = jsonResponse[0].url
|
||||
base_url = base_url.substring(0, base_url.lastIndexOf('/'))
|
||||
|
||||
const options: any = {
|
||||
provider: 'generic',
|
||||
url: base_url,
|
||||
allowDowngrade: true,
|
||||
}
|
||||
|
||||
let autoUpdater: any = null
|
||||
if (process.platform === 'win32') { //Windows
|
||||
autoUpdater = await new NsisUpdater(options)
|
||||
} else {
|
||||
autoUpdater = await new AppImageUpdater(options) //Linux and Mac (AppImages work on macOS btw)
|
||||
}
|
||||
|
||||
autoUpdater.on('error', (error: any) => {
|
||||
console.error(`[AutoUpdater] Error: ${error}`)
|
||||
bw.win.webContents.send('update-response', "update-error")
|
||||
})
|
||||
|
||||
autoUpdater.on('update-not-available', () => {
|
||||
console.log('[AutoUpdater] Update not available.')
|
||||
bw.win.webContents.send('update-response', "update-not-available");
|
||||
})
|
||||
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
console.log('[AutoUpdater] Update downloaded.')
|
||||
bw.win.webContents.send('update-response', "update-downloaded");
|
||||
})
|
||||
|
||||
log.transports.file.level = "debug"
|
||||
autoUpdater.logger = log
|
||||
await autoUpdater.checkForUpdate()
|
||||
}
|
||||
}
|
|
@ -155,7 +155,7 @@ export default class DiscordRichPresence {
|
|||
buttons: [
|
||||
{label: "Listen on Cider", url: attributes.url.cider},
|
||||
{label: "View on Apple Music", url: attributes.url.appleMusic},
|
||||
]
|
||||
] //To change attributes.url => preload/cider-preload.js
|
||||
};
|
||||
|
||||
this._activity = this.filterActivity(this._activity, attributes)
|
||||
|
|
|
@ -82,7 +82,7 @@ const MusicKitInterop = {
|
|||
attributes.playParams = attributes?.playParams ?? {id: 'no-id-found'};
|
||||
attributes.playParams.id = attributes?.playParams?.id ?? 'no-id-found';
|
||||
attributes.url = {
|
||||
cider: `cider://play/s/${nowPlayingItem?._songId ?? (nowPlayingItem?.songId ??'no-id-found')}`,
|
||||
cider: `https://cider.sh/link?play/s/${nowPlayingItem?._songId ?? (nowPlayingItem?.songId ??'no-id-found')}`,
|
||||
appleMusic: attributes.websiteUrl ? attributes.websiteUrl : `https://music.apple.com/${mk.storefrontId}/song/${nowPlayingItem?._songId ?? (nowPlayingItem?.songId ??'no-id-found')}`
|
||||
}
|
||||
if (attributes.playParams.id === 'no-id-found') {
|
||||
|
@ -156,5 +156,3 @@ process.once('loaded', () => {
|
|||
console.log("Setting ipcRenderer")
|
||||
global.MusicKitInterop = MusicKitInterop;
|
||||
});
|
||||
|
||||
ipcRenderer.send('check-for-update')
|
||||
|
|
|
@ -344,7 +344,7 @@ var CiderAudio = {
|
|||
let LLPW_FREQUENCIES = [16.452, 24.636, 37.134, 74.483, 159.54, 308.18, 670.21, 915.81, 1200.7, 2766.4, 2930.6, 4050.6, 4409.1, 5395.2, 5901.6, 6455.5, 7164.1, 7724.1, 8449, 10573, 12368, 14198, 17910, 18916];
|
||||
CiderAudio.audioNodes.llpw = []
|
||||
|
||||
if (app.cfg.audio.maikiwiAudio.ciderPPE_value === 0.5) {
|
||||
if (app.cfg.audio.maikiwiAudio.ciderPPE_value === 0.55) {
|
||||
for (i = 0; i < c_LLPW_FREQUENCIES.length; i++) {
|
||||
CiderAudio.audioNodes.llpw[i] = CiderAudio.context.createBiquadFilter();
|
||||
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
||||
|
@ -369,10 +369,10 @@ var CiderAudio = {
|
|||
|
||||
}
|
||||
|
||||
console.log("[Cider][Audio] CAP - Clarity Mode");
|
||||
console.debug("[Cider][Audio] CAP - Clarity Mode");
|
||||
}
|
||||
|
||||
else if (app.cfg.audio.maikiwiAudio.ciderPPE_value === 0.55) {
|
||||
else if (app.cfg.audio.maikiwiAudio.ciderPPE_value === 0.5) {
|
||||
for (i = 0; i < LLPW_FREQUENCIES.length; i++) {
|
||||
CiderAudio.audioNodes.llpw[i] = CiderAudio.context.createBiquadFilter();
|
||||
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
||||
|
@ -396,7 +396,7 @@ var CiderAudio = {
|
|||
break;
|
||||
|
||||
}
|
||||
console.log("[Cider][Audio] CAP - Biased Mode");
|
||||
console.debug("[Cider][Audio] CAP - Classic Mode");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -433,7 +433,7 @@ var CiderAudio = {
|
|||
try {for (var i of CiderAudio.audioNodes.llpw){i.disconnect();} CiderAudio.audioNodes.llpw = null} catch(e){}
|
||||
try {for (var i of CiderAudio.audioNodes.vibrantbassNode){i.disconnect();} CiderAudio.audioNodes.vibrantbassNode = null} catch(e){}
|
||||
|
||||
console.log("[Cider][Audio] Finished hierarchical unloading");
|
||||
console.debug("[Cider][Audio] Finished hierarchical unloading");
|
||||
|
||||
},
|
||||
hierarchical_loading: function (){
|
||||
|
@ -453,13 +453,13 @@ var CiderAudio = {
|
|||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
console.log('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth, Maikiwi Spatial')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth, Spatial')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth, Spatial')
|
||||
}
|
||||
|
||||
|
||||
|
@ -478,12 +478,12 @@ var CiderAudio = {
|
|||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
console.log('[Cider][Audio] CAP, Analog Warmth, Maikiwi Spatial')
|
||||
console.debug('[Cider][Audio] CAP, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.log('[Cider][Audio] CAP, Analog Warmth, Spatial')
|
||||
console.debug('[Cider][Audio] CAP, Analog Warmth, Spatial')
|
||||
}
|
||||
}
|
||||
// Vibrant Bass, CAP, Spatial
|
||||
|
@ -498,12 +498,12 @@ var CiderAudio = {
|
|||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
app.cfg.audio.normalization = true
|
||||
console.log('[Cider][Audio] Vibrant Bass, CAP, Maikiwi Spatial')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass, CAP, Spatial')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP, Spatial')
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ var CiderAudio = {
|
|||
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth')
|
||||
}
|
||||
// CAP, Spatial
|
||||
else if (app.cfg.audio.maikiwiAudio.vibrantBass.multiplier === 0 &&
|
||||
|
@ -532,12 +532,12 @@ var CiderAudio = {
|
|||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
console.log('[Cider][Audio] CAP, Maikiwi Spatial')
|
||||
console.debug('[Cider][Audio] CAP, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
console.log('[Cider][Audio] CAP, Spatial')
|
||||
console.debug('[Cider][Audio] CAP, Spatial')
|
||||
}
|
||||
}
|
||||
// Analog Warmth, Spatial
|
||||
|
@ -551,12 +551,12 @@ var CiderAudio = {
|
|||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
console.log('[Cider][Audio] Analog Warmth, Maikiwi Spatial')
|
||||
console.debug('[Cider][Audio] Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.log('[Cider][Audio] Analog Warmth, Spatial')
|
||||
console.debug('[Cider][Audio] Analog Warmth, Spatial')
|
||||
}
|
||||
}
|
||||
// CAP, Analog Warmth
|
||||
|
@ -568,7 +568,7 @@ var CiderAudio = {
|
|||
CiderAudio.llpw_h2_2(true, 1);
|
||||
CiderAudio.analogWarmth_h2_3(true, 3);
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.log('[Cider][Audio] CAP and Analog Warmth')
|
||||
console.debug('[Cider][Audio] CAP and Analog Warmth')
|
||||
}
|
||||
// Vibrant Bass, Analog Warmth
|
||||
else if (app.cfg.audio.maikiwiAudio.vibrantBass.multiplier !== 0 &&
|
||||
|
@ -580,7 +580,7 @@ var CiderAudio = {
|
|||
CiderAudio.analogWarmth_h2_3(true, 2);
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass, Analog Warmth')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, Analog Warmth')
|
||||
}
|
||||
|
||||
// Vibrant Bass, CAP
|
||||
|
@ -594,7 +594,7 @@ var CiderAudio = {
|
|||
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass, CAP')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP')
|
||||
}
|
||||
// Vibrant Bass, Spatial
|
||||
else if (app.cfg.audio.maikiwiAudio.vibrantBass.multiplier !== 0 &&
|
||||
|
@ -608,12 +608,12 @@ var CiderAudio = {
|
|||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass, Maikiwi Spatial')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass, Spatial')
|
||||
console.debug('[Cider][Audio] Vibrant Bass, Spatial')
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -626,7 +626,7 @@ var CiderAudio = {
|
|||
CiderAudio.vibrantbass_h2_1(true)
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
console.log('[Cider][Audio] Vibrant Bass')
|
||||
console.debug('[Cider][Audio] Vibrant Bass')
|
||||
|
||||
}
|
||||
// CAP
|
||||
|
@ -636,7 +636,7 @@ var CiderAudio = {
|
|||
app.cfg.audio.maikiwiAudio.analogWarmth === false) {
|
||||
CiderAudio.llpw_h2_2(true, 1);
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
console.log('[Cider][Audio] CAP')
|
||||
console.debug('[Cider][Audio] CAP')
|
||||
}
|
||||
// Analog Warmth
|
||||
else if (app.cfg.audio.maikiwiAudio.vibrantBass.multiplier === 0 &&
|
||||
|
@ -645,7 +645,7 @@ var CiderAudio = {
|
|||
app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
CiderAudio.analogWarmth_h2_3(true, 1);
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.log('[Cider][Audio] Analog Warmth')
|
||||
console.debug('[Cider][Audio] Analog Warmth')
|
||||
}
|
||||
// Spatial
|
||||
else if (app.cfg.audio.maikiwiAudio.vibrantBass.multiplier === 0 &&
|
||||
|
@ -657,22 +657,22 @@ var CiderAudio = {
|
|||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
console.log('[Cider][Audio] Maikiwi Spatial')
|
||||
console.debug('[Cider][Audio] Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
console.log('[Cider][Audio] Spatial')
|
||||
console.debug('[Cider][Audio] Spatial')
|
||||
}
|
||||
|
||||
}
|
||||
// Nothing
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
console.log('[Cider][Audio] Nothing') // If CAP & vibrant bass is disabled
|
||||
console.debug('[Cider][Audio] Nothing') // If CAP & vibrant bass is disabled
|
||||
}
|
||||
|
||||
console.log("[Cider][Audio] Finished hierarchical loading");
|
||||
console.debug("[Cider][Audio] Finished hierarchical loading");
|
||||
|
||||
},
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ const store = new Vuex.Store({
|
|||
}
|
||||
}
|
||||
})
|
||||
ipcRenderer.send('check-for-update')
|
||||
const app = new Vue({
|
||||
el: "#app",
|
||||
store: store,
|
||||
|
@ -786,8 +785,10 @@ const app = new Vue({
|
|||
|
||||
ipcRenderer.on('SoundCheckTag', (event, tag) => {
|
||||
let replaygain = self.parseSCTagToRG(tag)
|
||||
console.debug(`[Cider][MaikiwiSoundCheck] Replay Gain: ${JSON.stringify(replaygain)} | Attenuating '${Math.log10(replaygain.gain) * 20}' dB`)
|
||||
try {
|
||||
CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak)))
|
||||
//CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak)))
|
||||
CiderAudio.audioNodes.gainNode.gain.value = replaygain.gain
|
||||
} catch (e) {
|
||||
}
|
||||
})
|
||||
|
@ -1333,24 +1334,67 @@ const app = new Vue({
|
|||
return this.playerLCD.playbackDuration
|
||||
}
|
||||
},
|
||||
convertTime(time) {
|
||||
/**
|
||||
* Converts seconds to dd:hh:mm:ss
|
||||
* @param time (in seconds)
|
||||
* @param format (short, long)
|
||||
* @returns {string}
|
||||
*/
|
||||
convertTime(time, format = 'short') {
|
||||
if (typeof time !== "number") {
|
||||
time = parseInt(time)
|
||||
}
|
||||
|
||||
const timeGates = {
|
||||
600: 15,
|
||||
3600: 14,
|
||||
36000: 12,
|
||||
600: 15, // 10 Minutes
|
||||
3600: 14, // Hour
|
||||
36000: 12, // 10 Hours
|
||||
}
|
||||
|
||||
const datetime = new Date(time * 1000)
|
||||
|
||||
let returnTime = datetime.toISOString().substring(11, 19);
|
||||
for (let key in timeGates) {
|
||||
if (time < key) {
|
||||
return new Date(time * 1000).toISOString().substring(timeGates[key], 19)
|
||||
returnTime = datetime.toISOString().substring(timeGates[key], 19)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return new Date(time * 1000).toISOString().substring(11, 19)
|
||||
// Add the days on the front
|
||||
let day;
|
||||
if (time >= 86400) {
|
||||
day = datetime.toISOString().substring(8, 10)
|
||||
day = parseInt(day) - 1
|
||||
returnTime = day + ":" + returnTime
|
||||
}
|
||||
|
||||
if (format === 'long') {
|
||||
const longFormat = []
|
||||
|
||||
// Seconds
|
||||
if (datetime.getSeconds() !== 0) {
|
||||
longFormat.push(`${datetime.getSeconds()} ${app.getLz('term.time.seconds')}`)
|
||||
}
|
||||
|
||||
// Minutes
|
||||
if (time >= 60) {
|
||||
longFormat.push(`${datetime.getMinutes()} ${app.getLz('term.time.minute', options = {count: datetime.getMinutes()})}`)
|
||||
}
|
||||
|
||||
// Hours
|
||||
if (time >= 3600) {
|
||||
longFormat.push(`${datetime.getHours()} ${app.getLz('term.time.hour', options = {count: datetime.getHours()})}`)
|
||||
}
|
||||
|
||||
// Days
|
||||
if (time >= 86400) {
|
||||
longFormat.push(`${day} ${app.getLz('term.time.day', options = {count: day})}`)
|
||||
}
|
||||
returnTime = longFormat.reverse().join(', ')
|
||||
}
|
||||
|
||||
return returnTime
|
||||
},
|
||||
hashCode(str) {
|
||||
let hash = 0,
|
||||
|
@ -2313,14 +2357,8 @@ const app = new Vue({
|
|||
getTotalTime() {
|
||||
try {
|
||||
if (app.showingPlaylist.relationships.tracks.data.length > 0) {
|
||||
let time = Math.round([].concat(...app.showingPlaylist.relationships.tracks.data).reduce((a, {attributes: {durationInMillis}}) => a + durationInMillis, 0) / 1000);
|
||||
let hours = Math.floor(time / 3600)
|
||||
let mins = Math.floor(time / 60) % 60
|
||||
let secs = time % 60
|
||||
return app.showingPlaylist.relationships.tracks.data.length + " " + app.getLz('term.tracks', options = {count: app.showingPlaylist.relationships.tracks.data.length}) + ", "
|
||||
+ ((hours > 0) ? (hours + (" " + (app.getLz('term.time.hour', options = {count: hours}) + ", "))) : "") +
|
||||
((mins > 0) ? (mins + (" " + app.getLz('term.time.minute', options = {count: mins}) + ", ")) : "") +
|
||||
secs + (" " + app.getLz('term.time.second', options = {count: secs}) + ".");
|
||||
const timeInSeconds = Math.round([].concat(...app.showingPlaylist.relationships.tracks.data).reduce((a, {attributes: {durationInMillis}}) => a + durationInMillis, 0) / 1000);
|
||||
return `${app.showingPlaylist.relationships.tracks.data.length} ${app.getLz('term.track', options = {count: app.showingPlaylist.relationships.tracks.data.length})}, ${this.convertTime(timeInSeconds, 'long')}`
|
||||
} else return ""
|
||||
} catch (err) {
|
||||
return ""
|
||||
|
@ -3768,8 +3806,9 @@ const app = new Vue({
|
|||
|
||||
}
|
||||
numbers.shift()
|
||||
let gain = Math.log10((Math.max(numbers[0], numbers[1]) ?? 1000) / 1000.0) * -10
|
||||
//let gain = Math.log10((Math.max(numbers[0], numbers[1]) ?? 1000) / 1000.0) * -10
|
||||
let peak = Math.max(numbers[6], numbers[7]) / 32768.0
|
||||
let gain = Math.pow(10, ((-7.63 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant
|
||||
return {
|
||||
gain: gain,
|
||||
peak: peak
|
||||
|
@ -3950,6 +3989,18 @@ const app = new Vue({
|
|||
},
|
||||
checkForUpdate() {
|
||||
ipcRenderer.send('check-for-update')
|
||||
ipcRenderer.on('update-response', (event, res) => {
|
||||
if (res === "update-not-available") {
|
||||
notyf.error(app.getLz(`settings.notyf.updateCider.${res}`))
|
||||
} else if (res === "update-downloaded") {
|
||||
notyf.success(app.getLz(`settings.notyf.updateCider.${res}`))
|
||||
} else if (res === "update-error") {
|
||||
notyf.error(app.getLz(`settings.notyf.updateCider.${res}`))
|
||||
} else if (res === "update-timeout") {
|
||||
notyf.error(app.getLz(`settings.notyf.updateCider.${res}`))
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue