forked from cdgco/01V-Web-Controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
29 lines (23 loc) · 849 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const { ipcMain, BrowserWindow, app, dialog, Tray, Menu } = require('electron')
function createWindow() {
let win = new BrowserWindow({
width: 400,
height: 450,
webPreferences: {
nodeIntegration: true
},
icon: 'assets/homescreen512.png'
})
win.setMenuBarVisibility(false)
win.loadFile('launch.html')
}
ipcMain.on('input-broadcast', function(event, input, output, port) {
const midi = require('./app');
if (midi.connectOutport(input, output, port) == 1) {
dialog.showErrorBox("Midi Error", "Unable to open selected midi device. Attempting to open default device. Please try again later.");
}
});
process.on("uncaughtException", (err) => {
dialog.showErrorBox("Error", "Something failed. Please try again later.");
});
app.whenReady().then(createWindow)