Skip to content

Commit

Permalink
feat(nodecg-utility-obs): forward all data from TransitionBegin event
Browse files Browse the repository at this point in the history
  • Loading branch information
from-the-river-to-the-sea committed Jun 5, 2018
1 parent d48534a commit cf1563d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/nodecg-utility-obs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,13 @@ class OBSUtility extends OBSWebSocket {
};
});

this.on('TransitionBegin', () => {
this.on('TransitionBegin', data => {
const toScene = previewScene.value ? previewScene.value.name : undefined;
nodecg.sendMessage(`${namespace}:transitioning`, {
sceneName: toScene,
fromScene: programScene.value ? programScene.value.name : undefined,
toScene
toScene,
...data
});
transitioning.value = true;
});
Expand Down
6 changes: 4 additions & 2 deletions packages/nodecg-utility-obs/test/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ test('on TransitionBegin', t => {
t.context.obs.replicants.previewScene.value = {name: 'to-scene'};
t.context.obs.replicants.programScene.value = {name: 'from-scene'};

t.context.obs.emit('TransitionBegin');
t.context.obs.emit('TransitionBegin', {name: 'Transiton Name', duration: 500});

t.is(t.context.obs.replicants.transitioning.value, true);
t.true(t.context.nodecg.sendMessage.calledOnce);
Expand All @@ -323,7 +323,9 @@ test('on TransitionBegin', t => {
{
sceneName: 'to-scene',
toScene: 'to-scene',
fromScene: 'from-scene'
fromScene: 'from-scene',
name: 'Transiton Name',
duration: 500
}
]);
});
Expand Down

0 comments on commit cf1563d

Please sign in to comment.