diff --git a/.gitignore b/.gitignore index fee8672..abd407b 100644 --- a/.gitignore +++ b/.gitignore @@ -263,4 +263,4 @@ __pycache__/ /Thumbs.db /曲データ desktop.ini -/インストーラ +/アーカイブ diff --git a/DTXMania.sln b/DTXMania.sln index ac31a2e..fffde6a 100644 --- a/DTXMania.sln +++ b/DTXMania.sln @@ -17,6 +17,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SSTFormatTests", "SSTFormat EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FDKTests", "FDKTests\FDKTests.csproj", "{49864666-A028-4877-92A4-8200FE9D3C7E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeArchive", "MakeArchive\MakeArchive.csproj", "{18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}" + ProjectSection(ProjectDependencies) = postProject + {736BE388-5EC5-4BF9-838B-8580C9A8DA9C} = {736BE388-5EC5-4BF9-838B-8580C9A8DA9C} + {487B9AFD-05D4-41AE-9800-21E16B382BB7} = {487B9AFD-05D4-41AE-9800-21E16B382BB7} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -111,6 +117,18 @@ Global {49864666-A028-4877-92A4-8200FE9D3C7E}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU {49864666-A028-4877-92A4-8200FE9D3C7E}.RemoteDebug|x64.ActiveCfg = Debug|Any CPU {49864666-A028-4877-92A4-8200FE9D3C7E}.RemoteDebug|x64.Build.0 = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Debug|x64.ActiveCfg = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Debug|x64.Build.0 = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Release|Any CPU.Build.0 = Release|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Release|x64.ActiveCfg = Release|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.Release|x64.Build.0 = Release|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.RemoteDebug|x64.ActiveCfg = Debug|Any CPU + {18DA0EC0-28E2-439B-A8AB-D67ACEF8935F}.RemoteDebug|x64.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DTXMania/App.cs b/DTXMania/App.cs index 7499903..f96cdd7 100644 --- a/DTXMania/App.cs +++ b/DTXMania/App.cs @@ -37,6 +37,8 @@ public static int リリース番号 public static システム設定 システム設定 { get; protected set; } + public static システムサウンド システムサウンド { get; protected set; } + public static 入力管理 入力管理 { get; set; } public static ステージ管理 ステージ管理 { get; protected set; } @@ -157,6 +159,8 @@ public App( bool ビュアーモードである ) App.ドラムサウンド = new ドラムサウンド(); + App.システムサウンド = new システムサウンド(); + App.ユーザ管理 = new ユーザ管理(); App.ユーザ管理.ユーザリスト.SelectItem( ( user ) => ( user.ユーザID == "AutoPlayer" ) ); // ひとまずAutoPlayerを選択。 @@ -199,6 +203,9 @@ protected override void Dispose( bool disposing ) App.ユーザ管理?.Dispose(); App.ユーザ管理 = null; + App.システムサウンド?.Dispose(); + App.システムサウンド = null; + App.ドラムサウンド?.Dispose(); App.ドラムサウンド = null; @@ -273,6 +280,55 @@ public override void Run() } ); } + public static void システム設定を初期化する() + { + var vpath = システム設定.システム設定ファイルパス; + try + { + File.Delete( vpath.変数なしパス ); // ファイルがない場合には例外は出ない + } + catch( Exception e ) + { + Log.ERROR( $"システム設定ファイルの削除に失敗しました。[{vpath.変数付きパス}][{VariablePath.絶対パスをフォルダ変数付き絶対パスに変換して返す( e.Message )}]" ); + } + + App.システム設定 = システム設定.復元する(); // ファイルがない場合、新規に作られる + } + + public static void 曲データベースを初期化する() + { + App.曲ツリー.非活性化する(); + + var vpath = データベース.曲.SongDB.曲DBファイルパス; + try + { + File.Delete( vpath.変数なしパス ); // ファイルがない場合には例外は出ない + } + catch( Exception e ) + { + Log.ERROR( $"曲データベースファイルの削除に失敗しました。[{vpath.変数付きパス}][{VariablePath.絶対パスをフォルダ変数付き絶対パスに変換して返す( e.Message )}]" ); + } + } + + public static void ユーザデータベースを初期化する() + { + App.ユーザ管理.Dispose(); + + var vpath = データベース.ユーザ.UserDB.ユーザDBファイルパス; + try + { + File.Delete( vpath.変数なしパス ); // ファイルがない場合には例外は出ない + } + catch( Exception e ) + { + Log.ERROR( $"ユーザデータベースファイルの削除に失敗しました。[{vpath.変数付きパス}][{VariablePath.絶対パスをフォルダ変数付き絶対パスに変換して返す( e.Message )}]" ); + } + + App.ユーザ管理 = new ユーザ管理(); // 再生成。 + App.ユーザ管理.ユーザリスト.SelectItem( ( user ) => ( user.ユーザID == "AutoPlayer" ) ); // ひとまずAutoPlayerを選択。 + } + + protected override void OnClosing( CancelEventArgs e ) { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -544,9 +600,9 @@ private void _進行と描画を行う() } //---------------- #endregion - #region " 曲読み込みフォルダ変更 → 曲読み込みステージへ " + #region " 再起動 → 起動ステージへ " //---------------- - if( stage.現在のフェーズ == ステージ.オプション設定.オプション設定ステージ.フェーズ.曲読み込みフォルダ変更済み ) + if( stage.現在のフェーズ == ステージ.オプション設定.オプション設定ステージ.フェーズ.再起動 ) { App.ステージ管理.ステージを遷移する( nameof( ステージ.起動.起動ステージ ) ); } @@ -587,7 +643,9 @@ private void _進行と描画を行う() // ビュアーモードならクリアフェーズを維持。(サービスメッセージ待ち。) } else + { App.ステージ管理.ステージを遷移する( nameof( ステージ.結果.結果ステージ ) ); + } } //---------------- #endregion diff --git a/DTXMania/CommandLineOptions.cs b/DTXMania/CommandLineOptions.cs index 2cfc1e1..1ea5c33 100644 --- a/DTXMania/CommandLineOptions.cs +++ b/DTXMania/CommandLineOptions.cs @@ -5,8 +5,7 @@ namespace DTXMania { - - public class CommandLineOptions + class CommandLineOptions { public readonly string Usage = "DTXMania " + App.リリース番号.ToString( "000" ) + "\n" + diff --git a/DTXMania/DTXMania.csproj b/DTXMania/DTXMania.csproj index b781994..3d6ce96 100644 --- a/DTXMania/DTXMania.csproj +++ b/DTXMania/DTXMania.csproj @@ -31,7 +31,7 @@ AnyCPU - pdbonly + none true bin\Release\ TRACE @@ -105,9 +105,6 @@ ..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll - ..\packages\protobuf-net.3.0.0-alpha.3\lib\net462\protobuf-net.dll @@ -184,6 +181,9 @@ + + ..\packages\YamlDotNet.5.3.0\lib\net45\YamlDotNet.dll + @@ -196,10 +196,12 @@ + + Form @@ -272,18 +274,21 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -300,12 +305,13 @@ - - - - - - + + + + + + + Form @@ -357,19 +363,52 @@ Settings.settings True - + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest @@ -721,67 +760,67 @@ - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest @@ -802,7 +841,7 @@ PreserveNewest - + PreserveNewest @@ -811,6 +850,7 @@ PreserveNewest + diff --git a/DTXMania/Program.cs b/DTXMania/Program.cs index f72906a..31e56e5 100644 --- a/DTXMania/Program.cs +++ b/DTXMania/Program.cs @@ -22,6 +22,7 @@ static class Program public static readonly string endPointName = "Viewer"; public static readonly string endPointUri = $"{serviceUri}/{endPointName}"; + // メインエントリ。 [STAThread] static void Main( string[] args ) diff --git a/DTXMania/Properties/AssemblyInfo.cs b/DTXMania/Properties/AssemblyInfo.cs index 0eeeb6f..0fa347c 100644 --- a/DTXMania/Properties/AssemblyInfo.cs +++ b/DTXMania/Properties/AssemblyInfo.cs @@ -32,8 +32,8 @@ // すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion( "20.0.0.0" )] -[assembly: AssemblyFileVersion( "20.0.0.0" )] +[assembly: AssemblyVersion( "21.0.0.0" )] +[assembly: AssemblyFileVersion( "21.0.0.0" )] // 公開先のアセンブリを指定する // [assembly: InternalsVisibleTo("公開先のアセンブリ名")] diff --git "a/DTXMania/System/Images/\343\202\263\343\203\263\343\202\275\343\203\274\343\203\253\343\203\225\343\202\251\343\203\263\343\203\21020x32.json" "b/DTXMania/System/Images/\343\202\263\343\203\263\343\202\275\343\203\274\343\203\253\343\203\225\343\202\251\343\203\263\343\203\21020x32.json" deleted file mode 100644 index fea475c..0000000 --- "a/DTXMania/System/Images/\343\202\263\343\203\263\343\202\275\343\203\274\343\203\253\343\203\225\343\202\251\343\203\263\343\203\21020x32.json" +++ /dev/null @@ -1,101 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - " ": [ 0, 0, 20, 32 ], - "!": [ 20, 0, 20, 32 ], - "\"": [ 40, 0, 20, 32 ], - "#": [ 60, 0, 20, 32 ], - "$": [ 80, 0, 20, 32 ], - "%": [ 100, 0, 20, 32 ], - "&": [ 120, 0, 20, 32 ], - "'": [ 140, 0, 20, 32 ], - "(": [ 160, 0, 20, 32 ], - ")": [ 180, 0, 20, 32 ], - "*": [ 200, 0, 20, 32 ], - "+": [ 220, 0, 20, 32 ], - ",": [ 0, 32, 20, 32 ], - "-": [ 20, 32, 20, 32 ], - ".": [ 40, 32, 20, 32 ], - "/": [ 60, 32, 20, 32 ], - "0": [ 80, 32, 20, 32 ], - "1": [ 100, 32, 20, 32 ], - "2": [ 120, 32, 20, 32 ], - "3": [ 140, 32, 20, 32 ], - "4": [ 160, 32, 20, 32 ], - "5": [ 180, 32, 20, 32 ], - "6": [ 200, 32, 20, 32 ], - "7": [ 220, 32, 20, 32 ], - "8": [ 0, 64, 20, 32 ], - "9": [ 20, 64, 20, 32 ], - ":": [ 40, 64, 20, 32 ], - ";": [ 60, 64, 20, 32 ], - "<": [ 80, 64, 20, 32 ], - "=": [ 100, 64, 20, 32 ], - ">": [ 120, 64, 20, 32 ], - "?": [ 140, 64, 20, 32 ], - "@": [ 160, 64, 20, 32 ], - "A": [ 180, 64, 20, 32 ], - "B": [ 200, 64, 20, 32 ], - "C": [ 220, 64, 20, 32 ], - "D": [ 0, 96, 20, 32 ], - "E": [ 20, 96, 20, 32 ], - "F": [ 40, 96, 20, 32 ], - "G": [ 60, 96, 20, 32 ], - "H": [ 80, 96, 20, 32 ], - "I": [ 100, 96, 20, 32 ], - "J": [ 120, 96, 20, 32 ], - "K": [ 140, 96, 20, 32 ], - "L": [ 160, 96, 20, 32 ], - "M": [ 180, 96, 20, 32 ], - "N": [ 200, 96, 20, 32 ], - "O": [ 220, 96, 20, 32 ], - "P": [ 0, 128, 20, 32 ], - "Q": [ 20, 128, 20, 32 ], - "R": [ 40, 128, 20, 32 ], - "S": [ 60, 128, 20, 32 ], - "T": [ 80, 128, 20, 32 ], - "U": [ 100, 128, 20, 32 ], - "V": [ 120, 128, 20, 32 ], - "W": [ 140, 128, 20, 32 ], - "X": [ 160, 128, 20, 32 ], - "Y": [ 180, 128, 20, 32 ], - "Z": [ 200, 128, 20, 32 ], - "{": [ 220, 128, 20, 32 ], - "\\": [ 0, 160, 20, 32 ], - "}": [ 20, 160, 20, 32 ], - "^": [ 40, 160, 20, 32 ], - "_": [ 60, 160, 20, 32 ], - "`": [ 80, 160, 20, 32 ], - "a": [ 100, 160, 20, 32 ], - "b": [ 120, 160, 20, 32 ], - "c": [ 140, 160, 20, 32 ], - "d": [ 160, 160, 20, 32 ], - "e": [ 180, 160, 20, 32 ], - "f": [ 200, 160, 20, 32 ], - "g": [ 220, 160, 20, 32 ], - "h": [ 0, 192, 20, 32 ], - "i": [ 20, 192, 20, 32 ], - "j": [ 40, 192, 20, 32 ], - "k": [ 60, 192, 20, 32 ], - "l": [ 80, 192, 20, 32 ], - "m": [ 100, 192, 20, 32 ], - "n": [ 120, 192, 20, 32 ], - "o": [ 140, 192, 20, 32 ], - "p": [ 160, 192, 20, 32 ], - "q": [ 180, 192, 20, 32 ], - "r": [ 200, 192, 20, 32 ], - "s": [ 220, 192, 20, 32 ], - "t": [ 0, 224, 20, 32 ], - "u": [ 20, 224, 20, 32 ], - "v": [ 40, 224, 20, 32 ], - "w": [ 60, 224, 20, 32 ], - "x": [ 80, 224, 20, 32 ], - "y": [ 100, 224, 20, 32 ], - "z": [ 120, 224, 20, 32 ], - "[": [ 140, 224, 20, 32 ], - "|": [ 160, 224, 20, 32 ], - "]": [ 180, 224, 20, 32 ], - "~": [ 200, 224, 20, 32 ], - "": [ 220, 224, 20, 32 ] - } -} diff --git "a/DTXMania/System/Images/\343\202\263\343\203\263\343\202\275\343\203\274\343\203\253\343\203\225\343\202\251\343\203\263\343\203\21020x32.yaml" "b/DTXMania/System/Images/\343\202\263\343\203\263\343\202\275\343\203\274\343\203\253\343\203\225\343\202\251\343\203\263\343\203\21020x32.yaml" new file mode 100644 index 0000000..728fdc7 --- /dev/null +++ "b/DTXMania/System/Images/\343\202\263\343\203\263\343\202\275\343\203\274\343\203\253\343\203\225\343\202\251\343\203\263\343\203\21020x32.yaml" @@ -0,0 +1,98 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + '0': [80, 32, 20, 32] + '1': [100, 32, 20, 32] + '2': [120, 32, 20, 32] + '3': [140, 32, 20, 32] + '4': [160, 32, 20, 32] + '5': [180, 32, 20, 32] + '6': [200, 32, 20, 32] + '7': [220, 32, 20, 32] + '8': [0, 64, 20, 32] + '9': [20, 64, 20, 32] + ' ': [0, 0, 20, 32] + '!': [20, 0, 20, 32] + '"': [40, 0, 20, 32] + '#': [60, 0, 20, 32] + '$': [80, 0, 20, 32] + '%': [100, 0, 20, 32] + '&': [120, 0, 20, 32] + '''': [140, 0, 20, 32] + '(': [160, 0, 20, 32] + ')': [180, 0, 20, 32] + '*': [200, 0, 20, 32] + '+': [220, 0, 20, 32] + ',': [0, 32, 20, 32] + '-': [20, 32, 20, 32] + '.': [40, 32, 20, 32] + '/': [60, 32, 20, 32] + ':': [40, 64, 20, 32] + ';': [60, 64, 20, 32] + '<': [80, 64, 20, 32] + '=': [100, 64, 20, 32] + '>': [120, 64, 20, 32] + '?': [140, 64, 20, 32] + '@': [160, 64, 20, 32] + 'A': [180, 64, 20, 32] + 'B': [200, 64, 20, 32] + 'C': [220, 64, 20, 32] + 'D': [0, 96, 20, 32] + 'E': [20, 96, 20, 32] + 'F': [40, 96, 20, 32] + 'G': [60, 96, 20, 32] + 'H': [80, 96, 20, 32] + 'I': [100, 96, 20, 32] + 'J': [120, 96, 20, 32] + 'K': [140, 96, 20, 32] + 'L': [160, 96, 20, 32] + 'M': [180, 96, 20, 32] + 'N': [200, 96, 20, 32] + 'O': [220, 96, 20, 32] + 'P': [0, 128, 20, 32] + 'Q': [20, 128, 20, 32] + 'R': [40, 128, 20, 32] + 'S': [60, 128, 20, 32] + 'T': [80, 128, 20, 32] + 'U': [100, 128, 20, 32] + 'V': [120, 128, 20, 32] + 'W': [140, 128, 20, 32] + 'X': [160, 128, 20, 32] + 'Y': [180, 128, 20, 32] + 'Z': [200, 128, 20, 32] + '{': [220, 128, 20, 32] + '\\': [0, 160, 20, 32] + '}': [20, 160, 20, 32] + '^': [40, 160, 20, 32] + '_': [60, 160, 20, 32] + '`': [80, 160, 20, 32] + 'a': [100, 160, 20, 32] + 'b': [120, 160, 20, 32] + 'c': [140, 160, 20, 32] + 'd': [160, 160, 20, 32] + 'e': [180, 160, 20, 32] + 'f': [200, 160, 20, 32] + 'g': [220, 160, 20, 32] + 'h': [0, 192, 20, 32] + 'i': [20, 192, 20, 32] + 'j': [40, 192, 20, 32] + 'k': [60, 192, 20, 32] + 'l': [80, 192, 20, 32] + 'm': [100, 192, 20, 32] + 'n': [120, 192, 20, 32] + 'o': [140, 192, 20, 32] + 'p': [160, 192, 20, 32] + 'q': [180, 192, 20, 32] + 'r': [200, 192, 20, 32] + 's': [220, 192, 20, 32] + 't': [0, 224, 20, 32] + 'u': [20, 224, 20, 32] + 'v': [40, 224, 20, 32] + 'w': [60, 224, 20, 32] + 'x': [80, 224, 20, 32] + 'y': [100, 224, 20, 32] + 'z': [120, 224, 20, 32] + '[': [140, 224, 20, 32] + '|': [160, 224, 20, 32] + ']': [180, 224, 20, 32] + '~': [200, 224, 20, 32] + "": [220, 224, 20, 32] diff --git "a/DTXMania/System/Images/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.json" "b/DTXMania/System/Images/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.json" deleted file mode 100644 index 583118d..0000000 --- "a/DTXMania/System/Images/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.json" +++ /dev/null @@ -1,9 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "Up": [ 0, 0, 41, 41 ], - "Down": [ 42, 0, 41, 41 ], - "Left": [ 0, 42, 41, 41 ], - "Right": [ 42, 42, 41, 41 ] - } -} diff --git "a/DTXMania/System/Images/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.yaml" "b/DTXMania/System/Images/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.yaml" new file mode 100644 index 0000000..ceb6430 --- /dev/null +++ "b/DTXMania/System/Images/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.yaml" @@ -0,0 +1,6 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + Up: [0, 0, 41, 41] + Down: [42, 0, 41, 41] + Left: [0, 42, 41, 41] + Right: [42, 42, 41, 41] diff --git "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247.json" "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247.json" deleted file mode 100644 index 16ca4cf..0000000 --- "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247.json" +++ /dev/null @@ -1,22 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "0": [ 0, 0, 51, 96 ], - "1": [ 51, 0, 51, 96 ], - "2": [ 102, 0, 51, 96 ], - "3": [ 153, 0, 51, 96 ], - "4": [ 204, 0, 51, 96 ], - "5": [ 0, 96, 51, 96 ], - "6": [ 51, 96, 51, 96 ], - "7": [ 102, 96, 51, 96 ], - "8": [ 153, 96, 51, 96 ], - "9": [ 204, 96, 51, 96 ], - "//2": " 'o' はグレーのゼロ。", - "o": [ 0, 192, 51, 96 ], - ".": [ 51, 192, 51, 96 ], - "%": [ 102, 192, 51, 96 ], - " ": [ 153, 192, 51, 96 ] - } -} - - diff --git "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247.yaml" "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247.yaml" new file mode 100644 index 0000000..29e19c2 --- /dev/null +++ "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247.yaml" @@ -0,0 +1,17 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + '0': [0, 0, 51, 96] + '1': [51, 0, 51, 96] + '2': [102, 0, 51, 96] + '3': [153, 0, 51, 96] + '4': [204, 0, 51, 96] + '5': [0, 96, 51, 96] + '6': [51, 96, 51, 96] + '7': [102, 96, 51, 96] + '8': [153, 96, 51, 96] + '9': [204, 96, 51, 96] + # 'o' はグレーのゼロ。 + 'o': [0, 192, 51, 96] + '.': [51, 192, 51, 96] + '%': [102, 192, 51, 96] + ' ': [153, 192, 51, 96] diff --git "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247\345\244\252\346\226\234.json" "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247\345\244\252\346\226\234.json" deleted file mode 100644 index 6d4d982..0000000 --- "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247\345\244\252\346\226\234.json" +++ /dev/null @@ -1,22 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "0": [ 0, 0, 51, 96 ], - "1": [ 51, 0, 51, 96 ], - "2": [ 102, 0, 51, 96 ], - "3": [ 153, 0, 51, 96 ], - "4": [ 204, 0, 51, 96 ], - "5": [ 0, 96, 51, 96 ], - "6": [ 51, 96, 51, 96 ], - "7": [ 102, 96, 51, 96 ], - "8": [ 153, 96, 51, 96 ], - "9": [ 204, 96, 51, 96 ], - "//2": " 'o' は グレーのゼロ。", - "o": [ 0, 192, 51, 96 ], - ".": [ 51, 192, 51, 96 ], - "%": [ 102, 192, 51, 96 ], - " ": [ 153, 192, 51, 96 ] - } -} - - diff --git "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247\345\244\252\346\226\234.yaml" "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247\345\244\252\346\226\234.yaml" new file mode 100644 index 0000000..69ee312 --- /dev/null +++ "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\244\247\345\244\252\346\226\234.yaml" @@ -0,0 +1,17 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + '0': [0, 0, 51, 96] + '1': [51, 0, 51, 96] + '2': [102, 0, 51, 96] + '3': [153, 0, 51, 96] + '4': [204, 0, 51, 96] + '5': [0, 96, 51, 96] + '6': [51, 96, 51, 96] + '7': [102, 96, 51, 96] + '8': [153, 96, 51, 96] + '9': [204, 96, 51, 96] + # 'o' は グレーのゼロ。 + 'o': [0, 192, 51, 96] + '.': [51, 192, 51, 96] + '%': [102, 192, 51, 96] + ' ': [153, 192, 51, 96] diff --git "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\260\217.json" "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\260\217.json" deleted file mode 100644 index 661132f..0000000 --- "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\260\217.json" +++ /dev/null @@ -1,21 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "0": [ 0, 0, 17, 32 ], - "1": [ 17, 0, 17, 32 ], - "2": [ 34, 0, 17, 32 ], - "3": [ 51, 0, 17, 32 ], - "4": [ 68, 0, 17, 32 ], - "5": [ 0, 32, 17, 32 ], - "6": [ 17, 32, 17, 32 ], - "7": [ 34, 32, 17, 32 ], - "8": [ 51, 32, 17, 32 ], - "9": [ 68, 32, 17, 32 ], - "//2": " 'o' はグレーのゼロ。", - "o": [ 0, 64, 17, 32 ], - ".": [ 17, 64, 17, 32 ], - "%": [ 34, 64, 17, 32 ], - "~": [ 51, 64, 17, 32 ], - " ": [ 68, 64, 17, 32 ], - } -} diff --git "a/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\260\217.yaml" "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\260\217.yaml" new file mode 100644 index 0000000..bbc7302 --- /dev/null +++ "b/DTXMania/System/Images/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\346\226\207\345\255\227_\345\260\217.yaml" @@ -0,0 +1,18 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + '0': [0, 0, 17, 32] + '1': [17, 0, 17, 32] + '2': [34, 0, 17, 32] + '3': [51, 0, 17, 32] + '4': [68, 0, 17, 32] + '5': [0, 32, 17, 32] + '6': [17, 32, 17, 32] + '7': [34, 32, 17, 32] + '8': [51, 32, 17, 32] + '9': [68, 32, 17, 32] + # 'o' はグレーのゼロ。 + 'o': [0, 64, 17, 32] + '.': [17, 64, 17, 32] + '%': [34, 64, 17, 32] + '~': [51, 64, 17, 32] + ' ': [68, 64, 17, 32] diff --git "a/DTXMania/System/Images/\346\225\260\345\255\227\343\203\225\343\202\251\343\203\263\343\203\210\344\270\25548x64\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.json" "b/DTXMania/System/Images/\346\225\260\345\255\227\343\203\225\343\202\251\343\203\263\343\203\210\344\270\25548x64\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.json" deleted file mode 100644 index 872e2d6..0000000 --- "a/DTXMania/System/Images/\346\225\260\345\255\227\343\203\225\343\202\251\343\203\263\343\203\210\344\270\25548x64\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.json" +++ /dev/null @@ -1,15 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "0": [ 0, 0, 48, 64 ], - "1": [ 48, 0, 48, 64 ], - "2": [ 96, 0, 48, 64 ], - "3": [ 144, 0, 48, 64 ], - "4": [ 192, 0, 48, 64 ], - "5": [ 0, 64, 48, 64 ], - "6": [ 48, 64, 48, 64 ], - "7": [ 96, 64, 48, 64 ], - "8": [ 144, 64, 48, 64 ], - "9": [ 192, 64, 48, 64 ] - } -} diff --git "a/DTXMania/System/Images/\346\225\260\345\255\227\343\203\225\343\202\251\343\203\263\343\203\210\344\270\25548x64\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.yaml" "b/DTXMania/System/Images/\346\225\260\345\255\227\343\203\225\343\202\251\343\203\263\343\203\210\344\270\25548x64\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.yaml" new file mode 100644 index 0000000..4bf7669 --- /dev/null +++ "b/DTXMania/System/Images/\346\225\260\345\255\227\343\203\225\343\202\251\343\203\263\343\203\210\344\270\25548x64\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.yaml" @@ -0,0 +1,12 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + '0': [0, 0, 48, 64] + '1': [48, 0, 48, 64] + '2': [96, 0, 48, 64] + '3': [144, 0, 48, 64] + '4': [192, 0, 48, 64] + '5': [0, 64, 48, 64] + '6': [48, 64, 48, 64] + '7': [96, 64, 48, 64] + '8': [144, 64, 48, 64] + '9': [192, 64, 48, 64] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\346\226\207\345\255\227.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\346\226\207\345\255\227.json" deleted file mode 100644 index 8c9997c..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\346\226\207\345\255\227.json" +++ /dev/null @@ -1,18 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "0": [ 0, 0, 142, 188 ], - "1": [ 142, 0, 142, 188 ], - "2": [ 284, 0, 142, 188 ], - "3": [ 426, 0, 142, 188 ], - "4": [ 568, 0, 142, 188 ], - "5": [ 0, 188, 142, 188 ], - "6": [ 142, 188, 142, 188 ], - "7": [ 284, 188, 142, 188 ], - "8": [ 426, 188, 142, 188 ], - "9": [ 568, 188, 142, 188 ], - "Combo": [ 0, 376, 263, 98 ], - "//2": "'o' は空白文字を表す。", - "o": [ 568, 376, 142, 188 ] - } -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\346\226\207\345\255\227.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\346\226\207\345\255\227.yaml" new file mode 100644 index 0000000..478b2f2 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\346\226\207\345\255\227.yaml" @@ -0,0 +1,15 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + '0': [0, 0, 142, 188] + '1': [142, 0, 142, 188] + '2': [284, 0, 142, 188] + '3': [426, 0, 142, 188] + '4': [568, 0, 142, 188] + '5': [0, 188, 142, 188] + '6': [142, 188, 142, 188] + '7': [284, 188, 142, 188] + '8': [426, 188, 142, 188] + '9': [568, 188, 142, 188] + 'Combo': [0, 376, 263, 98] + # 'o' は空白文字を表す。 + 'o': [568, 376, 142, 188] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\346\225\260\345\255\227.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\346\225\260\345\255\227.json" deleted file mode 100644 index a3a2306..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\346\225\260\345\255\227.json" +++ /dev/null @@ -1,16 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "0": [ 0, 0, 50, 99 ], - "1": [ 50, 0, 50, 99 ], - "2": [ 100, 0, 50, 99 ], - "3": [ 150, 0, 50, 99 ], - "4": [ 0, 99, 50, 99 ], - "5": [ 50, 99, 50, 99 ], - "6": [ 100, 99, 50, 99 ], - "7": [ 150, 99, 50, 99 ], - "8": [ 0, 198, 50, 99 ], - "9": [ 50, 198, 50, 99 ], - " ": [ 100, 198, 50, 99 ] - } -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\346\225\260\345\255\227.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\346\225\260\345\255\227.yaml" new file mode 100644 index 0000000..7b95977 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\346\225\260\345\255\227.yaml" @@ -0,0 +1,13 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + '0': [0, 0, 50, 99] + '1': [50, 0, 50, 99] + '2': [100, 0, 50, 99] + '3': [150, 0, 50, 99] + '4': [0, 99, 50, 99] + '5': [50, 99, 50, 99] + '6': [100, 99, 50, 99] + '7': [150, 99, 50, 99] + '8': [0, 198, 50, 99] + '9': [50, 198, 50, 99] + ' ': [100, 198, 50, 99] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.json" deleted file mode 100644 index 70c1655..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.json" +++ /dev/null @@ -1,16 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "//2": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": [ 0, 0, 0, 0 ], - "LeftCymbal": [ 0, 0, 400, 300 ], - "HiHat": [ 400, 0, 400, 300 ], - "Foot": [ 800, 0, 400, 300 ], - "Snare": [ 0, 300, 400, 300 ], - "Bass": [ 400, 300, 400, 300 ], - "Tom1": [ 800, 300, 400, 300 ], - "Tom2": [ 0, 600, 400, 300 ], - "Tom3": [ 400, 600, 400, 300 ], - "RightCymbal": [ 800, 600, 400, 300 ] - } -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.yaml" new file mode 100644 index 0000000..8a260b7 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.yaml" @@ -0,0 +1,13 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: [0, 0, 0, 0] + LeftCymbal: [0, 0, 400, 300] + HiHat: [400, 0, 400, 300] + Foot: [800, 0, 400, 300] + Snare: [0, 300, 400, 300] + Bass: [400, 300, 400, 300] + Tom1: [800, 300, 400, 300] + Tom2: [0, 600, 400, 300] + Tom3: [400, 600, 400, 300] + RightCymbal: [800, 600, 400, 300] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\201\343\203\203\343\203\227.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\201\343\203\203\343\203\227.json" deleted file mode 100644 index 18966ae..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\201\343\203\203\343\203\227.json" +++ /dev/null @@ -1,72 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - - "//2": "チップ本体。各 Name は 表示チップ種別 列挙子の名前であること。", - "Unknown": [ 0, 0, 0, 0 ], - "LeftCymbal": [ 0, 0, 96, 98 ], - "RightCymbal": [ 673, 0, 96, 98 ], - "HiHat": [ 100, 0, 70, 98 ], - "HiHat_Open": [ 100, 0, 70, 98 ], - "HiHat_HalfOpen": [ 100, 0, 70, 98 ], - "Foot": [ 177, 0, 73, 98 ], - "LeftPedal": [ 177, 0, 73, 98 ], - "Snare": [ 255, 0, 84, 98 ], - "Snare_OpenRim": [ 255, 0, 84, 98 ], - "Snare_ClosedRim": [ 255, 202, 84, 98 ], - "Snare_Ghost": [ 255, 102, 84, 98 ], - "Bass": [ 348, 0, 90, 98 ], - "LeftBass": [ 177, 0, 73, 98 ], - "Tom1": [ 443, 0, 71, 98 ], - "Tom1_Rim": [ 443, 202, 71, 98 ], - "Tom2": [ 518, 0, 71, 98 ], - "Tom2_Rim": [ 518, 202, 71, 98 ], - "Tom3": [ 594, 0, 71, 98 ], - "Tom3_Rim": [ 594, 202, 71, 98 ], - "LeftRide": [ 0, 0, 96, 98 ], - "RightRide": [ 673, 0, 96, 98 ], - "LeftRide_Cup": [ 0, 0, 96, 98 ], - "RightRide_Cup": [ 673, 0, 96, 98 ], - "LeftChina": [ 0, 0, 96, 98 ], - "RightChina": [ 673, 0, 96, 98 ], - "LeftSplash": [ 0, 0, 96, 98 ], - "RightSplash": [ 673, 0, 96, 98 ], - "LeftCymbal_Mute": [ 0, 0, 0, 0 ], - "RightCymbal_Mute": [ 0, 0, 0, 0 ], - - "//3": "パッド絵。各 Name は 表示チップ種別 列挙子の名前 + '_back' であること。", - "Unknown_back": [ 0, 0, 0, 0 ], - "LeftCymbal_back": [ 0, 102, 96, 98 ], - "RightCymbal_back": [ 673, 102, 96, 98 ], - "HiHat_back": [ 103, 102, 70, 98 ], - "HiHat_Open_back": [ 103, 202, 70, 98 ], - "HiHat_HalfOpen_back": [ 103, 202, 70, 98 ], - "Foot_back": [ 177, 102, 73, 98 ], - "LeftPedal_back": [ 177, 102, 73, 98 ], - "Snare_back": [ 0, 0, 0, 0 ], - "Snare_OpenRim_back": [ 0, 0, 0, 0 ], - "Snare_ClosedRim_back": [ 0, 0, 0, 0 ], - "Snare_Ghost_back": [ 0, 0, 0, 0 ], - "Bass_back": [ 348, 102, 90, 98 ], - "LeftBass_back": [ 177, 102, 73, 98 ], - "Tom1_back": [ 0, 0, 0, 0 ], - "Tom1_Rim_back": [ 0, 0, 0, 0 ], - "Tom2_back": [ 0, 0, 0, 0 ], - "Tom2_Rim_back": [ 0, 0, 0, 0 ], - "Tom3_back": [ 0, 0, 0, 0 ], - "Tom3_Rim_back": [ 0, 0, 0, 0 ], - "LeftRide_back": [ 0, 102, 96, 98 ], - "RightRide_back": [ 673, 102, 96, 98 ], - "LeftRide_Cup_back": [ 0, 102, 96, 98 ], - "RightRide_Cup_back": [ 673, 102, 96, 98 ], - "LeftChina_back": [ 0, 102, 96, 98 ], - "RightChina_back": [ 673, 102, 96, 98 ], - "LeftSplash_back": [ 0, 102, 96, 98 ], - "RightSplash_back": [ 673, 102, 96, 98 ], - "LeftCymbal_Mute_back": [ 0, 0, 0, 0 ], - "RightCymbal_Mute_back": [ 0, 0, 0, 0 ], - }, - - "//4": "縦方向中央位置(全チップ共通", - "縦方向中央位置": 49 -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\201\343\203\203\343\203\227.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\201\343\203\203\343\203\227.yaml" new file mode 100644 index 0000000..73843d9 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\201\343\203\203\343\203\227.yaml" @@ -0,0 +1,69 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + + # チップ本体。各 Name は 表示チップ種別 列挙子の名前であること。 + Unknown: [0, 0, 0, 0] + LeftCymbal: [0, 0, 96, 98] + RightCymbal: [673, 0, 96, 98] + HiHat: [100, 0, 70, 98] + HiHat_Open: [100, 0, 70, 98] + HiHat_HalfOpen: [100, 0, 70, 98] + Foot: [177, 0, 73, 98] + LeftPedal: [177, 0, 73, 98] + Snare: [255, 0, 84, 98] + Snare_OpenRim: [255, 0, 84, 98] + Snare_ClosedRim: [255, 202, 84, 98] + Snare_Ghost: [255, 102, 84, 98] + Bass: [348, 0, 90, 98] + LeftBass: [177, 0, 73, 98] + Tom1: [443, 0, 71, 98] + Tom1_Rim: [443, 202, 71, 98] + Tom2: [518, 0, 71, 98] + Tom2_Rim: [518, 202, 71, 98] + Tom3: [594, 0, 71, 98] + Tom3_Rim: [594, 202, 71, 98] + LeftRide: [0, 0, 96, 98] + RightRide: [673, 0, 96, 98] + LeftRide_Cup: [0, 0, 96, 98] + RightRide_Cup: [673, 0, 96, 98] + LeftChina: [0, 0, 96, 98] + RightChina: [673, 0, 96, 98] + LeftSplash: [0, 0, 96, 98] + RightSplash: [673, 0, 96, 98] + LeftCymbal_Mute: [0, 0, 0, 0] + RightCymbal_Mute: [0, 0, 0, 0] + + # パッド絵。各 Name は 表示チップ種別 列挙子の名前 + '_back' であること。 + Unknown_back: [0, 0, 0, 0] + LeftCymbal_back: [0, 102, 96, 98] + RightCymbal_back: [673, 102, 96, 98] + HiHat_back: [103, 102, 70, 98] + HiHat_Open_back: [103, 202, 70, 98] + HiHat_HalfOpen_back: [103, 202, 70, 98] + Foot_back: [177, 102, 73, 98] + LeftPedal_back: [177, 102, 73, 98] + Snare_back: [0, 0, 0, 0] + Snare_OpenRim_back: [0, 0, 0, 0] + Snare_ClosedRim_back: [0, 0, 0, 0] + Snare_Ghost_back: [0, 0, 0, 0] + Bass_back: [348, 102, 90, 98] + LeftBass_back: [177, 102, 73, 98] + Tom1_back: [0, 0, 0, 0] + Tom1_Rim_back: [0, 0, 0, 0] + Tom2_back: [0, 0, 0, 0] + Tom2_Rim_back: [0, 0, 0, 0] + Tom3_back: [0, 0, 0, 0] + Tom3_Rim_back: [0, 0, 0, 0] + LeftRide_back: [0, 102, 96, 98] + RightRide_back: [673, 102, 96, 98] + LeftRide_Cup_back: [0, 102, 96, 98] + RightRide_Cup_back: [673, 102, 96, 98] + LeftChina_back: [0, 102, 96, 98] + RightChina_back: [673, 102, 96, 98] + LeftSplash_back: [0, 102, 96, 98] + RightSplash_back: [673, 102, 96, 98] + LeftCymbal_Mute_back: [0, 0, 0, 0] + RightCymbal_Mute_back: [0, 0, 0, 0] + +# 縦方向中央位置(全チップ共通 +縦方向中央位置: 49 diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.json" deleted file mode 100644 index fbcd71f..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.json" +++ /dev/null @@ -1,29 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - - "//2": "パッド本体。各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": [ 0, 0, 0, 0 ], - "LeftCymbal": [ 1, 0, 91, 98 ], - "HiHat": [ 108, 0, 68, 98 ], - "Foot": [ 183, 0, 68, 98 ], - "Snare": [ 259, 0, 85, 98 ], - "Bass": [ 351, 0, 90, 98 ], - "Tom1": [ 447, 0, 72, 98 ], - "Tom2": [ 520, 0, 72, 98 ], - "Tom3": [ 594, 0, 72, 98 ], - "RightCymbal": [ 683, 0, 92, 98 ], - - "//3": "パッドフラッシュ。各 Name は 表示レーン種別 列挙子の名前 + '_Flush' であること。", - "Unknown_Flush": [ 0, 0, 0, 0 ], - "LeftCymbal_Flush": [ 1, 98, 91, 98 ], - "HiHat_Flush": [ 108, 98, 68, 98 ], - "Foot_Flush": [ 183, 98, 68, 98 ], - "Snare_Flush": [ 259, 98, 85, 98 ], - "Bass_Flush": [ 351, 98, 90, 98 ], - "Tom1_Flush": [ 447, 98, 72, 98 ], - "Tom2_Flush": [ 520, 98, 72, 98 ], - "Tom3_Flush": [ 594, 98, 72, 98 ], - "RightCymbal_Flush": [ 683, 98, 92, 98 ] - } -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.yaml" new file mode 100644 index 0000000..04773d3 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.yaml" @@ -0,0 +1,26 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + + # パッド本体。各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: [0, 0, 0, 0] + LeftCymbal: [1, 0, 91, 98] + HiHat: [108, 0, 68, 98] + Foot: [183, 0, 68, 98] + Snare: [259, 0, 85, 98] + Bass: [351, 0, 90, 98] + Tom1: [447, 0, 72, 98] + Tom2: [520, 0, 72, 98] + Tom3: [594, 0, 72, 98] + RightCymbal: [683, 0, 92, 98] + + # パッドフラッシュ。各 Name は 表示レーン種別 列挙子の名前 + ''_Flush'' であること。 + Unknown_Flush: [0, 0, 0, 0] + LeftCymbal_Flush: [1, 98, 91, 98] + HiHat_Flush: [108, 98, 68, 98] + Foot_Flush: [183, 98, 68, 98] + Snare_Flush: [259, 98, 85, 98] + Bass_Flush: [351, 98, 90, 98] + Tom1_Flush: [447, 98, 72, 98] + Tom2_Flush: [520, 98, 72, 98] + Tom3_Flush: [594, 98, 72, 98] + RightCymbal_Flush: [683, 98, 92, 98] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\224\250\345\210\244\345\256\232\347\250\256\345\210\245\346\226\207\345\255\227.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\224\250\345\210\244\345\256\232\347\250\256\345\210\245\346\226\207\345\255\227.json" deleted file mode 100644 index e6fdc68..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\224\250\345\210\244\345\256\232\347\250\256\345\210\245\346\226\207\345\255\227.json" +++ /dev/null @@ -1,13 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "//2": "各 Name は 判定種別 列挙子の名前であること。", - "PERFECT": [ 0, 0, 87, 40 ], - "GREAT": [ 0, 40, 87, 40 ], - "GOOD": [ 0, 80, 87, 40 ], - "OK": [ 87, 0, 87, 40 ], - "MISS": [ 87, 40, 87, 40 ], - "//3": "MAX COMBO", - "MaxCombo": [ 87, 80, 87, 40 ] - } -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\224\250\345\210\244\345\256\232\347\250\256\345\210\245\346\226\207\345\255\227.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\224\250\345\210\244\345\256\232\347\250\256\345\210\245\346\226\207\345\255\227.yaml" new file mode 100644 index 0000000..41777aa --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\224\250\345\210\244\345\256\232\347\250\256\345\210\245\346\226\207\345\255\227.yaml" @@ -0,0 +1,10 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + # 各 Name は 判定種別 列挙子の名前であること。 + PERFECT: [0, 0, 87, 40] + GREAT: [0, 40, 87, 40] + GOOD: [0, 80, 87, 40] + OK: [87, 0, 87, 40] + MISS: [87, 40, 87, 40] + # 'MAX COMBO' + MaxCombo: [87, 80, 87, 40] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.json" deleted file mode 100644 index 7996ce6..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.json" +++ /dev/null @@ -1,18 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "//2": "レーンフラッシュ。各 Name は 表示レーン種別 列挙子の名前 であること。", - "Unknown": [ 0, 0, 0, 0 ], - "LeftCymbal": [ 1, 0, 91, 196 ], - "HiHat": [ 108, 0, 68, 196 ], - "Foot": [ 183, 0, 68, 196 ], - "Snare": [ 259, 0, 85, 196 ], - "Bass": [ 351, 0, 90, 196 ], - "Tom1": [ 447, 0, 72, 196 ], - "Tom2": [ 520, 0, 72, 196 ], - "Tom3": [ 594, 0, 72, 196 ], - "RightCymbal": [ 683, 0, 92, 196 ] - } -} - - diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.yaml" new file mode 100644 index 0000000..bf400fe --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.yaml" @@ -0,0 +1,13 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + # レーンフラッシュ。各 Name は 表示レーン種別 列挙子の名前 であること。 + Unknown: [0, 0, 0, 0] + LeftCymbal: [1, 0, 91, 196] + HiHat: [108, 0, 68, 196] + Foot: [183, 0, 68, 196] + Snare: [259, 0, 85, 196] + Bass: [351, 0, 90, 196] + Tom1: [447, 0, 72, 196] + Tom2: [520, 0, 72, 196] + Tom3: [594, 0, 72, 196] + RightCymbal: [683, 0, 92, 196] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeA.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeA.json" deleted file mode 100644 index d5aa9b9..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeA.json" +++ /dev/null @@ -1,56 +0,0 @@ -{ - "//0": "レーン配置TypeA: LC HH LP SD HT BD LT FT RC", - - "//1": "レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。", - "左端位置": { - "//2": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 1, - "HiHat": 108, - "Foot": 183, - "Snare": 258, - "Tom1": 344, - "Bass": 428, - "Tom2": 521, - "Tom3": 595, - "RightCymbal": 677 - }, - "//3": "表示レーンの幅。", - "幅": { - "//4": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 96, - "HiHat": 70, - "Foot": 73, - "Snare": 84, - "Tom1": 71, - "Bass": 90, - "Tom2": 71, - "Tom3": 71, - "RightCymbal": 96 - }, - "//5": "レーン間の線の矩形。", - "レーンライン": [ - [ 96, 0, 4, 938 ], - [ 104, 0, 4, 938 ], - - [ 179, 0, 4, 938 ], - - [ 256, 0, 4, 938 ], - - [ 340, 0, 4, 938 ], - - [ 416, 0, 4, 938 ], - [ 423, 0, 4, 938 ], - - [ 518, 0, 4, 938 ], - - [ 592, 0, 4, 938 ], - - [ 665, 0, 4, 938 ], - [ 673, 0, 4, 938 ] - ], - "//6": "レーンの色。A8R8G8B8。", - "レーン色": "80000000", - "レーンライン色": "ff5d5d5d" -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeA.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeA.yaml" new file mode 100644 index 0000000..1a3bb12 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeA.yaml" @@ -0,0 +1,43 @@ +# レーン配置TypeA: LC HH LP SD HT BD LT FT RC +# レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。 +左端位置: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 1 + HiHat: 108 + Foot: 183 + Snare: 258 + Tom1: 344 + Bass: 428 + Tom2: 521 + Tom3: 595 + RightCymbal: 677 +# 表示レーンの幅。 +幅: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 96 + HiHat: 70 + Foot: 73 + Snare: 84 + Tom1: 71 + Bass: 90 + Tom2: 71 + Tom3: 71 + RightCymbal: 96 +# レーン間の線の矩形。 +レーンライン: + - [96, 0, 4, 938] + - [104, 0, 4, 938] + - [179, 0, 4, 938] + - [256, 0, 4, 938] + - [340, 0, 4, 938] + - [416, 0, 4, 938] + - [423, 0, 4, 938] + - [518, 0, 4, 938] + - [592, 0, 4, 938] + - [665, 0, 4, 938] + - [673, 0, 4, 938] +# レーンの色。A8R8G8B8。 +レーン色: ff000000 +レーンライン色: ff5d5d5d diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeB.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeB.json" deleted file mode 100644 index 8e11c37..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeB.json" +++ /dev/null @@ -1,56 +0,0 @@ -{ - "//0": "レーン配置TypeB: LC HH SD LP BD HT LT FT RC", - - "//1": "レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。", - "左端位置": { - "//2": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 1, - "HiHat": 108, - "Snare": 183, - "Foot": 270, - "Bass": 354, - "Tom1": 447, - "Tom2": 521, - "Tom3": 595, - "RightCymbal": 677 - }, - "//3": "表示レーンの幅。", - "幅": { - "//4": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 96, - "HiHat": 70, - "Snare": 84, - "Foot": 73, - "Bass": 90, - "Tom1": 71, - "Tom2": 71, - "Tom3": 71, - "RightCymbal": 96 - }, - "//5": "レーン間の線の矩形。", - "レーンライン": [ - [ 96, 0, 4, 938 ], - [ 104, 0, 4, 938 ], - - [ 179, 0, 4, 938 ], - - [ 266, 0, 4, 938 ], - - [ 343, 0, 4, 938 ], - [ 350, 0, 4, 938 ], - - [ 443, 0, 4, 938 ], - - [ 518, 0, 4, 938 ], - - [ 592, 0, 4, 938 ], - - [ 665, 0, 4, 938 ], - [ 673, 0, 4, 938 ] - ], - "//6": "レーンの色。A8R8G8B8。", - "レーン色": "80000000", - "レーンライン色": "ff5d5d5d" -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeB.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeB.yaml" new file mode 100644 index 0000000..d7750b0 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeB.yaml" @@ -0,0 +1,43 @@ +# レーン配置TypeB: LC HH SD LP BD HT LT FT RC +# レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。 +左端位置: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 1 + HiHat: 108 + Snare: 183 + Foot: 270 + Bass: 354 + Tom1: 447 + Tom2: 521 + Tom3: 595 + RightCymbal: 677 +# 表示レーンの幅。 +幅: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 96 + HiHat: 70 + Snare: 84 + Foot: 73 + Bass: 90 + Tom1: 71 + Tom2: 71 + Tom3: 71 + RightCymbal: 96 +# レーン間の線の矩形。 +レーンライン: + - [96, 0, 4, 938] + - [104, 0, 4, 938] + - [179, 0, 4, 938] + - [266, 0, 4, 938] + - [343, 0, 4, 938] + - [350, 0, 4, 938] + - [443, 0, 4, 938] + - [518, 0, 4, 938] + - [592, 0, 4, 938] + - [665, 0, 4, 938] + - [673, 0, 4, 938] +# レーンの色。A8R8G8B8。 +レーン色: ff000000 +レーンライン色: ff5d5d5d diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeC.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeC.json" deleted file mode 100644 index 2e94c72..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeC.json" +++ /dev/null @@ -1,56 +0,0 @@ -{ - "//0": "レーン配置TypeC: LC HH LP SD HT BD LT FT RC", - - "//1": "レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。", - "左端位置": { - "//2": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 1, - "HiHat": 108, - "Foot": 183, - "Snare": 258, - "Bass": 352, - "Tom1": 446, - "Tom2": 521, - "Tom3": 595, - "RightCymbal": 677 - }, - "//3": "表示レーンの幅。", - "幅": { - "//4": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 96, - "HiHat": 70, - "Foot": 73, - "Snare": 84, - "Bass": 90, - "Tom1": 71, - "Tom2": 71, - "Tom3": 71, - "RightCymbal": 96 - }, - "//5": "レーン間の線の矩形。", - "レーンライン": [ - [ 96, 0, 4, 938 ], - [ 104, 0, 4, 938 ], - - [ 179, 0, 4, 938 ], - - [ 256, 0, 4, 938 ], - - [ 340, 0, 4, 938 ], - [ 347, 0, 4, 938 ], - - [ 443, 0, 4, 938 ], - - [ 518, 0, 4, 938 ], - - [ 592, 0, 4, 938 ], - - [ 665, 0, 4, 938 ], - [ 673, 0, 4, 938 ] - ], - "//6": "レーンの色。A8R8G8B8。", - "レーン色": "80000000", - "レーンライン色": "ff5d5d5d" -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeC.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeC.yaml" new file mode 100644 index 0000000..ed5f67c --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeC.yaml" @@ -0,0 +1,43 @@ +# レーン配置TypeC: LC HH LP SD HT BD LT FT RC +# レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。 +左端位置: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 1 + HiHat: 108 + Foot: 183 + Snare: 258 + Bass: 352 + Tom1: 446 + Tom2: 521 + Tom3: 595 + RightCymbal: 677 +# 表示レーンの幅。 +幅: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 96 + HiHat: 70 + Foot: 73 + Snare: 84 + Bass: 90 + Tom1: 71 + Tom2: 71 + Tom3: 71 + RightCymbal: 96 +# レーン間の線の矩形。 +レーンライン: + - [96, 0, 4, 938] + - [104, 0, 4, 938] + - [179, 0, 4, 938] + - [256, 0, 4, 938] + - [340, 0, 4, 938] + - [347, 0, 4, 938] + - [443, 0, 4, 938] + - [518, 0, 4, 938] + - [592, 0, 4, 938] + - [665, 0, 4, 938] + - [673, 0, 4, 938] +# レーンの色。A8R8G8B8。 +レーン色: ff000000 +レーンライン色: ff5d5d5d diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeD.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeD.json" deleted file mode 100644 index fd750ab..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeD.json" +++ /dev/null @@ -1,56 +0,0 @@ -{ - "//0": "レーン配置TypeD: LC HH SD HT LP BD LP FT RC", - - "//1": "レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。", - "左端位置": { - "//2": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 1, - "HiHat": 108, - "Snare": 183, - "Tom1": 271, - "Foot": 346, - "Bass": 430, - "Tom2": 521, - "Tom3": 595, - "RightCymbal": 677 - }, - "//3": "表示レーンの幅。", - "幅": { - "//4": "各 Name は 表示レーン種別 列挙子の名前であること。", - "Unknown": 0, - "LeftCymbal": 96, - "HiHat": 70, - "Snare": 84, - "Tom1": 71, - "Foot": 73, - "Bass": 90, - "Tom2": 71, - "Tom3": 71, - "RightCymbal": 96 - }, - "//5": "レーン間の線の矩形。", - "レーンライン": [ - [ 96, 0, 4, 938 ], - [ 104, 0, 4, 938 ], - - [ 179, 0, 4, 938 ], - - [ 267, 0, 4, 938 ], - - [ 342, 0, 4, 938 ], - - [ 419, 0, 4, 938 ], - [ 426, 0, 4, 938 ], - - [ 518, 0, 4, 938 ], - - [ 592, 0, 4, 938 ], - - [ 665, 0, 4, 938 ], - [ 673, 0, 4, 938 ] - ], - "//6": "レーンの色。A8R8G8B8。", - "レーン色": "80000000", - "レーンライン色": "ff5d5d5d" -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeD.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeD.yaml" new file mode 100644 index 0000000..dc6283c --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\351\205\215\347\275\256/TypeD.yaml" @@ -0,0 +1,43 @@ +# レーン配置TypeD: LC HH SD HT LP BD LP FT RC +# レーンフレーム全領域の左端からみた、表示レーンの左端の相対X位置。 +左端位置: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 1 + HiHat: 108 + Snare: 183 + Tom1: 271 + Foot: 346 + Bass: 430 + Tom2: 521 + Tom3: 595 + RightCymbal: 677 +# 表示レーンの幅。 +幅: + # 各 Name は 表示レーン種別 列挙子の名前であること。 + Unknown: 0 + LeftCymbal: 96 + HiHat: 70 + Snare: 84 + Tom1: 71 + Foot: 73 + Bass: 90 + Tom2: 71 + Tom3: 71 + RightCymbal: 96 +# レーン間の線の矩形。 +レーンライン: + - [96, 0, 4, 938] + - [104, 0, 4, 938] + - [179, 0, 4, 938] + - [267, 0, 4, 938] + - [342, 0, 4, 938] + - [419, 0, 4, 938] + - [426, 0, 4, 938] + - [518, 0, 4, 938] + - [592, 0, 4, 938] + - [665, 0, 4, 938] + - [673, 0, 4, 938] +# レーンの色。A8R8G8B8。 +レーン色: ff000000 +レーンライン色: ff5d5d5d diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.json" deleted file mode 100644 index f06215d..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.json" +++ /dev/null @@ -1,13 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "//2": "各 Name は 判定種別 列挙子の名前であること。", - "PERFECT": [ 0, 0, 144, 42 ], - "GREAT": [ 0, 42, 144, 42 ], - "GOOD": [ 0, 84, 144, 42 ], - "OK": [ 0, 126, 144, 42 ], - "MISS": [ 0, 168, 144, 42 ], - "//3": "ヒット光", - "PERFECT光": [ 154, 0, 8, 315 ] - } -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.yaml" new file mode 100644 index 0000000..4ac3a96 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.yaml" @@ -0,0 +1,10 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + # 各 Name は 判定種別 列挙子の名前であること。 + PERFECT: [0, 0, 144, 42] + GREAT: [0, 42, 144, 42] + GOOD: [0, 84, 144, 42] + OK: [0, 126, 144, 42] + MISS: [0, 168, 144, 42] + # ヒット光 + PERFECT光: [154, 0, 8, 315] diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\346\274\224\345\245\217\344\275\215\347\275\256\343\202\253\343\203\274\343\202\275\343\203\253.json" "b/DTXMania/System/Images/\346\274\224\345\245\217/\346\274\224\345\245\217\344\275\215\347\275\256\343\202\253\343\203\274\343\202\275\343\203\253.json" deleted file mode 100644 index f2554c4..0000000 --- "a/DTXMania/System/Images/\346\274\224\345\245\217/\346\274\224\345\245\217\344\275\215\347\275\256\343\202\253\343\203\274\343\202\275\343\203\253.json" +++ /dev/null @@ -1,8 +0,0 @@ -{ - "矩形リスト": { - "//1": "4つの数値は、Left, Top, Widht, Height の順。", - "Bar": [ 9, 8, 72, 8 ], - "Left": [ 0, 17, 12, 24 ], - "Right": [ 86, 17, 12, 24 ] - } -} diff --git "a/DTXMania/System/Images/\346\274\224\345\245\217/\346\274\224\345\245\217\344\275\215\347\275\256\343\202\253\343\203\274\343\202\275\343\203\253.yaml" "b/DTXMania/System/Images/\346\274\224\345\245\217/\346\274\224\345\245\217\344\275\215\347\275\256\343\202\253\343\203\274\343\202\275\343\203\253.yaml" new file mode 100644 index 0000000..345d150 --- /dev/null +++ "b/DTXMania/System/Images/\346\274\224\345\245\217/\346\274\224\345\245\217\344\275\215\347\275\256\343\202\253\343\203\274\343\202\275\343\203\253.yaml" @@ -0,0 +1,5 @@ +矩形リスト: + # 4つの数値は、Left, Top, Widht, Height の順。 + Bar: [9, 8, 72, 8] + Left: [0, 17, 12, 24] + Right: [86, 17, 12, 24] diff --git "a/DTXMania/System/sounds/presets/default/\343\202\253\343\203\274\343\202\275\343\203\253\347\247\273\345\213\225\351\237\263.ogg" "b/DTXMania/System/sounds/presets/default/\343\202\253\343\203\274\343\202\275\343\203\253\347\247\273\345\213\225\351\237\263.ogg" new file mode 100644 index 0000000..c7e4463 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\343\202\253\343\203\274\343\202\275\343\203\253\347\247\273\345\213\225\351\237\263.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\343\202\271\343\203\206\343\203\274\343\202\270\343\202\257\343\203\252\343\202\242.ogg" "b/DTXMania/System/sounds/presets/default/\343\202\271\343\203\206\343\203\274\343\202\270\343\202\257\343\203\252\343\202\242.ogg" new file mode 100644 index 0000000..df4e461 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\343\202\271\343\203\206\343\203\274\343\202\270\343\202\257\343\203\252\343\202\242.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\343\202\271\343\203\206\343\203\274\343\202\270\345\244\261\346\225\227.ogg" "b/DTXMania/System/sounds/presets/default/\343\202\271\343\203\206\343\203\274\343\202\270\345\244\261\346\225\227.ogg" new file mode 100644 index 0000000..40ecff9 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\343\202\271\343\203\206\343\203\274\343\202\270\345\244\261\346\225\227.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\343\202\277\343\202\244\343\203\210\343\203\253\343\202\271\343\203\206\343\203\274\343\202\270_\347\242\272\345\256\232\351\237\263.ogg" "b/DTXMania/System/sounds/presets/default/\343\202\277\343\202\244\343\203\210\343\203\253\343\202\271\343\203\206\343\203\274\343\202\270_\347\242\272\345\256\232\351\237\263.ogg" new file mode 100644 index 0000000..fe2b0c1 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\343\202\277\343\202\244\343\203\210\343\203\253\343\202\271\343\203\206\343\203\274\343\202\270_\347\242\272\345\256\232\351\237\263.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\343\203\225\343\203\253\343\202\263\343\203\263\343\203\234.ogg" "b/DTXMania/System/sounds/presets/default/\343\203\225\343\203\253\343\202\263\343\203\263\343\203\234.ogg" new file mode 100644 index 0000000..240167b Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\343\203\225\343\203\253\343\202\263\343\203\263\343\203\234.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\345\217\226\346\266\210\351\237\263.ogg" "b/DTXMania/System/sounds/presets/default/\345\217\226\346\266\210\351\237\263.ogg" new file mode 100644 index 0000000..2e38534 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\345\217\226\346\266\210\351\237\263.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\345\244\211\346\233\264\351\237\263.ogg" "b/DTXMania/System/sounds/presets/default/\345\244\211\346\233\264\351\237\263.ogg" new file mode 100644 index 0000000..21e47ee Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\345\244\211\346\233\264\351\237\263.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\346\255\223\345\243\260.ogg" "b/DTXMania/System/sounds/presets/default/\346\255\223\345\243\260.ogg" new file mode 100644 index 0000000..43a7778 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\346\255\223\345\243\260.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\346\261\272\345\256\232\351\237\263.ogg" "b/DTXMania/System/sounds/presets/default/\346\261\272\345\256\232\351\237\263.ogg" new file mode 100644 index 0000000..0d13ce5 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\346\261\272\345\256\232\351\237\263.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270_\343\203\255\343\202\260\343\202\244\343\203\263\351\237\263.ogg" "b/DTXMania/System/sounds/presets/default/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270_\343\203\255\343\202\260\343\202\244\343\203\263\351\237\263.ogg" new file mode 100644 index 0000000..fe2b0c1 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270_\343\203\255\343\202\260\343\202\244\343\203\263\351\237\263.ogg" differ diff --git "a/DTXMania/System/sounds/presets/default/\351\201\270\346\233\262\343\202\271\343\203\206\343\203\274\343\202\270_\346\233\262\346\261\272\345\256\232\351\237\263.ogg" "b/DTXMania/System/sounds/presets/default/\351\201\270\346\233\262\343\202\271\343\203\206\343\203\274\343\202\270_\346\233\262\346\261\272\345\256\232\351\237\263.ogg" new file mode 100644 index 0000000..fe2b0c1 Binary files /dev/null and "b/DTXMania/System/sounds/presets/default/\351\201\270\346\233\262\343\202\271\343\203\206\343\203\274\343\202\270_\346\233\262\346\261\272\345\256\232\351\237\263.ogg" differ diff --git a/DTXMania/Version.cs b/DTXMania/Version.cs new file mode 100644 index 0000000..a1a36de --- /dev/null +++ b/DTXMania/Version.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Reflection; + +namespace DTXMania +{ + /// + /// バージョン情報。外部アセンブラ向け。 + /// + public static class Version + { + public static int Major => Assembly.GetExecutingAssembly().GetName().Version.Major; + + public static int Minor => Assembly.GetExecutingAssembly().GetName().Version.Minor; + + public static int Revision => Assembly.GetExecutingAssembly().GetName().Version.Revision; + + public static int Build => Assembly.GetExecutingAssembly().GetName().Version.Build; + } +} diff --git a/DTXMania/packages.config b/DTXMania/packages.config index a372811..969c38c 100644 --- a/DTXMania/packages.config +++ b/DTXMania/packages.config @@ -5,7 +5,6 @@ - @@ -26,4 +25,5 @@ + \ No newline at end of file diff --git "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/GO.cs" "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/GO.cs" index 93aabb8..9dd269f 100644 --- "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/GO.cs" +++ "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/GO.cs" @@ -34,7 +34,7 @@ protected override void On活性化() foreach( var s in this._文字アニメーション ) { s.画像.加算合成 = true; - this.子を追加する( s.画像 ); + this.子Activityを追加する( s.画像 ); } //---------------- #endregion @@ -74,7 +74,7 @@ protected override void On非活性化() { foreach( var s in this._文字アニメーション ) { - this.子を削除する( s.画像 ); + this.子Activityを削除する( s.画像 ); s.Dispose(); } this._文字アニメーション = null; diff --git "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\343\202\267\343\203\243\343\203\203\343\202\277\343\203\274.cs" "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\343\202\267\343\203\243\343\203\203\343\202\277\343\203\274.cs" index 5967078..dbb218f 100644 --- "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\343\202\267\343\203\243\343\203\203\343\202\277\343\203\274.cs" +++ "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\343\202\267\343\203\243\343\203\203\343\202\277\343\203\274.cs" @@ -15,7 +15,7 @@ public シャッター() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._ロゴ = new 画像( @"$(System)images\タイトルロゴ.png" ) ); + this.子Activityを追加する( this._ロゴ = new 画像( @"$(System)images\タイトルロゴ.png" ) ); } } diff --git "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\215\212\345\233\236\350\273\242\351\273\222\343\203\225\343\202\247\343\203\274\343\203\211.cs" "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\215\212\345\233\236\350\273\242\351\273\222\343\203\225\343\202\247\343\203\274\343\203\211.cs" index 9e19a90..9df3a01 100644 --- "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\215\212\345\233\236\350\273\242\351\273\222\343\203\225\343\202\247\343\203\274\343\203\211.cs" +++ "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\215\212\345\233\236\350\273\242\351\273\222\343\203\225\343\202\247\343\203\274\343\203\211.cs" @@ -15,7 +15,7 @@ public 半回転黒フェード() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._ロゴ画像 = new 画像( @"$(System)images\タイトルロゴ・影.png" ) ); + this.子Activityを追加する( this._ロゴ画像 = new 画像( @"$(System)images\タイトルロゴ・影.png" ) ); } } diff --git "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\233\236\350\273\242\345\271\225.cs" "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\233\236\350\273\242\345\271\225.cs" index 985e712..f7758fb 100644 --- "a/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\233\236\350\273\242\345\271\225.cs" +++ "b/DTXMania/\343\202\242\343\202\244\343\202\255\343\203\243\343\203\203\343\203\201/\345\233\236\350\273\242\345\271\225.cs" @@ -49,9 +49,9 @@ public 回転幕() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._ロゴ = new 画像( @"$(System)images\タイトルロゴ.png" ) ); - this.子を追加する( this._画面BC_アイキャッチ遷移画面1_回転中 = new 舞台画像() ); - this.子を追加する( this._画面D_アイキャッチ遷移画面2_逆回転中 = new 舞台画像() ); + this.子Activityを追加する( this._ロゴ = new 画像( @"$(System)images\タイトルロゴ.png" ) ); + this.子Activityを追加する( this._画面BC_アイキャッチ遷移画面1_回転中 = new 舞台画像() ); + this.子Activityを追加する( this._画面D_アイキャッチ遷移画面2_逆回転中 = new 舞台画像() ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/01\350\265\267\345\213\225/\350\265\267\345\213\225\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/01\350\265\267\345\213\225/\350\265\267\345\213\225\343\202\271\343\203\206\343\203\274\343\202\270.cs" index 1658836..e148a9f 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/01\350\265\267\345\213\225/\350\265\267\345\213\225\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/01\350\265\267\345\213\225/\350\265\267\345\213\225\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -21,6 +21,7 @@ public enum フェーズ 開始, 曲ツリー構築中, ドラムサウンド構築中, + 開始音終了待ち, 確定, キャンセル, } @@ -31,7 +32,7 @@ public 起動ステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._コンソールフォント = new 画像フォント( @"$(System)images\コンソールフォント20x32.png", @"$(System)images\コンソールフォント20x32.json", 文字幅補正dpx: -6f ) ); + this.子Activityを追加する( this._コンソールフォント = new 画像フォント( @"$(System)images\コンソールフォント20x32.png", @"$(System)images\コンソールフォント20x32.yaml", 文字幅補正dpx: -6f ) ); } } @@ -39,13 +40,28 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + if( !App.ビュアーモードである ) + { + App.システムサウンド.再生する( 設定.システムサウンド種別.起動ステージ_開始音 ); + App.システムサウンド.再生する( 設定.システムサウンド種別.起動ステージ_ループBGM, ループ再生する: true ); + } + + this._コンソール表示内容 = new List() { + $"{App.属性().Title} r{App.リリース番号:000}", + $"{App.属性().Copyright}", + $"", + }; + this.現在のフェーズ = フェーズ.開始; } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.システムサウンド.停止する( 設定.システムサウンド種別.起動ステージ_開始音 ); + App.システムサウンド.停止する( 設定.システムサウンド種別.起動ステージ_ループBGM ); } } @@ -53,8 +69,8 @@ public override void 進行描画する( DeviceContext1 dc ) { // 進行描画 - this._コンソールフォント.描画する( dc, 0f, 0f, $"{App.属性().Title} r{App.リリース番号:000}" ); - this._コンソールフォント.描画する( dc, 0f, 32f, $"{App.属性().Copyright}" ); + for( int i = 0; i < this._コンソール表示内容.Count; i++ ) + this._コンソールフォント.描画する( dc, 0f, i * 32f, this._コンソール表示内容[ i ] ); switch( this.現在のフェーズ ) { @@ -88,6 +104,8 @@ public override void 進行描画する( DeviceContext1 dc ) } ); } + this._コンソール表示内容.Add( "" ); + this.現在のフェーズ = フェーズ.曲ツリー構築中; //---------------- #endregion @@ -99,20 +117,21 @@ public override void 進行描画する( DeviceContext1 dc ) if( App.ビュアーモードである ) { // ビュアーモードならスキップ。 - this._コンソールフォント.描画する( dc, 0f, 96f, $"Loading and decoding sounds ..." ); + this._コンソール表示内容.Add( $"Loading and decoding sounds ..." ); this.現在のフェーズ = フェーズ.ドラムサウンド構築中; } else { // 構築タスクの進捗表示。 - this._コンソールフォント.描画する( dc, 0f, 96f, $"Enumerating and loading score properties from file ... {Interlocked.Read( ref this._ファイル検出数 )}" ); + this._コンソール表示内容.RemoveAt( this._コンソール表示内容.Count - 1 ); + this._コンソール表示内容.Add( $"Enumerating and loading score properties from file ... {Interlocked.Read( ref this._ファイル検出数 )}" ); // 構築タスクが完了したら、次のフェーズへ遷移する。 if( this._構築タスク.IsCompleted || this._構築タスク.IsCanceled ) { App.曲ツリー.活性化する(); - this._コンソールフォント.描画する( dc, 0f, 128f, $"Loading and decoding sounds ..." ); + this._コンソール表示内容.Add( $"Loading and decoding sounds ..." ); this.現在のフェーズ = フェーズ.ドラムサウンド構築中; } } @@ -125,12 +144,25 @@ public override void 進行描画する( DeviceContext1 dc ) //---------------- { App.ドラムサウンド.初期化する(); - this.現在のフェーズ = フェーズ.確定; + + this._コンソール表示内容.RemoveAt( this._コンソール表示内容.Count - 1 ); + this._コンソール表示内容.Add( $"Loading and decoding sounds ... done." ); + + this.現在のフェーズ = フェーズ.開始音終了待ち; } //---------------- #endregion break; + case フェーズ.開始音終了待ち: + #region " 起動ステージ_開始音 が終了するまで待つ。" + //---------------- + if( !App.システムサウンド.再生中( 設定.システムサウンド種別.起動ステージ_開始音 ) ) + this.現在のフェーズ = フェーズ.確定; // 再生が終わったのでフェーズ遷移。 + //---------------- + #endregion + break; + case フェーズ.確定: case フェーズ.キャンセル: break; @@ -149,6 +181,7 @@ public override void 進行描画する( DeviceContext1 dc ) private 画像フォント _コンソールフォント = null; + private List _コンソール表示内容 = null; private Task _構築タスク = null; private long _ファイル検出数 = 0; } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/02\343\202\277\343\202\244\343\203\210\343\203\253/\343\202\277\343\202\244\343\203\210\343\203\253\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/02\343\202\277\343\202\244\343\203\210\343\203\253/\343\202\277\343\202\244\343\203\210\343\203\253\343\202\271\343\203\206\343\203\274\343\202\270.cs" index 3869265..f0d1574 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/02\343\202\277\343\202\244\343\203\210\343\203\253/\343\202\277\343\202\244\343\203\210\343\203\253\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/02\343\202\277\343\202\244\343\203\210\343\203\253/\343\202\277\343\202\244\343\203\210\343\203\253\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -27,9 +27,9 @@ public タイトルステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._舞台画像 = new 舞台画像() ); - this.子を追加する( this._タイトルロゴ = new 画像( @"$(System)images\タイトルロゴ.png" ) ); - this.子を追加する( this._パッドを叩いてください = new 文字列画像() { 表示文字列 = "パッドを叩いてください", フォントサイズpt = 40f, 描画効果 = 文字列画像.効果.縁取り } ); + this.子Activityを追加する( this._舞台画像 = new 舞台画像() ); + this.子Activityを追加する( this._タイトルロゴ = new 画像( @"$(System)images\タイトルロゴ.png" ) ); + this.子Activityを追加する( this._パッドを叩いてください = new 文字列画像() { 表示文字列 = "パッドを叩いてください", フォントサイズpt = 40f, 描画効果 = 文字列画像.効果.縁取り } ); } } @@ -38,15 +38,24 @@ protected override void On活性化() using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { this._帯ブラシ = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, new Color4( 0f, 0f, 0f, 0.8f ) ); + + App.システムサウンド.再生する( 設定.システムサウンド種別.タイトルステージ_開始音 ); + App.システムサウンド.再生する( 設定.システムサウンド種別.タイトルステージ_ループBGM, ループ再生する: true ); + this.現在のフェーズ = フェーズ.表示; base.On活性化(); } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.システムサウンド.停止する( 設定.システムサウンド種別.タイトルステージ_開始音 ); + App.システムサウンド.停止する( 設定.システムサウンド種別.タイトルステージ_ループBGM ); + //App.システムサウンド.停止する( 設定.システムサウンド種別.タイトルステージ_確定音 ); --> ならしっぱなしでいい + this._帯ブラシ?.Dispose(); this._帯ブラシ = null; @@ -80,6 +89,7 @@ public override void 進行描画する( DeviceContext1 dc ) if( App.入力管理.確定キーが入力された() ) { Log.Info( $"確定キーが入力されました。フェードアウトを開始します。" ); + App.システムサウンド.再生する( 設定.システムサウンド種別.タイトルステージ_確定音 ); App.ステージ管理.アイキャッチを選択しクローズする( nameof( シャッター ) ); this.現在のフェーズ = フェーズ.フェードアウト; } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\343\203\246\343\203\274\343\202\266\343\203\252\343\202\271\343\203\210.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\343\203\246\343\203\274\343\202\266\343\203\252\343\202\271\343\203\210.cs" index fedcb1a..b1c15b9 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\343\203\246\343\203\274\343\202\266\343\203\252\343\202\271\343\203\210.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\343\203\246\343\203\274\343\202\266\343\203\252\343\202\271\343\203\210.cs" @@ -34,26 +34,26 @@ public ユーザリスト() this._ユーザパネル = new Dictionary(); - this.子を追加する( image = new 画像( @"$(System)images\認証\パネル_0.png" ) ); + this.子Activityを追加する( image = new 画像( @"$(System)images\認証\パネル_0.png" ) ); this._ユーザパネル.Add( PlayMode.BASIC, image ); - this.子を追加する( image = new 画像( @"$(System)images\認証\パネル_1.png" ) ); + this.子Activityを追加する( image = new 画像( @"$(System)images\認証\パネル_1.png" ) ); this._ユーザパネル.Add( PlayMode.EXPERT, image ); this._ユーザパネル光彩付き = new Dictionary(); - this.子を追加する( image = new 画像( @"$(System)images\認証\パネル_0_光彩あり.png" ) ); + this.子Activityを追加する( image = new 画像( @"$(System)images\認証\パネル_0_光彩あり.png" ) ); this._ユーザパネル光彩付き.Add( PlayMode.BASIC, image ); - this.子を追加する( image = new 画像( @"$(System)images\認証\パネル_1_光彩あり.png" ) ); + this.子Activityを追加する( image = new 画像( @"$(System)images\認証\パネル_1_光彩あり.png" ) ); this._ユーザパネル光彩付き.Add( PlayMode.EXPERT, image ); this._ユーザ肩書きパネル = new Dictionary(); - this.子を追加する( image = new 画像( @"$(System)images\認証\肩書きパネル_0.png" ) ); + this.子Activityを追加する( image = new 画像( @"$(System)images\認証\肩書きパネル_0.png" ) ); this._ユーザ肩書きパネル.Add( PlayMode.BASIC, image ); - this.子を追加する( image = new 画像( @"$(System)images\認証\肩書きパネル_1.png" ) ); + this.子Activityを追加する( image = new 画像( @"$(System)images\認証\肩書きパネル_1.png" ) ); this._ユーザ肩書きパネル.Add( PlayMode.EXPERT, image ); - this.子を追加する( this._ユーザ名 = new 文字列画像() { + this.子Activityを追加する( this._ユーザ名 = new 文字列画像() { 表示文字列 = "", フォントサイズpt = 46f, 描画効果 = 文字列画像.効果.縁取り, diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270.cs" index b95e2fb..6a95d08 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -29,10 +29,10 @@ public 認証ステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._舞台画像 = new 舞台画像() ); - this.子を追加する( this._ウィンドウ画像 = new 画像( @"$(System)images\認証\ユーザ選択ウィンドウ.png" ) ); - this.子を追加する( this._プレイヤーを選択してください = new 文字列画像() { 表示文字列 = "プレイヤーを選択してください。", フォントサイズpt = 30f, 描画効果 = 文字列画像.効果.ドロップシャドウ } ); - this.子を追加する( this._ユーザリスト = new ユーザリスト() ); + this.子Activityを追加する( this._舞台画像 = new 舞台画像() ); + this.子Activityを追加する( this._ウィンドウ画像 = new 画像( @"$(System)images\認証\ユーザ選択ウィンドウ.png" ) ); + this.子Activityを追加する( this._プレイヤーを選択してください = new 文字列画像() { 表示文字列 = "プレイヤーを選択してください。", フォントサイズpt = 30f, 描画効果 = 文字列画像.効果.ドロップシャドウ } ); + this.子Activityを追加する( this._ユーザリスト = new ユーザリスト() ); } } @@ -40,14 +40,21 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.認証ステージ_開始音 ); + App.システムサウンド.再生する( 設定.システムサウンド種別.認証ステージ_ループBGM, ループ再生する: true ); + this.現在のフェーズ = フェーズ.フェードイン; this._初めての進行描画 = true; } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.システムサウンド.停止する( 設定.システムサウンド種別.認証ステージ_開始音 ); + App.システムサウンド.停止する( 設定.システムサウンド種別.認証ステージ_ループBGM ); + //App.システムサウンド.停止する( 設定.システムサウンド種別.認証ステージ_ログイン音 ); // --> なりっぱなしでいい } } @@ -104,19 +111,25 @@ public override void 進行描画する( DeviceContext1 dc ) if( App.入力管理.確定キーが入力された() ) { + App.システムサウンド.停止する( 設定.システムサウンド種別.認証ステージ_ループBGM ); + App.システムサウンド.再生する( 設定.システムサウンド種別.認証ステージ_ログイン音 ); + App.ステージ管理.アイキャッチを選択しクローズする( nameof( 回転幕 ) ); // アイキャッチを開始して this.現在のフェーズ = フェーズ.フェードアウト; // 次のフェーズへ。 } else if( App.入力管理.キャンセルキーが入力された() ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.取消音 ); this.現在のフェーズ = フェーズ.キャンセル; } else if( App.入力管理.上移動キーが入力された() ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.カーソル移動音 ); this._ユーザリスト.前のユーザを選択する(); } else if( App.入力管理.下移動キーが入力された() ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.カーソル移動音 ); this._ユーザリスト.次のユーザを選択する(); } } @@ -158,6 +171,7 @@ public override void 進行描画する( DeviceContext1 dc ) App.ユーザ管理.ユーザリスト.SelectItem( this._ユーザリスト.選択中のユーザ ); Log.Info( $"ユーザ「{App.ユーザ管理.ログオン中のユーザ.ユーザ名}」でログインしました。" ); + this.現在のフェーズ = フェーズ.確定; } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270_\343\202\277\343\203\203\343\203\201\343\202\242\343\202\244\343\202\263\343\203\263Ver.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270_\343\202\277\343\203\203\343\203\201\343\202\242\343\202\244\343\202\263\343\203\263Ver.cs" index cc58264..d69327c 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270_\343\202\277\343\203\203\343\203\201\343\202\242\343\202\244\343\202\263\343\203\263Ver.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/03\350\252\215\350\250\274/\350\252\215\350\250\274\343\202\271\343\203\206\343\203\274\343\202\270_\343\202\277\343\203\203\343\203\201\343\202\242\343\202\244\343\202\263\343\203\263Ver.cs" @@ -31,9 +31,9 @@ public 認証ステージ_タッチアイコンVer() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._舞台画像 = new 舞台画像() ); - this.子を追加する( this._タッチアイコン = new 画像( @"$(System)images\認証\タッチアイコン.png" ) ); - this.子を追加する( this._確認できませんでした = new 文字列画像() { 表示文字列 = "確認できませんでした。", フォントサイズpt = 40f, 描画効果 = 文字列画像.効果.ドロップシャドウ } ); + this.子Activityを追加する( this._舞台画像 = new 舞台画像() ); + this.子Activityを追加する( this._タッチアイコン = new 画像( @"$(System)images\認証\タッチアイコン.png" ) ); + this.子Activityを追加する( this._確認できませんでした = new 文字列画像() { 表示文字列 = "確認できませんでした。", フォントサイズpt = 40f, 描画効果 = 文字列画像.効果.ドロップシャドウ } ); } } protected override void On活性化() diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/BPM\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/BPM\343\203\221\343\203\215\343\203\253.cs" index 602d372..e49e6d9 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/BPM\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/BPM\343\203\221\343\203\215\343\203\253.cs" @@ -17,8 +17,8 @@ public BPMパネル() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._BPMパネル = new 画像( @"$(System)images\選曲\BPMパネル.png" ) ); - this.子を追加する( this._パラメータ文字 = new 画像フォント( @"$(System)images\パラメータ文字_小.png", @"$(System)images\パラメータ文字_小.json", 文字幅補正dpx: 0f ) ); + this.子Activityを追加する( this._BPMパネル = new 画像( @"$(System)images\選曲\BPMパネル.png" ) ); + this.子Activityを追加する( this._パラメータ文字 = new 画像フォント( @"$(System)images\パラメータ文字_小.png", @"$(System)images\パラメータ文字_小.yaml", 文字幅補正dpx: 0f ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\202\271\343\203\206\343\203\274\343\202\277\343\202\271\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\202\271\343\203\206\343\203\274\343\202\277\343\202\271\343\203\221\343\203\215\343\203\253.cs" index 0000b6d..e16260c 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\202\271\343\203\206\343\203\274\343\202\277\343\202\271\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\202\271\343\203\206\343\203\274\343\202\277\343\202\271\343\203\221\343\203\215\343\203\253.cs" @@ -17,7 +17,7 @@ public 曲ステータスパネル() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景画像 = new 画像( @"$(System)images\選曲\曲ステータスパネル.png" ) ); + this.子Activityを追加する( this._背景画像 = new 画像( @"$(System)images\選曲\曲ステータスパネル.png" ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\203\252\343\202\271\343\203\210.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\203\252\343\202\271\343\203\210.cs" index 07fe593..4a65b1c 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\203\252\343\202\271\343\203\210.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\343\203\252\343\202\271\343\203\210.cs" @@ -13,8 +13,11 @@ namespace DTXMania.ステージ.選曲 { /// /// 曲のリスト表示、選択、スクロール。 - /// 画面に表示される曲は8行だが、スクロールを勘案して上下に1行ずつ追加し、計10行として扱う。 /// + /// + /// を表示する。 + /// 画面に表示される曲は8行だが、スクロールを勘案して上下に1行ずつ追加し、計10行として扱う。 + /// class 曲リスト : Activity { public 曲リスト() @@ -28,6 +31,8 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.曲ツリー.フォーカスノードが変更された += this.曲ツリー_フォーカスノードが変更された; + #region " フォーカスノードを初期化する。" //---------------- { @@ -48,6 +53,7 @@ protected override void On活性化() else { // (B) なんらかのノードを選択中なら、それを継続して使用する(フォーカスノードをリセットしない)。 + tree.フォーカスノード.プレビュー音声を再生する(); } } //---------------- @@ -64,6 +70,7 @@ protected override void On活性化() this._初めての進行描画 = true; } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -180,6 +187,7 @@ public void 前のノードを選択する() this._選択ノードのオフセットアニメをリセットする( グラフィックデバイス.Instance.Animation ); } + public void 次のノードを選択する() { this._カーソル位置++; // 上限なし @@ -188,6 +196,7 @@ public void 次のノードを選択する() this._選択ノードのオフセットアニメをリセットする( グラフィックデバイス.Instance.Animation ); } + public void BOXに入る() { this._カーソル位置 = 4; @@ -196,6 +205,7 @@ public void BOXに入る() App.曲ツリー.フォーカスする( App.曲ツリー.フォーカスノード.子ノードリスト[ 0 ] ); } + public void BOXから出る() { this._カーソル位置 = 4; @@ -204,38 +214,51 @@ public void BOXから出る() App.曲ツリー.フォーカスする( App.曲ツリー.フォーカスノード.親ノード ); } + public void 難易度アンカをひとつ増やす() { App.曲ツリー.難易度アンカをひとつ増やす(); } + private bool _初めての進行描画 = true; + /// /// 曲リスト(10行分!)の合計表示領域の左上隅の座標。 /// 基準というのは、曲リストがスクロールしていないとき、という意味。 /// private readonly Vector3 _曲リストの基準左上隅座標dpx = new Vector3( 1065f, 145f - _ノードの高さdpx, 0f ); + private readonly Vector3 _サムネイル表示サイズdpx = new Vector3( 100f, 100f, 0f ); + private const float _ノードの高さdpx = ( 913f / 8f ); + private Dictionary _ノードto曲名画像 = new Dictionary(); + private Dictionary _ノードtoサブタイトル画像 = new Dictionary(); + /// /// 静止時は 4 。曲リストがスクロールしているときは、4より大きい整数(下から上にスクロール中)か、 /// または 4 より小さい整数(上から下にスクロール中)になる。 /// private int _カーソル位置 = 4; + private 定間隔進行 _スクロール用カウンタ = null; + /// /// -100~100。曲リスト全体の表示位置を、負数は 上 へ、正数は 下 へずらす 。(正負と上下の対応に注意。) /// private int _曲リスト全体のY軸移動オフセット = 0; + /// /// 選択中の曲ノードエリアを左にずらす度合い。 /// -50f ~ 0f [dpx] 。 /// private Variable _選択ノードの表示オフセットdpx = null; + private Storyboard _選択ノードの表示オフセットのストーリーボード = null; + /// /// 一番上:0 ~ 9:一番下。 /// 「静止時の」可視範囲は 1~8。 @@ -490,6 +513,7 @@ private void _ノードを描画する( DeviceContext1 dc, int 行番号, Node //---------------- #endregion } + private void _選択ノードのオフセットアニメをリセットする( アニメーション管理 am ) { this._選択ノードの表示オフセットdpx?.Dispose(); @@ -508,5 +532,18 @@ private void _選択ノードのオフセットアニメをリセットする( this._選択ノードの表示オフセットのストーリーボード.Schedule( am.Timer.Time ); } + + + private void 曲ツリー_フォーカスノードが変更された( object sender, (Node 選択されたNode, Node 選択が解除されたNode) e ) + { + // (1) 選択解除曲のプレビュー音声を止める。 + + e.選択が解除されたNode?.プレビュー音声を停止する(); + + + // (2) 選択曲のプレビュー音声を生成し、再生を始める。 + + e.選択されたNode?.プレビュー音声を再生する(); + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\345\210\245SKILL.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\345\210\245SKILL.cs" index a0c43af..7fa2765 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\345\210\245SKILL.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\346\233\262\345\210\245SKILL.cs" @@ -17,8 +17,8 @@ public 曲別SKILL() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大太斜.png", @"$(System)images\パラメータ文字_大太斜.json", 文字幅補正dpx: 0f ) ); - this.子を追加する( this._ロゴ画像 = new 画像( @"$(System)images\曲別SKILLアイコン2.png" ) ); + this.子Activityを追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大太斜.png", @"$(System)images\パラメータ文字_大太斜.yaml", 文字幅補正dpx: 0f ) ); + this.子Activityを追加する( this._ロゴ画像 = new 画像( @"$(System)images\曲別SKILLアイコン2.png" ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\350\241\250\347\244\272\346\226\271\346\263\225\351\201\270\346\212\236\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\350\241\250\347\244\272\346\226\271\346\263\225\351\201\270\346\212\236\343\203\221\343\203\215\343\203\253.cs" index 3223873..dd39da5 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\350\241\250\347\244\272\346\226\271\346\263\225\351\201\270\346\212\236\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\350\241\250\347\244\272\346\226\271\346\263\225\351\201\270\346\212\236\343\203\221\343\203\215\343\203\253.cs" @@ -31,7 +31,7 @@ public 表示方法選択パネル() this._表示開始位置 = this._指定した表示方法が選択位置に来る場合の表示開始位置を返す( this.現在の表示方法 ); foreach( var p in this._パネルs ) - this.子を追加する( p.画像 = new 画像( p.vpath ) ); + this.子Activityを追加する( p.画像 = new 画像( p.vpath ) ); } } protected override void On活性化() diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\212\236\346\233\262\346\236\240\343\203\251\343\203\263\343\203\212\343\203\274.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\212\236\346\233\262\346\236\240\343\203\251\343\203\263\343\203\212\343\203\274.cs" index a9bd75d..68ce396 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\212\236\346\233\262\346\236\240\343\203\251\343\203\263\343\203\212\343\203\274.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\212\236\346\233\262\346\236\240\343\203\251\343\203\263\343\203\212\343\203\274.cs" @@ -16,7 +16,7 @@ public 選択曲枠ランナー() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._ランナー画像 = new 画像( @"$(System)images\選曲\枠ランナー.png" ) ); + this.子Activityを追加する( this._ランナー画像 = new 画像( @"$(System)images\選曲\枠ランナー.png" ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\233\262\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\233\262\343\202\271\343\203\206\343\203\274\343\202\270.cs" index c76eba5..99fe578 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\233\262\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\201\270\346\233\262\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -30,17 +30,17 @@ public 選曲ステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._舞台画像 = new 舞台画像( @"$(System)images\舞台_暗.jpg" ) ); - this.子を追加する( this._曲リスト = new 曲リスト() ); - this.子を追加する( this._難易度と成績 = new 難易度と成績() ); - this.子を追加する( this._曲ステータスパネル = new 曲ステータスパネル() ); - this.子を追加する( this._ステージタイマー = new 画像( @"$(System)images\選曲\ステージタイマー.png" ) ); - this.子を追加する( this._青い線 = new 青い線() ); - this.子を追加する( this._選択曲枠ランナー = new 選択曲枠ランナー() ); - this.子を追加する( this._BPMパネル = new BPMパネル() ); - this.子を追加する( this._曲別SKILL = new 曲別SKILL() ); - this.子を追加する( this._表示方法選択パネル = new 表示方法選択パネル() ); - this.子を追加する( this._SongNotFound = new 文字列画像() { + this.子Activityを追加する( this._舞台画像 = new 舞台画像( @"$(System)images\舞台_暗.jpg" ) ); + this.子Activityを追加する( this._曲リスト = new 曲リスト() ); + this.子Activityを追加する( this._難易度と成績 = new 難易度と成績() ); + this.子Activityを追加する( this._曲ステータスパネル = new 曲ステータスパネル() ); + this.子Activityを追加する( this._ステージタイマー = new 画像( @"$(System)images\選曲\ステージタイマー.png" ) ); + this.子Activityを追加する( this._青い線 = new 青い線() ); + this.子Activityを追加する( this._選択曲枠ランナー = new 選択曲枠ランナー() ); + this.子Activityを追加する( this._BPMパネル = new BPMパネル() ); + this.子Activityを追加する( this._曲別SKILL = new 曲別SKILL() ); + this.子Activityを追加する( this._表示方法選択パネル = new 表示方法選択パネル() ); + this.子Activityを追加する( this._SongNotFound = new 文字列画像() { 表示文字列 = "Song not found...\n" + "Hit BDx2 (in default SPACEx2) to select song folders." @@ -67,10 +67,13 @@ protected override void On活性化() this._プレビュー枠の長さdpx = null; this._導線のストーリーボード = null; + App.システムサウンド.再生する( 設定.システムサウンド種別.選曲ステージ_開始音 ); + this.現在のフェーズ = フェーズ.フェードイン; this._初めての進行描画 = true; } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -164,15 +167,21 @@ public override void 進行描画する( DeviceContext1 dc ) //---------------- if( App.曲ツリー.フォーカスノード is BoxNode boxNode ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.決定音 ); this._曲リスト.BOXに入る(); } else if( App.曲ツリー.フォーカスノード is BackNode backNode ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.決定音 ); this._曲リスト.BOXから出る(); } else if( null != App.曲ツリー.フォーカスノード ) { // 選曲する + + App.曲ツリー.フォーカスノード.プレビュー音声を停止する(); + App.システムサウンド.再生する( 設定.システムサウンド種別.選曲ステージ_曲決定音 ); + App.ステージ管理.アイキャッチを選択しクローズする( nameof( GO ) ); this.現在のフェーズ = フェーズ.フェードアウト; } @@ -183,7 +192,19 @@ public override void 進行描画する( DeviceContext1 dc ) { #region " キャンセル " //---------------- - this.現在のフェーズ = フェーズ.キャンセル; + { + App.曲ツリー.フォーカスノード.プレビュー音声を停止する(); + App.システムサウンド.再生する( 設定.システムサウンド種別.取消音 ); + + if( App.曲ツリー.フォーカスノード.親ノード != App.曲ツリー.ルートノード ) + { + this._曲リスト.BOXから出る(); + } + else + { + this.現在のフェーズ = フェーズ.キャンセル; + } + } //---------------- #endregion } @@ -193,6 +214,8 @@ public override void 進行描画する( DeviceContext1 dc ) //---------------- if( null != App.曲ツリー.フォーカスノード ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.カーソル移動音 ); + //App.曲ツリー.前のノードをフォーカスする(); --> 曲リストへ委譲 this._曲リスト.前のノードを選択する(); this._導線アニメをリセットする(); @@ -206,6 +229,8 @@ public override void 進行描画する( DeviceContext1 dc ) //---------------- if( null != App.曲ツリー.フォーカスノード ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.カーソル移動音 ); + //App.曲ツリー.次のノードをフォーカスする(); --> 曲リストへ委譲 this._曲リスト.次のノードを選択する(); this._導線アニメをリセットする(); @@ -217,6 +242,7 @@ public override void 進行描画する( DeviceContext1 dc ) { #region " 左移動 " //---------------- + App.システムサウンド.再生する( 設定.システムサウンド種別.変更音 ); this._表示方法選択パネル.前のパネルを選択する(); //---------------- #endregion @@ -225,6 +251,7 @@ public override void 進行描画する( DeviceContext1 dc ) { #region " 右移動 " //---------------- + App.システムサウンド.再生する( 設定.システムサウンド種別.変更音 ); this._表示方法選択パネル.次のパネルを選択する(); //---------------- #endregion @@ -233,8 +260,12 @@ public override void 進行描画する( DeviceContext1 dc ) { #region " HH×2 → 難易度変更 " //---------------- - //App.曲ツリー.難易度アンカをひとつ増やす(); --> 曲リストへ委譲 + App.曲ツリー.フォーカスノード?.プレビュー音声を停止する(); + + App.システムサウンド.再生する( 設定.システムサウンド種別.変更音 ); this._曲リスト.難易度アンカをひとつ増やす(); + + App.曲ツリー.フォーカスノード?.プレビュー音声を再生する(); //---------------- #endregion } @@ -242,6 +273,8 @@ public override void 進行描画する( DeviceContext1 dc ) { #region " BD×2 → オプション設定 " //---------------- + App.曲ツリー.フォーカスノード.プレビュー音声を停止する(); + App.システムサウンド.再生する( 設定.システムサウンド種別.決定音 ); this.現在のフェーズ = フェーズ.確定_設定; //---------------- #endregion diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\233\243\346\230\223\345\272\246\343\201\250\346\210\220\347\270\276.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\233\243\346\230\223\345\272\246\343\201\250\346\210\220\347\270\276.cs" index 3260de7..31a3e9e 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\233\243\346\230\223\345\272\246\343\201\250\346\210\220\347\270\276.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/04\351\201\270\346\233\262/\351\233\243\346\230\223\345\272\246\343\201\250\346\210\220\347\270\276.cs" @@ -20,7 +20,7 @@ public 難易度と成績() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大.png", @"$(System)images\パラメータ文字_大.json", 文字幅補正dpx: 0f ) ); + this.子Activityを追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大.png", @"$(System)images\パラメータ文字_大.yaml", 文字幅補正dpx: 0f ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232\343\202\271\343\203\206\343\203\274\343\202\270.cs" index a7cdebc..9b784e4 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; using SharpDX.Direct2D1; using FDK; @@ -16,32 +17,20 @@ public enum フェーズ 表示, 入力割り当て, 曲読み込みフォルダ割り当て, - 曲読み込みフォルダ変更済み, + 再起動, フェードアウト, 確定, キャンセル, } public フェーズ 現在のフェーズ { get; protected set; } - /// - /// パネルの識別に を使う場合、 - /// その文字列を識別子として扱えるよう、ここで一元的に定義しておく。 - /// - public class 項目名 - { - public const string 入力割り当て = "入力割り当て"; - public const string 曲読み込みフォルダ = "曲読み込みフォルダ"; - public const string 設定完了 = "設定完了"; - public const string 設定完了_戻る = "設定完了(戻る)"; - } - public オプション設定ステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._舞台画像 = new 舞台画像() ); - this.子を追加する( this._パネルリスト = new パネルリスト() ); + this.子Activityを追加する( this._舞台画像 = new 舞台画像() ); + this.子Activityを追加する( this._パネルリスト = new パネルリスト() ); //this.子を追加する( this._ルートパネルフォルダ = new パネル_フォルダ( "Root", null, null ) ); --> 活性化のたびに、子パネルとまとめて動的に追加する。 } } @@ -53,208 +42,523 @@ protected override void On活性化() this.現在のフェーズ = フェーズ.フェードイン; this._初めての進行描画 = true; - // フォルダツリーを構築する。 + // パネルフォルダツリーを構築する。 var user = App.ユーザ管理.ログオン中のユーザ; + this._ルートパネルフォルダ = new パネル_フォルダ( "Root", null ); - this._ルートパネルフォルダ = new パネル_フォルダ( "Root", null, null ) { - 子パネルリスト = new SelectableList<パネル>(), - }; - - #region " 画面モード " + #region "「自動演奏」フォルダ" //---------------- - this._ルートパネルフォルダ.子パネルリスト.Add( - new パネル_文字列リスト( - パネル名: "画面モード", - 初期選択肢番号: ( user.全画面モードである ) ? 1 : 0, - 選択肢初期値s: new[] { "ウィンドウ", "全画面" }, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.全画面モードである = ( 1 == ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 ); - App.全画面モード = user.全画面モードである; - } ) ) ); + { + var 自動演奏フォルダ = new パネル_フォルダ( + + パネル名: + "自動演奏", + + 親パネル: + this._ルートパネルフォルダ, + + 値の変更処理: + ( panel ) => { + this._パネルリスト.子のパネルを選択する(); + this._パネルリスト.フェードインを開始する(); + } ); + + this._ルートパネルフォルダ.子パネルリスト.Add( 自動演奏フォルダ ); + + // 子フォルダツリーの構築 + + #region "「すべてON/OFF」パネル " + //---------------- + 自動演奏フォルダ.子パネルリスト.Add( + + new パネル( + + パネル名: + "すべてON/OFF", + + 値の変更処理: + ( panel ) => { + bool 設定値 = !( this._パネル_自動演奏_ONOFFトグルリスト[ 0 ].ONである ); // 最初の項目値の反対にそろえる + foreach( var typePanel in this._パネル_自動演奏_ONOFFトグルリスト ) + { + if( typePanel.ONである != 設定値 ) // 設定値と異なるなら + typePanel.確定キーが入力された(); // ON/OFF反転 + } + } + ) ); + //---------------- + #endregion + #region " 各パッドのON/OFFパネル " + //---------------- + this._パネル_自動演奏_ONOFFトグルリスト = new List<パネル_ONOFFトグル>(); + + foreach( AutoPlay種別 apType in Enum.GetValues( typeof( AutoPlay種別 ) ) ) + { + if( apType == AutoPlay種別.Unknown ) + continue; + + var typePanel = new パネル_ONOFFトグル( + + パネル名: + apType.ToString(), + + 初期状態はON: + ( user.AutoPlay[ apType ] ), + + 値の変更処理: + ( panel ) => { + user.AutoPlay[ apType ] = ( (パネル_ONOFFトグル) panel ).ONである; + } + ); + + 自動演奏フォルダ.子パネルリスト.Add( typePanel ); + + this._パネル_自動演奏_ONOFFトグルリスト.Add( typePanel ); + } + //---------------- + #endregion + #region "「設定完了(戻る)」システムボタン + //---------------- + 自動演奏フォルダ.子パネルリスト.Add( + + new パネル_システムボタン( + + パネル名: + "設定完了(戻る)", + + 値の変更処理: + ( panel ) => { + this._パネルリスト.親のパネルを選択する(); + this._パネルリスト.フェードインを開始する(); + } + ) ); + //---------------- + #endregion + + 自動演奏フォルダ.子パネルリスト.SelectFirst(); + } //---------------- #endregion - #region " 譜面スピード " + + #region "「画面モード」リスト " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( - new パネル_譜面スピード( "譜面スピード" ) ); + + new パネル_文字列リスト( + + パネル名: + "画面モード", + + 選択肢初期値リスト: + new[] { "ウィンドウ", "全画面" }, + + 初期選択肢番号: + ( user.全画面モードである ) ? 1 : 0, + + 値の変更処理: + ( panel ) => { + user.全画面モードである = ( 1 == ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 ); + App.全画面モード = user.全画面モードである; + } + ) ); //---------------- #endregion - #region " 演奏モード " + #region "「演奏モード」リスト " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( + new パネル_文字列リスト( - パネル名: "演奏モード", - 初期選択肢番号: (int) user.演奏モード, - 選択肢初期値s: new[] { "BASIC", "EXPERT" }, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.演奏モード = (PlayMode) ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号; - user.ドラムチッププロパティ管理.反映する( user.演奏モード ); - } ) ) ); + + パネル名: + "演奏モード", + + 選択肢初期値リスト: + new[] { "BASIC", "EXPERT" }, + + 初期選択肢番号: + (int) user.演奏モード, + + 値の変更処理: + ( panel ) => { + user.演奏モード = (PlayMode) ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号; + user.ドラムチッププロパティ管理.反映する( user.演奏モード ); + } + ) ); //---------------- #endregion - #region " シンバルフリー " + #region "「譜面スピード」リスト " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( - new パネル_ONOFFトグル( - パネル名: "シンバルフリー", - 初期状態はON: user.シンバルフリーモードである, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.シンバルフリーモードである = ( (パネル_ONOFFトグル) panel ).ONである; - user.ドラムチッププロパティ管理.反映する( ( user.シンバルフリーモードである ) ? 入力グループプリセット種別.シンバルフリー : 入力グループプリセット種別.基本形 ); - } ) ) ); + new パネル_譜面スピード( "譜面スピード" ) ); //---------------- #endregion - #region " 入力発声スレッドのスリープ量 " + #region "「シンバルフリー」ON/OFFトグル " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( - new パネル_文字列リスト( - パネル名: "入力発声スレッドのスリープ量", - 初期選択肢番号: ( App.システム設定.入力発声スレッドのスリープ量ms - 1 ), // 1~10 → 0~9 - 選択肢初期値s: new[] { "1 ms", "2 ms", "3 ms", "4 ms", "5 ms", "6 ms", "7 ms", "8 ms", "9 ms", "10 ms" }, - 値の変更処理: new Action<パネル>( ( panel ) => { - App.システム設定.入力発声スレッドのスリープ量ms = ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 + 1; // 0~9 → 1~10 - } ) ) ); + + new パネル_ONOFFトグル( + + パネル名: + "シンバルフリー", + + 初期状態はON: + user.シンバルフリーモードである, + + 値の変更処理: + ( panel ) => { + user.シンバルフリーモードである = ( (パネル_ONOFFトグル) panel ).ONである; + user.ドラムチッププロパティ管理.反映する( ( user.シンバルフリーモードである ) ? 入力グループプリセット種別.シンバルフリー : 入力グループプリセット種別.基本形 ); + } + ) ); //---------------- #endregion - #region " Ride の表示位置 " + #region "「Rideの表示位置」リスト " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( + new パネル_文字列リスト( - パネル名: "Rideの表示位置", - 初期選択肢番号: ( user.表示レーンの左右.Rideは左 ) ? 0 : 1, - 選択肢初期値s: new[] { "左", "右" }, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.表示レーンの左右 = new 表示レーンの左右() { - Rideは左 = ( ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 == 0 ), - Chinaは左 = user.表示レーンの左右.Chinaは左, - Splashは左 = user.表示レーンの左右.Splashは左, - }; - } ) ) ); + + パネル名: + "Rideの表示位置", + + 選択肢初期値リスト: + new[] { "左", "右" }, + + 初期選択肢番号: + ( user.表示レーンの左右.Rideは左 ) ? 0 : 1, + + 値の変更処理: + ( panel ) => { + user.表示レーンの左右 = new 表示レーンの左右() { + Rideは左 = ( ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 == 0 ), + Chinaは左 = user.表示レーンの左右.Chinaは左, + Splashは左 = user.表示レーンの左右.Splashは左, + }; + } + ) ); //---------------- #endregion - #region " China の表示位置 " + #region "「Chinaの表示位置」リスト " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( + new パネル_文字列リスト( - パネル名: "Chinaの表示位置", - 初期選択肢番号: ( user.表示レーンの左右.Chinaは左 ) ? 0 : 1, - 選択肢初期値s: new[] { "左", "右" }, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.表示レーンの左右 = new 表示レーンの左右() { - Rideは左 = user.表示レーンの左右.Rideは左, - Chinaは左 = ( ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 == 0 ), - Splashは左 = user.表示レーンの左右.Splashは左, - }; - } ) ) ); + + パネル名: + "Chinaの表示位置", + + 選択肢初期値リスト: + new[] { "左", "右" }, + + 初期選択肢番号: + ( user.表示レーンの左右.Chinaは左 ) ? 0 : 1, + + 値の変更処理: + ( panel ) => { + user.表示レーンの左右 = new 表示レーンの左右() { + Rideは左 = user.表示レーンの左右.Rideは左, + Chinaは左 = ( ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 == 0 ), + Splashは左 = user.表示レーンの左右.Splashは左, + }; + } + ) ); //---------------- #endregion - #region " Splash の表示位置 " + #region "「Splashの表示位置」リスト " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( + new パネル_文字列リスト( - パネル名: "Splashの表示位置", - 初期選択肢番号: ( user.表示レーンの左右.Splashは左 ) ? 0 : 1, - 選択肢初期値s: new[] { "左", "右" }, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.表示レーンの左右 = new 表示レーンの左右() { - Rideは左 = user.表示レーンの左右.Rideは左, - Chinaは左 = user.表示レーンの左右.Splashは左, - Splashは左 = ( ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 == 0 ), - }; - } ) ) ); + + パネル名: + "Splashの表示位置", + + 選択肢初期値リスト: + new[] { "左", "右" }, + + 初期選択肢番号: + ( user.表示レーンの左右.Splashは左 ) ? 0 : 1, + + 値の変更処理: + ( panel ) => { + user.表示レーンの左右 = new 表示レーンの左右() { + Rideは左 = user.表示レーンの左右.Rideは左, + Chinaは左 = user.表示レーンの左右.Splashは左, + Splashは左 = ( ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 == 0 ), + }; + } + ) ); //---------------- #endregion - #region " ユーザ入力によるドラムを発声する " + #region "「ドラムサウンド」ON/OFFトグル " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( + new パネル_ONOFFトグル( - パネル名: "ドラムサウンド", - 初期状態はON: user.ドラムの音を発声する, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.ドラムの音を発声する = ( (パネル_ONOFFトグル) panel ).ONである; - } ) ) ); + + パネル名: + "ドラムサウンド", + + 初期状態はON: + user.ドラムの音を発声する, + + 値の変更処理: + ( panel ) => { + user.ドラムの音を発声する = ( (パネル_ONOFFトグル) panel ).ONである; + } + ) ); //---------------- #endregion - #region " レーン配置 " + #region "「レーン配置」リスト " //---------------- { - var 選択肢s = 演奏.レーンフレーム.レーン配置リスト.Keys.ToList(); + var 選択肢リスト = 演奏.レーンフレーム.レーン配置リスト.Keys.ToList(); this._ルートパネルフォルダ.子パネルリスト.Add( + new パネル_文字列リスト( - パネル名: "レーン配置", - 初期選択肢番号: ( 選択肢s.Contains( user.レーン配置 ) ) ? 選択肢s.IndexOf( user.レーン配置 ) : 0, - 選択肢初期値s: 選択肢s, - 値の変更処理: new Action<パネル>( ( panel ) => { - user.レーン配置 = 選択肢s[ ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 ]; - } ) ) ); + + パネル名: + "レーン配置", + + 選択肢初期値リスト: + 選択肢リスト, + + 初期選択肢番号: + ( 選択肢リスト.Contains( user.レーン配置 ) ) ? 選択肢リスト.IndexOf( user.レーン配置 ) : 0, + + 値の変更処理: + ( panel ) => { + user.レーン配置 = 選択肢リスト[ ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 ]; + } + ) ); } //---------------- #endregion + #region "「レーンの透明度」数値ボックス " + //---------------- + this._ルートパネルフォルダ.子パネルリスト.Add( + + new パネル_整数( + + パネル名: + "レーンの透明度", + + 最小値: + 0, + + 最大値: + 100, + + 初期値: + user.レーンの透明度, + + 増加減単位値: + 5, + + 単位: + "%", + + 値の変更処理: + ( panel ) => { + user.レーンの透明度 = ( (パネル_整数) panel ).現在の値; + } + ) ); + //---------------- + #endregion + + #region "「入力発声スレッドのスリープ量」リスト " + //---------------- + this._ルートパネルフォルダ.子パネルリスト.Add( + + new パネル_文字列リスト( + + パネル名: + "入力発声スレッドのスリープ量", + + 選択肢初期値リスト: + new[] { "1 ms", "2 ms", "3 ms", "4 ms", "5 ms", "6 ms", "7 ms", "8 ms", "9 ms", "10 ms" }, + + 初期選択肢番号: + ( App.システム設定.入力発声スレッドのスリープ量ms - 1 ), // 1~10 → 0~9 + + 値の変更処理: + ( panel ) => { + App.システム設定.入力発声スレッドのスリープ量ms = ( (パネル_文字列リスト) panel ).現在選択されている選択肢の番号 + 1; // 0~9 → 1~10 + } + ) ); + //---------------- + #endregion + #region "「入力割り当て」パネル " + //---------------- + this._ルートパネルフォルダ.子パネルリスト.Add( + + new パネル( + + パネル名: + "入力割り当て", + + 値の変更処理: + ( panel ) => { + this.現在のフェーズ = フェーズ.入力割り当て; + }, + + ヘッダ色: + パネル.ヘッダ色種別.赤 + ) ); + //---------------- + #endregion + #region "「曲読み込みフォルダ」パネル " + //---------------- + this._ルートパネルフォルダ.子パネルリスト.Add( + + new パネル( + + パネル名: + "曲読み込みフォルダ", + + 値の変更処理: + ( panel ) => { + this.現在のフェーズ = フェーズ.曲読み込みフォルダ割り当て; + }, + + ヘッダ色: + パネル.ヘッダ色種別.赤 + ) ); + //---------------- + #endregion - #region " 自動演奏(フォルダ)" + #region "「初期化」フォルダ " //---------------- { - var 自動演奏 = new パネル_フォルダ( "自動演奏", this._ルートパネルフォルダ ) { - ヘッダ色 = パネル.ヘッダ色種別.赤, - }; + var 初期化フォルダ = new パネル_フォルダ( - 自動演奏.子パネルリスト = new SelectableList<パネル>(); + パネル名: + "初期化", - foreach( AutoPlay種別 apType in Enum.GetValues( typeof( AutoPlay種別 ) ) ) - { - if( apType == AutoPlay種別.Unknown ) - continue; + 親パネル: + this._ルートパネルフォルダ, - 自動演奏.子パネルリスト.Add( - new パネル_ONOFFトグル( - パネル名: apType.ToString(), - 初期状態はON: ( user.AutoPlay[ apType ] ), - 値の変更処理: new Action<パネル>( ( panel ) => { - user.AutoPlay[ apType ] = ( (パネル_ONOFFトグル) panel ).ONである; - } ) ) ); - } + 値の変更処理: + ( panel ) => { + this._パネルリスト.子のパネルを選択する(); + this._パネルリスト.フェードインを開始する(); + } ); + + this._ルートパネルフォルダ.子パネルリスト.Add( 初期化フォルダ ); + + // 子フォルダツリーの構築 - 自動演奏.子パネルリスト.Add( new パネル_システムボタン( 項目名.設定完了_戻る ) ); - 自動演奏.子パネルリスト.SelectFirst(); + #region "「戻る」システムボタン " + //---------------- + 初期化フォルダ.子パネルリスト.Add( - this._ルートパネルフォルダ.子パネルリスト.Add( 自動演奏 ); + new パネル_システムボタン( + + パネル名: + "戻る", + + 値の変更処理: + ( panel ) => { + this._パネルリスト.親のパネルを選択する(); + this._パネルリスト.フェードインを開始する(); + } + ) ); + //---------------- + #endregion + + #region "「設定を初期化」パネル" + //---------------- + 初期化フォルダ.子パネルリスト.Add( + + new パネル( + + パネル名: + "設定を初期化", + + 値の変更処理: + new Action<パネル>( ( panel ) => { + App.システム設定を初期化する(); + this.現在のフェーズ = フェーズ.再起動; + } ) + ) ); + //---------------- + #endregion + #region "「曲DBを初期化」パネル" + //---------------- + 初期化フォルダ.子パネルリスト.Add( + + new パネル( + + パネル名: + "曲DBを初期化", + + 値の変更処理: + new Action<パネル>( ( panel ) => { + App.曲データベースを初期化する(); + this.現在のフェーズ = フェーズ.再起動; + } ) + ) ); + //---------------- + #endregion + #region "「ユーザDBを初期化」パネル" + //---------------- + 初期化フォルダ.子パネルリスト.Add( + + new パネル( + + パネル名: + "ユーザDBを初期化", + + 値の変更処理: + new Action<パネル>( ( panel ) => { + App.ユーザデータベースを初期化する(); + this.現在のフェーズ = フェーズ.再起動; + } ) + ) ); + //---------------- + #endregion + + 初期化フォルダ.子パネルリスト.SelectFirst(); } //---------------- #endregion - #region " 入力割り当て " + + #region "「設定完了」システムボタン " //---------------- this._ルートパネルフォルダ.子パネルリスト.Add( - new パネル( 項目名.入力割り当て ) { - ヘッダ色 = パネル.ヘッダ色種別.赤, - } ); - //---------------- - #endregion - #region " 曲選択フォルダ割り当て " - //---------------- - this._ルートパネルフォルダ.子パネルリスト.Add( - new パネル( 項目名.曲読み込みフォルダ ) { - ヘッダ色 = パネル.ヘッダ色種別.赤, - } ); - //---------------- - #endregion - - #region " 設定完了(システムボタン)" - //---------------- - this._ルートパネルフォルダ.子パネルリスト.Add( - new パネル_システムボタン( 項目名.設定完了 ) ); + + new パネル_システムボタン( + + パネル名: + "設定完了", + + 値の変更処理: + ( panel ) => { + this._パネルリスト.フェードアウトを開始する(); + App.ステージ管理.アイキャッチを選択しクローズする( nameof( アイキャッチ.シャッター ) ); + this.現在のフェーズ = フェーズ.フェードアウト; + } + ) ); //---------------- #endregion - this._ルートパネルフォルダ.子パネルリスト.SelectLast(); // 最後のパネルを選択。 + // 最後のパネルを選択。 + this._ルートパネルフォルダ.子パネルリスト.SelectLast(); + + // ルートパネルフォルダを最初のツリーとして表示する。 this._パネルリスト.パネルリストを登録する( this._ルートパネルフォルダ ); - // 活性化する。 + // ルートパネルフォルダを活性化する。 this._ルートパネルフォルダ.活性化する(); + + + App.システムサウンド.再生する( システムサウンド種別.オプション設定ステージ_開始音 ); } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -266,7 +570,7 @@ protected override void On非活性化() public override void 進行描画する( DeviceContext1 dc ) { - // 進行描画。 + // (1) 全フェーズ共通の進行描画。 if( this._初めての進行描画 ) { @@ -277,6 +581,9 @@ public override void 進行描画する( DeviceContext1 dc ) this._舞台画像.進行描画する( dc ); this._パネルリスト.進行描画する( dc, 613f, 0f ); + + // (2) フェーズ別の進行描画。 + switch( this.現在のフェーズ ) { case フェーズ.フェードイン: @@ -284,41 +591,41 @@ public override void 進行描画する( DeviceContext1 dc ) this.現在のフェーズ = フェーズ.表示; break; + case フェーズ.表示: + break; + case フェーズ.入力割り当て: - using( Log.Block( FDKUtilities.現在のメソッド名 ) ) - { - using( var dlg = new 入力割り当てダイアログ() ) - dlg.表示する(); - } - this._パネルリスト.フェードインを開始する(); + using( var dlg = new 入力割り当てダイアログ() ) + dlg.表示する(); + this._パネルリスト.フェードインを開始する(); this.現在のフェーズ = フェーズ.表示; break; - case フェーズ.曲読み込みフォルダ割り当て: - { - bool 変更された = false; - using( Log.Block( FDKUtilities.現在のメソッド名 ) ) - { - using( var dlg = new 曲読み込みフォルダ割り当てダイアログ() ) - 変更された = dlg.表示する(); - } - this._パネルリスト.フェードインを開始する(); - this.現在のフェーズ = ( 変更された ) ? フェーズ.曲読み込みフォルダ変更済み : フェーズ.表示; - } - break; - - case フェーズ.フェードアウト: + case フェーズ.曲読み込みフォルダ割り当て: + { + bool 変更された = false; + using( var dlg = new 曲読み込みフォルダ割り当てダイアログ() ) + 変更された = dlg.表示する(); + this.現在のフェーズ = ( 変更された ) ? フェーズ.再起動 : フェーズ.表示; + } + break; + + case フェーズ.再起動: + break; + + case フェーズ.フェードアウト: App.ステージ管理.現在のアイキャッチ.進行描画する( dc ); if( App.ステージ管理.現在のアイキャッチ.現在のフェーズ == アイキャッチ.アイキャッチ.フェーズ.クローズ完了 ) this.現在のフェーズ = フェーズ.確定; break; - case フェーズ.曲読み込みフォルダ変更済み: - default: + case フェーズ.確定: + case フェーズ.キャンセル: break; } - // 入力。 + + // (3) フェーズ別の入力。 App.入力管理.すべての入力デバイスをポーリングする(); @@ -328,73 +635,60 @@ public override void 進行描画する( DeviceContext1 dc ) if( App.入力管理.キャンセルキーが入力された() ) { - this._パネルリスト.フェードアウトを開始する(); - App.ステージ管理.アイキャッチを選択しクローズする( nameof( アイキャッチ.半回転黒フェード ) ); - this.現在のフェーズ = フェーズ.フェードアウト; + App.システムサウンド.再生する( 設定.システムサウンド種別.取消音 ); + + if( null == this._パネルリスト.現在のパネルフォルダ.親パネル ) + { + this._パネルリスト.フェードアウトを開始する(); + App.ステージ管理.アイキャッチを選択しクローズする( nameof( アイキャッチ.半回転黒フェード ) ); + this.現在のフェーズ = フェーズ.フェードアウト; + } + else + { + this._パネルリスト.親のパネルを選択する(); + this._パネルリスト.フェードインを開始する(); + } } else if( App.入力管理.上移動キーが入力された() ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.カーソル移動音 ); this._パネルリスト.前のパネルを選択する(); } else if( App.入力管理.下移動キーが入力された() ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.カーソル移動音 ); this._パネルリスト.次のパネルを選択する(); } else if( App.入力管理.左移動キーが入力された() ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.変更音 ); this._パネルリスト.現在選択中のパネル.左移動キーが入力された(); } else if( App.入力管理.右移動キーが入力された() ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.変更音 ); this._パネルリスト.現在選択中のパネル.右移動キーが入力された(); } else if( App.入力管理.確定キーが入力された() ) { - switch( this._パネルリスト.現在選択中のパネル ) - { - case パネル_フォルダ folder: - this._パネルリスト.子のパネルを選択する(); - this._パネルリスト.フェードインを開始する(); - break; - - case パネル panel: - switch( panel.パネル名 ) - { - case 項目名.入力割り当て: - this.現在のフェーズ = フェーズ.入力割り当て; - break; - - case 項目名.曲読み込みフォルダ: - this.現在のフェーズ = フェーズ.曲読み込みフォルダ割り当て; - break; - - case 項目名.設定完了: - this._パネルリスト.フェードアウトを開始する(); - App.ステージ管理.アイキャッチを選択しクローズする( nameof( アイキャッチ.シャッター ) ); - this.現在のフェーズ = フェーズ.フェードアウト; - break; - - case 項目名.設定完了_戻る: - this._パネルリスト.親のパネルを選択する(); - this._パネルリスト.フェードインを開始する(); - break; - - default: - this._パネルリスト.現在選択中のパネル.確定キーが入力された(); - break; - } - break; - } + App.システムサウンド.再生する( 設定.システムサウンド種別.変更音 ); + this._パネルリスト.現在選択中のパネル.確定キーが入力された(); } - break; } } private bool _初めての進行描画 = true; + private 舞台画像 _舞台画像 = null; + private パネルリスト _パネルリスト = null; + private パネル_フォルダ _ルートパネルフォルダ = null; + + + // 以下、コード内で参照が必要になるパネルのホルダ。 + private List<パネル_ONOFFトグル> _パネル_自動演奏_ONOFFトグルリスト = null; } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253.cs" index d13f85a..0f084c7 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253.cs" @@ -11,6 +11,7 @@ namespace DTXMania.ステージ.オプション設定 { /// /// すべてのパネルのベースとなるクラス。 + /// 名前だけのパネルとしても使う。 /// class パネル : Activity { @@ -30,14 +31,15 @@ public class ヘッダ色種別 public Color4 ヘッダ色 { get; set; } = ヘッダ色種別.青; - public パネル( string パネル名, Action<パネル> 値の変更処理 = null ) + public パネル( string パネル名, Action<パネル> 値の変更処理 = null, Color4? ヘッダ色 = null ) { //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { this.パネル名 = パネル名; + this.ヘッダ色 = ( ヘッダ色.HasValue ) ? ヘッダ色.Value : ヘッダ色種別.青; this._値の変更処理 = 値の変更処理; - this.子を追加する( this._パネル名画像 = new 文字列画像() { 表示文字列 = this.パネル名, フォントサイズpt = 34f, 前景色 = Color4.White } ); + this.子Activityを追加する( this._パネル名画像 = new 文字列画像() { 表示文字列 = this.パネル名, フォントサイズpt = 34f, 前景色 = Color4.White } ); } } @@ -95,6 +97,7 @@ public void フェードインを開始する( double 遅延sec, double 速度 this._パネルのストーリーボード.Schedule( animation.Timer.Time ); } } + public void フェードアウトを開始する( double 遅延sec, double 速度倍率 = 1.0 ) { //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -128,18 +131,21 @@ public virtual void 確定キーが入力された() this._値の変更処理?.Invoke( this ); } + public virtual void 左移動キーが入力された() { // 必要あれば、派生クラスで実装すること。 this._値の変更処理?.Invoke( this ); } + public virtual void 右移動キーが入力された() { // 必要あれば、派生クラスで実装すること。 this._値の変更処理?.Invoke( this ); } + public virtual void 進行描画する( DeviceContext1 dc, float left, float top, bool 選択中 ) { float 拡大率Y = (float) this._パネルの高さ割合.Value; @@ -151,11 +157,14 @@ public virtual void 進行描画する( DeviceContext1 dc, float left, float top if( 選択中 ) { - // 選択パネルは、パネル矩形を左右にちょっと大きくする。 + // 選択されているパネルは、パネル矩形を左右にちょっと大きくする。 パネル矩形.Left -= 38f; パネル矩形.Width += 38f * 2f; } + + // (1) パネルの下地部分の描画。 + グラフィックデバイス.Instance.D2DBatchDraw( dc, () => { using( var パネル背景色 = new SolidColorBrush( dc, new Color4( Color3.Black, 0.5f ) ) ) @@ -169,6 +178,9 @@ public virtual void 進行描画する( DeviceContext1 dc, float left, float top } ); + + // (2) パネル名の描画。 + float 拡大率X = Math.Min( 1f, ( テキスト矩形.Width - 20f ) / this._パネル名画像.画像サイズdpx.Width ); // -20 は左右マージンの最低値[dpx] this._パネル名画像.描画する( @@ -183,20 +195,25 @@ public override string ToString() => $"{this.パネル名}"; + // パネル名は画像で保持。 protected 文字列画像 _パネル名画像 = null; + protected Action<パネル> _値の変更処理 = null; /// /// 項目部分のサイズ。 /// left と top は、パネルほ left,top からの相対値。 /// - protected RectangleF 項目領域 - => new RectangleF( +322f, +0f, 342f, サイズ.Height ); + protected RectangleF 項目領域 = new RectangleF( +322f, +0f, 342f, サイズ.Height ); /// /// 0.0:ゼロ ~ 1.0:原寸 /// protected Variable _パネルの高さ割合 = null; + + /// + /// フェードイン・アウトアニメーション用 + /// protected Storyboard _パネルのストーリーボード = null; } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_ONOFF\343\203\210\343\202\260\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_ONOFF\343\203\210\343\202\260\343\203\253.cs" index 8164780..6939e45 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_ONOFF\343\203\210\343\202\260\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_ONOFF\343\203\210\343\202\260\343\203\253.cs" @@ -12,12 +12,18 @@ namespace DTXMania.ステージ.オプション設定 class パネル_ONOFFトグル : パネル_文字列リスト { public bool ONである - => !( this.OFFである ); + { + get => !( this.OFFである ); + set => this.OFFである = !value; + } public bool OFFである - => ( 0 == this.現在選択されている選択肢の番号 ); + { + get => ( 0 == this.現在選択されている選択肢の番号 ); + set => this.現在選択されている選択肢の番号 = ( value ) ? 0 : 1; + } public パネル_ONOFFトグル( string パネル名, bool 初期状態はON, Action<パネル> 値の変更処理 = null ) - : base( パネル名, ( 初期状態はON ) ? 1 : 0, new[] { "OFF", "ON" }, 値の変更処理 ) + : base( パネル名, new[] { "OFF", "ON" }, ( 初期状態はON ) ? 1 : 0, 値の変更処理 ) { //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\202\267\343\202\271\343\203\206\343\203\240\343\203\234\343\202\277\343\203\263.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\202\267\343\202\271\343\203\206\343\203\240\343\203\234\343\202\277\343\203\263.cs" index ca9a9fb..612c844 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\202\267\343\202\271\343\203\206\343\203\240\343\203\234\343\202\277\343\203\263.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\202\267\343\202\271\343\203\206\343\203\240\343\203\234\343\202\277\343\203\263.cs" @@ -14,8 +14,8 @@ namespace DTXMania.ステージ.オプション設定 /// class パネル_システムボタン : パネル { - public パネル_システムボタン( string パネル名 ) - : base( パネル名, null ) + public パネル_システムボタン( string パネル名, Action<パネル> 値の変更処理 = null ) + : base( パネル名, 値の変更処理 ) { //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { @@ -28,6 +28,7 @@ protected override void On活性化() { base.On活性化(); //忘れないこと } + protected override void On非活性化() { base.On非活性化(); //忘れないこと @@ -40,6 +41,8 @@ public override void 進行描画する( DeviceContext1 dc, float left, float to float テキストの上下マージン = 72f * ( 1f - 拡大率Y ) / 2f; var テキスト矩形 = new RectangleF( left + 32f, top + 12f + テキストの上下マージン, 294f, 72f * 拡大率Y ); + // (1) パネルの下地部分の描画。 + グラフィックデバイス.Instance.D2DBatchDraw( dc, () => { using( var テキスト背景色 = new SolidColorBrush( dc, Color.LightGray ) ) @@ -47,6 +50,9 @@ public override void 進行描画する( DeviceContext1 dc, float left, float to } ); + + // (2) パネル名の描画。 + float 拡大率X = Math.Min( 1f, ( テキスト矩形.Width - 20f ) / this._パネル名画像.画像サイズdpx.Width ); // -20 は左右マージンの最低値[dpx] this._パネル名画像.描画する( diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\203\225\343\202\251\343\203\253\343\203\200.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\203\225\343\202\251\343\203\253\343\203\200.cs" index 4e8ac5c..f52f3c1 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\203\225\343\202\251\343\203\253\343\203\200.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\343\203\225\343\202\251\343\203\253\343\203\200.cs" @@ -8,7 +8,7 @@ namespace DTXMania.ステージ.オプション設定 { /// - /// 子パネルリストに入ることができるフォルダ。 + /// 子パネルリストを持つフォルダ。 /// 子パネルリストの活性化・非活性化はこのクラスで行う。 /// class パネル_フォルダ : パネル @@ -30,13 +30,12 @@ public SelectableList<パネル> 子パネルリスト } - public パネル_フォルダ( string パネル名, パネル_フォルダ 親パネル, IEnumerable<パネル> 初期子パネルリスト = null ) - : base( パネル名 ) + public パネル_フォルダ( string パネル名, パネル_フォルダ 親パネル, IEnumerable<パネル> 初期子パネルリスト = null, Action<パネル> 値の変更処理 = null ) + : base( パネル名, 値の変更処理, ヘッダ色種別.赤 ) { //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { this.親パネル = 親パネル; - this.子パネルリスト = new SelectableList<パネル>(); if( null != 初期子パネルリスト ) @@ -46,6 +45,7 @@ public パネル_フォルダ( string パネル名, パネル_フォルダ 親 this._子パネルリスト.SelectFirst(); } + Log.Info( $"フォルダパネルを生成しました。[{this}]" ); } } @@ -57,6 +57,7 @@ protected override void On活性化() foreach( var panel in this.子パネルリスト ) panel.活性化する(); } + protected override void On非活性化() { foreach( var panel in this.子パネルリスト ) @@ -67,12 +68,13 @@ protected override void On非活性化() public override void 進行描画する( DeviceContext1 dc, float left, float top, bool 選択中 ) { - // パネルの共通部分を描画。 + // パネルの下地と名前を描画。 base.進行描画する( dc, left, top, 選択中 ); - // 項目部分の描画はなし。 + // その他の描画があれば、ここに記述する。 } + protected SelectableList<パネル> _子パネルリスト = null; } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\346\225\264\346\225\260.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\346\225\264\346\225\260.cs" new file mode 100644 index 0000000..a5314cd --- /dev/null +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\346\225\264\346\225\260.cs" @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using SharpDX; +using SharpDX.Direct2D1; +using FDK; + +namespace DTXMania.ステージ.オプション設定 +{ + /// + /// 数値ボックス。整数のみ、単位表示は任意。 + /// + class パネル_整数 : パネル + { + public int 最小値 { get; } + + public int 最大値 { get; } + + public int 現在の値 { get; set; } + + public int 増加減単位値 { get; set; } + + public string 単位 { get; set; } + + + public パネル_整数( string パネル名, int 最小値, int 最大値, int 初期値, int 増加減単位値 = 1, string 単位 = "", Action<パネル> 値の変更処理 = null, Color4? ヘッダ色 = null ) + : base( パネル名, 値の変更処理, ヘッダ色 ) + { + //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) + { + this.最小値 = 最小値; + this.最大値 = 最大値; + this.現在の値 = 初期値; + this.増加減単位値 = 増加減単位値; + this.単位 = 単位; + + this.子Activityを追加する( this._項目画像 = new 文字列画像() { 表示文字列 = "", フォントサイズpt = 34f, 前景色 = Color4.White } ); + Log.Info( $"整数パネルを生成しました。[{this}]" ); + } + } + + protected override void On活性化() + { + base.On活性化(); //忘れないこと + } + + protected override void On非活性化() + { + base.On非活性化(); //忘れないこと + } + + public override void 左移動キーが入力された() + { + // 値を減らす。 + this.現在の値 = Math.Max( this.最小値, this.現在の値 - this.増加減単位値 ); + + base.左移動キーが入力された(); // 忘れないこと + } + + public override void 右移動キーが入力された() + { + // 値を増やす。 + this.現在の値 = Math.Min( this.最大値, this.現在の値 + this.増加減単位値 ); + + base.右移動キーが入力された(); // 忘れないこと + } + + public override void 確定キーが入力された() + { + // 値を増やす。 + this.現在の値 = ( this.現在の値 + this.増加減単位値 ); + + // 最大値を超えたら最小値へループ。 + if( this.現在の値 > this.最大値 ) + this.現在の値 = this.最小値; + + base.確定キーが入力された(); // 忘れないこと + } + + public override void 進行描画する( DeviceContext1 dc, float left, float top, bool 選択中 ) + { + // (1) パネルの下地と名前を描画。 + + base.進行描画する( dc, left, top, 選択中 ); + + + // (2) 値を描画。 + + this._項目画像.表示文字列 = $"{this.現在の値.ToString()} {this.単位}"; + this._項目画像.ビットマップを生成または更新する(); // このあと画像のサイズが必要になるので、先に生成/更新する。 + + float 拡大率Y = (float) this._パネルの高さ割合.Value; + float 項目の上下マージン = this.項目領域.Height * ( 1f - 拡大率Y ) / 2f; + + var 項目矩形 = new RectangleF( + x: this.項目領域.X + left, + y: this.項目領域.Y + top + 項目の上下マージン, + width: this.項目領域.Width, + height: this.項目領域.Height * 拡大率Y ); + + float 拡大率X = Math.Min( 1f, ( 項目矩形.Width - 20f ) / this._項目画像.画像サイズdpx.Width ); // -20 は左右マージンの最低値[dpx] + + this._項目画像.描画する( + dc, + 項目矩形.Left + ( 項目矩形.Width - this._項目画像.画像サイズdpx.Width * 拡大率X ) / 2f, + 項目矩形.Top + ( 項目矩形.Height - this._項目画像.画像サイズdpx.Height * 拡大率Y ) / 2f, + X方向拡大率: 拡大率X, + Y方向拡大率: 拡大率Y ); + } + + public override string ToString() + => $"{this.パネル名}, 最小値:{this.最小値}, 最大値:{this.最大値}, 増加減単位値:{this.増加減単位値}, 現在の値:{this.現在の値}"; + + + private 文字列画像 _項目画像 = null; + } +} diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\346\226\207\345\255\227\345\210\227\343\203\252\343\202\271\343\203\210.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\346\226\207\345\255\227\345\210\227\343\203\252\343\202\271\343\203\210.cs" index 293b15c..2e5165d 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\346\226\207\345\255\227\345\210\227\343\203\252\343\202\271\343\203\210.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\346\226\207\345\255\227\345\210\227\343\203\252\343\202\271\343\203\210.cs" @@ -9,15 +9,17 @@ namespace DTXMania.ステージ.オプション設定 { /// - /// 任意個の文字列から1つを選択できるパネル項目。 - /// コンストラクタから活性化までの間に、 を設定すること。 + /// 任意個の文字列から1つを選択できるパネル項目(コンボボックス)。 + /// コンストラクタから活性化までの間に、 に文字列を設定すること。 /// class パネル_文字列リスト : パネル { public int 現在選択されている選択肢の番号 { get; protected set; } = 0; + public List 選択肢リスト { get; protected set; } = new List(); - public パネル_文字列リスト( string パネル名, int 初期選択肢番号 = 0, IEnumerable 選択肢初期値s = null, Action<パネル> 値の変更処理 = null ) + + public パネル_文字列リスト( string パネル名, IEnumerable 選択肢初期値リスト = null, int 初期選択肢番号 = 0, Action<パネル> 値の変更処理 = null ) : base( パネル名, 値の変更処理 ) { //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -25,9 +27,9 @@ public パネル_文字列リスト( string パネル名, int 初期選択肢番 this.現在選択されている選択肢の番号 = 初期選択肢番号; // 初期値があるなら設定する。 - if( null != 選択肢初期値s ) + if( null != 選択肢初期値リスト ) { - foreach( var item in 選択肢初期値s ) + foreach( var item in 選択肢初期値リスト ) this.選択肢リスト.Add( item ); } @@ -37,9 +39,9 @@ public パネル_文字列リスト( string パネル名, int 初期選択肢番 protected override void On活性化() { - Trace.Assert( 0 < this.選択肢リスト.Count, "リストが空です。活性化するより先に設定してください。" ); + Debug.Assert( 0 < this.選択肢リスト.Count, "リストが空です。活性化するより先に設定してください。" ); - this._選択肢画像リスト = new Dictionary(); + this._選択肢文字列画像リスト = new Dictionary(); for( int i = 0; i < this.選択肢リスト.Count; i++ ) { @@ -49,19 +51,20 @@ protected override void On活性化() 前景色 = Color4.White, }; - this._選択肢画像リスト.Add( this.選択肢リスト[ i ], image ); + this._選択肢文字列画像リスト.Add( this.選択肢リスト[ i ], image ); - this.子を追加する( image ); + this.子Activityを追加する( image ); } base.On活性化(); //忘れないこと } + protected override void On非活性化() { - foreach( var kvp in this._選択肢画像リスト ) - this.子を削除する( kvp.Value ); + foreach( var kvp in this._選択肢文字列画像リスト ) + this.子Activityを削除する( kvp.Value ); - this._選択肢画像リスト = null; + this._選択肢文字列画像リスト = null; base.On非活性化(); //忘れないこと } @@ -69,22 +72,28 @@ protected override void On非活性化() public override void 左移動キーが入力された() { this.現在選択されている選択肢の番号 = ( this.現在選択されている選択肢の番号 - 1 + this.選択肢リスト.Count ) % this.選択肢リスト.Count; - this._値の変更処理?.Invoke( this ); + + base.左移動キーが入力された(); // 忘れないこと } + public override void 右移動キーが入力された() { this.現在選択されている選択肢の番号 = ( this.現在選択されている選択肢の番号 + 1 ) % this.選択肢リスト.Count; - this._値の変更処理?.Invoke( this ); + + base.右移動キーが入力された(); // 忘れないこと } + public override void 確定キーが入力された() => this.右移動キーが入力された(); public override void 進行描画する( DeviceContext1 dc, float left, float top, bool 選択中 ) { - // パネルの共通部分を描画。 + // (1) パネルの下地と名前を描画。 + base.進行描画する( dc, left, top, 選択中 ); - // 以下、項目部分の描画。 + + // (2) 選択肢文字列画像の描画。 float 拡大率Y = (float) this._パネルの高さ割合.Value; float 項目の上下マージン = this.項目領域.Height * ( 1f - 拡大率Y ) / 2f; @@ -95,7 +104,7 @@ public override void 進行描画する( DeviceContext1 dc, float left, float to width: this.項目領域.Width, height: this.項目領域.Height * 拡大率Y ); - var 項目画像 = this._選択肢画像リスト[ this.選択肢リスト[ this.現在選択されている選択肢の番号 ] ]; + var 項目画像 = this._選択肢文字列画像リスト[ this.選択肢リスト[ this.現在選択されている選択肢の番号 ] ]; float 拡大率X = Math.Min( 1f, ( 項目矩形.Width - 20f ) / 項目画像.画像サイズdpx.Width ); // -20 は左右マージンの最低値[dpx] @@ -111,6 +120,7 @@ public override string ToString() => $"{this.パネル名}, 選択肢: [{string.Join( ",", this.選択肢リスト )}]"; - private Dictionary _選択肢画像リスト = null; + // 各文字列は画像で保持。 + private Dictionary _選択肢文字列画像リスト = null; } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\350\255\234\351\235\242\343\202\271\343\203\224\343\203\274\343\203\211.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\350\255\234\351\235\242\343\202\271\343\203\224\343\203\274\343\203\211.cs" index 029e140..2fb7bed 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\350\255\234\351\235\242\343\202\271\343\203\224\343\203\274\343\203\211.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253_\350\255\234\351\235\242\343\202\271\343\203\224\343\203\274\343\203\211.cs" @@ -13,12 +13,16 @@ namespace DTXMania.ステージ.オプション設定 /// class パネル_譜面スピード : パネル { + protected const double 最小倍率 = 0.5; + protected const double 最大倍率 = 8.0; + + public パネル_譜面スピード( string パネル名 ) : base( パネル名, null ) { //using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._項目画像 = new 文字列画像() { 表示文字列 = "", フォントサイズpt = 34f, 前景色 = Color4.White } ); + this.子Activityを追加する( this._項目画像 = new 文字列画像() { 表示文字列 = "", フォントサイズpt = 34f, 前景色 = Color4.White } ); Log.Info( $"譜面スピードパネルを生成しました。[{this}]" ); } } @@ -27,6 +31,7 @@ protected override void On活性化() { base.On活性化(); //忘れないこと } + protected override void On非活性化() { base.On非活性化(); //忘れないこと @@ -34,32 +39,43 @@ protected override void On非活性化() public override void 左移動キーが入力された() { - // 譜面スクロールを減速 - const double 最小倍率 = 0.5; + // 譜面スクロール値を減らす。 App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 = Math.Max( App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 - 0.5, 最小倍率 ); + + base.左移動キーが入力された(); // 忘れないこと } + public override void 右移動キーが入力された() { - // 譜面スクロールを加速 - const double 最大倍率 = 8.0; + // 譜面スクロール値を増やす。 App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 = Math.Min( App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 + 0.5, 最大倍率 ); + + base.右移動キーが入力された(); // 忘れないこと } + public override void 確定キーが入力された() { - const double 最小倍率 = 0.5; - const double 最大倍率 = 8.0; + // 譜面スクロール値を増やす。 + App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 += 0.5; + // 最大値を超えたら最小値に戻る。 + if( 最大倍率 < App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 ) App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 = 最小倍率; + + base.確定キーが入力された(); } public override void 進行描画する( DeviceContext1 dc, float left, float top, bool 選択中 ) { - // パネルの共通部分を描画。 + // (1) パネルの下地と名前を描画。 + base.進行描画する( dc, left, top, 選択中 ); - // 項目部分の描画。 + + // (2) 値を描画。 + this._項目画像.表示文字列 = "× " + App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度.ToString( "0.0" ); this._項目画像.ビットマップを生成または更新する(); // このあと画像のサイズが必要になるので、先に生成/更新する。 @@ -82,6 +98,7 @@ public override void 進行描画する( DeviceContext1 dc, float left, float to Y方向拡大率: 拡大率Y ); } + private 文字列画像 _項目画像 = null; } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253\343\203\252\343\202\271\343\203\210.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253\343\203\252\343\202\271\343\203\210.cs" index e3eeda3..34d644e 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253\343\203\252\343\202\271\343\203\210.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\343\203\221\343\203\215\343\203\253\343\203\252\343\202\271\343\203\210.cs" @@ -8,17 +8,24 @@ namespace DTXMania.ステージ.オプション設定 { + /// + /// の選択と表示。 + /// class パネルリスト : Activity { public パネル 現在選択中のパネル => this._現在のパネルフォルダ.子パネルリスト.SelectedItem; + public パネル_フォルダ 現在のパネルフォルダ + => this._現在のパネルフォルダ; + + public パネルリスト() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._青い線 = new 青い線() ); - this.子を追加する( this._パッド矢印 = new パッド矢印() ); + this.子Activityを追加する( this._青い線 = new 青い線() ); + this.子Activityを追加する( this._パッド矢印 = new パッド矢印() ); this._ルートパネルフォルダ = null; this._現在のパネルフォルダ = null; @@ -30,6 +37,7 @@ public void パネルリストを登録する( パネル_フォルダ root ) this._ルートパネルフォルダ = root; this._現在のパネルフォルダ = root; } + public void フェードインを開始する( double 速度倍率 = 1.0 ) { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -40,6 +48,7 @@ public void フェードインを開始する( double 速度倍率 = 1.0 ) } } } + public void フェードアウトを開始する( double 速度倍率 = 1.0 ) { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -50,27 +59,31 @@ public void フェードアウトを開始する( double 速度倍率 = 1.0 ) } } } + public void 前のパネルを選択する() { - Trace.Assert( null != this._現在のパネルフォルダ?.子パネルリスト ); + Debug.Assert( null != this._現在のパネルフォルダ?.子パネルリスト ); this._現在のパネルフォルダ.子パネルリスト.SelectPrev( Loop: true ); } + public void 次のパネルを選択する() { - Trace.Assert( null != this._現在のパネルフォルダ?.子パネルリスト ); + Debug.Assert( null != this._現在のパネルフォルダ?.子パネルリスト ); this._現在のパネルフォルダ.子パネルリスト.SelectNext( Loop: true ); } + public void 親のパネルを選択する() { - Trace.Assert( null != this._現在のパネルフォルダ?.親パネル ); + Debug.Assert( null != this._現在のパネルフォルダ?.親パネル ); this._現在のパネルフォルダ = this._現在のパネルフォルダ.親パネル; } + public void 子のパネルを選択する() { - Trace.Assert( null != this._現在のパネルフォルダ?.子パネルリスト?.SelectedItem ); + Debug.Assert( null != this._現在のパネルフォルダ?.子パネルリスト?.SelectedItem ); this._現在のパネルフォルダ = this._現在のパネルフォルダ.子パネルリスト.SelectedItem as パネル_フォルダ; } @@ -84,6 +97,7 @@ protected override void On活性化() this._現在のパネルフォルダ = this._ルートパネルフォルダ; } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -98,11 +112,15 @@ public void 進行描画する( DeviceContext1 dc, float left, float top ) const float パネルの下マージン = 4f; float パネルの高さ = パネル.サイズ.Height + パネルの下マージン; - // フレーム1(たて線)を描画。 + // (1) フレーム1(たて線)を描画。 + this._青い線.描画する( dc, new Vector2( left, 0f ), 高さdpx: グラフィックデバイス.Instance.設計画面サイズ.Height ); - // パネルを描画。(選択中のパネルの3つ上から7つ下まで、計11枚。) + + // (2) パネルを描画。(選択中のパネルの3つ上から7つ下までの計11枚。) + var panels = this._現在のパネルフォルダ.子パネルリスト; + for( int i = 0; i < 11; i++ ) { int 描画パネル番号 = ( ( panels.SelectedIndex - 3 + i ) + panels.Count * 3 ) % panels.Count; // panels の末尾に達したら先頭に戻る。 @@ -115,13 +133,18 @@ public void 進行描画する( DeviceContext1 dc, float left, float top ) 選択中: ( i == 3 ) ); } - // フレーム2(選択パネル周囲)を描画。 + + // (3) フレーム2(選択パネル周囲)を描画。 + float 幅 = パネル.サイズ.Width + 22f * 2f; + this._青い線.描画する( dc, new Vector2( left, パネルの高さ * 3f ), 幅dpx: 幅 ); this._青い線.描画する( dc, new Vector2( left, パネルの高さ * 4f ), 幅dpx: 幅 ); this._青い線.描画する( dc, new Vector2( left + 幅, パネルの高さ * 3f ), 高さdpx: パネルの高さ ); - // パッド矢印(上&下)を描画。 + + // (4) パッド矢印(上&下)を描画。 + this._パッド矢印.描画する( dc, パッド矢印.種類.上_Tom1, new Vector2( left, パネルの高さ * 3f ) ); this._パッド矢印.描画する( dc, パッド矢印.種類.下_Tom2, new Vector2( left, パネルの高さ * 4f ) ); } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\345\205\245\345\212\233\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\345\205\245\345\212\233\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" index 67ea98f..a1f81e7 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\345\205\245\345\212\233\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\345\205\245\345\212\233\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" @@ -10,36 +10,37 @@ namespace DTXMania.ステージ.オプション設定 { - public partial class 入力割り当てダイアログ : Form + /// + /// ドラム入力の割り当て画面。 + /// + partial class 入力割り当てダイアログ : Form { public 入力割り当てダイアログ() { InitializeComponent(); - - // 物理画面のサイズに応じて、フォームのサイズを変更。 - //this.Scale( - // new System.Drawing.SizeF( - // Math.Max( 1f, グラフィックデバイス.Instance.拡大率DPXtoPX横 ), - // Math.Max( 1f, グラフィックデバイス.Instance.拡大率DPXtoPX縦 ) ) ); } public void 表示する() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - // メインウィンドウ用の入力管理をいったん破棄し、このウィンドウ用の入力管理を生成する。 + // (1) メインウィンドウ用の入力管理をいったん破棄し、このダイアログ用の入力管理を生成する。 + App.入力管理.Dispose(); + using( var 入力管理 = new 入力管理( this.Handle ) ) { 入力管理.キーバインディングを取得する = () => App.システム設定.キーバインディング; 入力管理.キーバインディングを保存する = () => App.システム設定.保存する(); 入力管理.初期化する(); + + // (2) ダイアログを表示。 + using( var timer = new Timer() ) { - #region " 設定値から初期化。" + #region " 設定値で初期化。" //---------------- - // パッドリストを初期化。 foreach( ドラム入力種別 drum in Enum.GetValues( typeof( ドラム入力種別 ) ) ) { if( drum == ドラム入力種別.Unknown || @@ -50,21 +51,30 @@ public void 表示する() } // 変更後のキーバインディングを、現在の設定値で初期化。 + this._変更後のキーバインディング = (キーバインディング) 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( $"KEYBOARD \"{入力管理.Keyboard.DeviceName}\" の受付を開始しました。" ); for( int i = 0; i < 入力管理.MidiIn.DeviceName.Count; i++ ) this.listView入力リスト.Items.Add( $"MIDI IN [{i}] \"{入力管理.MidiIn.DeviceName[ i ]}\" の受付を開始しました。" ); @@ -76,94 +86,111 @@ public void 表示する() //---------------- #endregion - // タイマーイベント&入力の表示。 + // タイマーイベントを使って、定期的に、入力値の表示とフットペダル開度ゲージの描画を行う。 timer.Interval = 100; timer.Tick += ( sender, arg ) => { - #region " (A) キーボードのポーリングと、入力リストへの出力。" + #region " キーボードをポーリングし、入力値を入力リストへ出力。" //---------------- 入力管理.Keyboard.ポーリングする(); for( int i = 0; i < 入力管理.Keyboard.入力イベントリスト.Count; i++ ) { - var ie = 入力管理.Keyboard.入力イベントリスト[ i ]; + var inputEvent = 入力管理.Keyboard.入力イベントリスト[ i ]; - if( ie.押された ) + if( inputEvent.押された ) { - var item = new ListViewItem入力リスト用( InputDeviceType.Keyboard, ie ); + var item = new ListViewItem入力リスト用( InputDeviceType.Keyboard, inputEvent ); - if( ie.Key == (int) Key.Escape ) // 割り当てされてほしくないキーはここへ。 + if( inputEvent.Key == (int) Key.Escape ) // 割り当てされてほしくないキーはここへ。 { item.割り当て可能 = false; } - this._一定時間が経っていれば空行を挿入する(); + // 既に割り当てられていたらそのドラム種別を表示。 + 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 ); } - else if( ie.離された ) + else if( inputEvent.離された ) { // キーボードについては表示しない。 } } - //---------------- - #endregion + //---------------- + #endregion - #region " (B) Midi入力のポーリングと、入力リストへの出力。" - //---------------- - 入力管理.MidiIn.ポーリングする(); + #region " MIDI入力をポーリングし、入力値を入力リストへ出力。" + //---------------- + // MidiInChecker の機能もかねて、NoteOFF や ControlChange も表示する。(割り当てはできない。) + + 入力管理.MidiIn.ポーリングする(); for( int i = 0; i < 入力管理.MidiIn.入力イベントリスト.Count; i++ ) { - var ie = 入力管理.MidiIn.入力イベントリスト[ i ]; - - // MidiInChecker の機能もかねて、NoteOFF や ControlChange も一応表示しておく。(割り当てはできない。) - - if( ie.押された && ( 255 == ie.Key ) && ( 4 == ie.Control ) ) - { - // (A) フットペダルコントロールは、入力リストではなく、専用のUIパーツへ表示。 + var inputEvent = 入力管理.MidiIn.入力イベントリスト[ i ]; - if( this._FootPedal現在値 != ie.Velocity ) + if( inputEvent.押された && ( 255 == inputEvent.Key ) && ( 4 == inputEvent.Control ) ) + { + #region " (A) フットペダルコントロールの場合 → 入力リストではなく専用のUIで表示。" + //---------------- + if( this._FootPedal現在値 != inputEvent.Velocity ) { - // "現在地" - this._FootPedal現在値 = ie.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(); } } - } - else + //---------------- + #endregion + } + else { - // (B) その他は入力リストに表示。 + #region " (B) その他のMIDI入出力 → 入力リストに表示。" + //---------------- + var item = new ListViewItem入力リスト用( InputDeviceType.MidiIn, inputEvent ); - var item = new ListViewItem入力リスト用( InputDeviceType.MidiIn, ie ); + // 既に割り当てられていたらそのドラム種別を表示。 + 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._一定時間が経っていれば空行を挿入する(); this.listView入力リスト.Items.Add( item ); this.listView入力リスト.EnsureVisible( this.listView入力リスト.Items.Count - 1 ); - - } - } - //---------------- - #endregion - - #region " MIDI フットペダル開度ゲージの描画 " - //---------------- - using( var g = pictureBoxFootPedal.CreateGraphics() ) + //---------------- + #endregion + } + } + //---------------- + #endregion + + #region " MIDIフットペダルの開度ゲージを描画。" + //---------------- + using( var g = pictureBoxFootPedal.CreateGraphics() ) { var 全体矩形 = pictureBoxFootPedal.ClientRectangle; var 背景色 = new System.Drawing.SolidBrush( pictureBoxFootPedal.BackColor ); @@ -192,35 +219,32 @@ public void 表示する() #endregion }; - DialogResult dr; + timer.Start(); - #region " ダイアログ表示→終了。" + #region " ダイアログを表示。" //---------------- - timer.Start(); - Cursor.Show(); - dr = this.ShowDialog( Program.App ); + var dr = this.ShowDialog( Program.App ); if( App.全画面モード ) Cursor.Hide(); + //---------------- + #endregion - timer.Stop(); - //---------------- - #endregion + timer.Stop(); - if( dr == DialogResult.OK ) + if( dr == DialogResult.OK ) { - #region " 設定値の反映。" - //---------------- + // 設定値を反映する。 App.システム設定.キーバインディング = (キーバインディング) this._変更後のキーバインディング.Clone(); 入力管理.キーバインディングを保存する(); - //---------------- - #endregion } } - // メインウィンドウ用の入力管理を復活。 + + // (3) メインウィンドウ用の入力管理を復活する。 + App.入力管理 = new 入力管理( Program.App.Handle ) { キーバインディングを取得する = () => App.システム設定.キーバインディング, キーバインディングを保存する = () => App.システム設定.保存する(), @@ -232,7 +256,7 @@ public void 表示する() /// - /// 用の ListViewItem 拡張。 + /// 用の ListViewItem 拡張クラス。 /// 表示テキストのほかに、入力情報も持つ。 /// private class ListViewItem入力リスト用 : ListViewItem @@ -247,50 +271,52 @@ public ListViewItem入力リスト用( InputDeviceType deviceType, InputEvent in this.deviceType = deviceType; this.inputEvent = inputEvent; - if( deviceType == InputDeviceType.Keyboard ) - { - this.Text = $"Keyboard, {inputEvent.Key}, '{( (Key) inputEvent.Key ).ToString()}'"; - } - else if( deviceType == InputDeviceType.MidiIn ) + switch( deviceType ) { - if( inputEvent.押された ) - { - if( 255 != inputEvent.Key ) + case InputDeviceType.Keyboard: + this.Text = $"Keyboard, {inputEvent.Key}, '{( (Key) inputEvent.Key ).ToString()}'"; + break; + + case InputDeviceType.MidiIn: + if( inputEvent.押された ) { - this.Text = $"MidiIn[{inputEvent.DeviceID}], {inputEvent.Extra}, ノートオン, Note={inputEvent.Key}, Velocity={inputEvent.Velocity}"; - this.割り当て可能 = true; // 割り当て可 - this.ForeColor = System.Drawing.Color.Black; // 黒 + if( 255 != inputEvent.Key ) + { + this.Text = $"MidiIn[{inputEvent.DeviceID}], {inputEvent.Extra}, ノートオン, Note={inputEvent.Key}, Velocity={inputEvent.Velocity}"; + this.割り当て可能 = true; // 割り当て可 + this.ForeColor = System.Drawing.Color.Black; // 黒 + } + else + { + // フットペダル + this.Text = $"MidiIn[{inputEvent.DeviceID}], {inputEvent.Extra}, コントロールチェンジ, Control={inputEvent.Control}(0x{inputEvent.Control:X2}), Value={inputEvent.Velocity}"; + this.割り当て可能 = false; // 割り当て不可 + this.ForeColor = System.Drawing.Color.Green; // 緑 + } } - else + else if( inputEvent.離された ) { - this.Text = $"MidiIn[{inputEvent.DeviceID}], {inputEvent.Extra}, コントロールチェンジ, Control={inputEvent.Control}(0x{inputEvent.Control:X2}), Value={inputEvent.Velocity}"; - this.割り当て可能 = false; // 割り当て不可 - this.ForeColor = System.Drawing.Color.Green; // 緑 + this.Text = $"MidiIn[{inputEvent.DeviceID}], {inputEvent.Extra}, ノートオフ, Note={inputEvent.Key}, Velocity={inputEvent.Velocity}"; + this.割り当て可能 = false; // 割り当て不可 + this.ForeColor = System.Drawing.Color.Gray; // 灰 } - } - else if( inputEvent.離された ) - { - this.Text = $"MidiIn[{inputEvent.DeviceID}], {inputEvent.Extra}, ノートオフ, Note={inputEvent.Key}, Velocity={inputEvent.Velocity}"; - this.割り当て可能 = false; // 割り当て不可 - this.ForeColor = System.Drawing.Color.Gray; // 灰 - } - } - else - { - throw new ArgumentException( "未対応のデバイスです。" ); + break; + + default: + throw new ArgumentException( "未対応のデバイスです。" ); } } } /// - /// 用の ListViewItem 拡張。 + /// 用の ListViewItem 拡張クラス。 /// 表示テキストのほかに、入力情報も持つ。 /// private class ListViewItem割り当て済み入力リスト用 : ListViewItem { public bool 割り当て可能; public InputDeviceType deviceType; // Device種別 - public キーバインディング.IdKey idKey; // DeviceID, key + public キーバインディング.IdKey idKey; // DeviceID, key public ListViewItem割り当て済み入力リスト用( InputDeviceType deviceType, キーバインディング.IdKey idKey ) { @@ -298,10 +324,19 @@ public ListViewItem割り当て済み入力リスト用( InputDeviceType deviceT this.deviceType = deviceType; this.idKey = idKey; - this.Text = - ( deviceType == InputDeviceType.Keyboard ) ? $"Keyboard, {idKey.key}, '{( (Key) idKey.key ).ToString()}'" : - ( deviceType == InputDeviceType.MidiIn ) ? $"MidiIn[{idKey.deviceId}], Note:{idKey.key}" : - throw new ArgumentException( "未対応のデバイスです。" ); + switch( deviceType ) + { + case InputDeviceType.Keyboard: + this.Text = $"Keyboard, {idKey.key}, '{( (Key) idKey.key ).ToString()}'"; + break; + + case InputDeviceType.MidiIn: + this.Text = $"MidiIn[{idKey.deviceId}], Note:{idKey.key}"; + break; + + default: + throw new ArgumentException( "未対応のデバイスです。" ); + } } } @@ -314,33 +349,35 @@ public ListViewItem割り当て済み入力リスト用( InputDeviceType deviceT private int _FootPedal現在値; + /// - /// について、 の内容を、 - /// 割り当て済みリストに反映する。 + /// について、 + /// の内容を割り当て済みリストに反映する。 /// private void _割り当て済みリストを更新する( ListViewItem入力リスト用 選択する項目 = null ) { this.listView割り当て済み入力リスト.Items.Clear(); - // (A) キーボード - var キー割り当て = this._変更後のキーバインディング - .キーボードtoドラム - .Where( ( kvp ) => ( kvp.Value == this._現在選択されているドラム入力種別 ) ); + // キーボードの反映 + + var 現在選択されているドラム入力種別に割り当てられているキーボード入力 + = this._変更後のキーバインディング.キーボードtoドラム.Where( ( kvp ) => ( kvp.Value == this._現在選択されているドラム入力種別 ) ); - foreach( var key in キー割り当て ) + foreach( var key in 現在選択されているドラム入力種別に割り当てられているキーボード入力 ) this.listView割り当て済み入力リスト.Items.Add( new ListViewItem割り当て済み入力リスト用( InputDeviceType.Keyboard, key.Key ) ); + - // (B) MIDI入力 + // MIDI入力の反映 - var MidiIn割り当て = this._変更後のキーバインディング - .MIDItoドラム - .Where( ( kvp ) => ( kvp.Value == this._現在選択されているドラム入力種別 ) ); + var 現在選択されているドラム入力種別に割り当てられているMIDI入力 = + this._変更後のキーバインディング.MIDItoドラム.Where( ( kvp ) => ( kvp.Value == this._現在選択されているドラム入力種別 ) ); - foreach( var note in MidiIn割り当て ) + foreach( var note in 現在選択されているドラム入力種別に割り当てられているMIDI入力 ) this.listView割り当て済み入力リスト.Items.Add( new ListViewItem割り当て済み入力リスト用( InputDeviceType.MidiIn, note.Key ) ); - // フォーカス + + // 指定された項目があればフォーカスを変更する。 if( null != 選択する項目 ) { @@ -350,15 +387,17 @@ private void _割り当て済みリストを更新する( ListViewItem入力リ item.idKey.deviceId == 選択する項目.inputEvent.DeviceID && item.idKey.key == 選択する項目.inputEvent.Key ) { - // > 項目をプログラムで選択しても、フォーカスは自動的に ListView コントロールには変更されません。 - // > そのため、項目を選択するときは、通常、その項目をフォーカスがある状態に設定します。(MSDNより) + // MSDNより: // https://msdn.microsoft.com/ja-jp/library/y4x56c0b(v=vs.110).aspx + // > 項目をプログラムで選択しても、フォーカスは自動的に ListView コントロールには変更されません。 + // > そのため、項目を選択するときは、通常、その項目をフォーカスがある状態に設定します。 item.Focused = true; item.Selected = true; } } } } + private void _現在選択されている入力リストの入力行を割り当て済み入力リストに追加する() { foreach( var itemobj in this.listView入力リスト.SelectedItems ) @@ -368,102 +407,91 @@ private void _現在選択されている入力リストの入力行を割り当 { var idKey = new キーバインディング.IdKey( item.inputEvent ); - // (A) キーボード - if( item.deviceType == InputDeviceType.Keyboard ) + switch( item.deviceType ) { - // すでに割り当て済みの場合は、先にそれを削除する。 - this._変更後のキーバインディング - .キーボードtoドラム - .Remove( idKey ); - - // 追加し、更新。 - this._変更後のキーバインディング - .キーボードtoドラム - .Add( idKey, this._現在選択されているドラム入力種別 ); - - this._割り当て済みリストを更新する( item ); - this.listView割り当て済み入力リスト.Focus(); - this._変更あり = true; - } + case InputDeviceType.Keyboard: - // (B) Midi入力 - else if( item.deviceType == InputDeviceType.MidiIn ) - { - // すでに割り当て済みの場合は、先にそれを削除する。 - this._変更後のキーバインディング - .MIDItoドラム - .Remove( idKey ); - - // 追加し、更新。 - this._変更後のキーバインディング - .MIDItoドラム - .Add( idKey, this._現在選択されているドラム入力種別 ); - - this._割り当て済みリストを更新する( item ); - this.listView割り当て済み入力リスト.Focus(); - this._変更あり = true; + this._変更後のキーバインディング.キーボードtoドラム[ idKey ] = this._現在選択されているドラム入力種別; // 追加または更新 + + this._割り当て済みリストを更新する( item ); + this.listView割り当て済み入力リスト.Focus(); + + this._変更あり = true; + break; + + case InputDeviceType.MidiIn: + + this._変更後のキーバインディング.MIDItoドラム[ idKey ] = this._現在選択されているドラム入力種別; // 追加または更新 + + this._割り当て済みリストを更新する( item ); + this.listView割り当て済み入力リスト.Focus(); + + this._変更あり = true; + break; } } } } + private double _前回の入力リスト追加時刻; + private void _一定時間が経っていれば空行を挿入する() { double 今回の入力リスト追加時刻 = QPCTimer.生カウント相対値を秒へ変換して返す( QPCTimer.生カウント ); - if( 1.0 < ( 今回の入力リスト追加時刻 - this._前回の入力リスト追加時刻 ) ) // 1秒以上経っていれば + // 1秒以上経っていれば改行 + if( 1.0 < ( 今回の入力リスト追加時刻 - this._前回の入力リスト追加時刻 ) ) this.listView入力リスト.Items.Add( "" ); this._前回の入力リスト追加時刻 = 今回の入力リスト追加時刻; } + private void comboBoxパッドリスト_SelectedIndexChanged( object sender, EventArgs e ) { - this._現在選択されているドラム入力種別 = (ドラム入力種別) Enum.Parse( typeof( ドラム入力種別 ), (string) this.comboBoxパッドリスト.SelectedItem ); + this._現在選択されているドラム入力種別 = + (ドラム入力種別) Enum.Parse( typeof( ドラム入力種別 ), (string) this.comboBoxパッドリスト.SelectedItem ); this._割り当て済みリストを更新する(); } + private void button追加_Click( object sender, EventArgs e ) { this._現在選択されている入力リストの入力行を割り当て済み入力リストに追加する(); } + private void listView入力リスト_DoubleClick( object sender, EventArgs e ) { this._現在選択されている入力リストの入力行を割り当て済み入力リストに追加する(); } + private void button割り当て解除_Click( object sender, EventArgs e ) { - // 選択されている項目に対応する入力をキーバインディングから削除。 + // 選択されている項目に対応する入力をキーバインディングから削除する。 + foreach( ListViewItem割り当て済み入力リスト用 item in this.listView割り当て済み入力リスト.SelectedItems ) { - // (A) キーボード。 - if( item.deviceType == InputDeviceType.Keyboard ) - { - // 割り当て済みの場合は、削除する。 - this._変更後のキーバインディング - .キーボードtoドラム - .Remove( item.idKey ); - - this._変更あり = true; - } - - // (B) MIDI入力。 - else if( item.deviceType == InputDeviceType.MidiIn ) + switch( item.deviceType ) { - // 割り当て済みの場合は、削除する。 - this._変更後のキーバインディング - .MIDItoドラム - .Remove( item.idKey ); + case InputDeviceType.Keyboard: + this._変更後のキーバインディング.キーボードtoドラム.Remove( item.idKey ); + this._変更あり = true; + break; - this._変更あり = true; + case InputDeviceType.MidiIn: + this._変更後のキーバインディング.MIDItoドラム.Remove( item.idKey ); + this._変更あり = true; + break; } } this._割り当て済みリストを更新する(); } + private bool _変更あり; + private void 入力割り当てダイアログ_FormClosing( object sender, FormClosingEventArgs e ) { // ※ウィンドウを閉じようとした時も Cancel になる。 diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.Designer.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.Designer.cs" index 54f0dab..821fbf3 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.Designer.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.Designer.cs" @@ -28,116 +28,117 @@ protected override void Dispose( bool disposing ) /// private void InitializeComponent() { - this.buttonOk = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.listViewフォルダ一覧 = new System.Windows.Forms.ListView(); - this.columnHeaderフォルダ名 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.label1 = new System.Windows.Forms.Label(); - this.button選択 = new System.Windows.Forms.Button(); - this.button削除 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // buttonOk - // - this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOk.Font = new System.Drawing.Font("MS UI Gothic", 12F); - this.buttonOk.Location = new System.Drawing.Point(450, 341); - this.buttonOk.Name = "buttonOk"; - this.buttonOk.Size = new System.Drawing.Size(129, 38); - this.buttonOk.TabIndex = 5; - this.buttonOk.Text = "OK"; - this.buttonOk.UseVisualStyleBackColor = true; - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Font = new System.Drawing.Font("MS UI Gothic", 12F); - this.buttonCancel.Location = new System.Drawing.Point(594, 341); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(129, 38); - this.buttonCancel.TabIndex = 6; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - // - // listViewフォルダ一覧 - // - this.listViewフォルダ一覧.AllowColumnReorder = true; - this.listViewフォルダ一覧.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.listViewフォルダ一覧 = new System.Windows.Forms.ListView(); + this.columnHeaderフォルダ名 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.label1 = new System.Windows.Forms.Label(); + this.button選択 = new System.Windows.Forms.Button(); + this.button削除 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Font = new System.Drawing.Font("MS UI Gothic", 12F); + this.buttonOk.Location = new System.Drawing.Point(450, 341); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(129, 38); + this.buttonOk.TabIndex = 5; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Font = new System.Drawing.Font("MS UI Gothic", 12F); + this.buttonCancel.Location = new System.Drawing.Point(594, 341); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(129, 38); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // listViewフォルダ一覧 + // + this.listViewフォルダ一覧.AllowColumnReorder = true; + this.listViewフォルダ一覧.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeaderフォルダ名}); - this.listViewフォルダ一覧.Font = new System.Drawing.Font("MS UI Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); - this.listViewフォルダ一覧.GridLines = true; - this.listViewフォルダ一覧.HideSelection = false; - this.listViewフォルダ一覧.Location = new System.Drawing.Point(12, 43); - this.listViewフォルダ一覧.Name = "listViewフォルダ一覧"; - this.listViewフォルダ一覧.Size = new System.Drawing.Size(711, 217); - this.listViewフォルダ一覧.TabIndex = 7; - this.listViewフォルダ一覧.UseCompatibleStateImageBehavior = false; - this.listViewフォルダ一覧.View = System.Windows.Forms.View.Details; - this.listViewフォルダ一覧.SelectedIndexChanged += new System.EventHandler(this.listViewフォルダ一覧_SelectedIndexChanged); - // - // columnHeaderフォルダ名 - // - this.columnHeaderフォルダ名.Text = "フォルダ名"; - this.columnHeaderフォルダ名.Width = 662; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("MS UI Gothic", 12F); - this.label1.Location = new System.Drawing.Point(11, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(163, 16); - this.label1.TabIndex = 8; - this.label1.Text = "曲読み込みフォルダ一覧"; - // - // button選択 - // - this.button選択.Font = new System.Drawing.Font("MS UI Gothic", 12F); - this.button選択.Location = new System.Drawing.Point(12, 277); - this.button選択.Name = "button選択"; - this.button選択.Size = new System.Drawing.Size(129, 38); - this.button選択.TabIndex = 9; - this.button選択.Text = "選択..."; - this.button選択.UseVisualStyleBackColor = true; - this.button選択.Click += new System.EventHandler(this.button選択_Click); - // - // button削除 - // - this.button削除.Enabled = false; - this.button削除.Font = new System.Drawing.Font("MS UI Gothic", 12F); - this.button削除.Location = new System.Drawing.Point(147, 277); - this.button削除.Name = "button削除"; - this.button削除.Size = new System.Drawing.Size(129, 38); - this.button削除.TabIndex = 10; - this.button削除.Text = "削除"; - this.button削除.UseVisualStyleBackColor = true; - this.button削除.Click += new System.EventHandler(this.button削除_Click); - // - // 曲読み込みフォルダ割り当てダイアログ - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(735, 391); - this.Controls.Add(this.button削除); - this.Controls.Add(this.button選択); - this.Controls.Add(this.label1); - this.Controls.Add(this.listViewフォルダ一覧); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOk); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "曲読み込みフォルダ割り当てダイアログ"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "曲読み込みフォルダ"; - this.TopMost = true; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this._FormClosing); - this.ResumeLayout(false); - this.PerformLayout(); + this.listViewフォルダ一覧.Font = new System.Drawing.Font("MS UI Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); + this.listViewフォルダ一覧.GridLines = true; + this.listViewフォルダ一覧.HideSelection = false; + this.listViewフォルダ一覧.Location = new System.Drawing.Point(12, 43); + this.listViewフォルダ一覧.Name = "listViewフォルダ一覧"; + this.listViewフォルダ一覧.Size = new System.Drawing.Size(711, 217); + this.listViewフォルダ一覧.TabIndex = 7; + this.listViewフォルダ一覧.UseCompatibleStateImageBehavior = false; + this.listViewフォルダ一覧.View = System.Windows.Forms.View.Details; + this.listViewフォルダ一覧.SelectedIndexChanged += new System.EventHandler(this.listViewフォルダ一覧_SelectedIndexChanged); + // + // columnHeaderフォルダ名 + // + this.columnHeaderフォルダ名.Text = "フォルダ名"; + this.columnHeaderフォルダ名.Width = 662; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("MS UI Gothic", 12F); + this.label1.Location = new System.Drawing.Point(11, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(163, 16); + this.label1.TabIndex = 8; + this.label1.Text = "曲読み込みフォルダ一覧"; + // + // button選択 + // + this.button選択.Font = new System.Drawing.Font("MS UI Gothic", 12F); + this.button選択.Location = new System.Drawing.Point(12, 277); + this.button選択.Name = "button選択"; + this.button選択.Size = new System.Drawing.Size(129, 38); + this.button選択.TabIndex = 9; + this.button選択.Text = "選択..."; + this.button選択.UseVisualStyleBackColor = true; + this.button選択.Click += new System.EventHandler(this.button選択_Click); + // + // button削除 + // + this.button削除.Enabled = false; + this.button削除.Font = new System.Drawing.Font("MS UI Gothic", 12F); + this.button削除.Location = new System.Drawing.Point(147, 277); + this.button削除.Name = "button削除"; + this.button削除.Size = new System.Drawing.Size(129, 38); + this.button削除.TabIndex = 10; + this.button削除.Text = "削除"; + this.button削除.UseVisualStyleBackColor = true; + this.button削除.Click += new System.EventHandler(this.button削除_Click); + // + // 曲読み込みフォルダ割り当てダイアログ + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(735, 391); + this.Controls.Add(this.button削除); + this.Controls.Add(this.button選択); + this.Controls.Add(this.label1); + this.Controls.Add(this.listViewフォルダ一覧); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "曲読み込みフォルダ割り当てダイアログ"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "曲読み込みフォルダ"; + this.TopMost = true; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this._FormClosing); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" index 28deac7..e7c425e 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/05\343\202\252\343\203\227\343\202\267\343\203\247\343\203\263\350\250\255\345\256\232/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\203\225\343\202\251\343\203\253\343\203\200\345\211\262\343\202\212\345\275\223\343\201\246\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" @@ -9,94 +9,97 @@ namespace DTXMania.ステージ.オプション設定 { - public partial class 曲読み込みフォルダ割り当てダイアログ : Form + partial class 曲読み込みフォルダ割り当てダイアログ : Form { public 曲読み込みフォルダ割り当てダイアログ() { InitializeComponent(); - - // 物理画面のサイズに応じて、フォームのサイズを変更。 - //this.Scale( - // new System.Drawing.SizeF( - // Math.Max( 1f, グラフィックデバイス.Instance.拡大率DPXtoPX横 ), - // Math.Max( 1f, グラフィックデバイス.Instance.拡大率DPXtoPX縦 ) ) ); } + /// + /// ダイアログを表示する。 + /// 設定が保存されたら true、キャンセルされたら false を返す。 + /// public bool 表示する() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - bool 変更された = false; + bool キャンセルされた = false; + + // (1) メインウィンドウ用の入力管理をいったん破棄し、このダイアログ用の入力管理を生成する。 - // メインウィンドウ用の入力管理をいったん破棄し、このウィンドウ用の入力管理を生成する。 App.入力管理.Dispose(); + using( var 入力管理 = new 入力管理( this.Handle ) ) { 入力管理.キーバインディングを取得する = () => App.システム設定.キーバインディング; 入力管理.キーバインディングを保存する = () => App.システム設定.保存する(); 入力管理.初期化する(); - #region " 現在の設定で初期値。" - //---------------- - foreach( var vpath in App.システム設定.曲検索フォルダ ) + // (2) ダイアログの表示から終了までを実行。 + + #region " 現在の設定で初期化。" + //---------------- + foreach( var vpath in App.システム設定.曲検索フォルダ ) this.listViewフォルダ一覧.Items.Add( new ListViewItem( $"{vpath.変数なしパス}" ) ); // ここでは変数なしでパスを表示する。 this._変更あり = false; - //---------------- - #endregion + //---------------- + #endregion - var dr = DialogResult.OK; + #region " ダイアログの表示と設定値の保存。" + //---------------- + { + Cursor.Show(); - #region " ダイアログの表示から終了まで " - //---------------- - Cursor.Show(); + var dr = this.ShowDialog( Program.App ); - dr = this.ShowDialog( Program.App ); + if( App.全画面モード ) + Cursor.Hide(); - if( App.全画面モード ) - Cursor.Hide(); - //---------------- - #endregion + if( dr == DialogResult.OK ) + { + // 変更後の設定を保存。 - if( dr == DialogResult.OK ) - { - #region " 変更後の設定を保存。" - //---------------- - App.システム設定.曲検索フォルダ.Clear(); - foreach( ListViewItem item in this.listViewフォルダ一覧.Items ) - App.システム設定.曲検索フォルダ.Add( new VariablePath( item.SubItems[ 0 ].Text ) ); + App.システム設定.曲検索フォルダ.Clear(); + foreach( ListViewItem item in this.listViewフォルダ一覧.Items ) + App.システム設定.曲検索フォルダ.Add( new VariablePath( item.SubItems[ 0 ].Text ) ); - App.システム設定.保存する(); - //---------------- - #endregion + App.システム設定.保存する(); - 変更された = true; - } - else - { - Log.Info( "キャンセルされました。" ); - 変更された = false; - } - } + キャンセルされた = false; + } + else + { + Log.Info( "キャンセルされました。" ); + キャンセルされた = true; + } + } + //---------------- + #endregion + } + + // (3) メインウィンドウ用の入力管理を復活させる。 - // メインウィンドウ用の入力管理を復活。 - App.入力管理 = new 入力管理( Program.App.Handle ) { + App.入力管理 = new 入力管理( Program.App.Handle ) { キーバインディングを取得する = () => App.システム設定.キーバインディング, キーバインディングを保存する = () => App.システム設定.保存する(), }; App.入力管理.初期化する(); - return 変更された; + return !( キャンセルされた ); } } private bool _変更あり; + + // イベント + private void _FormClosing( object sender, FormClosingEventArgs e ) { - // ※ウィンドウを閉じようとした時も Cancel になる。 - if( this.DialogResult == DialogResult.Cancel && this._変更あり ) + if( this.DialogResult == DialogResult.Cancel && this._変更あり ) // ウィンドウを閉じようとした時も Cancel になる。 { var dr = MessageBoxEx.Show( "変更を破棄していいですか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2 ); @@ -104,6 +107,7 @@ private void _FormClosing( object sender, FormClosingEventArgs e ) e.Cancel = true; } } + private void listViewフォルダ一覧_SelectedIndexChanged( object sender, EventArgs e ) { if( 0 < this.listViewフォルダ一覧.SelectedItems.Count ) @@ -117,6 +121,7 @@ private void listViewフォルダ一覧_SelectedIndexChanged( object sender, Eve this.button削除.Enabled = false; } } + private void button選択_Click( object sender, EventArgs e ) { // フォルダ選択ダイアログを生成する。 @@ -126,7 +131,7 @@ private void button選択_Click( object sender, EventArgs e ) AllowNonFileSystemItems = false, } ) { - // ダイアログの表示から終了。 + // ダイアログを表示。 if( dialog.ShowDialog( this.Handle ) == CommonFileDialogResult.Ok ) { // 選択されたフォルダを曲読み込みフォルダリストに追加する。 @@ -141,6 +146,7 @@ private void button選択_Click( object sender, EventArgs e ) } } } + private void button削除_Click( object sender, EventArgs e ) { foreach( int selectedIndex in this.listViewフォルダ一覧.SelectedIndices ) diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\202\271\343\203\206\343\203\274\343\202\270.cs" index 35727c6..9428eb0 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -27,9 +27,9 @@ public 曲読み込みステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._舞台画像 = new 舞台画像() ); - this.子を追加する( this._注意文 = new 画像( @"$(System)images\曲読み込み\ご注意ください.png" ) ); - this.子を追加する( this._曲名画像 = new 文字列画像() { + this.子Activityを追加する( this._舞台画像 = new 舞台画像() ); + this.子Activityを追加する( this._注意文 = new 画像( @"$(System)images\曲読み込み\ご注意ください.png" ) ); + this.子Activityを追加する( this._曲名画像 = new 文字列画像() { フォント名 = "HGMaruGothicMPRO", フォントサイズpt = 70f, フォント幅 = FontWeight.Regular, @@ -39,7 +39,7 @@ public 曲読み込みステージ() 前景色 = Color4.Black, 背景色 = Color4.White, } ); - this.子を追加する( this._サブタイトル画像 = new 文字列画像() { + this.子Activityを追加する( this._サブタイトル画像 = new 文字列画像() { フォント名 = "HGMaruGothicMPRO", フォントサイズpt = 45f, フォント幅 = FontWeight.Regular, @@ -49,8 +49,8 @@ public 曲読み込みステージ() 前景色 = Color4.Black, 背景色 = Color4.White, } ); - this.子を追加する( this._プレビュー画像 = new プレビュー画像() ); - this.子を追加する( this._難易度 = new 難易度() ); + this.子Activityを追加する( this._プレビュー画像 = new プレビュー画像() ); + this.子Activityを追加する( this._難易度 = new 難易度() ); } } @@ -64,14 +64,20 @@ protected override void On活性化() this._曲名画像.表示文字列 = 選択曲.タイトル; this._サブタイトル画像.表示文字列 = 選択曲.サブタイトル; + App.システムサウンド.再生する( 設定.システムサウンド種別.曲読み込みステージ_開始音 ); + App.システムサウンド.再生する( 設定.システムサウンド種別.曲読み込みステージ_ループBGM, ループ再生する: true ); + this.現在のフェーズ = フェーズ.フェードイン; this._初めての進行描画 = true; } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + //App.システムサウンド.停止する( 設定.システムサウンド種別.曲読み込みステージ_開始音 ); --> なりっぱなしでいい + App.システムサウンド.停止する( 設定.システムサウンド種別.曲読み込みステージ_ループBGM ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\351\233\243\346\230\223\345\272\246.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\351\233\243\346\230\223\345\272\246.cs" index d9bfa0f..4672435 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\351\233\243\346\230\223\345\272\246.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/06\346\233\262\350\252\255\343\201\277\350\276\274\343\201\277/\351\233\243\346\230\223\345\272\246.cs" @@ -16,7 +16,7 @@ public 難易度() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大.png", @"$(System)images\パラメータ文字_大.json", 文字幅補正dpx: 0f ) ); + this.子Activityを追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大.png", @"$(System)images\パラメータ文字_大.yaml", 文字幅補正dpx: 0f ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\250\343\202\255\343\202\265\343\202\244\343\203\210\343\202\262\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\250\343\202\255\343\202\265\343\202\244\343\203\210\343\202\262\343\203\274\343\202\270.cs" index 6cb16fb..aa29672 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\250\343\202\255\343\202\265\343\202\244\343\203\210\343\202\262\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\250\343\202\255\343\202\265\343\202\244\343\203\210\343\202\262\343\203\274\343\202\270.cs" @@ -15,8 +15,8 @@ public エキサイトゲージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._ゲージ枠通常 = new 画像( @"$(System)images\演奏\エキサイトゲージ通常.png" ) ); - this.子を追加する( this._ゲージ枠DANGER = new 画像( @"$(System)images\演奏\エキサイトゲージDANGER.png" ) ); + this.子Activityを追加する( this._ゲージ枠通常 = new 画像( @"$(System)images\演奏\エキサイトゲージ通常.png" ) ); + this.子Activityを追加する( this._ゲージ枠DANGER = new 画像( @"$(System)images\演奏\エキサイトゲージDANGER.png" ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\350\241\250\347\244\272.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\350\241\250\347\244\272.cs" index c5586f8..ac7cc1a 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\350\241\250\347\244\272.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\263\343\203\263\343\203\234\350\241\250\347\244\272.cs" @@ -6,7 +6,6 @@ using SharpDX; using SharpDX.Animation; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -17,7 +16,7 @@ public コンボ表示() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._コンボ文字画像 = new 画像( @"$(System)images\演奏\コンボ文字.png" ) ); + this.子Activityを追加する( this._コンボ文字画像 = new 画像( @"$(System)images\演奏\コンボ文字.png" ) ); } } @@ -27,7 +26,19 @@ protected override void On活性化() { this._前回表示した値 = 0; this._前回表示した数字 = " "; - this._コンボ文字設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\コンボ文字.json" ).変数なしパス ) ); + + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\コンボ文字.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._コンボ文字の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._コンボ文字の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } this._各桁のアニメ = new 各桁のアニメ[ 4 ]; for( int i = 0; i < this._各桁のアニメ.Length; i++ ) @@ -77,7 +88,7 @@ public void 進行描画する( DeviceContext1 dc, アニメーション管理 a var 全体のサイズ = new Vector2( 0f, 0f ); for( int i = 0; i < 数字.Length; i++ ) { - var 矩形 = FDKUtilities.JsonToRectangleF( this._コンボ文字設定[ "矩形リスト" ][ 数字[ i ].ToString() ] ); + var 矩形 = this._コンボ文字の矩形リスト[ 数字[ i ].ToString() ]; 全体のサイズ.X += 矩形.Width + 文字間隔補正; // 合計 全体のサイズ.Y = Math.Max( 全体のサイズ.Y, 矩形.Height ); // 最大値 } @@ -119,7 +130,7 @@ public void 進行描画する( DeviceContext1 dc, アニメーション管理 a } } - var 転送元矩形 = FDKUtilities.JsonToRectangleF( this._コンボ文字設定[ "矩形リスト" ][ 数字[ i ].ToString() ] ); + var 転送元矩形 = this._コンボ文字の矩形リスト[ 数字[ i ].ToString() ]; dc.Transform = Matrix3x2.Scaling( 画像矩形から表示矩形への拡大率 ) * @@ -139,7 +150,7 @@ public void 進行描画する( DeviceContext1 dc, アニメーション管理 a #region " Combo を描画。" //---------------- { - var 転送元矩形 = FDKUtilities.JsonToRectangleF( this._コンボ文字設定[ "矩形リスト" ][ "Combo" ] ); + var 転送元矩形 = this._コンボ文字の矩形リスト[ "Combo" ]; var 文字の位置 = new Vector2( 0f, 130f ); dc.Transform = @@ -165,7 +176,7 @@ public void 進行描画する( DeviceContext1 dc, アニメーション管理 a private int _前回表示した値 = 0; private string _前回表示した数字 = " "; private 画像 _コンボ文字画像 = null; - private JObject _コンボ文字設定 = null; + private Dictionary _コンボ文字の矩形リスト = null; // 桁ごとのアニメーション @@ -282,5 +293,11 @@ public void 開始( アニメーション管理 am ) } }; private 百ごとのアニメ _百ごとのアニメ = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\350\241\250\347\244\272.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\350\241\250\347\244\272.cs" index efde697..fe4130f 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\350\241\250\347\244\272.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\202\271\343\202\263\343\202\242\350\241\250\347\244\272.cs" @@ -6,7 +6,6 @@ using SharpDX; using SharpDX.Animation; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -21,7 +20,7 @@ public スコア表示() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._スコア数字画像 = new 画像( @"$(System)images\演奏\スコア数字.png" ) ); + this.子Activityを追加する( this._スコア数字画像 = new 画像( @"$(System)images\演奏\スコア数字.png" ) ); } } @@ -29,7 +28,18 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this._スコア数字画像設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\スコア数字.json" ).変数なしパス ) ); + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\スコア数字.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._スコア数字の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._スコア数字の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } // 表示用 this._現在表示中のスコア = 0; @@ -92,7 +102,7 @@ public void 進行描画する( DeviceContext1 dc, アニメーション管理 a this._各桁のアニメ[ i ].跳ね開始( am, 0.0 ); } - var 転送元矩形 = FDKUtilities.JsonToRectangleF( this._スコア数字画像設定[ "矩形リスト" ][ 数字[ i ].ToString() ] ); + var 転送元矩形 = this._スコア数字の矩形リスト[ 数字[ i ].ToString() ]; dc.Transform = //Matrix3x2.Scaling( 画像矩形から表示矩形への拡大率 ) * @@ -125,7 +135,7 @@ public void 進行描画する( DeviceContext1 dc, アニメーション管理 a private int _前回表示したスコア = 0; private 画像 _スコア数字画像 = null; - private JObject _スコア数字画像設定 = null; + private Dictionary _スコア数字の矩形リスト = null; private Dictionary<判定種別, int> _判定toヒット数 = null; private string _前回表示した数字 = " 0"; @@ -167,5 +177,11 @@ public void 跳ね開始( アニメーション管理 am, double 遅延sec ) } }; private 各桁のアニメ[] _各桁のアニメ = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.cs" index e43f619..c9cc7cf 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\201\343\203\203\343\203\227\345\205\211.cs" @@ -6,7 +6,6 @@ using SharpDX; using SharpDX.Animation; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -17,8 +16,8 @@ public チップ光() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._放射光 = new 画像( @"$(System)images\演奏\チップ光.png" ) { 加算合成 = true } ); - this.子を追加する( this._光輪 = new 画像( @"$(System)images\演奏\チップ光輪.png" ) { 加算合成 = true } ); + this.子Activityを追加する( this._放射光 = new 画像( @"$(System)images\演奏\チップ光.png" ) { 加算合成 = true } ); + this.子Activityを追加する( this._光輪 = new 画像( @"$(System)images\演奏\チップ光輪.png" ) { 加算合成 = true } ); } } @@ -26,7 +25,18 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this._放射光設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\チップ光.json" ).変数なしパス ) ); + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\チップ光.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._放射光の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._放射光の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } this._レーンtoステータス = new Dictionary<表示レーン種別, 表示レーンステータス>() { { 表示レーン種別.Unknown, new 表示レーンステータス( 表示レーン種別.Unknown ) }, @@ -146,7 +156,7 @@ public void 進行描画する( DeviceContext1 dc ) // (1) 放射光 の進行描画。 { - var 転送元矩形dpx = FDKUtilities.JsonToRectangleF( this._放射光設定[ "矩形リスト" ][ レーン.ToString() ] ); + var 転送元矩形dpx = this._放射光の矩形リスト[ レーン.ToString() ]; var 転送元矩形の中心dpx = new Vector2( 転送元矩形dpx.Width / 2f, 転送元矩形dpx.Height / 2f ); var 変換行列2D = @@ -160,7 +170,7 @@ public void 進行描画する( DeviceContext1 dc ) // (2) 光輪 の進行描画。 { - var 転送元矩形dpx = FDKUtilities.JsonToRectangleF( this._放射光設定[ "矩形リスト" ][ レーン.ToString() ] ); + var 転送元矩形dpx = this._放射光の矩形リスト[ レーン.ToString() ]; var 転送元矩形の中心dpx = new Vector2( 転送元矩形dpx.Width / 2f, 転送元矩形dpx.Height / 2f ); var 変換行列2D = @@ -188,7 +198,7 @@ public void 進行描画する( DeviceContext1 dc ) private 画像 _放射光 = null; private 画像 _光輪 = null; - private JObject _放射光設定 = null; + private Dictionary _放射光の矩形リスト = null; /// /// 以下の画像のアニメ&表示管理を行うクラス。 @@ -247,5 +257,11 @@ public void アニメ用メンバを解放する() } } private Dictionary<表示レーン種別, 表示レーンステータス> _レーンtoステータス = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.cs" index c78d3f6..0796227 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\211\343\203\251\343\203\240\343\203\221\343\203\203\343\203\211.cs" @@ -5,7 +5,6 @@ using System.Linq; using SharpDX; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -16,7 +15,7 @@ public ドラムパッド() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._パッド絵 = new 画像( @"$(System)images\演奏\ドラムパッド.png" ) ); + this.子Activityを追加する( this._パッド絵 = new 画像( @"$(System)images\演奏\ドラムパッド.png" ) ); } } @@ -24,7 +23,19 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this._パッド絵設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\ドラムパッド.json" ).変数なしパス ) ); + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\ドラムパッド.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._パッド絵の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._パッド絵の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } + this._レーンtoパッドContext = new Dictionary<表示レーン種別, パッドContext>(); foreach( 表示レーン種別 lane in Enum.GetValues( typeof( 表示レーン種別 ) ) ) @@ -33,8 +44,8 @@ protected override void On活性化() 左上位置dpx = new Vector2( x: レーンフレーム.領域.X + レーンフレーム.現在のレーン配置.表示レーンの左端位置dpx[ lane ], y: 840f ), - 転送元矩形 = FDKUtilities.JsonToRectangleF( this._パッド絵設定[ "矩形リスト" ][ lane.ToString() ] ), - 転送元矩形Flush = FDKUtilities.JsonToRectangleF( this._パッド絵設定[ "矩形リスト" ][ lane.ToString() + "_Flush" ] ), + 転送元矩形 = this._パッド絵の矩形リスト[ lane.ToString() ], + 転送元矩形Flush = this._パッド絵の矩形リスト[ lane.ToString() + "_Flush" ], アニメカウンタ = new Counter(), } ); } @@ -88,7 +99,7 @@ public void 進行描画する( DeviceContext1 dc ) } private 画像 _パッド絵 = null; - private JObject _パッド絵設定 = null; + private Dictionary _パッド絵の矩形リスト = null; private struct パッドContext { @@ -98,5 +109,11 @@ private struct パッドContext public Counter アニメカウンタ; }; private Dictionary<表示レーン種別, パッドContext> _レーンtoパッドContext = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\222\343\203\203\343\203\210\343\203\220\343\203\274.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\222\343\203\203\343\203\210\343\203\220\343\203\274.cs" index 965968b..51736c8 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\222\343\203\203\343\203\210\343\203\220\343\203\274.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\222\343\203\203\343\203\210\343\203\220\343\203\274.cs" @@ -16,7 +16,7 @@ class ヒットバー : Activity public ヒットバー() { - this.子を追加する( this._ヒットバー画像 = new 画像( @"$(System)images\演奏\ヒットバー.png" ) ); + this.子Activityを追加する( this._ヒットバー画像 = new 画像( @"$(System)images\演奏\ヒットバー.png" ) ); } protected override void On活性化() diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\225\343\202\247\343\203\274\343\202\272\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\225\343\202\247\343\203\274\343\202\272\343\203\221\343\203\215\343\203\253.cs" index 939c182..c463f12 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\225\343\202\247\343\203\274\343\202\272\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\225\343\202\247\343\203\274\343\202\272\343\203\221\343\203\215\343\203\253.cs" @@ -5,7 +5,6 @@ using System.Linq; using SharpDX; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -28,7 +27,7 @@ public フェーズパネル() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._演奏位置カーソル画像 = new 画像( @"$(System)images\演奏\演奏位置カーソル.png" ) ); + this.子Activityを追加する( this._演奏位置カーソル画像 = new 画像( @"$(System)images\演奏\演奏位置カーソル.png" ) ); } } @@ -36,8 +35,20 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\演奏位置カーソル.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._演奏位置カーソルの矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._演奏位置カーソルの矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } + this._現在位置 = 0.0f; - this._演奏位置カーソル画像設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\演奏位置カーソル.json" ).変数なしパス ) ); this._初めての進行描画 = true; } } @@ -58,21 +69,21 @@ public void 進行描画する( DeviceContext1 dc ) var 中央位置dpx = new Vector2( 1308f, 876f - this._現在位置 * 767f ); - var バー矩形 = FDKUtilities.JsonToRectangleF( this._演奏位置カーソル画像設定[ "矩形リスト" ][ "Bar" ] ); + var バー矩形 = this._演奏位置カーソルの矩形リスト[ "Bar" ]; this._演奏位置カーソル画像.描画する( dc, 中央位置dpx.X - バー矩形.Width / 2f, 中央位置dpx.Y - バー矩形.Height / 2f, 転送元矩形: バー矩形 ); - var 左三角矩形 = FDKUtilities.JsonToRectangleF( this._演奏位置カーソル画像設定[ "矩形リスト" ][ "Left" ] ); + var 左三角矩形 = this._演奏位置カーソルの矩形リスト[ "Left" ]; this._演奏位置カーソル画像.描画する( dc, 中央位置dpx.X - 左三角矩形.Width / 2f - this._左右三角アニメ用カウンタ.現在値の割合 * 40f, 中央位置dpx.Y - 左三角矩形.Height / 2f, 転送元矩形: 左三角矩形 ); - var 右三角矩形 = FDKUtilities.JsonToRectangleF( this._演奏位置カーソル画像設定[ "矩形リスト" ][ "Right" ] ); + var 右三角矩形 = this._演奏位置カーソルの矩形リスト[ "Right" ]; this._演奏位置カーソル画像.描画する( dc, 中央位置dpx.X - 右三角矩形.Width / 2f + this._左右三角アニメ用カウンタ.現在値の割合 * 40f, @@ -83,7 +94,13 @@ public void 進行描画する( DeviceContext1 dc ) private bool _初めての進行描画 = true; private float _現在位置 = 0.0f; private 画像 _演奏位置カーソル画像 = null; - private JObject _演奏位置カーソル画像設定 = null; + private Dictionary _演奏位置カーソルの矩形リスト = null; private LoopCounter _左右三角アニメ用カウンタ = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.cs" index 603c362..552bcbb 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\251\343\203\203\343\202\267\343\203\245.cs" @@ -5,7 +5,6 @@ using System.Linq; using SharpDX; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -16,7 +15,7 @@ public レーンフラッシュ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._レーンフラッシュ画像 = new 画像( @"$(System)images\演奏\レーンフラッシュ.png" ) { 加算合成 = true } ); + this.子Activityを追加する( this._レーンフラッシュ画像 = new 画像( @"$(System)images\演奏\レーンフラッシュ.png" ) { 加算合成 = true } ); } } @@ -24,7 +23,19 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this._レーンフラッシュ画像設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\レーンフラッシュ.json" ).変数なしパス ) ); + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\レーンフラッシュ.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._レーンフラッシュの矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._レーンフラッシュの矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } + this._レーンtoレーンContext = new Dictionary<表示レーン種別, レーンContext>(); foreach( 表示レーン種別 lane in Enum.GetValues( typeof( 表示レーン種別 ) ) ) @@ -33,7 +44,7 @@ protected override void On活性化() 開始位置dpx = new Vector2( x: レーンフレーム.領域.X + レーンフレーム.現在のレーン配置.表示レーンの左端位置dpx[ lane ], y: レーンフレーム.領域.Bottom ), - 転送元矩形 = FDKUtilities.JsonToRectangleF( this._レーンフラッシュ画像設定[ "矩形リスト" ][ lane.ToString() ] ), + 転送元矩形 = this._レーンフラッシュの矩形リスト[ lane.ToString() ], アニメカウンタ = new Counter(), } ); } @@ -79,6 +90,12 @@ private struct レーンContext private Dictionary<表示レーン種別, レーンContext> _レーンtoレーンContext = null; private 画像 _レーンフラッシュ画像 = null; - private JObject _レーンフラッシュ画像設定 = null; + private Dictionary _レーンフラッシュの矩形リスト = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\254\343\203\274\343\203\240.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\254\343\203\274\343\203\240.cs" index 4c9e661..7ff1a55 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\254\343\203\274\343\203\240.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\343\203\254\343\203\274\343\203\263\343\203\225\343\203\254\343\203\274\343\203\240.cs" @@ -5,7 +5,7 @@ using System.Linq; using SharpDX; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; +using YamlDotNet.Serialization; using FDK; namespace DTXMania.ステージ.演奏 @@ -45,9 +45,10 @@ public class レーン配置 /// レーンラインの領域。 /// .Left からの相対値[dpx]。 /// - public List レーンライン; + public RectangleF[] レーンライン; public Color4 レーン色; + public Color4 レーンライン色; } public static レーン配置 現在のレーン配置 { get; private set; } @@ -57,48 +58,54 @@ public static void 初期化する() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - var root = new VariablePath( @"$(System)images\演奏\レーン配置" ); - レーン配置リスト = new Dictionary(); + // レーン配置フォルダから、レーン配置に適合する設定ファイルを検索。 - // images フォルダから、レーン配置に適合する設定ファイルを検索。 + var root = new VariablePath( @"$(System)images\演奏\レーン配置" ); - foreach( var fileInfo in new DirectoryInfo( root.変数なしパス ).GetFiles( "*.json", SearchOption.TopDirectoryOnly ) ) + レーン配置リスト = new Dictionary(); + foreach( var fileInfo in new DirectoryInfo( root.変数なしパス ).GetFiles( "*.yaml", SearchOption.TopDirectoryOnly ) ) { var 拡張子なしのファイル名 = Path.GetFileNameWithoutExtension( fileInfo.Name ); - - レーン配置リスト.Add( 拡張子なしのファイル名, new レーン配置 { 配置名 = 拡張子なしのファイル名 } ); // 名前だけ + レーン配置リスト[ 拡張子なしのファイル名] = new レーン配置 { 配置名 = 拡張子なしのファイル名 }; } + // 各設定ファイルから設定を読み込む。 foreach( var kvp in レーン配置リスト ) { - var 設定ファイルパス = Path.Combine( root.変数なしパス, kvp.Key + ".json" ); - var 設定 = JObject.Parse( File.ReadAllText( 設定ファイルパス ) ); - - kvp.Value.表示レーンの左端位置dpx = new Dictionary<表示レーン種別, float>(); - kvp.Value.表示レーンの幅dpx = new Dictionary<表示レーン種別, float>(); + var 設定ファイルパス = new VariablePath( Path.Combine( root.変数なしパス, kvp.Key + ".yaml" ) ); - foreach( 表示レーン種別 lane in Enum.GetValues( typeof( 表示レーン種別 ) ) ) + try { - kvp.Value.表示レーンの左端位置dpx.Add( lane, (float) 設定[ "左端位置" ][ lane.ToString() ] ); - kvp.Value.表示レーンの幅dpx.Add( lane, (float) 設定[ "幅" ][ lane.ToString() ] ); + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + kvp.Value.表示レーンの左端位置dpx = yamlMap.左端位置; + kvp.Value.表示レーンの幅dpx = yamlMap.幅; + kvp.Value.レーンライン = new RectangleF[ yamlMap.レーンライン.Length ]; + for( int i = 0; i < yamlMap.レーンライン.Length; i++ ) + { + if( 4 == yamlMap.レーンライン[ i ].Length ) + kvp.Value.レーンライン[ i ] = new RectangleF( yamlMap.レーンライン[ i ][ 0 ], yamlMap.レーンライン[ i ][ 1 ], yamlMap.レーンライン[ i ][ 2 ], yamlMap.レーンライン[ i ][ 3 ] ); + } + kvp.Value.レーン色 = new Color4( Convert.ToUInt32( yamlMap.レーン色, 16 ) ); + kvp.Value.レーンライン色 = new Color4( Convert.ToUInt32( yamlMap.レーンライン色, 16 ) ); + + Log.Info( $"{設定ファイルパス.変数付きパス} ... 完了" ); + } + catch( Exception e ) + { + Log.Info( $"{設定ファイルパス.変数付きパス} ... 失敗 [{Folder.絶対パスをフォルダ変数付き絶対パスに変換して返す( e.Message )}]" ); } - kvp.Value.レーンライン = new List(); - - foreach( var rcline in 設定[ "レーンライン" ] ) - kvp.Value.レーンライン.Add( FDKUtilities.JsonToRectangleF( rcline ) ); - - kvp.Value.レーン色 = new Color4( Convert.ToUInt32( (string) 設定[ "レーン色" ], 16 ) ); - kvp.Value.レーンライン色 = new Color4( Convert.ToUInt32( (string) 設定[ "レーンライン色" ], 16 ) ); - - Log.Info( $"{new VariablePath( 設定ファイルパス ).変数付きパス} ... 完了" ); } レーン配置を設定する( "TypeA" ); } } + public static void レーン配置を設定する( string レーン配置名 ) { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -126,20 +133,27 @@ public static void レーン配置を設定する( string レーン配置名 ) } } - public void 描画する( DeviceContext1 dc ) + public void 描画する( DeviceContext1 dc, int BGAの透明度 ) { グラフィックデバイス.Instance.D2DBatchDraw( dc, () => { // レーンエリアを描画する。 - using( var laneBrush = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, 現在のレーン配置.レーン色 ) ) + + var レーン色 = 現在のレーン配置.レーン色; + レーン色.Alpha *= ( 100 - BGAの透明度 ) / 100.0f; // BGAの透明度0→100 のとき Alpha×1→×0 + using( var laneBrush = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, レーン色 ) ) { dc.FillRectangle( レーンフレーム.領域, laneBrush ); } + // レーンラインを描画する。 - using( var laneLineBrush = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, 現在のレーン配置.レーンライン色 ) ) + + var レーンライン色 = 現在のレーン配置.レーンライン色; + レーンライン色.Alpha *= ( 100 - BGAの透明度 ) / 100.0f; // BGAの透明度0→100 のとき Alpha×1→×0 + using( var laneLineBrush = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, レーンライン色 ) ) { - for( int i = 0; i < 現在のレーン配置.レーンライン.Count; i++ ) + for( int i = 0; i < 現在のレーン配置.レーンライン.Length; i++ ) { var rc = 現在のレーン配置.レーンライン[ i ]; rc.Left += レーンフレーム.領域.Left; @@ -150,5 +164,15 @@ public void 描画する( DeviceContext1 dc ) } ); } + + + private class YAMLマップ + { + public Dictionary<表示レーン種別, float> 左端位置 { get; set; } + public Dictionary<表示レーン種別, float> 幅 { get; set; } + public float[][] レーンライン { get; set; } + public string レーン色 { get; set; } + public string レーンライン色 { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\350\241\250\347\244\272.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\350\241\250\347\244\272.cs" index f197404..1449ac0 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\350\241\250\347\244\272.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\350\241\250\347\244\272.cs" @@ -5,7 +5,6 @@ using System.Linq; using SharpDX; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -16,8 +15,8 @@ public 判定パラメータ表示() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._パラメータ文字 = new 画像フォント( @"$(System)images\パラメータ文字_小.png", @"$(System)images\パラメータ文字_小.json" ) ); - this.子を追加する( this._判定種別文字 = new 画像( @"$(System)images\演奏\パラメータ用判定種別文字.png" ) ); + this.子Activityを追加する( this._パラメータ文字 = new 画像フォント( @"$(System)images\パラメータ文字_小.png", @"$(System)images\パラメータ文字_小.yaml" ) ); + this.子Activityを追加する( this._判定種別文字 = new 画像( @"$(System)images\演奏\パラメータ用判定種別文字.png" ) ); } } @@ -25,7 +24,18 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this._判定種別文字設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\パラメータ用判定種別文字.json" ).変数なしパス ) ); + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\パラメータ用判定種別文字.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._判定種別文字の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._判定種別文字の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } } } protected override void On非活性化() @@ -90,7 +100,7 @@ public virtual void 描画する( DeviceContext1 dc, float x, float y, 成績 y += 3f; // ちょっと間を開けて - var 矩形 = FDKUtilities.JsonToRectangleF( this._判定種別文字設定[ "矩形リスト" ][ "MaxCombo" ] ); + var 矩形 = this._判定種別文字の矩形リスト[ "MaxCombo" ]; dc.Transform = scaling * Matrix3x2.Translation( x, y ) * @@ -112,7 +122,7 @@ public virtual void 描画する( DeviceContext1 dc, float x, float y, 成績 public void パラメータを一行描画する( DeviceContext1 dc, float x, float y, 判定種別 judge, int ヒット数, int ヒット割合, float 不透明度 = 1.0f ) { - var 矩形 = FDKUtilities.JsonToRectangleF( this._判定種別文字設定[ "矩形リスト" ][ judge.ToString() ] ); + var 矩形 = this._判定種別文字の矩形リスト[ judge.ToString() ]; this._判定種別文字.描画する( dc, x, y - 4f, 不透明度, 転送元矩形: 矩形 ); x += 矩形.Width + 16f; @@ -128,7 +138,7 @@ public void パラメータを一行描画する( DeviceContext1 dc, float x, fl protected const float _改行幅dpx = 40f; protected 画像フォント _パラメータ文字 = null; protected 画像 _判定種別文字 = null; - protected JObject _判定種別文字設定 = null; + protected Dictionary _判定種別文字の矩形リスト = null; protected void 数値を描画する( DeviceContext1 dc, float x, float y, int 描画する数値, int 桁数, float 不透明度 = 1.0f ) @@ -142,5 +152,11 @@ protected void 数値を描画する( DeviceContext1 dc, float x, float y, int this._パラメータ文字.不透明度 = 不透明度; this._パラメータ文字.描画する( dc, x, y, 判定数文字列 ); } + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.cs" index aa17c3b..22f24aa 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\346\226\207\345\255\227\345\210\227.cs" @@ -6,7 +6,6 @@ using SharpDX; using SharpDX.Animation; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.ステージ.演奏 @@ -17,7 +16,7 @@ public 判定文字列() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._判定文字列画像 = new 画像( @"$(System)images\演奏\判定文字列.png" ) ); + this.子Activityを追加する( this._判定文字列画像 = new 画像( @"$(System)images\演奏\判定文字列.png" ) ); } } @@ -25,7 +24,18 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this._判定文字列画像設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\判定文字列.json" ).変数なしパス ) ); + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\判定文字列.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._判定文字列の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._判定文字列の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } this._レーンtoステータス = new Dictionary<表示レーン種別, 表示レーンステータス>() { { 表示レーン種別.Unknown, new 表示レーンステータス( 表示レーン種別.Unknown ) }, @@ -249,7 +259,7 @@ public void 進行描画する( DeviceContext1 dc ) //---------------- if( null != status.光のストーリーボード ) { - var 転送元矩形 = FDKUtilities.JsonToRectangleF( this._判定文字列画像設定[ "矩形リスト" ][ "PERFECT光" ] ); + var 転送元矩形 = this._判定文字列の矩形リスト[ "PERFECT光" ]; var 転送元矩形の中心dpx = new Vector2( 転送元矩形.Width / 2f, 転送元矩形.Height / 2f ); var 変換行列2D = @@ -273,7 +283,7 @@ public void 進行描画する( DeviceContext1 dc ) //---------------- if( null != status.文字列影のストーリーボード ) { - var 転送元矩形 = FDKUtilities.JsonToRectangleF( this._判定文字列画像設定[ "矩形リスト" ][ status.判定種別.ToString() ] ); + var 転送元矩形 = this._判定文字列の矩形リスト[ status.判定種別.ToString() ]; var 変換行列2D = Matrix3x2.Translation( @@ -293,7 +303,7 @@ public void 進行描画する( DeviceContext1 dc ) //---------------- if( null != status.文字列本体のストーリーボード ) { - var 転送元矩形 = FDKUtilities.JsonToRectangleF( this._判定文字列画像設定[ "矩形リスト" ][ status.判定種別.ToString() ] ); + var 転送元矩形 = this._判定文字列の矩形リスト[ status.判定種別.ToString() ]; var sx = (float) status.文字列本体のX方向拡大率.Value; var sy = (float) status.文字列本体のY方向拡大率.Value; @@ -334,7 +344,7 @@ public void 進行描画する( DeviceContext1 dc ) private 画像 _判定文字列画像 = null; - private JObject _判定文字列画像設定 = null; + private Dictionary _判定文字列の矩形リスト = null; /// /// 以下の画像のアニメ&表示管理を行うクラス。 @@ -468,5 +478,11 @@ public void アニメ用メンバを解放する() } private Dictionary<表示レーン種別, 表示レーンステータス> _レーンtoステータス = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\347\250\256\345\210\245.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\347\250\256\345\210\245.cs" index 3dd4fd6..1f2c934 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\347\250\256\345\210\245.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\210\244\345\256\232\347\250\256\345\210\245.cs" @@ -5,7 +5,7 @@ namespace DTXMania.ステージ.演奏 { - public enum 判定種別 + enum 判定種別 { PERFECT, GREAT, diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\217\263\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\217\263\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" index 9d4817a..527841e 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\217\263\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\217\263\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" @@ -17,8 +17,8 @@ public 右サイドクリアパネル() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景 = new 画像( @"$(System)images\演奏\右サイドクリアパネル.png" ) ); - this.子を追加する( this.クリアパネル = new 描画可能テクスチャ( new Size2F( 500, 990 ) ) ); // this._背景.サイズはまだ設定されていない。 + this.子Activityを追加する( this._背景 = new 画像( @"$(System)images\演奏\右サイドクリアパネル.png" ) ); + this.子Activityを追加する( this.クリアパネル = new 描画可能テクスチャ( new Size2F( 500, 990 ) ) ); // this._背景.サイズはまだ設定されていない。 } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\267\246\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\267\246\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" index 571729a..f6c6fda 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\267\246\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\345\267\246\343\202\265\343\202\244\343\203\211\343\202\257\343\203\252\343\202\242\343\203\221\343\203\215\343\203\253.cs" @@ -17,8 +17,8 @@ public 左サイドクリアパネル() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景 = new 画像( @"$(System)images\演奏\左サイドクリアパネル.png" ) ); - this.子を追加する( this.クリアパネル = new 描画可能テクスチャ( new Size2F( 388, 990 ) ) ); // this._背景.サイズはまだ設定されていない。 + this.子Activityを追加する( this._背景 = new 画像( @"$(System)images\演奏\左サイドクリアパネル.png" ) ); + this.子Activityを追加する( this.クリアパネル = new 描画可能テクスチャ( new Size2F( 388, 990 ) ) ); // this._背景.サイズはまだ設定されていない。 } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\210\245SKILL.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\210\245SKILL.cs" index 9809960..33a40b3 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\210\245SKILL.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\210\245SKILL.cs" @@ -14,8 +14,8 @@ public 曲別SKILL() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大太斜.png", @"$(System)images\パラメータ文字_大太斜.json", 文字幅補正dpx: -6f ) ); - this.子を追加する( this._ロゴ画像 = new 画像( @"$(System)images\曲別SKILLアイコン.png" ) ); + this.子Activityを追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大太斜.png", @"$(System)images\パラメータ文字_大太斜.yaml", 文字幅補正dpx: -6f ) ); + this.子Activityを追加する( this._ロゴ画像 = new 画像( @"$(System)images\曲別SKILLアイコン.png" ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\220\215\343\203\221\343\203\215\343\203\253.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\220\215\343\203\221\343\203\215\343\203\253.cs" index c58e58b..279fb72 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\220\215\343\203\221\343\203\215\343\203\253.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\233\262\345\220\215\343\203\221\343\203\215\343\203\253.cs" @@ -16,8 +16,8 @@ public 曲名パネル() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._パネル = new 画像( @"$(System)images\演奏\曲名パネル.png" ) ); - this.子を追加する( this._曲名画像 = new 文字列画像() { + this.子Activityを追加する( this._パネル = new 画像( @"$(System)images\演奏\曲名パネル.png" ) ); + this.子Activityを追加する( this._曲名画像 = new 文字列画像() { フォント名 = "HGMaruGothicMPRO", フォントサイズpt = 26f, フォント幅 = FontWeight.Regular, @@ -27,7 +27,7 @@ public 曲名パネル() 前景色 = Color4.Black, 背景色 = Color4.White, } ); - this.子を追加する( this._サブタイトル画像 = new 文字列画像() { + this.子Activityを追加する( this._サブタイトル画像 = new 文字列画像() { フォント名 = "HGMaruGothicMPRO", フォントサイズpt = 18f, フォント幅 = FontWeight.Regular, diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270.cs" index 4df5b8c..b57e522 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -6,8 +6,6 @@ using SharpDX; using SharpDX.Direct2D1; using SharpDX.DirectInput; -using CSCore; -using Newtonsoft.Json.Linq; using FDK; using SSTFormat.v4; using DTXMania.設定; @@ -45,31 +43,31 @@ public 演奏ステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景画像 = new 画像( @"$(System)images\演奏\演奏画面.png" ) ); - this.子を追加する( this._レーンフレーム = new レーンフレーム() ); - this.子を追加する( this._曲名パネル = new 曲名パネル() ); - this.子を追加する( this._ドラムパッド = new ドラムパッド() ); - this.子を追加する( this._ヒットバー = new ヒットバー() ); - this.子を追加する( this._レーンフラッシュ = new レーンフラッシュ() ); - this.子を追加する( this._ドラムチップ画像 = new 画像( @"$(System)images\演奏\ドラムチップ.png" ) ); - this.子を追加する( this._判定文字列 = new 判定文字列() ); - this.子を追加する( this._チップ光 = new チップ光() ); - this.子を追加する( this._左サイドクリアパネル = new 左サイドクリアパネル() ); - this.子を追加する( this._右サイドクリアパネル = new 右サイドクリアパネル() ); - this.子を追加する( this._判定パラメータ表示 = new 判定パラメータ表示() ); - this.子を追加する( this._フェーズパネル = new フェーズパネル() ); - this.子を追加する( this._コンボ表示 = new コンボ表示() ); - this.子を追加する( this._カウントマップライン = new カウントマップライン() ); - this.子を追加する( this._スコア表示 = new スコア表示() ); - this.子を追加する( this._プレイヤー名表示 = new プレイヤー名表示() ); - this.子を追加する( this._譜面スクロール速度 = new 譜面スクロール速度() ); - this.子を追加する( this._達成率表示 = new 達成率表示() ); - this.子を追加する( this._曲別SKILL = new 曲別SKILL() ); - this.子を追加する( this._エキサイトゲージ = new エキサイトゲージ() ); - this.子を追加する( this._FPS = new FPS() ); - this.子を追加する( this._数字フォント中グレー48x64 = new 画像フォント( + this.子Activityを追加する( this._背景画像 = new 画像( @"$(System)images\演奏\演奏画面.png" ) ); + this.子Activityを追加する( this._レーンフレーム = new レーンフレーム() ); + this.子Activityを追加する( this._曲名パネル = new 曲名パネル() ); + this.子Activityを追加する( this._ドラムパッド = new ドラムパッド() ); + this.子Activityを追加する( this._ヒットバー = new ヒットバー() ); + this.子Activityを追加する( this._レーンフラッシュ = new レーンフラッシュ() ); + this.子Activityを追加する( this._ドラムチップ画像 = new 画像( @"$(System)images\演奏\ドラムチップ.png" ) ); + this.子Activityを追加する( this._判定文字列 = new 判定文字列() ); + this.子Activityを追加する( this._チップ光 = new チップ光() ); + this.子Activityを追加する( this._左サイドクリアパネル = new 左サイドクリアパネル() ); + this.子Activityを追加する( this._右サイドクリアパネル = new 右サイドクリアパネル() ); + this.子Activityを追加する( this._判定パラメータ表示 = new 判定パラメータ表示() ); + this.子Activityを追加する( this._フェーズパネル = new フェーズパネル() ); + this.子Activityを追加する( this._コンボ表示 = new コンボ表示() ); + this.子Activityを追加する( this._カウントマップライン = new カウントマップライン() ); + this.子Activityを追加する( this._スコア表示 = new スコア表示() ); + this.子Activityを追加する( this._プレイヤー名表示 = new プレイヤー名表示() ); + this.子Activityを追加する( this._譜面スクロール速度 = new 譜面スクロール速度() ); + this.子Activityを追加する( this._達成率表示 = new 達成率表示() ); + this.子Activityを追加する( this._曲別SKILL = new 曲別SKILL() ); + this.子Activityを追加する( this._エキサイトゲージ = new エキサイトゲージ() ); + this.子Activityを追加する( this._FPS = new FPS() ); + this.子Activityを追加する( this._数字フォント中グレー48x64 = new 画像フォント( @"$(System)images\数字フォント中ホワイト48x64.png", - @"$(System)images\数字フォント中48x64矩形リスト.json", + @"$(System)images\数字フォント中48x64矩形リスト.yaml", 文字幅補正dpx: -16f, 不透明度: 0.3f ) ); } @@ -79,9 +77,24 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + { + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\ドラムチップ.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._ドラムチップの縦方向中央位置 = yamlMap.縦方向中央位置; + this._ドラムチップの矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._ドラムチップの矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } + } + this._小節線色 = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, Color.White ); this._拍線色 = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, Color.LightGray ); - this._ドラムチップ画像設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\ドラムチップ.json" ).変数なしパス ) ); this._ドラムチップアニメ = new LoopCounter( 0, 200, 3 ); this._プレイヤー名表示.名前 = App.ユーザ管理.ログオン中のユーザ.ユーザ名; レーンフレーム.レーン配置を設定する( App.ユーザ管理.ログオン中のユーザ.レーン配置 ); @@ -568,7 +581,7 @@ public override void 進行描画する( DeviceContext1 dc ) this._右サイドクリアパネル.クリアする(); this._右サイドクリアパネル.描画する( dc ); - this._レーンフレーム.描画する( dc ); + this._レーンフレーム.描画する( dc, App.ユーザ管理.ログオン中のユーザ.レーンの透明度 ); this._ドラムパッド.進行描画する( dc ); this._背景画像.描画する( dc, 0f, 0f ); this._譜面スクロール速度.描画する( dc, App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 ); @@ -647,9 +660,9 @@ public override void 進行描画する( DeviceContext1 dc ) } ); this._右サイドクリアパネル.描画する( dc ); + this._レーンフレーム.描画する( dc, App.ユーザ管理.ログオン中のユーザ.レーンの透明度 ); this._レーンフラッシュ.進行描画する( dc ); this._小節線拍線を描画する( dc, 演奏時刻sec ); - this._レーンフレーム.描画する( dc ); this._ドラムパッド.進行描画する( dc ); this._背景画像.描画する( dc, 0f, 0f ); this._譜面スクロール速度.描画する( dc, App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 ); @@ -771,11 +784,12 @@ private void _小節線拍線を描画する( DeviceContext1 dc, double 現在 } private 画像 _ドラムチップ画像 = null; - private JObject _ドラムチップ画像設定 = null; + private Dictionary _ドラムチップの矩形リスト = null; + private float _ドラムチップの縦方向中央位置 = 0f; private LoopCounter _ドラムチップアニメ = null; private void _チップを描画する( DeviceContext1 dc, double 現在の演奏時刻sec ) { - Debug.Assert( null != this._ドラムチップ画像設定 ); + Debug.Assert( null != this._ドラムチップの矩形リスト ); this._描画範囲内のすべてのチップに対して( 現在の演奏時刻sec, ( chip, index, ヒット判定バーと描画との時間sec, ヒット判定バーと発声との時間sec, ヒット判定バーとの距離dpx ) => { @@ -833,14 +847,14 @@ private void _チップを描画する( DeviceContext1 dc, double 現在の演 if( ( 表示レーン種別 != 表示レーン種別.Unknown ) && // Unknwon ならチップを表示しない。 ( 表示チップ種別 != 表示チップ種別.Unknown ) ) // { - var たて方向中央位置dpx = (float) ( this._ドラムチップ画像設定[ "縦方向中央位置" ] ); + var たて方向中央位置dpx = this._ドラムチップの縦方向中央位置; var 左端位置dpx = レーンフレーム.領域.Left + レーンフレーム.現在のレーン配置.表示レーンの左端位置dpx[ 表示レーン種別 ]; var 中央位置Xdpx = 左端位置dpx + レーンフレーム.現在のレーン配置.表示レーンの幅dpx[ 表示レーン種別 ] / 2f; #region " チップ背景(あれば)を描画する。" //---------------- { - var 矩形 = FDKUtilities.JsonToRectangleF( this._ドラムチップ画像設定[ "矩形リスト" ][ 表示チップ種別.ToString() + "_back" ] ); + var 矩形 = this._ドラムチップの矩形リスト[ 表示チップ種別.ToString() + "_back" ]; if( ( null != 矩形 ) && ( ( 0 < 矩形.Width && 0 < 矩形.Height ) ) ) { @@ -924,7 +938,7 @@ private void _チップを描画する( DeviceContext1 dc, double 現在の演 #region " チップ本体を描画する。" //---------------- { - var 矩形 = FDKUtilities.JsonToRectangleF( this._ドラムチップ画像設定[ "矩形リスト" ][ 表示チップ種別.ToString() ] ); + var 矩形 = this._ドラムチップの矩形リスト[ 表示チップ種別.ToString() ]; if( ( null != 矩形 ) && ( ( 0 < 矩形.Width && 0 < 矩形.Height ) ) ) { @@ -1168,5 +1182,12 @@ private void _キャプチャ画面を描画する( DeviceContext1 dc, float 不 private bool _初めての進行描画 = true; + + + private class YAMLマップ_ドラムチップ + { + public Dictionary 矩形リスト { get; set; } + public float 縦方向中央位置 { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270_\343\203\223\343\203\245\343\202\242\343\203\274\343\203\242\343\203\274\343\203\211.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270_\343\203\223\343\203\245\343\202\242\343\203\274\343\203\242\343\203\274\343\203\211.cs" index 41b1da8..18bf896 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270_\343\203\223\343\203\245\343\202\242\343\203\274\343\203\242\343\203\274\343\203\211.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\346\274\224\345\245\217\343\202\271\343\203\206\343\203\274\343\202\270_\343\203\223\343\203\245\343\202\242\343\203\274\343\203\242\343\203\274\343\203\211.cs" @@ -6,8 +6,6 @@ using SharpDX; using SharpDX.Direct2D1; using SharpDX.DirectInput; -using CSCore; -using Newtonsoft.Json.Linq; using FDK; using SSTFormat.v4; using DTXMania.設定; @@ -38,31 +36,31 @@ public 演奏ステージ_ビュアーモード() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景画像 = new 画像( @"$(System)images\演奏\演奏画面.png" ) ); - this.子を追加する( this._レーンフレーム = new レーンフレーム() ); - this.子を追加する( this._曲名パネル = new 曲名パネル() ); - this.子を追加する( this._ドラムパッド = new ドラムパッド() ); - this.子を追加する( this._ヒットバー = new ヒットバー() ); - this.子を追加する( this._レーンフラッシュ = new レーンフラッシュ() ); - this.子を追加する( this._ドラムチップ画像 = new 画像( @"$(System)images\演奏\ドラムチップ.png" ) ); - this.子を追加する( this._判定文字列 = new 判定文字列() ); - this.子を追加する( this._チップ光 = new チップ光() ); - this.子を追加する( this._左サイドクリアパネル = new 左サイドクリアパネル() ); - this.子を追加する( this._右サイドクリアパネル = new 右サイドクリアパネル() ); - this.子を追加する( this._判定パラメータ表示 = new 判定パラメータ表示() ); - this.子を追加する( this._フェーズパネル = new フェーズパネル() ); - this.子を追加する( this._コンボ表示 = new コンボ表示() ); - this.子を追加する( this._カウントマップライン = new カウントマップライン() ); - this.子を追加する( this._スコア表示 = new スコア表示() ); - this.子を追加する( this._プレイヤー名表示 = new プレイヤー名表示() ); - this.子を追加する( this._譜面スクロール速度 = new 譜面スクロール速度() ); - this.子を追加する( this._達成率表示 = new 達成率表示() ); - this.子を追加する( this._曲別SKILL = new 曲別SKILL() ); - this.子を追加する( this._エキサイトゲージ = new エキサイトゲージ() ); - this.子を追加する( this._FPS = new FPS() ); - this.子を追加する( this._数字フォント中グレー48x64 = new 画像フォント( + this.子Activityを追加する( this._背景画像 = new 画像( @"$(System)images\演奏\演奏画面.png" ) ); + this.子Activityを追加する( this._レーンフレーム = new レーンフレーム() ); + this.子Activityを追加する( this._曲名パネル = new 曲名パネル() ); + this.子Activityを追加する( this._ドラムパッド = new ドラムパッド() ); + this.子Activityを追加する( this._ヒットバー = new ヒットバー() ); + this.子Activityを追加する( this._レーンフラッシュ = new レーンフラッシュ() ); + this.子Activityを追加する( this._ドラムチップ画像 = new 画像( @"$(System)images\演奏\ドラムチップ.png" ) ); + this.子Activityを追加する( this._判定文字列 = new 判定文字列() ); + this.子Activityを追加する( this._チップ光 = new チップ光() ); + this.子Activityを追加する( this._左サイドクリアパネル = new 左サイドクリアパネル() ); + this.子Activityを追加する( this._右サイドクリアパネル = new 右サイドクリアパネル() ); + this.子Activityを追加する( this._判定パラメータ表示 = new 判定パラメータ表示() ); + this.子Activityを追加する( this._フェーズパネル = new フェーズパネル() ); + this.子Activityを追加する( this._コンボ表示 = new コンボ表示() ); + this.子Activityを追加する( this._カウントマップライン = new カウントマップライン() ); + this.子Activityを追加する( this._スコア表示 = new スコア表示() ); + this.子Activityを追加する( this._プレイヤー名表示 = new プレイヤー名表示() ); + this.子Activityを追加する( this._譜面スクロール速度 = new 譜面スクロール速度() ); + this.子Activityを追加する( this._達成率表示 = new 達成率表示() ); + this.子Activityを追加する( this._曲別SKILL = new 曲別SKILL() ); + this.子Activityを追加する( this._エキサイトゲージ = new エキサイトゲージ() ); + this.子Activityを追加する( this._FPS = new FPS() ); + this.子Activityを追加する( this._数字フォント中グレー48x64 = new 画像フォント( @"$(System)images\数字フォント中ホワイト48x64.png", - @"$(System)images\数字フォント中48x64矩形リスト.json", + @"$(System)images\数字フォント中48x64矩形リスト.yaml", 文字幅補正dpx: -16f, 不透明度: 0.3f ) ); } @@ -72,9 +70,24 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + { + var 設定ファイルパス = new VariablePath( @"$(System)images\演奏\ドラムチップ.yaml" ); + + var yaml = File.ReadAllText( 設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._ドラムチップの縦方向中央位置 = yamlMap.縦方向中央位置; + this._ドラムチップの矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._ドラムチップの矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } + } + this._小節線色 = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, Color.White ); this._拍線色 = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, Color.LightGray ); - this._ドラムチップ画像設定 = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\演奏\ドラムチップ.json" ).変数なしパス ) ); this._ドラムチップアニメ = new LoopCounter( 0, 200, 3 ); this._プレイヤー名表示.名前 = App.ユーザ管理.ログオン中のユーザ.ユーザ名; レーンフレーム.レーン配置を設定する( App.ユーザ管理.ログオン中のユーザ.レーン配置 ); @@ -587,9 +600,9 @@ public override void 進行描画する( DeviceContext1 dc ) } ); this._右サイドクリアパネル.描画する( dc ); + this._レーンフレーム.描画する( dc, App.ユーザ管理.ログオン中のユーザ.レーンの透明度 ); this._レーンフラッシュ.進行描画する( dc ); this._小節線拍線を描画する( dc, 演奏時刻sec ); - this._レーンフレーム.描画する( dc ); this._ドラムパッド.進行描画する( dc ); this._背景画像.描画する( dc, 0f, 0f ); this._譜面スクロール速度.描画する( dc, App.ユーザ管理.ログオン中のユーザ.譜面スクロール速度 ); @@ -735,12 +748,11 @@ private void _小節線拍線を描画する( DeviceContext1 dc, double 現在 } private 画像 _ドラムチップ画像 = null; - private JObject _ドラムチップ画像設定 = null; + private Dictionary _ドラムチップの矩形リスト = null; + private float _ドラムチップの縦方向中央位置 = 0f; private LoopCounter _ドラムチップアニメ = null; private void _チップを描画する( DeviceContext1 dc, double 現在の演奏時刻sec ) { - Debug.Assert( null != this._ドラムチップ画像設定 ); - this._描画範囲内のすべてのチップに対して( 現在の演奏時刻sec, ( chip, index, ヒット判定バーと描画との時間sec, ヒット判定バーと発声との時間sec, ヒット判定バーとの距離dpx ) => { float たて中央位置dpx = (float) ( ヒット判定位置Ydpx + ヒット判定バーとの距離dpx ); @@ -797,14 +809,14 @@ private void _チップを描画する( DeviceContext1 dc, double 現在の演 if( ( 表示レーン種別 != 表示レーン種別.Unknown ) && // Unknwon ならチップを表示しない。 ( 表示チップ種別 != 表示チップ種別.Unknown ) ) // { - var たて方向中央位置dpx = (float) ( this._ドラムチップ画像設定[ "縦方向中央位置" ] ); + var たて方向中央位置dpx = this._ドラムチップの縦方向中央位置; var 左端位置dpx = レーンフレーム.領域.Left + レーンフレーム.現在のレーン配置.表示レーンの左端位置dpx[ 表示レーン種別 ]; var 中央位置Xdpx = 左端位置dpx + レーンフレーム.現在のレーン配置.表示レーンの幅dpx[ 表示レーン種別 ] / 2f; #region " チップ背景(あれば)を描画する。" //---------------- { - var 矩形 = FDKUtilities.JsonToRectangleF( this._ドラムチップ画像設定[ "矩形リスト" ][ 表示チップ種別.ToString() + "_back" ] ); + var 矩形 = this._ドラムチップの矩形リスト[ 表示チップ種別.ToString() + "_back" ]; if( ( null != 矩形 ) && ( ( 0 < 矩形.Width && 0 < 矩形.Height ) ) ) { @@ -888,7 +900,7 @@ private void _チップを描画する( DeviceContext1 dc, double 現在の演 #region " チップ本体を描画する。" //---------------- { - var 矩形 = FDKUtilities.JsonToRectangleF( this._ドラムチップ画像設定[ "矩形リスト" ][ 表示チップ種別.ToString() ] ); + var 矩形 = this._ドラムチップの矩形リスト[ 表示チップ種別.ToString() ]; if( ( null != 矩形 ) && ( ( 0 < 矩形.Width && 0 < 矩形.Height ) ) ) { @@ -1203,5 +1215,12 @@ private void _ビュアー演奏を開始する( int 演奏開始小節番号 ) private bool _初めての進行描画 = true; private bool _ビュアーモード時にドラムサウンドを発声する = true; + + + private class YAMLマップ_ドラムチップ + { + public Dictionary 矩形リスト { get; set; } + public float 縦方向中央位置 { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\350\255\234\351\235\242\343\202\271\343\202\257\343\203\255\343\203\274\343\203\253\351\200\237\345\272\246.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\350\255\234\351\235\242\343\202\271\343\202\257\343\203\255\343\203\274\343\203\253\351\200\237\345\272\246.cs" index ba29594..302eee0 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\350\255\234\351\235\242\343\202\271\343\202\257\343\203\255\343\203\274\343\203\253\351\200\237\345\272\246.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\350\255\234\351\235\242\343\202\271\343\202\257\343\203\255\343\203\274\343\203\253\351\200\237\345\272\246.cs" @@ -35,7 +35,7 @@ public 譜面スクロール速度() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._文字画像 = new 画像フォント( @"$(System)images\パラメータ文字_小.png", @"$(System)images\パラメータ文字_小.json", 文字幅補正dpx: -3f ) ); + this.子Activityを追加する( this._文字画像 = new 画像フォント( @"$(System)images\パラメータ文字_小.png", @"$(System)images\パラメータ文字_小.yaml", 文字幅補正dpx: -3f ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\351\201\224\346\210\220\347\216\207\350\241\250\347\244\272.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\351\201\224\346\210\220\347\216\207\350\241\250\347\244\272.cs" index 8ce70cd..ff4868c 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\351\201\224\346\210\220\347\216\207\350\241\250\347\244\272.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/07\346\274\224\345\245\217/\351\201\224\346\210\220\347\216\207\350\241\250\347\244\272.cs" @@ -14,8 +14,8 @@ public 達成率表示() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大.png", @"$(System)images\パラメータ文字_大.json", 文字幅補正dpx: 0f ) ); - this.子を追加する( this._達成率ロゴ画像 = new 画像( @"$(System)images\達成率ロゴ.png" ) ); + this.子Activityを追加する( this._数字画像 = new 画像フォント( @"$(System)images\パラメータ文字_大.png", @"$(System)images\パラメータ文字_大.yaml", 文字幅補正dpx: 0f ) ); + this.子Activityを追加する( this._達成率ロゴ画像 = new 画像( @"$(System)images\達成率ロゴ.png" ) ); } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\346\274\224\345\245\217\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\265\220\346\236\234.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\346\274\224\345\245\217\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\265\220\346\236\234.cs" index fba308f..75de7e2 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\346\274\224\345\245\217\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\265\220\346\236\234.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\346\274\224\345\245\217\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\347\265\220\346\236\234.cs" @@ -25,6 +25,8 @@ protected override void On活性化() { base.On活性化(); + this._フルコンボ再生済み = false; + var animation = グラフィックデバイス.Instance.Animation; this._パラメータアニメ = new パラメータアニメ( animation.Manager ); @@ -74,6 +76,15 @@ protected override void On非活性化() public override void 描画する( DeviceContext1 dc, float x, float y, 成績 結果 ) { + // パラメータアニメが完了してからフルコンボチェック。 + if( this._パラメータアニメ.ストーリーボード.Status == StoryboardStatus.Ready && !(this._フルコンボ再生済み ) ) + { + if( 結果.MaxCombo == 結果.総ノーツ数 ) + App.システムサウンド.再生する( 設定.システムサウンド種別.フルコンボ ); + + this._フルコンボ再生済み = true; // 再生してようがしてまいが + } + グラフィックデバイス.Instance.D2DBatchDraw( dc, () => { var pretrans = dc.Transform; @@ -113,7 +124,7 @@ public override void 描画する( DeviceContext1 dc, float x, float y, 成績 y += _改行幅dpx; x = 基点X + (float) this._パラメータアニメ.X位置オフセット[ 5 ].Value; - var 矩形 = FDKUtilities.JsonToRectangleF( this._判定種別文字設定[ "矩形リスト" ][ "MaxCombo" ] ); + var 矩形 = this._判定種別文字の矩形リスト[ "MaxCombo" ]; this._判定種別文字.描画する( dc, x, y, 転送元矩形: 矩形, 不透明度0to1: (float) this._パラメータアニメ.不透明度[ 5 ].Value ); x += 矩形.Width + 16f; @@ -158,5 +169,8 @@ public void Dispose() private パラメータアニメ _パラメータアニメ = null; protected new const float _改行幅dpx = 27f; + + + private bool _フルコンボ再生済み = false; } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\347\265\220\346\236\234\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\347\265\220\346\236\234\343\202\271\343\203\206\343\203\274\343\202\270.cs" index 724de12..f738260 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\347\265\220\346\236\234\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/08\347\265\220\346\236\234/\347\265\220\346\236\234\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -37,9 +37,9 @@ public 結果ステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景 = new 舞台画像() ); - this.子を追加する( this._曲名パネル = new 画像( @"$(System)images\結果\曲名パネル.png" ) ); - this.子を追加する( this._曲名画像 = new 文字列画像() { + this.子Activityを追加する( this._背景 = new 舞台画像() ); + this.子Activityを追加する( this._曲名パネル = new 画像( @"$(System)images\結果\曲名パネル.png" ) ); + this.子Activityを追加する( this._曲名画像 = new 文字列画像() { フォント名 = "HGMaruGothicMPRO", フォントサイズpt = 40f, フォント幅 = FontWeight.Regular, @@ -49,7 +49,7 @@ public 結果ステージ() 前景色 = Color4.Black, 背景色 = Color4.White, } ); - this.子を追加する( this._サブタイトル画像 = new 文字列画像() { + this.子Activityを追加する( this._サブタイトル画像 = new 文字列画像() { フォント名 = "HGMaruGothicMPRO", フォントサイズpt = 25f, フォント幅 = FontWeight.Regular, @@ -59,7 +59,7 @@ public 結果ステージ() 前景色 = Color4.Black, 背景色 = Color4.White, } ); - this.子を追加する( this._演奏パラメータ結果 = new 演奏パラメータ結果() ); + this.子Activityを追加する( this._演奏パラメータ結果 = new 演奏パラメータ結果() ); } } @@ -72,6 +72,8 @@ protected override void On活性化() this._結果 = this.結果を取得する(); + App.システムサウンド.再生する( システムサウンド種別.ステージクリア ); + // 成績をDBに記録。 曲DB.成績を追加または更新する( this._結果, App.ユーザ管理.ログオン中のユーザ.ユーザID, 選択曲.曲ファイルハッシュ ); @@ -80,14 +82,18 @@ protected override void On活性化() this._黒マスクブラシ = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, new Color4( Color3.Black, 0.75f ) ); this._プレビュー枠ブラシ = new SolidColorBrush( グラフィックデバイス.Instance.D2DDeviceContext, new Color4( 0xFF209292 ) ); + this.現在のフェーズ = フェーズ.表示; this._初めての進行描画 = true; } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.システムサウンド.停止する( システムサウンド種別.ステージクリア ); + this._結果 = null; this._黒マスクブラシ?.Dispose(); @@ -133,6 +139,7 @@ public override void 進行描画する( DeviceContext1 dc ) case フェーズ.表示: if( App.入力管理.確定キーが入力された() ) { + App.システムサウンド.再生する( システムサウンド種別.取消音 ); // 確定だけど取消音 App.ステージ管理.アイキャッチを選択しクローズする( nameof( シャッター ) ); this.現在のフェーズ = フェーズ.フェードアウト; } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/09\347\265\202\344\272\206/\347\265\202\344\272\206\343\202\271\343\203\206\343\203\274\343\202\270.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/09\347\265\202\344\272\206/\347\265\202\344\272\206\343\202\271\343\203\206\343\203\274\343\202\270.cs" index 5dc6fc8..ed8c7b6 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/09\347\265\202\344\272\206/\347\265\202\344\272\206\343\202\271\343\203\206\343\203\274\343\202\270.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/09\347\265\202\344\272\206/\347\265\202\344\272\206\343\202\271\343\203\206\343\203\274\343\202\270.cs" @@ -13,6 +13,7 @@ public enum フェーズ { 開始, 表示中, + 開始音終了待ち, 確定, } public フェーズ 現在のフェーズ { get; protected set; } @@ -21,7 +22,7 @@ public 終了ステージ() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景画像 = new 画像( @"$(System)images\終了\終了画面.jpg" ) ); + this.子Activityを追加する( this._背景画像 = new 画像( @"$(System)images\終了\終了画面.jpg" ) ); } } @@ -29,6 +30,8 @@ protected override void On活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.システムサウンド.再生する( 設定.システムサウンド種別.終了ステージ_開始音 ); + this.現在のフェーズ = フェーズ.開始; } } @@ -36,6 +39,7 @@ protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { + App.システムサウンド.停止する( 設定.システムサウンド種別.終了ステージ_開始音 ); } } @@ -49,11 +53,20 @@ public override void 進行描画する( DeviceContext1 dc ) break; case フェーズ.表示中: - this._背景画像.描画する( dc ); + { + this._背景画像.描画する( dc ); + + if( this._カウンタ.終了値に達した ) + this.現在のフェーズ = フェーズ.開始音終了待ち; + } + break; - if( this._カウンタ.終了値に達した ) + case フェーズ.開始音終了待ち: { - this.現在のフェーズ = フェーズ.確定; + this._背景画像.描画する( dc ); + + if( !App.システムサウンド.再生中( 設定.システムサウンド種別.終了ステージ_開始音 ) ) + this.現在のフェーズ = フェーズ.確定; // 再生が終わったのでフェーズ遷移。 } break; diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\211\343\203\251\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\211\343\203\251\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211.cs" index 941fe56..f34efa1 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\211\343\203\251\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\211\343\203\251\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211.cs" @@ -55,86 +55,33 @@ public void 初期化する() this._チップtoコンテキスト = new Dictionary<(チップ種別 chipType, int サブチップID), ドラムサウンド情報>(); // SSTの既定のサウンドを、subChipId = 0 としてプリセット登録する。 - this.登録する( チップ種別.LeftCrash, 0, @"$(System)sounds\drums\LeftCrash.wav" ); - this.登録する( チップ種別.Ride, 0, @"$(System)sounds\drums\Ride.wav" ); - this.登録する( チップ種別.Ride_Cup, 0, @"$(System)sounds\drums\RideCup.wav" ); - this.登録する( チップ種別.China, 0, @"$(System)sounds\drums\China.wav" ); - this.登録する( チップ種別.Splash, 0, @"$(System)sounds\drums\Splash.wav" ); - this.登録する( チップ種別.HiHat_Open, 0, @"$(System)sounds\drums\HiHatOpen.wav" ); - this.登録する( チップ種別.HiHat_HalfOpen, 0, @"$(System)sounds\drums\HiHatHalfOpen.wav" ); - this.登録する( チップ種別.HiHat_Close, 0, @"$(System)sounds\drums\HiHatClose.wav" ); - this.登録する( チップ種別.HiHat_Foot, 0, @"$(System)sounds\drums\HiHatFoot.wav" ); - this.登録する( チップ種別.Snare, 0, @"$(System)sounds\drums\Snare.wav" ); - this.登録する( チップ種別.Snare_OpenRim, 0, @"$(System)sounds\drums\SnareOpenRim.wav" ); - this.登録する( チップ種別.Snare_ClosedRim, 0, @"$(System)sounds\drums\SnareClosedRim.wav" ); - this.登録する( チップ種別.Snare_Ghost, 0, @"$(System)sounds\drums\SnareGhost.wav" ); - this.登録する( チップ種別.Bass, 0, @"$(System)sounds\drums\Bass.wav" ); - this.登録する( チップ種別.Tom1, 0, @"$(System)sounds\drums\Tom1.wav" ); - this.登録する( チップ種別.Tom1_Rim, 0, @"$(System)sounds\drums\Tom1Rim.wav" ); - this.登録する( チップ種別.Tom2, 0, @"$(System)sounds\drums\Tom2.wav" ); - this.登録する( チップ種別.Tom2_Rim, 0, @"$(System)sounds\drums\Tom2Rim.wav" ); - this.登録する( チップ種別.Tom3, 0, @"$(System)sounds\drums\Tom3.wav" ); - this.登録する( チップ種別.Tom3_Rim, 0, @"$(System)sounds\drums\Tom3Rim.wav" ); - this.登録する( チップ種別.RightCrash, 0, @"$(System)sounds\drums\RightCrash.wav" ); - this.登録する( チップ種別.LeftCymbal_Mute, 0, @"$(System)sounds\drums\LeftCymbalMute.wav" ); - this.登録する( チップ種別.RightCymbal_Mute, 0, @"$(System)sounds\drums\RightCymbalMute.wav" ); + this._登録する( チップ種別.LeftCrash, 0, @"$(System)sounds\drums\LeftCrash.wav" ); + this._登録する( チップ種別.Ride, 0, @"$(System)sounds\drums\Ride.wav" ); + this._登録する( チップ種別.Ride_Cup, 0, @"$(System)sounds\drums\RideCup.wav" ); + this._登録する( チップ種別.China, 0, @"$(System)sounds\drums\China.wav" ); + this._登録する( チップ種別.Splash, 0, @"$(System)sounds\drums\Splash.wav" ); + this._登録する( チップ種別.HiHat_Open, 0, @"$(System)sounds\drums\HiHatOpen.wav" ); + this._登録する( チップ種別.HiHat_HalfOpen, 0, @"$(System)sounds\drums\HiHatHalfOpen.wav" ); + this._登録する( チップ種別.HiHat_Close, 0, @"$(System)sounds\drums\HiHatClose.wav" ); + this._登録する( チップ種別.HiHat_Foot, 0, @"$(System)sounds\drums\HiHatFoot.wav" ); + this._登録する( チップ種別.Snare, 0, @"$(System)sounds\drums\Snare.wav" ); + this._登録する( チップ種別.Snare_OpenRim, 0, @"$(System)sounds\drums\SnareOpenRim.wav" ); + this._登録する( チップ種別.Snare_ClosedRim, 0, @"$(System)sounds\drums\SnareClosedRim.wav" ); + this._登録する( チップ種別.Snare_Ghost, 0, @"$(System)sounds\drums\SnareGhost.wav" ); + this._登録する( チップ種別.Bass, 0, @"$(System)sounds\drums\Bass.wav" ); + this._登録する( チップ種別.Tom1, 0, @"$(System)sounds\drums\Tom1.wav" ); + this._登録する( チップ種別.Tom1_Rim, 0, @"$(System)sounds\drums\Tom1Rim.wav" ); + this._登録する( チップ種別.Tom2, 0, @"$(System)sounds\drums\Tom2.wav" ); + this._登録する( チップ種別.Tom2_Rim, 0, @"$(System)sounds\drums\Tom2Rim.wav" ); + this._登録する( チップ種別.Tom3, 0, @"$(System)sounds\drums\Tom3.wav" ); + this._登録する( チップ種別.Tom3_Rim, 0, @"$(System)sounds\drums\Tom3Rim.wav" ); + this._登録する( チップ種別.RightCrash, 0, @"$(System)sounds\drums\RightCrash.wav" ); + this._登録する( チップ種別.LeftCymbal_Mute, 0, @"$(System)sounds\drums\LeftCymbalMute.wav" ); + this._登録する( チップ種別.RightCymbal_Mute, 0, @"$(System)sounds\drums\RightCymbalMute.wav" ); } } } - /// - /// チップ種別とサブチップIDの組に対応するドラムサウンドファイルを登録する。 - /// - /// 登録するチップ種別。 - /// 登録するサブチップID。 - /// 割り当てるドラムサウンドファイルのパス。 - public void 登録する( チップ種別 chipType, int subChipId, VariablePath サウンドファイルパス ) - { - if( !( File.Exists( サウンドファイルパス.変数なしパス ) ) ) - { - Log.ERROR( $"サウンドファイルが存在しません。[{サウンドファイルパス.変数付きパス}]" ); - return; - } - - lock( this._Sound利用権 ) - { - // コンテキストを作成する。 - - var context = new ドラムサウンド情報( this._多重度 ); - - - // サウンドファイルを読み込んでデコードする。 - - context.SampleSource = SampleSourceFactory.Create( App.サウンドデバイス, サウンドファイルパス ); - - if( null == context.SampleSource ) - { - Log.ERROR( $"サウンドの生成に失敗しました。[{サウンドファイルパス.変数付きパス}]" ); - context.Dispose(); - return; - } - - // 多重度分のサウンドを生成する。 - - for( int i = 0; i < context.Sounds.Length; i++ ) - context.Sounds[ i ] = new Sound( App.サウンドデバイス, context.SampleSource ); - - - // コンテキストを辞書に追加する。 - - if( this._チップtoコンテキスト.ContainsKey( (chipType, subChipId) ) ) - { - // すでに辞書に存在してるなら、解放してから削除する。 - this._チップtoコンテキスト[ (chipType, subChipId) ]?.Dispose(); - this._チップtoコンテキスト.Remove( (chipType, subChipId) ); - } - - this._チップtoコンテキスト.Add( (chipType, subChipId), context ); - - Log.Info( $"ドラムサウンドを生成しました。[({chipType.ToString()},{subChipId}) = {サウンドファイルパス.変数付きパス}]" ); - } - } - /// /// 指定したチップ種別・サブチップIDの組に対応するドラムサウンドを再生する。 /// @@ -224,5 +171,53 @@ public void 発声する( 消音グループ種別 消音グループ種別, flo private Dictionary<(チップ種別 chipType, int サブチップID), ドラムサウンド情報> _チップtoコンテキスト = null; private readonly object _Sound利用権 = new object(); + + + private void _登録する( チップ種別 chipType, int subChipId, VariablePath サウンドファイルパス ) + { + if( !( File.Exists( サウンドファイルパス.変数なしパス ) ) ) + { + Log.ERROR( $"サウンドファイルが存在しません。[{サウンドファイルパス.変数付きパス}]" ); + return; + } + + lock( this._Sound利用権 ) + { + // コンテキストを作成する。 + + var context = new ドラムサウンド情報( this._多重度 ); + + + // サウンドファイルを読み込んでデコードする。 + + context.SampleSource = SampleSourceFactory.Create( App.サウンドデバイス, サウンドファイルパス ); + + if( null == context.SampleSource ) + { + Log.ERROR( $"サウンドの生成に失敗しました。[{サウンドファイルパス.変数付きパス}]" ); + context.Dispose(); + return; + } + + // 多重度分のサウンドを生成する。 + + for( int i = 0; i < context.Sounds.Length; i++ ) + context.Sounds[ i ] = new Sound( App.サウンドデバイス, context.SampleSource ); + + + // コンテキストを辞書に追加する。 + + if( this._チップtoコンテキスト.ContainsKey( (chipType, subChipId) ) ) + { + // すでに辞書に存在してるなら、解放してから削除する。 + this._チップtoコンテキスト[ (chipType, subChipId) ]?.Dispose(); + this._チップtoコンテキスト.Remove( (chipType, subChipId) ); + } + + this._チップtoコンテキスト.Add( (chipType, subChipId), context ); + + Log.Info( $"ドラムサウンドを生成しました。[({chipType.ToString()},{subChipId}) = {サウンドファイルパス.変数付きパス}]" ); + } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.cs" index 913bd81..15eab34 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\343\203\221\343\203\203\343\203\211\347\237\242\345\215\260.cs" @@ -5,7 +5,7 @@ using System.Linq; using SharpDX; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; +using YamlDotNet.RepresentationModel; using FDK; namespace DTXMania.ステージ @@ -14,25 +14,23 @@ class パッド矢印 : Activity { public enum 種類 { 上_Tom1, 下_Tom2, 左_Snare, 右_Tom3 }; + public パッド矢印() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._矢印画像 = new 画像( @"$(System)images\パッド矢印.png" ) ); - } - } + this.子Activityを追加する( this._矢印画像 = new 画像( @"$(System)images\パッド矢印.png" ) ); - protected override void On活性化() - { - using( Log.Block( FDKUtilities.現在のメソッド名 ) ) - { - this._矢印の矩形リスト = JObject.Parse( File.ReadAllText( new VariablePath( @"$(System)images\パッド矢印.json" ).変数なしパス ) ); - } - } - protected override void On非活性化() - { - using( Log.Block( FDKUtilities.現在のメソッド名 ) ) - { + var yaml = File.ReadAllText( new VariablePath( @"$(System)images\パッド矢印.yaml" ).変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._矢印の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._矢印の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } } } @@ -42,10 +40,10 @@ public void 描画する( DeviceContext1 dc, 種類 type, Vector2 中央位置dp switch( type ) { - case 種類.上_Tom1: 矩形 = FDKUtilities.JsonToRectangleF( this._矢印の矩形リスト[ "矩形リスト" ][ "Up" ] ); break; - case 種類.下_Tom2: 矩形 = FDKUtilities.JsonToRectangleF( this._矢印の矩形リスト[ "矩形リスト" ][ "Down" ] ); break; - case 種類.左_Snare: 矩形 = FDKUtilities.JsonToRectangleF( this._矢印の矩形リスト[ "矩形リスト" ][ "Left" ] ); break; - case 種類.右_Tom3: 矩形 = FDKUtilities.JsonToRectangleF( this._矢印の矩形リスト[ "矩形リスト" ][ "Right" ] ); break; + case 種類.上_Tom1: 矩形 = this._矢印の矩形リスト[ "Up" ]; break; + case 種類.下_Tom2: 矩形 = this._矢印の矩形リスト[ "Down" ]; break; + case 種類.左_Snare: 矩形 = this._矢印の矩形リスト[ "Left" ]; break; + case 種類.右_Tom3: 矩形 = this._矢印の矩形リスト[ "Right" ]; break; } var 左上位置dpx = new Vector2( 中央位置dpx.X - 矩形.Width * 拡大率 / 2f, 中央位置dpx.Y - 矩形.Height * 拡大率 / 2f ); @@ -57,7 +55,15 @@ public void 描画する( DeviceContext1 dc, 種類 type, Vector2 中央位置dp this._矢印画像.描画する( dc, 変換行列, 転送元矩形: 矩形 ); } + private 画像 _矢印画像 = null; - private JObject _矢印の矩形リスト = null; + + private Dictionary _矢印の矩形リスト = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\350\210\236\345\217\260\347\224\273\345\203\217.cs" "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\350\210\236\345\217\260\347\224\273\345\203\217.cs" index f6de7b2..617fa22 100644 --- "a/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\350\210\236\345\217\260\347\224\273\345\203\217.cs" +++ "b/DTXMania/\343\202\271\343\203\206\343\203\274\343\202\270/\350\210\236\345\217\260\347\224\273\345\203\217.cs" @@ -23,8 +23,8 @@ public 舞台画像( string 背景画像ファイル名 = null, string 背景黒 { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - this.子を追加する( this._背景画像 = new 画像( 背景画像ファイル名 ?? @"$(System)images\舞台.jpg" ) ); - this.子を追加する( this._背景黒幕付き画像 = new 画像( 背景黒幕付き画像ファイル名 ?? @"$(System)images\舞台黒幕付き.jpg" ) ); + this.子Activityを追加する( this._背景画像 = new 画像( 背景画像ファイル名 ?? @"$(System)images\舞台.jpg" ) ); + this.子Activityを追加する( this._背景黒幕付き画像 = new 画像( 背景黒幕付き画像ファイル名 ?? @"$(System)images\舞台黒幕付き.jpg" ) ); } } diff --git "a/DTXMania/\345\205\245\345\212\233/\345\205\245\345\212\233\347\256\241\347\220\206.cs" "b/DTXMania/\345\205\245\345\212\233/\345\205\245\345\212\233\347\256\241\347\220\206.cs" index b71b30f..5999c1d 100644 --- "a/DTXMania/\345\205\245\345\212\233/\345\205\245\345\212\233\347\256\241\347\220\206.cs" +++ "b/DTXMania/\345\205\245\345\212\233/\345\205\245\345\212\233\347\256\241\347\220\206.cs" @@ -265,7 +265,11 @@ public bool 確定キーが入力された() /// に含まれていれば true。 public bool キャンセルキーが入力された() { - return this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Escape ); + return + this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Escape ) || + this.ドラムのいずれか1つが入力された( new[] { + ドラム入力種別.Tom3, + ドラム入力種別.Tom3_Rim } ); } /// @@ -274,12 +278,11 @@ public bool キャンセルキーが入力された() /// に含まれていれば true。 public bool 上移動キーが入力された() { - return this.ドラムのいずれか1つが入力された( - new[] { + return + this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Up ) || + this.ドラムのいずれか1つが入力された( new[] { ドラム入力種別.Tom1, - ドラム入力種別.Tom1_Rim, - } ) - || this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Up ); + ドラム入力種別.Tom1_Rim } ); } /// @@ -288,12 +291,11 @@ public bool 上移動キーが入力された() /// に含まれていれば true。 public bool 下移動キーが入力された() { - return this.ドラムのいずれか1つが入力された( - new[] { + return + this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Down ) || + this.ドラムのいずれか1つが入力された( new[] { ドラム入力種別.Tom2, - ドラム入力種別.Tom2_Rim, - } ) - || this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Down ); + ドラム入力種別.Tom2_Rim } ); } /// @@ -302,13 +304,12 @@ public bool 下移動キーが入力された() /// に含まれていれば true。 public bool 左移動キーが入力された() { - return this.ドラムのいずれか1つが入力された( - new[] { + return + this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Left ) || + this.ドラムのいずれか1つが入力された( new[] { ドラム入力種別.Snare, ドラム入力種別.Snare_ClosedRim, - ドラム入力種別.Snare_OpenRim, - } ) - || this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Left ); + ドラム入力種別.Snare_OpenRim } ); } /// @@ -317,12 +318,11 @@ public bool 左移動キーが入力された() /// に含まれていれば true。 public bool 右移動キーが入力された() { - return this.ドラムのいずれか1つが入力された( - new[] { + return + this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Right ) || + this.ドラムのいずれか1つが入力された( new[] { ドラム入力種別.Tom3, - ドラム入力種別.Tom3_Rim, - } ) - || this.Keyboard.キーが押された( 0, SharpDX.DirectInput.Key.Right ); + ドラム入力種別.Tom3_Rim } ); } /// diff --git "a/DTXMania/\346\233\262/MusicNode.cs" "b/DTXMania/\346\233\262/MusicNode.cs" index 7dd0361..5d0296e 100644 --- "a/DTXMania/\346\233\262/MusicNode.cs" +++ "b/DTXMania/\346\233\262/MusicNode.cs" @@ -18,6 +18,7 @@ class MusicNode : Node { /// /// この曲ノードに対応する曲ファイル。 + /// 絶対パス。 /// public VariablePath 曲ファイルの絶対パス { get; protected set; } = null; @@ -28,6 +29,7 @@ class MusicNode : Node /// /// この曲ノードに対応する動画ファイル。 + /// 曲ファイルからの相対パス。 /// public VariablePath 動画ファイルパス { get; protected set; } = null; @@ -54,37 +56,15 @@ public MusicNode( VariablePath 曲ファイルの絶対パス, Node 親ノード this.曲ファイルハッシュ = song.HashId; this.難易度[ 3 ] = ("FREE", (float) song.Level); // [3]:MASTER相当。set.def 内にある MusicNode でも同じ。 - // サムネイル画像を決定する。 - string サムネイル画像ファイルパス = null; - if( song.PreImage.Nullでも空でもない() && File.Exists( song.PreImage ) ) + if( song.PreImage.Nullでも空でもない() ) { - // (A) DB に保存されている値があり、そのファイルが存在するなら、それを使う。 - サムネイル画像ファイルパス = song.PreImage; + var プレビュー画像ファイルの絶対パス = Path.Combine( Path.GetDirectoryName( song.Path ), song.PreImage ); + this.子Activityを追加する( this.ノード画像 = new テクスチャ( プレビュー画像ファイルの絶対パス ) ); } - else - { - // (B) DB に保存されてない場合、曲ファイルと同じ場所に画像ファイルがあるなら、それをノード画像として採用する。 - サムネイル画像ファイルパス = - ( from ファイル名 in Directory.GetFiles( Path.GetDirectoryName( this.曲ファイルの絶対パス.変数なしパス ) ) - where _対応するサムネイル画像名.Any( thumbファイル名 => ( Path.GetFileName( ファイル名 ).ToLower() == thumbファイル名 ) ) - select ファイル名 ).FirstOrDefault(); - } - if( null != サムネイル画像ファイルパス ) - { - this.子を追加する( this.ノード画像 = new テクスチャ( サムネイル画像ファイルパス ) ); - } - } - // 曲ファイルと同じ場所に(対応する拡張子を持った)動画ファイルがあるなら、それを背景動画として採用する。 - this.動画ファイルパス = new VariablePath( - ( from ファイル名 in Directory.GetFiles( Path.GetDirectoryName( this.曲ファイルの絶対パス.変数なしパス ) ) - where _対応する動画の拡張子.Any( 拡張子名 => ( Path.GetExtension( ファイル名 ).ToLower() == 拡張子名 ) ) - select ファイル名 ).FirstOrDefault() ); + if( song.PreSound.Nullでも空でもない() ) + this.プレビュー音声ファイルの絶対パス = Path.Combine( Path.GetDirectoryName( song.Path ), song.PreSound ); + } } - - - private readonly string[] _対応する動画の拡張子 = { ".mp4", ".avi" }; - - private readonly string[] _対応するサムネイル画像名 = { "thumb.png", "thumb.bmp", "thumb.jpg", "thumb.jpeg" }; } } diff --git "a/DTXMania/\346\233\262/Node.cs" "b/DTXMania/\346\233\262/Node.cs" index f717703..d6059f4 100644 --- "a/DTXMania/\346\233\262/Node.cs" +++ "b/DTXMania/\346\233\262/Node.cs" @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using SharpDX; using SharpDX.Direct2D1; using FDK; @@ -141,6 +143,69 @@ public Node 次のノード public static テクスチャ 既定のノード画像 { get; protected set; } = null; + // プレビュー音声関連 + + public void プレビュー音声を再生する() + { + if( this.プレビュー音声ファイルの絶対パス?.Nullまたは空である() ?? true ) + return; + + // 一定期間ごとに Tick イベントを呼び出すタイマを作成。 + + this._プレビュー音声再生タイマ?.Dispose(); + this._プレビュー音声再生タイマ = new System.Windows.Forms.Timer() { + Interval = 1000, + }; + + // Tick イベントでは、プレビュー音声を読み込んで再生する。 + + this._プレビュー音声再生タイマ.Tick += ( sender, e ) => { // このタスクはGUIスレッドで処理される(非同期ではない)。 + + this._プレビュー音声を生成する(); + this._プレビュー音声?.Play(); + + this._プレビュー音声再生タイマ.Stop(); // 実行停止。2回目以降の Tick はない。 + }; + + this._プレビュー音声再生タイマ.Start(); + } + + public void プレビュー音声を停止する() + { + this._プレビュー音声再生タイマ?.Stop(); + this._プレビュー音声再生タイマ?.Dispose(); + this._プレビュー音声再生タイマ = null; + + this._プレビュー音声?.Stop(); + } + + public virtual string プレビュー音声ファイルの絶対パス { get; protected set; } = null; + + protected CSCore.ISampleSource _プレビュー音声ソース = null; // 未対応、または生成に失敗した場合は null。 + + protected Sound _プレビュー音声 = null; // 未使用なら null。 + + private System.Windows.Forms.Timer _プレビュー音声再生タイマ = null; + + + protected void _プレビュー音声を生成する() + { + if( null != this._プレビュー音声 ) + return; // 生成済み + + if( this.プレビュー音声ファイルの絶対パス.Nullまたは空である() ) + return; // 指定なし + + if( null == this._プレビュー音声ソース ) // 未生成の場合 + this._プレビュー音声ソース = SampleSourceFactory.Create( App.サウンドデバイス, new VariablePath( this.プレビュー音声ファイルの絶対パス ).変数なしパス ); + + if( null != this._プレビュー音声ソース ) + this._プレビュー音声 = new Sound( App.サウンドデバイス, this._プレビュー音声ソース ); + } + + + // メソッド + public Node() { this.難易度 = new(string, float)[]{ @@ -152,7 +217,7 @@ public Node() }; //this.子を追加する( this._ノード画像 ); --> 派生クラスのコンストラクタで追加することができる。 - this.子を追加する( this._曲名テクスチャ = new 曲名() ); + this.子Activityを追加する( this._曲名テクスチャ = new 曲名() ); } protected override void On活性化() @@ -164,8 +229,17 @@ protected override void On活性化() Node.既定のノード画像.活性化する(); } } + protected override void On非活性化() { + this.プレビュー音声を停止する(); + + this._プレビュー音声?.Dispose(); + this._プレビュー音声 = null; + + this._プレビュー音声ソース?.Dispose(); + this._プレビュー音声ソース = null; + // 全インスタンスで共有する static メンバが生成な済みなら解放する。 if( null != Node.既定のノード画像 ) { diff --git "a/DTXMania/\346\233\262/SetNode.cs" "b/DTXMania/\346\233\262/SetNode.cs" index 572ab02..e27e169 100644 --- "a/DTXMania/\346\233\262/SetNode.cs" +++ "b/DTXMania/\346\233\262/SetNode.cs" @@ -46,6 +46,9 @@ protected set } } + public override string プレビュー音声ファイルの絶対パス + => this.MusicNodes[ App.曲ツリー.フォーカス難易度 ].プレビュー音声ファイルの絶対パス; + public SetNode() { @@ -90,11 +93,10 @@ where _対応するサムネイル画像名.Any( thumbファイル名 => ( Path. if( null != サムネイル画像ファイルパス ) { - this.子を追加する( this._ノード画像 = new テクスチャ( サムネイル画像ファイルパス ) ); + this.子Activityを追加する( this._ノード画像 = new テクスチャ( サムネイル画像ファイルパス ) ); } } - protected override void On活性化() { foreach( var node in this.MusicNodes ) @@ -105,6 +107,7 @@ protected override void On活性化() base.On活性化(); } + protected override void On非活性化() { foreach( var node in this.MusicNodes ) @@ -116,6 +119,7 @@ protected override void On非活性化() base.On非活性化(); } + private テクスチャ _ノード画像 = null; diff --git "a/DTXMania/\346\233\262/\346\233\262\343\203\204\343\203\252\343\203\274.cs" "b/DTXMania/\346\233\262/\346\233\262\343\203\204\343\203\252\343\203\274.cs" index d96f118..e8e5b0e 100644 --- "a/DTXMania/\346\233\262/\346\233\262\343\203\204\343\203\252\343\203\274.cs" +++ "b/DTXMania/\346\233\262/\346\233\262\343\203\204\343\203\252\343\203\274.cs" @@ -64,7 +64,7 @@ public MusicNode フォーカス曲ノード } /// - /// 現在選択されているノードが対応している、現在の難易度アンカに一番近い難易度(0:BASIC~4:ULTIMATE)を返す。 + /// 現在選択されているノードが対応している、現在の に一番近い難易度(0:BASIC~4:ULTIMATE)を返す。 /// public int フォーカス難易度 { @@ -91,6 +91,16 @@ public int フォーカス難易度 /// public SelectableList フォーカスリスト { get; protected set; } = null; + /// + /// フォーカスノードが変更された場合に発生するイベント。 + /// + /// + /// 選択されたノードと、選択が解除されたノードは、必ずしも同じNodeリストに存在するとは限らない。 + /// 例えば、BOXを移動する場合、選択されるNodeは移動後のNodeリストに、選択が解除されたNodeは移動前のNodeリストに、それぞれ存在する。 + /// この場合、後者はすでに非活性化されているので注意すること。 + /// + public event EventHandler<(Node 選択されたNode, Node 選択が解除されたNode)> フォーカスノードが変更された; + // 構築・破棄 @@ -117,6 +127,7 @@ protected override void On活性化() //this._難易度アンカ = 3; -> 初期化せず、前回の値を継承する。 } } + protected override void On非活性化() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) @@ -349,34 +360,51 @@ public void フォーカスする( Node ノード ) var 親ノード = ノード?.親ノード ?? this.ルートノード; Trace.Assert( null != 親ノード?.子ノードリスト ); - var 旧フォーカスリスト = this.フォーカスリスト; // 初回は null 。 + // 必要あればフォーカスリストを変更。 + + var 旧フォーカスリスト = this.フォーカスリスト; // 初回は null 。 this.フォーカスリスト = 親ノード.子ノードリスト; // 常に非null。(先のAssertで保証されている。) - if( null != ノード ) + if( 旧フォーカスリスト == this.フォーカスリスト ) { - // (A) ノードの指定がある(非null)なら、それを選択する。 - this.フォーカスリスト.SelectItem( ノード ); + // (A) フォーカスリストが変更されない場合;必要あればフォーカスノードを変更。 + + if( null != ノード ) + { + // ノードの指定がある(非null)なら、それを選択する。 + this.フォーカスリスト.SelectItem( ノード ); + } + else + { + // ノードの指定がない(null)なら、フォーカスノードは現状のまま維持する。 + } } else { - // (B) ノードの指定がない(null)なら、フォーカスノードは現状のまま維持する。 - } + // (B) フォーカスリストが変更される場合 - if( 旧フォーカスリスト != this.フォーカスリスト ) - { Log.Info( "フォーカスリストが変更されました。" ); if( this.活性化している ) { if( null != 旧フォーカスリスト ) // 初回は null 。 { + 旧フォーカスリスト.SelectionChanged -= this.フォーカスリスト_SelectionChanged; // ハンドラ削除 foreach( var node in 旧フォーカスリスト ) node.非活性化する(); } foreach( var node in this.フォーカスリスト ) node.活性化する(); + + if( null != ノード ) + this.フォーカスリスト.SelectItem( ノード ); // イベントハンドラ登録前 + + this.フォーカスリスト.SelectionChanged += this.フォーカスリスト_SelectionChanged; // ハンドラ登録 + + // 手動でイベントを発火。 + this.フォーカスノードが変更された?.Invoke( this.フォーカスリスト, (this.フォーカスリスト?.SelectedItem, 旧フォーカスリスト?.SelectedItem) ); } } } @@ -413,6 +441,18 @@ public void 前のノードをフォーカスする() } + /// + /// ユーザが希望している難易度。 + /// private int _難易度アンカ = 3; + + + private void フォーカスリスト_SelectionChanged( object sender, (Node 選択されたItem, Node 選択が解除されたItem) e ) + { + // 間接呼び出し; + // フォーカスリストの SelectedChanged イベントハンドラ → このクラス内で変更されうる + // 外部に対するイベントハンドラ → このクラス内では変更されない + this.フォーカスノードが変更された?.Invoke( sender, e ); + } } } diff --git "a/DTXMania/\346\234\252\345\207\246\347\220\206\344\276\213\345\244\226\346\244\234\345\207\272\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" "b/DTXMania/\346\234\252\345\207\246\347\220\206\344\276\213\345\244\226\346\244\234\345\207\272\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" index 7509e58..cd1a980 100644 --- "a/DTXMania/\346\234\252\345\207\246\347\220\206\344\276\213\345\244\226\346\244\234\345\207\272\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" +++ "b/DTXMania/\346\234\252\345\207\246\347\220\206\344\276\213\345\244\226\346\244\234\345\207\272\343\203\200\343\202\244\343\202\242\343\203\255\343\202\260.cs" @@ -11,7 +11,7 @@ namespace DTXMania { - public partial class 未処理例外検出ダイアログ : Form + partial class 未処理例外検出ダイアログ : Form { public 未処理例外検出ダイアログ() { diff --git "a/DTXMania/\350\250\255\345\256\232/\343\202\255\343\203\274\343\203\220\343\202\244\343\203\263\343\203\207\343\202\243\343\203\263\343\202\260.cs" "b/DTXMania/\350\250\255\345\256\232/\343\202\255\343\203\274\343\203\220\343\202\244\343\203\263\343\203\207\343\202\243\343\203\263\343\202\260.cs" index b10c43b..be0bbb8 100644 --- "a/DTXMania/\350\250\255\345\256\232/\343\202\255\343\203\274\343\203\220\343\202\244\343\203\263\343\203\207\343\202\243\343\203\263\343\202\260.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\202\255\343\203\274\343\203\220\343\202\244\343\203\263\343\203\207\343\202\243\343\203\263\343\202\260.cs" @@ -4,30 +4,27 @@ using System.Diagnostics; using System.Globalization; using System.Linq; +using System.Text.RegularExpressions; using System.Runtime.Serialization; using SharpDX.DirectInput; +using YamlDotNet.Core; +using YamlDotNet.Serialization; using FDK; using DTXMania.入力; namespace DTXMania.設定 { - [DataContract( Name = "KeyBindings", Namespace = "" )] - class キーバインディング : IExtensibleDataObject, ICloneable + internal class キーバインディング : ICloneable { /// /// 入力コードのマッピング用 Dictionary のキーとなる型。 /// 入力は、デバイスID(入力デバイスの内部識別用ID; FDKのIInputEvent.DeviceIDと同じ)と、 /// キー(キーコード、ノート番号などデバイスから得られる入力値)の組で定義される。 /// - [DataContract( Name = "IDとキー", Namespace = "" )] - [TypeConverter( typeof( IdKeyConverter ) )] - public struct IdKey + public struct IdKey : IYamlConvertible { - [DataMember] - public int deviceId; - - [DataMember] - public int key; + public int deviceId { get; set; } + public int key { get; set; } public IdKey( int deviceId, int key ) { @@ -50,45 +47,44 @@ public IdKey( string 文字列 ) public override string ToString() => $"{this.deviceId},{this.key}"; - /// - /// IdKey と string との相互変換。シリアライズ時に必要。 - /// - public class IdKeyConverter : TypeConverter + void IYamlConvertible.Read( IParser parser, Type expectedType, ObjectDeserializer nestedObjectDeserializer ) + { + var devkey = (string) nestedObjectDeserializer( typeof( string ) ); + + string 正規表現パターン = $@"^(\d+),(\d+)$"; // \d は10進数数字 + var m = Regex.Match( devkey, 正規表現パターン, RegexOptions.IgnoreCase ); + + if( m.Success && ( 3 <= m.Groups.Count ) ) + { + this.deviceId = int.Parse( m.Groups[ 1 ].Value ); + this.key = int.Parse( m.Groups[ 2 ].Value ); + } + } + void IYamlConvertible.Write( IEmitter emitter, ObjectSerializer nestedObjectSerializer ) { - public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType ) - => ( sourceType == typeof( string ) ) ? true : base.CanConvertFrom( context, sourceType ); - public override object ConvertFrom( ITypeDescriptorContext context, CultureInfo culture, object value ) - => ( value is string strvalue ) ? new IdKey( strvalue ) : base.ConvertFrom( context, culture, value ); - public override bool CanConvertTo( ITypeDescriptorContext context, Type destinationType ) - => ( destinationType == typeof( string ) ) ? true : base.CanConvertTo( context, destinationType ); - public override object ConvertTo( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) - => ( destinationType == typeof( string ) && ( value is IdKey idkey ) ) ? idkey.ToString() : base.ConvertTo( context, culture, value, destinationType ); + nestedObjectSerializer( $"{this.deviceId},{this.key}" ); } } - /// /// MIDI番号(0~7)とMIDIデバイス名のマッピング用 Dictionary。 /// - [DataMember] public Dictionary MIDIデバイス番号toデバイス名 { get; protected set; } /// /// キーボードの入力(DirectInputのKey値)からドラム入力へのマッピング用 Dictionary 。 /// - [DataMember] + [Description( "キーボードの入力割り当て(デバイスID,キーID: ドラム入力種別)" )] public Dictionary キーボードtoドラム { get; protected set; } + /// /// MIDI入力の入力(MIDIノート番号)からドラム入力へのマッピング用 Dictionary 。 /// - [DataMember] public Dictionary MIDItoドラム { get; protected set; } - [DataMember] public int FootPedal最小値 { get; set; } - [DataMember] public int FootPedal最大値 { get; set; } @@ -96,49 +92,6 @@ public override object ConvertTo( ITypeDescriptorContext context, CultureInfo cu /// コンストラクタ。 /// public キーバインディング() - { - this.OnDeserializing( new StreamingContext() ); - } - - /// - /// メンバを共有しない深いコピーを返す。 - /// - public object Clone() - { - var clone = new キーバインディング(); - - - clone.MIDIデバイス番号toデバイス名 = new Dictionary(); - - foreach( var kvp in this.MIDIデバイス番号toデバイス名 ) - clone.MIDIデバイス番号toデバイス名.Add( kvp.Key, kvp.Value ); - - - clone.キーボードtoドラム = new Dictionary(); - - foreach( var kvp in this.キーボードtoドラム ) - clone.キーボードtoドラム.Add( kvp.Key, kvp.Value ); - - - clone.MIDItoドラム = new Dictionary(); - - foreach( var kvp in this.MIDItoドラム ) - clone.MIDItoドラム.Add( kvp.Key, kvp.Value ); - - clone.FootPedal最小値 = this.FootPedal最小値; - clone.FootPedal最大値 = this.FootPedal最大値; - - return clone; - } - - - /// - /// コンストラクタまたは逆シリアル化前(復元前)に呼び出される。 - /// ここでは主に、メンバを規定値で初期化する。 - /// - /// 未使用。 - [OnDeserializing] - private void OnDeserializing( StreamingContext sc ) { this.FootPedal最小値 = 0; this.FootPedal最大値 = 90; // VH-11 の Normal Resolution での最大値 @@ -192,52 +145,37 @@ private void OnDeserializing( StreamingContext sc ) { new IdKey( 0, 38 ), ドラム入力種別.Snare }, { new IdKey( 0, 40 ), ドラム入力種別.Snare }, { new IdKey( 0, 37 ), ドラム入力種別.Snare }, - }; + }; } /// - /// 逆シリアル化後(復元後)に呼び出される。 - /// DataMember を使って他の 非DataMember を初期化する、などの処理を行う。 + /// メンバを共有しない深いコピーを返す。 /// - /// 未使用。 - [OnDeserialized] - private void OnDeserialized( StreamingContext sc ) + public object Clone() { - } + var clone = new キーバインディング(); - /// - /// シリアル化前に呼び出される。 - /// 非DataMember を使って保存用の DataMember を初期化する、などの処理を行う。 - /// - /// 未使用。 - [OnSerializing] - private void OnSerializing( StreamingContext sc ) - { - } - /// - /// シリアル化後に呼び出される。 - /// ログの出力などの処理を行う。 - /// - /// 未使用。 - [OnSerialized] - private void OnSerialized( StreamingContext sc ) - { - } + clone.MIDIデバイス番号toデバイス名 = new Dictionary(); - #region " IExtensibleDataObject の実装 " - //---------------- - private ExtensionDataObject _ExData; + foreach( var kvp in this.MIDIデバイス番号toデバイス名 ) + clone.MIDIデバイス番号toデバイス名.Add( kvp.Key, kvp.Value ); - public virtual ExtensionDataObject ExtensionData - { - get - => this._ExData; + clone.キーボードtoドラム = new Dictionary(); + + foreach( var kvp in this.キーボードtoドラム ) + clone.キーボードtoドラム.Add( kvp.Key, kvp.Value ); - set - => this._ExData = value; + clone.MIDItoドラム = new Dictionary(); + + foreach( var kvp in this.MIDItoドラム ) + clone.MIDItoドラム.Add( kvp.Key, kvp.Value ); + + clone.FootPedal最小値 = this.FootPedal最小値; + clone.FootPedal最大値 = this.FootPedal最大値; + + return clone; } - //---------------- - #endregion + } } diff --git "a/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211.cs" "b/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211.cs" new file mode 100644 index 0000000..3271661 --- /dev/null +++ "b/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211.cs" @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using CSCore; +using YamlDotNet.RepresentationModel; +using FDK; + +namespace DTXMania.設定 +{ + class システムサウンド : IDisposable + { + public システムサウンド( string プリセット名 = null ) + { + using( Log.Block( FDKUtilities.現在のメソッド名 ) ) + { + this._プリセットサウンドを読み込む( プリセット名 ?? this._既定のプリセット名 ); + } + } + + public void Dispose() + { + foreach( var kvp in this._種別toサウンドマップ ) + { + kvp.Value.sound.Dispose(); + kvp.Value.source.Dispose(); + } + + this._種別toサウンドマップ = null; + } + + public void 再生する( システムサウンド種別 type, bool ループ再生する = false ) + { + if( this._種別toサウンドマップ.TryGetValue( type, out var map ) ) + map.sound?.Play( ループ再生する: ループ再生する ); + } + + public void 停止する( システムサウンド種別 type ) + { + if( this._種別toサウンドマップ.TryGetValue( type, out var map ) ) + map.sound?.Stop(); + } + + public bool 再生中( システムサウンド種別 type ) + => this._種別toサウンドマップ.TryGetValue( type, out var map ) && map.sound.いずれかが再生中である; + + + private readonly string _既定のプリセット名 = "default"; + + private Dictionary<システムサウンド種別, (ISampleSource source, PolySound sound)> _種別toサウンドマップ = null; + + + private void _プリセットサウンドを読み込む( string プリセット名 ) + { + this._種別toサウンドマップ = new Dictionary<システムサウンド種別, (ISampleSource source, PolySound sound)>(); + + var プリセットフォルダの絶対パス = new VariablePath( $@"$(System)sounds\presets\{プリセット名}" ); + + try + { + foreach( システムサウンド種別 種別 in Enum.GetValues( typeof( システムサウンド種別 ) ) ) + { + // システムサウンド種別名をそのままファイル名として使う。形式は .ogg のみ。 + var サウンドファイルの絶対パス = new VariablePath( Path.Combine( プリセットフォルダの絶対パス.変数なしパス, 種別.ToString() + ".ogg" ) ); + + // ファイルがないなら無視。 + if( !File.Exists( サウンドファイルの絶対パス.変数なしパス ) ) + { + Log.ERROR( $"システムサウンドファイルが見つかりません。スキップします。[{サウンドファイルの絶対パス.変数付きパス}]" ); + continue; + } + + var sampleSource = SampleSourceFactory.Create( App.サウンドデバイス, サウンドファイルの絶対パス ); + if( null == sampleSource ) + throw new Exception( $"システムサウンドの読み込みに失敗しました。[{サウンドファイルの絶対パス.変数付きパス}]" ); + + var sound = new PolySound( App.サウンドデバイス, sampleSource, 2 ); + + this._種別toサウンドマップ[ 種別 ] = (sampleSource, sound); + + Log.Info( $"システムサウンドを読み込みました。[{サウンドファイルの絶対パス.変数付きパス}]" ); + } + } + catch( Exception e ) + { + Log.ERROR( $"プリセットサウンドの読み込みに失敗しました。[{プリセット名}][{Folder.絶対パスをフォルダ変数付き絶対パスに変換して返す( e.Message )}]" ); + + if( !( プリセット名.Equals( this._既定のプリセット名, StringComparison.OrdinalIgnoreCase ) ) ) + { + Log.Info( "既定のプリセットの読み込みを行います。" ); + this.Dispose(); + this._プリセットサウンドを読み込む( this._既定のプリセット名 ); + return; + } + } + + Log.Info( $"プリセットサウンドを読み込みました。[{プリセット名}]" ); + } + } +} \ No newline at end of file diff --git "a/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211\347\250\256\345\210\245.cs" "b/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211\347\250\256\345\210\245.cs" new file mode 100644 index 0000000..f857915 --- /dev/null +++ "b/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\343\202\265\343\202\246\343\203\263\343\203\211\347\250\256\345\210\245.cs" @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; + +namespace DTXMania.設定 +{ + enum システムサウンド種別 + { + カーソル移動音, + 決定音, + 取消音, + 変更音, + + ステージ失敗, + ステージクリア, + フルコンボ, + 歓声, + + 起動ステージ_開始音, + 起動ステージ_ループBGM, + + タイトルステージ_開始音, + タイトルステージ_ループBGM, + タイトルステージ_確定音, + + 認証ステージ_開始音, + 認証ステージ_ループBGM, + 認証ステージ_ログイン音, + + 選曲ステージ_開始音, + //選曲ステージ_ループBGM, --> なし + 選曲ステージ_曲決定音, + + オプション設定ステージ_開始音, + + 曲読み込みステージ_開始音, + 曲読み込みステージ_ループBGM, + + 終了ステージ_開始音, + } +} diff --git "a/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\350\250\255\345\256\232.cs" "b/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\350\250\255\345\256\232.cs" index 5f49bdf..adabede 100644 --- "a/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\350\250\255\345\256\232.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\202\267\343\202\271\343\203\206\343\203\240\350\250\255\345\256\232.cs" @@ -4,9 +4,6 @@ using System.Drawing; using System.IO; using System.Linq; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; using FDK; namespace DTXMania.設定 @@ -18,20 +15,18 @@ namespace DTXMania.設定 /// /// ユーザ別の項目はで管理すること。 /// - [DataContract( Name = "Configuration", Namespace = "" )] - [KnownType( typeof( キーバインディング ) )] - class システム設定 : IExtensibleDataObject + class システム設定 { + public static readonly VariablePath システム設定ファイルパス = @"$(AppData)Configuration.yaml"; + /// /// このクラスのバージョン。 /// - [DataMember( Order = 1 )] - public static int Version = 1; + public int Version = 1; /// /// キーバインディングは全ユーザで共通。 /// - [DataMember( Name = "KeyBindings", Order = 100 )] public キーバインディング キーバインディング { get; set; } = null; /// @@ -45,191 +40,84 @@ class システム設定 : IExtensibleDataObject /// /// 1~10? /// - [DataMember( Name = "WorkThreadSleep", Order = 10 )] public int 入力発声スレッドのスリープ量ms { get; set; } - [DataMember( Name = "WindowPositionOfViewerMode", Order = 10 )] public Point ウィンドウ表示位置Viewerモード用 { get; set; } - [DataMember( Name = "ClientSizeOfViewerMode", Order = 10 )] public Size ウィンドウサイズViewerモード用 { get; set; } public システム設定() { - this.OnDeserializing( new StreamingContext() ); - - // パスの指定がなければ、とりあえず exe のあるフォルダを検索対象にする。 - if( 0 == this.曲検索フォルダ.Count ) - this.曲検索フォルダ.Add( @"$(Exe)" ); + this.キーバインディング = new キーバインディング(); + this.曲検索フォルダ = new List() { @"$(Exe)" }; + this.入力発声スレッドのスリープ量ms = 2; + this.ウィンドウ表示位置Viewerモード用 = new Point( 100, 100 ); + this.ウィンドウサイズViewerモード用 = new Size( 640, 360 ); } public static システム設定 復元する() { using( Log.Block( FDKUtilities.現在のメソッド名 ) ) { - var 設定 = ( システム設定 ) null; - - try - { - // コンフィグのバージョン番号を取得。 - var jobj = JObject.Parse( File.ReadAllText( _ファイルパス.変数なしパス ) ); // いったん型なしで読み込む - int configVersion = ( (int?) jobj[ "Version" ] ) ?? 0; - - // バージョン別に読み込み。 - switch( configVersion ) - { - case 1: - // Release 015 以降 - 設定 = JsonConvert.DeserializeObject<システム設定>( jobj.ToString() ); - Log.Info( $"システム設定をファイルから復元しました。[{_ファイルパス.変数付きパス}]" ); - break; - - case 0: - #region " Release 014 まで " - //---------------- - try - { - 設定 = FDKUtilities.復元する<システム設定>( _ファイルパス, UseSimpleDictionaryFormat: false ); - Log.Info( $"システム設定をファイルから復元しました。[{_ファイルパス.変数付きパス}]" ); - } - catch - { - Log.WARNING( $"復元に失敗したので、新規に作成して保存します。[{_ファイルパス.変数付きパス}]" ); - 設定 = new システム設定(); - FDKUtilities.保存する( 設定, _ファイルパス, UseSimpleDictionaryFormat: false ); - } - return 設定; - //---------------- - #endregion - - default: - throw new NotSupportedException( $"未知のバージョン({configVersion})が指定されました。" ); - } - - return 設定; - } - catch( FileNotFoundException ) - { - Log.Info( $"ファイルが存在しないため、新規に作成して保存します。[{_ファイルパス.変数付きパス}]" ); - 設定 = new システム設定(); - FDKUtilities.保存する( 設定, _ファイルパス, UseSimpleDictionaryFormat: false ); - return 設定; - } - catch - { - Log.ERROR( $"ファイルの内容に誤りがあります。新規に作成して保存します。[{_ファイルパス.変数付きパス}]" ); - 設定 = new システム設定(); - FDKUtilities.保存する( 設定, _ファイルパス, UseSimpleDictionaryFormat: false ); - return 設定; - } - } - } + // (1) 読み込み or 新規作成 - public void 保存する() - { - using( Log.Block( FDKUtilities.現在のメソッド名 ) ) - { - switch( Version ) + var config = (システム設定) null; + + try { - case 0: - //FDKUtilities.保存する( this, _ファイルパス, UseSimpleDictionaryFormat: false ); - //break; - case 1: - File.WriteAllText( _ファイルパス.変数なしパス, JsonConvert.SerializeObject( this, Formatting.Indented ) ); - Log.Info( $"システム設定 を保存しました。[{_ファイルパス.変数付きパス}]" ); - break; + var yaml = File.ReadAllText( システム設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + config = deserializer.Deserialize<システム設定>( yaml ); + + if( 1 != config.Version ) + { + Log.ERROR( $"未対応のバージョンです。新規に作成して保存します。[{システム設定ファイルパス.変数付きパス}]" ); + config = new システム設定(); + config.保存する(); + } + } + catch( FileNotFoundException ) + { + Log.Info( $"ファイルが存在しないため、新規に作成します。[{システム設定ファイルパス.変数付きパス}]" ); + config = new システム設定(); + config.保存する(); + } + catch + { + Log.ERROR( $"ファイルの内容に誤りがあります。新規に作成して保存します。[{システム設定ファイルパス.変数付きパス}]" ); + config = new システム設定(); + config.保存する(); } - } - } - private static readonly VariablePath _ファイルパス = @"$(AppData)Configuration.json"; + // (2) 読み込み後の処理 - /// - /// のシリアライゼーションのための仲介役。 - /// - [DataMember( Name = "SongPaths", Order = 10 )] - private List _曲検索フォルダProxy = null; + // パスの指定がなければ、とりあえず exe のあるフォルダを検索対象にする。 + if( 0 == config.曲検索フォルダ.Count ) + config.曲検索フォルダ.Add( @"$(Exe)" ); + // 値の範囲チェック。 + config.入力発声スレッドのスリープ量ms = Math.Max( 1, Math.Min( 10, config.入力発声スレッドのスリープ量ms ) ); - /// - /// コンストラクタまたは逆シリアル化前(復元前)に呼び出される。 - /// ここでは主に、メンバを規定値で初期化する。 - /// - /// 未使用。 - [OnDeserializing] - private void OnDeserializing( StreamingContext sc ) - { - this.キーバインディング = new キーバインディング(); - this.曲検索フォルダ = new List(); - this._曲検索フォルダProxy = new List(); - this.入力発声スレッドのスリープ量ms = 2; - this.ウィンドウ表示位置Viewerモード用 = new Point( 100, 100 ); - this.ウィンドウサイズViewerモード用 = new Size( 640, 360 ); - } - - /// - /// 逆シリアル化後(復元後)に呼び出される。 - /// DataMember を使って他の 非DataMember を初期化する、などの処理を行う。 - /// - /// 未使用。 - [OnDeserialized] - private void OnDeserialized( StreamingContext sc ) - { - // Proxy から曲検索フォルダを復元。 - foreach( var path in this._曲検索フォルダProxy ) - this.曲検索フォルダ.Add( path ); - - // パスの指定がなければ、とりあえず exe のあるフォルダを検索対象にする。 - if( 0 == this.曲検索フォルダ.Count ) - this.曲検索フォルダ.Add( @"$(Exe)" ); - - // 値の範囲チェック。 - if( ( this.入力発声スレッドのスリープ量ms < 1 ) || ( this.入力発声スレッドのスリープ量ms > 10 ) ) - { - Log.WARNING( $"入力発声スレッドのスリープ量msの値({this.入力発声スレッドのスリープ量ms})が無効です。1~10の範囲の整数で指定してください。" ); - this.入力発声スレッドのスリープ量ms = Math.Max( 1, Math.Min( 10, this.入力発声スレッドのスリープ量ms ) ); + return config; } } - /// - /// シリアル化前に呼び出される。 - /// 非DataMember を使って保存用の DataMember を初期化する、などの処理を行う。 - /// - /// 未使用。 - [OnSerializing] - private void OnSerializing( StreamingContext sc ) - { - // 曲検索フォルダの内容をProxyへ転載。 - this._曲検索フォルダProxy = new List(); - foreach( var varpath in this.曲検索フォルダ ) - this._曲検索フォルダProxy.Add( varpath.変数付きパス ); - } - - /// - /// シリアル化後に呼び出される。 - /// ログの出力などの処理を行う。 - /// - /// 未使用。 - [OnSerialized] - private void OnSerialized( StreamingContext sc ) + public void 保存する() { - } - - #region " IExtensibleDataObject の実装 " - //---------------- - private ExtensionDataObject _ExData; + using( Log.Block( FDKUtilities.現在のメソッド名 ) ) + { + var serializer = new YamlDotNet.Serialization.SerializerBuilder() + .WithTypeInspector( inner => new FDK.シリアライズ.YAML.CommentGatheringTypeInspector( inner ) ) + .WithEmissionPhaseObjectGraphVisitor( args => new FDK.シリアライズ.YAML.CommentsObjectGraphVisitor( args.InnerVisitor ) ) + .Build(); - public virtual ExtensionDataObject ExtensionData - { - get - => this._ExData; + var yaml = serializer.Serialize( this ); + File.WriteAllText( システム設定ファイルパス.変数なしパス, yaml ); - set - => this._ExData = value; + Log.Info( $"システム設定 を保存しました。[{システム設定ファイルパス.変数付きパス}]" ); + } } - //---------------- - #endregion } } diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/SQLiteDBBase.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/SQLiteDBBase.cs" similarity index 95% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/SQLiteDBBase.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/SQLiteDBBase.cs" index 9832b95..16409b9 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/SQLiteDBBase.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/SQLiteDBBase.cs" @@ -104,6 +104,10 @@ public void Dispose() this.Connection?.Close(); this.Connection?.Dispose(); + + // SQLite は接続を切断した後もロックを維持するので、GC でそれを解放する。 + // 参考: https://stackoverrun.com/ja/q/3363188 + GC.Collect(); } diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/Record06.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/Record06.cs" similarity index 98% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/Record06.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/Record06.cs" index cc1c889..5dab524 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/Record06.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/Record06.cs" @@ -16,7 +16,7 @@ namespace DTXMania.データベース.ユーザ /// なし /// [Table( Name = "Records" )] // テーブル名は複数形 - public class Record06 : ICloneable + class Record06 : ICloneable { /// /// ユーザを一意に識別するID。 diff --git "a/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/User07.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/User07.cs" new file mode 100644 index 0000000..89ce18e --- /dev/null +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/User07.cs" @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using System.Data.Linq.Mapping; +using System.Diagnostics; +using System.Linq; +using FDK; + +namespace DTXMania.データベース.ユーザ +{ + /// + /// ユーザテーブルのエンティティクラス。 + /// バージョン 7。 + /// + [Table( Name = "Users" )] // テーブル名は複数形 + class User07 : ICloneable + { + /// + /// ユーザを一意に識別する文字列。主キー。 + /// 変更不可。 + /// + [Column( DbType = "NVARCHAR", CanBeNull = true, IsPrimaryKey = true )] + public string Id { get; set; } + + /// + /// ユーザ名。 + /// 変更可。 + /// + [Column( DbType = "NVARCHAR", CanBeNull = false )] + public string Name { get; set; } + + /// + /// 譜面スクロール速度の倍率。1.0で等倍。 + /// + [Column( DbType = "REAL", CanBeNull = false )] + public double ScrollSpeed { get; set; } + + /// + /// 起動直後の表示モード。 + /// 0: ウィンドウモード、その他: 全画面モードで。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int Fullscreen { get; set; } + + // AutoPlay + + /// + /// 左シンバルレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_LeftCymbal { get; set; } + + /// + /// ハイハットレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_HiHat { get; set; } + + /// + /// 左ペダルレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_LeftPedal { get; set; } + + /// + /// スネアレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_Snare { get; set; } + + /// + /// バスレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_Bass { get; set; } + + /// + /// ハイタムレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_HighTom { get; set; } + + /// + /// ロータムレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_LowTom { get; set; } + + /// + /// フロアタムレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_FloorTom { get; set; } + + /// + /// 右シンバルレーンの AutoPlay 。 + /// 0: OFF, その他: ON。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int AutoPlay_RightCymbal { get; set; } + + // 最大ヒット距離 + + /// + /// Perfect の最大ヒット距離[秒]。 + /// + [Column( DbType = "REAL", CanBeNull = false )] + public double MaxRange_Perfect { get; set; } + + /// + /// Great の最大ヒット距離[秒]。 + /// + [Column( DbType = "REAL", CanBeNull = false )] + public double MaxRange_Great { get; set; } + + /// + /// Good の最大ヒット距離[秒]。 + /// + [Column( DbType = "REAL", CanBeNull = false )] + public double MaxRange_Good { get; set; } + + /// + /// Ok の最大ヒット距離[秒]。 + /// + [Column( DbType = "REAL", CanBeNull = false )] + public double MaxRange_Ok { get; set; } + + + /// + /// シンバルフリーモード。 + /// 0: OFF, その他: ON + /// + [Column( DbType = "INT", CanBeNull = false )] + public int CymbalFree { get; set; } + + /// + /// 演奏モード。 + /// 0: Basic, 1: Expert + /// + [Column( DbType = "INT", CanBeNull = false )] + public int PlayMode { get; set; } + + /// + /// Ride の表示位置。 + /// 0: 右, 1: 左 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int RideLeft { get; set; } + + /// + /// China の表示位置。 + /// 0: 右, 1: 左 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int ChinaLeft { get; set; } + + /// + /// Splash の表示位置。 + /// 0: 右, 1: 左 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int SplashLeft { get; set; } + + /// + /// ユーザ入力時にドラム音を発声するか? + /// 0: OFF, その他: ON + /// + [Column( DbType = "INT", CanBeNull = false )] + public int DrumSound { get; set; } + + /// + /// レーンタイプ名。 + /// $(System)images\演奏\レーン配置\*.json の '*' に当たる部分の名前を指定できる。 + /// + [Column( DbType = "NVARCHAR", CanBeNull = false )] + public string LaneType { get; set; } + + /// + /// レーンの透過度[%]。 + /// 0:完全不透明 ~ 100:完全透明 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int LaneTrans { get; set; } + + + /////////////////////////// + + /// + /// 既定値で初期化。 + /// + public User07() + { + this.Id = "Anonymous"; + this.Name = "Anonymous"; + this.ScrollSpeed = 1.0; + this.Fullscreen = 0; + this.AutoPlay_LeftCymbal = 1; + this.AutoPlay_HiHat = 1; + this.AutoPlay_LeftPedal = 1; + this.AutoPlay_Snare = 1; + this.AutoPlay_Bass = 1; + this.AutoPlay_HighTom = 1; + this.AutoPlay_LowTom = 1; + this.AutoPlay_FloorTom = 1; + this.AutoPlay_RightCymbal = 1; + this.MaxRange_Perfect = 0.034; + this.MaxRange_Great = 0.067; + this.MaxRange_Good = 0.084; + this.MaxRange_Ok = 0.117; + this.CymbalFree = 1; + this.PlayMode = 0; + this.RideLeft = 0; + this.ChinaLeft = 0; + this.SplashLeft = 1; + this.DrumSound = 1; + this.LaneType = "TypeA"; + this.LaneTrans = 50; + } + + // ICloneable 実装 + public User07 Clone() + { + return (User07) this.MemberwiseClone(); + } + object ICloneable.Clone() + { + return this.Clone(); + } + + public override string ToString() + => $"Id:{this.Id}, Name:{this.Name}"; + + + /////////////////////////// + + /// + /// テーブルのカラム部分を列挙したSQL。 + /// + public static readonly string ColumnsList = + @"( Id NVARCHAR NOT NULL PRIMARY KEY" + + @", Name NVARCHAR NOT NULL" + + @", ScrollSpeed REAL NOT NULL" + + @", Fullscreen INTEGER NOT NULL" + + @", AutoPlay_LeftCymbal INTEGER NOT NULL" + + @", AutoPlay_HiHat INTEGER NOT NULL" + + @", AutoPlay_LeftPedal INTEGER NOT NULL" + + @", AutoPlay_Snare INTEGER NOT NULL" + + @", AutoPlay_Bass INTEGER NOT NULL" + + @", AutoPlay_HighTom INTEGER NOT NULL" + + @", AutoPlay_LowTom INTEGER NOT NULL" + + @", AutoPlay_FloorTom INTEGER NOT NULL" + + @", AutoPlay_RightCymbal INTEGER NOT NULL" + + @", MaxRange_Perfect REAL NOT NULL" + + @", MaxRange_Great REAL NOT NULL" + + @", MaxRange_Good REAL NOT NULL" + + @", MaxRange_Ok REAL NOT NULL" + + @", CymbalFree INTEGER NOT NULL" + + @", PlayMode INTEGER NOT NULL" + + @", RideLeft INTEGER NOT NULL" + + @", ChinaLeft INTEGER NOT NULL" + + @", SplashLeft INTEGER NOT NULL" + + @", DrumSound INTEGER NOT NULL" + + @", LaneType NVARCHAR NOT NULL" + + @", LaneTrans INTEGER NOT NULL" + + @")"; + } +} diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/UserDB.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/UserDB.cs" similarity index 81% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/UserDB.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/UserDB.cs" index 05feead..c50f9ce 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/UserDB.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/UserDB.cs" @@ -12,8 +12,9 @@ namespace DTXMania.データベース.ユーザ using User03 = old.User03; using User04 = old.User04; using User05 = old.User05; + using User06 = old.User06; - using User = User06; // 最新バージョンを指定(その1) + using User = User07; // 最新バージョンを指定(1/2) using Record = Record06; // /// @@ -21,7 +22,9 @@ namespace DTXMania.データベース.ユーザ /// class UserDB : SQLiteDBBase { - public const long VERSION = 6; // 最新バージョンを指定(その2) + public const long VERSION = 7; // 最新バージョンを指定(2/2) + + public static readonly VariablePath ユーザDBファイルパス = @"$(AppData)UserDB.sqlite3"; public Table Users => base.DataContext.GetTable(); @@ -29,7 +32,7 @@ public Table Records => base.DataContext.GetTable(); public UserDB() - : base( @"$(AppData)UserDB.sqlite3", VERSION ) + : base( ユーザDBファイルパス, VERSION ) { } @@ -107,7 +110,7 @@ protected override void データベースのアップグレードマイグレ { try { - // テータベースをアップデートしてデータを移行する。 + // データベースにカラム PlayMode を追加する。 this.DataContext.ExecuteCommand( "ALTER TABLE Users ADD COLUMN PlayMode INTEGER NOT NULL DEFAULT 1" ); this.DataContext.SubmitChanges(); @@ -138,7 +141,7 @@ protected override void データベースのアップグレードマイグレ { try { - // テータベースをアップデートしてデータを移行する。 + // データベースに新しいカラムを追加する。 this.DataContext.ExecuteCommand( "ALTER TABLE Users ADD COLUMN RideLeft INTEGER NOT NULL DEFAULT 0" ); // 2018.2.11 現在、SQLite で複数カラムを一度に追加できる構文はない。 this.DataContext.ExecuteCommand( "ALTER TABLE Users ADD COLUMN ChinaLeft INTEGER NOT NULL DEFAULT 0" ); this.DataContext.ExecuteCommand( "ALTER TABLE Users ADD COLUMN SplashLeft INTEGER NOT NULL DEFAULT 1" ); @@ -171,7 +174,7 @@ protected override void データベースのアップグレードマイグレ { try { - // テータベースをアップデートしてデータを移行する。 + // データベースにカラム DrumSound を追加する。 this.DataContext.ExecuteCommand( "ALTER TABLE Users ADD COLUMN DrumSound INTEGER NOT NULL DEFAULT 1" ); this.DataContext.SubmitChanges(); @@ -202,7 +205,7 @@ protected override void データベースのアップグレードマイグレ { try { - // テータベースをアップデートしてデータを移行する。 + // データベースにカラム LaneType を追加する。 this.DataContext.ExecuteCommand( "ALTER TABLE Users ADD COLUMN LaneType NVARCHAR NOT NULL DEFAULT 'TypeA'" ); this.DataContext.SubmitChanges(); @@ -223,6 +226,37 @@ protected override void データベースのアップグレードマイグレ #endregion break; + case 6: + #region " 6 → 7 " + //---------------- + // 変更点: + // ・Users テーブルに LaneTrans カラムを追加。 + this.DataContext.SubmitChanges(); + using( var transaction = this.Connection.BeginTransaction() ) + { + try + { + // データベースにカラム LaneTrans を追加する。 + this.DataContext.ExecuteCommand( "ALTER TABLE Users ADD COLUMN LaneTrans INTEGER NOT NULL DEFAULT 50" ); + this.DataContext.SubmitChanges(); + + // 成功。 + transaction.Commit(); + this.DataContext.ExecuteCommand( "VACUUM" ); // Vacuum はトランザクションの外で。 + this.DataContext.SubmitChanges(); + Log.Info( $"Users テーブルをアップデートしました。[{移行元DBバージョン}→{移行元DBバージョン + 1}]" ); + } + catch + { + // 失敗。 + transaction.Rollback(); + throw new Exception( $"Users テーブルのアップデートに失敗しました。[{移行元DBバージョン}→{移行元DBバージョン + 1}]" ); + } + } + //---------------- + #endregion + break; + default: throw new Exception( $"移行元DBのバージョン({移行元DBバージョン})がマイグレーションに未対応です。" ); } diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record01.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record01.cs" similarity index 98% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record01.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record01.cs" index 04dcbdc..f6861a8 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record01.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record01.cs" @@ -12,7 +12,7 @@ namespace DTXMania.データベース.ユーザ.old /// バージョン 1。 /// [Table( Name = "Records" )] // テーブル名は複数形 - public class Record01 : ICloneable + class Record01 : ICloneable { /// /// ユーザを一意に識別するID。 diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record02.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record02.cs" similarity index 98% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record02.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record02.cs" index 637616e..369055f 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record02.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record02.cs" @@ -16,7 +16,7 @@ namespace DTXMania.データベース.ユーザ.old /// なし /// [Table( Name = "Records" )] // テーブル名は複数形 - public class Record02 : ICloneable + class Record02 : ICloneable { /// /// ユーザを一意に識別するID。 diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record03.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record03.cs" similarity index 98% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record03.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record03.cs" index c517c86..c5b9ec0 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record03.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record03.cs" @@ -16,7 +16,7 @@ namespace DTXMania.データベース.ユーザ.old /// なし /// [Table( Name = "Records" )] // テーブル名は複数形 - public class Record03 : ICloneable + class Record03 : ICloneable { /// /// ユーザを一意に識別するID。 diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record04.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record04.cs" similarity index 98% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record04.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record04.cs" index 06ad871..cc4ad04 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record04.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record04.cs" @@ -16,7 +16,7 @@ namespace DTXMania.データベース.ユーザ.old /// なし /// [Table( Name = "Records" )] // テーブル名は複数形 - public class Record04 : ICloneable + class Record04 : ICloneable { /// /// ユーザを一意に識別するID。 diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record05.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record05.cs" similarity index 98% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record05.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record05.cs" index fbc8501..0e85441 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record05.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/Record05.cs" @@ -16,7 +16,7 @@ namespace DTXMania.データベース.ユーザ.old /// なし /// [Table( Name = "Records" )] // テーブル名は複数形 - public class Record05 : ICloneable + class Record05 : ICloneable { /// /// ユーザを一意に識別するID。 diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User01.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User01.cs" similarity index 100% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User01.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User01.cs" diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User02.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User02.cs" similarity index 100% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User02.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User02.cs" diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User03.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User03.cs" similarity index 100% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User03.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User03.cs" diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User04.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User04.cs" similarity index 100% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User04.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User04.cs" diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User05.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User05.cs" similarity index 100% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User05.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User05.cs" diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/User06.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User06.cs" similarity index 99% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/User06.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User06.cs" index 0f257e7..a96af48 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/User06.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\343\203\246\343\203\274\343\202\266/old/User06.cs" @@ -5,7 +5,7 @@ using System.Linq; using FDK; -namespace DTXMania.データベース.ユーザ +namespace DTXMania.データベース.ユーザ.old { /// /// ユーザテーブルのエンティティクラス。 diff --git "a/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/Song04.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/Song04.cs" new file mode 100644 index 0000000..0d81cf6 --- /dev/null +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/Song04.cs" @@ -0,0 +1,201 @@ +using System; +using System.Collections.Generic; +using System.Data.Linq.Mapping; +using System.Diagnostics; +using System.Linq; + +namespace DTXMania.データベース.曲 +{ + /// + /// 曲テーブルのエンティティクラス。 + /// バージョン 3。 + /// + /// + /// 変更点: + /// ・テーブルの末尾に Artist カラムを追加。 + /// + [Table( Name = "Songs" )] // テーブル名は複数形 + class Song04 : ICloneable + { + /// + /// 曲譜面ファイルのハッシュ値。 + /// 正確には一意じゃないけど、主キーとして扱う。 + /// + [Column( DbType = "NVARCHAR", CanBeNull = false, IsPrimaryKey = true )] + public string HashId { get; set; } + + /// + /// 曲のタイトル。 + /// + [Column( DbType = "NVARCHAR", CanBeNull = false )] + public string Title { get; set; } + + /// + /// 曲譜面ファイルへの絶対パス。 + /// これも一意とする。(テーブル生成SQLで UNIQUE を付与している。) + /// + [Column( DbType = "NVARCHAR", CanBeNull = false )] + public string Path { get; set; } + + /// + /// 曲譜面ファイルの最終更新時刻の文字列表記。 + /// 文字列の書式は、System.DateTime.ToString("G") と同じ。(例: "08/17/2000 16:32:32") + /// カルチャはシステム既定のものとする。 + /// + [Column( DbType = "NVARCHAR", CanBeNull = false )] + public string LastWriteTime { get; set; } + + /// + /// 曲の難易度。0.00~9.99。 + /// + [Column( DbType = "REAL", CanBeNull = false )] + public double Level { get; set; } + + /// + /// 最小BPM。null なら未取得。 + /// + [Column( DbType = "REAL", CanBeNull = true )] + public double? MinBPM { get; set; } + + /// + /// 最大BPM。null なら未取得。 + /// + [Column( DbType = "REAL", CanBeNull = true )] + public double? MaxBPM { get; set; } + + /// + /// 左シンバルの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_LeftCymbal { get; set; } + + /// + /// ハイハットの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_HiHat { get; set; } + + /// + /// 左ペダルまたは左バスの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_LeftPedal { get; set; } + + /// + /// スネアの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_Snare { get; set; } + + /// + /// バスの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_Bass { get; set; } + + /// + /// ハイタムの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_HighTom { get; set; } + + /// + /// ロータムの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_LowTom { get; set; } + + /// + /// フロアタムの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_FloorTom { get; set; } + + /// + /// 右シンバルの総ノーツ数。 + /// + [Column( DbType = "INT", CanBeNull = false )] + public int TotalNotes_RightCymbal { get; set; } + + /// + /// 曲のプレビュー画像ファイルのパス。 + /// 曲譜面ファイル()からの相対パス。 + /// + [Column( DbType = "NVARCHAR" )] + public string PreImage { get; set; } + + /// + /// 曲のアーティスト名。 + /// + [Column( DbType = "NVARCHAR" )] + public string Artist { get; set; } + + /// + /// 曲のプレビュー音声ファイルのパス。 + /// 曲譜面ファイル()からの相対パス。 + /// + [Column( DbType = "NVARCHAR" )] + public string PreSound { get; set; } + + + /////////////////////// + + public Song04() + { + this.HashId = ""; + this.Title = "(no title)"; + this.Path = ""; + this.LastWriteTime = DateTime.Now.ToString( "G" ); + this.Level = 5.00; + this.MinBPM = null; + this.MaxBPM = null; + this.TotalNotes_LeftCymbal = 0; + this.TotalNotes_HiHat = 0; + this.TotalNotes_LeftPedal = 0; + this.TotalNotes_Snare = 0; + this.TotalNotes_Bass = 0; + this.TotalNotes_HighTom = 0; + this.TotalNotes_LowTom = 0; + this.TotalNotes_FloorTom = 0; + this.TotalNotes_RightCymbal = 0; + this.PreImage = ""; + this.Artist = ""; + this.PreSound = ""; + } + + // ICloneable 実装 + public Song04 Clone() + { + return (Song04) this.MemberwiseClone(); + } + object ICloneable.Clone() + { + return this.Clone(); + } + + /// + /// テーブルのカラム部分を列挙したSQL。 + /// + public static readonly string ColumnsList = + @"( HashId NVARCHAR NOT NULL PRIMARY KEY" + + @", Title NVARCHAR NOT NULL" + + @", Path NVARCHAR NOT NULL UNIQUE" + + @", LastWriteTime NVARCHAR NOT NULL" + + @", Level REAL NOT NULL CHECK(0.0 <= Level AND Level < 10.0)" + + @", MinBPM REAL" + + @", MaxBPM REAL" + + @", TotalNotes_LeftCymbal INTEGER NOT NULL" + + @", TotalNotes_HiHat INTEGER NOT NULL" + + @", TotalNotes_LeftPedal INTEGER NOT NULL" + + @", TotalNotes_Snare INTEGER NOT NULL" + + @", TotalNotes_Bass INTEGER NOT NULL" + + @", TotalNotes_HighTom INTEGER NOT NULL" + + @", TotalNotes_LowTom INTEGER NOT NULL" + + @", TotalNotes_FloorTom INTEGER NOT NULL" + + @", TotalNotes_RightCymbal INTEGER NOT NULL" + + @", PreImage NVARCHAR" + + @", Artist NVARCHAR" + + @", PreSound NVARCHAR" + + @")"; + } +} diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/SongDB.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/SongDB.cs" similarity index 70% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/SongDB.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/SongDB.cs" index 949ef18..cee5111 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/SongDB.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/SongDB.cs" @@ -11,20 +11,24 @@ namespace DTXMania.データベース.曲 { using Song01 = old.Song01; using Song02 = old.Song02; - using Song = Song03; // 最新バージョンを指定(1/2)。 + using Song03 = old.Song03; + using Song = Song04; // 最新バージョンを指定(1/2)。 /// /// 曲データベースに対応するエンティティクラス。 /// class SongDB : SQLiteDBBase { - public const long VERSION = 3; // 最新バージョンを指定(2/2)。 + public const long VERSION = 4; // 最新バージョンを指定(2/2)。 + + public static readonly VariablePath 曲DBファイルパス = @"$(AppData)SongDB.sqlite3"; public Table Songs => base.DataContext.GetTable(); + public SongDB() - : base( @"$(AppData)SongDB.sqlite3", VERSION ) + : base( 曲DBファイルパス, VERSION ) { } @@ -54,8 +58,8 @@ protected override void データベースのアップグレードマイグレ { switch( 移行元DBバージョン ) { - case 2: - #region " 2 → 3 " + case 1: + #region " 1 → 2 " //---------------- this.DataContext.ExecuteCommand( "PRAGMA foreign_keys = OFF" ); this.DataContext.SubmitChanges(); @@ -64,7 +68,7 @@ protected override void データベースのアップグレードマイグレ try { // テータベースをアップデートしてデータを移行する。 - this.DataContext.ExecuteCommand( $"CREATE TABLE new_Songs {Song03.ColumnsList}" ); + this.DataContext.ExecuteCommand( $"CREATE TABLE new_Songs {Song02.ColumnsList}" ); this.DataContext.ExecuteCommand( $"INSERT INTO new_Songs SELECT *,null FROM Songs" ); // 追加されたカラムは null this.DataContext.ExecuteCommand( $"DROP TABLE Songs" ); this.DataContext.ExecuteCommand( $"ALTER TABLE new_Songs RENAME TO Songs" ); @@ -72,44 +76,48 @@ protected override void データベースのアップグレードマイグレ this.DataContext.SubmitChanges(); // すべてのレコードについて、追加されたカラムを更新する。 - var song03s = base.DataContext.GetTable(); - foreach( var song03 in song03s ) + var song02s = base.DataContext.GetTable(); + foreach( var song02 in song02s ) { var score = (SSTFormatCurrent.スコア) null; - var vpath = new VariablePath( song03.Path ); + var vpath = new VariablePath( song02.Path ); - // スコアを読み込む + // スコアを読み込む score = SSTFormatCurrent.スコア.ファイルから生成する( vpath.変数なしパス ); - // Artist カラムの更新。 - if( score.アーティスト名.Nullでも空でもない() ) + // PreImage カラムの更新。 + if( score.プレビュー画像ファイル名.Nullでも空でもない() ) { - song03.Artist = score.アーティスト名; + // プレビュー画像は、曲ファイルからの相対パス。 + song02.PreImage = Path.Combine( Path.GetDirectoryName( vpath.変数なしパス ), score.プレビュー画像ファイル名 ); } else { - song03.Artist = ""; // null不可 + song02.PreImage = + ( from ファイル名 in Directory.GetFiles( Path.GetDirectoryName( vpath.変数なしパス ) ) + where _対応するサムネイル画像名.Any( thumbファイル名 => ( Path.GetFileName( ファイル名 ).ToLower() == thumbファイル名 ) ) + select ファイル名 ).FirstOrDefault(); } } this.DataContext.SubmitChanges(); // 成功。 transaction.Commit(); - Log.Info( "Songs テーブルをアップデートしました。[2→3]" ); + Log.Info( "Songs テーブルをアップデートしました。[1→2]" ); } catch { // 失敗。 transaction.Rollback(); - Log.ERROR( "Songs テーブルのアップデートに失敗しました。[2→3]" ); + Log.ERROR( "Songs テーブルのアップデートに失敗しました。[1→2]" ); } } //---------------- #endregion break; - case 1: - #region " 1 → 2 " + case 2: + #region " 2 → 3 " //---------------- this.DataContext.ExecuteCommand( "PRAGMA foreign_keys = OFF" ); this.DataContext.SubmitChanges(); @@ -118,7 +126,7 @@ protected override void データベースのアップグレードマイグレ try { // テータベースをアップデートしてデータを移行する。 - this.DataContext.ExecuteCommand( $"CREATE TABLE new_Songs {Song02.ColumnsList}" ); + this.DataContext.ExecuteCommand( $"CREATE TABLE new_Songs {Song03.ColumnsList}" ); this.DataContext.ExecuteCommand( $"INSERT INTO new_Songs SELECT *,null FROM Songs" ); // 追加されたカラムは null this.DataContext.ExecuteCommand( $"DROP TABLE Songs" ); this.DataContext.ExecuteCommand( $"ALTER TABLE new_Songs RENAME TO Songs" ); @@ -126,40 +134,87 @@ protected override void データベースのアップグレードマイグレ this.DataContext.SubmitChanges(); // すべてのレコードについて、追加されたカラムを更新する。 - var song02s = base.DataContext.GetTable(); - foreach( var song02 in song02s ) + var song03s = base.DataContext.GetTable(); + foreach( var song03 in song03s ) { var score = (SSTFormatCurrent.スコア) null; - var vpath = new VariablePath( song02.Path ); + var vpath = new VariablePath( song03.Path ); - // スコアを読み込む + // スコアを読み込む score = SSTFormatCurrent.スコア.ファイルから生成する( vpath.変数なしパス ); - // PreImage カラムの更新。 - if( score.プレビュー画像ファイル名.Nullでも空でもない() ) + // Artist カラムの更新。 + if( score.アーティスト名.Nullでも空でもない() ) { - // プレビュー画像は、曲ファイルからの相対パス。 - song02.PreImage = Path.Combine( Path.GetDirectoryName( vpath.変数なしパス ), score.プレビュー画像ファイル名 ); + song03.Artist = score.アーティスト名; } else { - song02.PreImage = - ( from ファイル名 in Directory.GetFiles( Path.GetDirectoryName( vpath.変数なしパス ) ) - where _対応するサムネイル画像名.Any( thumbファイル名 => ( Path.GetFileName( ファイル名 ).ToLower() == thumbファイル名 ) ) - select ファイル名 ).FirstOrDefault(); + song03.Artist = ""; // null不可 } } this.DataContext.SubmitChanges(); // 成功。 transaction.Commit(); - Log.Info( "Songs テーブルをアップデートしました。[1→2]" ); + Log.Info( "Songs テーブルをアップデートしました。[2→3]" ); } catch { // 失敗。 transaction.Rollback(); - Log.ERROR( "Songs テーブルのアップデートに失敗しました。[1→2]" ); + Log.ERROR( "Songs テーブルのアップデートに失敗しました。[2→3]" ); + } + } + //---------------- + #endregion + break; + + case 3: + #region " 3 → 4 " + //---------------- + // 変更点: + // ・PreImage カラムの内容を、絶対パスから、曲譜面ファイルからの相対パスに変更。 + // ・PreSound カラムを追加。 + this.DataContext.SubmitChanges(); + using( var transaction = this.Connection.BeginTransaction() ) + { + try + { + // (1) データベースにカラム PreSound を追加する。 + this.DataContext.ExecuteCommand( "ALTER TABLE Songs ADD COLUMN PreSound NVARCHAR" ); + this.DataContext.SubmitChanges(); + + // (2) すべてのレコードについて、変更のあったカラムを更新する。 + var songs = this.DataContext.GetTable(); + foreach( var song in songs ) + { + // スコアを読み込む + var score = (SSTFormatCurrent.スコア) null; + var vpath = new VariablePath( song.Path ); + score = SSTFormatCurrent.スコア.ファイルから生成する( vpath.変数なしパス, ヘッダだけ: true ); + + // PreImage フィールドを更新 + song.PreImage = score.プレビュー画像ファイル名; + if( song.PreImage.Nullでも空でもない() && Path.IsPathRooted( song.PreImage ) ) + song.PreImage = FDK.Folder.絶対パスを相対パスに変換する( Path.GetDirectoryName( song.Path ), song.PreImage ); + + // PreSound フィールドを更新。 + song.PreSound = score.プレビュー音声ファイル名; + if( song.PreSound.Nullでも空でもない() && Path.IsPathRooted( song.PreSound ) ) + song.PreSound = FDK.Folder.絶対パスを相対パスに変換する( Path.GetDirectoryName( song.Path ), song.PreSound ); + } + this.DataContext.SubmitChanges(); + + // 成功。 + transaction.Commit(); + Log.Info( $"Songs テーブルをアップデートしました。[{移行元DBバージョン}→{移行元DBバージョン+1}]" ); + } + catch + { + // 失敗。 + transaction.Rollback(); + Log.ERROR( $"Songs テーブルのアップデートに失敗しました。[{移行元DBバージョン}→{移行元DBバージョン+1}]" ); } } //---------------- diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song01.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song01.cs" similarity index 100% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song01.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song01.cs" diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song02.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song02.cs" similarity index 100% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song02.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song02.cs" diff --git "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/Song03.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song03.cs" similarity index 97% rename from "DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/Song03.cs" rename to "DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song03.cs" index 5ea00cb..533de35 100644 --- "a/DTXMania/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/Song03.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\207\343\203\274\343\202\277\343\203\231\343\203\274\343\202\271/\346\233\262/old/Song03.cs" @@ -4,7 +4,7 @@ using System.Diagnostics; using System.Linq; -namespace DTXMania.データベース.曲 +namespace DTXMania.データベース.曲.old { /// /// 曲テーブルのエンティティクラス。 @@ -118,7 +118,8 @@ class Song03 : ICloneable public int TotalNotes_RightCymbal { get; set; } /// - /// 曲のプレビュー画像。 + /// 曲のプレビュー画像ファイルのパス。 + /// 曲譜面ファイル()からの相対パス。 /// [Column( DbType = "NVARCHAR" )] public string PreImage { get; set; } diff --git "a/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\347\256\241\347\220\206.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\347\256\241\347\220\206.cs" index ed88c4a..28c63e3 100644 --- "a/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\347\256\241\347\220\206.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\347\256\241\347\220\206.cs" @@ -4,7 +4,7 @@ using System.Linq; using FDK; -using User = DTXMania.データベース.ユーザ.User06; +using User = DTXMania.データベース.ユーザ.User07; namespace DTXMania.設定 { diff --git "a/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\350\250\255\345\256\232.cs" "b/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\350\250\255\345\256\232.cs" index c48a08b..f607d78 100644 --- "a/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\350\250\255\345\256\232.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\343\203\246\343\203\274\343\202\266\350\250\255\345\256\232.cs" @@ -6,7 +6,7 @@ using DTXMania.データベース.ユーザ; using DTXMania.ステージ.演奏; -using User = DTXMania.データベース.ユーザ.User06; +using User = DTXMania.データベース.ユーザ.User07; namespace DTXMania.設定 { @@ -28,26 +28,20 @@ class ユーザ設定 public bool 全画面モードである { - get - => ( 0 != this._User.Fullscreen ); - set - => this._User.Fullscreen = value ? 1 : 0; + get => ( 0 != this._User.Fullscreen ); + set => this._User.Fullscreen = value ? 1 : 0; } public double 譜面スクロール速度 { - get - => this._User.ScrollSpeed; - set - => this._User.ScrollSpeed = value; + get => this._User.ScrollSpeed; + set => this._User.ScrollSpeed = value; } public bool シンバルフリーモードである { - get - => ( 0 != this._User.CymbalFree ); - set - => this._User.CymbalFree = value ? 1 : 0; + get => ( 0 != this._User.CymbalFree ); + set => this._User.CymbalFree = value ? 1 : 0; } public bool AutoPlayがすべてONである @@ -74,10 +68,8 @@ public bool AutoPlayがすべてONである public PlayMode 演奏モード { - get - => (PlayMode) this._User.PlayMode; - set - => this._User.PlayMode = (int) value; + get => (PlayMode) this._User.PlayMode; + set => this._User.PlayMode = (int) value; } public 表示レーンの左右 表示レーンの左右 @@ -100,18 +92,20 @@ public 表示レーンの左右 表示レーンの左右 public bool ドラムの音を発声する { - get - => ( 0 != this._User.DrumSound ); - set - => this._User.DrumSound = value ? 1 : 0; + get => ( 0 != this._User.DrumSound ); + set => this._User.DrumSound = value ? 1 : 0; } public string レーン配置 { - get - => this._User.LaneType; - set - => this._User.LaneType = value; + get => this._User.LaneType; + set => this._User.LaneType = value; + } + + public int レーンの透明度 + { + get => this._User.LaneTrans; + set => this._User.LaneTrans = value; } diff --git "a/DTXMania/\350\250\255\345\256\232/\346\233\262DB.cs" "b/DTXMania/\350\250\255\345\256\232/\346\233\262DB.cs" index b2dafa9..6b76839 100644 --- "a/DTXMania/\350\250\255\345\256\232/\346\233\262DB.cs" +++ "b/DTXMania/\350\250\255\345\256\232/\346\233\262DB.cs" @@ -11,7 +11,7 @@ using DTXMania.データベース.曲; using DTXMania.ステージ.演奏; -using Song = DTXMania.データベース.曲.Song03; +using Song = DTXMania.データベース.曲.Song04; using Record = DTXMania.データベース.ユーザ.Record06; namespace DTXMania.設定 @@ -201,7 +201,7 @@ public static void 曲を追加または更新する( VariablePath 曲ファイ } catch( Exception e ) { - Log.ERROR( $"曲DBへの曲の追加に失敗しました。({e.Message})[{曲ファイルパス.変数付きパス}]" ); + Log.ERROR( $"曲DBへの曲の追加に失敗しました。({VariablePath.絶対パスをフォルダ変数付き絶対パスに変換して返す( e.Message )})[{曲ファイルパス.変数付きパス}]" ); //throw; } } diff --git a/DTXManiaTests/DTXManiaTests.csproj b/DTXManiaTests/DTXManiaTests.csproj index 4f96aa2..d743ff8 100644 --- a/DTXManiaTests/DTXManiaTests.csproj +++ b/DTXManiaTests/DTXManiaTests.csproj @@ -1,6 +1,6 @@  - + Debug AnyCPU @@ -62,12 +62,15 @@ - ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll - ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + ..\packages\YamlDotNet.5.3.0\lib\net45\YamlDotNet.dll + @@ -81,12 +84,17 @@ + {736be388-5ec5-4bf9-838b-8580c9a8da9c} DTXMania + + {0e35c4ac-6e28-4a09-a6ce-05d177800051} + FDK + {93b53767-a0a5-431c-9ec7-b23dbffb10ec} SSTFormat @@ -120,10 +128,10 @@ このプロジェクトは、このコンピューター上にない NuGet パッケージを参照しています。それらのパッケージをダウンロードするには、[NuGet パッケージの復元] を使用します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。見つからないファイルは {0} です。 - - + + - + 未選択状態になる。 + // イベント発火。 + this.SelectionChanged?.Invoke( this, ( + ( 0 <= this.SelectedIndex ) ? this[ this.SelectedIndex ] : null, + ( 0 <= 変更前のインデックス番号 ) ? this[ 変更前のインデックス番号 ] : null) ); + return true; } + /// /// 要素を選択する。 /// @@ -79,17 +98,30 @@ public bool SelectItem( T 要素 ) /// 選択または未選択状態にできたら true、できなかったら false。 public bool SelectItem( Func selector ) { + int 変更前のインデックス番号 = this.SelectedIndex; + + this.SelectedIndex = -1; // 未選択状態 for( int i = 0; i < this.Count; i++ ) { if( selector( this[ i ] ) ) { this.SelectedIndex = i; - return true; + break; } } - this.SelectedIndex = -1; // 未選択状態 - return false; + if( 変更前のインデックス番号 != this.SelectedIndex ) + { + // イベント発火。 + this.SelectionChanged?.Invoke( this, ( + ( 0 <= this.SelectedIndex ) ? this[ this.SelectedIndex ] : null, + ( 0 <= 変更前のインデックス番号 ) ? this[ 変更前のインデックス番号 ] : null) ); + return true; + } + else + { + return false; + } } /// @@ -101,8 +133,14 @@ public bool SelectFirst() if( 0 == this.Count ) // リストが空なら return false; // false を返す。 + int 変更前のインデックス番号 = this.SelectedIndex; this.SelectedIndex = 0; + // イベント発火。 + this.SelectionChanged?.Invoke( this, ( + ( 0 <= this.SelectedIndex ) ? this[ this.SelectedIndex ] : null, + ( 0 <= 変更前のインデックス番号 ) ? this[ 変更前のインデックス番号 ] : null) ); + return true; } @@ -115,8 +153,14 @@ public bool SelectLast() if( 0 == this.Count ) // リストが空なら return false; // false を返す。 + int 変更前のインデックス番号 = this.SelectedIndex; this.SelectedIndex = this.Count - 1; + // イベント発火。 + this.SelectionChanged?.Invoke( this, ( + ( 0 <= this.SelectedIndex ) ? this[ this.SelectedIndex ] : null, + ( 0 <= 変更前のインデックス番号 ) ? this[ 変更前のインデックス番号 ] : null) ); + return true; } @@ -133,6 +177,8 @@ public bool SelectNext( bool Loop = false ) return false; // false を返す。 } + int 変更前のインデックス番号 = this.SelectedIndex; + if( this.Count - 1 <= this.SelectedIndex ) // すでに末尾に位置してたりする場合は { if( Loop ) @@ -145,6 +191,11 @@ public bool SelectNext( bool Loop = false ) this.SelectedIndex++; } + // イベント発火。 + this.SelectionChanged?.Invoke( this, ( + ( 0 <= this.SelectedIndex ) ? this[ this.SelectedIndex ] : null, + ( 0 <= 変更前のインデックス番号 ) ? this[ 変更前のインデックス番号 ] : null) ); + return true; } @@ -161,6 +212,8 @@ public bool SelectPrev( bool Loop = false ) return false; // false を返す。 } + int 変更前のインデックス番号 = this.SelectedIndex; + if( 0 == this.SelectedIndex ) // すでに先頭に位置してたりする場合は { if( Loop ) @@ -173,6 +226,11 @@ public bool SelectPrev( bool Loop = false ) this.SelectedIndex--; } + // イベント発火。 + this.SelectionChanged?.Invoke( this, ( + ( 0 <= this.SelectedIndex ) ? this[ this.SelectedIndex ] : null, + ( 0 <= 変更前のインデックス番号 ) ? this[ 変更前のインデックス番号 ] : null) ); + return true; } } diff --git a/FDK/UI/Button.cs b/FDK/UI/Button.cs index edbf196..2936529 100644 --- a/FDK/UI/Button.cs +++ b/FDK/UI/Button.cs @@ -47,7 +47,7 @@ public Button( string ラベル, VariablePath 通常時画像ファイル, Varia this.広い部分の描画方法 = 広い部分の描画方法種別.拡大縮小描画; this.ラベル = ラベル; - this.子を追加する( this._ボタンラベル = new Label( + this.子Activityを追加する( this._ボタンラベル = new Label( this.ラベル, サイズdpx ) { ParagraphAlignment = ParagraphAlignment.Center, diff --git a/FDK/UI/DropDownList.cs b/FDK/UI/DropDownList.cs index 48858c7..d62e3c4 100644 --- a/FDK/UI/DropDownList.cs +++ b/FDK/UI/DropDownList.cs @@ -29,7 +29,7 @@ public SelectableList 項目リスト : base( サイズdpx, 位置dpx ) { var 表示欄マージンdpx = 矩形リスト.Margin変換( 表示欄セル矩形[ "Margin" ].Value ); - this.子を追加する( this._表示欄 = new TextArea( + this.子Activityを追加する( this._表示欄 = new TextArea( 表示欄画像ファイル, 表示欄セル矩形, new Size2F( @@ -44,7 +44,7 @@ public SelectableList 項目リスト this._表示欄.MouseDown += this._表示欄_MouseDown; var 選択欄マージンdpx = 矩形リスト.Margin変換( 選択欄セル矩形[ "Margin" ].Value ); - this.子を追加する( this._選択欄 = new ListView( + this.子Activityを追加する( this._選択欄 = new ListView( 選択欄画像ファイル, 選択欄セル矩形, new Size2F( @@ -62,7 +62,7 @@ public SelectableList 項目リスト var ボタンマージンdpx = 矩形リスト.Margin変換( アローボタンセル矩形[ "Margin" ].Value ); var ボタン幅dpx = Math.Max( 0f, this._表示欄.クライアント矩形dpx.Height - ボタンマージンdpx.Top - ボタンマージンdpx.Bottom ); - this.子を追加する( this._アローボタン = new Button( + this.子Activityを追加する( this._アローボタン = new Button( "-", アローボタン通常時画像ファイル, アローボタン押下時画像ファイル, diff --git a/FDK/UI/Element.cs b/FDK/UI/Element.cs index e3ab059..8f4252e 100644 --- a/FDK/UI/Element.cs +++ b/FDK/UI/Element.cs @@ -69,7 +69,7 @@ public virtual RectangleF クライアント矩形のスクリーン座標dpx { var rc = new RectangleF( this.位置dpx.X, this.位置dpx.Y, this.サイズdpx.Width, this.サイズdpx.Height ); - if( ( null != this.親 ) && ( this.親 is Element 親要素 ) ) + if( ( null != this.親Activity ) && ( this.親Activity is Element 親要素 ) ) { var parentRect = 親要素.クライアント矩形のスクリーン座標dpx; rc.Offset( parentRect.X, parentRect.Y ); @@ -134,7 +134,7 @@ public Element( Size2F サイズdpx, Vector2? 位置dpx = null ) /// /// このクラスだけでなくこのクラスからの派生クラスすべてで実行する必要があるコードは、 ではなくここで実行する。 /// - public override void 活性化する() + public new void 活性化する() { this._設計画面サイズdpx = グラフィックデバイス.Instance.設計画面サイズ; @@ -160,7 +160,7 @@ public void フォーカスする( UIEventArgs e ) { // Element ツリーのルート要素を取得。 var Root = this; - while( ( null != Root.親 ) && ( Root.親 is Element 親要素 ) ) + while( ( null != Root.親Activity ) && ( Root.親Activity is Element 親要素 ) ) Root = 親要素; // 自分をフォーカスすることをルート要素に通知。 @@ -179,7 +179,7 @@ public virtual void 描画する( DCEventArgs e ) var クリッピング後のウィンドウ矩形dpx = this.ウィンドウ矩形dpx; - if( ( null != this.親 ) && ( this.親 is Element 親要素 ) ) + if( ( null != this.親Activity ) && ( this.親Activity is Element 親要素 ) ) { // 親があるなら、親のクライアント矩形(スクリーン座標)でクリッピング。 クリッピング後のウィンドウ矩形dpx = RectangleF.Intersect( クリッピング後のウィンドウ矩形dpx, 親要素.クライアント矩形のスクリーン座標dpx ); @@ -205,9 +205,9 @@ public virtual void 描画する( DCEventArgs e ) } ); // クライアント矩形内に、子要素を昇順に描画する。 - for( int i = 0; i < this.子リスト.Count; i++ ) + for( int i = 0; i < this.子Activityリスト.Count; i++ ) { - if( this.子リスト[ i ] is Element 子要素 ) + if( this.子Activityリスト[ i ] is Element 子要素 ) { if( 子要素.活性化していない ) 子要素.活性化する(); @@ -229,9 +229,9 @@ public void InvokeKeyDown( KeyEventArgs e ) else { // 子要素を降順(描画順の逆)にチェックする。 - for( int i = this.子リスト.Count - 1; i >= 0; i-- ) + for( int i = this.子Activityリスト.Count - 1; i >= 0; i-- ) { - if( this.子リスト[ i ] is Element 子要素 ) + if( this.子Activityリスト[ i ] is Element 子要素 ) 子要素.InvokeKeyDown( e ); } } @@ -370,9 +370,9 @@ bool すべての子要素のヒットチェック( Element 要素 ) bool キャッチした = false; // 子要素を降順(描画順の逆)にチェックする。 - for( int i = 要素.子リスト.Count - 1; i >= 0; i-- ) + for( int i = 要素.子Activityリスト.Count - 1; i >= 0; i-- ) { - if( 要素.子リスト[ i ] is Element 子要素 && + if( 要素.子Activityリスト[ i ] is Element 子要素 && 子要素.可視 && //子要素.ヒットチェックあり && // ヒットチェックなしの場合でも、その子孫はチェック対象。 子要素.ヒットチェック( マウス位置dpx ) ) @@ -443,7 +443,7 @@ private void _MouseEnterまたはMouseLeaveが発生するかチェックする( // (2) すべての子要素についてチェック。 //   親が不可視なら子はチェックしないが、親がヒットチェックなしでも子はチェックする。 - foreach( var 子 in this.子リスト ) + foreach( var 子 in this.子Activityリスト ) { if( 子 is Element 子要素 ) { @@ -458,9 +458,9 @@ private bool _MouseMoveのヒットチェック( UIMouseEventArgs e ) bool キャッチした = false; // すべての子について深さ優先で降順(描画順の逆)にヒットチェック。 - for( int i = this.子リスト.Count - 1; i >= 0; i-- ) + for( int i = this.子Activityリスト.Count - 1; i >= 0; i-- ) { - if( this.子リスト[ i ] is Element 子要素 && 子要素.可視 ) + if( this.子Activityリスト[ i ] is Element 子要素 && 子要素.可視 ) { if( 子要素._MouseMoveのヒットチェック( e ) ) // 深さ優先(子優先); ヒットチェックなしでも子孫はチェックする。 { @@ -493,7 +493,7 @@ private bool _MouseMoveのヒットチェック( UIMouseEventArgs e ) private void _フォーカスを通知する( Element 対象要素, UIEventArgs e ) { // すべての子要素について... - foreach( Element 子要素 in this.子リスト.Where( ( 子 ) => ( 子 is Element ) ) ) + foreach( Element 子要素 in this.子Activityリスト.Where( ( 子 ) => ( 子 is Element ) ) ) { bool 子要素はフォーカス対象である = ( 子要素 == 対象要素 ); diff --git a/FDK/UI/Framework.cs b/FDK/UI/Framework.cs index 7ee4088..cff8efb 100644 --- a/FDK/UI/Framework.cs +++ b/FDK/UI/Framework.cs @@ -21,7 +21,7 @@ public RootElement Root public Framework() { - this.子を追加する( this.Root = new RootElement() { + this.子Activityを追加する( this.Root = new RootElement() { 位置dpx = new Vector2( 0f, 0f ), サイズdpx = グラフィックデバイス.Instance.設計画面サイズ, 背景色 = Color.Transparent, @@ -37,7 +37,7 @@ public void 初期化する() if( this.活性化している ) this.Root.非活性化する(); - this.Root.子リストをクリアする(); + this.Root.子Activityリストをクリアする(); if( this.活性化している ) this.Root.活性化する(); diff --git a/FDK/UI/Image.cs b/FDK/UI/Image.cs index b36b2a7..abecda6 100644 --- a/FDK/UI/Image.cs +++ b/FDK/UI/Image.cs @@ -37,14 +37,14 @@ public Image( VariablePath imagePath, Vector2? 位置dpx = null, Vector2? 拡大 this.位置dpx = 位置dpx ?? Vector2.Zero; this.拡大率 = 拡大率 ?? Vector2.One; - this.子を追加する( this._画像 = new 描画可能画像( imagePath ) ); + this.子Activityを追加する( this._画像 = new 描画可能画像( imagePath ) ); } public Image( Size2F サイズdpx, Vector2? 位置dpx = null, Vector2? 拡大率 = null ) { this.位置dpx = 位置dpx ?? Vector2.Zero; this.拡大率 = 拡大率 ?? Vector2.One; - this.子を追加する( this._画像 = new 描画可能画像( this.サイズdpx ) ); + this.子Activityを追加する( this._画像 = new 描画可能画像( this.サイズdpx ) ); } public void 画像へ描画する( Action action ) diff --git a/FDK/UI/Label.cs b/FDK/UI/Label.cs index ada0133..d7cd1d9 100644 --- a/FDK/UI/Label.cs +++ b/FDK/UI/Label.cs @@ -135,7 +135,7 @@ public InterpolationMode 補正モード public Label( string テキスト, Size2F サイズdpx, Vector2? 位置dpx = null ) :base( サイズdpx, 位置dpx ) { - this.子を追加する( this._文字列画像 = new 文字列画像() { + this.子Activityを追加する( this._文字列画像 = new 文字列画像() { フォント名 = "メイリオ", フォント幅 = FontWeight.Normal, フォントスタイル = FontStyle.Normal, diff --git a/FDK/UI/ListView.cs b/FDK/UI/ListView.cs index 58e6a5a..745f4da 100644 --- a/FDK/UI/ListView.cs +++ b/FDK/UI/ListView.cs @@ -68,7 +68,7 @@ public ListView( VariablePath 画像ファイル, 矩形リスト セル矩形, this._先頭に表示されている項目番号 = 0; this._フォーカスされている項目番号 = -1; - this.子を追加する( this.ウィンドウ画像 = new 描画可能画像( this.サイズdpx ) ); + this.子Activityを追加する( this.ウィンドウ画像 = new 描画可能画像( this.サイズdpx ) ); } public void 項目を追加する( ListViewItem item ) @@ -76,7 +76,7 @@ public void 項目を追加する( ListViewItem item ) item.サイズdpx = new Size2F( this.クライアント矩形dpx.Width, this.クライアント矩形dpx.Height ); this.項目リスト.Add( item ); - this.子を追加する( item ); + this.子Activityを追加する( item ); } /// @@ -187,8 +187,8 @@ protected override void OnPaint( DCEventArgs e ) this.サイズdpx = 高さに合わせたサイズdpx; this.ウィンドウ画像.非活性化する(); - this.子を削除する( this.ウィンドウ画像 ); - this.子を追加する( this.ウィンドウ画像 = new 描画可能画像( this.サイズdpx ) ); + this.子Activityを削除する( this.ウィンドウ画像 ); + this.子Activityを追加する( this.ウィンドウ画像 = new 描画可能画像( this.サイズdpx ) ); this.ウィンドウ画像.活性化する(); } } @@ -201,7 +201,7 @@ protected override void OnPaint( DCEventArgs e ) dcw.Clear( Color.Transparent ); // 全項目を不可視で初期化。 - foreach( var 子 in this.子リスト ) + foreach( var 子 in this.子Activityリスト ) { if( 子 is ListViewItem item ) item.可視 = false; diff --git a/FDK/UI/TextArea.cs b/FDK/UI/TextArea.cs index 232910c..7884574 100644 --- a/FDK/UI/TextArea.cs +++ b/FDK/UI/TextArea.cs @@ -20,7 +20,7 @@ public string テキスト public TextArea( VariablePath 画像ファイル, 矩形リスト セル矩形, Size2F サイズdpx, Vector2? 位置dpx = null, float fontSize = 18f ) : base( 画像ファイル, セル矩形, サイズdpx, 位置dpx ) { - this.子を追加する( this.ラベル = new Label( + this.子Activityを追加する( this.ラベル = new Label( "テキスト\nエリア", サイズdpx ) { フォントサイズpt = fontSize, diff --git a/FDK/UI/Window.cs b/FDK/UI/Window.cs index f40ae61..9db8ffe 100644 --- a/FDK/UI/Window.cs +++ b/FDK/UI/Window.cs @@ -75,15 +75,15 @@ public Window( VariablePath 画像ファイル, 矩形リスト セル矩形, Si this._最大左枠幅dpx = Math.Max( this._左上矩形.Width, Math.Max( this._左辺矩形.Width, this._左下矩形.Width ) ); this._最大右枠幅dpx = Math.Max( this._右上矩形.Width, Math.Max( this._右辺矩形.Width, this._右下矩形.Width ) ); - this.子を追加する( this.通常時セル画像 = new 画像( 画像ファイル ) ); + this.子Activityを追加する( this.通常時セル画像 = new 画像( 画像ファイル ) ); if( null != 押下時画像ファイル ) - this.子を追加する( this.押下時セル画像 = new 画像( 押下時画像ファイル ) ); // オプション + this.子Activityを追加する( this.押下時セル画像 = new 画像( 押下時画像ファイル ) ); // オプション if( null != フォーカス時画像ファイル ) - this.子を追加する( this.フォーカス時セル画像 = new 画像( フォーカス時画像ファイル ) ); // オプション + this.子Activityを追加する( this.フォーカス時セル画像 = new 画像( フォーカス時画像ファイル ) ); // オプション - this.子を追加する( this.全体画像 = new 描画可能画像( this.サイズdpx_枠込み ) ); + this.子Activityを追加する( this.全体画像 = new 描画可能画像( this.サイズdpx_枠込み ) ); } protected override void On活性化() @@ -176,8 +176,8 @@ protected override void OnPaint( DCEventArgs e ) if( this.サイズdpx_枠込み != this.全体画像.サイズ ) { this.全体画像.非活性化する(); - this.子を削除する( this.全体画像 ); - this.子を追加する( this.全体画像 = new 描画可能画像( this.サイズdpx_枠込み ) ); + this.子Activityを削除する( this.全体画像 ); + this.子Activityを追加する( this.全体画像 = new 描画可能画像( this.サイズdpx_枠込み ) ); this.全体画像.活性化する(); } diff --git a/FDK/VariablePath.cs b/FDK/VariablePath.cs index 6b3de47..71098f6 100644 --- a/FDK/VariablePath.cs +++ b/FDK/VariablePath.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using YamlDotNet.Serialization; namespace FDK { @@ -13,33 +14,29 @@ namespace FDK /// /// 型と string は、暗黙的に相互変換できる。 /// - public class VariablePath : FDK.Folder + public class VariablePath : FDK.Folder, IYamlConvertible { /// /// 管理しているパスにフォルダ変数が含まれている場合、それを展開して返す。 /// - public string 変数なしパス - { - get; - protected set; - } = null; + public string 変数なしパス { get; protected set; } = null; /// /// 管理しているパスにフォルダ変数に置き換えられる場所があるなら、それを置き換えて返す。 /// - public string 変数付きパス + public string 変数付きパス { get; protected set; } = null; + + public VariablePath() { - get; - protected set; - } = null; + // Yamlデシリアライズのためにデフォルトコンストラクタが必要。 + } /// /// 管理したいパス文字列。変数付き・変数なしのどちらを指定してもいい。 /// public VariablePath( string パス ) { - this.変数なしパス = Folder.絶対パスに含まれるフォルダ変数を展開して返す( パス ); - this.変数付きパス = Folder.絶対パスをフォルダ変数付き絶対パスに変換して返す( this.変数なしパス ); + this._初期化( パス ); } /// @@ -60,5 +57,26 @@ public VariablePath( string パス ) /// public override string ToString() => this.変数付きパス; + + + private void _初期化( string パス ) + { + this.変数なしパス = Folder.絶対パスに含まれるフォルダ変数を展開して返す( パス ); + this.変数付きパス = Folder.絶対パスをフォルダ変数付き絶対パスに変換して返す( this.変数なしパス ); + } + + + // Yaml から変換する + void IYamlConvertible.Read( YamlDotNet.Core.IParser parser, Type expectedType, ObjectDeserializer nestedObjectDeserializer ) + { + var vpath = (string) nestedObjectDeserializer( typeof( string ) ); + this._初期化( vpath ); + } + + // Yaml に変換する + void IYamlConvertible.Write( YamlDotNet.Core.IEmitter emitter, ObjectSerializer nestedObjectSerializer ) + { + nestedObjectSerializer( this.変数付きパス ); + } } } diff --git a/FDK/packages.config b/FDK/packages.config index ddfe53c..a9813de 100644 --- a/FDK/packages.config +++ b/FDK/packages.config @@ -1,8 +1,7 @@  - - + @@ -15,4 +14,5 @@ + \ No newline at end of file diff --git "a/FDK/\343\202\253\343\202\246\343\203\263\343\202\277/FPS.cs" "b/FDK/\343\202\253\343\202\246\343\203\263\343\202\277/FPS.cs" index 27e2b5f..85f2bf4 100644 --- "a/FDK/\343\202\253\343\202\246\343\203\263\343\202\277/FPS.cs" +++ "b/FDK/\343\202\253\343\202\246\343\203\263\343\202\277/FPS.cs" @@ -38,7 +38,7 @@ public int 現在のVPS public FPS() { - this.子を追加する( this._FPSパラメータ = new 文字列画像() ); + this.子Activityを追加する( this._FPSパラメータ = new 文字列画像() ); this._初めてのFPS更新 = true; this._現在のFPS = 0; diff --git "a/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentGatheringTypeInspector.cs" "b/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentGatheringTypeInspector.cs" new file mode 100644 index 0000000..7e58a58 --- /dev/null +++ "b/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentGatheringTypeInspector.cs" @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using YamlDotNet.Core; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.TypeInspectors; + +namespace FDK.シリアライズ.YAML +{ + /// + /// [Description("コメント文")] で、YAML にコメントを出力するための TypeInspector。 + /// + /// + /// 使用例: + /// var serializer = new YamlDotNet.Serialization.SerializerBuilder() + /// .WithTypeInspector( inner => new FDK.シリアライズ.YAML.CommentGatheringTypeInspector( inner ) ) + /// .WithEmissionPhaseObjectGraphVisitor( args => new FDK.シリアライズ.YAML.CommentsObjectGraphVisitor( args.InnerVisitor ) ) + /// .Build(); + /// + /// + public class CommentGatheringTypeInspector : TypeInspectorSkeleton + { + private readonly ITypeInspector innerTypeDescriptor; + + public CommentGatheringTypeInspector( ITypeInspector innerTypeDescriptor ) + { + this.innerTypeDescriptor = innerTypeDescriptor ?? throw new ArgumentNullException( "innerTypeDescriptor" ); + } + + public override IEnumerable GetProperties( Type type, object container ) + { + return innerTypeDescriptor + .GetProperties( type, container ) + .Select( d => new CommentsPropertyDescriptor( d ) ); + } + + private sealed class CommentsPropertyDescriptor : IPropertyDescriptor + { + private readonly IPropertyDescriptor baseDescriptor; + + public CommentsPropertyDescriptor( IPropertyDescriptor baseDescriptor ) + { + this.baseDescriptor = baseDescriptor; + Name = baseDescriptor.Name; + } + + public string Name { get; set; } + + public Type Type { get { return baseDescriptor.Type; } } + + public Type TypeOverride + { + get { return baseDescriptor.TypeOverride; } + set { baseDescriptor.TypeOverride = value; } + } + + public int Order { get; set; } + + public ScalarStyle ScalarStyle + { + get { return baseDescriptor.ScalarStyle; } + set { baseDescriptor.ScalarStyle = value; } + } + + public bool CanWrite { get { return baseDescriptor.CanWrite; } } + + public void Write( object target, object value ) + { + baseDescriptor.Write( target, value ); + } + + public T GetCustomAttribute() where T : Attribute + { + return baseDescriptor.GetCustomAttribute(); + } + + public IObjectDescriptor Read( object target ) + { + var description = baseDescriptor.GetCustomAttribute(); + return description != null + ? new CommentsObjectDescriptor( baseDescriptor.Read( target ), description.Description ) + : baseDescriptor.Read( target ); + } + } + } +} diff --git "a/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentsObjectDescriptor.cs" "b/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentsObjectDescriptor.cs" new file mode 100644 index 0000000..0c20841 --- /dev/null +++ "b/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentsObjectDescriptor.cs" @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using YamlDotNet.Core; +using YamlDotNet.Serialization; + +namespace FDK.シリアライズ.YAML +{ + /// + /// コメント文を表すでスクリプタ。 + /// + /// + public sealed class CommentsObjectDescriptor : IObjectDescriptor + { + private readonly IObjectDescriptor innerDescriptor; + + public CommentsObjectDescriptor( IObjectDescriptor innerDescriptor, string comment ) + { + this.innerDescriptor = innerDescriptor; + this.Comment = comment; + } + + public string Comment { get; private set; } + + public object Value { get { return innerDescriptor.Value; } } + public Type Type { get { return innerDescriptor.Type; } } + public Type StaticType { get { return innerDescriptor.StaticType; } } + public ScalarStyle ScalarStyle { get { return innerDescriptor.ScalarStyle; } } + } +} diff --git "a/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentsObjectGraphVisitor.cs" "b/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentsObjectGraphVisitor.cs" new file mode 100644 index 0000000..5dd5b95 --- /dev/null +++ "b/FDK/\343\202\267\343\203\252\343\202\242\343\203\251\343\202\244\343\202\272/YAML/CommentsObjectGraphVisitor.cs" @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using YamlDotNet.Core; +using YamlDotNet.Core.Events; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.ObjectGraphVisitors; + +namespace FDK.シリアライズ.YAML +{ + /// + /// コメント文があればYAMLに出力するためのVisitor。 + /// + /// + public class CommentsObjectGraphVisitor : ChainedObjectGraphVisitor + { + public CommentsObjectGraphVisitor( IObjectGraphVisitor nextVisitor ) + : base( nextVisitor ) + { + } + + public override bool EnterMapping( IPropertyDescriptor key, IObjectDescriptor value, IEmitter context ) + { + var commentsDescriptor = value as CommentsObjectDescriptor; + if( commentsDescriptor != null && commentsDescriptor.Comment != null ) + { + context.Emit( new Comment( commentsDescriptor.Comment, false ) ); + } + + return base.EnterMapping( key, value, context ); + } + } +} diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/PolySound.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/PolySound.cs" new file mode 100644 index 0000000..c9a7a50 --- /dev/null +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/PolySound.cs" @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using CSCore; + +namespace FDK +{ + /// + /// 多重再生ができるSound。 + /// + public class PolySound : IDisposable + { + /// + /// 音量。0.0(無音)~1.0(原音)~...上限なし + /// + /// + /// このクラスではなく、クラスから参照して使用する。 + /// + public float Volume + { + get => this.サウンドリスト[ 0 ].Volume; // 代表 + set + { + float vol = Math.Max( value, 0f ); + + foreach( var sound in this.サウンドリスト ) // 全部同じ音量に + sound.Volume = vol; + } + } + + + public PolySound( SoundDevice device, ISampleSource sampleSource, int 多重度 = 4 ) + { + this.多重度 = 多重度; + this.サウンドリスト = new Sound[ 多重度 ]; + + // 多重度数だけ Sound を同じソースで生成。 + for( int i = 0; i < 多重度; i++ ) + this.サウンドリスト[ i ] = new Sound( device, sampleSource ); + + } + + public void Dispose() + { + foreach( var sound in this.サウンドリスト ) + sound.Dispose(); + + this.サウンドリスト = null; + } + + public void Play( long 再生開始位置frame = 0, bool ループ再生する = false ) + { + // サウンドを再生する。 + this.サウンドリスト[ this._次に再生するサウンドのインデックス ].Play( 再生開始位置frame, ループ再生する ); + + // サウンドローテーション。 + if( !( ループ再生する ) ) // ループ再生時はローテーションしない。 + this._次に再生するサウンドのインデックス = ( this._次に再生するサウンドのインデックス + 1 ) % this.多重度; + } + + public void Play( double 再生開始位置sec, bool ループ再生する = false ) + => this.Play( this._秒ToFrame( 再生開始位置sec ), ループ再生する ); + + public void Stop() + { + foreach( var sound in this.サウンドリスト ) + sound.Stop(); + } + + public bool いずれかが再生中である + => this.サウンドリスト.Any( ( sound ) => sound.再生中である ); + + + protected int 多重度; + + protected Sound[] サウンドリスト = null; + + + private int _次に再生するサウンドのインデックス = 0; + + private long _秒ToFrame( double 時間sec ) + => this.サウンドリスト[ 0 ].秒ToFrame( 時間sec ); + } +} diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/SampleSourceFactory.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/SampleSourceFactory.cs" index 718eadf..e88c8cd 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/SampleSourceFactory.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/SampleSourceFactory.cs" @@ -39,6 +39,22 @@ public static ISampleSource Create( SoundDevice device, VariablePath ファイ //---------------- #endregion } + if( ".wav" == 拡張子 ) + { + #region " WAV " + //---------------- + try + { + return new WavResampledOnMemoryWaveSource( ファイルパス, device.WaveFormat ) + .ToSampleSource(); + } + catch + { + // ダメだったので次へ。 + } + //---------------- + #endregion + } if( ".xa" == 拡張子 ) { #region " XA " diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sound.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sound.cs" index 4599fd7..fdff346 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sound.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sound.cs" @@ -55,6 +55,8 @@ public float Volume => this._Volume = Math.Max( value, 0 ); } + public bool IsLoop { get; set; } = false; + public Sound( SoundDevice device, ISampleSource sampleSource ) : this( device ) @@ -80,7 +82,7 @@ public void Dispose() this._DeviceRef = null; } - public void Play( long 再生開始位置frame = 0 ) + public void Play( long 再生開始位置frame = 0, bool ループ再生する = false ) { if( null == this._BaseSampleSource ) throw new InvalidOperationException( "サンプルソースが null です。" ); @@ -99,30 +101,45 @@ public void Play( long 再生開始位置frame = 0 ) } // ミキサーに追加(=再生開始)。 + this.IsLoop = ループ再生する; device.Mixer.AddSound( this ); } } - public void Play( double 再生開始位置sec ) - => this.Play( this._秒ToFrame( 再生開始位置sec ) ); + public void Play( double 再生開始位置sec, bool ループ再生する = false ) + => this.Play( this.秒ToFrame( 再生開始位置sec ), ループ再生する ); public int Read( float[] buffer, int offset, int count ) { if( null == this._BaseSampleSource ) - return 0; + return 0; // 再生終了 if( this._BaseSampleSource.Length <= this._Position ) // 最後まで再生済み、または次のストリームデータが届いていない { - Array.Clear( buffer, offset, count ); // 全部ゼロで埋めて返す。 - return count; + if( this.IsLoop ) + { + Array.Clear( buffer, offset, count ); // 全部ゼロで埋めて返す。 + this._Position = 0; // 再生をループ。 + return count; + } + else + { + return 0; // 再生終了 + } } + else + { + // 1つの BaseSampleSource を複数の Sound で共有するために、Position は Sound ごとに管理している。 + this._BaseSampleSource.Position = this._Position; + var readCount = this._BaseSampleSource.Read( buffer, offset, count ); // 読み込み。 - // 1つの BaseSampleSource を複数の Sound で共有するために、Position は Sound ごとに管理している。 - this._BaseSampleSource.Position = this._Position; - var readCount = this._BaseSampleSource.Read( buffer, offset, count ); // 読み込み。 - this._Position = this._BaseSampleSource.Position; + this._Position = this._BaseSampleSource.Position; - return readCount; + if( 0 == readCount && this.IsLoop ) + this._Position = 0; // 再生をループ。 + + return readCount; + } } public void Stop() @@ -133,17 +150,7 @@ public void Stop() } } - - private WeakReference _DeviceRef = null; - - private ISampleSource _BaseSampleSource = null; - - private long _Position = 0; - - private float _Volume = 1.0f; - - - private long _秒ToFrame( double 時間sec ) + internal long 秒ToFrame( double 時間sec ) { if( null == this._BaseSampleSource ) return 0; @@ -152,7 +159,7 @@ private long _秒ToFrame( double 時間sec ) return (long) ( 時間sec * wf.SampleRate + 0.5 ); // +0.5 で四捨五入ができる } - private double _FrameTo秒( long 時間frame ) + internal double FrameTo秒( long 時間frame ) { if( null == this._BaseSampleSource ) return 0; @@ -160,5 +167,14 @@ private double _FrameTo秒( long 時間frame ) var wf = this._BaseSampleSource.WaveFormat; return (double) 時間frame / wf.SampleRate; } + + + private WeakReference _DeviceRef = null; + + private ISampleSource _BaseSampleSource = null; + + private long _Position = 0; + + private float _Volume = 1.0f; } } diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisOnStreamingSampleSource.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisOnStreamingSampleSource.cs" index 031b3e1..aec8072 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisOnStreamingSampleSource.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisOnStreamingSampleSource.cs" @@ -37,7 +37,6 @@ public long Position public long Length => ( this.CanSeek ) ? this._vorbisReader.TotalSamples * this.WaveFormat.Channels : 0; // TotalSamples はフレーム数を返す。 - public NVorbisOnStreamingSampleSource( Stream stream, WaveFormat deviceFormat ) { if( null == stream ) diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisResampledOnMemoryWaveSource.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisResampledOnMemoryWaveSource.cs" index 29ee2ae..779cb5c 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisResampledOnMemoryWaveSource.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/NVorbisResampledOnMemoryWaveSource.cs" @@ -60,8 +60,7 @@ public NVorbisResampledOnMemoryWaveSource( Stream stream, WaveFormat deviceForma using( var vorbisSource = new NVorbisOnStreamingSampleSource( stream, deviceFormat ) ) using( var resampler = new DmoResampler( vorbisSource.ToWaveSource(), this.WaveFormat ) ) { - // resampler.Length はサンプル単位ではなくフレーム単位。 - var サイズbyte = resampler.Length * resampler.WaveFormat.Channels; // 実際のサイズはチャンネル倍ある。 + var サイズbyte = resampler.Length; this._DecodedWaveData = new byte[ サイズbyte ]; resampler.Read( this._DecodedWaveData, 0, (int) サイズbyte ); // でもこっちはバイト単位。 diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/WavOnMemoryWaveSource.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/WavOnMemoryWaveSource.cs" new file mode 100644 index 0000000..90a9a1d --- /dev/null +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/WavOnMemoryWaveSource.cs" @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using CSCore; +using CSCore.Codecs.WAV; + +namespace FDK +{ + /// + /// 指定されたメディアファイルを PCM WAVE としてデコードして、 オブジェクトを生成する。 + /// リサンプラーなし版。 + /// + public class WavOnMemoryWaveSource : IWaveSource + { + public bool CanSeek => this._WaveFileReader.CanSeek; + + public WaveFormat WaveFormat => this._WaveFileReader.WaveFormat; + + /// + /// 現在の再生位置[byte]。 + /// + public long Position + { + get => this._WaveFileReader.Position; + set => this._WaveFileReader.Position = FDKUtilities.位置をブロック境界単位にそろえて返す( value, this.WaveFormat.BlockAlign ); + } + + /// + /// デコード後のオーディオデータのすべての長さ[byte]。 + /// + public long Length => this._WaveFileReader.Length; + + + public WavOnMemoryWaveSource( VariablePath ファイルパス, WaveFormat deviceFormat ) + { + this._WaveFileReader = new WaveFileReader( ファイルパス.変数なしパス ); + } + + /// + /// 連続したデータを読み込み、 を読み込んだ数だけ進める。 + /// + /// 読み込んだデータを格納するための配列。 + /// に格納を始める位置。 + /// 読み込む最大のデータ数。 + /// に読み込んだデータの総数。 + public int Read( byte[] buffer, int offset, int count ) + => this._WaveFileReader.Read( buffer, offset, count ); + + public void Dispose() + { + this._WaveFileReader?.Dispose(); + this._WaveFileReader = null; + } + + + private WaveFileReader _WaveFileReader = null; + } +} diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/WavResampledOnMemoryWaveSource.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/WavResampledOnMemoryWaveSource.cs" new file mode 100644 index 0000000..4bba0c5 --- /dev/null +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/WavResampledOnMemoryWaveSource.cs" @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using CSCore; +using CSCore.DSP; + +namespace FDK +{ + /// + /// 指定されたメディアファイルを PCM WAVE としてデコードして、 オブジェクトを生成する。 + /// リサンプラーあり版。 + /// + public class WavResampledOnMemoryWaveSource : IWaveSource + { + public bool CanSeek => true; // オンメモリなので常にサポートできる。 + + /// + /// デコード&リサンプル後のオーディオデータのフォーマット。 + /// + public WaveFormat WaveFormat { get; protected set; } = null; + + /// + /// デコード後のオーディオデータのすべての長さ[byte]。 + /// + public long Length => this._DecodedWaveData.Length; + + /// + /// 現在の再生位置[byte]。 + /// + public long Position + { + get => this._Position; + set => this._Position = FDKUtilities.位置をブロック境界単位にそろえて返す( value, this.WaveFormat.BlockAlign ); + } + + + /// + /// コンストラクタ。 + /// 指定されたWAVファイルを指定されたフォーマットでデコードし、内部にオンメモリで保管する。 + /// + public WavResampledOnMemoryWaveSource( VariablePath ファイルパス, WaveFormat deviceFormat ) + { + this.WaveFormat = new WaveFormat( + deviceFormat.SampleRate, + 32, + deviceFormat.Channels, + AudioEncoding.IeeeFloat ); + + // リサンプルなし版で生成して、それを this.WaveFormat に合わせてリサンプルしたデータ(byte[])を保管する。 + using( var wavSource = new WavOnMemoryWaveSource( ファイルパス, deviceFormat ) ) + using( var resampler = new DmoResampler( wavSource, this.WaveFormat ) ) + { + // resampler.Length はサンプル単位ではなくフレーム単位。 + var サイズbyte = resampler.Length * resampler.WaveFormat.Channels; // 実際のサイズはチャンネル倍ある。 + + this._DecodedWaveData = new byte[ サイズbyte ]; + resampler.Read( this._DecodedWaveData, 0, (int) サイズbyte ); // でもこっちはバイト単位。 + } + } + + /// + /// 連続したデータを読み込み、 を読み込んだ数だけ進める。 + /// + /// 読み込んだデータを格納するための配列。 + /// に格納を始める位置。 + /// 読み込む最大のデータ数。 + /// に読み込んだデータの総数。 + public int Read( byte[] buffer, int offset, int count ) + { + // ※ 音がめちゃくちゃになるとうざいので、このメソッド内では例外を出さないこと。 + if( ( null == this._DecodedWaveData ) || ( null == buffer ) ) + return 0; + + long 読み込み可能な最大count = ( this.Length - this._Position ); + + if( count > 読み込み可能な最大count ) + count = (int) 読み込み可能な最大count; + + if( 0 < count ) + { + Buffer.BlockCopy( + src: this._DecodedWaveData, + srcOffset: (int) this._Position, + dst: buffer, + dstOffset: offset, + count: count ); + + this._Position += count; + } + + return count; + } + + public void Dispose() + { + this._DecodedWaveData = null; + } + + + private byte[] _DecodedWaveData = null; + + private long _Position = 0; + } +} diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/XAOnMemoryWaveSource.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/XAOnMemoryWaveSource.cs" index 4e63996..855f588 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/XAOnMemoryWaveSource.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\202\265\343\202\246\343\203\263\343\203\211/Sources/XAOnMemoryWaveSource.cs" @@ -9,34 +9,27 @@ namespace FDK { /// - /// 指定されたメディアファイルを XA としてデコードして、 オブジェクトを生成する。 + /// 指定されたメディアファイルを XA としてデコードして、 オブジェクトを生成する。 /// リサンプラーなし版。 /// unsafe class XAOnMemoryWaveSource : IWaveSource { public bool CanSeek => true; // オンメモリなので常にサポートする。 - public WaveFormat WaveFormat - { - get; - protected set; - } = null; + public WaveFormat WaveFormat { get; protected set; } = null; /// /// デコード後のオーディオデータのすべての長さ[byte]。 /// - public long Length - => this._DecodedWaveData.Length; + public long Length => this._DecodedWaveData.Length; /// /// 現在の再生位置[byte]。 /// public long Position { - get - => this._Position; - set - => this._Position = FDKUtilities.位置をブロック境界単位にそろえて返す( value, this.WaveFormat.BlockAlign ); + get => this._Position; + set => this._Position = FDKUtilities.位置をブロック境界単位にそろえて返す( value, this.WaveFormat.BlockAlign ); } /// diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\203\206\343\202\257\343\202\271\343\203\201\343\203\243\343\203\225\343\202\251\343\203\263\343\203\210.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\203\206\343\202\257\343\202\271\343\203\201\343\203\243\343\203\225\343\202\251\343\203\263\343\203\210.cs" index 341ff88..8367ec1 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\203\206\343\202\257\343\202\271\343\203\201\343\203\243\343\203\225\343\202\251\343\203\263\343\203\210.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\343\203\206\343\202\257\343\202\271\343\203\201\343\203\243\343\203\225\343\202\251\343\203\263\343\203\210.cs" @@ -4,7 +4,6 @@ using System.IO; using System.Linq; using SharpDX; -using Newtonsoft.Json.Linq; namespace FDK { @@ -19,18 +18,19 @@ public class テクスチャフォント : Activity /// 指定された画像ファイルと矩形リストファイルを使って、テクスチャフォントを生成する。 /// public テクスチャフォント( VariablePath 文字盤の画像ファイルパス, VariablePath 文字盤設定ファイルパス ) - : this( 文字盤の画像ファイルパス, JObject.Parse( File.ReadAllText( 文字盤設定ファイルパス.変数なしパス ) ) ) { - } - - /// - /// コンストラクタ。 - /// 指定された画像ファイルと矩形リストを使って、テクスチャフォントを生成する。 - /// - public テクスチャフォント( VariablePath 文字盤の画像ファイルパス, JObject 文字盤設定 ) - { - this.子を追加する( this._文字盤 = new テクスチャ( 文字盤の画像ファイルパス ) ); - this._文字盤設定 = 文字盤設定; + this.子Activityを追加する( this._文字盤 = new テクスチャ( 文字盤の画像ファイルパス ) ); + + var yaml = File.ReadAllText( 文字盤設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._文字盤の矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) + { + if( 4 == kvp.Value.Length ) + this._文字盤の矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); + } } /// @@ -43,11 +43,10 @@ public void 描画する( string 表示文字列, Matrix 文字列全体のワ // 有効文字(矩形リストに登録されている文字)の矩形、文字数を抽出し、文字列全体のサイズを計算する。 - var rclist = this._文字盤設定[ "矩形リスト" ]; var 有効文字矩形リスト = from 文字 in 表示文字列 - where ( null != rclist[ 文字.ToString() ] ) - select FDKUtilities.JsonToRectangleF( rclist[ 文字.ToString() ] ); + where ( null != this._文字盤の矩形リスト[ 文字.ToString() ] ) + select this._文字盤の矩形リスト[ 文字.ToString() ]; int 有効文字数 = 有効文字矩形リスト.Count(); if( 0 == 有効文字数 ) @@ -85,6 +84,12 @@ public void 描画する( string 表示文字列, Matrix 文字列全体のワ private テクスチャ _文字盤 = null; - private JObject _文字盤設定 = null; + private Dictionary _文字盤の矩形リスト = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\224\273\345\203\217\343\203\225\343\202\251\343\203\263\343\203\210.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\224\273\345\203\217\343\203\225\343\202\251\343\203\263\343\203\210.cs" index c4921d9..e457fcb 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\224\273\345\203\217\343\203\225\343\202\251\343\203\263\343\203\210.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\224\273\345\203\217\343\203\225\343\202\251\343\203\263\343\203\210.cs" @@ -5,7 +5,6 @@ using System.Linq; using SharpDX; using SharpDX.Direct2D1; -using Newtonsoft.Json.Linq; namespace FDK { @@ -26,22 +25,21 @@ public class 画像フォント : Activity public 画像フォント( VariablePath 文字盤の画像ファイルパス, VariablePath 文字盤設定ファイルパス, float 文字幅補正dpx = 0f, float 不透明度 = 1f ) - : this( 文字盤の画像ファイルパス, JObject.Parse( File.ReadAllText( 文字盤設定ファイルパス.変数なしパス ) ), 文字幅補正dpx, 不透明度 ) { - } + this.子Activityを追加する( this._文字盤 = new 画像( 文字盤の画像ファイルパス ) ); - public 画像フォント( VariablePath 文字盤の画像ファイルパス, JObject 文字盤設定, float 文字幅補正dpx = 0f, float 不透明度 = 1f ) - { - this.子を追加する( this._文字盤 = new 画像( 文字盤の画像ファイルパス ) ); this.文字幅補正dpx = 文字幅補正dpx; this.不透明度 = 不透明度; - // 高速化のために、JObject を Dictionary に変換。 - this._矩形リスト = new Dictionary(); - foreach( JProperty rc in 文字盤設定[ "矩形リスト" ].Where( - ( jtoken ) => ( jtoken is JProperty && jtoken.Values().Count() == 4 && ( (JProperty) jtoken ).Value.Type == JTokenType.Array ) ) ) // 要素4個の配列のみ抽出 + var yaml = File.ReadAllText( 文字盤設定ファイルパス.変数なしパス ); + var deserializer = new YamlDotNet.Serialization.Deserializer(); + var yamlMap = deserializer.Deserialize( yaml ); + + this._矩形リスト = new Dictionary(); + foreach( var kvp in yamlMap.矩形リスト ) { - this._矩形リスト.Add( rc.Name, FDKUtilities.JsonToRectangleF( rc.Value ) ); + if( 4 == kvp.Value.Length ) + this._矩形リスト[ kvp.Key ] = new RectangleF( kvp.Value[ 0 ], kvp.Value[ 1 ], kvp.Value[ 2 ], kvp.Value[ 3 ] ); } } @@ -96,6 +94,12 @@ public void 描画する( DeviceContext1 dc, float 基点のX位置, float 上 private 画像 _文字盤 = null; - private Dictionary _矩形リスト = null; + internal protected Dictionary _矩形リスト = null; + + + private class YAMLマップ + { + public Dictionary 矩形リスト { get; set; } + } } } diff --git "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.cs" "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.cs" index e2a32f3..d42989f 100644 --- "a/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.cs" +++ "b/FDK/\343\203\241\343\203\207\343\202\243\343\202\242/\347\237\251\345\275\242\343\203\252\343\202\271\343\203\210.cs" @@ -91,7 +91,7 @@ public void 矩形リストXmlファイルを読み込む( VariablePath ファ } catch( Exception e ) { - Log.ERROR( $"矩形リストXmlファイルの読み込みに失敗しました。{e.Message}[{ファイルパス.変数付きパス}]" ); + Log.ERROR( $"矩形リストXmlファイルの読み込みに失敗しました。{VariablePath.絶対パスをフォルダ変数付き絶対パスに変換して返す( e.Message )}[{ファイルパス.変数付きパス}]" ); } } diff --git a/FDKTests/FDKTests.csproj b/FDKTests/FDKTests.csproj index 5097d85..64c6939 100644 --- a/FDKTests/FDKTests.csproj +++ b/FDKTests/FDKTests.csproj @@ -1,6 +1,6 @@  - + Debug AnyCPU @@ -40,10 +40,10 @@ - ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll - ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll ..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll @@ -52,6 +52,9 @@ ..\packages\SharpDX.Mathematics.4.2.0\lib\net45\SharpDX.Mathematics.dll + + ..\packages\YamlDotNet.5.3.0\lib\net45\YamlDotNet.dll + @@ -64,7 +67,9 @@ + + @@ -77,6 +82,9 @@ + + PreserveNewest + PreserveNewest @@ -84,6 +92,11 @@ PreserveNewest + + + PreserveNewest + + @@ -108,10 +121,10 @@ このプロジェクトは、このコンピューター上にない NuGet パッケージを参照しています。それらのパッケージをダウンロードするには、[NuGet パッケージの復元] を使用します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。見つからないファイルは {0} です。 - - + + - +