Skip to content

Commit

Permalink
Add 1.9.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcprince committed Oct 17, 2022
1 parent 665a0b1 commit f6c4d12
Show file tree
Hide file tree
Showing 14 changed files with 823 additions and 455 deletions.
45 changes: 36 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function openSplitWindow () {

splitWindow = new BrowserWindow({
width: 565,
height: shrinkWindowHeight(403),
height: shrinkWindowHeight(468),
title: 'Split AudioMoth WAV Files',
useContentSize: true,
resizable: false,
Expand Down Expand Up @@ -116,7 +116,7 @@ function openExpansionWindow () {

expansionWindow = new BrowserWindow({
width: 565,
height: shrinkWindowHeight(575),
height: shrinkWindowHeight(643),
title: 'Expand AudioMoth T.WAV Files',
useContentSize: true,
resizable: false,
Expand Down Expand Up @@ -173,7 +173,7 @@ function openDownsamplingWindow () {

downsampleWindow = new BrowserWindow({
width: 565,
height: shrinkWindowHeight(380),
height: shrinkWindowHeight(448),
title: 'Downsample AudioMoth WAV Files',
useContentSize: true,
resizable: false,
Expand Down Expand Up @@ -558,14 +558,23 @@ ipcMain.on('start-expansion-bar', (event, fileCount) => {

});

ipcMain.on('set-expansion-bar-progress', (event, fileNum, progress, name) => {
ipcMain.on('set-expansion-bar-progress', (event, fileNum, progress) => {

if (expandProgressBar) {

expandProgressBar.value = (fileNum * 100) + progress;

}

});

ipcMain.on('set-expansion-bar-file', (event, fileNum, name) => {

const index = fileNum + 1;
const fileCount = expandProgressBar.getOptions().maxValue / 100;

if (expandProgressBar) {

expandProgressBar.value = (fileNum * 100) + progress;
expandProgressBar.detail = 'Expanding ' + name + ' (' + index + ' of ' + fileCount + ').';

}
Expand Down Expand Up @@ -691,14 +700,23 @@ ipcMain.on('start-split-bar', (event, fileCount) => {

});

ipcMain.on('set-split-bar-progress', (event, fileNum, progress, name) => {
ipcMain.on('set-split-bar-progress', (event, fileNum, progress) => {

if (splitProgressBar) {

splitProgressBar.value = (fileNum * 100) + progress;

}

});

ipcMain.on('set-split-bar-file', (event, fileNum, name) => {

const index = fileNum + 1;
const fileCount = splitProgressBar.getOptions().maxValue / 100;

if (splitProgressBar) {

splitProgressBar.value = (fileNum * 100) + progress;
splitProgressBar.detail = 'Splitting ' + name + ' (' + index + ' of ' + fileCount + ').';

}
Expand Down Expand Up @@ -824,14 +842,23 @@ ipcMain.on('start-downsample-bar', (event, fileCount) => {

});

ipcMain.on('set-downsample-bar-progress', (event, fileNum, progress, name) => {
ipcMain.on('set-downsample-bar-progress', (event, fileNum, progress) => {

if (downsampleProgressBar) {

downsampleProgressBar.value = (fileNum * 100) + progress;

}

});

ipcMain.on('set-downsample-bar-file', (event, fileNum, name) => {

const index = fileNum + 1;
const fileCount = downsampleProgressBar.getOptions().maxValue / 100;

if (downsampleProgressBar) {

downsampleProgressBar.value = (fileNum * 100) + progress;
downsampleProgressBar.detail = 'Downsampling ' + name + ' (' + index + ' of ' + fileCount + ').';

}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AudioMoth-Config",
"version": "1.8.1",
"version": "1.9.0",
"description": "The configuration app for the AudioMoth acoustic monitoring device.",
"main": "main.js",
"author": "openacousticdevices.info",
Expand Down Expand Up @@ -57,8 +57,6 @@
}
},
"devDependencies": {
"electron": "8.5.2",
"electron-builder": "^22.11.7",
"eslint": "^7.27.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.22.1",
Expand All @@ -67,6 +65,8 @@
"eslint-plugin-standard": "^4.0.2"
},
"dependencies": {
"electron": "8.5.2",
"electron-builder": "^22.11.7",
"audiomoth-hid": "^2.1.0",
"audiomoth-utils": "^1.2.0",
"bootstrap": "4.3.1",
Expand Down
131 changes: 46 additions & 85 deletions processing/downsampling.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,104 +109,64 @@
</div>
</div>

<div class="fixed-bottom" style="width: 100%; padding: 11px; padding-top: 8px;">

<div class="row" style="margin-top: 8px;">
<div style="border: #cdcdcd thin solid; margin-left: 15px; width: 543px;">

<div class="row" style="margin-top: 8px; margin-bottom: 8px;">
<div class="col-1">
<input id="prefix-checkbox" type="checkbox" style="margin-left: 16px; margin-top: 9px;">
</div>
<div class="col-5" style="padding-left: 0px;">
<div style="margin-top: 6px; margin-bottom: 0px; text-align: left;">
<label id="prefix-label" for="prefix-checkbox" title="Prefix which will be added to WAV file to differentiate it from the original file" style="margin-left: 20px;" class="grey">Add WAV file prefix:</label>
</div>
</div>
<div class="col-6">
<div style="text-align: right; margin-top: 2px; margin-bottom: 0px; margin-right: 16px;">
<input id="prefix-input" maxlength="20" disabled style="text-align: right;" class="grey">
</div>
</div>
</div>

</div>
</div>
<div class="row" style="margin-top: 8px;">
<div style="border: #cdcdcd thin solid; margin-left: 15px; width: 543px;">

<div class="row" style="margin-top: 8px;">
<div style="border: #cdcdcd thin solid; margin-left: 15px; width: 543px;">

<div class="row" style="margin-top: 8px; margin-bottom: 8px;">
<div class="col-1">
<input id="output-checkbox" type="checkbox" style="margin-left: 16px; margin-top: 12px;">
</div>
<div class="col-4" style="padding-left: 0px;">
<button id="output-button" class="btn btn-primary" style="width: 100%; margin-left: 16px;" disabled>Select Destination</button>
</div>
<div class="col-7">
<div style="margin-top: 11px; text-align: right; margin-right: 16px;">
<span id="output-label" title="'." class="grey">Writing WAV files to source folder.</span>
</div>
<div class="row" style="margin-top: 1%; margin-bottom: 8px;">
<div class="col-12">
<div style="margin-left: 8px; margin-right: 8px">
<table class="table" style="margin-bottom: 8px;">
<tr class="settings-text" style="font-size: 12px;" title="Select multiple files or a folder of recordings.">
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;" name="selection-radio-label">File</td>
<td align="center" style="padding: 0px; width: 45px;" name="selection-radio-label">Folder</td>
</tr>
<tr class="settings-text" title="Select multiple files or a folder of recordings.">
<td align="left" style="padding-top: 0px; padding-bottom: 0px;" id="selection-type-label">Selection type:</td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px">
<input class="settings-inputs" type="radio" value="0" name="selection-radio" checked>
</td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px">
<input class="settings-inputs" type="radio" value="1" name="selection-radio">
</td>
</tr>
</table>
</div>
</div>

</div>
</div>

<div class="row" style="margin-top: 8px;">
<div style="border: #cdcdcd thin solid; margin-left: 15px; width: 543px;">

<div class="row" style="margin-top: 1%; margin-bottom: 8px;">
<div class="col-12">
<div style="margin-left: 8px; margin-right: 8px">
<table class="table" style="margin-bottom: 8px;">
<tr class="settings-text" style="font-size: 12px;" title="Select multiple files or a folder of recordings.">
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;"></td>
<td align="center" style="padding: 0px;" name="selection-radio-label">File</td>
<td align="center" style="padding: 0px; width: 45px;" name="selection-radio-label">Folder</td>
</tr>
<tr class="settings-text" title="Select multiple files or a folder of recordings.">
<td align="left" style="padding-top: 0px; padding-bottom: 0px;" id="selection-type-label">Selection type:</td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px"></td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px">
<input class="settings-inputs" type="radio" value="0" name="selection-radio" checked>
</td>
<td align="center" style="padding-top: 0px; padding-bottom: 0px">
<input class="settings-inputs" type="radio" value="1" name="selection-radio">
</td>
</tr>
</table>
</div>
</div>
<div class="row" style="margin-top: 8px; margin-bottom: 8px;">
<div class="col-4">
<button id="file-button" class="btn btn-primary" style="width: 100%; margin-left: 16px;">Select Files</button>
</div>

<div class="row" style="margin-top: 8px; margin-bottom: 8px;">
<div class="col-4">
<button id="file-button" class="btn btn-primary" style="width: 100%; margin-left: 16px;">Select Files</button>
</div>
<div class="col-8">
<div style="margin-top: 11px; text-align: right; margin-right: 16px;">
<span id="file-label" title="AudioMoth recordings will have a file name ending in '.WAV'.">No AudioMoth WAV files selected.</span>
</div>
<div class="col-8">
<div style="margin-top: 11px; text-align: right; margin-right: 16px;">
<span id="file-label" title="AudioMoth recordings will have a file name ending in '.WAV'.">No AudioMoth WAV files selected.</span>
</div>
</div>
</div>
</div>
</div>

<div class="fixed-bottom" style="width: 100%; padding: 11px; padding-top: 8px;">

<div id="output-content"></div>

<div class="row" style="margin-top: 8px;">
<div class="col-12">
<button id="downsample-button" class="btn btn-success" disabled style="width: 100%;">Downsample Recordings</button>
<button id="downsample-button" class="btn btn-success" disabled style="width: 100%;">Downsample Files</button>
</div>
</div>
</div>
Expand All @@ -215,6 +175,7 @@

<script>
window.jQuery = window.$ = require('jquery');
$("#output-content").load('output.html');
</script>
<script src="../node_modules/bootstrap/dist/js/bootstrap.bundle.js"></script>
<script src="uiDownsampling.js" charset="utf-8"></script>
Expand Down
Loading

0 comments on commit f6c4d12

Please sign in to comment.