Revamp to use terminalizer-player for rendering

This commit is contained in:
Mohammad Fares
2018-11-04 18:16:32 +02:00
parent 8424b7364b
commit f757546b31
4 changed files with 160 additions and 116 deletions

View File

@@ -11,9 +11,19 @@ var path = require('path'),
ipcMain = require('electron').ipcMain,
os = require('os');
// Set as global to be read by the web page
/**
* The step option
* To reduce the number of rendered frames (step > 1)
* @type {Number}
*/
global.step = process.argv[2] || 1;
/**
* The temporary rendering directory's path
* @type {String}
*/
global.renderDir = path.join(__dirname, 'frames');
// Set the display scale factor to 1
app.commandLine.appendSwitch('force-device-scale-factor', 1);
@@ -55,10 +65,11 @@ ipcMain.on('captured', function(event, recordIndex) {
* A callback function for the event:
* When something unexpected happened
*
* @param {String} errorMsg
* @param {Object} event
* @param {String} error
*/
ipcMain.on('error', function(errorMsg) {
ipcMain.on('error', function(event, error) {
console.error(errorMsg);
process.stderr.write(error);
});