summaryrefslogtreecommitdiff
path: root/webcam/media/NeaveCamera.as
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2010-05-25 04:03:45 -0400
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2010-05-25 04:03:45 -0400
commit1f030e0ba0d15ad62b9b705f8bec260508aa7dcc (patch)
tree96ef458a500126b204730666954cdc1a1672f519 /webcam/media/NeaveCamera.as
parent3bd873a866bdc503ecc1144d9795876662c47563 (diff)
parent41025f011fe761b9c5d4e580bf5d7288b05b7e0f (diff)
Merge branch 'master' of /pichat/repo
Diffstat (limited to 'webcam/media/NeaveCamera.as')
-rw-r--r--webcam/media/NeaveCamera.as81
1 files changed, 0 insertions, 81 deletions
diff --git a/webcam/media/NeaveCamera.as b/webcam/media/NeaveCamera.as
deleted file mode 100644
index 2b68201..0000000
--- a/webcam/media/NeaveCamera.as
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * 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