private void OnDeleteClick(object sender, EventArgs e) { SoundUtilities.Instance().Play(SoundType.AppbarClicked); _mode = MainPageMode.MainView; _memoPlayerViewModel.Remove(); StopMemoPlaying(); }
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; } }
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); }
private void OnAboutClick(object sender, EventArgs e) { SoundUtilities.Instance().Play(SoundType.AppbarClicked); this.NavigationService.Navigate( new Uri("/AboutPage.xaml", UriKind.Relative)); }
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()); }
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)); }
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); }
private void OnMemoClick(object sender, EventArgs e) { SoundUtilities.Instance().Play(SoundType.AppbarClicked); BeginRecorderStoryboard.Begin(); this.ApplicationBar.Buttons.Clear(); this.ApplicationBar.Buttons.Add(_stopAppbarIconButton); DisableApplicationBar(); }
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); }
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()); }
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; } }
/// <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); }
private void OnDatePickerTap(object sender, GestureEventArgs e) { SoundUtilities.Instance().Play(SoundType.CalendarPanelStart); }
private void DoBack() { SoundUtilities.Instance().Play(SoundType.AppbarClicked); this.NavigationService.GoBack(); }
protected override void OnBackKeyPress(CancelEventArgs e) { SoundUtilities.Instance().Play(SoundType.AppbarClicked); base.OnBackKeyPress(e); }
private void OnStopClick(object sender, EventArgs e) { SoundUtilities.Instance().Play(SoundType.AppbarClicked); _mode = MainPageMode.MainView; StopMemoRecording(); }
private void OnOkClick(object sender, EventArgs e) { SoundUtilities.Instance().Play(SoundType.AppbarClicked); this.NavigationService.GoBack(); }