mic disable state is implemented, but can't filter by role yet

This commit is contained in:
Chad Pilkey 2013-03-28 14:38:37 -07:00
parent 799cc3f348
commit bfa8e97e34
14 changed files with 125 additions and 14 deletions

View File

@ -67,6 +67,17 @@ public class VoiceService {
return result;
}
public void disableViewersMic(boolean lock) {
String conference = getBbbSession().getVoiceBridge();
log.debug("Disable all viewers in room[" + conference + "]");
conferenceService.disable(conference, lock);
}
public boolean isRoomViewerDisabled(){
String conference = getBbbSession().getVoiceBridge();
return conferenceService.isRoomViewerDisabled(conference);
}
public void muteAllUsers(boolean mute) {
String conference = getBbbSession().getVoiceBridge();
log.debug("Mute all users in room[" + conference + "]");

View File

@ -92,6 +92,27 @@ public class ConferenceService implements ConferenceEventListener {
return false;
}
public void disable(String room, Boolean lock) {
if (roomMgr.hasRoom(room)) {
roomMgr.disable(room, lock);
ArrayList<Participant> p = getParticipants(room);
for (Participant o : p) {
if (lock) {
muteParticipant(o.getId(), room, true);
}
lock(o.getId(), room, lock);
}
}
}
public boolean isRoomViewerDisabled(String room){
if (roomMgr.hasRoom(room)) {
return roomMgr.isRoomViewerDisabled(room);
}
return false;
}
private void muteParticipant(Integer participant, String room, Boolean mute) {
confProvider.mute(room, participant, mute);
}

View File

@ -28,6 +28,7 @@ public interface Room {
public boolean hasParticipant(Integer id);
public ArrayList<Participant> getParticipants();
public boolean isMuted();
public boolean isViewerDisabled();
public void record(boolean rec);
public boolean record();
public void recording(boolean rec);

View File

@ -36,6 +36,7 @@ public class RoomImp implements Room {
private final ConcurrentMap<Integer, Participant> participants;
private boolean muted = false;
private boolean viewerDisabled = false;
private boolean record = false;
private String meetingid;
private boolean recording = false;
@ -80,6 +81,14 @@ public class RoomImp implements Room {
return muted;
}
public void disable(boolean disable) {
viewerDisabled = disable;
}
public boolean isViewerDisabled() {
return viewerDisabled;
}
public void record(boolean record){
this.record = record;
}

View File

@ -79,6 +79,17 @@ public class RoomManager {
else return false;
}
public void disable(String room, boolean lock) {
RoomImp rm = rooms.get(room);
if (rm != null) rm.disable(lock);
}
public boolean isRoomViewerDisabled(String room){
RoomImp rm = rooms.get(room);
if (rm != null) return rm.isViewerDisabled();
else return false;
}
public ArrayList<Participant> getParticipants(String room) {
log.debug("Getting participants for room: " + room);
RoomImp rm = rooms.get(room);

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties analytics="false" mainApplicationPath="BigBlueButton.mxml" projectUUID="2f78753b-2e4c-41b4-8cf4-eddb768eb4b3" version="10">
<compiler additionalCompilerArguments="-locale=" autoRSLOrdering="true" copyDependentFiles="true" flex3CompatMode="true" flexSDK="Flex 4.5" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="10.3.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
<compiler additionalCompilerArguments="-locale=" autoRSLOrdering="true" copyDependentFiles="true" flex3CompatMode="true" flexSDK="Flex 4.5" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="11.2.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
<compilerSourcePath/>
<libraryPath defaultLinkType="1">
<libraryPathEntry kind="4" path="">
@ -14,13 +14,13 @@
</libraryPathEntry>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
<libraryPathEntry applicationDomain="default" forceLoad="false" index="3" kind="3" linkType="4" path="${PROJECT_FRAMEWORKS}/libs/spark.swc" useDefaultLinkType="true">
<crossDomainRsls>
<crossDomainRslEntry autoExtract="true" policyFileUrl="http://fpdownload.adobe.com/pub/swz/crossdomain.xml" rslUrl="http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/spark_4.5.0.20967.swz"/>
<crossDomainRslEntry autoExtract="true" policyFileUrl="" rslUrl="spark_4.5.0.20967.swz"/>
</crossDomainRsls>
</libraryPathEntry>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
</excludedEntries>
</libraryPathEntry>
<libraryPathEntry kind="1" linkType="1" path="libs"/>
@ -61,4 +61,3 @@
</buildCSSFiles>
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>

View File

@ -1,3 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>

View File

@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.adobe.flexbuilder.project.flexbuilder</name>
<arguments>
@ -20,6 +25,7 @@
<nature>com.adobe.flexbuilder.project.flexnature</nature>
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
<nature>com.powerflasher.fdt.core.FlashNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>

View File

@ -1,4 +1,3 @@
#Mon Dec 13 14:02:21 EST 2010
eclipse.preferences.version=1
encoding//locale/el_GR/bbbResources.properties=UTF-8
encoding/<project>=UTF-8

View File

@ -119,7 +119,7 @@ package org.bigbluebutton.modules.classyaudio.managers
private function enablePushToTalkButton():void{
var e:ToolbarButtonEvent = new ToolbarButtonEvent(ToolbarButtonEvent.ADD);
e.button = new PushToTalkButton();
event.module="Microphone";
e.module="Microphone";
//e.tabIndex = 2;
dispatcher.dispatchEvent(e);
}

View File

@ -94,6 +94,8 @@ package org.bigbluebutton.modules.users.business
{
//find the presenter and lock them
var pres:BBBUser = UserManager.getInstance().getConference().getPresenter();
if (pres && pres.voiceLocked) pres = null;
if (pres)
_listenersService.lockMuteUser(int(pres.voiceUserid), true);
@ -103,6 +105,11 @@ package org.bigbluebutton.modules.users.business
if (pres)
_listenersService.lockMuteUser(int(pres.voiceUserid), false);
}
public function lockMuteUser(command:VoiceConfEvent):void
{
_listenersService.lockMuteUser(command.userid, command.lock);
}
public function kickUser(event:KickUserEvent):void {
var user:BBBUser = UsersUtil.getUser(event.userid);

View File

@ -74,4 +74,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{UsersProxy}" method="muteAlmostAllUsers" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{VoiceConfEvent.LOCK_MUTE_USER}" >
<MethodInvoker generator="{UsersProxy}" method="lockMuteUser" arguments="{event}" />
</EventHandlers>
</EventMap>

View File

@ -60,20 +60,26 @@
private var rolledOver:Boolean = false;
private var muteRolled:Boolean = false;
private var lockRolled:Boolean = false;
private function onCreationComplete():void{
muteBtn.enabled = kickUserBtn.enabled = moderator = UserManager.getInstance().getConference().amIModerator();
lockBtn.enabled = muteBtn.enabled = kickUserBtn.enabled = moderator = UserManager.getInstance().getConference().amIModerator();
if (moderator) {
BindingUtils.bindProperty(muteBtn, "visible", voiceJoinedInd, "visible");
muteBtn.includeInLayout = true;
BindingUtils.bindProperty(lockBtn, "visible", voiceJoinedInd, "visible");
lockBtn.includeInLayout = true;
} else {
BindingUtils.bindProperty(muteImg, "visible", voiceJoinedInd, "visible");
muteImg.includeInLayout = true;
BindingUtils.bindProperty(lockImg, "visible", voiceJoinedInd, "visible");
lockImg.includeInLayout = true;
}
this.addEventListener(FlexEvent.DATA_CHANGE, dataChangeHandler);
BindingUtils.bindSetter(updateMuteBtn, muteInd, "visible");
BindingUtils.bindSetter(updateLockBtn, voiceLockedInd, "visible");
}
private function dataChangeHandler(e:Event):void {
@ -115,6 +121,13 @@
dispatchEvent(e);
}
public function toggleLockState():void {
var e:VoiceConfEvent = new VoiceConfEvent(VoiceConfEvent.LOCK_MUTE_USER);
e.userid = data.userid;
e.lock = !data.voiceLocked;
dispatchEvent(e);
}
private function updateMuteBtn(voiceMuted:Boolean = false):void {
if (data != null) {
if (moderator) {
@ -131,16 +144,42 @@
}
}
private function mouseOverHandler():void {
private function updateLockBtn(voiceLocked:Boolean = false):void {
if (data != null) {
if (moderator) {
if (data.voiceLocked == lockRolled)
lockBtn.setStyle("icon", images.unlocked);
else
lockBtn.setStyle("icon", images.locked);
} else {
if (data.voiceLocked == lockRolled)
lockImg.source = images.unlocked;
else
lockImg.source = images.locked;
}
}
}
private function mouseOverMuteHandler():void {
muteRolled = true;
updateMuteBtn();
}
private function mouseOutHandler():void {
private function mouseOutMuteHandler():void {
muteRolled = false;
updateMuteBtn();
}
private function mouseOverLockHandler():void {
lockRolled = true;
updateLockBtn();
}
private function mouseOutLockHandler():void {
lockRolled = false;
updateLockBtn();
}
]]>
</mx:Script>
<mx:Image id="talkingIcon" visible="{data.talking}" source="{images.sound_new}" width="20" height="20"
@ -151,16 +190,21 @@
<mx:Image id="muteImg" visible="false" includeInLayout="false" width="16" height="16" />
<mx:Button id="muteBtn" visible="false" includeInLayout="false" enabled="false" icon="{images.audio}"
width="20" height="20" click="toggleMuteState()"
mouseOver="mouseOverHandler()"
mouseOut="mouseOutHandler()"
mouseOver="mouseOverMuteHandler()"
mouseOut="mouseOutMuteHandler()"
toolTip="{data.voiceMuted ? ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.pushToTalk') : ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.pushToMute')}" />
<mx:Button id="kickUserBtn" icon="{images.eject_user_new}"
width="20" height="20" visible="{rolledOver}"
toolTip="{ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.kickUser')}"
click="kickUser()"/>
<mx:Image id="showLock" visible="{data.voiceLocked}" source="{images.lock_close}" width="20" height="20" />
<mx:Image id="lockImg" visible="false" includeInLayout="false" width="16" height="16" />
<mx:Button id="lockBtn" visible="false" includeInLayout="false" enabled="false"
width="20" height="20" click="toggleLockState()"
mouseOver="mouseOverLockHandler()"
mouseOut="mouseOutLockHandler()"
toolTip="{ResourceUtil.getInstance().getString('bbb.listenerItem.lockImg.toolTip')}" />
<!-- Helper objects because direct bindings to data break when the itemRenderer is recycled -->
<mx:Image id="muteInd" includeInLayout="false" visible="{data.voiceMuted}" />
<mx:Image id="voiceJoinedInd" includeInLayout="false" visible="{data.voiceJoined}" />
<mx:Image id="voiceLockedInd" includeInLayout="false" visible="{data.voiceLocked}" />
</mx:HBox>

View File

@ -116,7 +116,7 @@ package org.red5.flash.bwcheck.app
{
LogUtil.debug("kbit Down: " + event.info.kbitDown + " Delta Down: " + event.info.deltaDown + " Delta Time: " + event.info.deltaTime + " Latency: " + event.info.latency);
LogUtil.debug("Server Client Bandwidth Detect Complete");
LogUtil.debug("Detecting Client Server Bandwidth)";
LogUtil.debug("Detecting Client Server Bandwidth");
ClientServer();
}