diff --git a/HISTORY.md b/HISTORY.md index c03ca082..e5ff706f 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,6 +8,7 @@ * **Notable Changes:** * searching for blocks and keyboard entry now includes the contents of dropdown menus * disabled dropping reporters into certain dropdowns (monadic functions, types, costume attributees, graphic effects, layers, audio attributes, pen attributes, dates, relation, keys, video attributes) + * changed VIDEOP _ ON _ reporter primitive to be hyper-monadic (second slot) * **Notable Fixes:** * keep internal linked-list organization intact for hyperblocks @@ -19,6 +20,7 @@ * blocks: made audio attributes menu static * blocks: made pen attributes menus static * blocks: made sensing attributes menus largely static +* threads: changed reportVideo() to be hyper-monadic ### 2020-11-30 * threads: keep internal linked-list organization intact for hyperblocks diff --git a/src/threads.js b/src/threads.js index 236bf870..c12e59fd 100644 --- a/src/threads.js +++ b/src/threads.js @@ -5306,8 +5306,11 @@ Process.prototype.doSetVideoTransparency = function(factor) { }; Process.prototype.reportVideo = function(attribute, name) { - // hyper-dyadic - var stage = this.blockReceiver().parentThatIsA(StageMorph); + // hyper-monadic + var thisObj = this.blockReceiver(), + stage = thisObj.parentThatIsA(StageMorph), + thatObj; + if (!stage.projectionSource || !stage.projectionSource.stream) { // wait until video is turned on if (!this.context.accumulator) { @@ -5318,17 +5321,13 @@ Process.prototype.reportVideo = function(attribute, name) { this.pushContext(); return; } - return this.hyperDyadic( - (att, obj) => this.reportBasicVideo(att, obj), - attribute, - name - ); -}; -Process.prototype.reportBasicVideo = function(attribute, name) { - var thisObj = this.blockReceiver(), - stage = thisObj.parentThatIsA(StageMorph), - thatObj = this.getOtherObject(name, thisObj, stage); + if (this.enableHyperOps) { + if (name instanceof List) { + return name.map(each => this.reportVideo(attribute, each)); + } + } + thatObj = this.getOtherObject(name, thisObj, stage); switch (this.inputOption(attribute)) { case 'motion': if (thatObj instanceof SpriteMorph) {