diff --git a/js/gainControl.js b/js/gainControl.js index dd13b81..97cb7c5 100644 --- a/js/gainControl.js +++ b/js/gainControl.js @@ -82,7 +82,7 @@ restoreButton.addEventListener('click', () => { function parseListEntry (line) { - const gainRegex = /gain [0|1|2|3|4]/; + const gainRegex = / gain (0|1|2|3|4)\b/; const gainRegexResult = gainRegex.exec(line); if (!gainRegexResult) { @@ -93,9 +93,9 @@ function parseListEntry (line) { } - const gain = parseInt(gainRegexResult[0].split(' ')[1]); + const gain = parseInt(gainRegexResult[1]); - const lgrRegex = /lgr/; + const lgrRegex = / lgr\b/; const lgrRegexResult = lgrRegex.exec(line); let lgr = false; diff --git a/main.js b/main.js index 27f830a..c521b91 100644 --- a/main.js +++ b/main.js @@ -320,19 +320,6 @@ const createWindow = () => { mainWindow.webContents.send('high-sample-rate-default', menuItem.checked); - } - }, { - type: 'checkbox', - id: 'lowAmpColourScale', - label: 'Enable Low-Amplitude Colour Scale', - accelerator: 'CommandOrControl+J', - checked: false, - click: () => { - - const menuItem = menu.getMenuItemById('lowAmpColourScale'); - - mainWindow.webContents.send('low-amp-colour-scale', menuItem.checked); - } }, { type: 'separator' @@ -400,6 +387,21 @@ const createWindow = () => { updateColours(COLOUR_MAP_INVERSE_MONOCHROME); + } + }, { + type: 'separator' + }, { + type: 'checkbox', + id: 'lowAmpColourScale', + label: 'Enable Low-Amplitude Colour Scale', + accelerator: 'CommandOrControl+J', + checked: false, + click: () => { + + const menuItem = menu.getMenuItemById('lowAmpColourScale'); + + mainWindow.webContents.send('low-amp-colour-scale', menuItem.checked); + } }] }, { diff --git a/package.json b/package.json index 9118171..cc575a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "AudioMoth-Live", - "version": "1.1.1", + "version": "1.1.2", "description": "An Electron-based application for recording and analysing live audio from high sample rate microphones, including the AudioMoth USB Microphone.", "main": "main.js", "scripts": {