Exemple #1
0
        void m_Timer_Elapsed(object sender, MyTimerElapsedEventArgs e)
        {
            if ((null == m_RecorderViewModel) || (!m_RecorderViewModel.IsStarted))
            {
                return;
            }

            this.CurrentNoise = m_RecorderViewModel.GetAmplitude();
            base.RaisePropertyChanged(() => this.CurrentNoise);

            if (null != PeriodicNotifications)
            {
                PeriodicNotifications(this, this.CurrentNoise);
            }
        }
Exemple #2
0
        private void m_PhoneTimer_Elapsed(object sender, MyTimerElapsedEventArgs e)
        {
            if (!this.CanStart)
            {
                this.Stop(); return;
            }


            if ((null != m_AudioRecorderViewModel) && (m_AudioRecorderViewModel.IsStarted) && (m_AudioRecorderViewModel.GetAmplitude() >= m_Settings.NoiseLevel) && (m_CallNumber.CanDial()))
            {
                m_AudioRecorderViewModel.Stop();
                // this.m_Speaker.Turn(this.m_Settings.UseSpeakerEnabled, this.m_Settings.CallType); //TODO: activate me in future
                this.m_CallNumber.Dial();
            }
            else
            {
                m_AudioRecorderViewModel.Start();
                this.m_PhoneTimer.Start();
            }
        }