Ejemplo n.º 1
0
        private void RestartStationController()
        {
            IPAddress ip;
            int       localport;
            int       remoteport;

            bool ipsuccess = IPAddress.TryParse(tbxIP.Text, out ip);

            if (!ipsuccess)
            {
                MessageBox.Show("Invalid IP");
                return;
            }
            bool localsuccess = int.TryParse(tbxLocalPort.Text, out localport);

            if (!localsuccess)
            {
                MessageBox.Show("Invalid local port");
                return;
            }
            bool remotesuccess = int.TryParse(tbxRemotePort.Text, out remoteport);

            if (!remotesuccess)
            {
                MessageBox.Show("Invalid remote port");
                return;
            }
            sc = new StationController(ip, localport, remoteport);
        }
Ejemplo n.º 2
0
 public MusicAnalyzer(StationController sc)
 {
     this.sc             = sc;
     this.color          = new Color(255, 255, 255);
     _fft                = new float[1024];
     _hanctr             = 0;
     _t                  = new DispatcherTimer();
     _t.Tick            += _t_Tick;
     _t.Interval         = TimeSpan.FromMilliseconds(5); //25 -> 40hz refresh rate
     _t.IsEnabled        = false;
     _process            = new WASAPIPROC(Process);
     spectrumdata        = new List <byte>();
     spectrumdataHistory = new List <List <byte> >();
     _devicelist         = new List <AudioDevice>();
     _initialized        = false;
     Init();
 }