private void OnSoundChanged() { if (SoundChanged != null) { SoundChanged.Invoke(this, EventArgs.Empty); } }
public void LoadSound(FmodSystem system, string filename) { SoundChanged?.Invoke(this, EventArgs.Empty); new Thread(() => { using (var sound = system.CreateSound(filename, Mode.Default)) WaveformPathFactory.Create(sound, out _maxPeakPath, out _avgPeakPath); Invoke(new Action(RefreshBrushes)); }).Start(); }
/// <summary> /// Default class constructor. /// </summary> public Settings() { _service = DependencyService.Get <ISettings>(); _service.LocaleChanged += (s, e) => { LocaleChanged?.Invoke(s, e); }; _service.UserSettingsChanged += (s, e) => { UserSettingsChanged?.Invoke(s, e); }; _service.FontChanged += (s, e) => { FontChanged?.Invoke(s, e); }; _service.SoundChanged += (s, e) => { SoundChanged?.Invoke(s, e); }; _service.OtherChanged += (s, e) => { OtherChanged?.Invoke(s, e); }; _service.StartListening(); }
/// <summary> /// Starts observing system settings for changes. /// </summary> /// <remarks> /// System settings events will be never invoked before calling this method. /// </remarks> public void StartListening() { SystemSettings.LocaleCountryChanged += (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); }; SystemSettings.LocaleLanguageChanged += (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); }; SystemSettings.LocaleTimeFormat24HourSettingChanged += (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); }; SystemSettings.LocaleTimeZoneChanged += (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); }; try { SystemSettings.IncomingCallRingtoneChanged += (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); }; } catch (NotSupportedException e) { Log.Warn("SystemInfo", e.Message); } try { SystemSettings.EmailAlertRingtoneChanged += (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); }; } catch (NotSupportedException e) { Log.Warn("SystemInfo", e.Message); } try { SystemSettings.WallpaperHomeScreenChanged += (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); }; } catch (NotSupportedException e) { Log.Warn("SystemInfo", e.Message); } try { SystemSettings.WallpaperLockScreenChanged += (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); }; } catch (NotSupportedException e) { Log.Warn("SystemInfo", e.Message); } SystemSettings.FontSizeChanged += (s, e) => { FontChanged?.Invoke(s, new EventArgs()); }; SystemSettings.FontTypeChanged += (s, e) => { FontChanged?.Invoke(s, new EventArgs()); }; SystemSettings.SoundLockSettingChanged += (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); }; SystemSettings.SoundSilentModeSettingChanged += (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); }; SystemSettings.SoundTouchSettingChanged += (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); }; SystemSettings.SoundNotificationRepetitionPeriodChanged += (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); }; SystemSettings.DeviceNameChanged += (s, e) => { OtherChanged?.Invoke(s, new EventArgs()); }; SystemSettings.MotionSettingChanged += (s, e) => { OtherChanged?.Invoke(s, new EventArgs()); }; }
/// <summary> /// Invoked on sound lock setting change. /// </summary> /// <param name="s">Object that sent event.</param> /// <param name="e">Event parameters.</param> private void OnSoundLockSettingChanged(object s, SoundLockSettingChangedEventArgs e) { SoundChanged?.Invoke(s, new EventArgs()); }
/// <summary> /// Invoked on sound notification repetition period change. /// </summary> /// <param name="s">Object that sent event.</param> /// <param name="e">Event parameters.</param> private void OnSoundNotificationRepetitionPeriodChanged(object s, SoundNotificationRepetitionPeriodChangedEventArgs e) { SoundChanged?.Invoke(s, new EventArgs()); }
public void LoadSound(Sound sound) { SoundChanged?.Invoke(this, EventArgs.Empty); WaveformPathFactory.Create(sound, out _maxPeakPath, out _avgPeakPath); RefreshBrushes(); }