Beispiel #1
0
 /// <summary>
 /// Attempts to start the radio
 /// </summary>
 private void StartRadio()
 {
     try
     {
         if (_control != null)
         {
             _control.StartRadio();
             // once we have started, check if we need to set frequency
             if (_frequency == 0)
             {
                 return;
             }
             // set the tuning timer
             Timer timer = new Timer();
             timer.Interval = DEFAULT_INTERVAL;
             timer.Tick    += (sender, e) =>
             {
                 timer.Enabled = false;
                 TuneRadio();
             };
             timer.Enabled = true;
         }
     }
     catch (System.ApplicationException)
     {
         MessageBox.Show("Could not start the radio, is there a device connected?", "Auto Start Radio");
     }
 }
        private string Command(string command, string method, object value)
        {
            string result;

            if (string.Equals(command, "exe"))
            {
                switch (method)
                {
                case "start":
                    _control.StartRadio();
                    break;

                case "stop":
                    _control.StopRadio();
                    break;

                case "close":
                    throw new ClientException();

                default:
                    throw new MethodException(String.Format("Unknown Exe method: {0}",
                                                            method));
                }
                result = Response <object>(null, null);
            }
            else
            {
                bool set = string.Equals(command, "set");
                result = METHODS[method].Invoke(set, value);
            }

            return(result);
        }
Beispiel #3
0
 private void OnJoin(object sender, JoinMessage args)
 {
     presence.Party.Size++;
     presence.Secrets.JoinSecret = args.Secret;
     MessageBox.Show("OnJoin: " + args.Secret);
     _control.StopRadio();
     _control.RefreshSource(true);
     Utils.SaveSetting("spyserver.uri", args.Secret);
     _control.StartRadio();
 }
Beispiel #4
0
 /// <summary>
 /// Attempts to start the radio
 /// </summary>
 private void StartRadio()
 {
     try
     {
         if (_control != null)
         {
             _control.StartRadio();
         }
     }
     catch (System.ApplicationException)
     {
         MessageBox.Show("Could not start the radio, is there a device connected?", "Auto Start Radio");
     }
 }
Beispiel #5
0
        private void startStop(int pegel)
        {
            var midiEntry = new MidiEntry();

            midiEntry.Startstop = _controlInterface.IsPlaying;

            if (pegel == 127)
            {
                if (midiEntry.Startstop == true)
                {
                    _controlInterface.StopRadio();
                }
                else
                {
                    _controlInterface.StartRadio();
                }
            }
        }