Rename VoiceModule to ListenersModule
git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@681 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
parent
878cdcf3d9
commit
be019db88a
Binary file not shown.
Before Width: | Height: | Size: 722 B |
@ -1,55 +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.control
|
||||
{
|
||||
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
|
||||
import org.bigbluebutton.modules.voiceconference.VoiceModule;
|
||||
import org.bigbluebutton.modules.voiceconference.VoiceModuleMediator;
|
||||
import org.bigbluebutton.modules.voiceconference.model.business.NetConnectionDelegate;
|
||||
import org.bigbluebutton.modules.voiceconference.model.business.VoiceConfConnectResponder;
|
||||
import org.bigbluebutton.modules.voiceconference.view.MeetMeUserItem;
|
||||
import org.bigbluebutton.modules.voiceconference.view.MeetMeUserItemMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
/**
|
||||
* This command gets called from the facade when the application is first started
|
||||
* @author Denis Zgonjanin
|
||||
*
|
||||
*/
|
||||
public class StartupVoiceConfCommand extends SimpleCommand
|
||||
{
|
||||
/**
|
||||
* This method gets automatically called, there is no need to call it
|
||||
* <p>
|
||||
* This method initiates the mediators and the proxies that the application needs
|
||||
* @param notification
|
||||
*
|
||||
*/
|
||||
override public function execute(notification:INotification):void{
|
||||
var app:VoiceModule = notification.getBody() as VoiceModule;
|
||||
facade.registerMediator(new VoiceModuleMediator(app));
|
||||
|
||||
facade.registerProxy(new NetConnectionDelegate(VoiceFacade.getInstance().meetMeRoom.getUri()));
|
||||
facade.registerMediator(new VoiceConfConnectResponder(VoiceFacade.getInstance().meetMeRoom));
|
||||
//facade.registerMediator(new MeetMeUserItemMediator(new MeetMeUserItem()));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,47 +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.control.notifiers
|
||||
{
|
||||
/**
|
||||
* A wrapper class so that multiple pieces of information can be sent inside a PureMVC notification
|
||||
* @author Denis Zgonjanin
|
||||
*
|
||||
*/
|
||||
public class MuteNotifier
|
||||
{
|
||||
private var _userid:Number;
|
||||
private var _muteUser:Boolean;
|
||||
|
||||
public function MuteNotifier(userid:Number, muteUser:Boolean)
|
||||
{
|
||||
this._userid = userid;
|
||||
this._muteUser = muteUser;
|
||||
}
|
||||
|
||||
public function get userid():Number{
|
||||
return _userid;
|
||||
}
|
||||
|
||||
public function get muteUser():Boolean{
|
||||
return _muteUser;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,72 +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.model
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
|
||||
import org.bigbluebutton.modules.voiceconference.model.business.NetConnectionDelegate;
|
||||
|
||||
/**
|
||||
* This class represents a room in the Asterisk server. The information about the participants is held
|
||||
* in the public variable dpParticipants:ArrayCollection
|
||||
* @author dev_team@bigbluebutton.org
|
||||
*
|
||||
*/
|
||||
public class VoiceConferenceRoom
|
||||
{
|
||||
|
||||
[Bindable]
|
||||
public var isConnected : Boolean;
|
||||
|
||||
[Bindable]
|
||||
public var dpParticipants : ArrayCollection;
|
||||
|
||||
private var room : String;
|
||||
private var uri : String;
|
||||
|
||||
[Bindable]
|
||||
public var userRole : String;
|
||||
|
||||
public function VoiceConferenceRoom(uri:String):void{
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uri - the uri of this room
|
||||
*
|
||||
*/
|
||||
public function setUri(uri : String) : void
|
||||
{
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return - the uri of this room
|
||||
*
|
||||
*/
|
||||
public function getUri() : String
|
||||
{
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
package org.bigbluebutton.modules.viewers.model
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
|
||||
import org.bigbluebutton.modules.viewers.model.business.Conference;
|
||||
import org.bigbluebutton.modules.viewers.model.business.IViewers;
|
||||
import org.bigbluebutton.modules.viewers.model.services.IViewersService;
|
||||
import org.bigbluebutton.modules.viewers.model.services.ViewersSOService;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
public class VoiceProxy extends Proxy implements IProxy
|
||||
{
|
||||
public static const NAME:String = "VoiceProxy";
|
||||
|
||||
private var _uri:String;
|
||||
private var _viewersService:IViewersService;
|
||||
private var _participants:IViewers = null;
|
||||
|
||||
private var isPresenter:Boolean = false;
|
||||
|
||||
public function VoiceProxy(uri:String)
|
||||
{
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
override public function getProxyName():String
|
||||
{
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public function connect(uri:String, room:String, username:String, password:String ):void {
|
||||
_uri = uri;
|
||||
_participants = new Conference();
|
||||
_viewersService = new ViewersSOService(_uri, _participants);
|
||||
_viewersService.addConnectionStatusListener(connectionStatusListener);
|
||||
_viewersService.addMessageSender(messageSender);
|
||||
_participants.me.name = username;
|
||||
_viewersService.connect(_uri, room, username, password);
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
_viewersService.disconnect();
|
||||
}
|
||||
|
||||
public function get me():User {
|
||||
return _participants.me;
|
||||
}
|
||||
|
||||
public function isModerator():Boolean {
|
||||
if (me.role == "MODERATOR") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get participants():ArrayCollection {
|
||||
return _participants.users;
|
||||
}
|
||||
|
||||
public function assignPresenter(assignTo:Number):void {
|
||||
_viewersService.assignPresenter(assignTo, me.userid);
|
||||
}
|
||||
|
||||
private function connectionStatusListener(connected:Boolean):void {
|
||||
if (connected) {
|
||||
sendNotification(ViewersModuleConstants.LOGGED_IN);
|
||||
} else {
|
||||
_participants = null;
|
||||
sendNotification(ViewersModuleConstants.LOGGED_OUT);
|
||||
}
|
||||
}
|
||||
|
||||
private function messageSender(msg:String, body:Object=null):void {
|
||||
if (msg == ViewersModuleConstants.ASSIGN_PRESENTER) {
|
||||
if (me.userid == body.assignedTo) {
|
||||
// I've been assigned as presenter.
|
||||
trace('I have become presenter');
|
||||
isPresenter = true;
|
||||
sendNotification(msg, body);
|
||||
} else {
|
||||
// Somebody else has become presenter.
|
||||
if (isPresenter) {
|
||||
trace('Somebody else has become presenter.');
|
||||
isPresenter = false;
|
||||
sendNotification(ViewersModuleConstants.BECOME_VIEWER);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sendNotification(msg, body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,212 +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.model.business
|
||||
{
|
||||
import flash.events.*;
|
||||
import flash.net.NetConnection;
|
||||
|
||||
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
|
||||
import org.bigbluebutton.modules.voiceconference.control.notifiers.MuteNotifier;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
import org.bigbluebutton.modules.log.LogModuleFacade;
|
||||
|
||||
/**
|
||||
* This is the NetConnectionDelegate which connects to the server
|
||||
* <p>
|
||||
* This class extends the Proxy Class of the PureMVC framework
|
||||
* @author dev_team@bigbluebutton.org
|
||||
*
|
||||
*/
|
||||
public class NetConnectionDelegate extends Proxy implements IProxy
|
||||
{
|
||||
public static const NAME:String = "NetConnectionDelegate";
|
||||
|
||||
private var netConnection : NetConnection;
|
||||
private var meetmeRoomURI:String;
|
||||
private var roomNumber : String;
|
||||
|
||||
//private var log:TempLogBridge;
|
||||
private var log : LogModuleFacade = LogModuleFacade.getInstance("LogModule");
|
||||
|
||||
/**
|
||||
* The Default constructor
|
||||
* @param meetmeRoom - the MeetMeRoom this class uses
|
||||
*
|
||||
*/
|
||||
public function NetConnectionDelegate(meetmeRoomURI:String)
|
||||
{
|
||||
super(NAME);
|
||||
this.meetmeRoomURI = meetmeRoomURI;
|
||||
//log = new TempLogBridge();
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts connect to the server
|
||||
*
|
||||
*/
|
||||
public function connect(nc:NetConnection) : void
|
||||
{
|
||||
netConnection = nc;
|
||||
|
||||
netConnection.client = this;
|
||||
|
||||
// Setup the NetConnection and listen for NetStatusEvent and SecurityErrorEvent events.
|
||||
netConnection.addEventListener( NetStatusEvent.NET_STATUS, netStatus );
|
||||
netConnection.addEventListener( AsyncErrorEvent.ASYNC_ERROR, netASyncError );
|
||||
netConnection.addEventListener( SecurityErrorEvent.SECURITY_ERROR, netSecurityError );
|
||||
netConnection.addEventListener( IOErrorEvent.IO_ERROR, netIOError );
|
||||
|
||||
// connect to server
|
||||
try {
|
||||
log.voice( "Connecting to <b>" + meetmeRoomURI + "</b>");
|
||||
netConnection.connect( meetmeRoomURI, true );
|
||||
} catch( e : ArgumentError ) {
|
||||
// Invalid parameters.
|
||||
switch ( e.errorID )
|
||||
{
|
||||
case 2004 :
|
||||
log.voice( "Invalid server location: <b>" + meetmeRoomURI + "</b>");
|
||||
break;
|
||||
|
||||
default :
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the connection to the server
|
||||
*
|
||||
*/
|
||||
public function close() : void
|
||||
{
|
||||
// Close the NetConnection.
|
||||
sendNotification(VoiceConfConnectResponder.CLOSE);
|
||||
netConnection.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called when a NET_STATUS event is received from the server
|
||||
* @param event
|
||||
*/
|
||||
protected function netStatus( event : NetStatusEvent ) : void
|
||||
{
|
||||
sendNotification(VoiceConfConnectResponder.RESULT, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called when a NET_SECURITY_ERROR is received from the server
|
||||
* @param event
|
||||
*/
|
||||
protected function netSecurityError( event : SecurityErrorEvent ) : void
|
||||
{
|
||||
sendNotification(VoiceConfConnectResponder.FAULT,
|
||||
new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR, false, true,
|
||||
"Security error - " + event.text ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called when an IO_ERROR event is received from the server
|
||||
* @param event
|
||||
*/
|
||||
protected function netIOError( event : IOErrorEvent ) : void
|
||||
{
|
||||
sendNotification(VoiceConfConnectResponder.FAULT,
|
||||
new IOErrorEvent( IOErrorEvent.IO_ERROR, false, true,
|
||||
"Input/output error - " + event.text ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called when an ASYNC_ERROR event is received from the server
|
||||
* @param event
|
||||
*/
|
||||
protected function netASyncError( event : AsyncErrorEvent ) : void
|
||||
{
|
||||
sendNotification(VoiceConfConnectResponder.FAULT,
|
||||
new AsyncErrorEvent ( AsyncErrorEvent.ASYNC_ERROR, false, true,
|
||||
"Asynchronous code error - <i>" + event.error + "</i>" ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback setID from server
|
||||
*/
|
||||
public function setRoomNumber( room : String ):*
|
||||
{
|
||||
log.voice( "NetconnectionDelegate::setRoomNumber:room = " + room );
|
||||
roomNumber = room;
|
||||
|
||||
return "Okay";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the URI of the MeetMeRoom
|
||||
*
|
||||
*/
|
||||
public function getUri() : String{
|
||||
return meetmeRoomURI;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the NetConnection of this class
|
||||
*
|
||||
*/
|
||||
public function getConnection() : NetConnection
|
||||
{
|
||||
return netConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a call to the server to mute all users
|
||||
* @param muteUSers
|
||||
*
|
||||
*/
|
||||
public function muteAllUsers(muteUsers : Boolean) : void
|
||||
{
|
||||
sendNotification(VoiceFacade.MUTE_ALL_USERS_COMMAND, muteUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mute or Unmute a specific user
|
||||
* @param userId - the user to mute/unmute
|
||||
* @param muteUser - mute/unmute?
|
||||
*
|
||||
*/
|
||||
public function muteUnmuteUser(userId : Number, muteUser : Boolean) : void
|
||||
{
|
||||
log.voice("NetConnectionDelegate::muteUnmuteUser : [" + userId + "," + muteUser + "]");
|
||||
sendNotification(VoiceFacade.MUTE_UNMUTE_USER_COMMAND, new MuteNotifier(userId, muteUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ejects a particular user
|
||||
* @param userId - the user to eject
|
||||
*
|
||||
*/
|
||||
public function ejectUser(userId : Number) : void
|
||||
{
|
||||
log.voice("NetConnectionDelegate::ejectUser : [" + userId + "]");
|
||||
sendNotification(VoiceFacade.EJECT_USER_COMMAND, userId);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,463 +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.model.business
|
||||
{
|
||||
import flash.events.AsyncErrorEvent;
|
||||
import flash.events.Event;
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.events.SyncEvent;
|
||||
import flash.net.Responder;
|
||||
import flash.net.SharedObject;
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.rpc.IResponder;
|
||||
|
||||
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
|
||||
import org.bigbluebutton.modules.voiceconference.control.notifiers.MuteNotifier;
|
||||
import org.bigbluebutton.modules.voiceconference.model.VoiceConferenceRoom;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
import org.bigbluebutton.modules.log.LogModuleFacade;
|
||||
|
||||
|
||||
/**
|
||||
* This class receives notifications of server events
|
||||
* <p>
|
||||
* This class extends the Mediator class of the PureMVC framework
|
||||
* <p>
|
||||
* This class implements the IResponder Interface
|
||||
* @author dev_team@bigbluebutton.org
|
||||
*
|
||||
*/
|
||||
public class VoiceConfConnectResponder extends Mediator implements IResponder, IMediator
|
||||
{
|
||||
public static const NAME:String = "MeetMeConnectResponder";
|
||||
public static const CLOSE:String = "Close Connection";
|
||||
public static const RESULT:String = "Got result";
|
||||
public static const FAULT:String = "Got fault";
|
||||
|
||||
private var model:VoiceFacade = VoiceFacade.getInstance();
|
||||
|
||||
private var meetMeRoom : VoiceConferenceRoom;
|
||||
private var participantsSO : SharedObject;
|
||||
private var participants : Array;
|
||||
|
||||
//private var log:TempLogBridge;
|
||||
private var log : LogModuleFacade = LogModuleFacade.getInstance("LogModule");
|
||||
/**
|
||||
* The default constructor.
|
||||
* @param meetMeRoom - The MeetMeRoom class of the MeetMe module
|
||||
*
|
||||
*/
|
||||
public function VoiceConfConnectResponder(meetMeRoom:VoiceConferenceRoom)
|
||||
{
|
||||
super(NAME);
|
||||
this.meetMeRoom = meetMeRoom;
|
||||
//log = new TempLogBridge();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The list of notifications this class is interested in
|
||||
* VoiceConfConnectResponder.CLOSE
|
||||
* VoiceConfConnectResponder.RESULT
|
||||
* VoiceConfConnectResponder.FAULT
|
||||
* VoiceConferenceFacade.MUTE_UNMUTE_USER_COMMAND
|
||||
* VoiceConferenceFacade.MUTE_ALL_USERS_COMMAND
|
||||
* VoiceConferenceFacade.EJECT_USER_COMMAND
|
||||
*
|
||||
*/
|
||||
override public function listNotificationInterests():Array{
|
||||
return [
|
||||
CLOSE,
|
||||
RESULT,
|
||||
FAULT,
|
||||
VoiceFacade.MUTE_UNMUTE_USER_COMMAND,
|
||||
VoiceFacade.MUTE_ALL_USERS_COMMAND,
|
||||
VoiceFacade.EJECT_USER_COMMAND,
|
||||
VoiceFacade.MUTE_EVENT
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles notifications received
|
||||
* @param notification
|
||||
*
|
||||
*/
|
||||
override public function handleNotification(notification:INotification):void{
|
||||
switch(notification.getName()){
|
||||
case CLOSE:
|
||||
close();
|
||||
break;
|
||||
case RESULT:
|
||||
result(notification.getBody() as Event);
|
||||
break;
|
||||
case FAULT:
|
||||
fault(notification.getBody() as Event);
|
||||
break;
|
||||
case VoiceFacade.MUTE_ALL_USERS_COMMAND:
|
||||
muteAllUsers(notification.getBody() as Boolean);
|
||||
break;
|
||||
case VoiceFacade.MUTE_EVENT:
|
||||
muteUnmuteUser(notification.getBody() as MuteNotifier);
|
||||
break;
|
||||
case VoiceFacade.EJECT_USER_COMMAND:
|
||||
ejectUser(notification.getBody() as Number);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return - The NetConnectionDelegate Proxy of the VoiceConference Module
|
||||
*
|
||||
*/
|
||||
public function get proxy():NetConnectionDelegate{
|
||||
return facade.retrieveProxy(NetConnectionDelegate.NAME) as NetConnectionDelegate;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* The result method is called when the delegate receives
|
||||
* a result from the service
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public function result( event : Object ) : void {
|
||||
var info : Object = event.info;
|
||||
var statusCode : String = info.code;
|
||||
|
||||
meetMeRoom.isConnected = false;
|
||||
|
||||
switch ( statusCode )
|
||||
{
|
||||
case "NetConnection.Connect.Success" :
|
||||
//
|
||||
meetMeRoom.isConnected = true;
|
||||
|
||||
// find out if it's a secure (HTTPS/TLS) connection
|
||||
if ( event.target.connectedProxyType == "HTTPS" || event.target.usingTLS ) {
|
||||
log.voice("MeetMe:: Connected to secure server");
|
||||
} else {
|
||||
log.voice("MeetMe: Connected to server");
|
||||
}
|
||||
|
||||
joinMeetMeRoom();
|
||||
|
||||
var nc_responder : Responder;
|
||||
nc_responder = new Responder(getMeetMeUsers, null);
|
||||
|
||||
// call the server side method to get list of FLV's
|
||||
proxy.getConnection().call("meetmeService.getMeetMeUsers", nc_responder);
|
||||
//meetMeRoom.getConnection().getConnection().call("meetmeService.getMeetMeUsers", nc_responder);
|
||||
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Failed" :
|
||||
|
||||
// serverDisconnect(DisconnectedEvent.FAILED, "Connection to server failed");
|
||||
|
||||
log.voice("MeetMe::Connection to server failed");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Closed" :
|
||||
|
||||
// serverDisconnect(DisconnectedEvent.CLOSED, "Connection to server closed");
|
||||
|
||||
log.voice("MeetMe::Connection to server closed");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.InvalidApp" :
|
||||
// serverDisconnect(DisconnectedEvent.INVALID_APP, "Application not found on server")
|
||||
log.voice("MeetMe::Application not found on server");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.AppShutDown" :
|
||||
// serverDisconnect(DisconnectedEvent.APP_SHUTDOWN, "Application has been shutdown");
|
||||
log.voice("MeetMe::Application has been shutdown");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Rejected" :
|
||||
// serverDisconnect(DisconnectedEvent.REJECTED, "No permissions to connect to the application");
|
||||
log.voice("MeetMe::No permissions to connect to the application" );
|
||||
break;
|
||||
|
||||
default :
|
||||
// statements
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The fault method is called when the delegate receives a fault from the service
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public function fault( event : Object ) : void {
|
||||
|
||||
log.error( event.text);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method is called when the delegate receives a disconnect notice from the server
|
||||
* @param reason
|
||||
* @param message
|
||||
*
|
||||
*/
|
||||
private function serverDisconnect(reason : uint, message : String) : void
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets called when the server has disconnected
|
||||
*
|
||||
*/
|
||||
public function close() : void {
|
||||
if (participantsSO != null) participantsSO.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Joins a room on the server
|
||||
*
|
||||
*/
|
||||
private function joinMeetMeRoom() : void
|
||||
{
|
||||
participantsSO = SharedObject.getRemote("meetMeUsersSO", proxy.getUri(), false);
|
||||
participantsSO.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
participantsSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
participantsSO.addEventListener(SyncEvent.SYNC, sharedObjectSyncHandler);
|
||||
|
||||
participantsSO.client = this;
|
||||
participantsSO.connect(proxy.getConnection());
|
||||
}
|
||||
|
||||
/**
|
||||
* This event is called when a new user has joined a room on the server
|
||||
* @param userId
|
||||
* @param cidName
|
||||
* @param cidNum
|
||||
* @param muted
|
||||
* @param talking
|
||||
*
|
||||
*/
|
||||
public function userJoin(userId : Number, cidName : String, cidNum : String,
|
||||
muted : Boolean, talking : Boolean) : void
|
||||
{
|
||||
if (participants == null) participants = new Array();
|
||||
|
||||
// Only add new participants to our array
|
||||
var isNew : Boolean = true;
|
||||
for (var i:int = 0; i < participants.length; i++)
|
||||
{
|
||||
if (participants[i].userid == userId) {
|
||||
isNew = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isNew) {
|
||||
if (cidName == null) cidName = "unknown";
|
||||
participants.push({callerName : cidName, isMuted : muted, isTalking : talking, userid : userId});
|
||||
}
|
||||
|
||||
participants.sortOn("callerName", Array.CASEINSENSITIVE);
|
||||
|
||||
meetMeRoom.dpParticipants = new ArrayCollection(participants);
|
||||
meetMeRoom.dpParticipants.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets called when a particular user was muted/unmuted
|
||||
* @param userId - The user
|
||||
* @param mute - mute?
|
||||
*
|
||||
*/
|
||||
public function userMute(userId : Number, mute : Boolean) : void
|
||||
{
|
||||
if (participants == null) return;
|
||||
|
||||
for (var i:int = 0; i < participants.length; i++)
|
||||
{
|
||||
if (participants[i].userid == userId) {
|
||||
participants[i].isMuted = mute;
|
||||
sendNewMeetMeEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method gets called when a user is talking
|
||||
* @param userId - the user who is talking
|
||||
* @param talk
|
||||
*
|
||||
*/
|
||||
public function userTalk(userId : Number, talk : Boolean) : void
|
||||
{
|
||||
//log.voice("User Talking");
|
||||
if (participants == null) return;
|
||||
|
||||
for (var i:int = 0; i < participants.length; i++)
|
||||
{
|
||||
if (participants[i].userid == userId) {
|
||||
participants[i].isTalking = talk;
|
||||
sendNewMeetMeEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method gets called when the user has left
|
||||
* @param userId - the user which left the room
|
||||
*
|
||||
*/
|
||||
public function userLeft(userId : Number) : void
|
||||
{
|
||||
if (participants == null) return;
|
||||
|
||||
participants = meetMeRoom.dpParticipants.toArray();
|
||||
|
||||
var currentUsers : Array = new Array();
|
||||
|
||||
for (var i:int = 0; i < meetMeRoom.dpParticipants.length; i++)
|
||||
{
|
||||
if (meetMeRoom.dpParticipants[i].userid == userId) {
|
||||
meetMeRoom.dpParticipants.removeItemAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
meetMeRoom.dpParticipants.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mute or Unmute a specific user
|
||||
* @param userId - the user to mute/unmute
|
||||
* @param muteUser - mute/unmute?
|
||||
*
|
||||
*/
|
||||
public function muteUnmuteUser(note:MuteNotifier) : void
|
||||
{
|
||||
var nc_responder : Responder;
|
||||
nc_responder = new Responder(getMeetMeUsers, null);
|
||||
|
||||
log.voice("VoiceConfConnectResponder: calling meetmeService.muteUnmuteUser" + " userid:" + note.userid);
|
||||
proxy.getConnection().call("meetmeService.muteUnmuteUser", nc_responder, note.userid, note.muteUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a call to the server to mute all users
|
||||
* @param muteUSers
|
||||
*
|
||||
*/
|
||||
public function muteAllUsers(mute : Boolean) : void
|
||||
{
|
||||
log.voice("MeetMe: calling meetmeService.muteAllUsers");
|
||||
proxy.getConnection().call("meetmeService.muteAllUsers", null, mute);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ejects a particular user
|
||||
* @param userId - the user to eject
|
||||
*
|
||||
*/
|
||||
public function ejectUser(userId : Number) : void
|
||||
{
|
||||
log.voice("MeetMe: calling meetmeService.ejectUser");
|
||||
proxy.getConnection().call("meetmeService.ejectUser", null, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the users in the room on the server and then refreshes the ArrayCollection of users
|
||||
* which is stored in the MeetMeRoom class
|
||||
* @param meetmeUser
|
||||
*
|
||||
*/
|
||||
public function getMeetMeUsers(meetmeUser : Object) : void
|
||||
{
|
||||
var i:Number = 0;
|
||||
|
||||
if (participants == null) participants = new Array();
|
||||
|
||||
for(var items:String in meetmeUser)
|
||||
{
|
||||
var userId : String = meetmeUser[items][0];
|
||||
var cidName : String = meetmeUser[items][1];
|
||||
var cidNum : String = meetmeUser[items][2];
|
||||
var muted : Boolean = meetmeUser[items][3];
|
||||
var talking : Boolean = meetmeUser[items][4];
|
||||
|
||||
if (cidName == null) cidName = "unknown";
|
||||
|
||||
participants.push({callerName : cidName, isMuted : muted, isTalking : talking, userid : userId});
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
participants.sortOn("callerName", Array.CASEINSENSITIVE);
|
||||
|
||||
log.voice("Getting users for refresh");
|
||||
meetMeRoom.dpParticipants = new ArrayCollection(participants);
|
||||
meetMeRoom.dpParticipants.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Responds to a SYNC event of a shared object
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
private function sharedObjectSyncHandler( event : SyncEvent) : void
|
||||
{
|
||||
log.voice( "MeetMe::sharedObjectSyncHandler " + event.changeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Responds to a NET_STATUS_EVENT of a shared object
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
private function netStatusHandler ( event : NetStatusEvent ) : void
|
||||
{
|
||||
log.voice( "MeetMe::netStatusHandler " + event.info.code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Responds to an ASYNC_ERROR_EVENT of a shared object
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
private function asyncErrorHandler ( event : AsyncErrorEvent ) : void
|
||||
{
|
||||
log.voice( "MeetMe::asyncErrorHandler " + event.error);
|
||||
}
|
||||
|
||||
/**
|
||||
* The method is called when a new event is received from the server
|
||||
* <p>
|
||||
* This method then sends out a notification to the rest of the module
|
||||
*
|
||||
*/
|
||||
public function sendNewMeetMeEvent():void
|
||||
{
|
||||
//log.voice("Got to sendMeetMeEvent");
|
||||
sendNotification(VoiceFacade.USER_JOIN_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package org.bigbluebutton.modules.voiceconference.model.service
|
||||
{
|
||||
public interface IVoiceService
|
||||
{
|
||||
function connect(uri:String):void;
|
||||
function disconnect():void;
|
||||
function sendMessage(message:String):void;
|
||||
function addMessageListener(msgListener:Function):void;
|
||||
function addConnectionStatusListener(connectionListener:Function):void;
|
||||
}
|
||||
}
|
@ -1,142 +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.model.service
|
||||
{
|
||||
import flash.events.*;
|
||||
import flash.net.NetConnection;
|
||||
|
||||
public class NetConnectionDelegate
|
||||
{
|
||||
public static const NAME : String = "NetConnectionDelegate";
|
||||
|
||||
private var _netConnection : NetConnection;
|
||||
private var _uri : String;
|
||||
private var connectionId : Number;
|
||||
private var connected : Boolean = false;
|
||||
private var _connectionListener:Function;
|
||||
|
||||
public function NetConnectionDelegate(uri:String, connectionListener:Function) : void
|
||||
{
|
||||
_netConnection = new NetConnection();
|
||||
_uri = uri;
|
||||
_connectionListener = connectionListener;
|
||||
}
|
||||
|
||||
public function get connection():NetConnection {
|
||||
return _netConnection;
|
||||
}
|
||||
|
||||
public function connect() : void
|
||||
{
|
||||
_netConnection.client = this;
|
||||
_netConnection.addEventListener( NetStatusEvent.NET_STATUS, netStatus );
|
||||
_netConnection.addEventListener( AsyncErrorEvent.ASYNC_ERROR, netASyncError );
|
||||
_netConnection.addEventListener( SecurityErrorEvent.SECURITY_ERROR, netSecurityError );
|
||||
_netConnection.addEventListener( IOErrorEvent.IO_ERROR, netIOError );
|
||||
|
||||
try {
|
||||
trace( "Connecting to " + _uri);
|
||||
_netConnection.connect(_uri );
|
||||
|
||||
} catch( e : ArgumentError ) {
|
||||
// Invalid parameters.
|
||||
switch ( e.errorID )
|
||||
{
|
||||
case 2004 :
|
||||
trace("Error! Invalid server location: " + _uri);
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function disconnect() : void
|
||||
{
|
||||
_netConnection.close();
|
||||
}
|
||||
|
||||
protected function netStatus( event : NetStatusEvent ) : void
|
||||
{
|
||||
handleResult( event );
|
||||
}
|
||||
|
||||
public function handleResult( event : Object ) : void {
|
||||
var info : Object = event.info;
|
||||
var statusCode : String = info.code;
|
||||
|
||||
switch ( statusCode )
|
||||
{
|
||||
case "NetConnection.Connect.Success" :
|
||||
trace("Connection to voice application succeeded.");
|
||||
_connectionListener(true);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Failed" :
|
||||
_connectionListener(false);
|
||||
trace("Connection to voice application failed");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Closed" :
|
||||
_connectionListener(false);
|
||||
trace("Connection to voice application closed");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.InvalidApp" :
|
||||
_connectionListener(false);
|
||||
trace("voice application not found on server");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.AppShutDown" :
|
||||
_connectionListener(false);
|
||||
trace("voice application has been shutdown");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Rejected" :
|
||||
_connectionListener(false);
|
||||
trace("No permissions to connect to the voice application" );
|
||||
break;
|
||||
|
||||
default :
|
||||
// statements
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function netSecurityError( event : SecurityErrorEvent ) : void
|
||||
{
|
||||
trace("Security error - " + event.text);
|
||||
_connectionListener(false);
|
||||
}
|
||||
|
||||
protected function netIOError( event : IOErrorEvent ) : void
|
||||
{
|
||||
trace("Input/output error - " + event.text);
|
||||
_connectionListener(false);
|
||||
}
|
||||
|
||||
protected function netASyncError( event : AsyncErrorEvent ) : void
|
||||
{
|
||||
trace("Asynchronous code error - " + event.error );
|
||||
_connectionListener(false);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,158 +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.model.service
|
||||
{
|
||||
import flash.events.AsyncErrorEvent;
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.net.SharedObject;
|
||||
|
||||
public class VoiceSOService implements IVoiceService
|
||||
{
|
||||
public static const NAME:String = "VoiceSOService";
|
||||
|
||||
private var voiceSO : SharedObject;
|
||||
private static const SHARED_OBJECT:String = "meetMeUsersSO";
|
||||
|
||||
private var netConnectionDelegate: NetConnectionDelegate;
|
||||
private var _uri:String;
|
||||
private var _msgListener:Function;
|
||||
private var _connectionListener:Function;
|
||||
|
||||
public function VoiceSOService(uri:String)
|
||||
{
|
||||
_uri = uri;
|
||||
netConnectionDelegate = new NetConnectionDelegate(uri, connectionListener);
|
||||
}
|
||||
|
||||
public function connect(uri:String):void {
|
||||
_uri = uri
|
||||
netConnectionDelegate.connect();
|
||||
}
|
||||
|
||||
public function disconnect():void {
|
||||
leave();
|
||||
netConnectionDelegate.disconnect();
|
||||
}
|
||||
|
||||
private function connectionListener(connected:Boolean):void {
|
||||
if (connected) {
|
||||
trace(NAME + ":Connected to the VOice application");
|
||||
join();
|
||||
} else {
|
||||
leave();
|
||||
trace(NAME + ":Disconnected from the Voice application");
|
||||
notifyConnectionStatusListener(false);
|
||||
}
|
||||
}
|
||||
|
||||
private function join() : void
|
||||
{
|
||||
voiceSO = SharedObject.getRemote(SHARED_OBJECT, _uri, false);
|
||||
voiceSO.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
voiceSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
voiceSO.client = this;
|
||||
voiceSO.connect(netConnectionDelegate.connection);
|
||||
trace(NAME + ":Voice is connected to Shared object");
|
||||
notifyConnectionStatusListener(true);
|
||||
}
|
||||
|
||||
private function leave():void
|
||||
{
|
||||
if (voiceSO != null) voiceSO.close();
|
||||
}
|
||||
|
||||
public function addMessageListener(messageListener:Function):void {
|
||||
_msgListener = messageListener;
|
||||
}
|
||||
|
||||
public function addConnectionStatusListener(connectionListener:Function):void {
|
||||
_connectionListener = connectionListener;
|
||||
}
|
||||
|
||||
public function sendMessage(message:String):void
|
||||
{
|
||||
voiceSO.send("receiveNewMessage", message);
|
||||
}
|
||||
|
||||
public function receiveNewMessage(message:String):void{
|
||||
if (_msgListener != null) {
|
||||
_msgListener( message);
|
||||
}
|
||||
}
|
||||
|
||||
private function notifyConnectionStatusListener(connected:Boolean):void {
|
||||
if (_connectionListener != null) {
|
||||
trace('notifying connectionListener for Voice');
|
||||
_connectionListener(connected);
|
||||
} else {
|
||||
trace("_connectionListener is null");
|
||||
}
|
||||
}
|
||||
|
||||
private function netStatusHandler ( event : NetStatusEvent ) : void
|
||||
{
|
||||
var statusCode : String = event.info.code;
|
||||
|
||||
switch ( statusCode )
|
||||
{
|
||||
case "NetConnection.Connect.Success" :
|
||||
trace(NAME + ":Connection Success");
|
||||
notifyConnectionStatusListener(true);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Failed" :
|
||||
trace(NAME + ":Connection to voice SO failed");
|
||||
notifyConnectionStatusListener(false);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Closed" :
|
||||
trace(NAME + ":Connection to voice SO closed");
|
||||
notifyConnectionStatusListener(false);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.InvalidApp" :
|
||||
trace(NAME + ":Voice application not found on server");
|
||||
notifyConnectionStatusListener(false);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.AppShutDown" :
|
||||
trace(NAME + ":Voice application has been shutdown");
|
||||
notifyConnectionStatusListener(false);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Rejected" :
|
||||
trace(NAME + ":No permissions to connect to the voice application" );
|
||||
notifyConnectionStatusListener(false);
|
||||
break;
|
||||
|
||||
default :
|
||||
trace(NAME + ":default - " + event.info.code );
|
||||
notifyConnectionStatusListener(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function asyncErrorHandler ( event : AsyncErrorEvent ) : void
|
||||
{
|
||||
trace( "VoiceSO asyncErrorHandler " + event.error);
|
||||
notifyConnectionStatusListener(false);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,32 +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.model.vo
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
public interface IListeners {
|
||||
function addListener(listener:Listener):void;
|
||||
function hasListener(id:Number):Boolean;
|
||||
function getListener(id:Number):Listener;
|
||||
function removeListener(id:Number):void;
|
||||
function removeAllListeners():void;
|
||||
function newUserStatus(id:Number, newStatus:String):void;
|
||||
}
|
||||
}
|
@ -1,33 +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.model.vo
|
||||
{
|
||||
public class Listener
|
||||
{
|
||||
public var room:String;
|
||||
public var callerIdName:String;
|
||||
public var callerIdNumber:String;
|
||||
public var dateJoined:Date;
|
||||
public var dateLeft:Date;
|
||||
public var userid:Number;
|
||||
public var muted:Boolean;
|
||||
public var talking:Boolean;
|
||||
}
|
||||
}
|
@ -1,108 +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.model.vo
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
public class Listeners implements IListeners
|
||||
{
|
||||
[Bindable] public var listeners:ArrayCollection = null;
|
||||
|
||||
public function Listeners():void
|
||||
{
|
||||
listeners = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function addListener(listener:Listener):void
|
||||
{
|
||||
if (! hasListener(listener.userid)) {
|
||||
listeners.addItem(listener);
|
||||
sort();
|
||||
}
|
||||
}
|
||||
|
||||
public function hasListener(id:Number):Boolean
|
||||
{
|
||||
var index:int = getListenerIndex(id);
|
||||
if (index > -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getListener(id:Number):Listener
|
||||
{
|
||||
var index:int = getListenerIndex(id);
|
||||
if (index > -1) {
|
||||
return listeners.getItemAt(index) as Listener;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function removeListener(id:Number):void
|
||||
{
|
||||
var index:int = getListenerIndex(id);
|
||||
trace( "removing listener[" + id + " at index=" + index + "]")
|
||||
if (index > -1) {
|
||||
trace( "remove listener[" + id + " at index=" + index + "]");
|
||||
listeners.removeItemAt(index);
|
||||
sort();
|
||||
}
|
||||
}
|
||||
|
||||
private function getListenerIndex(id:Number):int
|
||||
{
|
||||
var l:Listener;
|
||||
for (var i:int = 0; i < listeners.length; i++)
|
||||
{
|
||||
l = listeners.getItemAt(i) as Listener;
|
||||
if (l.userid == id) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
// Listener not found.
|
||||
return -1;
|
||||
}
|
||||
|
||||
public function removeAllListeners():void
|
||||
{
|
||||
listeners.removeAll();
|
||||
}
|
||||
|
||||
public function newUserStatus(id:Number, newStatus:String) : void
|
||||
{
|
||||
var l:Listener = getListener(id);
|
||||
|
||||
if (l != null) {
|
||||
//l.status = newStatus;
|
||||
}
|
||||
|
||||
sort();
|
||||
}
|
||||
|
||||
private function sort() : void
|
||||
{
|
||||
listeners.source.sortOn("callerIdName", Array.CASEINSENSITIVE);
|
||||
listeners.refresh();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user