// 生成と終了


        public 曲読み込みステージ()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._舞台画像 = new 舞台画像();
            this._注意文  = new 画像(@"$(Images)\LoadingStage\Caution.png");
            this._曲名画像 = new 文字列画像D2D()
            {
                フォント名     = "HGMaruGothicMPRO",
                フォントサイズpt = 70f,
                フォントの太さ   = FontWeight.Regular,
                フォントスタイル  = FontStyle.Normal,
                描画効果      = 文字列画像D2D.効果.縁取り,
                縁のサイズdpx  = 10f,
                前景色       = Color4.Black,
                背景色       = Color4.White,
                表示文字列     = Global.App.演奏譜面.譜面.Title,
            };
            this._サブタイトル画像 = new 文字列画像D2D()
            {
                フォント名     = "HGMaruGothicMPRO",
                フォントサイズpt = 45f,
                フォントの太さ   = FontWeight.Regular,
                フォントスタイル  = FontStyle.Normal,
                描画効果      = 文字列画像D2D.効果.縁取り,
                縁のサイズdpx  = 7f,
                前景色       = Color4.Black,
                背景色       = Color4.White,
                表示文字列     = Global.App.演奏譜面.譜面.Artist,
            };
            this._プレビュー画像 = new プレビュー画像();
            this._難易度     = new 難易度();

            Global.App.システムサウンド.再生する(システムサウンド種別.曲読み込みステージ_開始音);
            Global.App.システムサウンド.再生する(システムサウンド種別.曲読み込みステージ_ループBGM, ループ再生する: true);

            this._舞台画像.ぼかしと縮小を適用する(0.0);
            Global.App.アイキャッチ管理.現在のアイキャッチ.オープンする();

            this.現在のフェーズ = フェーズ.フェードイン;
        }
Exemple #2
0
        private void Next()
        {
            using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                if (IsPST)
                {
                    if (PSTFile.Length == 0)
                    {
                        MessageBox.Show("Please enter a PST file", "Zimbra Migration", MessageBoxButton.OK, MessageBoxImage.Error);
                        return;
                    }
                    else
                    if (!File.Exists(PSTFile))
                    {
                        string temp = string.Format("{0} does not exist", PSTFile);
                        MessageBox.Show(temp, "Zimbra Migration", MessageBoxButton.OK, MessageBoxImage.Error);
                        return;
                    }
                    if (isDesktop)
                    {
                        try
                        {
                            ((ConfigViewModelUDest)ViewModelPtrs[(int)ViewType.USRDEST]).DesktopLoad();
                        }
                        catch (Exception)
                        {
                            lb.SelectedIndex = 1;
                            return;
                        }
                    }
                }
                else
                if (CurrentProfileSelection == -1)
                {
                    MessageBox.Show("Please select a valid profile", "Zimbra Migration", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                lb.SelectedIndex = 3;
            }
        }
Exemple #3
0
        private void CloseTab(object source, RoutedEventArgs args)
        {
            using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                TabItem tabItem = args.OriginalSource as CloseableTabItem;

                if (tabItem != null)
                {
                    TabControl tabControl = tabItem.Parent as TabControl;
                    if (tabControl != null)
                    {
                        int accountnum = GetAcctNum((string)tabItem.Header);

                        tabControl.Items.Remove(tabItem);
                        urListView[accountnum] = null;
                        lbErrors[accountnum]   = null;
                        iTabCount--;
                    }
                }
            }
        }
Exemple #4
0
 public UsersViewModel(string username, string mappedname)
 {
     using (LogBlock logblock = Log.NotTracing()?null: new LogBlock("UsersViewModel.UsersViewModel"))
     {
         this.ObjectPickerCommand = new ActionCommand(this.ObjectPicker, () => true);
         this.UserMapCommand      = new ActionCommand(this.UserMap, () => true);
         this.AddCommand          = new ActionCommand(this.Add, () => true);
         this.RemoveCommand       = new ActionCommand(this.Remove, () => true);
         this.SaveCSVCommand      = new ActionCommand(this.SaveCSV, () => true);
         this.BackCommand         = new ActionCommand(this.Back, () => true);
         this.NextCommand         = new ActionCommand(this.Next, () => true);
         this.Username            = username;
         this.MappedName          = mappedname;
         this.OPInfo             = new ObjectPickerInfo("", "", "", "");
         this.IsProvisioned      = false;
         this.MustChangePassword = false;
         this.EnablePopButtons   = true;
         this.DomainsFilledIn    = false;
         this.CsvDelimiter       = ",";
     }
 }
Exemple #5
0
        public void Dispose()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            //this._QuickConfig画面.Dispose(); 使用時に破棄。
            this._SongNotFound.Dispose();
            this._現行化前のノード画像.Dispose();
            this._既定のノード画像.Dispose();
            this._ステージタイマー.Dispose();
            this._曲別スキルと達成率.Dispose();
            this._BPMパネル.Dispose();
            this._曲ステータスパネル.Dispose();
            this._難易度と成績.Dispose();
            this._選曲リスト.Dispose();
            this._選択曲枠ランナー.Dispose();
            this._青い線.Dispose();
            this._表示方法選択パネル.Dispose();
            this._UpdatingSoglistパネル.Dispose();
            this._システム情報.Dispose();
            this._舞台画像.Dispose();
        }
Exemple #6
0
        // 生成と終了


        public 認証ステージ()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._舞台画像           = new 舞台画像();
            this._ウィンドウ画像        = new 画像(@"$(Images)\AuthStage\UserSelectFrame.png");
            this._プレイヤーを選択してください = new 文字列画像D2D()
            {
                表示文字列     = "プレイヤーを選択してください。",
                フォントサイズpt = 30f,
                描画効果      = 文字列画像D2D.効果.ドロップシャドウ,
            };
            this._ユーザリスト = new ユーザリスト();
            this._システム情報 = new システム情報();

            Global.App.アイキャッチ管理.現在のアイキャッチ.オープンする();

            Global.App.システムサウンド.再生する(システムサウンド種別.認証ステージ_開始音);
            Global.App.システムサウンド.再生する(システムサウンド種別.認証ステージ_ループBGM, ループ再生する: true);

            this.現在のフェーズ = フェーズ.フェードイン;
        }
Exemple #7
0
        // 生成と終了


        public 起動ステージ()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            if (!Global.Options.ビュアーモードである)
            {
                // この2つを先行読み込み。残りはシステムサウンド構築フェーズにて。
                Global.App.システムサウンド.読み込む(Global.App.サウンドデバイス, システムサウンド種別.起動ステージ_開始音);
                Global.App.システムサウンド.読み込む(Global.App.サウンドデバイス, システムサウンド種別.起動ステージ_ループBGM);

                // さっそく再生。
                Global.App.システムサウンド.再生する(システムサウンド種別.起動ステージ_開始音);
                Global.App.システムサウンド.再生する(システムサウンド種別.起動ステージ_ループBGM, ループ再生する: true);
            }
            else
            {
                // ビュアーモードならシステムサウンドなし。
            }

            this._コンソールフォント = new フォント画像D2D(
                @"$(Images)\ConsoleFont20x32.png",
                @"$(Images)\ConsoleFont20x32.yaml",
                文字幅補正dpx: -6f);

            var copyrights = (AssemblyCopyrightAttribute[])Assembly.GetExecutingAssembly()
                             .GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);

            this._コンソール表示内容 = new List <string>()
            {
                $"{Application.ProductName} Release {int.Parse( Application.ProductVersion.Split( '.' ).ElementAt( 0 ) ):000} - Beats with your heart.",
                $"{copyrights[ 0 ].Copyright}",
                $"",
            };

            // 最初のフェーズへ。

            this._コンソール表示内容.Add("Boot...");
            this.現在のフェーズ = フェーズ.開始;
        }
Exemple #8
0
        // 生成と終了


        public 曲ステータスパネル()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._背景画像 = new 画像D2D(@"$(Images)\SelectStage\ScoreStatusPanel.png");

            // 色ブラシを作成。
            var dc = Global.GraphicResources.既定のD2D1DeviceContext;

            this._色 = new Dictionary <表示レーン種別, SolidColorBrush>()
            {
                { 表示レーン種別.LeftCymbal, new SolidColorBrush(dc, new Color4(0xff7b1fff)) },
                { 表示レーン種別.HiHat, new SolidColorBrush(dc, new Color4(0xffffc06a)) },
                { 表示レーン種別.Foot, new SolidColorBrush(dc, new Color4(0xffed4bff)) },
                { 表示レーン種別.Snare, new SolidColorBrush(dc, new Color4(0xff16fefc)) },
                { 表示レーン種別.Tom1, new SolidColorBrush(dc, new Color4(0xff00ff02)) },
                { 表示レーン種別.Bass, new SolidColorBrush(dc, new Color4(0xffff819b)) },
                { 表示レーン種別.Tom2, new SolidColorBrush(dc, new Color4(0xff0000ff)) },
                { 表示レーン種別.Tom3, new SolidColorBrush(dc, new Color4(0xff19a9ff)) },
                { 表示レーン種別.RightCymbal, new SolidColorBrush(dc, new Color4(0xffffb55e)) },
            };
        }
Exemple #9
0
        // =============================================================================================================
        // Helpers
        // =============================================================================================================
        public void SetupViewModelPtrs()
        {
            using (LogBlock logblock = Log.NotTracing()?null: new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                for (int i = 0; i < (int)ViewType.MAX; i++)
                {
                    ViewModelPtrs[i] = null;
                }

                ViewModelPtrs[(int)ViewType.INTRO]   = this;
                ViewModelPtrs[(int)ViewType.SVRSRC]  = m_configViewModelS;
                ViewModelPtrs[(int)ViewType.USRSRC]  = m_configViewModelU;
                ViewModelPtrs[(int)ViewType.ZDSRC]   = m_configViewModelZU;
                ViewModelPtrs[(int)ViewType.SVRDEST] = m_configViewModelSDest;
                ViewModelPtrs[(int)ViewType.USRDEST] = m_configViewModelUDest;
                ViewModelPtrs[(int)ViewType.OPTIONS] = m_optionsViewModel;
                ViewModelPtrs[(int)ViewType.USERS]   = m_usersViewModel;
                ViewModelPtrs[(int)ViewType.PUBFLDS] = m_publicfoldersViewModel;
                ViewModelPtrs[(int)ViewType.SCHED]   = m_scheduleViewModel;
                ViewModelPtrs[(int)ViewType.RESULTS] = m_resultsViewModel;
            }
        }
Exemple #10
0
        // 生成と終了


        public ドラムキットとヒットバー()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._ドラムキット画像 = new 画像D2D(@"$(Images)\PlayStage\DrumKit_and_HitBar.png");

            this._パーツ画像の矩形リスト = new Dictionary <パーツ, RectangleF>();
            this._パーツ画像の中心位置  = new Dictionary <パーツ, (float X, float Y)>();

            var 設定ファイルパス     = new VariablePath(@"$(Images)\PlayStage\DrumKit_and_HitBar.yaml");
            var yaml         = File.ReadAllText(設定ファイルパス.数なしパス);
            var deserializer = new YamlDotNet.Serialization.Deserializer();
            var yamlMap      = deserializer.Deserialize <YAMLマップ>(yaml);

            foreach (var kvp in yamlMap.RectangleList)
            {
                if (4 == kvp.Value.Length)
                {
                    this._パーツ画像の矩形リスト[kvp.Key] = new RectangleF(kvp.Value[0], kvp.Value[1], kvp.Value[2], kvp.Value[3]);
                }
            }
            foreach (var kvp in yamlMap.CenterPosition)
            {
                if (2 == kvp.Value.Length)
                {
                    this._パーツ画像の中心位置[kvp.Key] = (kvp.Value[0], kvp.Value[1]);
                }
            }

            this._振動パラメータ = new Dictionary <表示レーン種別, 振動パラメータ>();
            foreach (表示レーン種別?lane in Enum.GetValues(typeof(表示レーン種別)))
            {
                if (lane.HasValue)
                {
                    this._振動パラメータ[lane.Value] = new 振動パラメータ();
                }
            }
        }
Exemple #11
0
        // 生成と終了


        public ユーザリスト()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._ユーザパネル     = new 画像D2D(@"$(Images)\AuthStage\UserPanel.png");
            this._ユーザパネル光彩付き = new 画像D2D(@"$(Images)\AuthStage\UserPanelWithFrame.png");
            this._ユーザ肩書きパネル  = new 画像D2D(@"$(Images)\AuthStage\UserSubPanel.png");
            this._ユーザ名       = new 文字列画像D2D[Global.App.ユーザリスト.Count];
            for (int i = 0; i < this._ユーザ名.Length; i++)
            {
                this._ユーザ名[i] = new 文字列画像D2D()
                {
                    表示文字列     = Global.App.ユーザリスト[i].前,
                    フォントサイズpt = 46f,
                    描画効果      = 文字列画像D2D.効果.縁取り,
                    縁のサイズdpx  = 6f,
                    前景色       = Color4.Black,
                    背景色       = Color4.White,
                };
            }

            this._光彩アニメーションを開始する();
        }
Exemple #12
0
        // 生成と終了


        public タイトルステージ()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._舞台画像        = new 舞台画像();
            this._システム情報      = new システム情報();
            this._タイトルロゴ      = new 画像D2D(@"$(Images)\TitleLogo.png");
            this._帯ブラシ        = new SolidColorBrush(Global.GraphicResources.既定のD2D1DeviceContext, new Color4(0f, 0f, 0f, 0.8f));
            this._パッドを叩いてください = new 文字列画像D2D()
            {
                表示文字列     = "パッドを叩いてください",
                フォントサイズpt = 40f,
                描画効果      = 文字列画像D2D.効果.縁取り,
            };

            Global.App.システムサウンド.再生する(システムサウンド種別.タイトルステージ_開始音);
            Global.App.システムサウンド.再生する(システムサウンド種別.タイトルステージ_ループBGM, ループ再生する: true);

            Global.App.ログオフする();

            // 最初のフェーズへ。
            this.現在のフェーズ = フェーズ.表示;
        }
Exemple #13
0
        // 生成と終了


        public 選曲リスト()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._カーソル位置 = 4;

            this._曲リスト全体のY軸移動オフセット = 0;
            this._スクロール用カウンタ       = new 定間隔進行();

            this._選択ノードの表示オフセットdpx       = null;
            this._選択ノードの表示オフセットのストーリーボード = null;
            this._選択ノードのオフセットアニメをリセットする();

            this._既定のノード画像     = new 画像(@"$(Images)\DefaultPreviewImage.png");
            this._現行化前のノード画像   = new 画像(@"$(Images)\PreviewImageWaitForActivation.png");
            this._成績アイコン       = new 画像(@"$(Images)\SelectStage\RecordIcon.png");
            this._成績アイコンの矩形リスト = new 矩形リスト(@"$(Images)\SelectStage\RecordIcon.yaml");
            this._達成率ゲージアイコン   = new 画像(@"$(Images)\AchivementIcon.png");
            this._達成率数字画像      = new フォント画像(@"$(Images)\ParameterFont_LargeBoldItalic.png", @"$(Images)\ParameterFont_LargeBoldItalic.yaml", 文字幅補正dpx: -2f, 透明度: 0.5f);
            this._プレビュー音声      = new プレビュー音声();

            this._フォーカスリストを優先して現行化する();
        }
Exemple #14
0
        // 生成と終了


        public レーンフラッシュ()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._レーンフラッシュ画像 = new 画像(@"$(Images)\PlayStage\LaneFlush.png")
            {
                加算合成する = true
            };
            this._レーンフラッシュの矩形リスト = new 矩形リスト(@"$(Images)\PlayStage\LaneFlush.yaml");

            this._フラッシュ情報 = new Dictionary <表示レーン種別, Counter>()
            {
                { 表示レーン種別.LeftCymbal, new Counter() },
                { 表示レーン種別.HiHat, new Counter() },
                { 表示レーン種別.Foot, new Counter() },
                { 表示レーン種別.Snare, new Counter() },
                { 表示レーン種別.Tom1, new Counter() },
                { 表示レーン種別.Bass, new Counter() },
                { 表示レーン種別.Tom2, new Counter() },
                { 表示レーン種別.Tom3, new Counter() },
                { 表示レーン種別.RightCymbal, new Counter() },
            };
        }
Exemple #15
0
 public bool ValidateUsersList(bool bShowWarning)
 {
     using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
     {
         // Make sure there are no blanks or duplicates in the list; remove them if there are.
         // If we get down to no items, disable the Next button.
         for (int i = UsersList.Count - 1; i >= 0; i--)
         {
             if (UsersList[i].Username.Length == 0)
             {
                 UsersList.RemoveAt(i);
             }
             else if (isDuplicate(UsersList[i].Username, TYPE_USERNAME))
             {
                 UsersList.RemoveAt(i);
             }
             else if (UsersList[i].MappedName.Length > 0)
             {
                 if (isDuplicate(UsersList[i].MappedName, TYPE_MAPNAME))
                 {
                     UsersList.RemoveAt(i);
                 }
             }
         }
         if (UsersList.Count == 0)
         {
             if (bShowWarning)
             {
                 MessageBox.Show("Please specify a source name", "Zimbra Migration", MessageBoxButton.OK,
                                 MessageBoxImage.Warning);
             }
             EnableNext = false;
             return(false);
         }
     }
     return(true);
 }
Exemple #16
0
        public MainViewA()
        {
            // TESTPOINT_MIGRATION_LOGGING_INIT_MIGRATION_LOG_WIZARD Initializes main log for MigrationWizard
            Log.InitializeLogging(Log.Level.Trace); // <- use Trace level for startup (and swicth to Info at bottom of this method)

            using (LogBlock logblock = Log.NotTracing()?null: new LogBlock("MainViewA.MainViewA"))
            {
                Log.info("Running as administrator?", RunningAsAdministrator()?"Yes":"No");

                InitializeComponent();

                // Default is "server migration"
                Application.Current.Properties["migrationmode"] = "server";

                m_baseViewModel = new BaseViewModel();

                // Setup intro page
                Intro intro = new Intro();

                m_introViewModel            = new IntroViewModel(lbMode);
                m_introViewModel.Name       = "IntroViewModel";
                m_introViewModel.ViewTitle  = "Welcome";
                m_introViewModel.lb         = lbMode;
                m_introViewModel.isBrowser  = false;
                m_introViewModel.WelcomeMsg = intro.WelcomeMsg;
                m_introViewModel.InstallDir = intro.InstallDir;

                m_introViewModel.SetupViews(false);
                m_introViewModel.AddViews(false);

                lbMode.SelectedIndex = 0;
                DataContext          = m_introViewModel;

                // Switch back to Info log level
                m_introViewModel.SelectedLogLevelCBItem.LogLevelEnum = Log.Level.Info;
            }
        }
Exemple #17
0
        // 生成と終了


        public 選曲ステージ()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._舞台画像               = new 舞台画像(@"$(Images)\Background_Dark.jpg");
            this._システム情報             = new システム情報();
            this._UpdatingSoglistパネル = new UpdatingSoglistパネル();
            this._表示方法選択パネル          = new 表示方法選択パネル();
            this._青い線             = new 青い線();
            this._選択曲枠ランナー        = new 選択曲枠ランナー();
            this._選曲リスト           = new 選曲リスト();
            this._難易度と成績          = new 難易度と成績();
            this._難易度と成績.青い線を取得する = () => this._青い線;    // 外部依存アクションの接続
            this._曲ステータスパネル       = new 曲ステータスパネル();
            this._BPMパネル          = new BPMパネル();
            this._曲別スキルと達成率       = new 曲別スキルと達成率();
            this._ステージタイマー        = new 画像D2D(@"$(Images)\SelectStage\StageTimer.png");
            this._既定のノード画像        = new 画像D2D(@"$(Images)\DefaultPreviewImage.png");
            this._現行化前のノード画像      = new 画像D2D(@"$(Images)\PreviewImageWaitForActivation.png");
            this._SongNotFound    = new 文字列画像D2D()
            {
                表示文字列 =
                    "Song not found...\n" +
                    "Hit BDx2 (in default SPACEx2) to select song folders.",
            };
            this._QuickConfig画面 = null !; // 使用時に生成
            this._フェートアウト後のフェーズ = フェーズ.確定_選曲;

            Global.App.システムサウンド.再生する(システムサウンド種別.選曲ステージ_開始音);
            Global.App.アイキャッチ管理.現在のアイキャッチ.オープンする();
            this._導線アニメをリセットする();

            // 最初のフェーズへ。
            this.現在のフェーズ = フェーズ.フェードイン;
            this._フェーズ完了 = false;
        }
Exemple #18
0
        protected void Save()
        {
            using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                Microsoft.Win32.SaveFileDialog fDialog = new Microsoft.Win32.SaveFileDialog();
                fDialog.Filter = "Config Files|*.xml";
                if (fDialog.ShowDialog() == true)
                {
                    System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(Config));

                    System.IO.StreamWriter file = new System.IO.StreamWriter(fDialog.FileName);

                    // Populate m_config
                    PopulateConfigForSaving(isServer);

                    // Serialize m_config
                    writer.Serialize(file, m_config);

                    file.Close();

                    ((ScheduleViewModel)ViewModelPtrs[(int)ViewType.SCHED]).SetConfigFile(fDialog.FileName);
                }
            }
        }
        public virtual void Dispose()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            Global.App.システムサウンド.停止する(システムサウンド種別.ステージクリア);

            Global.App.WAV管理.すべての発声を停止する();
            Global.App.WAV管理.Dispose();

            this._プレビュー枠ブラシ.Dispose();
            this._黒マスクブラシ.Dispose();
            this._システム情報.Dispose();
            this._達成率.Dispose();
            this._曲別SKILL.Dispose();
            this._難易度.Dispose();
            this._ランク.Dispose();
            this._演奏パラメータ結果.Dispose();
            this._サブタイトル画像.Dispose();
            this._曲名画像.Dispose();
            this._曲名パネル.Dispose();
            this._現行化前のノード画像.Dispose();
            this._既定のノード画像.Dispose();
            this._背景.Dispose();
        }
Exemple #20
0
        private void Application_Exit(object sender, ExitEventArgs e)
        {
            using (LogBlock logblock = Log.NotTracing()?null: new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                CSMigrationWrapper mw = (CSMigrationWrapper)Properties["mw"];
                if (mw != null)
                {
                    if (mw.csSourceAccount != null) // FBS bug 71047 -- 3/20/12
                    {
                        mw.csSourceAccount.UninitSourceAccount();
                    }

                    string s = mw.UninitCSMigrationWrapper();
                    if (s.Length > 0)
                    {
                        bool retval = mw.AvoidInternalErrors(s);
                        if (!retval)
                        {
                            MessageBox.Show(s, "Shutdown error", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                }
            }
        }
Exemple #21
0
        // 生成と終了


        public 判定文字列()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._判定文字列画像     = new 画像D2D(@"$(Images)\PlayStage\JudgeLabel.png");
            this._判定文字列の矩形リスト = new 矩形リスト(@"$(Images)\PlayStage\JudgeLabel.yaml");

            this._FastSlow数字画像     = new 画像D2D(@"$(Images)\PlayStage\FastSlowNumber.png");
            this._FastSlow数字の矩形リスト = new 矩形リスト(@"$(Images)\PlayStage\FastSlowNumber.yaml");

            this._レーンtoステータス = new Dictionary <表示レーン種別, 表示レーンステータス>()
            {
                { 表示レーン種別.Unknown, new 表示レーンステータス(表示レーン種別.Unknown) },
                { 表示レーン種別.LeftCymbal, new 表示レーンステータス(表示レーン種別.LeftCymbal) },
                { 表示レーン種別.HiHat, new 表示レーンステータス(表示レーン種別.HiHat) },
                { 表示レーン種別.Foot, new 表示レーンステータス(表示レーン種別.Foot) },
                { 表示レーン種別.Snare, new 表示レーンステータス(表示レーン種別.Snare) },
                { 表示レーン種別.Bass, new 表示レーンステータス(表示レーン種別.Bass) },
                { 表示レーン種別.Tom1, new 表示レーンステータス(表示レーン種別.Tom1) },
                { 表示レーン種別.Tom2, new 表示レーンステータス(表示レーン種別.Tom2) },
                { 表示レーン種別.Tom3, new 表示レーンステータス(表示レーン種別.Tom3) },
                { 表示レーン種別.RightCymbal, new 表示レーンステータス(表示レーン種別.RightCymbal) },
            };
        }
        // 生成と終了


        public 演奏パラメータ結果()
            : base()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._フルコンボ音声再生済み = false;

            // パラメータアニメを構築する。
            this._パラメータアニメ = new パラメータアニメ(Global.Animation.Manager);
            for (int i = 0; i < 6; i++)
            {
                const float 開始Xオフセット = +50f;

                this._パラメータアニメ.X位置オフセット[i] = new Variable(Global.Animation.Manager, initialValue: 開始Xオフセット);
                this._パラメータアニメ.透明度[i]      = new Variable(Global.Animation.Manager, initialValue: 0.0);

                using (var 遅延 = Global.Animation.TrasitionLibrary.Constant(duration: i * 0.05))
                    using (var 透明度の遷移 = Global.Animation.TrasitionLibrary.Linear(duration: 0.8, finalValue: 1.0))
                    {
                        this._パラメータアニメ.ストーリーボード.AddTransition(this._パラメータアニメ.透明度[i], 遅延);
                        this._パラメータアニメ.ストーリーボード.AddTransition(this._パラメータアニメ.透明度[i], 透明度の遷移);
                    }

                using (var 遅延 = Global.Animation.TrasitionLibrary.Constant(duration: i * 0.05))
                    using (var 遷移1 = Global.Animation.TrasitionLibrary.Cubic(duration: 0.2, finalValue: +0.0, finalVelocity: -200.0)) // 左へスライド
                        using (var 遷移2 = Global.Animation.TrasitionLibrary.Reversal(duration: 0.2))                                   // 方向転換
                        {
                            this._パラメータアニメ.ストーリーボード.AddTransition(this._パラメータアニメ.X位置オフセット[i], 遅延);
                            this._パラメータアニメ.ストーリーボード.AddTransition(this._パラメータアニメ.X位置オフセット[i], 遷移1);
                            this._パラメータアニメ.ストーリーボード.AddTransition(this._パラメータアニメ.X位置オフセット[i], 遷移2);
                        }
            }

            // 開始。
            this._パラメータアニメ.ストーリーボード.Schedule(Global.Animation.Timer.Time);
        }
Exemple #23
0
        public virtual void Dispose()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._背景画像?.Dispose();
        }
        public void 表示する()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            using var timer = new Timer();

            #region " 設定値で初期化。"
            //----------------
            foreach (ドラム入力種別?drum in Enum.GetValues(typeof(ドラム入力種別)))
            {
                if (!drum.HasValue ||
                    drum == ドラム入力種別.Unknown ||
                    drum == ドラム入力種別.HiHat_Control)
                {
                    continue;   // 除外(設定変更不可)
                }
                this.comboBoxパッドリスト.Items.Add(drum.Value.ToString());
            }

            // 変更後のキーバインディングを、現在の設定値で初期化。
            this._変更後のシステム設定 = Global.App.システム設定.Clone();

            // 最初のパッドを選択し、割り当て済みリストを更新。
            this.comboBoxパッドリスト.SelectedIndex = 0;

            // その他の初期化。
            this._前回の入力リスト追加時刻            = QPCTimer.生カウント相対値を秒へ変換して返す(QPCTimer.生カウント);
            this._FootPedal現在値            = 0;
            this.textBoxFootPedal現在値.Text = "0";
            this.textBoxFootPedal最小値.Text = this._変更後のシステム設定.FootPedal最小値.ToString();
            this.textBoxFootPedal最大値.Text = this._変更後のシステム設定.FootPedal最大値.ToString();
            this._変更あり = false;

            // 初期メッセージを出力。
            this.listView入力リスト.Items.Add($"HID Keyboard の受付を開始しました。");
            for (int i = 0; i < Global.AppForm.MidiIns.DeviceName.Count; i++)
            {
                this.listView入力リスト.Items.Add($"MIDI IN [{i}] '{Global.AppForm.MidiIns.DeviceName[ i ]}' の受付を開始しました。");
            }
            this.listView入力リスト.Items.Add("");
            this.listView入力リスト.Items.Add("* タイミングクロック信号、アクティブ信号は無視します。");
            this.listView入力リスト.Items.Add("* 入力と入力の間が500ミリ秒以上開いた場合は、間に空行を表示します。");
            this.listView入力リスト.Items.Add("");
            this.listView入力リスト.Items.Add("キーボードまたはMIDI信号を入力してください。");
            //----------------
            #endregion

            // タイマーイベントを使って、定期的に、ゲームコントローラ/MIDI入力値の表示と、MIDIフットペダル開度ゲージの描画を行う。
            timer.Interval = 100;
            timer.Tick    += (sender, arg) => {
                #region " ゲームコントローラをポーリングし、入力値を入力リストへ出力。"
                //----------------
                Global.AppForm.GameControllersHID.ポーリングする();

                for (int i = 0; i < Global.AppForm.GameControllersHID.入力イベントリスト.Count; i++)
                {
                    var inputEvent = Global.AppForm.GameControllersHID.入力イベントリスト[i];

                    if (inputEvent.押された)
                    {
                        // 入力リストに表示。
                        var item = new ListViewItem入力リスト用(InputDeviceType.GameController, inputEvent);

                        // 既に割り当てられていたらそのドラム種別を表示。
                        var drumType = this._変更後のシステム設定.ゲームコントローラtoドラム
                                       .Where((kvp) => (kvp.Key.deviceId == item.inputEvent.DeviceID && kvp.Key.key == item.inputEvent.Key))
                                       .Select((kvp) => kvp.Value);
                        if (0 < drumType.Count())
                        {
                            item.Text += $" (現在の割り当て: {drumType.ElementAt( 0 )})";
                        }

                        this._一定時間が経っていれば空行を挿入する();

                        this.listView入力リスト.Items.Add(item);
                        this.listView入力リスト.EnsureVisible(this.listView入力リスト.Items.Count - 1);
                    }
                }
                //----------------
                #endregion

                #region " MIDI入力をポーリングし、入力値を入力リストへ出力。"
                //----------------
                // MidiInChecker の機能もかねて、NoteOFF や ControlChange も表示する。(割り当てはできない。)

                Global.AppForm.MidiIns.ポーリングする();

                for (int i = 0; i < Global.AppForm.MidiIns.入力イベントリスト.Count; i++)
                {
                    var inputEvent = Global.AppForm.MidiIns.入力イベントリスト[i];

                    if (inputEvent.押された && (255 == inputEvent.Key) && (4 == inputEvent.Control))
                    {
                        #region " (A) フットペダルコントロールの場合 → 入力リストではなく専用のUIで表示。"
                        //----------------
                        if (this._FootPedal現在値 != inputEvent.Velocity)
                        {
                            // 現在値
                            this._FootPedal現在値            = inputEvent.Velocity;
                            this.textBoxFootPedal現在値.Text = this._FootPedal現在値.ToString();

                            // 最大値
                            if (this._FootPedal現在値 > this._変更後のシステム設定.FootPedal最大値)
                            {
                                this._変更後のシステム設定.FootPedal最大値 = this._FootPedal現在値;
                                this.textBoxFootPedal最大値.Text = this._変更後のシステム設定.FootPedal最大値.ToString();
                            }

                            // 最小値
                            if (this._FootPedal現在値 <= this._変更後のシステム設定.FootPedal最小値)
                            {
                                this._変更後のシステム設定.FootPedal最小値 = this._FootPedal現在値;
                                this.textBoxFootPedal最小値.Text = this._変更後のシステム設定.FootPedal最小値.ToString();
                            }
                        }
                        //----------------
                        #endregion
                    }
                    else
                    {
                        #region " (B) その他のMIDI入出力 → 入力リストに表示。"
                        //----------------
                        var item = new ListViewItem入力リスト用(InputDeviceType.MidiIn, inputEvent);

                        // 既に割り当てられていたらそのドラム種別を表示。
                        var drumType = this._変更後のシステム設定.MIDItoドラム
                                       .Where((kvp) => (kvp.Key.deviceId == item.inputEvent.DeviceID && kvp.Key.key == item.inputEvent.Key))
                                       .Select((kvp) => kvp.Value);
                        if (0 < drumType.Count())
                        {
                            item.Text += $" (現在の割り当て: {drumType.ElementAt( 0 )})";
                        }

                        this._一定時間が経っていれば空行を挿入する();

                        this.listView入力リスト.Items.Add(item);
                        this.listView入力リスト.EnsureVisible(this.listView入力リスト.Items.Count - 1);
                        //----------------
                        #endregion
                    }
                }
                //----------------
                #endregion

                #region " MIDIフットペダルの開度ゲージを描画。"
                //----------------
                using (var g = pictureBoxFootPedal.CreateGraphics())
                {
                    var 全体矩形    = pictureBoxFootPedal.ClientRectangle;
                    var 背景色     = new System.Drawing.SolidBrush(pictureBoxFootPedal.BackColor);
                    var 最大値ゲージ色 = System.Drawing.Brushes.LightBlue;
                    var ゲージ色    = System.Drawing.Brushes.Blue;

                    g.FillRectangle(背景色, 全体矩形);

                    int 最大値用差分   = (int)(全体矩形.Height * (1.0 - this._変更後のシステム設定.FootPedal最大値 / 127.0));
                    var 最大値ゲージ矩形 = new System.Drawing.Rectangle(
                        全体矩形.X,
                        全体矩形.Y + 最大値用差分,
                        全体矩形.Width,
                        全体矩形.Height - 最大値用差分);
                    g.FillRectangle(最大値ゲージ色, 最大値ゲージ矩形);

                    int 現在値用差分 = (int)(全体矩形.Height * (1.0 - this._FootPedal現在値 / 127.0));
                    var ゲージ矩形  = new System.Drawing.Rectangle(
                        全体矩形.X,
                        全体矩形.Y + 現在値用差分,
                        全体矩形.Width,
                        全体矩形.Height - 現在値用差分);
                    g.FillRectangle(ゲージ色, ゲージ矩形);
                }
                //----------------
                #endregion
            };

            this.KeyPreview = true;            // Control への入力を先に Form が受け取れるようにする。

            this.KeyDown += (sender, arg) => { // ダイアログで RawInput を使う方法が分からないので KeyDown を使う
                #region " キーボードの入力値を入力リストへ出力。"
                //----------------
                var inputEvent = new InputEvent()
                {
                    DeviceID  = 0,
                    Key       = (int)arg.KeyCode,
                    TimeStamp = 0,
                    Velocity  = 100,
                    押された      = true,
                    Control   = 0,
                };

                var item = new ListViewItem入力リスト用(InputDeviceType.Keyboard, inputEvent);

                if (inputEvent.Key == (int)Keys.Escape)      // 割り当てされてほしくないキーはここへ。
                {
                    item.割り当て可能 = false;
                }

                // 既に割り当てられていたらそのドラム種別を表示。
                var drumType = this._変更後のシステム設定.キーボードtoドラム
                               .Where((kvp) => (kvp.Key.deviceId == item.inputEvent.DeviceID && kvp.Key.key == item.inputEvent.Key))
                               .Select((kvp) => kvp.Value);

                if (0 < drumType.Count())
                {
                    item.Text += $" (現在の割り当て: {drumType.ElementAt( 0 )})";
                }

                this._一定時間が経っていれば空行を挿入する();

                this.listView入力リスト.Items.Add(item);
                this.listView入力リスト.EnsureVisible(this.listView入力リスト.Items.Count - 1);
                //----------------
                #endregion
            };

            timer.Start();

            #region " ダイアログを表示。"
            //----------------
            Cursor.Show();

            var dr = this.ShowDialog(Global.AppForm);

            if (Global.AppForm.ScreenMode.IsFullscreenMode)
            {
                Cursor.Hide();
            }
            //----------------
            #endregion

            timer.Stop();

            if (dr == DialogResult.OK)
            {
                // 設定値を反映する。
                Global.App.システム設定 = this._変更後のシステム設定.Clone();
                Global.App.システム設定.保存する();
            }
        }
Exemple #25
0
 public static LogBlock LogInformationalBlock(FunctionId functionId, string message, CancellationToken cancellationToken)
 => LogBlock.Create(functionId, message, EventLevel.Informational, cancellationToken);
Exemple #26
0
        public void LoadConfig(Config config)
        {
            using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                // ========================
                // Import Options
                // ========================
                ImportMailOptions        = config.ImportOptions.Mail;
                ImportCalendarOptions    = config.ImportOptions.Calendar;
                ImportContactOptions     = config.ImportOptions.Contacts;
                ImportDeletedItemOptions = config.ImportOptions.DeletedItems;
                ImportJunkOptions        = config.ImportOptions.Junk;
                ImportTaskOptions        = config.ImportOptions.Tasks;
                ImportSentOptions        = config.ImportOptions.Sent;
                ImportRuleOptions        = config.ImportOptions.Rules;
                ImportOOOOptions         = config.ImportOptions.OOO;
                SetNextState();

                // ========================
                // Advanced Import Options
                // ========================
                MigrateONRAfter = config.AdvancedImportOptions.MigrateOnOrAfter.ToShortDateString();
                IsOnOrAfter     = config.AdvancedImportOptions.IsOnOrAfter;

                MaxMessageSize = config.AdvancedImportOptions.MaxMessageSize;

                DateFilterItem = config.AdvancedImportOptions.DateFilterItem;

                IsSkipPrevMigratedItems = config.AdvancedImportOptions.IsSkipPrevMigratedItems;
                IsMaxMessageSize        = config.AdvancedImportOptions.IsMaxMessageSize;
                IsSkipFolders           = config.AdvancedImportOptions.IsSkipFolders;
                SpecialCharReplace      = config.AdvancedImportOptions.SpecialCharReplace;
                MaxRetries = config.AdvancedImportOptions.MaxRetries;


                // DCB_BUG_104613 If cfg file says "Public Folders Migration", override this if this is not a server mig
                bool           bIsServerMig = true;
                IntroViewModel ivm          = ((IntroViewModel)ViewModelPtrs[(int)ViewType.INTRO]);
                if (ivm != null)
                {
                    bIsServerMig = ivm.rbServerMigration;
                }
                IsPublicFolders = bIsServerMig && config.AdvancedImportOptions.IsPublicFolders;

                IsZDesktop = config.AdvancedImportOptions.IsZDesktop;

                // ========================
                // General Options
                // ========================
                if (config.GeneralOptions != null)  // so old config files will work
                {
                    // Having read loglevel from the config XML, write it to the global log level
                    Log.SetLogLevel(Log.LogLevelStr2Enum(config.GeneralOptions.LogLevel));

                    MaxThreadCount = config.GeneralOptions.MaxThreadCount;
                    MaxErrorCount  = config.GeneralOptions.MaxErrorCount;
                }

                // ========================
                // ========================
                string returnval = "";
                returnval     = ConvertToCSV(config.AdvancedImportOptions.FoldersToSkip, ",");
                FoldersToSkip = returnval;

                // ========================
                // User provision
                // ========================
                savedDomain = config.UserProvision.DestinationDomain;
            }
        }
        /// <summary>
        ///     スコアを読み込む。
        /// </summary>
        /// <returns>読み込みに成功すれば true, 失敗またはキャンセルされれば false。</returns>
        public static bool スコアを読み込む()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            var keyboard = Global.App.ドラム入力.Keyboard;

            #region " キャンセルチェック "
            //----------------
            keyboard.ポーリングする();
            if (keyboard.キーが押された(0, Keys.Escape))
            {
                return(false);
            }
            //----------------
            #endregion


            // 曲ファイルを読み込む。

            var 選択曲ファイルの絶対パス = Global.App.演奏譜面.譜面.ScorePath;
            Global.App.演奏スコア = SSTF.スコア.ファイルから生成する(選択曲ファイルの絶対パス);

            #region " キャンセルチェック "
            //----------------
            keyboard.ポーリングする();
            if (keyboard.キーが押された(0, Keys.Escape))
            {
                return(false);
            }
            //----------------
            #endregion


            // 全チップの発声時刻を修正する。

            foreach (var chip in Global.App.演奏スコア.チップリスト)
            {
                // Viewerでの再生速度は、ビュアーモード時のみ反映する。
                double 再生速度 = Global.Options.ビュアーモードである ?
                              Global.App.ログオン中のユーザ.再生速度 * Global.App.演奏スコア.Viewerでの再生速度 :
                              Global.App.ログオン中のユーザ.再生速度;

                chip.発声時刻sec /= 再生速度;
                chip.描画時刻sec /= 再生速度;

                chip.発声時刻sec -= Global.App.サウンドデバイス.再生遅延sec;
            }

            #region " キャンセルチェック "
            //----------------
            keyboard.ポーリングする();
            if (keyboard.キーが押された(0, Keys.Escape))
            {
                return(false);
            }
            //----------------
            #endregion


            // WAVを生成する。

            Global.App.WAVキャッシュ.世代を進める();

            // ビュアーモードで再生速度が異なっている場合は、さらに世代を進めてキャッシュを無効にする。
            if (_ビュアーモードでの前回の再生速度 != Global.App.演奏スコア.Viewerでの再生速度)
            {
                Global.App.WAVキャッシュ.世代を進める();
                _ビュアーモードでの前回の再生速度 = Global.App.演奏スコア.Viewerでの再生速度;
            }

            Global.App.WAV管理?.Dispose();
            Global.App.WAV管理 = new WAV管理();

            foreach (var kvp in Global.App.演奏スコア.WAVリスト)
            {
                #region " キャンセルチェック "
                //----------------
                keyboard.ポーリングする();
                if (keyboard.キーが押された(0, Keys.Escape))
                {
                    return(false);
                }
                //----------------
                #endregion

                var wavInfo = kvp.Value;

                var path = Path.Combine(Global.App.演奏スコア.PATH_WAV, wavInfo.ファイルパス);
                Global.App.WAV管理.登録する(kvp.Key, path, wavInfo.多重再生する, wavInfo.BGMである);
            }


            // AVIを生成する。

            Global.App.AVI管理?.Dispose();
            Global.App.AVI管理 = new AVI管理();

            if (Global.App.ログオン中のユーザ.演奏中に動画を表示する)
            {
                foreach (var kvp in Global.App.演奏スコア.AVIリスト)
                {
                    #region " キャンセルチェック "
                    //----------------
                    keyboard.ポーリングする();
                    if (keyboard.キーが押された(0, Keys.Escape))
                    {
                        return(false);
                    }
                    //----------------
                    #endregion

                    var path = Path.Combine(Global.App.演奏スコア.PATH_WAV, kvp.Value);

                    // Viewerでの再生速度は、ビュアーモード時のみ反映する。
                    double 再生速度 = Global.Options.ビュアーモードである ?
                                  Global.App.ログオン中のユーザ.再生速度 * Global.App.演奏スコア.Viewerでの再生速度 :
                                  Global.App.ログオン中のユーザ.再生速度;

                    Global.App.AVI管理.登録する(kvp.Key, path, 再生速度);
                }
            }

            #region " キャンセルチェック "
            //----------------
            keyboard.ポーリングする();
            if (keyboard.キーが押された(0, Keys.Escape))
            {
                return(false);
            }
            //----------------
            #endregion


            // 完了。

            Log.Info($"曲ファイルを読み込みました。[{Folder.絶対パスをフォルダ変数付き絶対パスに変換して返す( 選択曲ファイルの絶対パス )}]");

            return(true);
        }
Exemple #28
0
        public override void Dispose()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            base.Dispose();
        }
Exemple #29
0
        // 生成と終了


        public 標準の曲ツリー()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);
        }
Exemple #30
0
        public virtual void Dispose()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            this._レーンフラッシュ画像.Dispose();
        }