Esempio n. 1
0
 private void LoadTemplates()
 {
     if (CaptureSettings.Instance().DEFAULT_TEMPLATE_PATH == "")
     {
         System.Windows.MessageBox.Show("No template path configured!");
     }
     else
     {
         string fileName = CaptureSettings.Instance().DEFAULT_TEMPLATE_PATH;
         try
         {
             if (!File.Exists(fileName))
             {
                 System.Windows.MessageBox.Show("There is no file with templates for stones! Create one in contour settings!");
             }
             else
             {
                 using (FileStream fs = new FileStream(fileName, FileMode.Open))
                     CommonAttribService.DEFAULT_TEMPLATES = (Templates) new BinaryFormatter().Deserialize(fs);
             }
         }
         catch
         {
             System.Windows.MessageBox.Show("An error ocurred during template initialization");
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Loads gradient colors
        /// </summary>
        private void LoadFadeColors()
        {
            // fade color path
            if (CaptureSettings.Instance().DEFAULT_FADECOLOR_PATH == "")
            {
                CaptureSettings.Instance().DEFAULT_FADECOLOR_PATH = "colors.xml";
            }

            string fadeName = CaptureSettings.Instance().DEFAULT_FADECOLOR_PATH;

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(HashSet <FadeColor>), new Type[] { typeof(FadeColor) });
                StreamReader  reader     = new StreamReader(fadeName);

                // we need to order the colors as they are not serialized in order
                LinkedList <FadeColor> output = new LinkedList <FadeColor>();
                HashSet <FadeColor>    temp   = (HashSet <FadeColor>)serializer.Deserialize(reader);
                foreach (FadeColor fade in temp.OrderBy(fadec => fadec.position))
                {
                    output.AddLast(fade);
                }
                CommonAttribService.DEFAULT_FADE_COLORS = output;
                reader.Close();
            }
            catch
            {
                System.Windows.MessageBox.Show("An error ocurred during loading of color gradients");
            }
        }
Esempio n. 3
0
        private CaptureSettings GetSettings()
        {
            var ret = new CaptureSettings();

            ret.Inject = InjectMode;

            ret.AutoStart = AutoStart.Checked;

            ret.Executable = exePath.Text;
            ret.WorkingDir = RealWorkDir;
            ret.CmdLine    = cmdline.Text;

            ret.Options.AllowFullscreen            = AllowFullscreen.Checked;
            ret.Options.AllowVSync                 = AllowVSync.Checked;
            ret.Options.HookIntoChildren           = HookIntoChildren.Checked;
            ret.Options.CaptureCallstacks          = CaptureCallstacks.Checked;
            ret.Options.CaptureCallstacksOnlyDraws = CaptureCallstacksOnlyDraws.Checked;
            ret.Options.APIValidation              = APIValidation.Checked;
            ret.Options.RefAllResources            = RefAllResources.Checked;
            ret.Options.SaveAllInitials            = SaveAllInitials.Checked;
            ret.Options.CaptureAllCmdLists         = CaptureAllCmdLists.Checked;
            ret.Options.DelayForDebugger           = (uint)DelayForDebugger.Value;
            ret.Options.VerifyMapWrites            = VerifyMapWrites.Checked;

            return(ret);
        }
Esempio n. 4
0
        /// <summary>
        /// Click on openIcon will open a template from a file
        /// </summary>
        private void openTemplateImage_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Templates(*.bin)|*.bin";
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string fileName = ofd.FileName;
                CaptureSettings.Instance().DEFAULT_TEMPLATE_PATH = fileName;

                try
                {
                    using (FileStream fs = new FileStream(fileName, FileMode.Open))
                    {
                        // WARNING: here a default path and also a default template will change, if we open a new template
                        Templates tmp = (Templates) new BinaryFormatter().Deserialize(fs);
                        CommonAttribService.DEFAULT_TEMPLATES = tmp;
                        captureWindow.Processor.templates     = tmp;
                    }
                }
                catch (Exception ex)
                {
                    System.Windows.MessageBox.Show(ex.Message);
                }
            }
        }
Esempio n. 5
0
        private void SetSettings(CaptureSettings settings)
        {
            InjectMode = settings.Inject;

            workDirPath_Enter(null, null);

            exePath.Text     = settings.Executable;
            workDirPath.Text = settings.WorkingDir;
            cmdline.Text     = settings.CmdLine;

            workDirPath_Leave(null, null);

            AllowFullscreen.Checked            = settings.Options.AllowFullscreen;
            AllowVSync.Checked                 = settings.Options.AllowVSync;
            HookIntoChildren.Checked           = settings.Options.HookIntoChildren;
            CaptureCallstacks.Checked          = settings.Options.CaptureCallstacks;
            CaptureCallstacksOnlyDraws.Checked = settings.Options.CaptureCallstacksOnlyDraws;
            APIValidation.Checked              = settings.Options.APIValidation;
            RefAllResources.Checked            = settings.Options.RefAllResources;
            SaveAllInitials.Checked            = settings.Options.SaveAllInitials;
            DelayForDebugger.Value             = settings.Options.DelayForDebugger;
            VerifyMapWrites.Checked            = settings.Options.VerifyMapWrites;
            AutoStart.Checked = settings.AutoStart;

            if (settings.AutoStart)
            {
                TriggerCapture();
            }
        }
Esempio n. 6
0
        public CaptureDialog(Core core, OnCaptureMethod captureCallback, OnInjectMethod injectCallback)
        {
            InitializeComponent();

            exePath.Font             =
                workDirPath.Font     =
                    cmdline.Font     =
                        pidList.Font =
                            core.Config.PreferredFont;

            Icon = global::renderdocui.Properties.Resources.icon;

            vulkanLayerWarn.Visible = !Helpers.CheckVulkanLayerRegistration();

            var defaults = new CaptureSettings();

            defaults.Inject = false;

            m_CaptureCallback = captureCallback;
            m_InjectCallback  = injectCallback;

            m_Core = core;

            workDirHint           = true;
            workDirPath.ForeColor = SystemColors.GrayText;

            SetSettings(defaults);

            UpdateGlobalHook();
        }
Esempio n. 7
0
 void InternalRun(CaptureSettings captureSettings, MediaFile outFile)
 {
     Reset();
     if (type == CapturerType.Live)
     {
         ReadyToCapture           = false;
         videowindow.Message      = Catalog.GetString("Loading");
         Capturer                 = App.Current.MultimediaToolkit.GetCapturer();
         outputFile               = outFile;
         settings                 = captureSettings;
         videowindow.Ratio        = (float)outputFile.VideoWidth / outputFile.VideoHeight;
         Capturer.Error          += OnError;
         Capturer.MediaInfo      += HandleMediaInfo;
         Capturer.DeviceChange   += OnDeviceChange;
         Capturer.ReadyToCapture += HandleReadyToCapture;
         Periods = new List <Period> ();
         if (videowindow.Ready)
         {
             Configure();
         }
         else
         {
             delayStart = true;
         }
     }
     else
     {
         ReadyToCapture = true;
     }
 }
Esempio n. 8
0
        private void SetSettings(CaptureSettings settings)
        {
            InjectMode = settings.Inject;

            workDirPath_Enter(null, null);

            exePath.Text = settings.Executable;
            workDirPath.Text = settings.WorkingDir;
            cmdline.Text = settings.CmdLine;

            workDirPath_Leave(null, null);

            AllowFullscreen.Checked = settings.Options.AllowFullscreen;
            AllowVSync.Checked = settings.Options.AllowVSync;
            HookIntoChildren.Checked = settings.Options.HookIntoChildren;
            CaptureCallstacks.Checked = settings.Options.CaptureCallstacks;
            CaptureCallstacksOnlyDraws.Checked = settings.Options.CaptureCallstacksOnlyDraws;
            DebugDeviceMode.Checked = settings.Options.DebugDeviceMode;
            RefAllResources.Checked = settings.Options.RefAllResources;
            SaveAllInitials.Checked = settings.Options.SaveAllInitials;
            DelayForDebugger.Value = settings.Options.DelayForDebugger;
            VerifyMapWrites.Checked = settings.Options.VerifyMapWrites;
            AutoStart.Checked = settings.AutoStart;

            if (settings.AutoStart)
            {
                TriggerCapture();
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Po nacteni hlavniho okna se inicializuje hlavni manazer, ktery se postara
        /// o zbytek inicializace; take se inicializuje manazer kamery
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // pokud loading timer uz nebezi, zrus loading okno
            if (!loadingTimer.Enabled)
            {
                loadingWindow.Close();
            }

            // nacteni veskereho nastaveni z XML souboru
            CalibrationSettings.Instance().Load();
            CaptureSettings.Instance().Load();
            GraphicsSettings.Instance().Load();
            PhysicSettings.Instance().Load();


            CommonAttribService.mainWindow = this;

            // vytvoreni manazeru, ktery propoji funkcionalitu VSEM hlavnim modelum
            myManager          = new WindowManager();
            myManager.MyWindow = this;
            myManager.LoadDefaultValues();
            myManager.ManageMainWindow();

            CameraManager.Reinitialize();
        }
Esempio n. 10
0
        public static void OpenProject(ProjectVM project, CaptureSettings props = null)
        {
            Log.Information($"Open project {project.ProjectType}");
            dynamic settings = new ExpandoObject();

            settings.Project         = project;
            settings.CaptureSettings = props;
            if (project.ProjectType == ProjectType.FakeCaptureProject)
            {
                App.Current.StateController.MoveTo(FakeLiveProjectAnalysisState.NAME, settings, true);
            }
            else if (project.Model.IsFakeCapture)
            {
                App.Current.StateController.MoveTo(NewProjectState.NAME, project);
            }
            else if (project.ProjectType == ProjectType.FileProject || project.ProjectType == ProjectType.EditProject)
            {
                App.Current.StateController.MoveTo(ProjectAnalysisState.NAME, settings, true);
            }
            else
            {
                App.Current.StateController.MoveTo(LiveProjectAnalysisState.NAME, settings, true);
            }

            App.Current.EventsBroker.Publish(new OpenedProjectEvent {
                Project = project.Model
            });
        }
Esempio n. 11
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     CalibrationSettings.Instance().Save();
     CaptureSettings.Instance().Save();
     GraphicsSettings.Instance().Save();
     PhysicSettings.Instance().Save();
 }
Esempio n. 12
0
 public CameraCollectionViewCellDelegate(Func <CameraCollectionViewCell> getCameraCellFunc,
                                         CaptureSession captureSession, CaptureSettings captureSettings)
 {
     _getCameraCellFunc = getCameraCellFunc;
     _captureSession    = captureSession;
     _captureSettings   = captureSettings;
 }
Esempio n. 13
0
 public void OpenProject(Project project, ProjectType projectType,
                         CaptureSettings props, EventsFilter filter,
                         out IAnalysisWindow analysisWindow)
 {
     Log.Information("Open project");
     analysisWindow = mainWindow.SetProject(project, projectType, props, filter);
 }
Esempio n. 14
0
        private void SetSettings(CaptureSettings settings)
        {
            InjectMode = settings.Inject;

            exePath.Text     = settings.Executable;
            workDirPath.Text = settings.WorkingDir;
            cmdline.Text     = settings.CmdLine;

            AllowFullscreen.Checked            = settings.Options.AllowFullscreen;
            AllowVSync.Checked                 = settings.Options.AllowVSync;
            CacheStateObjects.Checked          = settings.Options.CacheStateObjects;
            HookIntoChildren.Checked           = settings.Options.HookIntoChildren;
            CaptureCallstacks.Checked          = settings.Options.CaptureCallstacks;
            CaptureCallstacksOnlyDraws.Checked = settings.Options.CaptureCallstacksOnlyDraws;
            DebugDeviceMode.Checked            = settings.Options.DebugDeviceMode;
            RefAllResources.Checked            = settings.Options.RefAllResources;
            SaveAllInitials.Checked            = settings.Options.SaveAllInitials;
            DelayForDebugger.Value             = settings.Options.DelayForDebugger;
            AutoStart.Checked = settings.AutoStart;

            if (settings.AutoStart)
            {
                TriggerCapture();
            }
        }
Esempio n. 15
0
 /// <summary>
 /// Reset of al settings
 /// </summary>
 private void resetBut_Click(object sender, RoutedEventArgs e)
 {
     CalibrationSettings.Instance().Restart();
     CaptureSettings.Instance().Restart();
     GraphicsSettings.Instance().Restart();
     PhysicSettings.Instance().Restart();
 }
Esempio n. 16
0
                #pragma warning restore 0169

        public void Configure(CaptureSettings settings, IntPtr window_handle)
        {
            IntPtr            err    = IntPtr.Zero;
            EncodingQuality   qual   = settings.EncodingSettings.EncodingQuality;
            Device            device = settings.Device;
            DeviceVideoFormat format = settings.Format;
            EncodingProfile   enc;
            VideoStandard     std;
            IntPtr            outFile, sourceElement, deviceID;

            enc = settings.EncodingSettings.EncodingProfile;
            std = settings.EncodingSettings.VideoStandard;

            outFile       = Marshaller.StringToPtrGStrdup(settings.EncodingSettings.OutputFile);
            sourceElement = Marshaller.StringToPtrGStrdup(device.SourceElement);
            deviceID      = Marshaller.StringToPtrGStrdup(device.ID);

            gst_camera_capturer_configure(Handle, outFile, (int)settings.Device.DeviceType,
                                          sourceElement, deviceID,
                                          format.width, format.height, format.fps_n, format.fps_d,
                                          (int)enc.VideoEncoder, (int)enc.AudioEncoder,
                                          (int)enc.Muxer, qual.VideoQuality,
                                          qual.AudioQuality,
                                          settings.EncodingSettings.EnableAudio,
                                          std.Width, std.Height, window_handle,
                                          out err);
            Marshaller.Free(outFile);
            Marshaller.Free(sourceElement);
            Marshaller.Free(deviceID);
            if (err != IntPtr.Zero)
            {
                throw new GLib.GException(err);
            }
        }
Esempio n. 17
0
 /// <summary>
 /// Click on RESET - resets all settings
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void resetButton_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     settingsLock = true;
     CaptureSettings.Instance().Restart();
     SetDefaultValues();
     settingsLock = false;
 }
Esempio n. 18
0
        public IAnalysisWindow SetProject(Project project, ProjectType projectType, CaptureSettings props, EventsFilter filter)
        {
            ExportProjectAction1.Sensitive = true;

            this.projectType = projectType;
            openedProject    = project;
            if (projectType == ProjectType.FileProject)
            {
                Title = openedProject.Description.Title +
                        " - " + Constants.SOFTWARE_NAME;
            }
            else
            {
                Title = Constants.SOFTWARE_NAME;
            }
            MakeActionsSensitive(true, projectType);
            if (projectType == ProjectType.FakeCaptureProject)
            {
                analysisWindow = new FakeAnalysisComponent();
            }
            else
            {
                analysisWindow = new AnalysisComponent();
            }
            SetPanel(analysisWindow as Widget);
            analysisWindow.SetProject(project, projectType, props, filter);
            return(analysisWindow);
        }
        public CaptureSettings GetSettings()
        {
            CaptureSettings settings = CaptureSettings.Instance();

            settings.Mode = (Mode.INSTRUMENTATION_CATEGORIES | Mode.INSTRUMENTATION_EVENTS);

            foreach (Flag flag in FlagSettings)
            {
                if (flag.IsEnabled)
                {
                    settings.Mode = settings.Mode | flag.Mask;
                }
            }

            settings.SamplingFrequencyHz = (uint)SamplingFrequencyHz;

            settings.CpuGranularityLv = (uint)CpuGranularityLv;
            settings.GpuGranularityLv = (uint)GpuGranularityLv;

            settings.FrameLimit       = (uint)FrameCountLimit.Value;
            settings.TimeLimitUs      = (uint)(TimeLimitSec.Value * 1000000);
            settings.MaxSpikeLimitUs  = (uint)(MaxSpikeLimitMs.Value * 1000);
            settings.MinFilterLimitUs = (uint)(MinFilterLimitMs.Value);
            settings.MaxFilterLimitUs = (uint)(MaxFilterLimitMs.Value);

            settings.MemoryLimitMb = 0;

            return(settings);
        }
        public void SetCaptureSettings( CaptureSettings settings )
        {
            Client.SetActiveChannels( settings.ActiveDigitalChannels.ToArray(), settings.ActiveAnalogChannels.ToArray() );

            var all_sample_rates = GetAllSampleRates();

            SampleRate target_sample_rate = new SampleRate() { DigitalSampleRate = settings.DigitalSampleRateHz, AnalogSampleRate = settings.AnalogSampleRateHz };
            var found_sample_rate_pair = all_sample_rates.FirstOrDefault( x => x.Value.Any( y => y == target_sample_rate ) );
            if( found_sample_rate_pair.Equals( default( KeyValuePair<PerformanceOption, List<SampleRate>> ) ) )
                throw new Exception( "sample rate not possible" );

            PerformanceOption perfomance_option = found_sample_rate_pair.Key;
            Client.SetPerformanceOption( perfomance_option );
            Client.SetSampleRate( target_sample_rate );

            Client.SetCaptureSeconds( settings.CaptureDurationS );

            //trigger configure.
            List<Trigger> trigger_settings = new List<Trigger>();

            settings.ActiveDigitalChannels.Sort(); // lowest to largest.
            foreach( int channel in settings.ActiveDigitalChannels )
            {
                Trigger channel_trigger_setting = Trigger.None;
                if( settings.TriggerSettings.ContainsKey( channel ) )
                    channel_trigger_setting = settings.TriggerSettings[ channel ];

                trigger_settings.Add( channel_trigger_setting );

            }

            Client.SetTrigger( trigger_settings.ToArray(), settings.TriggerMinTimeS, settings.TriggerMaxTimeS );

            //TODO: voltage level
        }
Esempio n. 21
0
 public Camera([NotNull] ILogger <Camera> logger, [NotNull] ILogger <CameraStream> streamLogger, [NotNull] CaptureSettings settings, [NotNull] Func <CaptureSettings, VideoCapture> createVideoCaptureFunc)
 {
     this.logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     this.streamLogger           = streamLogger ?? throw new ArgumentNullException(nameof(streamLogger));
     this.settings               = settings ?? throw new ArgumentNullException(nameof(settings));
     this.createVideoCaptureFunc = createVideoCaptureFunc ?? throw new ArgumentNullException(nameof(createVideoCaptureFunc));
     this.errorObserver          = new ErrorObserver(this);
 }
Esempio n. 22
0
 void OpenNewProject(Project project, ProjectType projectType,
                     CaptureSettings captureSettings)
 {
     if (project != null)
     {
         Config.DatabaseManager.ActiveDB.AddProject(project);
         SetProject(project, projectType, captureSettings);
     }
 }
Esempio n. 23
0
        public void FixtureSetup()
        {
            mockList = new List <Mock> ();
            settings = new CaptureSettings();
            settings.EncodingSettings = new EncodingSettings();
            settings.EncodingSettings.EncodingProfile = EncodingProfiles.MP4;

            App.Current.HotkeysService = new HotkeysService();
            GeneralUIHotkeys.RegisterDefaultHotkeys();
            LMGeneralUIHotkeys.RegisterDefaultHotkeys();

            var playerMock = new Mock <IVideoPlayer> ();

            playerMock.SetupAllProperties();
            mockList.Add(playerMock);

            capturerMock = new Mock <ICapturer> ();
            capturerMock.SetupAllProperties();
            mockList.Add(capturerMock);

            mtkMock = new Mock <IMultimediaToolkit> ();
            mtkMock.Setup(m => m.GetPlayer()).Returns(playerMock.Object);
            mtkMock.Setup(m => m.GetMultiPlayer()).Throws(new Exception());
            mtkMock.Setup(m => m.GetCapturer()).Returns(capturerMock.Object);
            mtkMock.Setup(m => m.DiscoverFile(It.IsAny <string> (), It.IsAny <bool> ()))
            .Returns((string s, bool b) => new MediaFile {
                FilePath = s
            });
            App.Current.MultimediaToolkit = mtkMock.Object;
            mockList.Add(mtkMock);

            gtkMock = new Mock <IGUIToolkit> ();
            gtkMock.SetupGet(o => o.DeviceScaleFactor).Returns(1.0f);
            gtkMock.Setup(m => m.Invoke(It.IsAny <EventHandler> ())).Callback <EventHandler> (e => e(null, null));
            gtkMock.Setup(g => g.RemuxFile(It.IsAny <string> (), It.IsAny <string> (), It.IsAny <VideoMuxerType> ()))
            .Returns(() => settings.EncodingSettings.OutputFile)
            .Callback((string s, string d, VideoMuxerType m) => File.Copy(s, d));
            gtkMock.Setup(g => g.EndCapture(true)).Returns(EndCaptureResponse.Save);
            App.Current.GUIToolkit = gtkMock.Object;
            mockList.Add(gtkMock);

            capturerBinMock = new Mock <ICapturerBin> ();
            capturerBinMock.Setup(w => w.Capturer).Returns(capturerMock.Object);
            capturerBinMock.Setup(w => w.CaptureSettings).Returns(() => settings);
            capturerBinMock.Setup(w => w.Periods).Returns(() => new List <Period> ());
            mockList.Add(capturerBinMock);

            player               = new VideoPlayerController();
            videoPlayerVM        = new VideoPlayerVM();
            videoPlayerVM.Player = player;
            player.SetViewModel(videoPlayerVM);

            currentService = App.Current.LicenseLimitationsService;

            stateControllerMock         = new Mock <IStateController> ();
            App.Current.StateController = stateControllerMock.Object;
        }
Esempio n. 24
0
 public void Run(CaptureSettings settings, MediaFile outputFile)
 {
     if (!capturerBinReady)
     {
         delayedRun = () => InternalRun(settings, outputFile);
         return;
     }
     InternalRun(settings, outputFile);
 }
Esempio n. 25
0
        bool SetProject(Project project, ProjectType projectType, CaptureSettings props)
        {
            if (OpenedProject != null)
            {
                CloseOpenedProject(true);
            }

            Log.Debug("Loading project " + project.ID + " " + projectType);

            PlaysFilter = new EventsFilter(project);
            project.CleanupTimers();
            guiToolkit.OpenProject(project, projectType, props, PlaysFilter,
                                   out analysisWindow);
            Player            = analysisWindow.Player;
            Capturer          = analysisWindow.Capturer;
            OpenedProject     = project;
            OpenedProjectType = projectType;

            if (projectType == ProjectType.FileProject)
            {
                // Check if the file associated to the project exists
                if (!project.Description.FileSet.CheckFiles())
                {
                    if (!guiToolkit.SelectMediaFiles(project))
                    {
                        CloseOpenedProject(true);
                        return(false);
                    }
                }
                try {
                    Player.Open(project.Description.FileSet);
                } catch (Exception ex) {
                    Log.Exception(ex);
                    guiToolkit.ErrorMessage(Catalog.GetString("An error occurred opening this project:") + "\n" + ex.Message);
                    CloseOpenedProject(false);
                    return(false);
                }
            }
            else if (projectType == ProjectType.CaptureProject ||
                     projectType == ProjectType.URICaptureProject ||
                     projectType == ProjectType.FakeCaptureProject)
            {
                try {
                    Capturer.Run(props, project.Description.FileSet.First());
                } catch (Exception ex) {
                    Log.Exception(ex);
                    guiToolkit.ErrorMessage(ex.Message);
                    CloseOpenedProject(false);
                    return(false);
                }
            }

            EmitProjectChanged();
            return(true);
        }
Esempio n. 26
0
        private bool SetProject(Project project, ProjectType projectType, CaptureSettings props)
        {
            if (OpenedProject != null)
            {
                CloseOpenedProject(true);
            }

            if (projectType == ProjectType.FileProject)
            {
                // Check if the file associated to the project exists
                if (!File.Exists(project.Description.File.FilePath))
                {
                    guiToolkit.WarningMessage(Catalog.GetString("The file associated to this project doesn't exist.") + "\n"
                                              + Catalog.GetString("If the location of the file has changed try to edit it with the database manager."));
                    CloseOpenedProject(true);
                    return(false);
                }
                try {
                    Player.Open(project.Description.File.FilePath);
                }
                catch (Exception ex) {
                    guiToolkit.ErrorMessage(Catalog.GetString("An error occurred opening this project:") + "\n" + ex.Message);
                    CloseOpenedProject(true);
                    return(false);
                }
            }
            else
            {
                if (projectType == ProjectType.CaptureProject ||
                    projectType == ProjectType.URICaptureProject)
                {
                    Capturer.CaptureProperties = props;
                    try {
                        Capturer.Type = CapturerType.Live;
                    } catch (Exception ex) {
                        guiToolkit.ErrorMessage(ex.Message);
                        CloseOpenedProject(false);
                        return(false);
                    }
                }
                else
                {
                    Capturer.Type = CapturerType.Fake;
                }
                Capturer.Run();
            }

            OpenedProject     = project;
            OpenedProjectType = projectType;
            PlaysFilter       = new PlaysFilter(project);
            mainWindow.SetProject(project, projectType, props, PlaysFilter);
            EmitProjectChanged();
            return(true);
        }
Esempio n. 27
0
        private void captureWindow(object sender, EventArgs e)
        {
            var settings = new CaptureSettings();

            feeble = new Feeble.Feeble();
            settings.ffmpegLocation      = ffmpegLocation.Text;
            settings.recordingRegionType = RecordingRegionType.window;
            settings.fileName            = cdOutputFile.Text;
            settings.saveLocation        = saveLocation.Text;
            settings.windowTitle         = cwWindowTitle.Text;

            var temp = Task.Run(() => feeble.Capture(settings));
        }
Esempio n. 28
0
        /// <summary>
        /// Load all values from storage
        /// </summary>
        public void LoadValues()
        {
            contourPathTbx.Text            = CaptureSettings.Instance().DEFAULT_TEMPLATE_PATH;
            camIndexCombo.SelectedIndex    = CaptureSettings.Instance().DEFAULT_CAMERA_INDEX;
            dependOutputSizeChck.IsChecked = GraphicsSettings.Instance().OUTPUT_TABLE_SIZE_DEPENDENT;
            contourPathTbx.IsEnabled       = GraphicsSettings.Instance().OUTPUT_TABLE_SIZE_DEPENDENT;
            dependOutputSizeTbx.Text       = CommonAttribService.ACTUAL_OUTPUT_WIDTH.ToString();

            partColorRedTbx.Text          = GraphicsSettings.Instance().DEFAULT_PARTICLE_COLOR_R.ToString();
            partColorGreenTbx.Text        = GraphicsSettings.Instance().DEFAULT_PARTICLE_COLOR_G.ToString();
            partColorBlueTbx.Text         = GraphicsSettings.Instance().DEFAULT_PARTICLE_COLOR_B.ToString();
            motionDetectionChck.IsChecked = CaptureSettings.Instance().MOTION_DETECTION;
            detectionThreshold.Text       = CaptureSettings.Instance().MOTION_TOLERANCE.ToString();
        }
Esempio n. 29
0
        protected virtual void NewProject()
        {
            Project         project;
            ProjectType     projectType;
            CaptureSettings captureSettings = new CaptureSettings();

            Log.Debug("Creating new project");

            /* Show the project selection dialog */
            projectType = guiToolkit.SelectNewProjectType();

            if (projectType == ProjectType.CaptureProject)
            {
                List <Device> devices = multimediaToolkit.VideoDevices;
                if (devices.Count == 0)
                {
                    guiToolkit.ErrorMessage(Catalog.GetString("No capture devices were found."));
                    return;
                }
                project = guiToolkit.NewCaptureProject(Core.DB, Core.TemplatesService, devices,
                                                       out captureSettings);
            }
            else if (projectType == ProjectType.FakeCaptureProject)
            {
                project = guiToolkit.NewFakeProject(Core.DB, Core.TemplatesService);
            }
            else if (projectType == ProjectType.FileProject)
            {
                project = guiToolkit.NewFileProject(Core.DB, Core.TemplatesService);
                if (project != null)
                {
                    Core.DB.AddProject(project);
                }
            }
            else if (projectType == ProjectType.URICaptureProject)
            {
                project = guiToolkit.NewURICaptureProject(Core.DB, Core.TemplatesService,
                                                          out captureSettings);
            }
            else
            {
                project = null;
            }

            if (project != null)
            {
                SetProject(project, projectType, captureSettings);
            }
        }
Esempio n. 30
0
		public void FixtureSetup ()
		{
			mockList = new List<Mock> ();
			settings = new CaptureSettings ();
			settings.EncodingSettings = new EncodingSettings ();
			settings.EncodingSettings.EncodingProfile = EncodingProfiles.MP4;

			var playerMock = new Mock<IPlayer> ();
			playerMock.SetupAllProperties ();
			mockList.Add (playerMock);

			capturerMock = new Mock<ICapturer> ();
			capturerMock.SetupAllProperties ();
			mockList.Add (capturerMock);

			winMock = new Mock<IAnalysisWindow> ();
			winMock.SetupAllProperties ();
			IAnalysisWindowBase win = winMock.Object;
			mockList.Add (winMock);

			mtkMock = new Mock<IMultimediaToolkit> ();
			mtkMock.Setup (m => m.GetPlayer ()).Returns (playerMock.Object);
			mtkMock.Setup (m => m.GetMultiPlayer ()).Throws (new Exception ());
			mtkMock.Setup (m => m.GetCapturer ()).Returns (capturerMock.Object);
			mtkMock.Setup (m => m.DiscoverFile (It.IsAny<string> (), It.IsAny<bool> ()))
				.Returns ((string s, bool b) => new MediaFile { FilePath = s });
			App.Current.MultimediaToolkit = mtkMock.Object;
			mockList.Add (mtkMock);

			gtkMock = new Mock<IGUIToolkit> ();
			gtkMock.Setup (m => m.Invoke (It.IsAny<EventHandler> ())).Callback<EventHandler> (e => e (null, null));
			gtkMock.Setup (m => m.OpenProject (It.IsAny<ProjectLongoMatch> (), It.IsAny<ProjectType> (),
				It.IsAny<CaptureSettings> (), It.IsAny<EventsFilter> (), out win));
			gtkMock.Setup (g => g.RemuxFile (It.IsAny<string> (), It.IsAny<string> (), It.IsAny<VideoMuxerType> ()))
				.Returns (() => settings.EncodingSettings.OutputFile)
				.Callback ((string s, string d, VideoMuxerType m) => File.Copy (s, d));
			gtkMock.Setup (g => g.EndCapture (true)).Returns (EndCaptureResponse.Save);
			App.Current.GUIToolkit = gtkMock.Object;
			mockList.Add (gtkMock);

			capturerBinMock = new Mock<ICapturerBin> ();
			capturerBinMock.Setup (w => w.Capturer).Returns (capturerMock.Object);
			capturerBinMock.Setup (w => w.CaptureSettings).Returns (() => settings);
			capturerBinMock.Setup (w => w.Periods).Returns (() => new List<Period> ());
			mockList.Add (capturerBinMock);
			player = new PlayerController ();
			winMock.Setup (w => w.Capturer).Returns (capturerBinMock.Object);
			winMock.Setup (w => w.Player).Returns (player);
		}
Esempio n. 31
0
        public CaptureDialog(Core core, OnCaptureMethod captureCallback, OnInjectMethod injectCallback)
        {
            InitializeComponent();

            Icon = global::renderdocui.Properties.Resources.icon;

            var defaults = new CaptureSettings();
            defaults.Inject = false;

            m_CaptureCallback = captureCallback;
            m_InjectCallback = injectCallback;

            m_Core = core;

            SetSettings(defaults);
        }
Esempio n. 32
0
        //private void FrameFilterSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        //{
        //	ICollectionView view = CollectionViewSource.GetDefaultView(frameList.ItemsSource);
        //	view.Filter = new Predicate<object>((item) => { return (item is Frame) ? (item as Frame).Duration >= FrameFilterSlider.Value : true; });
        //}

        public void StartCapture(IPAddress address, UInt16 port, CaptureSettings settings, SecureString password)
        {
            ProfilerClient.Get().IpAddress = address;
            ProfilerClient.Get().Port      = port;

            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                StatusText.Text       = "Connecting...";
                StatusText.Visibility = System.Windows.Visibility.Visible;
            }));

            Task.Run(() => { ProfilerClient.Get().SendMessage(new StartMessage()
                {
                    Settings = settings, Password = password
                }, true); });
        }
Esempio n. 33
0
        public bool SetProject(Project project, ProjectType projectType, CaptureSettings props)
        {
            bool isLive = false;

            /* Update tabs labels */
            var desc = project.Description;

            visitorteamlabel.Text = desc.VisitorName;
            localteamlabel.Text   = desc.LocalName;

            if (projectType == ProjectType.FileProject)
            {
                Title = System.IO.Path.GetFileNameWithoutExtension(desc.File.FilePath) +
                        " - " + Constants.SOFTWARE_NAME;
                player.LogoMode    = false;
                timeline.Project   = project;
                guTimeline.Project = project;
            }
            else
            {
                Title  = Constants.SOFTWARE_NAME;
                isLive = true;
                if (projectType == ProjectType.FakeCaptureProject)
                {
                    capturer.Type = CapturerType.Fake;
                }
                player.Visible           = false;
                capturer.Visible         = true;
                TaggingViewAction.Active = true;
            }

            openedProject    = project;
            this.projectType = projectType;

            playsList.ProjectIsLive          = isLive;
            localPlayersList.ProjectIsLive   = isLive;
            visitorPlayersList.ProjectIsLive = isLive;
            tagsList.ProjectIsLive           = isLive;
            playsList.Project = project;
            tagsList.Project  = project;
            UpdateTeamsModels(project);
            buttonswidget.Categories = project.Categories;
            MakeActionsSensitive(true, projectType);
            ShowWidgets();
            return(true);
        }
Esempio n. 34
0
        public CaptureDialog(Core core, OnCaptureMethod captureCallback, OnInjectMethod injectCallback)
        {
            InitializeComponent();

            Icon = global::renderdocui.Properties.Resources.icon;

            var defaults = new CaptureSettings();

            defaults.Inject = false;

            m_CaptureCallback = captureCallback;
            m_InjectCallback  = injectCallback;

            m_Core = core;

            SetSettings(defaults);
        }
Esempio n. 35
0
        bool CreateProject()
        {
            TreeIter iter;
            MediaFile file;

            if (projectType == ProjectType.FileProject ||
                projectType == ProjectType.EditProject) {
                if (!mediafilesetselection1.FileSet.CheckFiles ()) {
                    gtoolkit.WarningMessage (Catalog.GetString ("You need at least 1 video file for the main angle"));
                    return false;
                }
            }

            if (project != null) {
                /* Make sure event types and timers are updated in case we are importing
                 * a project without dashboard */
                project.UpdateEventTypesAndTimers ();
                return true;
            }

            if (projectType == ProjectType.CaptureProject ||
                projectType == ProjectType.URICaptureProject) {
                if (String.IsNullOrEmpty (capturemediafilechooser.CurrentPath)) {
                    gtoolkit.WarningMessage (Catalog.GetString ("No output video file"));
                    return false;
                }
            }
            if (projectType == ProjectType.URICaptureProject) {
                if (urientry.Text == "") {
                    gtoolkit.WarningMessage (Catalog.GetString ("No input URI"));
                    return false;
                }
            }
            project = new Project ();
            project.Dashboard = analysisTemplate;
            project.LocalTeamTemplate = hometemplate;
            project.VisitorTeamTemplate = awaytemplate;
            project.Description = new ProjectDescription ();
            project.Description.Competition = competitionentry.Text;
            project.Description.MatchDate = datepicker1.Date;
            project.Description.Description = desctextview.Buffer.GetText (desctextview.Buffer.StartIter,
                desctextview.Buffer.EndIter, true);
            project.Description.Season = seasonentry.Text;
            project.Description.LocalName = project.LocalTeamTemplate.TeamName;
            project.Description.VisitorName = project.VisitorTeamTemplate.TeamName;
            project.Description.FileSet = mediafilesetselection1.FileSet;
            project.UpdateEventTypesAndTimers ();

            encSettings = new EncodingSettings ();
            captureSettings = new CaptureSettings ();

            encSettings.OutputFile = capturemediafilechooser.CurrentPath;

            /* Get quality info */
            qualitycombobox.GetActiveIter (out iter);
            encSettings.EncodingQuality = (EncodingQuality)qualList.GetValue (iter, 1);

            /* Get size info */
            imagecombobox.GetActiveIter (out iter);
            encSettings.VideoStandard = (VideoStandard)videoStandardList.GetValue (iter, 1);

            /* Get encoding profile info */
            encodingcombobox.GetActiveIter (out iter);
            encSettings.EncodingProfile = (EncodingProfile)encProfileList.GetValue (iter, 1);

            encSettings.Framerate_n = Config.FPS_N;
            encSettings.Framerate_d = Config.FPS_D;

            captureSettings.EncodingSettings = encSettings;

            file = project.Description.FileSet.FirstOrDefault ();
            if (file == null) {
                file = new MediaFile () { Name = Catalog.GetString ("Main camera angle") };
                file.FilePath = capturemediafilechooser.CurrentPath;
                file.Fps = (ushort)(Config.FPS_N / Config.FPS_D);
                file.Par = 1;
                project.Description.FileSet.Add (file);
            }

            if (projectType == ProjectType.CaptureProject) {
                captureSettings.Device = videoDevices [devicecombobox.Active];
                captureSettings.Format = captureSettings.Device.Formats [deviceformatcombobox.Active];
                file.VideoHeight = encSettings.VideoStandard.Height;
                file.VideoWidth = encSettings.VideoStandard.Width;
            } else if (projectType == ProjectType.URICaptureProject) {
                captureSettings.Device = new Device {DeviceType = CaptureSourceType.URI,
                    ID = urientry.Text
                };
                file.VideoHeight = encSettings.VideoStandard.Height;
                file.VideoWidth = encSettings.VideoStandard.Width;
            } else if (projectType == ProjectType.FakeCaptureProject) {
                file.FilePath = Constants.FAKE_PROJECT;
            }
            return true;
        }
Esempio n. 36
0
        public IAnalysisWindow SetProject(Project project, ProjectType projectType, CaptureSettings props, EventsFilter filter)
        {
            ExportProjectAction1.Sensitive = true;

            this.projectType = projectType;
            openedProject = project;
            if (projectType == ProjectType.FileProject) {
                Title = openedProject.Description.Title +
                " - " + Constants.SOFTWARE_NAME;
            } else {
                Title = Constants.SOFTWARE_NAME;
            }
            MakeActionsSensitive (true, projectType);
            if (projectType == ProjectType.FakeCaptureProject) {
                analysisWindow = new FakeAnalysisComponent ();
            } else {
                analysisWindow = new AnalysisComponent ();
            }
            SetPanel (analysisWindow as Widget);
            analysisWindow.SetProject (project, projectType, props, filter);
            return analysisWindow;
        }
Esempio n. 37
0
        bool SetProject(ProjectLongoMatch project, ProjectType projectType, CaptureSettings props)
        {
            if (OpenedProject != null) {
                CloseOpenedProject (true);
            }

            Log.Debug ("Loading project " + project.ID + " " + projectType);

            PlaysFilter = new EventsFilter (project);
            project.CleanupTimers ();
            project.ProjectType = projectType;
            guiToolkit.OpenProject (project, projectType, props, PlaysFilter,
                out analysisWindow);
            Player = analysisWindow.Player;
            Capturer = analysisWindow.Capturer;
            OpenedProject = project;
            OpenedProjectType = projectType;

            if (projectType == ProjectType.FileProject) {
                // Check if the file associated to the project exists
                if (!project.Description.FileSet.CheckFiles ()) {
                    if (!guiToolkit.SelectMediaFiles (project.Description.FileSet)) {
                        CloseOpenedProject (true);
                        return false;
                    }
                }
                try {
                    Player.Open (project.Description.FileSet);
                } catch (Exception ex) {
                    Log.Exception (ex);
                    App.Current.Dialogs.ErrorMessage (Catalog.GetString ("An error occurred opening this project:") + "\n" + ex.Message);
                    CloseOpenedProject (false);
                    return false;
                }

            } else if (projectType == ProjectType.CaptureProject ||
                       projectType == ProjectType.URICaptureProject ||
                       projectType == ProjectType.FakeCaptureProject) {
                try {
                    Capturer.Run (props, project.Description.FileSet.First ());
                } catch (Exception ex) {
                    Log.Exception (ex);
                    App.Current.Dialogs.ErrorMessage (ex.Message);
                    CloseOpenedProject (false);
                    return false;
                }
            }

            EmitProjectChanged ();
            return true;
        }
Esempio n. 38
0
        private CaptureSettings GetSettings()
        {
            var ret = new CaptureSettings();

            ret.Inject = InjectMode;

            ret.AutoStart = AutoStart.Checked;

            ret.Executable = exePath.Text;
            ret.WorkingDir = RealWorkDir;
            ret.CmdLine = cmdline.Text;

            ret.Options.AllowFullscreen = AllowFullscreen.Checked;
            ret.Options.AllowVSync = AllowVSync.Checked;
            ret.Options.HookIntoChildren = HookIntoChildren.Checked;
            ret.Options.CaptureCallstacks = CaptureCallstacks.Checked;
            ret.Options.CaptureCallstacksOnlyDraws = CaptureCallstacksOnlyDraws.Checked;
            ret.Options.DebugDeviceMode = DebugDeviceMode.Checked;
            ret.Options.RefAllResources = RefAllResources.Checked;
            ret.Options.SaveAllInitials = SaveAllInitials.Checked;
            ret.Options.CaptureAllCmdLists = CaptureAllCmdLists.Checked;
            ret.Options.DelayForDebugger = (uint)DelayForDebugger.Value;
            ret.Options.VerifyMapWrites = VerifyMapWrites.Checked;

            return ret;
        }
 public void SetProject(Project project, ProjectType projectType, CaptureSettings props, EventsFilter filter)
 {
     this.project = (ProjectLongoMatch)project;
     codingwidget1.SetProject (this.project, projectType, (LMFilters.EventsFilter)filter);
 }
Esempio n. 40
0
        public CaptureDialog(Core core, OnCaptureMethod captureCallback, OnInjectMethod injectCallback)
        {
            InitializeComponent();

            exePath.Font =
                workDirPath.Font =
                cmdline.Font = 
                pidList.Font = 
                core.Config.PreferredFont;

            Icon = global::renderdocui.Properties.Resources.icon;

            var defaults = new CaptureSettings();
            defaults.Inject = false;
            
            m_CaptureCallback = captureCallback;
            m_InjectCallback = injectCallback;

            m_Core = core;

            workDirHint = true;
            workDirPath.ForeColor = SystemColors.GrayText;

            SetSettings(defaults);

            UpdateGlobalHook();
        }
Esempio n. 41
0
 public void EmitOpenNewProject(Project project, ProjectType projectType, CaptureSettings captureSettings)
 {
     if (OpenNewProjectEvent != null) {
         OpenNewProjectEvent (project, projectType, captureSettings);
     }
 }
Esempio n. 42
0
 public void Run(CaptureSettings settings, MediaFile outputFile)
 {
     Reset ();
     if (type == CapturerType.Live) {
         Capturer = Config.MultimediaToolkit.GetCapturer ();
         this.outputFile = outputFile;
         this.settings = settings;
         videowindow.Ratio = (float)outputFile.VideoWidth / outputFile.VideoHeight;
         Capturer.Error += OnError;
         Capturer.MediaInfo += HandleMediaInfo;
         Capturer.DeviceChange += OnDeviceChange;
         Periods = new List<Period> ();
         if (videowindow.Ready) {
             Configure ();
         } else {
             delayStart = true;
         }
     }
 }
Esempio n. 43
0
        public CaptureDialog(Core core, OnCaptureMethod captureCallback, OnInjectMethod injectCallback)
        {
            InitializeComponent();

            exePath.Font =
                workDirPath.Font =
                cmdline.Font =
                pidList.Font =
                core.Config.PreferredFont;

            Icon = global::renderdocui.Properties.Resources.icon;

            vulkanLayerWarn.Visible = !Helpers.CheckVulkanLayerRegistration();

            var defaults = new CaptureSettings();
            defaults.Inject = false;

            m_CaptureCallback = captureCallback;
            m_InjectCallback = injectCallback;

            m_Core = core;

            workDirHint = true;
            workDirPath.ForeColor = SystemColors.GrayText;

            processFilterHint = true;
            processFilter.ForeColor = SystemColors.GrayText;
            processFilter_Leave(processFilter, new EventArgs());

            m_ProcessSorter.Sorting = SortOrder.Ascending;
            pidList.ListViewItemSorter = m_ProcessSorter;

            SetSettings(defaults);

            UpdateGlobalHook();
        }
Esempio n. 44
0
 public void Configure(CaptureSettings settings, IntPtr window_handle)
 {
 }
Esempio n. 45
0
 public void SetProject(Project project, ProjectType projectType, CaptureSettings props, EventsFilter filter)
 {
     codingwidget1.SetProject (project, projectType, filter);
 }
Esempio n. 46
0
        public CaptureDialog(Core core, OnCaptureMethod captureCallback, OnInjectMethod injectCallback)
        {
            InitializeComponent();

            Icon = global::renderdocui.Properties.Resources.icon;

            var defaults = new CaptureSettings();
            defaults.Inject = false;
            
            m_CaptureCallback = captureCallback;
            m_InjectCallback = injectCallback;

            m_Core = core;

            workDirHint = true;
            workDirPath.ForeColor = SystemColors.GrayText;

            SetSettings(defaults);
        }
Esempio n. 47
0
        public void SetProject(Project project, ProjectType projectType, CaptureSettings props, EventsFilter filter)
        {
            openedProject = project;
            this.projectType = projectType;
            this.filter = filter;

            codingwidget.SetProject (project, projectType, filter);
            playsSelection.SetProject (project, filter);
            if (projectType == ProjectType.FileProject) {
                playercapturer.Mode = PlayerViewOperationMode.Analysis;
            } else {
                playercapturer.Mode = playercapturer.Mode = PlayerViewOperationMode.LiveAnalysisReview;
                Capturer.PeriodsNames = project.Dashboard.GamePeriods;
                Capturer.Periods = project.Periods;
            }
        }
Esempio n. 48
0
		#pragma warning restore 0169

		public void Configure (CaptureSettings settings, IntPtr window_handle)
		{
			IntPtr err = IntPtr.Zero;
			EncodingQuality qual = settings.EncodingSettings.EncodingQuality;
			Device device = settings.Device;
			DeviceVideoFormat format = settings.Format;
			EncodingProfile enc;
			VideoStandard std;
			IntPtr outFile, sourceElement, deviceID;
			
			enc = settings.EncodingSettings.EncodingProfile;
			std = settings.EncodingSettings.VideoStandard;
			
			outFile = Marshaller.StringToPtrGStrdup (settings.EncodingSettings.OutputFile);
			sourceElement = Marshaller.StringToPtrGStrdup (device.SourceElement);
			deviceID = Marshaller.StringToPtrGStrdup (device.ID);
			
			gst_camera_capturer_configure (Handle, outFile, (int)settings.Device.DeviceType,
				sourceElement, deviceID,
				format.width, format.height, format.fps_n, format.fps_d,
				(int)enc.VideoEncoder, (int)enc.AudioEncoder,
				(int)enc.Muxer, qual.VideoQuality,
				qual.AudioQuality,
				settings.EncodingSettings.EnableAudio,
				std.Width, std.Height, window_handle,
				out err);
			Marshaller.Free (outFile);
			Marshaller.Free (sourceElement);
			Marshaller.Free (deviceID);
			if (err != IntPtr.Zero)
				throw new GLib.GException (err);
		}