From: Cedric Godin Date: Tue, 30 Jan 2018 20:45:35 +0000 (-0500) Subject: UI improvements. Fixed bug where file metadata would not fill X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=6b43fe21504da290d8e94f5a4cd131da67a57f4b;p=yn%2Fyn-odasweb.git UI improvements. Fixed bug where file metadata would not fill --- diff --git a/main.js b/main.js index a3f8aa2..6e13b37 100644 --- a/main.js +++ b/main.js @@ -23,7 +23,8 @@ function createWindow () { 'web-security': false, "webgl": true }, - icon: path.join(__dirname, 'ressources/images/introlab_icon.png') + icon: path.join(__dirname, 'ressources/images/introlab_icon.png'), + show: false }) @@ -45,6 +46,10 @@ function createWindow () { odasStudio.mainWindow = null app.quit() }) + + odasStudio.mainWindow.on('ready-to-show', function() { + odasStudio.mainWindow.show() + }) } // This method will be called when Electron has finished diff --git a/recordings.js b/recordings.js index 0872895..fe18067 100644 --- a/recordings.js +++ b/recordings.js @@ -4,7 +4,6 @@ const path = require('path') const url = require('url') const net = require('net') const wav = require('wav') -const reverser = require('buffer-reverse') /* Some hardcoded parameters for now Should be dynamic... @@ -31,11 +30,18 @@ exports.register = (_odasStudio) => { function createWindow () { - odasStudio.recordingsWindow = new BrowserWindow({width: 1200, height: 800, + + if(odasStudio.recordingsWindow != null) { + odasStudio.recordingsWindow.show() + return + } + + odasStudio.recordingsWindow = new BrowserWindow({width: 900, height: 700, 'web-preferences': { 'web-security': false, "webgl": true - }}) + }, + show:false}) odasStudio.recordingsWindow.loadURL(url.format({ pathname: path.join(__dirname, 'views/recordings.html'), @@ -48,6 +54,10 @@ function createWindow () { audioRecorders.forEach((recorder)=>{recorder.stopRecording()}) odasStudio.recordingsWindow = null }) + + odasStudio.recordingsWindow.on('ready-to-show', function() { + odasStudio.recordingsWindow.show() + }) } // Receive recording control diff --git a/ressources/css/style.css b/ressources/css/style.css index 95d8455..d17d94d 100644 --- a/ressources/css/style.css +++ b/ressources/css/style.css @@ -76,10 +76,10 @@ body { background-color: #dfefe7; width: 100%; - + z-index: 100; } - + .navbar-header { float: none; } @@ -120,15 +120,15 @@ body { } @media screen and (min-width: 992px) { - + #source-list { position: static; } - + .darker { background-color: #dfefe7; } - + .wrapper { height: 100vh; } @@ -136,7 +136,7 @@ body { .content { height: 100%; } - + .main { padding-top: 0; padding-bottom: 0; @@ -151,7 +151,7 @@ body { .graph-row { height: 30% } - + .graph { max-height: none } @@ -159,30 +159,30 @@ body { .sphere-row { height: 40% } - + #sphere_heading { position: absolute; padding-left: 10px } - + #sphere { padding-top: 0; } - + .abs_head { position: absolute } - + .graph { padding-top: 40px } - + #axis { position: absolute; bottom: 0; left: 15px; } - + .darker h2 { margin-top: 5px; } @@ -199,3 +199,12 @@ body { #right-marker { margin-left: 15px } + +.control { + cursor: pointer; +} + +.rec-body { + padding-top: 60px; + padding-bottom: 0px +} diff --git a/ressources/js/recordings_model.js b/ressources/js/recordings_model.js index 7d1f5d3..23ce491 100644 --- a/ressources/js/recordings_model.js +++ b/ressources/js/recordings_model.js @@ -17,7 +17,13 @@ class Recording { this.filename = path.basename(this.path) this.duration = 0 this.audio = undefined + this.deleting = 'hidden' + this.readInfo(true) + + } + + readInfo(retry) { // Read duration from wave file info.infoByFilename(this.path, (err, info) => { if(err == null) { @@ -41,6 +47,9 @@ class Recording { else { this.duration = -1 console.log(err) + if(retry) { + setTimeout(() => { this.readInfo(false)}, 3000) + } } }) } diff --git a/views/legal.html b/views/legal.html index 561dd1d..5fd38e5 100644 --- a/views/legal.html +++ b/views/legal.html @@ -12,8 +12,8 @@ @@ -52,7 +52,7 @@