當前位置: 首頁>>代碼示例>>C#>>正文


C# Controls.CameraWindow類代碼示例

本文整理匯總了C#中iSpyApplication.Controls.CameraWindow的典型用法代碼示例。如果您正苦於以下問題:C# CameraWindow類的具體用法?C# CameraWindow怎麽用?C# CameraWindow使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CameraWindow類屬於iSpyApplication.Controls命名空間,在下文中一共展示了CameraWindow類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TextToSpeech

        public TextToSpeech(CameraWindow cw = null)
        {
            InitializeComponent();

            CW = cw;
            Text = LocRm.GetString("TextToSpeech");
            button1.Text = LocRm.GetString("OK");
        }
開發者ID:tdhieu,項目名稱:iSpy,代碼行數:8,代碼來源:TextToSpeech.cs

示例2: SynthToCam

        private static void SynthToCam(string text, CameraWindow cw)
        {
            var synthFormat = new System.Speech.AudioFormat.SpeechAudioFormatInfo(System.Speech.AudioFormat.EncodingFormat.Pcm, 11025, 16, 1, 22100, 2, null);
            using (var synthesizer = new SpeechSynthesizer())
            {
                using (var waveStream = new MemoryStream())
                {

                    //write some silence to the stream to allow camera to initialise properly
                    var silence = new byte[1 * 22050];
                    waveStream.Write(silence, 0, silence.Length);

                    var pbuilder = new PromptBuilder();
                    var pStyle = new PromptStyle
                    {
                        Emphasis = PromptEmphasis.Strong,
                        Rate = PromptRate.Slow,
                        Volume = PromptVolume.ExtraLoud
                    };

                    pbuilder.StartStyle(pStyle);
                    pbuilder.StartParagraph();
                    pbuilder.StartVoice(VoiceGender.Male, VoiceAge.Adult, 2);
                    pbuilder.StartSentence();
                    pbuilder.AppendText(text);
                    pbuilder.EndSentence();
                    pbuilder.EndVoice();
                    pbuilder.EndParagraph();
                    pbuilder.EndStyle();

                    synthesizer.SetOutputToAudioStream(waveStream, synthFormat);
                    synthesizer.Speak(pbuilder);
                    synthesizer.SetOutputToNull();

                    //write some silence to the stream to allow camera to end properly
                    waveStream.Write(silence, 0, silence.Length);
                    waveStream.Seek(0, SeekOrigin.Begin);

                    var ds = new DirectStream(waveStream) { RecordingFormat = new WaveFormat(11025, 16, 1) };
                    var talkTarget = TalkHelper.GetTalkTarget(cw.Camobject, ds); 
                    ds.Start();
                    talkTarget.Start();
                    while (ds.IsRunning)
                    {
                        Thread.Sleep(100);
                    }
                    ds.Stop();
                    talkTarget.Stop();
                    talkTarget = null;
                    ds = null;
                }
            }


        }
開發者ID:tdhieu,項目名稱:iSpy,代碼行數:55,代碼來源:SpeechSynth.cs

示例3: SynthToCam

        private static void SynthToCam(string fileName, CameraWindow cw)
        {
            using (var waveStream = new MemoryStream())
            {

                //write some silence to the stream to allow camera to initialise properly
                var silence = new byte[1 * 22050];
                waveStream.Write(silence, 0, silence.Count());

                //read in and convert the wave stream into our format
                using (var reader = new WaveFileReader(fileName))
                {
                    var newFormat = new WaveFormat(11025, 16, 1);
                    byte[] buff = new byte[22050];

                    using (var conversionStream = new WaveFormatConversionStream(newFormat, reader))
                    {
                        do
                        {
                            int i = conversionStream.Read(buff, 0, 22050);
                            waveStream.Write(buff, 0, i);
                            if (i < 22050)
                                break;
                        } while (true);
                    }
                }

                //write some silence to the stream to allow camera to end properly
                waveStream.Write(silence, 0, silence.Count());

                waveStream.Seek(0, SeekOrigin.Begin);

                var ds = new DirectStream(waveStream) { RecordingFormat = new WaveFormat(11025, 16, 1) };
                var talkTarget = TalkHelper.GetTalkTarget(cw.Camobject, ds);

                ds.Start();
                talkTarget.Start();
                while (ds.IsRunning)
                {
                    Thread.Sleep(100);
                }
                ds.Stop();
                talkTarget.Stop();
                talkTarget = null;
                ds = null;

                waveStream.Close();
            }
        }
開發者ID:WesleyYep,項目名稱:ispyconnect,代碼行數:49,代碼來源:AudioSynth.cs

示例4: PTZController

 public PTZController(CameraWindow cameraControl)
 {
     _cameraControl = cameraControl;
 }
開發者ID:huangxuelun,項目名稱:iSpy,代碼行數:4,代碼來源:PTZController.cs

示例5: PTZToolUpdate

 public void PTZToolUpdate(CameraWindow cw)
 {
     if (_ptzTool != null)
     {
         _ptzTool.CameraControl = cw;
     }
 }
開發者ID:flos-club,項目名稱:iSpy,代碼行數:7,代碼來源:MainForm.cs

示例6: ShowFiles

 internal void ShowFiles(CameraWindow cw)
 {
     string foldername = Helper.GetMediaDirectory(2, cw.Camobject.id) + "video\\" + cw.Camobject.directory + "\\";
     if (!foldername.EndsWith(@"\"))
         foldername += @"\";
     Process.Start(foldername);
     cw.Camobject.newrecordingcount = 0;
 }
開發者ID:flos-club,項目名稱:iSpy,代碼行數:8,代碼來源:MainForm.cs

示例7: TalkTo

        public void TalkTo(CameraWindow cw, bool talk)
        {
            if (string.IsNullOrEmpty(Conf.TalkMic))
                return;

            if (_talkSource != null)
            {
                _talkSource.Stop();
                _talkSource = null;
            }
            if (_talkTarget != null)
            {
                _talkTarget.Stop();
                _talkTarget = null;
            }

            if (!talk)
            {
                if (cw.VolumeControl != null)
                {
                    cw.VolumeControl.Listening = false;
                }
                return;
            }
            Application.DoEvents();
            TalkCamera = cw;
            _talkSource = new TalkDeviceStream(Conf.TalkMic) {RecordingFormat = new WaveFormat(8000, 16, 1)};
            _talkSource.AudioFinished += _talkSource_AudioFinished;

            if (!_talkSource.IsRunning)
                _talkSource.Start();

            _talkTarget = TalkHelper.GetTalkTarget(cw.Camobject, _talkSource);
            _talkTarget.TalkStopped += TalkTargetTalkStopped;
            _talkTarget.Start();

            //auto listen
            if (cw.VolumeControl != null)
            {
                cw.VolumeControl.Listening = true;
            }
        }
開發者ID:flos-club,項目名稱:iSpy,代碼行數:42,代碼來源:MainForm.cs

示例8: NewCameraWindow

        private CameraWindow NewCameraWindow(int videoSourceIndex)
        {
            var oc = new objectsCamera
                         {
                             alerts = new objectsCameraAlerts(),
                             detector = new objectsCameraDetector
                                            {
                                                motionzones =
                                                    new objectsCameraDetectorZone
                                                    [0]
                                            },
                             notifications = new objectsCameraNotifications(),
                             recorder = new objectsCameraRecorder(),
                             schedule = new objectsCameraSchedule {entries = new objectsCameraScheduleEntry[0]},
                             settings = new objectsCameraSettings(),
                             ftp = new objectsCameraFtp(),
                             id = -1,
                             directory = RandomString(5),
                             ptz = -1,
                             x = Convert.ToInt32(Random.NextDouble()*100),
                             y = Convert.ToInt32(Random.NextDouble()*100),
                             name = LocRm.GetString("Camera") + " " + NextCameraId
            };
            oc.ptzschedule = new objectsCameraPtzschedule
            {
                active = false,
                entries = new objectsCameraPtzscheduleEntry[] { }
            };
            oc.flipx = oc.flipy = false;
            oc.width = 320;
            oc.height = 240;
            oc.description = "";
            oc.resolution = "320x240";
            oc.newrecordingcount = 0;

            oc.alerts.active = true;
            oc.alerts.mode = "movement";
            oc.alerts.alertoptions = "false,false";
            oc.alerts.objectcountalert = 1;
            oc.alerts.minimuminterval = 180;
            oc.alerts.processmode = "continuous";
            oc.alerts.pluginconfig = "";
            oc.alerts.trigger = "";

            oc.notifications.sendemail = false;
            oc.notifications.sendsms = false;
            oc.notifications.sendmms = false;
            oc.notifications.emailgrabinterval = 0;

            oc.ftp.enabled = false;
            oc.ftp.port = 21;
            oc.ftp.mode = 0;
            oc.ftp.server = "ftp://";
            oc.ftp.interval = 10;
            oc.ftp.filename = "mylivecamerafeed.jpg";
            oc.ftp.localfilename = "{0:yyyy-MM-dd_HH-mm-ss_fff}.jpg";
            oc.ftp.ready = true;
            oc.ftp.text = "www.ispyconnect.com";
            oc.ftp.quality = 75;

            oc.schedule.active = false;

            oc.settings.active = false;
            oc.settings.deleteavi = true;
            oc.settings.ffmpeg = Conf.FFMPEG_Camera;
            oc.settings.emailaddress = EmailAddress;
            oc.settings.smsnumber = MobileNumber;
            oc.settings.suppressnoise = true;
            oc.settings.login = "";
            oc.settings.password = "";
            oc.settings.useragent = "Mozilla/5.0";
            oc.settings.frameinterval = 10;
            oc.settings.sourceindex = videoSourceIndex;
            oc.settings.micpair = -1;
            oc.settings.frameinterval = 200;
            oc.settings.maxframerate = 10;
            oc.settings.maxframeraterecord = 10;
            oc.settings.ptzautotrack = false;
            oc.settings.framerate = 10;
            oc.settings.timestamplocation = 1;
            oc.settings.ptztimetohome = 100;
            oc.settings.ptzchannel = "0";
            oc.settings.timestampformatter = "FPS: {FPS} {0:G} ";
            oc.settings.timestampfontsize = 10;
            oc.settings.notifyondisconnect = false;
            oc.settings.ptzautohomedelay = 30;
            oc.settings.accessgroups = "";

            oc.settings.youtube = new objectsCameraSettingsYoutube
            {
                autoupload = false,
                category = Conf.YouTubeDefaultCategory,
                tags = "iSpy, Motion Detection, Surveillance",
                @public = false
            };
            oc.settings.desktopresizeheight = 480;
            oc.settings.desktopresizewidth = 640;
            oc.settings.resize = false;

            if (VlcHelper.VlcInstalled)
//.........這裏部分代碼省略.........
開發者ID:vmail,項目名稱:main,代碼行數:101,代碼來源:MainForm_Configuration.cs

示例9: RemoveCameraPanel

        private void RemoveCameraPanel(CameraWindow cameraControl)
        {
            _pnlCameras.Controls.Remove(cameraControl);
            if (!_closing)
            {
                CameraWindow control = cameraControl;
                var oc = Cameras.FirstOrDefault(p => p.id == control.Camobject.id);
                if (oc != null)
                {
                    lock (ThreadLock)
                    {
                        Masterfilelist.RemoveAll(p => p.ObjectId == oc.id && p.ObjectTypeId == 2);
                    }
                    Actions.RemoveAll(p => p.objectid == control.Camobject.id && p.objecttypeid == 2);
                    Cameras.Remove(oc);
                }

                foreach (var ofp in FloorPlans)
                    ofp.needsupdate = true;

                NeedsSync = true;
                SetNewStartPosition();
            }
            Application.DoEvents();
            cameraControl.Dispose();
            if (!_shuttingDown)
            {
                LoadPreviews();
            }
        }
開發者ID:Jaejoon,項目名稱:iSpy,代碼行數:30,代碼來源:MainForm_Configuration.cs

示例10: DisplayCamera

        internal void DisplayCamera(objectsCamera cam)
        {
            var cameraControl = new CameraWindow(cam);
            SetCameraEvents(cameraControl);
            cameraControl.BackColor = Conf.BackColor.ToColor();
            _pnlCameras.Controls.Add(cameraControl);
            cameraControl.Location = new Point(cam.x, cam.y);
            cameraControl.Size = new Size(cam.width, cam.height);
            cameraControl.BringToFront();
            cameraControl.Tag = GetControlIndex();

            if (Conf.AutoSchedule && cam.schedule.active && cam.schedule.entries.Any())
            {
                cam.settings.active = false;
                cameraControl.ApplySchedule();
            }
            else
            {
                try
                {
                    if (cam.settings.active)
                        cameraControl.Enable();
                }
                catch (Exception ex)
                {
                    Log.Error("", ex);
                }
            }

            string path = Conf.MediaDirectory + "video\\" + cam.directory + "\\";
            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);
            path = Conf.MediaDirectory + "video\\" + cam.directory + "\\thumbs\\";
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
                //move existing thumbs into directory
                var lfi =
                    Directory.GetFiles(Conf.MediaDirectory + "video\\" + cam.directory + "\\", "*.jpg").ToList();
                foreach (string file in lfi)
                {
                    string destfile = file;
                    int i = destfile.LastIndexOf(@"\", StringComparison.Ordinal);
                    destfile = file.Substring(0, i) + @"\thumbs" + file.Substring(i);
                    File.Move(file, destfile);
                }
            }
            path = Conf.MediaDirectory + "video\\" + cam.directory + "\\grabs\\";
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
        }
開發者ID:vmail,項目名稱:main,代碼行數:53,代碼來源:MainForm_Configuration.cs

示例11: RemoveCamera

        public void RemoveCamera(CameraWindow cameraControl, bool confirm)
        {
            if (confirm &&
                MessageBox.Show(LocRm.GetString("AreYouSure"), LocRm.GetString("Confirm"), MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning) == DialogResult.Cancel)
                return;
            cameraControl.ShuttingDown = true;
            cameraControl.MouseDown -= CameraControlMouseDown;
            cameraControl.MouseUp -= CameraControlMouseUp;
            cameraControl.MouseMove -= CameraControlMouseMove;
            cameraControl.DoubleClick -= CameraControlDoubleClick;
            cameraControl.RemoteCommand -= CameraControlRemoteCommand;
            cameraControl.Notification -= ControlNotificationHandler;
            if (cameraControl.Recording)
                cameraControl.RecordSwitch(false);

            cameraControl.Disable();
            cameraControl.SaveFileList();

            if (cameraControl.VolumeControl != null)
                RemoveMicrophone(cameraControl.VolumeControl, false);

            if (InvokeRequired)
                Invoke(new CameraCommandDelegate(RemoveCameraPanel), cameraControl);
            else
                RemoveCameraPanel(cameraControl);
        }
開發者ID:WesleyYep,項目名稱:ispyconnect,代碼行數:27,代碼來源:CameraPanel.cs

示例12: Say

 public static void Say(string text,CameraWindow cw)
 {
     var t = new Thread(() => SynthToCam(Uri.UnescapeDataString(text), cw));
     t.Start();
 }
開發者ID:tdhieu,項目名稱:iSpy,代碼行數:5,代碼來源:SpeechSynth.cs

示例13: Play

 public static void Play(string fileName,CameraWindow cw)
 {
     var t = new Thread(() => SynthToCam(fileName, cw));
     t.Start();
 }
開發者ID:WesleyYep,項目名稱:ispyconnect,代碼行數:5,代碼來源:AudioSynth.cs

示例14: SynthToCam

        private static void SynthToCam(string fileName, CameraWindow cw)
        {
            using (var waveStream = new MemoryStream())
            {

                //write some silence to the stream to allow camera to initialise properly
                var silence = new byte[1 * 22050];
                waveStream.Write(silence, 0, silence.Count());

                //read in and convert the wave stream into our format
                using (var reader = new WaveFileReader(fileName))
                {
                    var newFormat = new WaveFormat(11025, 16, 1);
                    byte[] buff = new byte[22050];

                    using (var conversionStream = new WaveFormatConversionStream(newFormat, reader))
                    {
                        do
                        {
                            int i = conversionStream.Read(buff, 0, 22050);
                            waveStream.Write(buff, 0, i);
                            if (i < 22050)
                                break;
                        } while (true);
                    }
                }

                //write some silence to the stream to allow camera to end properly
                waveStream.Write(silence, 0, silence.Count());

                waveStream.Seek(0, SeekOrigin.Begin);

                ITalkTarget talkTarget;

                var ds = new DirectStream(waveStream) { RecordingFormat = new WaveFormat(11025, 16, 1) };
                switch (cw.Camobject.settings.audiomodel)
                {
                    case "Foscam":
                        ds.Interval = 40;
                        ds.PacketSize = 882; // (40ms packet at 22050 bytes per second)
                        talkTarget = new TalkFoscam(cw.Camobject.settings.audioip, cw.Camobject.settings.audioport,
                                                    cw.Camobject.settings.audiousername,
                                                    cw.Camobject.settings.audiopassword, ds);
                        break;
                    case "NetworkKinect":
                        ds.Interval = 40;
                        ds.PacketSize = 882;
                        talkTarget = new TalkNetworkKinect(cw.Camobject.settings.audioip, cw.Camobject.settings.audioport, ds);
                        break;
                    case "iSpyServer":
                        ds.Interval = 40;
                        ds.PacketSize = 882;
                        talkTarget = new TalkiSpyServer(cw.Camobject.settings.audioip,
                                                        cw.Camobject.settings.audioport,
                                                        ds);
                        break;
                    case "Axis":
                        talkTarget = new TalkAxis(cw.Camobject.settings.audioip, cw.Camobject.settings.audioport,
                                                    cw.Camobject.settings.audiousername,
                                                    cw.Camobject.settings.audiopassword, ds);
                        break;
                    default:
                        //local playback
                        talkTarget = new TalkLocal(ds);

                        break;
                }
                ds.Start();
                talkTarget.Start();
                while (ds.IsRunning)
                {
                    Thread.Sleep(100);
                }
                ds.Stop();
                if (talkTarget != null)
                    talkTarget.Stop();
                talkTarget = null;
                ds = null;

                waveStream.Close();
            }
        }
開發者ID:WildGenie,項目名稱:ispyconnect,代碼行數:82,代碼來源:AudioSynth.cs

示例15: ConfigureProcessorForm

 public ConfigureProcessorForm(CameraWindow CW)
 {
     InitializeComponent();
     RenderResources();
     CameraControl = CW;
 }
開發者ID:vmail,項目名稱:main,代碼行數:6,代碼來源:ConfigureProcessorForm.cs


注:本文中的iSpyApplication.Controls.CameraWindow類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。