Skip to content

Commit

Permalink
added podId to SlideView to isolate events
Browse files Browse the repository at this point in the history
  • Loading branch information
antobinary committed Oct 23, 2017
1 parent 6f8abff commit 31ce060
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,19 @@ case class PresentationInPod(id: String, name: String, current: Boolean = false,
Some(newPres)
case None =>
None

}
}

}

case class PresentationPod(id: String, ownerId: String, currentPresenter: String, authorizedPresenters: Vector[String],
case class PresentationPod(id: String, ownerId: String, currentPresenter: String,
presentations: collection.immutable.Map[String, PresentationInPod]) {
def addPresentation(presentation: PresentationInPod): PresentationPod = {
copy(presentations = presentations + (presentation.id -> presentation))
}

def removePresentation(id: String): PresentationPod = copy(presentations = presentations - id)

def addAuthorizedPresenter(userId: String): PresentationPod = copy(authorizedPresenters = authorizedPresenters :+ userId)
def removeAuthorizedPresenter(userId: String): PresentationPod = copy(authorizedPresenters =
authorizedPresenters.filterNot(u => u == userId))

def setCurrentPresenter(userId: String): PresentationPod = copy(currentPresenter = userId)
// def getCurrentPresenter(): String = currentPresenter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ package org.bigbluebutton.modules.present.services.messaging
import org.bigbluebutton.modules.present.events.ConversionUnsupportedDocEvent;
import org.bigbluebutton.modules.present.events.ConversionUpdateEvent;
import org.bigbluebutton.modules.present.events.CreatingThumbnailsEvent;
import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent;
import org.bigbluebutton.modules.present.events.NewPresentationPodCreated;
import org.bigbluebutton.modules.present.events.OfficeDocConvertFailedEvent;
import org.bigbluebutton.modules.present.events.OfficeDocConvertInvalidEvent;
import org.bigbluebutton.modules.present.events.OfficeDocConvertSuccessEvent;
import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass;
import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail;
import org.bigbluebutton.modules.present.events.NewPresentationPodCreated;
import org.bigbluebutton.modules.present.events.PresentationPodRemoved;
import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent;
import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail;
import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass;
import org.bigbluebutton.modules.present.services.Constants;
import org.bigbluebutton.modules.present.services.PresentationService;
import org.bigbluebutton.modules.present.services.messages.PageVO;
import org.bigbluebutton.modules.present.services.messages.PresentationVO;
import org.bigbluebutton.modules.present.services.messages.PresentationPodVO;
import org.bigbluebutton.modules.present.services.messages.PresentationVO;


public class MessageReceiver implements IMessageListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var pollMenuData:Array;
private var pollMenu:Menu;
[Bindable]
private var podId: String = "";
private var ownerId: String = "";
Expand Down Expand Up @@ -1004,7 +1005,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
</fx:Declarations>

<mx:Canvas width="100%" height="100%" styleName="slideViewBackground" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<views:SlideView id="slideView" width="100%" height="100%" visible="false" mouseDown="mouseDown = true" mouseUp="mouseDown = false"/>
<views:SlideView id="slideView" podId="{this.podId}" width="100%" height="100%" visible="false" mouseDown="mouseDown = true" mouseUp="mouseDown = false"/>
</mx:Canvas>

<mx:ControlBar id="presCtrlBar" name="presCtrlBar" width="100%" verticalAlign="top" styleName="presentationWindowControlsStyle" paddingTop="6" paddingBottom="6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable]
public var slideModel:SlideViewModel = new SlideViewModel();
public var podId:String;
private var pageCache:ArrayCollection = new ArrayCollection();
private function onCreationComplete():void {
Expand Down Expand Up @@ -113,8 +116,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
}
public function setSlides(podId: String):void {
var pres: Presentation = PresentationPodManager.getInstance().getPod(podId).getCurrentPresentation();
public function setSlides(_podId: String):void {
if (_podId != this.podId) {
return;
}
var pres: Presentation = PresentationPodManager.getInstance().getPod(_podId).getCurrentPresentation();
if (pres != null) {
pageCache = pres.getPages();
/* Create the SortField object for the "num" field in the ArrayCollection object, and make sure we do a numeric sort. */
Expand Down Expand Up @@ -289,6 +296,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
* Handles notification from presenter that the slide has moved.
*/
private function handlePageChangedEvent(e:PageChangedEvent):void {
if (e.podId != this.podId) {
return;
}
LOGGER.debug("Got a page changed event for page [{0}]", [e.pageId]);
var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId);
if (page != null) {
Expand Down Expand Up @@ -316,25 +327,29 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function handlePageLoadedEvent(e:PageLoadedEvent):void {
LOGGER.debug("Got a page loaded event for page [{0}]", [e.pageId]);
var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId);
if (page != null) {
setSelectedSlide(page.num);
slideLoader.source = page.swfData;
LOGGER.debug("Displaying page [{0}]", [e.pageId]);
// positionPage(page);
if (whiteboardCanvas != null) {
whiteboardCanvas.displayWhiteboardById(page.id);
}
//slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end";
slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
}
if (e.podId != this.podId) {
return;
}
LOGGER.debug("Got a page loaded event for page [{0}]", [e.pageId]);
var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId);
if (page != null) {
setSelectedSlide(page.num);
slideLoader.source = page.swfData;
LOGGER.debug("Displaying page [{0}]", [e.pageId]);
// positionPage(page);
if (whiteboardCanvas != null) {
whiteboardCanvas.displayWhiteboardById(page.id);
}
//slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end";
slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
}
}
private function becomeViewer():void {
removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelZoomEvent);
this.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
Expand Down

0 comments on commit 31ce060

Please sign in to comment.