- Created a sample module for potential developers

- Deleted some junk that we don't need
- Cleaned up code in the main and common packages

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@560 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Denis Zgonjanin 2008-10-13 05:28:10 +00:00
parent d1c33a7a17
commit 367693e202
48 changed files with 455 additions and 712 deletions

View File

@ -37,6 +37,7 @@
<module application="src/BigBlueButton.mxml" destPath="org/bigbluebutton/modules/chat/chat_module.swf" optimize="true" sourcePath="src/org/bigbluebutton/modules/chat/chat_module.mxml"/>
<module application="src/BigBlueButton.mxml" destPath="org/bigbluebutton/modules/video/video_module.swf" optimize="true" sourcePath="src/org/bigbluebutton/modules/video/video_module.mxml"/>
<module application="src/BigBlueButton.mxml" destPath="org/bigbluebutton/modules/playback/playback_module.swf" optimize="true" sourcePath="src/org/bigbluebutton/modules/playback/playback_module.mxml"/>
<module application="src/BigBlueButton.mxml" destPath="org/bigbluebutton/modules/sample_module/sample_module.swf" optimize="true" sourcePath="src/org/bigbluebutton/modules/sample_module/sample_module.mxml"/>
</modules>
<buildCSSFiles/>
</actionScriptProperties>

View File

@ -22,7 +22,6 @@ package org.bigbluebutton.common
import flexlib.mdi.containers.MDIWindow;
import mx.controls.Button;
import mx.modules.ModuleBase;
import org.bigbluebutton.common.red5.Connection;
import org.bigbluebutton.common.red5.ConnectionEvent;
@ -37,19 +36,30 @@ package org.bigbluebutton.common
*/
public class BigBlueButtonModule
{
//This is the X position on the screen where you would like your module to appear
public var preferedX:Number;
//This is the Y position on the screen where you would like your module to appear
public var preferedY:Number;
//This is the MDIWindow that should be used as the main display component of your application
private var MDIComponent:MDIWindow;
public var name:String;
//This is the name of your module
protected var name:String;
public var _router:Router;
public var mshell:MainApplicationShell;
private var conn:Connection;
private var connE:ConnectionEvent;
//This is the time at which your module will start. Please enter one of the START Constants from below...
public var startTime:String;
public var addButton:Boolean = false;
//This tells BBB whether you'd like a button for your module added in the main toolbar
protected var addButton:Boolean;
//If you placed 'true' in addButton, the button will be placed in this button variable, so that you may control it
public var button:Button;
//This is the display name of your module, as the end user will see it. (on buttons, etc...)
protected var displayName:String;
public static const START_ON_LOGIN:String = "Start on Login";
public static const START_ON_CREATION_COMPLETE:String = "Start on Creation Complete";
@ -120,8 +130,41 @@ package org.bigbluebutton.common
this._router = router;
}
public function moduleAdded():void{
/**
* Called from the main program. Tells the program whether you'd like a button added to the main toolbar
* @return
*
*/
public function hasButton():Boolean{
return this.addButton;
}
/**
* Returns the name of the module
* @return
*
*/
public function getID():String{
return this.name;
}
/**
* Returns the user-friendly display name of the module
* @return
*
*/
public function getDisplayName():String{
return this.displayName;
}
/**
* Returns the time at which this module should start
* @return
*
*/
public function getStartTime():String{
return this.startTime;
}
}

View File

@ -0,0 +1,76 @@
package org.bigbluebutton.common
{
import flexlib.mdi.containers.MDIWindow;
import org.bigbluebutton.main.MainApplicationConstants;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
import org.puremvc.as3.multicore.utilities.pipes.messages.Message;
import org.puremvc.as3.multicore.utilities.pipes.plumbing.PipeListener;
/**
* This is a convinience class you can extend when creating a module. It abstracts away many annoying parts concerning
* communication with the BigBlueButton core.
* @author Denis
*
*/
public class ModuleMediator extends Mediator implements IMediator
{
private var outpipe : OutputPipe;
private var inpipe : InputPipe;
private var router : Router;
private var inpipeListener : PipeListener;
private var displayComponent:MDIWindow;
private var name:String;
private var toString:String;
private var fromString:String;
/**
* The Constructor.
* @param viewComponent - Your BigBlueButtonModule class
* @param toString - A constant String that the Core program will use to communicate to your module
* @param fromString - A constant String that your program will use to communicate to the Core program
*
*/
public function ModuleMediator(viewComponent:BigBlueButtonModule, toString:String, fromString:String)
{
super(name, viewComponent);
router = viewComponent.router;
this.toString = toString;
this.fromString = fromString;
inpipe = new InputPipe(toString);
outpipe = new OutputPipe(fromString);
inpipeListener = new PipeListener(this, messageReceiver);
inpipe.connect(inpipeListener);
router.registerOutputPipe(outpipe.name, outpipe);
router.registerInputPipe(inpipe.name, inpipe);
displayComponent = viewComponent.getMDIComponent();
addWindow();
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
}
private function addWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader( {MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: fromString,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH );
msg.setBody(this.viewComponent as BigBlueButtonModule);
outpipe.write(msg);
}
/**
* Messages sent to your module will be received here. Override this function if you wish to receive them
* @param message
*
*/
protected function messageReceiver(message:IPipeMessage):void{
}
}
}

View File

@ -5,4 +5,5 @@
<module id="Voice" swfpath="org/bigbluebutton/modules/voiceconference/voice_module.swf" />
<module id="Whiteboard" swfpath="org/bigbluebutton/modules/whiteboard/whiteboard_module.swf" />
<module id="Playback" swfpath="org/bigbluebutton/modules/playback/playback_module.swf" />
<module id="Sample" swfpath="org/bigbluebutton/modules/sample_module/sample_module.swf" />
</modules>

View File

@ -3,6 +3,6 @@
<module id="Presentation" swfpath="org/bigbluebutton/modules/presentation/presentation_module.swf" />
<module id="Video" swfpath="org/bigbluebutton/modules/video/video_module.swf" />
<module id="Voice" swfpath="org/bigbluebutton/modules/voiceconference/voice_module.swf" />
<module id="Playback" swfpath="org/bigbluebutton/modules/playback/playback_module.swf" />
<module id="Whiteboard" swfpath="org/bigbluebutton/modules/whiteboard/whiteboard_module.swf" />
<module id="Playback" swfpath="org/bigbluebutton/modules/playback/playback_module.swf" />
</modules>

View File

@ -77,7 +77,6 @@ package org.bigbluebutton.main
modules.addItem(loader);
loader.addEventListener(ModuleEvent.READY, moduleReady);
loader.url = path;
//Alert.show(loader.url);
loader.loadModule();
}

View File

@ -1,26 +0,0 @@
package org.bigbluebutton.main
{
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
public class ModuleMediator extends Mediator implements IMediator
{
public function ModuleMediator()
{
}
override public function listNotificationInterests():Array{
return [];
}
override public function handleNotification(notification:INotification):void{
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
}
}
}

View File

@ -168,7 +168,7 @@ package org.bigbluebutton.main.view
modules = new Array();
logModule = new LogModule();
runModule(logModule);
logModule.mediator.logWindow.visible = false;
//logModule.mediator.logWindow.visible = false;
runModule(new ViewersModule());
shell.toolbar.enabled = false;
}
@ -206,7 +206,7 @@ package org.bigbluebutton.main.view
*
*/
private function addButton(module:BigBlueButtonModule):void{
var button:Button = mshell.toolbar.addButton(module.name);
var button:Button = mshell.toolbar.addButton(module.getDisplayName());
button.addEventListener(MouseEvent.CLICK, openModule);
}
@ -235,7 +235,7 @@ package org.bigbluebutton.main.view
break;
case MainApplicationConstants.REMOVE_WINDOW_MSG:
module = message.getBody() as BigBlueButtonModule;
if(module.name == LogModule.NAME) {
if(module.getID() == LogModule.NAME) {
//shell.toolbar.LogBtn.enabled = true;
module.getMDIComponent().visible = false;
} else removeWindow(module);
@ -280,7 +280,7 @@ package org.bigbluebutton.main.view
case MainApplicationFacade.ADD_MODULE:
var moduleNote:BigBlueButtonModule = notification.getBody() as BigBlueButtonModule;
addModule(moduleNote);
if (moduleNote.addButton) addButton(moduleNote);
if (moduleNote.hasButton()) addButton(moduleNote);
break;
case MainApplicationFacade.MODULES_STARTED:
runAddedModules(BigBlueButtonModule.START_ON_LOGIN);

View File

@ -55,7 +55,7 @@ package org.bigbluebutton.modules.chat
{
super(NAME);
log.debug("Creating new ChatWindow...");
chatWindow = new ChatWindow;
chatWindow = new ChatWindow();
log.debug("Getting an instance of Chat Facade...");
facade = ChatFacade.getInstance();
this.preferedX = 700;

View File

@ -1,35 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2008 by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.bigbluebutton.modules.chat
{
/**
*
* Class of Constants
*
*/
public class ChatModuleConstants
{
public static const FROM_CHAT_MODULE:String = 'FROM_CHAT_MODULE';
public static const TO_CHAT_MODULE:String = 'TO_CHAT_MODULE';
//public static const OPEN_WINDOW_MSG:String = 'OPEN_WINDOW_MSG';
//public static const CLOSE_WINDOW_MSG:String = 'CLOSE_WINDOW_MSG';
}
}

View File

@ -27,13 +27,11 @@ package org.bigbluebutton.modules.chat.view
import org.bigbluebutton.common.Router;
import org.bigbluebutton.main.MainApplicationConstants;
import org.bigbluebutton.modules.chat.ChatModule;
import org.bigbluebutton.modules.chat.ChatModuleConstants;
import org.bigbluebutton.modules.chat.model.business.ChatProxy;
import org.bigbluebutton.modules.chat.model.business.PlaybackProxy;
import org.bigbluebutton.modules.chat.model.vo.MessageVO;
import org.bigbluebutton.modules.chat.view.components.ChatWindow;
import org.bigbluebutton.modules.log.LogModuleFacade;
import org.bigbluebutton.modules.playback.PlaybackModuleConstants;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
@ -48,7 +46,6 @@ package org.bigbluebutton.modules.chat.view
public class ChatModuleMediator extends Mediator implements IMediator
{
public static const NAME:String = 'LogModuleMediator';
private var outpipe : OutputPipe;
private var inpipe : InputPipe;
@ -58,6 +55,12 @@ package org.bigbluebutton.modules.chat.view
private var log : LogModuleFacade = LogModuleFacade.getInstance("LogModule");
private var module:ChatModule;
private static const TO_CHAT_MODULE:String = "TO_CHAT_MODULE";
private static const FROM_CHAT_MODULE:String = "FROM_CHAT_MODULE";
private static const PLAYBACK_MESSAGE:String = "PLAYBACK_MESSAGE";
private static const PLAYBACK_MODE:String = "PLAYBACK_MODE";
/**
* Constructor
* It sets the required initialization for the router and piping
@ -70,9 +73,9 @@ package org.bigbluebutton.modules.chat.view
module = viewComponent;
router = viewComponent.router;
log.debug("initializing input pipes for chat module...");
inpipe = new InputPipe(ChatModuleConstants.TO_CHAT_MODULE);
inpipe = new InputPipe(TO_CHAT_MODULE);
log.debug("initializing output pipes for chat module...");
outpipe = new OutputPipe(ChatModuleConstants.FROM_CHAT_MODULE);
outpipe = new OutputPipe(FROM_CHAT_MODULE);
log.debug("initializing pipe listener for chat module...");
inpipeListener = new PipeListener(this, messageReceiver);
inpipe.connect(inpipeListener);
@ -88,15 +91,6 @@ package org.bigbluebutton.modules.chat.view
super.initializeNotifier(key);
}
//override public function handleNotification(note:INotification):void
//{
// switch(note.getName())
// {
//case ChatFacade.DEBUG:
//break;
// }
//}
/**
* prepares the chat window to be sent as a message through pipes to Shell
*
@ -105,7 +99,7 @@ package org.bigbluebutton.modules.chat.view
{
// create a message
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader( {MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: ChatModuleConstants.FROM_CHAT_MODULE,
msg.setHeader( {MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: FROM_CHAT_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH );
@ -126,7 +120,7 @@ package org.bigbluebutton.modules.chat.view
private function removeWindow(event:Event) : void
{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader( {MSG:MainApplicationConstants.REMOVE_WINDOW_MSG, SRC: ChatModuleConstants.FROM_CHAT_MODULE,
msg.setHeader( {MSG:MainApplicationConstants.REMOVE_WINDOW_MSG, SRC: FROM_CHAT_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH );
chatWindow.closeBtn.removeEventListener(MouseEvent.CLICK, removeWindow);
@ -156,14 +150,14 @@ package org.bigbluebutton.modules.chat.view
//Alert.show("Message received by Chat");
var msg : String = message.getHeader().MSG as String;
switch(msg){
case PlaybackModuleConstants.PLAYBACK_MODE:
case PLAYBACK_MODE:
//var proxy:ChatProxy = facade.retrieveProxy(ChatProxy.NAME) as ChatProxy;
//proxy = new PlaybackProxy(new MessageVO());
//Alert.show("playbackproxy registered");
facade.removeProxy(ChatProxy.NAME);
facade.registerProxy(new PlaybackProxy(new MessageVO()));
break;
case PlaybackModuleConstants.PLAYBACK_MESSAGE:
case PLAYBACK_MESSAGE:
playMessage(message.getBody() as XML);
break;
}

View File

@ -1,17 +0,0 @@
package org.bigbluebutton.modules.notes
{
public class NotesConstants
{
public static const FROM_NOTES_MODULE:String = "From Notes Module";
public static const TO_NOTES_MODULE:String = "To Notes Module";
public static const OPEN_WINDOW_MSG:String = "Open Window";
public static const CLOSE_WINDOW_MSG:String = "Close Window";
public static const ERROR:int = 1;
public static const WARN:int = 2;
public static const INFO:int = 3;
public static const DEBUG:int = 4;
}
}

View File

@ -1,33 +0,0 @@
package org.bigbluebutton.modules.notes
{
import org.puremvc.as3.multicore.interfaces.IFacade;
import org.puremvc.as3.multicore.patterns.facade.Facade;
public class NotesFacade extends Facade implements IFacade
{
public static const NAME:String = "NotesFacade";
//Notification constants for the Notes Module
public static const STARTUP = "StartNotesModule"
public function NotesFacade(key:String)
{
super(key);
}
public static function getInstance():NotesFacade{
if (instanceMap[NAME] == null) instanceMap[NAME] = new NotesFacade(NAME);
return instanceMap[NAME] as NotesFacade;
}
override protected function initializeController():void{
super.initializeController();
registerCommand(STARTUP, StartupNotesCommand);
}
public function startup(app:NotesModule):void{
sendNotification(STARTUP, app);
}
}
}

View File

@ -1,39 +0,0 @@
package org.bigbluebutton.modules.notes
{
import flexlib.mdi.containers.MDIWindow;
import org.bigbluebutton.common.BigBlueButtonModule;
import org.bigbluebutton.common.IRouterAware;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.main.view.components.MainApplicationShell;
public class NotesModule extends BigBlueButtonModule implements IRouterAware
{
public static const NAME:String = "NotesModule";
private var facade:NotesFacade;
public var activeWindow:MDIWindow;
public function NotesModule()
{
super(NAME);
facade = NotesFacade.getInstance();
this.preferedX = 400;
this.preferedY = 400;
this.startTime = BigBlueButtonModule.START_ON_LOGIN;
}
override public function acceptRouter(router:Router, shell:MainApplicationShell):void{
super.acceptRouter(router, shell);
}
override public function getMDIComponent():MDIWindow{
return this.activeWindow;
}
override public function logout():void{
facade.removeCore(NotesFacade.NAME);
}
}
}

View File

@ -1,69 +0,0 @@
package org.bigbluebutton.modules.notes
{
import org.bigbluebutton.common.InputPipe;
import org.bigbluebutton.common.OutputPipe;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.modules.notes.view.NotesWindow;
import org.bigbluebutton.modules.notes.view.NotesWindowMediator;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
import org.puremvc.as3.multicore.utilities.pipes.plumbing.PipeListener;
public class NotesModuleMediator extends Mediator implements IMediator
{
public static const NAME:String = "NotesModuleMediator";
private var outpipe : OutputPipe;
private var inpipe : InputPipe;
private var router : Router;
private var inpipeListener : PipeListener;
private var notesWindow:NotesWindow;
public function NotesModuleMediator(module:NotesModule)
{
super(NAME, module);
inpipe = new InputPipe(NotesConstants.TO_NOTES_MODULE);
outpipe = new OutputPipe(NotesConstants.FROM_NOTES_MODULE);
inpipeListener = new PipeListener(this, messageReceiver);
router.registerOutputPipe(outpipe.name, outpipe);
router.registerInputPipe(inpipe.name, inpipe);
addWindow();
}
private function messageReceiver(message:IPipeMessage):void{
var msg:String = message.getHeader().MSG;
}
private function get module():NotesModule{
return viewComponent as NotesModule;
}
private function addWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: NotesConstants.FROM_NOTES_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);
notesWindow = new NotesWindow();
module.activeWindow = notesWindow;
msg.setBody(module);
outpipe.write(msg);
}
override public function listNotificationInterests():Array{
return [];
}
override public function handleNotification(notification:INotification):void{
}
override protected function initializeNotifier(key:String):void{
super.initializeNotifier();
facade.registerMediator(new NotesWindowMediator(notesWindow));
}
}
}

View File

@ -1,14 +0,0 @@
package org.bigbluebutton.modules.notes.controller
{
import org.bigbluebutton.modules.notes.NotesModule;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
public class StartupNotesCommand extends SimpleCommand
{
override public function execute(notification:INotification):void{
var app:NotesModule = notification.getBody() as NotesModule;
}
}
}

View File

@ -1,16 +0,0 @@
package org.bigbluebutton.modules.notes.model
{
import org.puremvc.as3.multicore.interfaces.IProxy;
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
public class NotesProxy extends Proxy implements IProxy
{
public static const NAME:String = "NotesProxy";
public function NotesProxy()
{
super(NAME);
}
}
}

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<MDIWindow xmlns="flexlib.mdi.containers.*" xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
</MDIWindow>

View File

@ -1,25 +0,0 @@
package org.bigbluebutton.modules.notes.view
{
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
public class NotesWindowMediator extends Mediator implements IMediator
{
public static const NAME:String = "NotesWindowMediator";
public function NotesWindowMediator(view:NotesWindow)
{
super(NAME, view);
}
override public function listNotificationInterests():Array{
return [];
}
override public function handleNotification(notification:INotification):void{
}
}
}

View File

@ -1,20 +0,0 @@
package org.bigbluebutton.modules.playback
{
public class PlaybackModuleConstants
{
public static const FROM_PLAYBACK_MODULE:String = "From Playback Module";
public static const TO_PLAYBACK_MODULE:String = "To Playback Module";
public static const OPEN_WINDOW_MSG:String = "Open Window";
public static const CLOSE_WINDOW_MSG:String = "Close Window";
public static const PLAYBACK_MESSAGE:String = "Playback Message";
public static const PLAYBACK_MODE:String = "Switch to Playback Mode";
public static const ERROR:int = 1;
public static const WARN:int = 2;
public static const INFO:int = 3;
public static const DEBUG:int = 4;
}
}

View File

@ -24,12 +24,17 @@ package org.bigbluebutton.modules.playback
private var playbackWindow:PlaybackWindow
public static const TO_PLAYBACK_MODULE:String = "TO_PLAYBACK_MODULE";
public static const FROM_PLAYBACK_MODULE:String = "FROM_PLAYBACK_MODULE";
public static const PLAYBACK_MESSAGE:String = "PLAYBACK_MESSAGE";
public static const PLAYBACK_MODE:String = "PLAYBACK_MODE";
public function PlaybackModuleMediator(module:PlaybackModule)
{
super(NAME, module);
_router = module.router;
inpipe = new InputPipe(PlaybackModuleConstants.TO_PLAYBACK_MODULE);
outpipe = new OutputPipe(PlaybackModuleConstants.FROM_PLAYBACK_MODULE);
inpipe = new InputPipe(TO_PLAYBACK_MODULE);
outpipe = new OutputPipe(FROM_PLAYBACK_MODULE);
inpipeListener = new PipeListener(this, messageReceiver);
_router.registerOutputPipe(outpipe.name, outpipe);
_router.registerInputPipe(inpipe.name, inpipe);
@ -50,7 +55,7 @@ package org.bigbluebutton.modules.playback
private function addWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: PlaybackModuleConstants.FROM_PLAYBACK_MODULE,
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: FROM_PLAYBACK_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);

View File

@ -7,7 +7,7 @@ package org.bigbluebutton.modules.playback.model
import org.bigbluebutton.common.OutputPipe;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.modules.playback.PlaybackFacade;
import org.bigbluebutton.modules.playback.PlaybackModuleConstants;
import org.bigbluebutton.modules.playback.PlaybackModuleMediator;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
@ -64,7 +64,7 @@ package org.bigbluebutton.modules.playback.model
private function sendMessage(message:XML):void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG: PlaybackModuleConstants.PLAYBACK_MESSAGE, SRC: PlaybackModuleConstants.FROM_PLAYBACK_MODULE,
msg.setHeader({MSG: PlaybackModuleMediator.PLAYBACK_MESSAGE, SRC: PlaybackModuleMediator.FROM_PLAYBACK_MODULE,
TO: destinationModule});
msg.setPriority(Message.PRIORITY_HIGH);
@ -75,7 +75,7 @@ package org.bigbluebutton.modules.playback.model
private function playbackModeRequest():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG: PlaybackModuleConstants.PLAYBACK_MODE, SRC: PlaybackModuleConstants.FROM_PLAYBACK_MODULE,
msg.setHeader({MSG: PlaybackModuleMediator.PLAYBACK_MODE, SRC: PlaybackModuleMediator.FROM_PLAYBACK_MODULE,
TO: destinationModule});
//msg.setBody(null):
sendNotification(PlaybackFacade.SEND_OUT_MESSAGE, msg);

View File

@ -1,10 +1,7 @@
package org.bigbluebutton.modules.playback.model
{
import org.bigbluebutton.modules.chat.ChatModuleConstants;
import org.bigbluebutton.modules.playback.PlaybackFacade;
import org.bigbluebutton.modules.playback.controller.notifiers.ParseNotifier;
import org.bigbluebutton.modules.presentation.PresentationConstants;
import org.bigbluebutton.modules.voiceconference.VoiceModuleConstants;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
@ -40,11 +37,11 @@ package org.bigbluebutton.modules.playback.model
private function parse():void{
mainSequence = xml.par.seq;
sendNotification(PlaybackFacade.PARSE_COMPLETE,
new ParseNotifier(mainSequence.chat, ChatModuleConstants.TO_CHAT_MODULE, startTime));
//sendNotification(PlaybackFacade.PARSE_COMPLETE,
// new ParseNotifier(mainSequence.chat, ChatModuleConstants.TO_CHAT_MODULE, startTime));
sendNotification(PlaybackFacade.PARSE_COMPLETE,
new ParseNotifier(mainSequence.presentation, PresentationConstants.TO_PRESENTATION_MODULE, startTime));
//sendNotification(PlaybackFacade.PARSE_COMPLETE,
// new ParseNotifier(mainSequence.presentation, PresentationConstants.TO_PRESENTATION_MODULE, startTime));
//sendNotification(PlaybackFacade.PARSE_COMPLETE,
// new ParseNotifier(mainSequence.voice, VoiceModuleConstants.TO_VOICE_MODULE, startTime));

View File

@ -1,41 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2008 by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.bigbluebutton.modules.presentation
{
/**
* Constants for the Presentation piping
* @author Denis Zgonjanin
*
*/
public class PresentationConstants
{
public static const FROM_PRESENTATION_MODULE:String = "From Presentation Module";
public static const TO_PRESENTATION_MODULE:String = "To Presentation Module";
public static const OPEN_WINDOW_MESSAGE:String = "Open Window Message";
public static const CLOSE_WINDOW_MESSAGE:String = "Close Window Message";
public static const ERROR:int = 1;
public static const WARN:int = 2;
public static const INFO:int = 3;
public static const DEBUG:int = 4;
}
}

View File

@ -59,7 +59,7 @@ package org.bigbluebutton.modules.presentation
super(NAME);
facade = PresentationFacade.getInstance();
this.preferedX = 250;
this.preferedY = 20;
this.preferedY = 20;
this.startTime = BigBlueButtonModule.START_ON_LOGIN;
}

View File

@ -23,7 +23,6 @@ package org.bigbluebutton.modules.presentation
import org.bigbluebutton.common.OutputPipe;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.main.MainApplicationConstants;
import org.bigbluebutton.modules.playback.PlaybackModuleConstants;
import org.bigbluebutton.modules.presentation.model.business.PresentationDelegate;
import org.bigbluebutton.modules.presentation.model.business.PresentationPlaybackProxy;
import org.bigbluebutton.modules.presentation.view.PresentationWindow;
@ -57,6 +56,12 @@ package org.bigbluebutton.modules.presentation
private var presentationWindow:PresentationWindow = new PresentationWindow();
private var module:PresentationModule;
private static const TO_PRESENTATION_MODULE:String = "TO_PRESENTATION_MODULE";
private static const FROM_PRESENTATION_MODULE:String = "FROM_PRESENTATION_MODULE";
private static const PLAYBACK_MODE:String = "PLAYBACK_MODE";
private static const PLAYBACK_MESSAGE:String = "PLAYBACK_MESSAGE";
/**
* The constructor. Associates this mediator with the PresentationModule class
* The constructor does the work of registering the PresentationModule with input/output pipes
@ -69,8 +74,8 @@ package org.bigbluebutton.modules.presentation
super(NAME, view);
module = view;
router = view.router;
inpipe = new InputPipe(PresentationConstants.TO_PRESENTATION_MODULE);
outpipe = new OutputPipe(PresentationConstants.FROM_PRESENTATION_MODULE);
inpipe = new InputPipe(TO_PRESENTATION_MODULE);
outpipe = new OutputPipe(FROM_PRESENTATION_MODULE);
inpipeListener = new PipeListener(this, messageReceiver);
inpipe.connect(inpipeListener);
router.registerOutputPipe(outpipe.name, outpipe);
@ -87,10 +92,10 @@ package org.bigbluebutton.modules.presentation
{
var msg : String = message.getHeader().MSG as String;
switch(msg){
case PlaybackModuleConstants.PLAYBACK_MODE:
case PLAYBACK_MODE:
switchToPlayback();
break;
case PlaybackModuleConstants.PLAYBACK_MESSAGE:
case PLAYBACK_MESSAGE:
playMessage(message.getBody() as XML);
break;
}
@ -154,7 +159,7 @@ package org.bigbluebutton.modules.presentation
*/
private function addWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: PresentationConstants.FROM_PRESENTATION_MODULE,
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: FROM_PRESENTATION_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);

View File

@ -0,0 +1,49 @@
package org.bigbluebutton.modules.sample_module
{
import org.bigbluebutton.modules.sample_module.controller.StartupSampleCommand;
import org.puremvc.as3.multicore.patterns.facade.Facade;
/**
* This is the facade for the Module
* @author Denis
*
*/
public class SampleFacade extends Facade
{
public static const NAME:String = "SampleFacade";
public static const STARTUP:String = "StartupSampleModule";
//Notification Constants
public static const TEST:String = "Test";
public function SampleFacade()
{
super(NAME);
}
/**
*
* @return - the Unique! instance of this Singleton facade.
*
*/
public static function getInstance():SampleFacade{
if (instanceMap[NAME] == null) instanceMap[NAME] = new SampleFacade;
return instanceMap[NAME] as SampleFacade;
}
override protected function initializeController():void{
super.initializeController();
registerCommand(STARTUP, StartupSampleCommand);
}
/**
* Sends out a command to start the rest of the module (mediators, proxies)
* @param app
*
*/
public function startup(app:SampleModule):void{
sendNotification(STARTUP, app);
}
}
}

View File

@ -0,0 +1,46 @@
package org.bigbluebutton.modules.sample_module
{
import flexlib.mdi.containers.MDIWindow;
import org.bigbluebutton.common.BigBlueButtonModule;
import org.bigbluebutton.common.IRouterAware;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.main.view.components.MainApplicationShell;
import org.bigbluebutton.modules.sample_module.view.SampleWindow;
/**
* This is a Sample Module. It is very minimalistic. You can copy it and use it as a start point for your own BBB module
* @author Denis
*
*/
public class SampleModule extends BigBlueButtonModule implements IRouterAware
{
public static const NAME:String = "SampleModule";
private var window:SampleWindow;
private var facade:SampleFacade;
public function SampleModule()
{
super(NAME);
this.window = new SampleWindow();
this.facade = SampleFacade.getInstance();
this.preferedX = 400;
this.preferedY = 200;
this.startTime = BigBlueButtonModule.START_ON_LOGIN;
}
override public function acceptRouter(router:Router, shell:MainApplicationShell):void{
super.acceptRouter(router, shell);
facade.startup(this);
}
override public function getMDIComponent():MDIWindow{
return this.window;
}
override public function logout():void{
facade.removeCore(SampleFacade.NAME);
}
}
}

View File

@ -0,0 +1,49 @@
package org.bigbluebutton.modules.sample_module
{
import mx.controls.Alert;
import org.bigbluebutton.common.ModuleMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
/**
* This is a Module Mediator. It communicates between this module and the rest of BigBlueButton.
* @author Denis
*
*/
public class SampleModuleMediator extends ModuleMediator
{
public static const FROM_SAMPLE_MODULE:String = "From Sample Module";
public static const TO_SAMPLE_MODULE:String = "To Sample Module";
public function SampleModuleMediator(viewComponent:SampleModule)
{
super(viewComponent, TO_SAMPLE_MODULE, FROM_SAMPLE_MODULE);
}
/**
* You list the notifications your mediator is interested in here. If one of the listed events occurs, this class will get
* notified of it
* @return
*
*/
override public function listNotificationInterests():Array{
return [
SampleFacade.TEST
];
}
/**
* This is the method where the event gets handled.
* @param notification
*
*/
override public function handleNotification(notification:INotification):void{
switch(notification.getName()){
case SampleFacade.TEST:
Alert.show(notification.getBody() as String);
break;
}
}
}
}

View File

@ -0,0 +1,28 @@
package org.bigbluebutton.modules.sample_module.controller
{
import org.bigbluebutton.modules.sample_module.SampleModule;
import org.bigbluebutton.modules.sample_module.SampleModuleMediator;
import org.bigbluebutton.modules.sample_module.model.SampleProxy;
import org.bigbluebutton.modules.sample_module.view.SampleWindow;
import org.bigbluebutton.modules.sample_module.view.SampleWindowMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
/**
* This command is exected when the Module starts-up. The command creates a SampleModuleMediator and registers it
* with the Facade of this module.
* @author Denis
*
*/
public class StartupSampleCommand extends SimpleCommand
{
override public function execute(notification:INotification):void{
var note:SampleModule = notification.getBody() as SampleModule;
facade.registerMediator(new SampleModuleMediator(note));
facade.registerMediator(new SampleWindowMediator(note.getMDIComponent() as SampleWindow));
facade.registerProxy(new SampleProxy("Hello World"));
}
}
}

View File

@ -0,0 +1,35 @@
package org.bigbluebutton.modules.sample_module.model
{
import org.bigbluebutton.modules.sample_module.SampleFacade;
import org.puremvc.as3.multicore.interfaces.IProxy;
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
/**
* The job of the proxy class is to communicate with web services and manipulate data objects. This proxy is a very simple one,
* just to show you roughly how it functions.
* @author Denis
*
*/
public class SampleProxy extends Proxy implements IProxy
{
public static const NAME:String = "SampleProxy";
public function SampleProxy(data:String)
{
super(NAME, data);
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
}
override public function getData():Object{
return data as String;
}
public function test():void{
sendNotification(SampleFacade.TEST, getData());
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"
implements="org.bigbluebutton.common.ModuleInterface">
<mx:Script>
<![CDATA[
import org.bigbluebutton.common.BigBlueButtonModule;
public function getBBBModule():BigBlueButtonModule{
return new SampleModule();
}
]]>
</mx:Script>
</mx:Module>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<MDIWindow xmlns="flexlib.mdi.containers.*" xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" title="Sample Module">
<mx:Button id="btnTest" label="Test" click="dispatchEvent(new Event(SampleWindowMediator.TEST));" />
</MDIWindow>

View File

@ -0,0 +1,33 @@
package org.bigbluebutton.modules.sample_module.view
{
import flash.events.Event;
import org.bigbluebutton.modules.sample_module.model.SampleProxy;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
public class SampleWindowMediator extends Mediator implements IMediator
{
public static const NAME:String = "SampleWindowMediator";
public static const TEST:String = "Test Event";
public function SampleWindowMediator(viewComponent:SampleWindow)
{
super(NAME, viewComponent);
viewComponent.addEventListener(TEST, test);
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
}
private function get proxy():SampleProxy{
return facade.retrieveProxy(SampleProxy.NAME) as SampleProxy;
}
public function test(e:Event):void{
proxy.test();
}
}
}

View File

@ -1,42 +0,0 @@
package org.bigbluebutton.modules.sip
{
import flash.system.Capabilities;
import flexlib.mdi.containers.MDIWindow;
import org.bigbluebutton.common.BigBlueButtonModule;
import org.bigbluebutton.common.IRouterAware;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.main.view.components.MainApplicationShell;
public class SipModule extends BigBlueButtonModule implements IRouterAware
{
public static const NAME:String = "Sip Module";
private var facade:SipModuleFacade;
public var activeWindow:MDIWindow;
public function SipModule()
{
super(NAME);
facade = SipModuleFacade.getInstance();
this.preferedX = Capabilities.screenResolutionX/2 - 200;
this.preferedY = 500;
this.startTime = BigBlueButtonModule.START_ON_LOGIN;
}
override public function acceptRouter(router:Router, shell:MainApplicationShell):void{
super.acceptRouter(router, shell);
facade.startup(this);
}
override public function getMDIComponent():MDIWindow{
return this.activeWindow;
}
override public function logout():void{
facade.removeCore(SipModuleFacade.NAME);
}
}
}

View File

@ -1,17 +0,0 @@
package org.bigbluebutton.modules.sip
{
public class SipModuleConstants
{
public static const FROM_SIP_MODULE:String = "From Sip Module";
public static const TO_SIP_MODULE:String = "To Sip Module";
public static const OPEN_WINDOW_MSG:String = "Open Window";
public static const CLOSE_WINDOW_MSG:String = "Close Window";
public static const ERROR:int = 1;
public static const WARN:int = 2;
public static const INFO:int = 3;
public static const DEBUG:int = 4;
}
}

View File

@ -1,34 +0,0 @@
package org.bigbluebutton.modules.sip
{
import org.bigbluebutton.modules.sip.controller.StartupSipCommand;
import org.puremvc.as3.multicore.interfaces.IFacade;
import org.puremvc.as3.multicore.patterns.facade.Facade;
public class SipModuleFacade extends Facade implements IFacade
{
public static const NAME:String = "SipModuleFacade";
//Notification Constants
public static const STARTUP:String = "Startup Sip Module";
public function SipModuleFacade(key:String)
{
super(key);
}
public static function getInstance():SipModuleFacade{
if (instanceMap[NAME] == null) instanceMap[NAME] = new SipModuleFacade(NAME);
return instanceMap[NAME] as SipModuleFacade;
}
override protected function initializeController():void{
super.initializeController();
registerCommand(STARTUP, StartupSipCommand);
}
public function startup(app:SipModule):void{
sendNotification(STARTUP, app);
}
}
}

View File

@ -1,64 +0,0 @@
package org.bigbluebutton.modules.sip
{
import org.bigbluebutton.common.InputPipe;
import org.bigbluebutton.common.OutputPipe;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.main.MainApplicationConstants;
import org.bigbluebutton.modules.sip.view.SipWindow;
import org.bigbluebutton.modules.sip.view.mediators.SipWindowMediator;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
import org.puremvc.as3.multicore.utilities.pipes.messages.Message;
import org.puremvc.as3.multicore.utilities.pipes.plumbing.PipeListener;
public class SipModuleMediator extends Mediator implements IMediator
{
public static const NAME:String = "SipModuleMediator";
private var outpipe : OutputPipe;
private var inpipe : InputPipe;
private var router : Router;
private var inpipeListener : PipeListener;
private var sipWindow:SipWindow;
public function SipModuleMediator(module:SipModule)
{
super(NAME, module);
router = module.router;
inpipe = new InputPipe(SipModuleConstants.TO_SIP_MODULE);
outpipe = new OutputPipe(SipModuleConstants.FROM_SIP_MODULE);
inpipeListener = new PipeListener(this, messageReceiver);
router.registerOutputPipe(outpipe.name, outpipe);
router.registerInputPipe(inpipe.name, inpipe);
addWindow();
}
private function messageReceiver(message:IPipeMessage):void{
var msg:String = message.getHeader().MSG;
}
private function get module():SipModule{
return viewComponent as SipModule;
}
private function addWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: SipModuleConstants.FROM_SIP_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);
sipWindow = new SipWindow();
module.activeWindow = sipWindow;
msg.setBody(module);
outpipe.write(msg);
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
facade.registerMediator(new SipWindowMediator(sipWindow));
}
}
}

View File

@ -1,17 +0,0 @@
package org.bigbluebutton.modules.sip.controller
{
import org.bigbluebutton.modules.sip.SipModule;
import org.bigbluebutton.modules.sip.SipModuleMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
public class StartupSipCommand extends SimpleCommand
{
override public function execute(notification:INotification):void{
var app:SipModule = notification.getBody() as SipModule;
facade.registerMediator(new SipModuleMediator(app));
}
}
}

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<MDIWindow xmlns="flexlib.mdi.containers.*" xmlns:mx="http://www.adobe.com/2006/mxml"
width="150" height="250" title="VoIP">
</MDIWindow>

View File

@ -1,30 +0,0 @@
package org.bigbluebutton.modules.sip.view.mediators
{
import org.bigbluebutton.modules.sip.view.SipWindow;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
public class SipWindowMediator extends Mediator implements IMediator
{
public static const NAME:String = "SipWindowMediator";
public function SipWindowMediator(view:SipWindow)
{
super(NAME, view);
}
private function get window():SipWindow{
return viewComponent as SipWindow;
}
override public function listNotificationInterests():Array{
return [];
}
override public function handleNotification(notification:INotification):void{
}
}
}

View File

@ -1,40 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2008 by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.bigbluebutton.modules.video
{
/**
* This class holds various constants relevant to the VideoModule
* @author Denis Zgonjanin
*
*/
public class VideoConstants
{
public static const FROM_VIDEO_MODULE:String = "From Video Module";
public static const TO_VIDEO_MODULE:String = "To Video Module";
public static const OPEN_WINDOW_MESSAGE:String = "Open Window Message";
public static const CLOSE_WINDOW_MESSAGE:String = "Close Window Messsage";
public static const ERROR:int = 1;
public static const WARN:int = 2;
public static const INFO:int = 3;
public static const DEBUG:int = 4;
}
}

View File

@ -72,6 +72,7 @@ package org.bigbluebutton.modules.video
this.preferedY = 240;
this.startTime = NAME;
this.addButton = true;
this.displayName = "Share Webcam";
}

View File

@ -19,8 +19,6 @@
*/
package org.bigbluebutton.modules.video
{
import mx.controls.Alert;
import org.bigbluebutton.common.InputPipe;
import org.bigbluebutton.common.OutputPipe;
import org.bigbluebutton.common.Router;
@ -32,8 +30,6 @@ package org.bigbluebutton.modules.video
import org.bigbluebutton.modules.video.view.ViewCameraWindow;
import org.bigbluebutton.modules.video.view.mediators.MyCameraWindowMediator;
import org.bigbluebutton.modules.video.view.mediators.ViewCameraWindowMediator;
import org.bigbluebutton.modules.viewers.ViewersConstants;
import org.bigbluebutton.modules.viewers.model.vo.User;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
@ -61,6 +57,9 @@ package org.bigbluebutton.modules.video
public var videoWindow:MyCameraWindow;
public var viewWindow:ViewCameraWindow;
private static const TO_VIDEO_MODULE:String = "TO_VIDEO_MODULE";
private static const FROM_VIDEO_MODULE:String = "FROM_VIDEO_MODULE";
/**
* The constructor. Registers the VideoModule with this mediator class
* @param module
@ -71,8 +70,8 @@ package org.bigbluebutton.modules.video
super(NAME, module);
this.module = module;
router = module.router;
inpipe = new InputPipe(VideoConstants.TO_VIDEO_MODULE);
outpipe = new OutputPipe(VideoConstants.FROM_VIDEO_MODULE);
inpipe = new InputPipe(TO_VIDEO_MODULE);
outpipe = new OutputPipe(FROM_VIDEO_MODULE);
inpipeListener = new PipeListener(this, messageReceiver);
inpipe.connect(inpipeListener);
router.registerOutputPipe(outpipe.name, outpipe);
@ -90,7 +89,7 @@ package org.bigbluebutton.modules.video
*/
private function addVideoWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: VideoConstants.FROM_VIDEO_MODULE,
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: FROM_VIDEO_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);
@ -112,7 +111,7 @@ package org.bigbluebutton.modules.video
public function addViewWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: VideoConstants.FROM_VIDEO_MODULE,
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: FROM_VIDEO_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);

View File

@ -1,40 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2008 by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.bigbluebutton.modules.voiceconference
{
/**
* Holds various constants used by the Voice Module
* @author Denis Zgonjanin
*
*/
public class VoiceModuleConstants
{
public static const FROM_VOICE_MODULE:String = "From Voice Module";
public static const TO_VOICE_MODULE:String = "To Voice Module";
public static const OPEN_WINDOW_MSG:String = "Open Window";
public static const CLOSE_WINDOW_MSG:String = "Close Window";
public static const ERROR:int = 1;
public static const WARN:int = 2;
public static const INFO:int = 3;
public static const DEBUG:int = 4;
}
}

View File

@ -23,7 +23,6 @@ package org.bigbluebutton.modules.voiceconference
import org.bigbluebutton.common.OutputPipe;
import org.bigbluebutton.common.Router;
import org.bigbluebutton.main.MainApplicationConstants;
import org.bigbluebutton.modules.playback.PlaybackModuleConstants;
import org.bigbluebutton.modules.voiceconference.model.business.VoiceConfConnectResponder;
import org.bigbluebutton.modules.voiceconference.view.ListenersWindow;
import org.bigbluebutton.modules.voiceconference.view.ListenersWindowMediator;
@ -52,6 +51,12 @@ package org.bigbluebutton.modules.voiceconference
private var voiceWindow:ListenersWindow = new ListenersWindow();
private var module:VoiceModule;
private static const TO_VOICE_MODULE:String = "TO_VOICE_MODULE";
private static const FROM_VOICE_MODULE:String = "FROM_VOICE_MODULE";
private static const PLAYBACK_MESSAGE:String = "PLAYBACK_MESSAGE";
private static const PLAYBACK_MODE:String = "PLAYBACK_MODE";
/**
* The constructor. Registers this class with the VoiceModule
* @param view
@ -62,8 +67,8 @@ package org.bigbluebutton.modules.voiceconference
super(NAME,view);
module = view;
router = view.router;
inpipe = new InputPipe(VoiceModuleConstants.TO_VOICE_MODULE);
outpipe = new OutputPipe(VoiceModuleConstants.FROM_VOICE_MODULE);
inpipe = new InputPipe(TO_VOICE_MODULE);
outpipe = new OutputPipe(FROM_VOICE_MODULE);
inpipeListener = new PipeListener(this, messageReceiver);
inpipe.connect(inpipeListener);
router.registerOutputPipe(outpipe.name, outpipe);
@ -74,10 +79,10 @@ package org.bigbluebutton.modules.voiceconference
private function messageReceiver(message:IPipeMessage):void{
var msg:String = message.getHeader().MSG as String;
switch(msg){
case PlaybackModuleConstants.PLAYBACK_MODE:
case PLAYBACK_MODE:
switchToPlaybackMode();
break;
case PlaybackModuleConstants.PLAYBACK_MESSAGE:
case PLAYBACK_MESSAGE:
playMessage(message.getBody() as XML);
break;
}
@ -114,7 +119,7 @@ package org.bigbluebutton.modules.voiceconference
*/
private function addWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: VoiceModuleConstants.FROM_VOICE_MODULE,
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: FROM_VOICE_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);

View File

@ -1,17 +0,0 @@
package org.bigbluebutton.modules.whiteboard
{
public class BoardModuleConstants
{
public static const FROM_WHITEBOARD_MODULE:String = "From Voice Module";
public static const TO_WHITEBOARD_MODULE:String = "To Voice Module";
public static const OPEN_WINDOW_MSG:String = "Open Window";
public static const CLOSE_WINDOW_MSG:String = "Close Window";
public static const ERROR:int = 1;
public static const WARN:int = 2;
public static const INFO:int = 3;
public static const DEBUG:int = 4;
}
}

View File

@ -23,12 +23,15 @@ package org.bigbluebutton.modules.whiteboard
private var board:Board;
private static const TO_WHITEBOARD_MODULE:String = "TO_WHITEBOARD_MODULE";
private static const FROM_WHITEBOARD_MODULE:String = "FROM_WHITEBOARD_MODULE";
public function WhiteboardModuleMediator(module:WhiteboardModule)
{
super(NAME, module);
router = module.router;
inpipe = new InputPipe(BoardModuleConstants.TO_WHITEBOARD_MODULE);
outpipe = new OutputPipe(BoardModuleConstants.FROM_WHITEBOARD_MODULE);
inpipe = new InputPipe(TO_WHITEBOARD_MODULE);
outpipe = new OutputPipe(FROM_WHITEBOARD_MODULE);
inpipeListener = new PipeListener(this, messageReceiver);
router.registerOutputPipe(outpipe.name, outpipe);
router.registerInputPipe(inpipe.name, inpipe);
@ -45,7 +48,7 @@ package org.bigbluebutton.modules.whiteboard
private function addWindow():void{
var msg:IPipeMessage = new Message(Message.NORMAL);
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: BoardModuleConstants.FROM_WHITEBOARD_MODULE,
msg.setHeader({MSG:MainApplicationConstants.ADD_WINDOW_MSG, SRC: FROM_WHITEBOARD_MODULE,
TO: MainApplicationConstants.TO_MAIN });
msg.setPriority(Message.PRIORITY_HIGH);