Skip to content

Commit

Permalink
Fixed setting Audio library location
Browse files Browse the repository at this point in the history
Fixed region error when zooming
  • Loading branch information
Mattk70 committed Oct 20, 2024
1 parent e59890f commit 8950b46
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,13 @@ function zoomSpec(direction) {
}
}
// Keep playhead at same time in file
position = clamp((timeNow - bufferBegin) / windowLength, 0, 1);
position = (timeNow - bufferBegin) / windowLength;
// adjust region start time to new window start time
let region = getRegion();
if (region) {
const duration = region.end - region.start;
region.start = region.start + (oldBufferBegin - bufferBegin);
region.end = region.start + duration;
const {start, end} = region;
if (start < 0 || start > windowLength || end > windowLength) region = undefined;

region.start = (oldBufferBegin + region.start) - bufferBegin;
region.end = region.start + duration;
}
postBufferUpdate({ begin: bufferBegin, position: position, region: region, goToRegion: false })
}
Expand Down Expand Up @@ -1426,11 +1423,11 @@ async function resultClick(e) {
}

const [file, start, end, sname, label] = row.getAttribute('name').split('|');
if (row.classList.contains('table-active')){
createRegion(start - bufferBegin, end - bufferBegin, label, true);
e.target.classList.contains('circle') && getSelectionResults(true);
return;
}
// if (row.classList.contains('table-active')){
// createRegion(start - bufferBegin, end - bufferBegin, label, true);
// e.target.classList.contains('circle') && getSelectionResults(true);
// return;
// }

// Search for results rows - Why???
while (!(row.classList.contains('nighttime') ||
Expand Down Expand Up @@ -3185,7 +3182,7 @@ function centreSpec(){
region.play()
}
} else {
//clearActive();
resetRegions();
}
fileLoaded = true;
//if (activeRow) activeRow.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
Expand Down Expand Up @@ -4567,7 +4564,7 @@ DOM.gain.addEventListener('input', () => {
if (! files.canceled) {
const archiveFolder = files.filePaths[0];
config.archive.location = archiveFolder;
exploreLink.classList.contains('disabled') ||
DOM.exploreLink.classList.contains('disabled') ||
document.getElementById('compress-and-organise').classList.remove('disabled');
document.getElementById('archive-location').value = archiveFolder;
updatePrefs('config.json', config);
Expand Down

0 comments on commit 8950b46

Please sign in to comment.