Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bug in osc goto #44

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/src/classes/EventTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,15 @@ export class EventTimer extends Timer {
}

loadEventById(eventId) {
let eventIndex = this._eventlist.findIndex((e) => e.id === eventId);
const eventIndex = this._eventlist.findIndex((e) => e.id === eventId);

if (eventIndex === -1) return;
this.pause();
this.loadEvent(eventIndex, 'load', true);
}

loadEventByIndex(eventIndex) {
if (eventIndex === -1 || index > this.numEvents) return;
if (eventIndex === -1 || eventIndex > this.numEvents) return;
this.pause();
this.loadEvent(eventIndex, 'load', true);
}
Expand Down
6 changes: 3 additions & 3 deletions server/src/controllers/OscController.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const initiateOSC = (config) => {
case 'delay':
console.log('calling delay with', args);
try {
let t = parseInt(args);
const t = parseInt(args);
if (isNaN(t)) {
console.error(`OSC IN: delay time not recognised ${args}`);
return;
Expand All @@ -84,13 +84,13 @@ export const initiateOSC = (config) => {
case 'goto':
console.log('calling goto with', args);
try {
let eventIndex = parseInt(args);
const eventIndex = parseInt(args);
if (isNaN(eventIndex) || eventIndex <= 0 || eventIndex == null) {
console.error(
`OSC IN: event index not recognised or out of range ${eventIndex}`
);
}
global.timer.loadEventByIndex(eventIndex - 1, undefined, true);
global.timer.loadEventByIndex(eventIndex - 1);
} catch (error) {
console.log('error calling goto: ', error);
}
Expand Down