Exemplo n.º 1
0
        private void RunSynch()
        {
            //Start timer
            timer.Start();

            tree.Synchronize(path, pattern, bRecursive, subroot);

            //Stop timer
            timer.Stop();
        }
Exemplo n.º 2
0
        public SoundCardSinkControl(SoundCardSink sink)
        {
            Sink = sink;
            InitializeComponent();

            DeviceInfo[] infos = Sink.GetDevices();

            foreach (DeviceInfo info in infos)
            {
                lstDevice.Items.Add(info);
            }

            lstDevice.Text = "Default";

            waveForm.ScaleUnit      = "%";
            waveForm.ScalePosMax    = 100;
            waveForm.ScalePosMin    = 0;
            waveForm.YZoomFactorMin = 0.001;
            waveForm.MaxSamples     = 400;

            BufferStatsTimer = new AccurateTimer((object sender, EventArgs e) =>
            {
                lock (waveForm)
                {
                    if (Sink.BufferSize > 0)
                    {
                        waveForm.ProcessData(((float)Sink.BufferUsage * 100.0f) / Sink.BufferSize, true);
                    }
                }
            });
            BufferStatsTimer.Interval = 100;
            BufferStatsTimer.Start();
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            treeView1.Nodes.Clear();
            timer.Start();

            thread = new Thread(new ThreadStart(Synchronize));
            thread.Start();
        }
Exemplo n.º 4
0
        private void StartRead()
        {
            StartThreads();

            lock (Lock)
            {
                USBRXDeviceNative.ResetEpFifo(DevNum);
                USBRXDeviceNative.UsbSetGPIFMode(DevNum);
            }
            ReadTimerLocked = false;
            ReadTimer.Start();

            lock (ReadTimerLock)
            {
                Monitor.Pulse(ReadTimerLock);
            }
        }
Exemplo n.º 5
0
        public DirectXWaterfallFFTDisplay()
        {
            InitializeComponent();

            FpsUpdateTimer          = new AccurateTimer();
            FpsUpdateTimer.Interval = 1000;
            FpsUpdateTimer.Timer   += FpsUpdateTimer_Timer;
            FpsUpdateTimer.Start();

            /* we work with already squared FFT values for performance reasons */
            FFTDisplay.SquaredFFTData       = true;
            WaterfallDisplay.SquaredFFTData = true;

            /* handle some actions ourselves */
            FFTDisplay.UserEventCallback       = UserEventCallbackFunc;
            WaterfallDisplay.UserEventCallback = UserEventCallbackFunc;

            /* when dragging in Y-direction in FFTDisplay, update offset */
            FFTDisplay.EventActions[eUserEvent.MouseDragY]      = eUserAction.YOffset;
            FFTDisplay.EventActions[eUserEvent.MouseDragYShift] = eUserAction.YOffset;

            /* when zooming in X direction in FFTDisplay, update waterfall view also */
            FFTDisplay.EventActions[eUserEvent.MouseWheelUpShift]   = eUserAction.UserCallback;
            FFTDisplay.EventActions[eUserEvent.MouseWheelDownShift] = eUserAction.UserCallback;

            /* to force "show cursor" in other graph */
            AddUserEventCallback(eUserEvent.MouseEnter);
            AddUserEventCallback(eUserEvent.MouseLeave);

            /* when dragging, drag other view also */
            AddUserEventCallback(eUserEvent.MouseDragX);
            AddUserEventCallback(eUserEvent.MouseDragXShift);

            /* when zooming in? */
            //FFTDisplay.EventActions[eUserEvent.MouseWheelUp] = eUserAction.UserCallback;
            //FFTDisplay.EventActions[eUserEvent.MouseWheelDown] = eUserAction.UserCallback;

            /* configure update speed */
            //WaterfallDisplay.EventActions[eUserEvent.MouseWheelUpAlt] = eUserAction.UserCallback;
            //WaterfallDisplay.EventActions[eUserEvent.MouseWheelDownAlt] = eUserAction.UserCallback;
        }
Exemplo n.º 6
0
        public FileSourceDeviceControl(string fileName, int oversampling)
        {
            InitializeComponent();

            InternalOversampling = oversampling;

            if (fileName == null)
            {
                FileDialog dlg = new OpenFileDialog();

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    fileName = dlg.FileName;
                }
            }

            Timer          = new AccurateTimer();
            Timer.Periodic = true;
            Timer.Timer   += new EventHandler(Timer_Timer);

            if (fileName != null)
            {
                FileName = fileName;
                Source   = new FileSampleSource(FileName, InternalOversampling);
                Source.ForwardEnabled  = true;
                Source.SamplesPerBlock = (int)Math.Min(ReadFrameRate * Source.InputSamplingRate, 32768);

                trackBar.Maximum = (int)(Source.GetTotalTime() / 0.01f);

                if (trackBar.Maximum < 0)
                {
                    trackBar.Maximum = int.MaxValue;
                }

                Timer.Interval = (uint)((double)(Source.OutputBlockSize * 1000.0f) / Source.OutputSamplingRate);

                UpdateDisplay();
                Timer.Start();
            }
        }
Exemplo n.º 7
0
        public void LoadFile(string fileName)
        {
            try
            {
                /* try to open the file */
                FileSampleSource source = new FileSampleSource(fileName);
                source.ForwardEnabled  = true;
                source.SamplesPerBlock = (int)(ReadFrameRate * source.OutputSamplingRate);

                /* succeeded, use this filesource */
                lock (AccessLock)
                {
                    eTransferMode lastMode = TransferMode;

                    TransferMode = eTransferMode.Stopped;
                    Source.Close();
                    FileName     = fileName;
                    Source       = source;
                    TransferMode = lastMode;

                    /* update trackbar */
                    trackBar.Maximum = (int)(Source.GetTotalTime() / 0.01f);

                    /* reconfigure timer */
                    Timer.Stop();
                    Timer.Interval = (uint)((double)(Source.OutputBlockSize * 1000.0f) / Source.InputSamplingRate);
                    Timer.Start();
                }
                UpdateDisplay();
            }
            catch (InvalidDataException ex)
            {
                MessageBox.Show("File format not supported. (" + ex.Message + ")");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Could not open the file. (" + ex.Message + ")");
            }
        }