HasFeature() public static method

public static HasFeature ( System.Enums feature ) : bool
feature System.Enums
return bool
Beispiel #1
0
        private void RenderResources()
        {
            Text         = LocRm.GetString("VideoSource");
            button1.Text = LocRm.GetString("Ok");
            button2.Text = LocRm.GetString("Cancel");

            label15.Text = LocRm.GetString("Username");
            label17.Text = LocRm.GetString("Password");
            label2.Text  = LocRm.GetString("MjpegUrl");

            tabPage2.Text = LocRm.GetString("MjpegUrl");
            tabPage4.Text = LocRm.GetString("LocalDevice");

            label39.Text        = LocRm.GetString("VideoDevice");
            label38.Text        = LocRm.GetString("VideoResolution");
            label37.Text        = LocRm.GetString("VideoInput");
            snapshotsLabel.Text = LocRm.GetString("SnapshotsResolution");

            LocRm.SetString(label20, "DecodeKey");

            chkAutoImageSettings.Text = LocRm.GetString("AutomaticImageSettings");
            rdoCaptureSnapshots.Text  = LocRm.GetString("Snapshots");
            rdoCaptureVideo.Text      = LocRm.GetString("Video");
            label35.Text = LocRm.GetString("CaptureMode");

            HideTab(tabPage2, Helper.HasFeature(Enums.Features.Source_MJPEG));

            HideTab(tabPage4, Helper.HasFeature(Enums.Features.Source_Local));

            HideTab(tabPage10, Helper.HasFeature(Enums.Features.Source_ONVIF));
        }
Beispiel #2
0
        private void RenderResources()
        {
            Text         = LocRm.GetString("VideoSource");
            button1.Text = LocRm.GetString("Ok");
            button2.Text = LocRm.GetString("Cancel");

            HideTab(tabPage10, Helper.HasFeature(Enums.Features.Source_ONVIF));
        }
Beispiel #3
0
        private void SettingsLoad(object sender, EventArgs e)
        {
            if (!Helper.HasFeature(Enums.Features.Settings))
            {
                using (var cp = new CheckPassword())
                {
                    cp.ShowDialog(this);
                }
            }

            if (!Helper.HasFeature(Enums.Features.Settings))
            {
                MessageBox.Show(this, LocRm.GetString("AccessDenied"));
                Close();
                return;
            }

            UISync.Init(this);
            tcTabs.SelectedIndex       = InitialTab;
            chkErrorReporting.Checked  = MainForm.Conf.Enable_Error_Reporting;
            chkCheckForUpdates.Checked = MainForm.Conf.Enable_Update_Check;

            chkShowGettingStarted.Checked = MainForm.Conf.Enabled_ShowGettingStarted;
            _rkApp             = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", false);
            chkStartup.Checked = (_rkApp != null && _rkApp.GetValue("iSpy") != null);

            mediaDirectoryEditor1.Init(MainForm.Conf.MediaDirectories);

            btnDetectColor.BackColor     = MainForm.Conf.ActivityColor.ToColor();
            btnNoDetectColor.BackColor   = MainForm.Conf.NoActivityColor.ToColor();
            btnColorTracking.BackColor   = MainForm.Conf.TrackingColor.ToColor();
            btnColorVolume.BackColor     = MainForm.Conf.VolumeLevelColor.ToColor();
            btnColorMain.BackColor       = MainForm.Conf.MainColor.ToColor();
            btnColorArea.BackColor       = MainForm.Conf.AreaColor.ToColor();
            btnColorBack.BackColor       = MainForm.Conf.BackColor.ToColor();
            btnBorderHighlight.BackColor = MainForm.Conf.BorderHighlightColor.ToColor();
            btnBorderDefault.BackColor   = MainForm.Conf.BorderDefaultColor.ToColor();
            chkAutoSchedule.Checked      = MainForm.Conf.AutoSchedule;
            numMaxCPU.Value = MainForm.Conf.CPUMax;
            numMaxRecordingThreads.Value = MainForm.Conf.MaxRecordingThreads;
            numRedraw.Value              = MainForm.Conf.MaxRedrawRate;
            numMediaPanelItems.Value     = MainForm.Conf.PreviewItems;
            txtTrayIcon.Text             = MainForm.Conf.TrayIconText;
            chkMinimise.Checked          = MainForm.Conf.MinimiseOnClose;
            chkSpeechRecognition.Checked = MainForm.Conf.SpeechRecognition;
            chkMinimiseToTray.Checked    = MainForm.Conf.TrayOnMinimise;

            if (chkMonitor.Checked && !MainForm.Conf.Monitor)
            {
                Process.Start(Program.AppPath + "iSpyMonitor.exe");
            }
            chkMonitor.Checked = MainForm.Conf.Monitor;

            tbOpacity.Value = MainForm.Conf.Opacity;
            SetColors();

            chkBalloon.Checked = MainForm.Conf.BalloonTips;

            txtIPCameraTimeout.Value      = MainForm.Conf.IPCameraTimeout;
            txtServerReceiveTimeout.Value = MainForm.Conf.ServerReceiveTimeout;
            txtServerName.Text            = MainForm.Conf.ServerName;
            rtbAccessList.Text            = MainForm.Conf.AllowedIPList;

            int i = 0, selind = 0;

            foreach (TranslationsTranslationSet set in LocRm.TranslationSets.OrderBy(p => p.Name))
            {
                ddlLanguage.Items.Add(new ListItem(set.Name, new[] { set.CultureCode }));
                if (set.CultureCode == MainForm.Conf.Language)
                {
                    selind = i;
                }
                i++;
            }
            ddlLanguage.SelectedIndex    = selind;
            chkAlertWindows.Checked      = MainForm.Conf.CreateAlertWindows;
            chkOverlay.Checked           = MainForm.Conf.ShowOverlayControls;
            chkInterrupt.Checked         = MainForm.Conf.ScreensaverWakeup;
            chkEnableIPv6.Checked        = !MainForm.Conf.IPv6Disabled;
            chkRecycle.Checked           = MainForm.Conf.DeleteToRecycleBin;
            txtAppendLinkText.Text       = MainForm.Conf.AppendLinkText;
            numMJPEGStreamInterval.Value = MainForm.Conf.MJPEGStreamInterval;
            txtAlertOnDisconnect.Text    = MainForm.Conf.AlertOnDisconnect;
            txtAlertOnReconnect.Text     = MainForm.Conf.AlertOnReconnect;
            txtArchive.Text = MainForm.Conf.Archive;
            SetSSLText();


            txtAlertSubject.Text = MainForm.Conf.MailAlertSubject;
            txtAlertBody.Text    = MainForm.Conf.MailAlertBody;
            txtSMSBody.Text      = MainForm.Conf.SMSAlert;

            foreach (string s in StartupModes)
            {
                ddlStartupMode.Items.Add(LocRm.GetString(s));
            }

            foreach (string s in Priorities)
            {
                ddlPriority.Items.Add(LocRm.GetString(s));
            }
            ddlStartupMode.SelectedIndex = MainForm.Conf.StartupMode;

            foreach (var grid in MainForm.Conf.GridViews)
            {
                ddlStartUpForm.Items.Add(grid.name);
            }

            ddlPriority.SelectedIndex = MainForm.Conf.Priority - 1;

            ddlStartUpForm.SelectedItem = MainForm.Conf.StartupForm;
            if (ddlStartUpForm.SelectedItem == null)
            {
                ddlStartUpForm.SelectedIndex = 0;
            }

            ddlPlayback.Items.AddRange(PlaybackModes);

            if (MainForm.Conf.PlaybackMode < 0)
            {
                MainForm.Conf.PlaybackMode = 0;
            }

            if (MainForm.Conf.PlaybackMode < ddlPlayback.Items.Count)
            {
                ddlPlayback.SelectedIndex = MainForm.Conf.PlaybackMode;
            }
            try
            {
                numJPEGQuality.Value = MainForm.Conf.JPEGQuality;
            }
            catch (Exception)
            {
            }
            chkBigButtons.Checked = MainForm.Conf.BigButtons;

            selind = -1;
            i      = 1;
            try
            {
                ddlTalkMic.Items.Add(LocRm.GetString("None"));

                for (int n = 0; n < WaveIn.DeviceCount; n++)
                {
                    ddlTalkMic.Items.Add(WaveIn.GetCapabilities(n).ProductName);
                    if (WaveIn.GetCapabilities(n).ProductName == MainForm.Conf.TalkMic)
                    {
                        selind = i;
                    }
                    i++;
                }
                ddlTalkMic.Enabled = true;
                if (selind > -1)
                {
                    ddlTalkMic.SelectedIndex = selind;
                }
                else
                {
                    if (ddlTalkMic.Items.Count == 1)
                    {
                        ddlTalkMic.Items.Add(_noDevices);
                        ddlTalkMic.Enabled       = false;
                        ddlTalkMic.SelectedIndex = 1;
                    }
                    else
                    {
                        ddlTalkMic.SelectedIndex = 0;
                    }
                }
            }
            catch (ApplicationException ex)
            {
                MainForm.LogExceptionToFile(ex);
                ddlTalkMic.Items.Add(_noDevices);
                ddlTalkMic.Enabled = false;
            }

            ddlJoystick.Items.Add(LocRm.GetString("None"));

            _jst = new JoystickDevice();
            var ij = 0;

            _sticks = _jst.FindJoysticks();
            i       = 1;
            foreach (string js in _sticks)
            {
                var nameid = js.Split('|');
                ddlJoystick.Items.Add(nameid[0]);
                if (nameid[1] == MainForm.Conf.Joystick.id)
                {
                    ij = i;
                }
                i++;
            }

            ddlJoystick.SelectedIndex = ij;


            jaxis1.ID          = MainForm.Conf.Joystick.XAxis;
            jaxis1.SupportDPad = true;
            jaxis1.Invert      = MainForm.Conf.Joystick.InvertXAxis;

            jaxis2.ID     = MainForm.Conf.Joystick.YAxis;
            jaxis2.Invert = MainForm.Conf.Joystick.InvertYAxis;

            jaxis3.ID     = MainForm.Conf.Joystick.ZAxis;
            jaxis3.Invert = MainForm.Conf.Joystick.InvertZAxis;

            jbutton1.ID = MainForm.Conf.Joystick.Record;
            jbutton2.ID = MainForm.Conf.Joystick.Snapshot;
            jbutton3.ID = MainForm.Conf.Joystick.Talk;
            jbutton4.ID = MainForm.Conf.Joystick.Listen;
            jbutton5.ID = MainForm.Conf.Joystick.Play;
            jbutton6.ID = MainForm.Conf.Joystick.Next;
            jbutton7.ID = MainForm.Conf.Joystick.Previous;
            jbutton8.ID = MainForm.Conf.Joystick.Stop;
            jbutton9.ID = MainForm.Conf.Joystick.MaxMin;

            jbutton1.GetInput += JbuttonGetInput;
            jbutton2.GetInput += JbuttonGetInput;
            jbutton3.GetInput += JbuttonGetInput;
            jbutton4.GetInput += JbuttonGetInput;
            jbutton5.GetInput += JbuttonGetInput;
            jbutton6.GetInput += JbuttonGetInput;
            jbutton7.GetInput += JbuttonGetInput;
            jbutton8.GetInput += JbuttonGetInput;
            jbutton9.GetInput += JbuttonGetInput;

            jaxis1.GetInput += JaxisGetInput;
            jaxis2.GetInput += JaxisGetInput;
            jaxis3.GetInput += JaxisGetInput;

            chkGZip.Checked = MainForm.Conf.EnableGZip;
            numDisconnectNotification.Value = MainForm.Conf.DisconnectNotificationDelay;
            mediaDirectoryEditor1.Enabled   = Helper.HasFeature(Enums.Features.Storage);
            HideTab(tabPage11, Helper.HasFeature(Enums.Features.Plugins));

            //important leave here:
            chkPasswordProtect.Checked = MainForm.Conf.Enable_Password_Protect;
            if (Helper.HasFeature(Enums.Features.Plugins))
            {
                ListPlugins();
            }

            chkUseiSpy.Checked      = !MainForm.Conf.UseSMTP;
            txtSMTPFromAddress.Text = MainForm.Conf.SMTPFromAddress;
            txtSMTPUsername.Text    = MainForm.Conf.SMTPUsername;
            txtSMTPPassword.Text    = MainForm.Conf.SMTPPassword;
            txtSMTPServer.Text      = MainForm.Conf.SMTPServer;
            chkSMTPUseSSL.Checked   = MainForm.Conf.SMTPSSL;
            numSMTPPort.Value       = MainForm.Conf.SMTPPort;

            ftpEditor1.Init(MainForm.Conf.FTPServers);
            chkOpenGrabs.Checked = MainForm.Conf.OpenGrabs;
            numFileCache.Value   = MainForm.Conf.VLCFileCache;
            rtbReferrers.Text    = MainForm.Conf.Referers;
            chkPasswordProtectOnStart.Checked = MainForm.Conf.Password_Protect_Startup;

            chkEnableLogging.Checked = MainForm.Conf.Logging.Enabled;
            numMaxLogSize.Value      = MainForm.Conf.Logging.FileSize;
            numKeepLogs.Value        = MainForm.Conf.Logging.KeepDays;

            _loaded = true;
        }
Beispiel #4
0
        private void SettingsLoad(object sender, EventArgs e)
        {
            if (!Helper.HasFeature(Enums.Features.Settings))
            {
                using (var cp = new CheckPassword())
                {
                    cp.ShowDialog(this);
                }
            }

            if (!Helper.HasFeature(Enums.Features.Settings))
            {
                MessageBox.Show(this, LocRm.GetString("AccessDenied"));
                Close();
                return;
            }

            UISync.Init(this);
            tcTabs.SelectedIndex = InitialTab;

            _rkApp = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", false);

            SetColors();



            int i = 0, selind = 0;

            foreach (TranslationsTranslationSet set in LocRm.TranslationSets.OrderBy(p => p.Name))
            {
                if (set.CultureCode == MainForm.Conf.Language)
                {
                    selind = i;
                }
                i++;
            }

            SetSSLText();



            _jst = new JoystickDevice();
            var ij = 0;

            _sticks = _jst.FindJoysticks();
            i       = 1;
            foreach (string js in _sticks)
            {
                var nameid = js.Split('|');

                if (nameid[1] == MainForm.Conf.Joystick.id)
                {
                    ij = i;
                }
                i++;
            }



            HideTab(tabPage11, Helper.HasFeature(Enums.Features.Plugins));

            //important leave here:

            if (Helper.HasFeature(Enums.Features.Plugins))
            {
                ListPlugins();
            }



            _loaded = true;
        }
Beispiel #5
0
        private void RenderResources()
        {
            btnBack.Text                   = LocRm.GetString("Back");
            btnDelete.Text                 = LocRm.GetString("Delete");
            btnFinish.Text                 = LocRm.GetString("Finish");
            btnNext.Text                   = LocRm.GetString("Next");
            btnSelectSource.Text           = "...";
            btnUpdate.Text                 = LocRm.GetString("Update");
            button2.Text                   = LocRm.GetString("Add");
            chkActive.Text                 = LocRm.GetString("MicrophoneActive");
            chkFri.Text                    = LocRm.GetString("Fri");
            chkMon.Text                    = LocRm.GetString("Mon");
            groupBox1.Text                 = LocRm.GetString("RecordingSettings");
            groupBox6.Text                 = LocRm.GetString("RecordingSettings");
            groupBox6.Text                 = LocRm.GetString("RecordingMode");
            rdoRecordDetect.Text           = LocRm.GetString("RecordOnSoundDetection");
            rdoRecordAlert.Text            = LocRm.GetString("RecordOnAlert");
            rdoNoRecord.Text               = LocRm.GetString("NoRecord");
            chkRecordSchedule.Text         = LocRm.GetString("RecordOnScheduleStart");
            chkSat.Text                    = LocRm.GetString("Sat");
            chkSchedule.Text               = LocRm.GetString("ScheduleMicrophone");
            chkScheduleActive.Text         = LocRm.GetString("ScheduleActive");
            chkScheduleAlerts.Text         = LocRm.GetString("AlertsEnabled");
            chkScheduleRecordOnDetect.Text = LocRm.GetString("RecordOnDetect");
            chkRecordAlertSchedule.Text    = LocRm.GetString("RecordOnAlert");
            chkSound.Text                  = LocRm.GetString("AlertsEnabled");
            chkSun.Text                    = LocRm.GetString("Sun");
            chkThu.Text                    = LocRm.GetString("Thu");
            chkTue.Text                    = LocRm.GetString("Tue");
            chkWed.Text                    = LocRm.GetString("Wed");
            label1.Text                    = LocRm.GetString("Name");
            label10.Text                   = label18.Text = ":";
            label12.Text                   = LocRm.GetString("MaxRecordTime");
            label6.Text                    = LocRm.GetString("MinRecordTime");
            label13.Text                   = LocRm.GetString("Seconds");
            label14.Text                   = LocRm.GetString("Seconds");
            label15.Text                   = LocRm.GetString("DistinctAlertInterval");
            label16.Text                   = LocRm.GetString("Seconds");
            label17.Text                   = LocRm.GetString("Seconds");
            label19.Text                   = LocRm.GetString("InactivityRecord");
            label2.Text                    = LocRm.GetString("Source");
            label20.Text                   = LocRm.GetString("BufferAudio");
            label21.Text                   = LocRm.GetString("ExitThisToEnableAlertsAnd");
            label3.Text                    = LocRm.GetString("Sensitivity");
            label4.Text                    = LocRm.GetString("WhenSound");
            label48.Text                   = LocRm.GetString("Seconds");
            label49.Text                   = LocRm.GetString("Days");
            label5.Text                    = LocRm.GetString("Seconds");
            label50.Text                   = LocRm.GetString("ImportantMakeSureYourSche");
            label8.Text                    = LocRm.GetString("Start");
            label15.Text                   = LocRm.GetString("Intervals");
            label9.Text                    = ":";
            label7.Text                    = LocRm.GetString("TipToCreateAScheduleOvern");
            label10.Text                   = LocRm.GetString("Stop");

            lblAudioSource.Text = LocRm.GetString("Audiosource");
            rdoMovement.Text    = LocRm.GetString("IsDetectedFor");
            rdoNoMovement.Text  = LocRm.GetString("IsNotDetectedFor");
            tabPage1.Text       = LocRm.GetString("Microphone");
            tabPage2.Text       = LocRm.GetString("Alerts");
            tabPage3.Text       = LocRm.GetString("Scheduling");
            tabPage4.Text       = LocRm.GetString("Recording");
            Text = LocRm.GetString("Addmicrophone");

            toolTip1.SetToolTip(txtMicrophoneName, LocRm.GetString("ToolTip_MicrophoneName"));
            toolTip1.SetToolTip(txtInactiveRecord, LocRm.GetString("ToolTip_InactiveRecordAudio"));
            toolTip1.SetToolTip(txtBuffer, LocRm.GetString("ToolTip_BufferAudio"));
            toolTip1.SetToolTip(lbSchedule, LocRm.GetString("ToolTip_PressDelete"));
            llblHelp.Text        = LocRm.GetString("help");
            lblAccessGroups.Text = LocRm.GetString("AccessGroups");
            toolTip1.SetToolTip(ranger1, LocRm.GetString("ToolTip_MotionSensitivity"));
            label74.Text = LocRm.GetString("Directory");

            LocRm.SetString(label23, "Listen");
            LocRm.SetString(label22, "TriggerRecording");

            label11.Text = LocRm.GetString("MediaLocation");
            label74.Text = LocRm.GetString("Directory");
            chkStorageManagement.Text = LocRm.GetString("EnableStorageManagement");
            label85.Text    = LocRm.GetString("MaxFolderSizeMb");
            label94.Text    = LocRm.GetString("MaxAgeHours");
            chkArchive.Text = LocRm.GetString("ArchiveInsteadOfDelete");
            btnRunNow.Text  = LocRm.GetString("RunNow");

            HideTab(tabPage2, Helper.HasFeature(Enums.Features.Alerts));
            HideTab(tabPage4, Helper.HasFeature(Enums.Features.Recording));
            HideTab(tabPage3, Helper.HasFeature(Enums.Features.Scheduling));
            HideTab(tabPage5, Helper.HasFeature(Enums.Features.Storage));
            LocRm.SetString(linkLabel4, "CopyTo");
        }
Beispiel #6
0
        private void RenderResources()
        {
            Text = LocRm.GetString("settings");
            btnColorArea.Text = LocRm.GetString("AreaHighlight");
            btnColorBack.Text = LocRm.GetString("ObjectBack");
            btnColorMain.Text = LocRm.GetString("MainPanel");
            btnColorTracking.Text = LocRm.GetString("Tracking");
            btnBorderHighlight.Text = LocRm.GetString("BorderHighlight");
            btnColorVolume.Text = LocRm.GetString("Level");
            btnDetectColor.Text = LocRm.GetString("Activity");
            btnNoDetectColor.Text = LocRm.GetString("NoActivity");
            button1.Text = LocRm.GetString("Ok");
            button2.Text = LocRm.GetString("Cancel");
            chkBalloon.Text = LocRm.GetString("ShowBalloonTips");
            chkCheckForUpdates.Text = LocRm.GetString("AutomaticallyCheckForUpda");
            chkErrorReporting.Text = LocRm.GetString("AnonymousErrorReporting");
            chkPasswordProtect.Text = LocRm.GetString("PasswordProtectWhenMinimi");
            chkShowGettingStarted.Text = LocRm.GetString("ShowGettingStarted");
            chkStartup.Text = LocRm.GetString("RunOnStartupthisUserOnly");
            chkAutoSchedule.Text = LocRm.GetString("AutoApplySchedule");
            chkPasswordProtectOnStart.Text = LocRm.GetString("PasswordProtectOnStart");
            
            label14.Text = LocRm.GetString("IspyServerName");
            label16.Text = LocRm.GetString("ispyOpacitymayNotW");
            label2.Text = LocRm.GetString("ServerReceiveTimeout");
            label21.Text = LocRm.GetString("TrayIconText");
            label3.Text = LocRm.GetString("MediaDirectory");
            label4.Text = "ms";
            label7.Text = "ms";
            label42.Text = "ms";
            label49.Text = "ms";
            label62.Text = "s";

            label8.Text = LocRm.GetString("MjpegReceiveTimeout");
            label47.Text = LocRm.GetString("StartupMode");

            label18.Text = LocRm.GetString("MaxRecordingThreads");
            label13.Text = LocRm.GetString("PlaybackMode");
            tabPage1.Text = LocRm.GetString("Colors");
            tabPage2.Text = LocRm.GetString("Storage");
            tabPage4.Text = LocRm.GetString("Timeouts");
            tabPage6.Text = LocRm.GetString("options");
            tabPage7.Text = LocRm.GetString("IPAccess");
            linkLabel1.Text = LocRm.GetString("GetLatestList");
            Text = LocRm.GetString("settings");
            linkLabel2.Text = LocRm.GetString("HelpTranslateISpy");
            chkAlertWindows.Text = LocRm.GetString("CreateAlertWindow");
            chkOverlay.Text = LocRm.GetString("ShowOverlayControls");
            lblPriority.Text = LocRm.GetString("Priority");
            chkInterrupt.Text = LocRm.GetString("InterruptScreensaverOnAlert");
            label23.Text = LocRm.GetString("JPEGQuality");
            llblHelp.Text = LocRm.GetString("help");
            label17.Text = LocRm.GetString("IPAccessExplainer");
            chkMonitor.Text = LocRm.GetString("RestartIfCrashed");
            chkGZip.Text = LocRm.GetString("Enable GZip");
            label40.Text = LocRm.GetString("Permissions");
            label24.Text = LocRm.GetString("MediaPanelItems");
            label11.Text = LocRm.GetString("ArchiveDirectory");
            label48.Text = LocRm.GetString("DisconnectionNotificationDelay");
            label41.Text = LocRm.GetString("MJPEGFrameInterval");
            label20.Text = LocRm.GetString("VLCFileCache");
            label64.Text = LocRm.GetString("HTTPReferrersAllowed");

            LocRm.SetString(lblMicrophone, "Microphone");
            LocRm.SetString(chkBigButtons, "BigButtons");
            LocRm.SetString(chkMinimise, "MinimiseOnClose");
            LocRm.SetString(chkRecycle, "DeleteToRecycle");
            LocRm.SetString(chkEnableIPv6,"EnableIPv6");
            LocRm.SetString(label15, "MaxCPUTarget");
            LocRm.SetString(label22, "MaxRedrawRate");
            LocRm.SetString(btnBorderDefault, "BorderDefault");
            LocRm.SetString(label25,"YouCanUseRegularExpressions");
            LocRm.SetString(tabPage5,"Talk");
            LocRm.SetString(tabPage8, "Joystick");
            LocRm.SetString(label26, "Joystick");
            LocRm.SetString(tabPage9, "Messaging");
            LocRm.SetString(label19, "AppendLinkText");

            LocRm.SetString(label28, "PanAxis");
            LocRm.SetString(label30, "TiltAxis");
            LocRm.SetString(label32, "ZoomAxis");
            LocRm.SetString(btnCenterAxes, "CenterAxes");


            LocRm.SetString(label34, "Record");
            LocRm.SetString(label29, "Snapshot");
            LocRm.SetString(label27, "Talk");
            LocRm.SetString(label31, "Listen");
            LocRm.SetString(label33, "Play");
            LocRm.SetString(label37, "Stop");
            LocRm.SetString(label35, "Next");
            LocRm.SetString(label36, "Previous");
            LocRm.SetString(label38, "JoystickNote");
            LocRm.SetString(label39, "StartupForm");
            LocRm.SetString(chkMinimiseToTray, "MinimiseToTray");

            LocRm.SetString(label56, "EmailNotifications");
            LocRm.SetString(label50, "EmailSubject");
            LocRm.SetString(label51, "EmailBody");
            LocRm.SetString(label19, "AppendLinkText");
            LocRm.SetString(label57, "SMSNotifications");
            LocRm.SetString(label54, "Message");
            LocRm.SetString(linkLabel5, "Reset");

            chkUseiSpy.Text = LocRm.GetString("UseISpyServers");
            label52.Text = LocRm.GetString("FromAddress");
            label58.Text = LocRm.GetString("Username");

            LocRm.SetString(label59, "Password");
            LocRm.SetString(label53, "Server");
            LocRm.SetString(label61, "Port");
            LocRm.SetString(chkSMTPUseSSL, "UseSSL");
            LocRm.SetString(btnTestSMTP, "Test");
            LocRm.SetString(label43, "WhenDisconnectedFromWebServices");
            LocRm.SetString(label45,"Execute");
            LocRm.SetString(label46, "Execute");
            LocRm.SetString(label44, "WhenReconnectedToWebServices");
            LocRm.SetString(label10, "Plugins");
            LocRm.SetString(linkLabel3, "DownloadPlugins");
            LocRm.SetString(linkLabel4, "RefreshList");
            LocRm.SetString(label12, "ArchiveLocation");
            LocRm.SetString(button3, "RunNow");

            LocRm.SetString(label66, "MaxLogSize");
            LocRm.SetString(label65, "KeepLogsFor");
            LocRm.SetString(label67, "Days");

            tabPage10.Text = LocRm.GetString("ConnectionAlerts");
            tabPage11.Text = LocRm.GetString("Plugins");
            tabPage14.Text = LocRm.GetString("Logging");
            label9.Text = LocRm.GetString("MaximseAndRestore");
            label60.Text = LocRm.GetString("SSLCertificate");
            //future
            chkSpeechRecognition.Visible = false;
            label63.Text = LocRm.GetString("Servers");
            chkOpenGrabs.Text = LocRm.GetString("OpenImagesAfterSaving");
            chkEnableLogging.Text = LocRm.GetString("Enable");
            numKeepLogs.Text = LocRm.GetString("KeepLogsForDays");
            numMaxLogSize.Text = LocRm.GetString("MaxFileSizeKB");
            llblHelp.Visible = linkLabel1.Visible = linkLabel2.Visible = Helper.HasFeature(Enums.Features.View_Ispy_Links);
        }
Beispiel #7
0
        public static objectsCommand[] GenerateRemoteCommands()
        {
            //copy over
            var lcom = new List <objectsCommand>();
            var cmd  = new objectsCommand
            {
                command = "ispy ALLON",
                id      = 0,
                name    = "cmd_SwitchAllOn",
            };

            lcom.Add(cmd);

            cmd = new objectsCommand
            {
                command = "ispy ALLOFF",
                id      = 1,
                name    = "cmd_SwitchAllOff",
            };
            lcom.Add(cmd);

            cmd = new objectsCommand
            {
                command = "ispy APPLYSCHEDULE",
                id      = 2,
                name    = "cmd_ApplySchedule",
            };
            lcom.Add(cmd);

            if (Helper.HasFeature(Enums.Features.Recording))
            {
                cmd = new objectsCommand
                {
                    command = "ispy RECORDONDETECTON",
                    id      = 3,
                    name    = "cmd_RecordOnDetectAll",
                };
                lcom.Add(cmd);

                cmd = new objectsCommand
                {
                    command = "ispy RECORDONALERTON",
                    id      = 4,
                    name    = "cmd_RecordOnAlertAll",
                };
                lcom.Add(cmd);

                cmd = new objectsCommand
                {
                    command = "ispy RECORDINGOFF",
                    id      = 5,
                    name    = "cmd_RecordOffAll",
                };
                lcom.Add(cmd);

                cmd = new objectsCommand
                {
                    command = "ispy RECORD",
                    id      = 8,
                    name    = "cmd_RecordAll",
                };
                lcom.Add(cmd);

                cmd = new objectsCommand
                {
                    command = "ispy RECORDSTOP",
                    id      = 9,
                    name    = "cmd_RecordAllStop",
                };
                lcom.Add(cmd);
            }

            cmd = new objectsCommand
            {
                command = "ispy ALERTON",
                id      = 6,
                name    = "cmd_AlertsOnAll",
            };
            lcom.Add(cmd);

            cmd = new objectsCommand
            {
                command = "ispy ALERTOFF",
                id      = 7,
                name    = "cmd_AlertsOffAll",
            };
            lcom.Add(cmd);

            if (Helper.HasFeature(Enums.Features.Save_Frames))
            {
                cmd = new objectsCommand
                {
                    command = "ispy SNAPSHOT",
                    id      = 10,
                    name    = "cmd_SnapshotAll",
                };
                lcom.Add(cmd);
            }
            return(lcom.ToArray());
        }
Beispiel #8
0
        internal void MergeMedia()
        {
            if (_ffmpegProcess != null)
            {
                return;
            }

            if (!Helper.HasFeature(Enums.Features.Recording))
            {
                return;
            }
            _pbMerge = new List <FilesFile>();

            _currentObject = ((Li)ddlObject.SelectedItem);
            if (_currentObject.Ot == 1)
            {
                var vl = MainClass.GetVolumeLevel(_currentObject.ID);
                _pbMerge = vl.FileList.Where(
                    p => p.CreatedDateTicks >= dateTimePicker1.Value.Ticks &&
                    p.CreatedDateTicks <= dateTimePicker2.Value.Ticks).OrderBy(p => p.CreatedDateTicks).ToList();
            }
            else
            {
                var cw = MainClass.GetCameraWindow(_currentObject.ID);
                _pbMerge = cw.FileList.Where(
                    p => p.CreatedDateTicks >= dateTimePicker1.Value.Ticks &&
                    p.CreatedDateTicks <= dateTimePicker2.Value.Ticks).OrderBy(p => p.CreatedDateTicks).ToList();
            }

            if (_pbMerge.Count > 0)
            {
                var    first = _pbMerge.First();
                string ext   = first.Filename.Substring(first.Filename.LastIndexOf(".", StringComparison.Ordinal) + 1);
                var    date  = DateTime.Now;

                _dir     = Helper.GetFullPath(_currentObject.Ot, _currentObject.ID);
                _outfile = _currentObject.ID + "_" +
                           $"Merge_{date.Year}-{Helper.ZeroPad(date.Month)}-{Helper.ZeroPad(date.Day)}_{Helper.ZeroPad(date.Hour)}-{Helper.ZeroPad(date.Minute)}-{Helper.ZeroPad(date.Second)}" + "." + ext;

                string filelist = _pbMerge.Aggregate("",
                                                     (current, file) => current + ("file '" + _dir + file.Filename + "'" + Environment.NewLine));

                File.WriteAllText(Program.AppDataPath + "concat.txt", filelist);
                if (filelist != "")
                {
                    var startInfo = new ProcessStartInfo
                    {
                        FileName  = "\"" + Program.AppPath + "ffmpeg.exe\"",
                        Arguments =
                            "-f concat -i \"" + Program.AppDataPath + "concat.txt" +
                            "\" -codec copy \"" + _dir + _outfile + "\"",
                        RedirectStandardOutput = false,
                        RedirectStandardError  = false,
                        UseShellExecute        = false,
                        CreateNoWindow         = false
                    };
                    Logger.LogMessageToFile("Merge: " + startInfo.FileName + " " + startInfo.Arguments);
                    _ffmpegProcess = new Process {
                        StartInfo = startInfo, EnableRaisingEvents = true
                    };
                    _ffmpegProcess.Exited            += FfmpegMergeProcessExited;
                    _ffmpegProcess.ErrorDataReceived += FfmpegMergeProcessErrorDataReceived;
                    try
                    {
                        _ffmpegProcess.Start();
                    }
                    catch (Exception e)
                    {
                        _ffmpegProcess = null;
                        Logger.LogExceptionToFile(e);
                    }
                }
                button1.Enabled = false;
            }
        }
Beispiel #9
0
        private void SetupVideoSource()
        {
            StopPlayer();

            MainForm.Conf.MJPEGURL = cmbMJPEGURL.Text.Trim();


            string nv = "";

            SourceIndex = GetSourceIndex();

            CameraLogin = CameraPassword = "";


            FriendlyName = "Camera " + MainForm.Cameras.Count;
            string url;

            switch (SourceIndex)
            {
            case 0:



                SetPTZPort();
                break;

            case 1:
                url = cmbMJPEGURL.Text.Trim();
                if (string.IsNullOrEmpty(url))
                {
                    MessageBox.Show(LocRm.GetString("Validate_SelectCamera"), LocRm.GetString("Note"));
                    return;
                }
                VideoSourceString = url;
                CameraLogin       = txtLogin2.Text;
                CameraPassword    = txtPassword2.Text;
                CameraControl.Camobject.decodekey = txtDecodeKey.Text;
                SetPTZPort();
                break;

            case 2:



                //analyse cannot be greater than timeout
                if (CameraControl.Camobject.settings.analyseduration > CameraControl.Camobject.settings.timeout - 500)
                {
                    CameraControl.Camobject.settings.timeout = CameraControl.Camobject.settings.analyseduration + 500;
                }


                SetPTZPort();
                break;

            case 3:
                if (!devicesCombo.Enabled)
                {
                    MessageBox.Show(LocRm.GetString("Validate_SelectCamera"), LocRm.GetString("Note"));
                    return;
                }
                _videoDeviceMoniker = _videoCaptureDevice.Source;
                if (_videoCapabilitiesDictionary.Count != 0)
                {
                    VideoCapabilities caps =
                        _videoCapabilitiesDictionary[(string)videoResolutionsCombo.SelectedItem];
                    _captureSize = caps.FrameSize;
                    FrameRate    = caps.AverageFrameRate;
                    nv           = "video=" + (string)videoResolutionsCombo.SelectedItem + ",";
                }

                if (ConfigureSnapshots)
                {
                    // set snapshots size
                    if (_snapshotCapabilitiesDictionary.Count != 0)
                    {
                        VideoCapabilities caps = _snapshotCapabilitiesDictionary[(string)snapshotResolutionsCombo.SelectedItem];
                        _snapshotSize = caps.FrameSize;
                        nv           += "snapshots=" + (string)snapshotResolutionsCombo.SelectedItem + ",";
                    }
                }
                nv += "manual=" + (!chkAutoImageSettings.Checked).ToString().ToLower() + ",";
                nv += "capturemode=";
                if (rdoCaptureSnapshots.Checked)
                {
                    nv += "snapshots";
                }
                else
                {
                    nv += "video";
                }

                VideoInputIndex = -1;
                if (videoInputsCombo.SelectedIndex > 0)
                {
                    if (_availableVideoInputs.Length != 0)
                    {
                        VideoInputIndex = _availableVideoInputs[videoInputsCombo.SelectedIndex - 1].Index;
                    }
                }

                VideoSourceString = _videoDeviceMoniker;
                break;

            case 4:



                break;

            case 5:
                if (!VlcHelper.VlcInstalled)
                {
                    MessageBox.Show(LocRm.GetString("DownloadVLC"), LocRm.GetString("Note"));
                    return;
                }
                if (!_vlcStreamSizeSet)
                {
                    CameraControl.Camobject.settings.vlcWidth  = 640;
                    CameraControl.Camobject.settings.vlcHeight = 480;
                }



                SetPTZPort();
                break;

            case 6:

                nv = "type=ximea";

                VideoSourceString = nv;
                break;

            case 7:

                nv = "type=kinect";


                VideoSourceString = nv;
                break;

            case 8:

                CameraControl.Camobject.settings.namevaluesettings = nv;
                CameraControl.Camobject.alerts.mode             = "KinectPlugin";//custom ispykinect alert mode
                CameraControl.Camobject.detector.recordonalert  = false;
                CameraControl.Camobject.alerts.minimuminterval  = 10;
                CameraControl.Camobject.detector.recordondetect = false;
                CameraControl.Camobject.detector.type           = "None";
                CameraControl.Camobject.settings.audiomodel     = "NetworkKinect";
                try
                {
                    var uri = new Uri(VideoSourceString);

                    if (!string.IsNullOrEmpty(uri.DnsSafeHost))
                    {
                        CameraControl.Camobject.settings.audioip   = uri.DnsSafeHost;
                        CameraControl.Camobject.settings.audioport = uri.Port;
                    }
                }
                catch
                {
                    MessageBox.Show(LocRm.GetString("InvalidURL"), LocRm.GetString("Error"));
                    return;
                }

                CameraControl.Camobject.settings.audiousername = "";
                CameraControl.Camobject.settings.audiopassword = "";

                break;

            case 9:

                var cfg = onvifWizard1.lbOnvifURLs.SelectedItem as ONVIFDevice.MediaEndpoint;
                if (cfg == null)
                {
                    MessageBox.Show(LocRm.GetString("Validate_SelectCamera"), LocRm.GetString("Note"));
                    return;
                }

                url = cfg.Uri.Uri;

                CameraLogin       = onvifWizard1.txtOnvifUsername.Text;
                CameraPassword    = onvifWizard1.txtOnvifPassword.Text;
                VideoSourceString = CameraControl.Camobject.settings.onvifident = onvifWizard1.ddlDeviceURL.Text;
                nv = "profilename=" + onvifWizard1.lbOnvifURLs.SelectedIndex.ToString() + ",use=" + (onvifWizard1.ddlConnectWith.SelectedIndex == 0 ? "FFMPEG" : "VLC");

                CameraControl.Camobject.ptz = -5;    //onvif
                CameraControl.Camobject.settings.rtspmode       = onvifWizard1.ddlTransport.SelectedIndex;
                CameraControl.Camobject.settings.onvif.rtspport = (int)onvifWizard1.numRTSP.Value;
                SetVideoSize(new Size(cfg.Width, cfg.Height));


                break;

            case 10:


                break;
            }
            CameraControl.Camobject.settings.namevaluesettings = nv;

            if (!Helper.HasFeature(Enums.Features.Recording))
            {
                CameraControl.Camobject.detector.recordonalert  = false;
                CameraControl.Camobject.detector.recordondetect = false;
            }

            string t = FriendlyName;
            int    i = 1;

            while (MainForm.Cameras.FirstOrDefault(p => p.name == t) != null)
            {
                t = FriendlyName + " (" + i + ")";
                i++;
            }

            FriendlyName = t;


            if (string.IsNullOrEmpty(VideoSourceString))
            {
                MessageBox.Show(LocRm.GetString("Validate_SelectCamera"), LocRm.GetString("Note"));
                return;
            }

            if (!MainForm.Conf.RecentFileList.Contains(MainForm.Conf.AVIFileName) &&
                MainForm.Conf.AVIFileName != "")
            {
                MainForm.Conf.RecentFileList =
                    (MainForm.Conf.RecentFileList + "|" + MainForm.Conf.AVIFileName).Trim('|');
            }
            if (!MainForm.Conf.RecentJPGList.Contains(MainForm.Conf.JPEGURL) &&
                MainForm.Conf.JPEGURL != "")
            {
                MainForm.Conf.RecentJPGList =
                    (MainForm.Conf.RecentJPGList + "|" + MainForm.Conf.JPEGURL).Trim('|');
            }
            if (!MainForm.Conf.RecentMJPGList.Contains(MainForm.Conf.MJPEGURL) &&
                MainForm.Conf.MJPEGURL != "")
            {
                MainForm.Conf.RecentMJPGList =
                    (MainForm.Conf.RecentMJPGList + "|" + MainForm.Conf.MJPEGURL).Trim('|');
            }
            if (!MainForm.Conf.RecentVLCList.Contains(MainForm.Conf.VLCURL) &&
                MainForm.Conf.VLCURL != "")
            {
                MainForm.Conf.RecentVLCList =
                    (MainForm.Conf.RecentVLCList + "|" + MainForm.Conf.VLCURL).Trim('|');
            }



            DialogResult = DialogResult.OK;
            Close();
        }
        public static void InitRemoteCommands()
        {
            //copy over
            _remotecommands.Clear();
            var cmd = new objectsCommand
            {
                command    = "ispy ALLON",
                id         = 0,
                name       = "cmd_SwitchAllOn",
                smscommand = "ALL ON"
            };

            _remotecommands.Add(cmd);

            cmd = new objectsCommand
            {
                command    = "ispy ALLOFF",
                id         = 1,
                name       = "cmd_SwitchAllOff",
                smscommand = "ALL OFF"
            };
            _remotecommands.Add(cmd);

            cmd = new objectsCommand
            {
                command    = "ispy APPLYSCHEDULE",
                id         = 2,
                name       = "cmd_ApplySchedule",
                smscommand = "APPLY SCHEDULE"
            };
            _remotecommands.Add(cmd);

            if (Helper.HasFeature(Enums.Features.Recording))
            {
                cmd = new objectsCommand
                {
                    command    = "ispy RECORDONDETECTON",
                    id         = 3,
                    name       = "cmd_RecordOnDetectAll",
                    smscommand = "RECORDONDETECTON"
                };
                _remotecommands.Add(cmd);

                cmd = new objectsCommand
                {
                    command    = "ispy RECORDONALERTON",
                    id         = 4,
                    name       = "cmd_RecordOnAlertAll",
                    smscommand = "RECORDONALERTON"
                };
                _remotecommands.Add(cmd);

                cmd = new objectsCommand
                {
                    command    = "ispy RECORDINGOFF",
                    id         = 5,
                    name       = "cmd_RecordOffAll",
                    smscommand = "RECORDINGOFF"
                };
                _remotecommands.Add(cmd);

                cmd = new objectsCommand
                {
                    command    = "ispy RECORD",
                    id         = 8,
                    name       = "cmd_RecordAll",
                    smscommand = "RECORD"
                };
                _remotecommands.Add(cmd);

                cmd = new objectsCommand
                {
                    command    = "ispy RECORDSTOP",
                    id         = 9,
                    name       = "cmd_RecordAllStop",
                    smscommand = "RECORDSTOP"
                };
                _remotecommands.Add(cmd);
            }

            cmd = new objectsCommand
            {
                command    = "ispy ALERTON",
                id         = 6,
                name       = "cmd_AlertsOnAll",
                smscommand = "ALERTSON"
            };
            _remotecommands.Add(cmd);

            cmd = new objectsCommand
            {
                command    = "ispy ALERTOFF",
                id         = 7,
                name       = "cmd_AlertsOffAll",
                smscommand = "ALERTSOFF"
            };
            _remotecommands.Add(cmd);

            if (Helper.HasFeature(Enums.Features.Save_Frames))
            {
                cmd = new objectsCommand
                {
                    command    = "ispy SNAPSHOT",
                    id         = 10,
                    name       = "cmd_SnapshotAll",
                    smscommand = "SNAPSHOT"
                };
                _remotecommands.Add(cmd);
            }
        }
Beispiel #11
0
        private void SetupVideoSource()
        {
            StopPlayer();


            string nv = "";

            SourceIndex = GetSourceIndex();

            CameraLogin = CameraPassword = "";


            FriendlyName = "Camera " + MainForm.Cameras.Count;
            string url;

            switch (SourceIndex)
            {
            case 0:

                break;

            case 1:

                break;

            case 2:

                break;

            case 3:

                break;

            case 4:


                break;

            case 5:

                break;

            case 6:

                break;

            case 7:

                break;

            case 8:

                break;

            case 9:

                var cfg = onvifWizard1.lbOnvifURLs.SelectedItem as ONVIFDevice.MediaEndpoint;
                if (cfg == null)
                {
                    MessageBox.Show(LocRm.GetString("Validate_SelectCamera"), LocRm.GetString("Note"));
                    return;
                }

                url = cfg.Uri.Uri;
                string       writePath   = "Requst/source_selected.txt";
                StreamWriter info_source = new StreamWriter(writePath);
                info_source.WriteLine(url);
                info_source.Close();
                MessageBox.Show("fdf", url);

                CameraLogin       = onvifWizard1.txtOnvifUsername.Text;
                CameraPassword    = onvifWizard1.txtOnvifPassword.Text;
                VideoSourceString = CameraControl.Camobject.settings.onvifident = onvifWizard1.ddlDeviceURL.Text;
                nv = "profilename=" + onvifWizard1.lbOnvifURLs.SelectedIndex.ToString() + ",use=" + (onvifWizard1.ddlConnectWith.SelectedIndex == 0 ? "FFMPEG" : "VLC");

                CameraControl.Camobject.ptz = -5;    //onvif
                CameraControl.Camobject.settings.rtspmode       = onvifWizard1.ddlTransport.SelectedIndex;
                CameraControl.Camobject.settings.onvif.rtspport = (int)onvifWizard1.numRTSP.Value;
                SetVideoSize(new Size(cfg.Width, cfg.Height));


                break;

            case 10:

                break;
            }
            CameraControl.Camobject.settings.namevaluesettings = nv;

            if (!Helper.HasFeature(Enums.Features.Recording))
            {
                CameraControl.Camobject.detector.recordonalert  = false;
                CameraControl.Camobject.detector.recordondetect = false;
            }

            string t = FriendlyName;
            int    i = 1;

            while (MainForm.Cameras.FirstOrDefault(p => p.name == t) != null)
            {
                t = FriendlyName + " (" + i + ")";
                i++;
            }

            FriendlyName = t;


            if (string.IsNullOrEmpty(VideoSourceString))
            {
                MessageBox.Show(LocRm.GetString("Validate_SelectCamera"), LocRm.GetString("Note"));
                return;
            }

            if (!MainForm.Conf.RecentFileList.Contains(MainForm.Conf.AVIFileName) &&
                MainForm.Conf.AVIFileName != "")
            {
                MainForm.Conf.RecentFileList =
                    (MainForm.Conf.RecentFileList + "|" + MainForm.Conf.AVIFileName).Trim('|');
            }
            if (!MainForm.Conf.RecentJPGList.Contains(MainForm.Conf.JPEGURL) &&
                MainForm.Conf.JPEGURL != "")
            {
                MainForm.Conf.RecentJPGList =
                    (MainForm.Conf.RecentJPGList + "|" + MainForm.Conf.JPEGURL).Trim('|');
            }
            if (!MainForm.Conf.RecentMJPGList.Contains(MainForm.Conf.MJPEGURL) &&
                MainForm.Conf.MJPEGURL != "")
            {
                MainForm.Conf.RecentMJPGList =
                    (MainForm.Conf.RecentMJPGList + "|" + MainForm.Conf.MJPEGURL).Trim('|');
            }
            if (!MainForm.Conf.RecentVLCList.Contains(MainForm.Conf.VLCURL) &&
                MainForm.Conf.VLCURL != "")
            {
                MainForm.Conf.RecentVLCList =
                    (MainForm.Conf.RecentVLCList + "|" + MainForm.Conf.VLCURL).Trim('|');
            }



            DialogResult = DialogResult.OK;
            Close();
        }