Exemple #1
0
        private void menuDigitalTVDecomposeGraph_Click(object sender, System.EventArgs e)
        {
            this.bdaGraphBuilder.Dispose();
            this.bdaGraphBuilder = null;

            this.menuNetworkDVBT.Checked = false;
            this.menuNetworkDVBT.Enabled = true;
            this.menuNetworkDVBS.Checked = false;
            this.menuNetworkDVBS.Enabled = true;

            this.menuFileSaveGraph.Enabled           = false;
            this.menuDigitalTVBuildGraph.Enabled     = false;
            this.menuDigitalTVDoTuneRequest.Enabled  = false;
            this.menuDigitalTVDecomposeGraph.Enabled = false;
        }
Exemple #2
0
        private void menuDigitalTVBuildGraph_Click(object sender, System.EventArgs e)
        {
            if (this.tuningSelector.TuneSelect() == true)
            {
                this.bdaGraphBuilder = new BDAGraphBuilder(this);
                this.bdaGraphBuilder.BuildGraph(this.tuningSelector.TuningSpace);
                this.bdaGraphBuilder.SubmitTuneRequest(this.tuningSelector.TuneRequest);
                this.bdaGraphBuilder.RunGraph();
            }

            this.menuDigitalTVBuildGraph.Enabled     = false;
            this.menuFileSaveGraph.Enabled           = true;
            this.menuDigitalTVDoTuneRequest.Enabled  = true;
            this.menuDigitalTVDecomposeGraph.Enabled = true;
        }
Exemple #3
0
        /// <summary>
        /// Nettoyage des ressources utilisées.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }

            if (this.bdaGraphBuilder != null)
            {
              this.bdaGraphBuilder.Dispose();
              this.bdaGraphBuilder = null;
            }
            }
            base.Dispose( disposing );
        }
Exemple #4
0
        /// <summary>
        /// Nettoyage des ressources utilisées.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }

                if (this.bdaGraphBuilder != null)
                {
                    this.bdaGraphBuilder.Dispose();
                    this.bdaGraphBuilder = null;
                }
            }
            base.Dispose(disposing);
        }
Exemple #5
0
        private void menuDigitalTVDecomposeGraph_Click(object sender, System.EventArgs e)
        {
            this.bdaGraphBuilder.Dispose();
              this.bdaGraphBuilder = null;

              this.menuNetworkDVBT.Checked = false;
              this.menuNetworkDVBT.Enabled = true;
              this.menuNetworkDVBS.Checked = false;
              this.menuNetworkDVBS.Enabled = true;

              this.menuFileSaveGraph.Enabled = false;
              this.menuDigitalTVBuildGraph.Enabled = false;
              this.menuDigitalTVDoTuneRequest.Enabled = false;
              this.menuDigitalTVDecomposeGraph.Enabled = false;
        }
Exemple #6
0
        private void menuDigitalTVBuildGraph_Click(object sender, System.EventArgs e)
        {
            if (this.tuningSelector.TuneSelect() == true)
              {
            this.bdaGraphBuilder = new BDAGraphBuilder(this);
            this.bdaGraphBuilder.BuildGraph(this.tuningSelector.TuningSpace);
            this.bdaGraphBuilder.SubmitTuneRequest(this.tuningSelector.TuneRequest);
            this.bdaGraphBuilder.RunGraph();
              }

              this.menuDigitalTVBuildGraph.Enabled = false;
              this.menuFileSaveGraph.Enabled = true;
              this.menuDigitalTVDoTuneRequest.Enabled = true;
              this.menuDigitalTVDecomposeGraph.Enabled = true;
        }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (this.bdaGraphBuilder != null)
     {
         this.bdaGraphBuilder.Dispose();
         this.bdaGraphBuilder = null;
     }
 }
        private void buttonCapture_Click(object sender, RoutedEventArgs e)
        {
            _extractFolder = txtTsLocation.Text;

            if (Directory.Exists(_extractFolder))
            {
                if (Properties.Settings.Default.ExtractDirectory != _extractFolder)
                {
                    Properties.Settings.Default.ExtractDirectory = _extractFolder;
                    Properties.Settings.Default.Save();
                }

                txtTsLocation.IsEnabled = false;
                buttonBrowse.IsEnabled = false;

                // List already downloaded items
                DirectoryInfo extractDir = new DirectoryInfo(_extractFolder);

                foreach (DirectoryInfo fwFolder in extractDir.EnumerateDirectories())
                {
                    FirmwareFile fwFile = new FirmwareFile(fwFolder.FullName);

                    CompletedFiles.Add(string.Format("{0:X2}-{1:X2}-{2:X2}", fwFile.VendorId, fwFile.ModelId, fwFile.VersionId), fwFile);
                    CompletedFileList.Add(fwFile);
                }

                timer.Interval = new TimeSpan(0, 0, 1);
                timer.Tick += new EventHandler(timer_Tick);
                timer.Start();

                try
                {
                    // Start BDA Capture
                    int hr = 0;
                    IDVBSTuningSpace tuningSpace;

                    tuningSpace = (IDVBSTuningSpace)new DVBSTuningSpace();
                    hr = tuningSpace.put_UniqueName("DVBS TuningSpace");
                    hr = tuningSpace.put_FriendlyName("DVBS TuningSpace");
                    hr = tuningSpace.put__NetworkType(typeof(DVBSNetworkProvider).GUID);
                    hr = tuningSpace.put_SystemType(DVBSystemType.Satellite);
                    hr = tuningSpace.put_LowOscillator(9750000);
                    hr = tuningSpace.put_HighOscillator(10600000);

                    ITuneRequest tr = null;

                    hr = tuningSpace.CreateTuneRequest(out tr);
                    DsError.ThrowExceptionForHR(hr);

                    IDVBTuneRequest tuneRequest = (IDVBTuneRequest)tr;

                    hr = tuneRequest.put_ONID(2);
                    hr = tuneRequest.put_TSID(2004);
                    hr = tuneRequest.put_SID(4190);

                    IDVBSLocator locator = (IDVBSLocator)new DVBSLocator();
                    hr = locator.put_CarrierFrequency(11778000);
                    hr = locator.put_SymbolRate(27500000);
                    hr = locator.put_Modulation(ModulationType.ModQpsk);
                    hr = (locator as IDVBSLocator).put_SignalPolarisation(Polarisation.LinearV);
                    hr = (locator as IDVBSLocator).put_InnerFEC(FECMethod.Viterbi);
                    hr = (locator as IDVBSLocator).put_InnerFECRate(BinaryConvolutionCodeRate.Rate2_3);
                    hr = (locator as IDVBSLocator).put_OuterFEC(FECMethod.Viterbi);
                    hr = (locator as IDVBSLocator).put_OuterFECRate(BinaryConvolutionCodeRate.Rate2_3);

                    hr = tr.put_Locator(locator as ILocator);
                    Marshal.ReleaseComObject(locator);

                    this.bdaGraphBuilder = new BDAGraphBuilder();
                    this.bdaGraphBuilder.BuildGraph(tuningSpace);
                    this.bdaGraphBuilder.SubmitTuneRequest(tr);

                    // We have to do this to make it actually tune!
                    this.bdaGraphBuilder.RunGraph();
                    this.bdaGraphBuilder.StopGraph();

                    TsGrabber grabber = new TsGrabber();
                    grabber.Callback = new TsGrabber.ProcessBufferDelegate(ProcessBuffer);

                    this.bdaGraphBuilder.SetUpForTs(grabber, 1);

                    this.bdaGraphBuilder.RunGraph();

                    this.buttonCapture.IsEnabled = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error connecting to DVB-S:\n{0}", ex), "Connection error", MessageBoxButton.OK, MessageBoxImage.Error);
                    Close();
                }
            }
            else
            {
                MessageBox.Show("Cannot find extract directory specified!");
            }
        }