Merge branch 'set-option-for-voice'

This commit is contained in:
Richard Alam 2011-10-06 01:57:07 -04:00
commit 5d6d4cf87b
15 changed files with 87 additions and 33 deletions

View File

@ -40,6 +40,7 @@
<module name="PhoneModule" url="PhoneModule.swf?v=VERSION"
uri="rtmp://HOST/sip"
autoJoin="false"
skipCheck="false"
showButton="true"
dependsOn="ViewersModule"
/>

View File

@ -38,6 +38,10 @@ package org.bigbluebutton.core
return configManager;
}
public static function getConfigForModule(module:String):XML {
return initConfigManager().config.getConfigFor(module);
}
public static function initStreamManager():StreamManager {
if (streamManager == null) {
streamManager = new StreamManager();
@ -63,8 +67,7 @@ package org.bigbluebutton.core
var versionString:String = Capabilities.version;
var pattern:RegExp = /^(\w*) (\d*),(\d*),(\d*),(\d*)$/;
var result:Object = pattern.exec(versionString);
if (result != null)
{
if (result != null) {
// trace("input: " + result.input);
// trace("platform: " + result[1]);
// trace("majorVersion: " + result[2]);

View File

@ -11,14 +11,9 @@ package org.bigbluebutton.core.managers
import org.bigbluebutton.core.EventBroadcaster;
import org.bigbluebutton.core.model.Config;
public class ConfigManager2 extends EventDispatcher
{
public class ConfigManager2 extends EventDispatcher {
private var _config:Config = null;
public function ConfigManager2()
{
}
public function loadConfig():void {
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, handleComplete);

View File

@ -78,7 +78,7 @@ package org.bigbluebutton.core.model
return found;
}
public function getModuleConfig(moduleName:String):XML {
public function getConfigFor(moduleName:String):XML {
if (isModulePresent(moduleName)) {
return new XML(config.modules.module.(@name.toUpperCase() == moduleName.toUpperCase()).toXMLString());
}

View File

@ -49,7 +49,7 @@ package org.bigbluebutton.modules.chat.maps {
}
private function getChatOptions():void {
var cxml:XML = BBB.initConfigManager().config.getModuleConfig("ChatModule");
var cxml:XML = BBB.getConfigForModule("ChatModule");
if (cxml != null) {
chatOptions.privateEnabled = (cxml.@privateEnabled.toString().toUpperCase() == "TRUE") ? true : false;
}
@ -65,13 +65,9 @@ package org.bigbluebutton.modules.chat.maps {
// main application.
var event:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT);
event.window = _chatWindow;
globalDispatcher.dispatchEvent(event);
_chatWindowOpen = true;
dispatchTranslationOptions();
globalDispatcher.dispatchEvent(event);
_chatWindowOpen = true;
dispatchTranslationOptions();
}
public function closeChatWindow():void {

View File

@ -40,7 +40,7 @@ package org.bigbluebutton.modules.listeners.managers
dispatcher = new Dispatcher();
listenerOptions = new ListenerOptions();
var vxml:XML = BBB.initConfigManager().config.getModuleConfig("ListenersModule");
var vxml:XML = BBB.getConfigForModule("ListenersModule");
if (vxml != null) {
listenerOptions.windowVisible = (vxml.@windowVisible.toString().toUpperCase() == "TRUE") ? true : false;
}

View File

@ -1,13 +1,13 @@
package org.bigbluebutton.modules.phone
{
public class PhoneOptions
{
public class PhoneOptions {
[Bindable]
public var showButton:Boolean = true;
[Bindable]
public var autoJoin:Boolean = false;
[Bindable]
public var skipCheck:Boolean = false;
}
}

View File

@ -19,8 +19,7 @@
package org.bigbluebutton.modules.phone.managers {
import com.asfusion.mate.events.Dispatcher;
import com.asfusion.mate.events.Dispatcher;
import flash.events.AsyncErrorEvent;
import flash.events.Event;
import flash.events.IEventDispatcher;
@ -28,8 +27,7 @@ package org.bigbluebutton.modules.phone.managers {
import flash.events.SecurityErrorEvent;
import flash.external.*;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.NetStream;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.phone.events.CallConnectedEvent;
import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent;

View File

@ -18,7 +18,12 @@
*/
package org.bigbluebutton.modules.phone.managers {
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.modules.phone.PhoneOptions;
import org.bigbluebutton.modules.phone.events.CallConnectedEvent;
public class PhoneManager {
@ -26,6 +31,7 @@ package org.bigbluebutton.modules.phone.managers {
private var streamManager:StreamManager;
private var onCall:Boolean = false;
private var attributes:Object;
private var phoneOptions:PhoneOptions;
public function PhoneManager() {
connectionManager = new ConnectionManager();
@ -34,7 +40,22 @@ package org.bigbluebutton.modules.phone.managers {
public function setModuleAttributes(attributes:Object):void {
this.attributes = attributes;
if (attributes.autoJoin == "true") joinVoice(true);
var vxml:XML = BBB.getConfigForModule("PhoneModule");
phoneOptions = new PhoneOptions();
if (vxml != null) {
phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false;
phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false;
phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false;
}
if (phoneOptions.autoJoin) {
if (phoneOptions.skipCheck) {
joinVoice(true);
} else {
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS"));
}
}
}
private function setupMic(useMic:Boolean):void {

View File

@ -0,0 +1,22 @@
package org.bigbluebutton.modules.phone.managers
{
import flash.events.EventDispatcher;
import org.bigbluebutton.core.events.ErrorEvent;
public class PreferencesManager extends EventDispatcher {
private static var sharedObject:SharedObject = SharedObject.getLocal("BBBUserPreferences", "/");
public function savePreference(key:String, value:Object):void{
sharedObject.data[key] = value;
try{
sharedObject.flush(1000);
} catch(err:Error){
dispatchEvent(new ErrorEvent("SavingErrorEvent", true, true));
}
}
public function getPreference(key:String):Object {
return sharedObject.data[key];
}
}
}

View File

@ -18,8 +18,7 @@
*/
package org.bigbluebutton.modules.phone.managers {
import com.asfusion.mate.events.Dispatcher;
import com.asfusion.mate.events.Dispatcher;
import flash.events.ActivityEvent;
import flash.events.AsyncErrorEvent;
import flash.events.IEventDispatcher;
@ -77,6 +76,8 @@ package org.bigbluebutton.modules.phone.managers {
options.echoPath = 128;
options.nonLinearProcessing = true;
mic['enhancedOptions'] = options;
} else {
}
mic.setUseEchoSuppression(true);

View File

@ -37,10 +37,11 @@ package org.bigbluebutton.modules.phone.maps
phoneButton = new ToolbarButton();
globalDispatcher = new Dispatcher();
phoneOptions = new PhoneOptions();
var vxml:XML = BBB.initConfigManager().config.getModuleConfig("PhoneModule");
var vxml:XML = BBB.getConfigForModule("PhoneModule");
if (vxml != null) {
phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false;
phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false;
phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false;
}
}

View File

@ -35,8 +35,10 @@
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.views.MainToolbar;
import org.bigbluebutton.modules.phone.PhoneOptions;
import org.bigbluebutton.modules.phone.events.CallConnectedEvent;
import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent;
import org.bigbluebutton.modules.phone.views.assets.Images;
@ -49,12 +51,26 @@
private function startPhone():void {
if (this.selected) {
dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS"));
var vxml:XML = BBB.getConfigForModule("PhoneModule");
var phoneOptions:PhoneOptions = new PhoneOptions();
if (vxml != null) {
phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false;
phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false;
phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false;
}
this.enabled = false;
if (phoneOptions.skipCheck) {
var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT");
joinEvent.payload['useMicrophone'] = false;
dispatcher.dispatchEvent(joinEvent);
} else {
dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS"));
}
} else {
dispatcher.dispatchEvent(new BBBEvent("LEAVE_VOICE_CONFERENCE_EVENT"));
}
this.enabled = false;
var t:Timer = new Timer(3000, 1);
t.addEventListener(TimerEvent.TIMER, onTimer);
t.start();

View File

@ -38,7 +38,7 @@ package org.bigbluebutton.modules.videoconf.model
public var camQualityPicture:Number = 50;
public function parseOptions():void {
var vxml:XML = BBB.initConfigManager().config.getModuleConfig("VideoconfModule");
var vxml:XML = BBB.getConfigForModule("VideoconfModule");
if (vxml != null) {
if (vxml.@showButton != undefined) {
showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false;

View File

@ -47,7 +47,7 @@ package org.bigbluebutton.modules.viewers.managers
viewerOptions = new ViewerOptions();
var vxml:XML = BBB.initConfigManager().config.getModuleConfig("ViewersModule");
var vxml:XML = BBB.getConfigForModule("ViewersModule");
if (vxml != null) {
viewerOptions.windowVisible = (vxml.@windowVisible.toString().toUpperCase() == "TRUE") ? true : false;
}