var app = require('app'); var BrowserWindow = require('browser-window'); var Menu = require('menu'); var globalShortcut = require('global-shortcut') var fs = require('fs'); var Tray = require('tray'); var ipc = require('ipc'); require('crash-reporter').start(); // Start crash reporter // Creating menu var menu = new Menu(); Menu.setApplicationMenu(menu); var mainWindow = null; var audioController = null; // Make sure the application closes app.on('window-all-closed', function () { app.quit(); }); app.on('ready', function () { mainWindow = new BrowserWindow({ width: 800, height: 600, frame: false }); mainWindow.loadUrl('file://' + __dirname + '/index.html'); mainWindow.toggleDevTools(); mainWindow.on('closed', function() { mainWindow = undefined; audioController.close(); }); audioController = new BrowserWindow({ width: 1, height: 1, hide: true, frame: false }); audioController.loadUrl('file://' + __dirname + '/audio.html'); }); ipc.on('hide', function () { mainWindow.hide(); }); ipc.on('show', function () { mainWindow.show(); }); ipc.on('close', function () { mainWindow.close(); });