diff --git a/client/src/features/modals/OscSettingsModal.jsx b/client/src/features/modals/OscSettingsModal.jsx index 4ba39bd56a..218a6bdeae 100644 --- a/client/src/features/modals/OscSettingsModal.jsx +++ b/client/src/features/modals/OscSettingsModal.jsx @@ -169,7 +169,6 @@ export default function OscSettingsModal() { active={formData.enabled} text={formData.enabled ? 'OSC IN Enabled' : 'OSC IN Disabled'} actionHandler={() => handleChange('enabled', !formData.enabled)} - onClick={() => console.log('yay')} /> diff --git a/server/src/classes/EventTimer.js b/server/src/classes/EventTimer.js index 72701aa8ac..b63bc7a935 100644 --- a/server/src/classes/EventTimer.js +++ b/server/src/classes/EventTimer.js @@ -336,8 +336,11 @@ export class EventTimer extends Timer { case 'onPause': // broadcast current state this.broadcastState(); + // send OSC - this.sendOsc(this.osc.implemented.pause); + if (this.prevCycle === this.cycleState.onUpdate) { + this.sendOsc(this.osc.implemented.pause); + } // check integrations - http if (h?.onLoad?.enabled) { @@ -1278,9 +1281,12 @@ export class EventTimer extends Timer { if (this.selectedEventIndex === 0) return; // if there is no event running, go to first - if (this.selectedEventIndex == null) { + if (!this.selectedEventIndex) { this.loadEvent(0); - return; + } else { + const gotoEvent = this.selectedEventIndex > 0 ? this.selectedEventIndex - 1 : 0; + if (gotoEvent === this.selectedEventIndex) return; + this.loadEvent(gotoEvent); } // send OSC @@ -1288,11 +1294,6 @@ export class EventTimer extends Timer { // change playstate this.pause(); - - const gotoEvent = this.selectedEventIndex > 0 ? this.selectedEventIndex - 1 : 0; - - if (gotoEvent === this.selectedEventIndex) return; - this.loadEvent(gotoEvent); } next() { @@ -1303,9 +1304,15 @@ export class EventTimer extends Timer { if (this.selectedEventIndex === this.numEvents - 1) return; // if there is no event running, go to first - if (this.selectedEventIndex == null) { + if (!this.selectedEventIndex) { this.loadEvent(0); - return; + } else { + const gotoEvent = + this.selectedEventIndex < this.numEvents - 1 + ? this.selectedEventIndex + 1 + : this.numEvents - 1; + if (gotoEvent === this.selectedEventIndex) return; + this.loadEvent(gotoEvent); } // send OSC @@ -1313,14 +1320,6 @@ export class EventTimer extends Timer { // change playstate this.pause(); - - const gotoEvent = - this.selectedEventIndex < this.numEvents - 1 - ? this.selectedEventIndex + 1 - : this.numEvents - 1; - - if (gotoEvent === this.selectedEventIndex) return; - this.loadEvent(gotoEvent); } unload() {