Rename VoiceModule to ListenersModule

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@680 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Richard Alam 2008-11-06 18:48:28 +00:00
parent be479bcc66
commit 878cdcf3d9
6 changed files with 0 additions and 559 deletions

View File

@ -1,48 +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.view
{
import flexlib.mdi.containers.MDIWindow;
import mx.controls.TileList;
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
import org.bigbluebutton.modules.voiceconference.model.VoiceConferenceRoom;
/**
* This is a convinience class extended by the Listeners Window. It holds some variables
* @author dev_team@bigbluebutton.org
*
*/
public class ListenersClass extends MDIWindow
{
private var model:VoiceFacade = VoiceFacade.getInstance();
[Bindable]
public var meetMeRoom:VoiceConferenceRoom = model.meetMeRoom;;
[Bindable]
public var participantsList:TileList;
[Bindable]
public var userRole : uint;
}
}

View File

@ -1,104 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<view:ListenersClass xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:view="org.bigbluebutton.modules.voiceconference.view.*"
xmlns:controller="org.bigbluebutton.modules.voiceconference.control.*"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.core.Application;
import org.bigbluebutton.modules.viewers.ViewersFacade;
import org.bigbluebutton.modules.viewers.model.business.Conference;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.Images;
import mx.events.DragEvent;
import flash.events.MouseEvent;
import mx.core.DragSource;
import mx.managers.DragManager;
import mx.controls.Label;
import mx.collections.ArrayCollection;
import mx.controls.Image;
public static const TITLE:String = "Listeners";
private var images:Images = new Images();
//private var meetme:MeetMeUserItem = new MeetMeUserItem();
[Bindable] public var dropTargetIcon : Object = images.door_in;
[Bindable] private var muteAllIcon : Class = images.sound_mute;
[Bindable] private var unmuteAllIcon : Class = images.sound_none;
[Bindable] private var role:String;
public var userid:Number;
public var isMuted:Boolean;
//Full screen?
private var dispState:String;
private function init():void{
// var conf:Conference = ViewersFacade.getInstance().retrieveMediator(Conference.NAME) as Conference;
// role = conf.me.role;
//Initialize full screen handler
Application.application.stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler);
dispState = Application.application.stage.displayState;
}
private function fullScreenHandler(evt:FullScreenEvent):void {
dispState = Application.application.stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")";
if (evt.fullScreen) {
//Notify user that the keyboard is not working
this.maximizeRestoreBtn.visible = false;
if (this.maximized){
this.restore();
}
} else{
this.maximizeRestoreBtn.visible = true;
}
}
public function dragEnterHandler(event:DragEvent):void
{
var dropTarget : Image = event.currentTarget as Image;
if (event.dragSource.hasFormat('userid'))
DragManager.acceptDragDrop(dropTarget);
}
public function dragDropHandler(event:DragEvent):void
{
dropTargetIcon = images.door_open;
userid = Number(event.dragSource.dataForFormat('userid'));
dispatchEvent(new Event(ListenersWindowMediator.EJECT_USER));
}
//public function muteUser(event:MouseEvent):void
//{
// userid = Number(event.currentTarget.userid);
// dispatchEvent(new Event(ListenersWindowMediator.MUTE_USER));
//}
]]>
</mx:Script>
<mx:TileList id="participantsList" height="100%" width="100%"
itemRenderer="org.bigbluebutton.modules.voiceconference.view.MeetMeUserItem"
maxColumns="1" rowHeight="25" columnWidth="200"
dataProvider="{meetMeRoom.dpParticipants}">
</mx:TileList>
<mx:ControlBar width="100%">
<mx:Button id="muteAllIconImg" icon="{muteAllIcon}"
toolTip="Mute All" click="dispatchEvent(new Event(ListenersWindowMediator.MUTE_ALL))"
visible="{role == Role.MODERATOR}"/>
<mx:Button id="unmuteAllIconImg" icon="{unmuteAllIcon}"
toolTip="Unmute All" click="dispatchEvent(new Event(ListenersWindowMediator.UNMUTE_ALL))"
visible="{role == Role.MODERATOR}"/>
<mx:Spacer width="100%"/>
<mx:Image id="ejectUserDropTarget" source="{dropTargetIcon}"
toolTip="Drop user here to eject." visible="{role == Role.MODERATOR}"
dragEnter="dragEnterHandler(event)" dragDrop="dragDropHandler(event)"/>
</mx:ControlBar>
</view:ListenersClass>

View File

@ -1,131 +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.view
{
import flash.events.Event;
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
import org.bigbluebutton.modules.voiceconference.control.notifiers.MuteNotifier;
import org.puremvc.as3.multicore.interfaces.IMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
/**
* The ListenersWindowMediator is a Mediator class for the ListenersWindow mxml component
* <p>
* This class extends the Mediator class of the PureMVC framework
* @author Denis Zgonjanin
*
*/
public class ListenersWindowMediator extends Mediator implements IMediator
{
public static const NAME:String = "ListenersWindowMediator";
public static const UNMUTE_ALL:String = "Unmute All Users";
public static const MUTE_ALL:String = "Mute All Users";
public static const EJECT_USER:String = "Eject User";
public static const MUTE_USER:String = "Mute User";
/**
* The default constructor. Assigns this class to a certain GUI component
* @param view - the gui component which this class Mediates
*
*/
public function ListenersWindowMediator(view:ListenersWindow)
{
super(NAME, view);
view.addEventListener(UNMUTE_ALL, unmuteAllUsers);
view.addEventListener(MUTE_ALL, muteAllUsers);
view.addEventListener(EJECT_USER, ejectUser);
view.addEventListener(MUTE_USER, muteUser);
}
/**
*
* @return The GUI component of this mediator
*
*/
public function get listenersWindow():ListenersWindow{
return viewComponent as ListenersWindow;
}
/**
*
* @return The array of strings representing which notifications this class listens to
* <p>
* This class listens to the following notifications:
* MeetMeFacade.USER_JOIN_EVENT
*
*/
override public function listNotificationInterests():Array{
return [
VoiceFacade.USER_JOIN_EVENT
];
}
/**
* Decides how to handle a notification received by this class
* @param notification
*
*/
override public function handleNotification(notification:INotification):void{
switch(notification.getName()){
case VoiceFacade.USER_JOIN_EVENT:
listenersWindow.participantsList.dataProvider = VoiceFacade.getInstance().meetMeRoom.dpParticipants;
//log.debug("Participants: " + VoiceConferenceFacade.getInstance().meetMeRoom.dpParticipants.length);
break;
}
}
/**
* Sends a MUTE_ALL_USERS_COMMAND notification (false - unmutes all users)
* @param e - the event which generated the call to this method
*
*/
private function unmuteAllUsers(e:Event) : void
{
sendNotification(VoiceFacade.MUTE_ALL_USERS_COMMAND, false);
}
/**
* Sends a MUTE_ALL_USERS_COMMAND notification (true - mutes all users)
* @param e - the event which generated the call to this method
*
*/
private function muteAllUsers(e:Event) : void
{
sendNotification(VoiceFacade.MUTE_ALL_USERS_COMMAND, true);
}
/**
* Sends an EJECT_USER_COMMAND notification
* @param e - the event which generated the call to this method
*
*/
private function ejectUser(e:Event):void{
sendNotification(VoiceFacade.EJECT_USER_COMMAND, listenersWindow.userid);
}
private function muteUser(e:Event):void{
sendNotification(VoiceFacade.MUTE_UNMUTE_USER_COMMAND,new MuteNotifier(listenersWindow.userid, listenersWindow.isMuted));
}
}
}

View File

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" creationComplete="initParticipantItem()">
<mx:Script>
<![CDATA[
import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
import mx.controls.Image;
import org.bigbluebutton.modules.voiceconference.view.ListenersWindowMediator;
import mx.events.DragEvent;
import flash.events.MouseEvent;
import mx.core.DragSource;
import mx.managers.DragManager;
import mx.controls.Label;
import mx.collections.ArrayCollection;
import mx.controls.TileList;
import org.bigbluebutton.modules.log.LogModuleFacade;
//private var confModel:ConferenceFacade = ConferenceFacade.getInstance();
private var userRole : String = Role.MODERATOR;
private var log : LogModuleFacade = LogModuleFacade.getInstance("LogModule");
private var model:VoiceFacade = VoiceFacade.getInstance();
private var images:Images = new Images();
[Bindable] private var muteIcon : Object = images.sound_mute;
[Bindable] private var talkIcon : Object = images.sound;
[Bindable] private var ejectIcon : Object = images.eject_user;
[Bindable] private var statusTooltip : String = "";
[Bindable] private var ejectTooltip : String = "Click to eject user.";
[Bindable] public var isModerator : Boolean = true;
private function initParticipantItem() : void
{
displayStatusIcon();
VoiceFacade.getInstance().registerMediator(new MeetMeUserItemMediator(this));
log.voice("VoiceConferenceFacade.getInstance().registerMediator(new MeetMeUserItemMediator(this));");
//trace(this.parent.toString());
//trace(this.parentApplication.toString());
//trace(this.parentDocument.userid);
//trace(this.document.toString());
}
public function displayStatusIcon() : void
{
if (data.isMuted) {
muteIcon = images.sound_mute;
muteImg.toolTip = "Double click to unmute user.";
} else {
muteIcon = images.sound_none;
muteImg.toolTip = "Double click to mute user.";
}
if (data.isTalking) {
talkIcon = images.sound;
talkImg.toolTip = "Talking";
talkImg.visible = true;
} else {
talkImg.visible = false;
}
if (model.meetMeRoom.userRole == Role.MODERATOR) {
isModerator = true;
} else {
isModerator = false;
statusTooltip = "";
ejectTooltip = "";
}
}
public function dragIt(event:MouseEvent, userid:Number):void
{
if (userRole != Role.MODERATOR) return;
var dragInitiator:Label = event.currentTarget as Label;
var dragSource:DragSource = new DragSource();
dragSource.addData(data.userid , 'userid');
var dragProxy:Image = new Image();
dragProxy.source = images.eject_user;
dragProxy.alpha = 1;
DragManager.doDrag(dragInitiator, dragSource , event, dragProxy, 0, 0, 1, true);
}
public function muteUser():void
{
//this.parentDocument.userid = this.data.userid;
//this.parentDocument.isMuted != this.data.isMuted;
dispatchEvent(new Event(MeetMeUserItemMediator.MUTE_UNMUTE_USER));
log.voice("MeetMeUserItem:: doubleClick to mute/unmute");
}
]]>
</mx:Script>
<mx:Image id="muteImg" source="{muteIcon}" doubleClick="muteUser()"/>
<mx:Label id="nameLabel" mouseDown="dragIt(event,data.userid)" useHandCursor="true"
toolTip="Drag to eject." text="{data.callerName}"/>
<mx:Image id="talkImg" source="{talkIcon}" visible="{data.isTalking}" toolTip="Talking"/>
</mx:HBox>

View File

@ -1,118 +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.view
{
import flash.events.Event;
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
import org.bigbluebutton.modules.voiceconference.control.notifiers.MuteNotifier;
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 is the mediator class for the MeerMeUserItem GUI component
* <p>
* This class extends the Mediator class of the PureMVC framework
* @author Denis Zgonjanin
*
*/
public class MeetMeUserItemMediator extends Mediator implements IMediator
{
public static const NAME:String = "MeetMeUserItemMediator";
public static const MUTE_UNMUTE_USER:String = "Mute-Unmute User";
private var log : LogModuleFacade = LogModuleFacade.getInstance("LogModule");
/**
* The defualt constructor
* @param view - The gui component which this class mediates
*
*/
public function MeetMeUserItemMediator(view:MeetMeUserItem)
{
super(NAME, view);
view.addEventListener(MUTE_UNMUTE_USER, muteUnmuteUser);
log.voice("this is in MeetMeUserItemMediator's constructor: adding MUTE_UNMUTE_USER event listener");
}
/**
*
* @return - the gui component of this mediator
*
*/
public function get meetMeUserItem():MeetMeUserItem{
return viewComponent as MeetMeUserItem;
}
/**
*
* @return - the events which this class listens
* <p>
* This class listens to the following notifications:
* MeetMeFacade.USER_JOIN_EVENT
*
*/
override public function listNotificationInterests():Array{
return [
VoiceFacade.USER_JOIN_EVENT
];
}
/**
* Handles a received notification
* @param notification
*
*/
override public function handleNotification(notification:INotification):void{
switch(notification.getName()){
case VoiceFacade.USER_JOIN_EVENT:
onNewMeetMeEvent(notification);
break;
}
}
/**
* Mutes or unmutes a user
*
*/
private function muteUnmuteUser(e:Event) : void
{
//if (meetMeUserItem. == true)
//{
sendNotification(VoiceFacade.MUTE_EVENT, new MuteNotifier(meetMeUserItem.data.userid, !meetMeUserItem.data.isMuted));
log.voice("MeetMeUserItemMediator::muteUnmuteUser() : [" + meetMeUserItem.data.userid + "," + !meetMeUserItem.data.isMuted + "]");
//}
//else return;
}
/**
* Changes the display when a New MeetMeEvent is received
* @param note
*
*/
private function onNewMeetMeEvent(note:INotification) : void
{
//log.debug("Got newMeetMeEvent."); // comment out as generates too much noise
meetMeUserItem.displayStatusIcon();
}
}
}

View File

@ -1,50 +0,0 @@
package org.bigbluebutton.modules.voiceconference.view.recording
{
import org.bigbluebutton.modules.voiceconference.VoiceFacade;
import org.bigbluebutton.modules.voiceconference.model.VoiceConferenceRoom;
import org.bigbluebutton.modules.voiceconference.model.vo.User;
import org.bigbluebutton.modules.voiceconference.view.ListenersWindow;
import org.bigbluebutton.modules.voiceconference.view.ListenersWindowMediator;
import org.puremvc.as3.multicore.interfaces.INotification;
public class ListenersPlaybackMediator extends ListenersWindowMediator
{
public static const PLAYBACK_ROOM:String = "Playback Room";
public static const JOIN:String = "join";
public static const TALK:String = "talk";
public static const LEFT:String = "left";
public function ListenersPlaybackMediator(view:ListenersWindow)
{
super(view);
}
override public function initializeNotifier(key:String):void{
super.initializeNotifier(key);
(facade as VoiceFacade).meetMeRoom = new VoiceConferenceRoom(PLAYBACK_ROOM);
}
override public function listNotificationInterests():Array{
return [
JOIN,
LEFT,
TALK
];
}
override public function handleNotification(notification:INotification):void{
var message:XML = notification.getBody() as XML;
switch(notification.getName()){
case JOIN:
listenersWindow.meetMeRoom.dpParticipants.addItem(new User())
break;
case LEFT:
break;
case TALK:
break;
}
}
}
}