diff --git a/public/osdlyrics.html b/public/osdlyrics.html deleted file mode 100644 index deba7ce..0000000 --- a/public/osdlyrics.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - OSD Lyrics - - - - -
YesPlayMusic
- - - \ No newline at end of file diff --git a/src/assets/icons/osd-lyrics.svg b/src/assets/icons/osd-lyrics.svg deleted file mode 100644 index b388642..0000000 --- a/src/assets/icons/osd-lyrics.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/src/background.js b/src/background.js index caeba33..2bdaee7 100644 --- a/src/background.js +++ b/src/background.js @@ -29,7 +29,6 @@ const log = text => { class Background { constructor() { this.window = null; - this.osdlyrics = null; this.tray = null; this.store = new Store({ windowWidth: { @@ -165,71 +164,6 @@ class Background { } } - createOSDWindow() { - this.osdlyrics = new BrowserWindow({ - x: this.store.get('osdlyrics.x-pos') || 0, - y: this.store.get('osdlyrics.y-pos') || 0, - width: this.store.get('osdlyrics.width') || 840, - height: this.store.get('osdlyrics.height') || 110, - title: 'OSD Lyrics', - transparent: true, - frame: false, - webPreferences: { - webSecurity: false, - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false, - }, - }); - this.osdlyrics.setAlwaysOnTop(true, 'screen'); - - if (process.env.WEBPACK_DEV_SERVER_URL) { - // Load the url of the dev server if in development mode - this.osdlyrics.loadURL( - process.env.WEBPACK_DEV_SERVER_URL + '/osdlyrics.html' - ); - if (!process.env.IS_TEST) this.osdlyrics.webContents.openDevTools(); - } else { - this.osdlyrics.loadURL('http://localhost:27232/osdlyrics.html'); - } - } - - initOSDLyrics() { - const osdState = this.store.get('osdlyrics.show') || false; - if (osdState) { - this.showOSDLyrics(); - } - } - - toggleOSDLyrics() { - const osdState = this.store.get('osdlyrics.show') || false; - if (osdState) { - this.hideOSDLyrics(); - } else { - this.showOSDLyrics(); - } - } - - showOSDLyrics() { - this.store.set('osdlyrics.show', true); - if (!this.osdlyrics) { - this.createOSDWindow(); - this.handleOSDEvents(); - } - } - - hideOSDLyrics() { - this.store.set('osdlyrics.show', false); - if (this.osdlyrics) { - this.osdlyrics.close(); - } - } - - resizeOSDLyrics(height) { - const width = this.store.get('osdlyrics.width') || 840; - this.osdlyrics.setSize(width, height); - } - checkForUpdates() { if (process.env.NODE_ENV === 'development') return; log('checkForUpdates'); @@ -259,30 +193,6 @@ class Background { }); } - handleOSDEvents() { - this.osdlyrics.once('ready-to-show', () => { - log('OSD ready-to-show event'); - this.osdlyrics.show(); - }); - - this.osdlyrics.on('closed', e => { - log('OSD close event'); - this.osdlyrics = null; - }); - - this.osdlyrics.on('resized', () => { - let { height, width } = this.osdlyrics.getBounds(); - this.store.set('osdlyrics.width', width); - this.store.set('osdlyrics.height', height); - }); - - this.osdlyrics.on('moved', () => { - var pos = this.osdlyrics.getPosition(); - this.store.set('osdlyrics.x-pos', pos[0]); - this.store.set('osdlyrics.y-pos', pos[1]); - }); - } - handleWindowEvents() { this.window.once('ready-to-show', () => { log('windows ready-to-show event'); @@ -363,13 +273,8 @@ class Background { }); this.handleWindowEvents(); - this.initOSDLyrics(); - // init ipcMain - initIpcMain(this.window, this.store, { - resizeOSDLyrics: height => this.resizeOSDLyrics(height), - toggleOSDLyrics: () => this.toggleOSDLyrics(), - }); + initIpcMain(this.window, this.store); // set proxy const proxyRules = this.store.get('proxy'); diff --git a/src/components/Player.vue b/src/components/Player.vue index 4b553af..9789a67 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -95,12 +95,6 @@
-