From 921f247b0109e854e359865330c652a0a1f16616 Mon Sep 17 00:00:00 2001 From: sostler Date: Tue, 6 Apr 2010 21:43:03 -0400 Subject: Fixed webcam line endings --- webcam/media/NeaveCamera.as | 160 +++++++++++++++---------------- webcam/media/NeaveMicrophone.as | 206 ++++++++++++++++++++-------------------- 2 files changed, 183 insertions(+), 183 deletions(-) mode change 100755 => 100644 webcam/media/NeaveCamera.as mode change 100755 => 100644 webcam/media/NeaveMicrophone.as (limited to 'webcam/media') diff --git a/webcam/media/NeaveCamera.as b/webcam/media/NeaveCamera.as old mode 100755 new mode 100644 index f401af8..2b68201 --- a/webcam/media/NeaveCamera.as +++ b/webcam/media/NeaveCamera.as @@ -1,81 +1,81 @@ -/** - * Neave Camera - * - * Copyright (C) 2008 Paul Neave - * http://www.neave.com/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html - */ - -package com.neave.media -{ - import flash.events.*; - import flash.media.*; - import flash.system.*; - - public class NeaveCamera - { - /** - * The requested width of the camera object - */ - static public var CAMERA_WIDTH:int = 320; - - /** - * The requested height of the camera object - */ - static public var CAMERA_HEIGHT:int = 240; - - static private var cam:Camera; - - public function NeaveCamera() { } - - /** - * Sets up and returns the camera object - * - * @return A camera object - */ - static public function getCamera():Camera - { - // Return the same camera if it has been successfully requested before - if (cam != null) - { - if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY); - return cam; - } - - // Get the camera - cam = Camera.getCamera(); - if (cam != null) - { - // Set properties if a camera was found - cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true); - cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener); - return cam; - } - else - { - // No camera found - Security.showSettings(SecurityPanel.CAMERA); - return new Camera(); - } - } - - /** - * Whether the camera object is available or not - */ - static public function get muted():Boolean - { - return cam == null || cam.muted || cam.name == null || cam.width == 0; - } - - /** - * Camera status response - */ - static private function statusListener(e:StatusEvent):void - { - if (e.code == "Camera.Unmuted") Security.showSettings(SecurityPanel.CAMERA); - } - } +/** + * Neave Camera + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.media +{ + import flash.events.*; + import flash.media.*; + import flash.system.*; + + public class NeaveCamera + { + /** + * The requested width of the camera object + */ + static public var CAMERA_WIDTH:int = 320; + + /** + * The requested height of the camera object + */ + static public var CAMERA_HEIGHT:int = 240; + + static private var cam:Camera; + + public function NeaveCamera() { } + + /** + * Sets up and returns the camera object + * + * @return A camera object + */ + static public function getCamera():Camera + { + // Return the same camera if it has been successfully requested before + if (cam != null) + { + if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY); + return cam; + } + + // Get the camera + cam = Camera.getCamera(); + if (cam != null) + { + // Set properties if a camera was found + cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true); + cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener); + return cam; + } + else + { + // No camera found + Security.showSettings(SecurityPanel.CAMERA); + return new Camera(); + } + } + + /** + * Whether the camera object is available or not + */ + static public function get muted():Boolean + { + return cam == null || cam.muted || cam.name == null || cam.width == 0; + } + + /** + * Camera status response + */ + static private function statusListener(e:StatusEvent):void + { + if (e.code == "Camera.Unmuted") Security.showSettings(SecurityPanel.CAMERA); + } + } } \ No newline at end of file diff --git a/webcam/media/NeaveMicrophone.as b/webcam/media/NeaveMicrophone.as old mode 100755 new mode 100644 index 6a46ee7..4f6e6c1 --- a/webcam/media/NeaveMicrophone.as +++ b/webcam/media/NeaveMicrophone.as @@ -1,104 +1,104 @@ -/** - * Neave Microphone - * - * Copyright (C) 2008 Paul Neave - * http://www.neave.com/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html - */ - -package com.neave.media -{ - import flash.events.*; - import flash.media.*; - import flash.system.*; - import flash.utils.*; - - public class NeaveMicrophone - { - static private var mic:Microphone; - static private var gainTimer:Timer; - - public function NeaveMicrophone() { } - - /** - * Sets up and returns the microphone object - * - * @return A microphone object - */ - static public function getMicrophone():Microphone - { - // Return the same microphone if it has been successfully requested before - if (mic != null) - { - if (mic.muted) Security.showSettings(SecurityPanel.PRIVACY); - else NeaveMicrophone.startAutoGain(); - return mic; - } - - gainTimer = new Timer(100); - - // Get the microphone - mic = Microphone.getMicrophone(); - if (mic != null) - { - // Set properties if a microphone was found - mic.setLoopBack(true); - mic.rate = 44; - mic.gain = 25; - mic.setSilenceLevel(0); - mic.setUseEchoSuppression(true); - mic.soundTransform = new SoundTransform(0); // Mute microphone from sounding on speakers - mic.addEventListener(StatusEvent.STATUS, NeaveMicrophone.statusListener); - - return mic; - } - else - { - // No microphone found - Security.showSettings(SecurityPanel.MICROPHONE); - return new Microphone(); - } - } - - /** - * Microphone status response - */ - static private function statusListener(e:StatusEvent):void - { - if (e.code == "Microphone.Unmuted") NeaveMicrophone.startAutoGain(); - else NeaveMicrophone.stopAutoGain(); - } - - /** - * Set up gain control - */ - static public function startAutoGain():void - { - gainTimer.start(); - if (!gainTimer.hasEventListener(TimerEvent.TIMER)) gainTimer.addEventListener(TimerEvent.TIMER, setGain); - } - - /** - * Stop gain control - */ - static public function stopAutoGain():void - { - gainTimer.stop(); - gainTimer.reset(); - gainTimer.removeEventListener(TimerEvent.TIMER, setGain); - } - - /** - * Dynamically adjust the microphone's gain value - */ - static private function setGain(e:TimerEvent):void - { - if (mic.activityLevel < 15) mic.gain = 30; - else if (mic.activityLevel > 90) mic.gain = 20; - else mic.gain = 25; - } - } +/** + * Neave Microphone + * + * Copyright (C) 2008 Paul Neave + * http://www.neave.com/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html + */ + +package com.neave.media +{ + import flash.events.*; + import flash.media.*; + import flash.system.*; + import flash.utils.*; + + public class NeaveMicrophone + { + static private var mic:Microphone; + static private var gainTimer:Timer; + + public function NeaveMicrophone() { } + + /** + * Sets up and returns the microphone object + * + * @return A microphone object + */ + static public function getMicrophone():Microphone + { + // Return the same microphone if it has been successfully requested before + if (mic != null) + { + if (mic.muted) Security.showSettings(SecurityPanel.PRIVACY); + else NeaveMicrophone.startAutoGain(); + return mic; + } + + gainTimer = new Timer(100); + + // Get the microphone + mic = Microphone.getMicrophone(); + if (mic != null) + { + // Set properties if a microphone was found + mic.setLoopBack(true); + mic.rate = 44; + mic.gain = 25; + mic.setSilenceLevel(0); + mic.setUseEchoSuppression(true); + mic.soundTransform = new SoundTransform(0); // Mute microphone from sounding on speakers + mic.addEventListener(StatusEvent.STATUS, NeaveMicrophone.statusListener); + + return mic; + } + else + { + // No microphone found + Security.showSettings(SecurityPanel.MICROPHONE); + return new Microphone(); + } + } + + /** + * Microphone status response + */ + static private function statusListener(e:StatusEvent):void + { + if (e.code == "Microphone.Unmuted") NeaveMicrophone.startAutoGain(); + else NeaveMicrophone.stopAutoGain(); + } + + /** + * Set up gain control + */ + static public function startAutoGain():void + { + gainTimer.start(); + if (!gainTimer.hasEventListener(TimerEvent.TIMER)) gainTimer.addEventListener(TimerEvent.TIMER, setGain); + } + + /** + * Stop gain control + */ + static public function stopAutoGain():void + { + gainTimer.stop(); + gainTimer.reset(); + gainTimer.removeEventListener(TimerEvent.TIMER, setGain); + } + + /** + * Dynamically adjust the microphone's gain value + */ + static private function setGain(e:TimerEvent):void + { + if (mic.activityLevel < 15) mic.gain = 30; + else if (mic.activityLevel > 90) mic.gain = 20; + else mic.gain = 25; + } + } } \ No newline at end of file -- cgit v1.2.3-70-g09d2