public OutgoingDistress(int interval, RtpAudioFacade rtp) { this.rtp = rtp; this.timer = new Timer(); timer.Interval = interval; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Enabled = false; this.Nature = "UNDESIGNATED"; }
public ICM411() { string uid = Guid.NewGuid().ToString(); rtp = new RtpAudioFacade(ConfSingleton.Instance.Network); try { cmdSrv = new MulticastCommandServer(uid); } catch (Exception ex) { MessageBox.Show(ex.Message, "Unable to start command server", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(0); } cmdDispatcher = new CommandDispatcher(uid); aisReg = new AISRegistry(cmdSrv); outgoingDistress = new OutgoingDistress(rtp); groupAddresses = new AddressRecordCollection(); indvAddresses = new AddressRecordCollection(); deferredChanChangeTimer = new Timer(); deferredChanChangeTimer.Interval = 1000; deferredChanChangeTimer.Enabled = false; deferredChanChangeTimer.Tick += new EventHandler(deferredChanChangeTimer_Tick); dscEnvelope = new DscEnvelope(); outgoingDistress.DistressEnded += new EventHandler(outgoingDistress_DistressEnded); outgoingDistress.DistressStarted += new EventHandler(outgoingDistress_DistressStarted); outgoingDistress.TimeToSendDistress += new EventHandler<TimeToSendDistressEventArgs>(outgoingDistress_TimeToSendDistress); InitializeComponent(); try { rtp.SetVoiceDevices(this); } catch (Exception) { //MessageBox.Show(String.Format("Unable to initialise sound hardware. This may be because there isn't a physical output device present.{0}{1}", Environment.NewLine + Environment.NewLine, e.InnerException != null ? e.InnerException.Message : e.Message), "DirectSound error", MessageBoxButtons.OK, MessageBoxIcon.Error); notifyIcon.ShowBalloonTip(4000, "Unable to initialise sound hardware", "This may be because there is no physical output device connected.", ToolTipIcon.Error); } }
public OutgoingDistress(RtpAudioFacade rtp) : this(DEFAULT_INTERVAL, rtp) { }