Skip to content

Commit

Permalink
Mac tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Jan 30, 2024
1 parent f52f22e commit aff3724
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
20 changes: 10 additions & 10 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2294,7 +2294,7 @@ document.getElementById('timelineSetting').addEventListener('change', timelineTo

const GLOBAL_ACTIONS = { // eslint-disable-line
KeyA: async function (e) {
if (e.ctrlKey) {
if ( e.ctrlKey || e.metaKey) {
if (currentFile) {
if (e.shiftKey) analyseAllLink.click();
else analyseLink.click()
Expand All @@ -2303,7 +2303,7 @@ const GLOBAL_ACTIONS = { // eslint-disable-line
},
KeyC: function (e) {
// Center window on playhead
if (e.ctrlKey && currentBuffer) {
if (( e.ctrlKey || e.metaKey) && currentBuffer) {
const saveBufferBegin = bufferBegin;
const middle = bufferBegin + wavesurfer.getCurrentTime();
bufferBegin = middle - windowLength / 2;
Expand All @@ -2321,33 +2321,33 @@ const GLOBAL_ACTIONS = { // eslint-disable-line
}
},
KeyD: function (e) {
if (e.ctrlKey && e.shiftKey) worker.postMessage({ action: 'convert-dataset' });
if (( e.ctrlKey || e.metaKey) && e.shiftKey) worker.postMessage({ action: 'convert-dataset' });
},
KeyE: function (e) {
if (e.ctrlKey && region) exportAudio();
if (( e.ctrlKey || e.metaKey) && region) exportAudio();
},
KeyF: function (e) {
if (e.ctrlKey) toggleFullscreen();
if ( e.ctrlKey || e.metaKey) toggleFullscreen();
},
KeyG: function (e) {
if (e.ctrlKey) showGoToPosition();
if ( e.ctrlKey || e.metaKey) showGoToPosition();
},
KeyO: async function (e) {
if (e.ctrlKey) await showOpenDialog();
if ( e.ctrlKey || e.metaKey) await showOpenDialog();
},
KeyP: function () {
(typeof region !== 'undefined') ? region.play() : console.log('Region undefined')
},
KeyS: function (e) {
if (e.ctrlKey) {
if ( e.ctrlKey || e.metaKey) {
worker.postMessage({ action: 'save2db', file: currentFile});
}
},
KeyT: function (e) {
if (e.ctrlKey) timelineToggle(true);
if ( e.ctrlKey || e.metaKey) timelineToggle(true);
},
KeyZ: function (e) {
if (e.ctrlKey && DELETE_HISTORY.length) insertManualRecord(...DELETE_HISTORY.pop());
if (( e.ctrlKey || e.metaKey) && DELETE_HISTORY.length) insertManualRecord(...DELETE_HISTORY.pop());
},
Escape: function () {
if (PREDICTING) {
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ app.whenReady().then(async () => {
app.dock.bounce();
// Close app on Command+Q on OSX
globalShortcut.register('Command+Q', () => {
app.quit();
if (mainWindow.isFocused())app.quit();
})
} else {
// Quit when all windows are closed.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "electron .",
"minify": "node minify.js",
"export": "electron-builder build -w --x64",
"export": "electron-builder build -m",
"publish": "electron-builder --win --x64 -p always"
},
"repository": {
Expand Down Expand Up @@ -98,7 +98,7 @@
],
"mac": {
"target": {
"target": "dmg",
"target": "pkg",
"arch": "arm64"
},
"files": [
Expand Down Expand Up @@ -186,6 +186,7 @@
"@easepick/bundle": "^1.2.1",
"@fast-csv/format": "^4.3.5",
"@popperjs/core": "^2.9.2",
"@tensorflow/tfjs-core": "^4.14.0",
"@tensorflow/tfjs-node": "^4.14.0",
"bootstrap": "5.2.2",
"browser-id3-writer": "^4.4.0",
Expand Down

0 comments on commit aff3724

Please sign in to comment.