Ejemplo n.º 1
0
 private void OnDeleteClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     _memoPlayerViewModel.Remove();
     StopMemoPlaying();
 }
Ejemplo n.º 2
0
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            switch (_mode)
            {
            case MainPageMode.MainView:
                base.OnBackKeyPress(e);
                break;

            case MainPageMode.MemoRecording:
                _mode = MainPageMode.MainView;
                StopMemoRecording();
                e.Cancel = true;
                break;

            case MainPageMode.MemoPlaying:
                _mode = MainPageMode.MainView;
                StopMemoPlaying();
                e.Cancel = true;
                break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
        private void OnImageManipulationStarted(object sender, ManipulationStartedEventArgs e)
        {
            BitmapImage img = new BitmapImage(new Uri(
                                                  "/Resources/Images/TryToPlay_press.png", UriKind.Relative));

            _tryToPlayImage.Source = img;

            AnniversaryViewModel viewModel = (AnniversaryViewModel)_ringtoneListPicker.DataContext;

            switch (viewModel.RingTone)
            {
            case RingTone.SchoolBell:
                SoundUtilities.Instance().Play(SoundType.SchoolBell);
                break;

            case RingTone.Chaotic:
                SoundUtilities.Instance().Play(SoundType.Chaotic);
                break;

            case RingTone.DingTone:
                SoundUtilities.Instance().Play(SoundType.DingTone);
                break;

            default:
                break;
            }

            base.OnManipulationStarted(e);
        }
Ejemplo n.º 4
0
        private void OnAboutClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            this.NavigationService.Navigate(
                new Uri("/AboutPage.xaml", UriKind.Relative));
        }
Ejemplo n.º 5
0
 private void Awake()
 {
     //------------------------------------------------------
     //Erstelle eine Instanz falls nicht vorhanden
     //------------------------------------------------------
     if (Instance == null)
     {
         Instance = this;
     }
     //------------------------------------------------------
     //Oder lösche falls diese Instanz nicht die Instanz ist
     //------------------------------------------------------
     else if (Instance != this)
     {
         Destroy(this);
     }
     //------------------------------------------------------
     //Füge eine Standartsource hinzu
     //------------------------------------------------------
     m_MustnPlay = SoundUtilities.AddSourceToObject(gameObject, false, 1.0f, false);
     //------------------------------------------------------
     //Starte Cleanup Routine
     //------------------------------------------------------
     StartCoroutine(CleanUp());
 }
Ejemplo n.º 6
0
        private void OnAlarmClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            string startTimeStr = _calendarMonthView.CurrentDay.ToLongDateString();

            this.NavigationService.Navigate(
                new Uri("/AlarmPage.xaml?StartTime=" + startTimeStr, UriKind.Relative));
        }
Ejemplo n.º 7
0
        private void OnResumeClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            _memoPlayerViewModel.Resume();
            _memoPlayerPanel.Start();

            this.ApplicationBar.Buttons.Remove(_resumeAppbarIconButton);
            this.ApplicationBar.Buttons.Insert(0, _pauseAppbarIconButton);
        }
Ejemplo n.º 8
0
        private void OnMemoClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            BeginRecorderStoryboard.Begin();

            this.ApplicationBar.Buttons.Clear();
            this.ApplicationBar.Buttons.Add(_stopAppbarIconButton);

            DisableApplicationBar();
        }
Ejemplo n.º 9
0
        private bool AssertApply()
        {
            bool ret = false;

            if (string.IsNullOrEmpty(_AnniversaryViewModel.Subject) ||
                _AnniversaryViewModel.Subject == AppResources.EnterSubjectText)
            {
                SoundUtilities.Instance().Play(SoundType.Note);
                VibrateUtilities.Instance().Vibrate(VibrateType.ShortVibrate);

                MessageBox.Show(
                    AppResources.EmptySubjectWarningText,
                    AppResources.WarningTitleText,
                    MessageBoxButton.OK
                    );
            }
            else if (_AnniversaryViewModel.AlarmOn &&
                     ((_AnniversaryViewModel.AlarmTime < DateTime.Now &&
                       _AnniversaryViewModel.RepeatType == RepeatType.NotRepeated) ||
                      _AnniversaryViewModel.ExpirationTime < DateTime.Now))
            {
                SoundUtilities.Instance().Play(SoundType.Note);
                VibrateUtilities.Instance().Vibrate(VibrateType.ShortVibrate);

                MessageBox.Show(
                    AppResources.AlarmExpiredWarningText,
                    AppResources.WarningTitleText,
                    MessageBoxButton.OK
                    );
            }
            else if (_AnniversaryViewModel.AlarmOn &&
                     _startTime.Date > _AnniversaryViewModel.ExpirationTime)
            {
                SoundUtilities.Instance().Play(SoundType.Note);
                VibrateUtilities.Instance().Vibrate(VibrateType.ShortVibrate);

                MessageBox.Show(
                    AppResources.AnniversaryExpirationWarningText,
                    AppResources.WarningTitleText,
                    MessageBoxButton.OK
                    );
            }
            else
            {
                ret = true;
            }

            return(ret);
        }
Ejemplo n.º 10
0
        private async Task SpeakAsync(string toSpeak)
        {
            if (_speechSynthesizer == null)
            {
                _speechSynthesizer = new SpeechSynthesizer();
                var voice = SpeechSynthesizer.AllVoices.Where(v => v.Gender == VoiceGender.Female && v.Language.Contains("en")).FirstOrDefault();
                if (voice != null)
                {
                    _speechSynthesizer.Voice = voice;
                }
            }
            var syntStream = await _speechSynthesizer.SynthesizeTextToStreamAsync(toSpeak);

            await SoundUtilities.PlaySound(syntStream.AsStream());
        }
Ejemplo n.º 11
0
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.VerticalVelocity > FlickVelocity)
            {
                SoundUtilities.Instance().Play(SoundType.Slipping);
                Date       = Date.AddMonths(1);
                CurrentDay = Date;
            }

            if (e.VerticalVelocity < -FlickVelocity)
            {
                SoundUtilities.Instance().Play(SoundType.Slipping);
                Date       = Date.AddMonths(-1);
                CurrentDay = Date;
            }
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Spielt einen zufälligen Clip
 /// </summary>
 /// <param name="pi_Clips">Clips</param>
 /// <param name="pi_Volume">Optional Lautstärke</param>
 /// <param name="pi_HasToPlay">Optional muss gespielt werden</param>
 private void PlayRandomSound(AudioClip[] pi_Clips, float pi_Volume = 1.0f, bool pi_HasToPlay = true)
 {
     //------------------------------------------------------
     //Falls der Sound unterbrechen darf
     //------------------------------------------------------
     if (!pi_HasToPlay)
     {
         //------------------------------------------------------
         //Spiele Sound auf der entsprechenden Quelle
         //------------------------------------------------------
         float l_OldVol = m_MustnPlay.volume;
         m_MustnPlay.volume = pi_Volume;
         SoundUtilities.PlayRandomSound(m_MustnPlay, pi_Clips);
         m_MustnPlay.volume = l_OldVol;
         return;
     }
     //------------------------------------------------------
     //Versuche eine Source zu finden die nicht benutzt wird
     //------------------------------------------------------
     foreach (AudioSource b_Source in m_AddedSources)
     {
         if (!b_Source.isPlaying)
         {
             //------------------------------------------------------
             //Spiele ggf.
             //------------------------------------------------------
             float l_OldVol = b_Source.volume;
             b_Source.volume = pi_Volume;
             SoundUtilities.PlayRandomSound(b_Source, pi_Clips);
             b_Source.volume = l_OldVol;
             return;
         }
     }
     //------------------------------------------------------
     //Füge neue Source hinzu
     //------------------------------------------------------
     m_AddedSources.Add(SoundUtilities.AddSourceToObject(gameObject, false, 1.0f, false));
     //------------------------------------------------------
     //Versuche erneut
     //------------------------------------------------------
     PlayRandomSound(pi_Clips, pi_Volume);
 }
Ejemplo n.º 13
0
 private void OnDatePickerTap(object sender, GestureEventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.CalendarPanelStart);
 }
Ejemplo n.º 14
0
        private void DoBack()
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            this.NavigationService.GoBack();
        }
Ejemplo n.º 15
0
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            base.OnBackKeyPress(e);
        }
Ejemplo n.º 16
0
 private void OnStopClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     StopMemoRecording();
 }
Ejemplo n.º 17
0
        private void OnOkClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            this.NavigationService.GoBack();
        }