void sampler_MediaOnline(DSConfig config) { sampler.MediaOnline -= new DsSampler.MediaStartup(sampler_MediaOnline); imgDimLabel.Enabled = true; imgDim.Text = sampler.Configuration.ImageWidth + "x" + sampler.Configuration.ImageHeight; if (sampler.Configuration.Statistics) { //starting stats updateTimer.Enabled = true; numFramesLabel.Enabled = true; numRequestsLabel.Enabled = true; numCopiesLabel.Enabled = true; responseLabel.Enabled = true; fpsLabel.Enabled = true; avgFpsLabel.Enabled = true; avgResponseLabel.Enabled = true; skipFramesLabel.Enabled = true; } if (closeWindow.Checked) { Hide(); } }
/// <summary> /// Parametrizes the provider and itself according to the required config. /// You can consider it as converting required -> actual config. /// </summary> /// <param name="config">The required configuration from the UI</param> private void configPane_SetupComplete(InteractiveDSConfig config) { // Copy the provider provider = config.Provider; // Enable stats if necessary stats.Enabled = config.Statistics; // Prepare the buffer BMPbuffer = null; BMPbuffered = config.Buffered; videoInfoHeader = provider.StartProvider(config.Preview, this, config.Owner.Handle); // Setup image storage imageWidth = videoInfoHeader.BmiHeader.Width; imageHeight = videoInfoHeader.BmiHeader.Height; imageStride = imageWidth * 3; imageOffset = (imageHeight - 1) * imageStride; savedArray = new byte[imageWidth * imageHeight * 4]; // Adjust the preview ResizeVideo(config.Owner.Size); // Create the current configuration object configuration = new DSConfig(provider, imageWidth, imageHeight, config.Preview, config.Statistics); // Indicate that the preparations are complete mediaOnline = true; if (MediaOnline != null) { MediaOnline(configuration); } }