public void backupConfig(LinearConfig linearConfig) { ConfigForm configForm = LinearGlobal.MainForm.ConfigForm; // フェード持続時間 linearConfig.SoundConfig.FadeDuration = (float)configForm.numudFadeDuration.Value; }
public static void Linear <T>(DependencyObject target, DependencyProperty property, LinearConfig <T> config, Func <AnimationTimeline> createTimeline) { var animation = createTimeline(); if (config.CallBack != null) { animation.Completed += (sender, e) => { config.CallBack(); }; } var animatable = target as IAnimatable; if (animatable != null) { AnimationClock clock = animation.CreateClock(); animatable.ApplyAnimationClock(property, clock); } else { Storyboard.SetTarget(animation, target); Storyboard.SetTargetProperty(animation, new PropertyPath(property)); Storyboard storyboard = new Storyboard(); storyboard.Children.Add(animation); storyboard.Begin(); } }
public static void Linear(DependencyObject target, DependencyProperty property, LinearConfig <double> config) { Linear <double>(target, property, config, () => { EasingFunctionBase easeFunction = new PowerEase() { EasingMode = config.EasingMode, Power = EasingPower }; DoubleAnimation animation = new DoubleAnimation(); animation.From = config.Start; animation.To = config.End; animation.Duration = new Duration(TimeSpan.FromMilliseconds(config.DurationMilliseconds)); animation.EasingFunction = easeFunction; return(animation); }); }
/// <summary> /// 設定を復元 /// </summary> public void restoreConfig(LinearConfig linearConfig) { // 設定画面の位置およびサイズ復元 this.Location = linearConfig.ViewConfig.ConfigLocation; //this.Size = linearConfig.ViewConfig.ConfigSize; this.Size = new Size(408, 405); this.checkResumePlay.Checked = linearConfig.PlayerConfig.ResumePlay; this.checkAutoUpdate.Checked = linearConfig.PlayerConfig.IsAutoUpdate; this.txtExclusionKeywords.Text = String.Join(",", linearConfig.PlayerConfig.ExclusionKeywords); this.txtTitleTemplete.Text = linearConfig.ViewConfig.TitleTemplete; this.checkTitleCentering.Checked = linearConfig.ViewConfig.isTitleCentering; this.checkNotificationWindow.Checked = linearConfig.ViewConfig.isNotificationWindow; this.checkSlidePIP.Checked = linearConfig.ViewConfig.isSlidePIP; this.checkRandomStyle.Checked = linearConfig.PlayerConfig.isRandomStyleSelect; this.checkGetNetworkArtwork.Checked = linearConfig.ViewConfig.isGetNetworkArtwork; this.checkAlbumAutoRename.Checked = linearConfig.PlayerConfig.isAlbumAutoRename; this.checkSoundNormalize.Checked = linearConfig.SoundConfig.IsVolumeNormalize; this.txtAlbumAutoRenameTemplete.Text = linearConfig.PlayerConfig.albumAutoRenameTemplete; this.txtAlbumAutoRenameTemplete.Enabled = this.checkAlbumAutoRename.Checked; this.numudPIPViewDuration.Value = (decimal)linearConfig.ViewConfig.PIPViewDuration; this.numudPlayCountUpRatio.Value = linearConfig.PlayerConfig.PlayCountUpRatio; // WEBUI設定 this.checkWEBUIEnable.Checked = linearConfig.ViewConfig.UseWebInterface; this.numWEBUIPort.Value = linearConfig.ViewConfig.WebInterfaceListenPort; numWEBUIPort.Enabled = checkWEBUIEnable.Checked; labelOpenWEBUI.Enabled = checkWEBUIEnable.Checked; comboWebUITheme.Enabled = checkWEBUIEnable.Checked; comboWebUITheme.Items.Clear(); var filePaths = FileUtils.getFilePathList( Application.StartupPath + LinearConst.WEB_DIRECTORY_NAME + "ui", SearchOption.TopDirectoryOnly); foreach (string path in filePaths) { comboWebUITheme.Items.Add( Path.GetFileNameWithoutExtension(path)); } comboWebUITheme.SelectedIndex = comboWebUITheme.FindStringExact(linearConfig.ViewConfig.WebInterfaceTheme); // フェード持続時間 this.numudFadeDuration.Value = (decimal)linearConfig.SoundConfig.FadeDuration; this.tbMiniVisualLevel.Value = linearConfig.ViewConfig.MiniVisualizationLevel; // 再生方式 if (linearConfig.EngineConfig.PlayEngine == LinearEnum.PlayEngine.FMOD) { this.radioFMOD.Checked = true; } else { this.radioBASS.Checked = true; } this.checkFontBold.Checked = linearConfig.ViewConfig.FontBold; // タイトルスクロールモード if (linearConfig.ViewConfig.TitleScrollMode == LinearEnum.TitleScrollMode.LOOP) { this.radioTitleScrollLoop.Checked = true; } else if (linearConfig.ViewConfig.TitleScrollMode == LinearEnum.TitleScrollMode.REFLECT) { this.radioTitleScrollReflect.Checked = true; } else if (linearConfig.ViewConfig.TitleScrollMode == LinearEnum.TitleScrollMode.ROLL) { this.radioTitleScrollRoll.Checked = true; } else { this.radioTitleScrollNone.Checked = true; } // カラープロファイル選択 colorProfileList.SelectedIndex = colorProfileList.FindStringExact( LinearGlobal.LinearConfig.ViewConfig.ColorProfile); // スタイル選択 if (checkRandomStyle.Checked) { styleList.SelectedIndex = new Random().Next(0, styleList.Items.Count - 1); } else { styleList.SelectedIndex = styleList.FindStringExact(LinearGlobal.LinearConfig.ViewConfig.StyleName); } this.txtTempDirectory.Text = LinearGlobal.LinearConfig.PlayerConfig.TempDirectory; // プラグインリスト表示 List <string> excludePlugins = new List <string>(linearConfig.PlayerConfig.ExcludePlugins); foreach (var plugin in LinearGlobal.Plugins) { ListViewItem lvi = new ListViewItem(plugin.Name); lvi.SubItems.Add(plugin.Version); lvi.SubItems.Add(plugin.Author); if (!excludePlugins.Contains(plugin.Name)) { lvi.Checked = true; } listPlugin.Items.Add(lvi); } // オーディオファイル自動登録設定 this.textMoniterDir.Text = linearConfig.PlayerConfig.AudioFileAutoRegistInfo.MonitoringDirectory; this.textStorageDir.Text = linearConfig.PlayerConfig.AudioFileAutoRegistInfo.StorageDirectory; IList <string> dbList = FileUtils.getFilePathListWithExtFilter( new string[] { LinearGlobal.DatabaseDirectory }, SearchOption.AllDirectories, new string[] { ".db" }); comboTargetDatabase.Items.Clear(); comboTargetDatabase.Items.Add(""); foreach (string dbfile in dbList) { comboTargetDatabase.Items.Add( Path.GetFileNameWithoutExtension(dbfile)); } comboTargetDatabase.SelectedIndex = comboTargetDatabase.FindStringExact(linearConfig.PlayerConfig.AudioFileAutoRegistInfo.TargetDatabase); this.checkAutoRegist.Checked = linearConfig.PlayerConfig.AudioFileAutoRegistInfo.IsEnable; this.numMiniVisualLineCount.Value = linearConfig.ViewConfig.MiniVisualizationLineCount; }