public static SoundVolume SoundVolume(AudioSource target, float duration, bool scaledTime = true) { Debug.Assert(target.gameObject.activeInHierarchy, "game object must be active : " + target.name); var soundVolume = new SoundVolume(target, duration, scaledTime: scaledTime); return(soundVolume); }
private async void SetVolumeInfoBtn_Clicked(object sender, EventArgs e) { try { Log.Debug(Globals.LogTag, "Set call volume info start"); var actionDev = await DisplayActionSheet("Device", "Cancel", null, Enum.GetNames(typeof(SoundDevice))); var actionType = await DisplayActionSheet("Type", "Cancel", null, Enum.GetNames(typeof(SoundType))); var actionVolume = await DisplayActionSheet("Volume", "Cancel", null, Enum.GetNames(typeof(SoundVolume))); Log.Debug(Globals.LogTag, "Action: Device = " + actionDev + ", type = " + actionType + ", Volume = " + actionVolume); if (actionDev != null && actionType != null && actionVolume != null) { SoundDevice device = (SoundDevice)Enum.Parse(typeof(SoundDevice), actionDev); SoundType type = (SoundType)Enum.Parse(typeof(SoundType), actionType); SoundVolume volume = (SoundVolume)Enum.Parse(typeof(SoundVolume), actionVolume); CallVolumeRecord volumeRecord = new CallVolumeRecord(device, type, volume); await call.SetCallVolumeInfo(volumeRecord); Log.Debug(Globals.LogTag, "Set call volume info ends with success"); } } catch (Exception ex) { Log.Debug(Globals.LogTag, "Set call volume info ,exception = " + ex.ToString()); } }
/// <summary> /// Get Sound /// </summary> protected void GetSound() { uint dwVolume = 0; SoundVolume.GetSoundVolume(ref dwVolume); this.lbsound.Text = "The Volume is : " + dwVolume.ToString(); }
/// <summary> /// Set Sound /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tbsound_ValueChanged(object sender, EventArgs e) { uint oriVolume = (uint)(0xFFFF * 1.0 * (this.tbsound.Value / 6.0)); SoundVolume.SetSoundVolume(oriVolume); GetSound(); SoundPlayer.PlayWAV(SoundOK); }
private void LoadSoundVolume() { soundVolume = new SoundVolume(); if (PlayerPrefs.HasKey("volume")) { soundVolume.volume = PlayerPrefs.GetFloat("volume"); } }
void EnforceVolumePref(SoundVolume soundVolume) { string audioMixerParameter = Options.AudioMixerParameterBySoundVolume[soundVolume]; AudioMixer.GetFloat(audioMixerParameter, out float currentVolume); float x = PlayerPrefs.GetFloat(audioMixerParameter, 7f); AudioMixer.SetFloat(audioMixerParameter, Mathf.Log10(MyMethods.ConvertValueFromOldScaleToNewScale(x, 0, 15, 0.0001f, 1f)) * 20); }
public SoundConfig(SoundVolume volume) { InitializeComponent(); this.soundVolume.Value = (int)(volume.master * 100); this.pulse1Volume.Value = (int)(volume.square1 * 100); this.pulse2Volume.Value = (int)(volume.square2 * 100); this.triangleVolume.Value = (int)(volume.triangle * 100); this.noiseVolume.Value = (int)(volume.noise * 100); this.dmcVolume.Value = (int)(volume.dmc * 100); this.externalVolume.Value = (int)(volume.external * 100); }
void ISoundVolumeController.Put(SoundVolume value) { if (value == null) { throw new ArgumentException(); } _master.Value = value.Master; _bgm.Value = value.BGM; _se.Value = value.SE; _voice.Value = value.Voice; }
public void Reload() { if (this.Ammo != this.MagazineSize && this.Reloading != true) { Sound sound = SoundHolder.GetInstance().Get(SoundIdentifier.Reload); sound.Volume = SoundVolume.GetInstance().GetVolume(); sound.Play(); this.ChangeAmmo(-this.Ammo); this.ReloadTimer.Restart(); this.Reloading = true; } }
public void Visit(Component element) { Button temp = (Button)element; if (temp.CheckText() == "<") { SoundVolume.GetInstance().ChangeVolume(-5); OurLogger.Log("Lowering volume"); } else if (temp.CheckText() == ">") { SoundVolume.GetInstance().ChangeVolume(5); OurLogger.Log("Increasing volume"); } }
/// <summary> /// Sound_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SetSound_Load(object sender, EventArgs e) { GetSound(); uint dwVolume = 0; SoundVolume.GetSoundVolume(ref dwVolume); int sound = (int)(dwVolume * 6 / 0xFFFF * 1.0); if (dwVolume > 0xFFFF) { sound = (int)(dwVolume * 6 / 0xFFFFFFFF); } this.tbsound.Value = sound; }
/// <summary> /// 将配置写入存盘文件 /// </summary> public static void SaveParam() { isDirty = false; string path = GetSavePath(); Dictionary <string, string> data = new Dictionary <string, string>(); data.Add("AntiShakeBeforeTime", AntiShakeBeforeTime.ToString()); data.Add("AntiShakeAfterTime", AntiShakeAfterTime.ToString()); data.Add("Alpha", Alpha.ToString()); data.Add("SyncDelayTime", SyncDelayTime.ToString()); data.Add("SoundVolume", SoundVolume.ToString()); data.Add("AuthorId", AuthorId); data.Add("AuthorPass", AuthorPass); Debug.Log("Save file [" + path + "]"); AppConfig.SaveConfigFile(path, data); }
public void Accept(IVisitor visitor) { if (this.ChangeTimer.ElapsedTime.AsMilliseconds() > 200) { this.ChangeTimer.Restart(); Button textCheck = (Button)children[selectedChild]; if (textCheck.CheckText() == "Settings") { //OurLogger.Log("Testing visit"); visitor.Visit(temp[tempSelected]); } if (5 <= tempSelected && tempSelected <= 6) { CompositeUI tempComposite = (CompositeUI)temp[8]; Button volumeText = (Button)tempComposite.children[0]; volumeText.SetText(SoundVolume.GetInstance().GetVolume().ToString()); } } }
public void VolumeChange(SoundVolume volumeToChange, float newValue) { PlayerPrefs.SetFloat(AudioMixerParameterBySoundVolume[volumeToChange], newValue); AudioMixer.SetFloat(AudioMixerParameterBySoundVolume[volumeToChange], Mathf.Log10(MyMethods.ConvertValueFromOldScaleToNewScale(newValue, 0, 15, 0.0001f, 1f)) * 20); }
/// <summary> /// A parameterized constructor of CallVolumeRecord. /// </summary> /// <param name="device">Call sound device.</param> /// <param name="type">Call sound type.</param> /// <param name="volume">Call sound volume.</param> public CallVolumeRecord(SoundDevice device, SoundType type, SoundVolume volume) { _device = device; _type = type; _volume = volume; }
private void WriteSettings(XmlWriter writer) { writer.WriteStartElement("Settings"); writer.WriteAttributeString("Version", 1.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteElementString("MusicDirectory", MusicDirectory); writer.WriteElementString("SoundsDirectory", SoundDirectory); writer.WriteElementString("LastDownloadLocation", LastDownloadLocation); writer.WriteStartElement("WindowLayout"); writer.WriteRaw(WindowLayout); writer.WriteEndElement(); writer.WriteStartElement("Volumes"); writer.WriteAttributeString("Overall", GlobalVolume.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("Music", MusicVolume.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("Sound", SoundVolume.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteEndElement(); writer.WriteStartElement("Network"); writer.WriteAttributeString("TcpPort", TcpPort.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("UdpPort", UdpPort.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("IPAddress", IPAddress); writer.WriteAttributeString("CheckForUpdate", CheckForUpdate ? "true" : "false"); writer.WriteAttributeString("Enabled", UseLegacyNetwork ? "true" : "false"); writer.WriteAttributeString("WebTcpPort", WebTcpPort.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("UseWebNetwork", UseWebNetwork ? "true" : "false"); writer.WriteEndElement(); RecentFiles.WriteFiles(writer); writer.WriteStartElement("Tools"); writer.WriteElementString("SoundFileEditor", SoundFileEditor); writer.WriteElementString("ExternalMusicPlayer", ExternalMusicPlayer); writer.WriteEndElement(); writer.WriteStartElement("Options"); writer.WriteAttributeString("MessageFilterLevel", MessageFilterLevel.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("ShowKeys", ShowKeysInButtons ? "true" : "false"); writer.WriteAttributeString("GlobalKeyHook", GlobalKeyHook ? "true" : "false"); writer.WriteAttributeString("OutputDevice", OutputDeviceIndex.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteEndElement(); writer.WriteStartElement("Streaming"); writer.WriteAttributeString("Active", UseStreaming ? "true" : "false"); writer.WriteAttributeString("Address", StreamingServerAddress); writer.WriteAttributeString("Port", StreamingServerPort.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("Password", StreamingPassword); writer.WriteAttributeString("Encoding", StreamingEncoder.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("StreamName", StreamingStreamName); writer.WriteAttributeString("Bitrate", StreamingBitrate.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("UserName", StreamingUserName); writer.WriteEndElement(); writer.WriteStartElement("OnlineDB"); writer.WriteAttributeString("UserId", OnlineDBUserId); writer.WriteAttributeString("DialogAfterDownload", ShowDialogAfterDownload ? "true" : "false"); writer.WriteAttributeString("DialogAfterUpload", ShowDialogAfterUpload ? "true" : "false"); writer.WriteEndElement(); writer.WriteStartElement("TagMusicFading"); writer.WriteAttributeString("FadeTime", TagMusicFadeTime.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("FadeOnlyOnChange", TagMusicFadeOnlyOnChange ? "true" : "false"); writer.WriteEndElement(); writer.WriteStartElement("Music"); writer.WriteAttributeString("PlayOnAllSpeakers", PlayMusicOnAllSpeakers ? "true" : "false"); writer.WriteAttributeString("ButtonFadeMode", ButtonMusicFadeMode.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("ButtonFadeTime", ButtonMusicFadeTime.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteEndElement(); writer.WriteStartElement("Controllers"); writer.WriteAttributeString("LocalPlayerPath", LocalPlayerPath); writer.WriteEndElement(); writer.WriteStartElement("TipOfTheDay"); writer.WriteAttributeString("ShowTip", ShowTipOfTheDay ? "true" : "false"); writer.WriteAttributeString("LastTip", LastTipOfTheDay.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteEndElement(); writer.WriteStartElement("Tpm2NetTarget"); writer.WriteAttributeString("Host", Tpm2NetTargetHost); writer.WriteAttributeString("Port", Tpm2NetTargetPort.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteEndElement(); writer.WriteEndElement(); }
private void StartEmu() { bool logState = false; if (this.cpu != null) logState = this.cpu.debug.logging; if (renderer != null) renderer.Destroy(); if (audio != null) audio.Destroy(); if (input != null) input.Destroy(); if (config["audio"] == "DXS") //DirectSound has some issues with unusual samplerates config["sampleRate"] = 48000.ToString(); try { if (Path.GetExtension(romPath).ToLower() == ".fds") this.cpu = new NESCore((SystemType)Convert.ToInt32(config["region"]), config["fdsBios"], this.romPath, this.appPath, Convert.ToInt32(this.config["sampleRate"])); else if (Path.GetExtension(romPath).ToLower() == ".nsf") this.cpu = new NESCore(this.romPath, Convert.ToInt32(this.config["sampleRate"])); else this.cpu = new NESCore((SystemType)Convert.ToInt32(config["region"]), this.romPath, this.appPath, Convert.ToInt32(this.config["sampleRate"])); } catch (BadHeaderException e) { if (MessageBox.Show("File appears to be invalid. Attempt load anyway?", "Error", MessageBoxButtons.YesNo) == DialogResult.Yes) if (Path.GetExtension(romPath).ToLower() == ".fds") this.cpu = new NESCore((SystemType)Convert.ToInt32(config["region"]), config["fdsBios"], this.romPath, this.appPath, Convert.ToInt32(this.config["sampleRate"]), true); else if (Path.GetExtension(romPath).ToLower() == ".nsf") this.cpu = new NESCore(this.romPath, Convert.ToInt32(this.config["sampleRate"]), true); else this.cpu = new NESCore((SystemType)Convert.ToInt32(config["region"]), this.romPath, this.appPath, Convert.ToInt32(this.config["sampleRate"]), true); else throw (e); } catch (FDSBiosException e) { MessageBox.Show("FDS BIOS image (" + config["fdsBios"] + ") not found."); return; } this.frame = 0; moviePtr = 0; this.saveBufferAvaliable = 0; this.cpu.debug.logging = logState; this.cpu.PPU.displayBG = (config["displayBG"] == "1"); this.cpu.PPU.displaySprites = (config["displaySprites"] == "1"); this.cpu.PPU.enforceSpriteLimit = !(config["disableSpriteLimit"] == "1"); if (config["simulatedPalette"] == "1") { NTSCFilter.gamma = double.Parse(config["gamma"]); NTSCFilter.hue = double.Parse(config["hue"]); NTSCFilter.sat = double.Parse(config["saturation"]); NTSCFilter.brightness = double.Parse(config["brightness"]); this.cpu.PPU.colorChart = NTSCFilter.NesPalette; } else { this.cpu.PPU.colorChart = this.colorChart; } if (config["rawNESPalette"] == "1") { for (uint i = 0; i < 0x200; i++) this.cpu.PPU.colorChart[i] = i; } this.cpu.APU.mute = !(config["sound"] == "1"); this.cpu.APU.volume = volume; this.LoadGame(); this.LoadSaveStateFiles(); this.cpu.gameGenieCodeNum = this.gameGenieCodeCount; this.cpu.gameGenieCodes = this.gameGenieCodes; this.Text = this.cpu.rom.fileName + " - Emu-o-Tron"; this.state = SystemState.Playing; this.surfaceControl.Visible = true; if (this.cpu.rom.vsUnisystem) { this.state = SystemState.SystemPause; DipDialog DipDiag = new DipDialog(); DipDiag.FormClosing += new FormClosingEventHandler(DipDiag_FormClosing); DipDiag.ShowDialog(); } if (debugger != null) debugger.Close(); debugger = new Debugger(cpu.debug); debugger.UpdateDebug(); ejectDiskToolStripMenuItem.DropDownItems.Clear(); ejectDiskToolStripMenuItem.Text = "Eject Disk"; ejectDiskToolStripMenuItem.Visible = (cpu.GetSideCount() != 0); cpu.SetControllers((ControllerType)Enum.Parse(typeof(ControllerType), config["portOne"]), (ControllerType)Enum.Parse(typeof(ControllerType), config["portTwo"]), (ControllerType)Enum.Parse(typeof(ControllerType), config["expansion"]), config["fourScore"] == "1", config["filterIllegalInput"] == "1"); if (cpu.nsfPlayer) nsfScreen = new NSFScreen(cpu); switch (config["renderer"]) { #if NO_DX default: case "GDI": config["renderer"] = "GDI"; renderer = new GDIRenderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked); break; #else case "GDI": renderer = new GDIRenderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked); break; default: case "DX9": config["renderer"] = "DX9"; renderer = new DX9Renderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked); break; case "DX10": renderer = new DX10Renderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked); break; #endif case "OGL": renderer = new OpenGLRenderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked); break; case "Null": renderer = new NullRenderer(); break; } renderer.DrawMessageEvent += new EventHandler(renderer_DrawMessageEvent); renderer.Create(); switch (config["audio"]) { case "OAL": audio = new OpenALAudio(cpu.APU.sampleRate, cpu.APU.output, Convert.ToInt32(config["volume"]) / 100f); break; #if NO_DX default: case "Null": config["audio"] = "Null"; audio = new NullAudio(cpu.APU.sampleRate); break; #else default: case "XA2": config["audio"] = "XA2"; audio = new XA2Audio(cpu.APU.sampleRate, cpu.APU.output, Convert.ToInt32(config["volume"]) / 100f); break; case "DXS": audio = new DXSAudio(cpu.APU.sampleRate, cpu.APU.output, Convert.ToInt32(config["volume"]) / 100f, this.Handle); break; case "Null": audio = new NullAudio(cpu.APU.sampleRate); break; #endif } audio.Create(); switch (config["input"]) { default: case "Win": config["input"] = "Win"; input = new WinInput(this, surfaceControl); break; #if !NO_DX case "DX": input = new DXInput(this); break; case "XIn": input = new XInInput(); break; #endif case "Null": input = new NullInput(); break; } input.Create(); input.InputEvent += new InputHandler(input_InputEvent); input.InputScalerEvent += new InputScalerHandler(input_InputScalerEvent); }
private void OnEnable() { volumeSave = SoundUtility.Volume; }
/// <summary> /// 設定保存 /// </summary> private void Save() { volumeSave = SoundUtility.Volume; }
public void MakeSound(SoundVolume volume) { _soundModule.MakeSound(volume.Db); }
public LiveVideoPlayerControlViewModel( HohoemaApp hohoemaApp, PageManager pageManager, TextInputDialogService textInputDialogService, ToastNotificationService toast ) : base(hohoemaApp, pageManager, canActivateBackgroundUpdate: true) { _TextInputDialogService = textInputDialogService; _ToastNotificationService = toast; MediaPlayer = HohoemaApp.MediaPlayer; // play CurrentState = new ReactiveProperty <MediaElementState>(); NowPlaying = CurrentState.Select(x => x == MediaElementState.Playing) .ToReactiveProperty(); NowUpdating = new ReactiveProperty <bool>(false); LivePlayerType = new ReactiveProperty <Models.Live.LivePlayerType?>(); CanChangeQuality = new ReactiveProperty <bool>(false); RequestQuality = new ReactiveProperty <string>(); CurrentQuality = new ReactiveProperty <string>(); IsAvailableSuperLowQuality = new ReactiveProperty <bool>(false); IsAvailableLowQuality = new ReactiveProperty <bool>(false); IsAvailableNormalQuality = new ReactiveProperty <bool>(false); IsAvailableHighQuality = new ReactiveProperty <bool>(false); ChangeQualityCommand = new DelegateCommand <string>( (quality) => { NicoLiveVideo.ChangeQualityRequest(quality).ConfigureAwait(false); HohoemaApp.UserSettings.PlayerSettings.DefaultLiveQuality = quality; HohoemaApp.UserSettings.PlayerSettings.Save().ConfigureAwait(false); }, (quality) => NicoLiveVideo.Qualities.Any(x => x == quality) ); IsVisibleComment = new ReactiveProperty <bool>(PlayerWindowUIDispatcherScheduler, true).AddTo(_CompositeDisposable); CommentCanvasHeight = new ReactiveProperty <double>(PlayerWindowUIDispatcherScheduler, 0.0).AddTo(_CompositeDisposable); CommentDefaultColor = new ReactiveProperty <Color>(PlayerWindowUIDispatcherScheduler, Colors.White).AddTo(_CompositeDisposable); CommentOpacity = HohoemaApp.UserSettings.PlayerSettings.ObserveProperty(x => x.CommentOpacity) .Select(x => x.ToOpacity()) .ToReadOnlyReactiveProperty(eventScheduler: PlayerWindowUIDispatcherScheduler); // post comment WritingComment = new ReactiveProperty <string>(PlayerWindowUIDispatcherScheduler, "").AddTo(_CompositeDisposable); NowCommentWriting = new ReactiveProperty <bool>(PlayerWindowUIDispatcherScheduler).AddTo(_CompositeDisposable); NowSubmittingComment = new ReactiveProperty <bool>(PlayerWindowUIDispatcherScheduler).AddTo(_CompositeDisposable); // TODO: ニコ生での匿名コメント設定 CommandString = new ReactiveProperty <string>(PlayerWindowUIDispatcherScheduler, "").AddTo(_CompositeDisposable); CommandEditerVM = new CommentCommandEditerViewModel(true /* isDefaultAnnonymous */); CommandEditerVM.OnCommandChanged += CommandEditerVM_OnCommandChanged; CommandEditerVM.ChangeEnableAnonymity(true); CommandEditerVM.IsAnonymousComment.Value = true; CommandEditerVM_OnCommandChanged(); CommentSubmitCommand = Observable.CombineLatest( WritingComment.Select(x => !string.IsNullOrEmpty(x)), NowSubmittingComment.Select(x => !x) ) .Select(x => x.All(y => y)) .ToReactiveCommand(PlayerWindowUIDispatcherScheduler) .AddTo(_CompositeDisposable); CommentSubmitCommand.Subscribe(async x => { if (NicoLiveVideo != null) { NowSubmittingComment.Value = true; await NicoLiveVideo.PostComment(WritingComment.Value, CommandString.Value, LiveElapsedTime); } }); // operation command PermanentDisplayText = new ReactiveProperty <string>(PlayerWindowUIDispatcherScheduler, "").AddTo(_CompositeDisposable); // sound IsFullScreen = new ReactiveProperty <bool>(PlayerWindowUIDispatcherScheduler, false).AddTo(_CompositeDisposable); IsFullScreen .Subscribe(isFullScreen => { var appView = ApplicationView.GetForCurrentView(); if (isFullScreen) { if (!appView.TryEnterFullScreenMode()) { IsFullScreen.Value = false; } } else { appView.ExitFullScreenMode(); } }) .AddTo(_CompositeDisposable); IsSmallWindowModeEnable = HohoemaApp.Playlist .ToReactivePropertyAsSynchronized(x => x.IsPlayerFloatingModeEnable); IsAutoHideEnable = Observable.CombineLatest( NowPlaying , NowCommentWriting.Select(x => !x) ) .Select(x => x.All(y => y)) .ToReactiveProperty(PlayerWindowUIDispatcherScheduler) .AddTo(_CompositeDisposable); Suggestion = new ReactiveProperty <LiveSuggestion>(); HasSuggestion = Suggestion.Select(x => x != null) .ToReactiveProperty(); AutoHideDelayTime = HohoemaApp.UserSettings.PlayerSettings .ToReactivePropertyAsSynchronized(x => x.AutoHidePlayerControlUIPreventTime, PlayerWindowUIDispatcherScheduler) .AddTo(_CompositeDisposable); IsDisplayControlUI = HohoemaApp.Playlist.ToReactivePropertyAsSynchronized(x => x.IsDisplayPlayerControlUI); IsMuted = HohoemaApp.UserSettings.PlayerSettings .ToReactivePropertyAsSynchronized(x => x.IsMute, PlayerWindowUIDispatcherScheduler) .AddTo(_CompositeDisposable); IsMuted.Subscribe(isMuted => { MediaPlayer.IsMuted = isMuted; }) .AddTo(_CompositeDisposable); SoundVolume = HohoemaApp.UserSettings.PlayerSettings .ToReactivePropertyAsSynchronized(x => x.SoundVolume, PlayerWindowUIDispatcherScheduler) .AddTo(_CompositeDisposable); SoundVolume.Subscribe(volume => { MediaPlayer.Volume = volume; }) .AddTo(_CompositeDisposable); CommentUpdateInterval = HohoemaApp.UserSettings.PlayerSettings.ObserveProperty(x => x.CommentRenderingFPS) .Select(x => TimeSpan.FromSeconds(1.0 / x)) .ToReactiveProperty() .AddTo(_CompositeDisposable); RequestCommentDisplayDuration = HohoemaApp.UserSettings.PlayerSettings .ObserveProperty(x => x.CommentDisplayDuration) .ToReactiveProperty(PlayerWindowUIDispatcherScheduler) .AddTo(_CompositeDisposable); CommentFontScale = HohoemaApp.UserSettings.PlayerSettings .ObserveProperty(x => x.DefaultCommentFontScale) .ToReactiveProperty(PlayerWindowUIDispatcherScheduler) .AddTo(_CompositeDisposable); IsForceLandscape = new ReactiveProperty <bool>(PlayerWindowUIDispatcherScheduler, HohoemaApp.UserSettings.PlayerSettings.IsForceLandscape); IsStillLoggedInTwitter = new ReactiveProperty <bool>(!TwitterHelper.IsLoggedIn) .AddTo(_CompositeDisposable); }