using System.Security.Cryptography;\r
using System.Reflection;\r
using System.Globalization;\r
+using System.Threading;\r
using FDK;\r
\r
namespace DTXMania\r
CDTX.tZZ( this.nBMP番号 ) );\r
}\r
}\r
- public class CBMP : IDisposable\r
+ public class CBMP : CBMPbase, IDisposable\r
{\r
- public bool bUse;\r
- public int n番号;\r
- public string strコメント文 = "";\r
- public string strファイル名 = "";\r
- public CTexture tx画像;\r
- public int n高さ\r
+ public override void PutLog( string strテクスチャファイル名 )\r
{\r
- get\r
- {\r
- return this.tx画像.sz画像サイズ.Height;\r
- }\r
+ Trace.TraceInformation( "テクスチャを生成しました。({0})({1})({2}x{3})", this.strコメント文, strテクスチャファイル名, this.n幅, this.n高さ );\r
}\r
- public int n幅\r
+ public override string ToString()\r
{\r
- get\r
- {\r
- return this.tx画像.sz画像サイズ.Width;\r
- }\r
+ return string.Format( "CBMP{0}: File:{1}, Comment:{2}", CDTX.tZZ( this.n番号 ), this.strファイル名, this.strコメント文 );\r
}\r
\r
- public void OnDeviceCreated()\r
+ }\r
+ public class CBMPTEX : CBMPbase, IDisposable\r
+ {\r
+ public override void PutLog( string strテクスチャファイル名 )\r
{\r
- #region [ strテクスチャファイル名 を作成。]\r
- //-----------------\r
- string strテクスチャファイル名;\r
- if( !string.IsNullOrEmpty( CDTXMania.DTX.PATH_WAV ) )\r
- strテクスチャファイル名 = CDTXMania.DTX.PATH_WAV + this.strファイル名;\r
- else\r
- strテクスチャファイル名 = CDTXMania.DTX.strフォルダ名 + this.strファイル名;\r
- //-----------------\r
- #endregion\r
-\r
- if( !File.Exists( strテクスチャファイル名 ) )\r
- {\r
- Trace.TraceWarning( "ファイルが存在しません。({0})({1})", this.strコメント文, strテクスチャファイル名 );\r
- this.tx画像 = null;\r
- return;\r
- }\r
-\r
- // テクスチャを作成。\r
-\r
- this.tx画像 = CDTXMania.tテクスチャの生成( strテクスチャファイル名, true );\r
-\r
- if( this.tx画像 != null )\r
- {\r
- // 作成成功。\r
-\r
- if( CDTXMania.ConfigIni.bLog作成解放ログ出力 )\r
- Trace.TraceInformation( "テクスチャを生成しました。({0})({1})({2}x{3})", this.strコメント文, strテクスチャファイル名, this.n幅, this.n高さ );\r
-\r
- this.bUse = true;\r
- }\r
- else\r
- {\r
- // 作成失敗。\r
-\r
- Trace.TraceError( "テクスチャの生成に失敗しました。({0})({1})", this.strコメント文, strテクスチャファイル名 );\r
- this.tx画像 = null;\r
- }\r
+ Trace.TraceInformation( "テクスチャを生成しました。({0})({1})(Gr:{2}x{3})(Tx:{4}x{5})", this.strコメント文, strテクスチャファイル名, this.tx画像.sz画像サイズ.Width, this.tx画像.sz画像サイズ.Height, this.tx画像.szテクスチャサイズ.Width, this.tx画像.szテクスチャサイズ.Height );\r
}\r
public override string ToString()\r
{\r
- return string.Format( "CBMP{0}: File:{1}, Comment:{2}", CDTX.tZZ( this.n番号 ), this.strファイル名, this.strコメント文 );\r
- }\r
-\r
- #region [ IDisposable 実装 ]\r
- //-----------------\r
- public void Dispose()\r
- {\r
- if( this.bDisposed済み )\r
- return;\r
-\r
- if( this.tx画像 != null )\r
- {\r
- #region [ strテクスチャファイル名 を作成。]\r
- //-----------------\r
- string strテクスチャファイル名;\r
- if( !string.IsNullOrEmpty( CDTXMania.DTX.PATH_WAV ) )\r
- strテクスチャファイル名 = CDTXMania.DTX.PATH_WAV + this.strファイル名;\r
- else\r
- strテクスチャファイル名 = CDTXMania.DTX.strフォルダ名 + this.strファイル名;\r
- //-----------------\r
- #endregion\r
-\r
- CDTXMania.tテクスチャの解放( ref this.tx画像 );\r
-\r
- if( CDTXMania.ConfigIni.bLog作成解放ログ出力 )\r
- Trace.TraceInformation( "テクスチャを解放しました。({0})({1})", this.strコメント文, strテクスチャファイル名 );\r
- }\r
- this.bUse = false;\r
-\r
- this.bDisposed済み = true;\r
+ return string.Format( "CBMPTEX{0}: File:{1}, Comment:{2}", CDTX.tZZ( this.n番号 ), this.strファイル名, this.strコメント文 );\r
}\r
- //-----------------\r
- #endregion\r
-\r
- #region [ private ]\r
- //-----------------\r
- private bool bDisposed済み;\r
- //-----------------\r
- #endregion\r
}\r
- public class CBMPTEX : IDisposable\r
+ public class CBMPbase : IDisposable\r
{\r
public bool bUse;\r
public int n番号;\r
}\r
}\r
\r
+ public string GetFullPathname\r
+ {\r
+ get\r
+ {\r
+ if( !string.IsNullOrEmpty( CDTXMania.DTX.PATH_WAV ) )\r
+ return CDTXMania.DTX.PATH_WAV + this.strファイル名;\r
+ else\r
+ return CDTXMania.DTX.strフォルダ名 + this.strファイル名;\r
+ }\r
+ }\r
+\r
public void OnDeviceCreated()\r
{\r
#region [ strテクスチャファイル名 を作成。]\r
//-----------------\r
- string strテクスチャファイル名;\r
- if( !string.IsNullOrEmpty( CDTXMania.DTX.PATH_WAV ) )\r
- strテクスチャファイル名 = CDTXMania.DTX.PATH_WAV + this.strファイル名;\r
- else\r
- strテクスチャファイル名 = CDTXMania.DTX.strフォルダ名 + this.strファイル名;\r
+ string strテクスチャファイル名 = this.GetFullPathname;\r
+ //if( !string.IsNullOrEmpty( CDTXMania.DTX.PATH_WAV ) )\r
+ // strテクスチャファイル名 = CDTXMania.DTX.PATH_WAV + this.strファイル名;\r
+ //else\r
+ // strテクスチャファイル名 = CDTXMania.DTX.strフォルダ名 + this.strファイル名;\r
//-----------------\r
#endregion\r
\r
- if( !File.Exists( strテクスチャファイル名 ) )\r
+ if ( !File.Exists( strテクスチャファイル名 ) )\r
{\r
Trace.TraceWarning( "ファイルが存在しません。({0})({1})", this.strコメント文, strテクスチャファイル名 );\r
this.tx画像 = null;\r
}\r
\r
// テクスチャを作成。\r
+ byte[] txData = File.ReadAllBytes( strテクスチャファイル名 );\r
+ // this.tx画像 = CDTXMania.tテクスチャの生成( strテクスチャファイル名, true );\r
+ this.OnDeviceCreated( txData, strテクスチャファイル名 );\r
+ }\r
+ public void OnDeviceCreated( byte[] txData, string strテクスチャファイル名 )\r
+ {\r
+ this.tx画像 = CDTXMania.tテクスチャの生成( txData, true );\r
\r
- this.tx画像 = CDTXMania.tテクスチャの生成( strテクスチャファイル名 );\r
-\r
- if( this.tx画像 != null )\r
+ if ( this.tx画像 != null )\r
{\r
- // 作成成功\r
+ // 作成成功。\r
\r
- if( CDTXMania.ConfigIni.bLog作成解放ログ出力 )\r
- Trace.TraceInformation( "テクスチャを生成しました。({0})({1})(Gr:{2}x{3})(Tx:{4}x{5})", this.strコメント文, strテクスチャファイル名, this.tx画像.sz画像サイズ.Width, this.tx画像.sz画像サイズ.Height, this.tx画像.szテクスチャサイズ.Width, this.tx画像.szテクスチャサイズ.Height );\r
+ if ( CDTXMania.ConfigIni.bLog作成解放ログ出力 )\r
+ PutLog( strテクスチャファイル名 );\r
this.bUse = true;\r
}\r
else\r
{\r
- // 作成失敗\r
-\r
+ // 作成失敗。\r
Trace.TraceError( "テクスチャの生成に失敗しました。({0})({1})", this.strコメント文, strテクスチャファイル名 );\r
+ this.tx画像 = null;\r
}\r
}\r
- public override string ToString()\r
+\r
+ public virtual void PutLog(string strテクスチャファイル名)\r
{\r
- return string.Format( "CBMPTEX{0}: File:{1}, Comment:{2}", CDTX.tZZ( this.n番号 ), this.strファイル名, this.strコメント文 );\r
}\r
\r
#region [ IDisposable 実装 ]\r
{\r
#region [ strテクスチャファイル名 を作成。]\r
//-----------------\r
- string strテクスチャファイル名;\r
- if( !string.IsNullOrEmpty( CDTXMania.DTX.PATH_WAV ) )\r
- strテクスチャファイル名 = CDTXMania.DTX.PATH_WAV + this.strファイル名;\r
- else\r
- strテクスチャファイル名 = CDTXMania.DTX.strフォルダ名 + this.strファイル名;\r
+ string strテクスチャファイル名 = this.GetFullPathname;\r
+ //if( !string.IsNullOrEmpty( CDTXMania.DTX.PATH_WAV ) )\r
+ // strテクスチャファイル名 = CDTXMania.DTX.PATH_WAV + this.strファイル名;\r
+ //else\r
+ // strテクスチャファイル名 = CDTXMania.DTX.strフォルダ名 + this.strファイル名;\r
//-----------------\r
#endregion\r
\r
\r
this.bDisposed済み = true;\r
}\r
- //-----------------\r
#endregion\r
-\r
#region [ private ]\r
//-----------------\r
private bool bDisposed済み;\r
public class CWAV : IDisposable\r
{\r
public bool bBGMとして使う;\r
- public List<int> listこのWAVを使用するチャンネル番号の集合 = new List<int>( 16 );\r
+ public bool bIsOnBGMLane; // #28021 「bBGMとして使う」の用途不明につき、「BGMレーン(01)上にあるWAV」という意味で新規作成\r
+ public List<int> listこのWAVを使用するチャンネル番号の集合 = new List<int>( 16 ); // 登録はしているけど参照はしていないような・・・\r
public int nチップサイズ = 100;\r
public int n位置;\r
public long[] n一時停止時刻 = new long[ 4 ];\r
stdgbvalue.Bass = 0;\r
this.LEVEL = stdgbvalue;\r
\r
-#if true // 2010.12.31 yyagi #RESULTxxxのリファクタ後。ここはnew()して参照渡ししなくてもいいよね?\r
for (int i = 0; i < 7; i++) {\r
this.RESULTIMAGE[i] = "";\r
this.RESULTMOVIE[i] = "";\r
this.RESULTSOUND[i] = "";\r
}\r
-#else // #RESULTxxxのリファクタ前\r
- STRESULT stresult4 = new STRESULT();\r
- STRESULT stresult = stresult4;\r
- stresult.SS = "";\r
- stresult.S = "";\r
- stresult.A = "";\r
- stresult.B = "";\r
- stresult.C = "";\r
- stresult.D = "";\r
- stresult.E = "";\r
- this.RESULTIMAGE = stresult;\r
- stresult4 = new STRESULT();\r
- STRESULT stresult2 = stresult4;\r
- stresult2.SS = "";\r
- stresult2.S = "";\r
- stresult2.A = "";\r
- stresult2.B = "";\r
- stresult2.C = "";\r
- stresult2.D = "";\r
- stresult2.E = "";\r
- this.RESULTMOVIE = stresult2;\r
- STRESULT stresult3 = new STRESULT();\r
- stresult3.SS = "";\r
- stresult3.S = "";\r
- stresult3.A = "";\r
- stresult3.B = "";\r
- stresult3.C = "";\r
- stresult3.D = "";\r
- stresult3.E = "";\r
- this.RESULTSOUND = stresult3;\r
-#endif\r
+\r
this.db再生速度 = 1.0;\r
this.strハッシュofDTXファイル = "";\r
this.bチップがある = new STチップがある();\r
this.nRESULTMOVIE用優先順位 = new int[ 7 ];\r
this.nRESULTSOUND用優先順位 = new int[ 7 ];\r
\r
-#if true // 2011.1.1 yyagi GDA->DTX変換テーブル リファクタ後\r
STGDAPARAM[] stgdaparamArray = new STGDAPARAM[] { // GDA->DTX conversion table\r
new STGDAPARAM("TC", 0x03), new STGDAPARAM("BL", 0x02), new STGDAPARAM("GS", 0x29),\r
new STGDAPARAM("DS", 0x30), new STGDAPARAM("FI", 0x53), new STGDAPARAM("HH", 0x11),\r
new STGDAPARAM("B7", 0xA7), new STGDAPARAM("BW", 0xA8), new STGDAPARAM("G0", 0x20),\r
new STGDAPARAM("B0", 0xA0)\r
};\r
-#else // 2011.1.1 yyagi GDA->DTX変換テーブル リファクタ前\r
- STGDAPARAM[] stgdaparamArray = new STGDAPARAM[62];\r
- STGDAPARAM stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam = stgdaparam62;\r
- stgdaparam.s = "TC";\r
- stgdaparam.c = 3;\r
- stgdaparamArray[ 0 ] = stgdaparam;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam2 = stgdaparam62;\r
- stgdaparam2.s = "BL";\r
- stgdaparam2.c = 2;\r
- stgdaparamArray[ 1 ] = stgdaparam2;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam3 = stgdaparam62;\r
- stgdaparam3.s = "GS";\r
- stgdaparam3.c = 0x29;\r
- stgdaparamArray[ 2 ] = stgdaparam3;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam4 = stgdaparam62;\r
- stgdaparam4.s = "DS";\r
- stgdaparam4.c = 0x30;\r
- stgdaparamArray[ 3 ] = stgdaparam4;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam5 = stgdaparam62;\r
- stgdaparam5.s = "FI";\r
- stgdaparam5.c = 0x53;\r
- stgdaparamArray[ 4 ] = stgdaparam5;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam6 = stgdaparam62;\r
- stgdaparam6.s = "HH";\r
- stgdaparam6.c = 0x11;\r
- stgdaparamArray[ 5 ] = stgdaparam6;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam7 = stgdaparam62;\r
- stgdaparam7.s = "SD";\r
- stgdaparam7.c = 0x12;\r
- stgdaparamArray[ 6 ] = stgdaparam7;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam8 = stgdaparam62;\r
- stgdaparam8.s = "BD";\r
- stgdaparam8.c = 0x13;\r
- stgdaparamArray[ 7 ] = stgdaparam8;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam9 = stgdaparam62;\r
- stgdaparam9.s = "HT";\r
- stgdaparam9.c = 20;\r
- stgdaparamArray[ 8 ] = stgdaparam9;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam10 = stgdaparam62;\r
- stgdaparam10.s = "LT";\r
- stgdaparam10.c = 0x15;\r
- stgdaparamArray[ 9 ] = stgdaparam10;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam11 = stgdaparam62;\r
- stgdaparam11.s = "CY";\r
- stgdaparam11.c = 0x16;\r
- stgdaparamArray[ 10 ] = stgdaparam11;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam12 = stgdaparam62;\r
- stgdaparam12.s = "G1";\r
- stgdaparam12.c = 0x21;\r
- stgdaparamArray[ 11 ] = stgdaparam12;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam13 = stgdaparam62;\r
- stgdaparam13.s = "G2";\r
- stgdaparam13.c = 0x22;\r
- stgdaparamArray[ 12 ] = stgdaparam13;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam14 = stgdaparam62;\r
- stgdaparam14.s = "G3";\r
- stgdaparam14.c = 0x23;\r
- stgdaparamArray[ 13 ] = stgdaparam14;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam15 = stgdaparam62;\r
- stgdaparam15.s = "G4";\r
- stgdaparam15.c = 0x24;\r
- stgdaparamArray[ 14 ] = stgdaparam15;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam16 = stgdaparam62;\r
- stgdaparam16.s = "G5";\r
- stgdaparam16.c = 0x25;\r
- stgdaparamArray[ 15 ] = stgdaparam16;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam17 = stgdaparam62;\r
- stgdaparam17.s = "G6";\r
- stgdaparam17.c = 0x26;\r
- stgdaparamArray[ 0x10 ] = stgdaparam17;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam18 = stgdaparam62;\r
- stgdaparam18.s = "G7";\r
- stgdaparam18.c = 0x27;\r
- stgdaparamArray[ 0x11 ] = stgdaparam18;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam19 = stgdaparam62;\r
- stgdaparam19.s = "GW";\r
- stgdaparam19.c = 40;\r
- stgdaparamArray[ 0x12 ] = stgdaparam19;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam20 = stgdaparam62;\r
- stgdaparam20.s = "01";\r
- stgdaparam20.c = 0x61;\r
- stgdaparamArray[ 0x13 ] = stgdaparam20;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam21 = stgdaparam62;\r
- stgdaparam21.s = "02";\r
- stgdaparam21.c = 0x62;\r
- stgdaparamArray[ 20 ] = stgdaparam21;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam22 = stgdaparam62;\r
- stgdaparam22.s = "03";\r
- stgdaparam22.c = 0x63;\r
- stgdaparamArray[ 0x15 ] = stgdaparam22;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam23 = stgdaparam62;\r
- stgdaparam23.s = "04";\r
- stgdaparam23.c = 100;\r
- stgdaparamArray[ 0x16 ] = stgdaparam23;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam24 = stgdaparam62;\r
- stgdaparam24.s = "05";\r
- stgdaparam24.c = 0x65;\r
- stgdaparamArray[ 0x17 ] = stgdaparam24;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam25 = stgdaparam62;\r
- stgdaparam25.s = "06";\r
- stgdaparam25.c = 0x66;\r
- stgdaparamArray[ 0x18 ] = stgdaparam25;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam26 = stgdaparam62;\r
- stgdaparam26.s = "07";\r
- stgdaparam26.c = 0x67;\r
- stgdaparamArray[ 0x19 ] = stgdaparam26;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam27 = stgdaparam62;\r
- stgdaparam27.s = "08";\r
- stgdaparam27.c = 0x68;\r
- stgdaparamArray[ 0x1a ] = stgdaparam27;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam28 = stgdaparam62;\r
- stgdaparam28.s = "09";\r
- stgdaparam28.c = 0x69;\r
- stgdaparamArray[ 0x1b ] = stgdaparam28;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam29 = stgdaparam62;\r
- stgdaparam29.s = "0A";\r
- stgdaparam29.c = 0x70;\r
- stgdaparamArray[ 0x1c ] = stgdaparam29;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam30 = stgdaparam62;\r
- stgdaparam30.s = "0B";\r
- stgdaparam30.c = 0x71;\r
- stgdaparamArray[ 0x1d ] = stgdaparam30;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam31 = stgdaparam62;\r
- stgdaparam31.s = "0C";\r
- stgdaparam31.c = 0x72;\r
- stgdaparamArray[ 30 ] = stgdaparam31;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam32 = stgdaparam62;\r
- stgdaparam32.s = "0D";\r
- stgdaparam32.c = 0x73;\r
- stgdaparamArray[ 0x1f ] = stgdaparam32;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam33 = stgdaparam62;\r
- stgdaparam33.s = "0E";\r
- stgdaparam33.c = 0x74;\r
- stgdaparamArray[ 0x20 ] = stgdaparam33;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam34 = stgdaparam62;\r
- stgdaparam34.s = "0F";\r
- stgdaparam34.c = 0x75;\r
- stgdaparamArray[ 0x21 ] = stgdaparam34;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam35 = stgdaparam62;\r
- stgdaparam35.s = "10";\r
- stgdaparam35.c = 0x76;\r
- stgdaparamArray[ 0x22 ] = stgdaparam35;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam36 = stgdaparam62;\r
- stgdaparam36.s = "11";\r
- stgdaparam36.c = 0x77;\r
- stgdaparamArray[ 0x23 ] = stgdaparam36;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam37 = stgdaparam62;\r
- stgdaparam37.s = "12";\r
- stgdaparam37.c = 120;\r
- stgdaparamArray[ 0x24 ] = stgdaparam37;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam38 = stgdaparam62;\r
- stgdaparam38.s = "13";\r
- stgdaparam38.c = 0x79;\r
- stgdaparamArray[ 0x25 ] = stgdaparam38;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam39 = stgdaparam62;\r
- stgdaparam39.s = "14";\r
- stgdaparam39.c = 0x80;\r
- stgdaparamArray[ 0x26 ] = stgdaparam39;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam40 = stgdaparam62;\r
- stgdaparam40.s = "15";\r
- stgdaparam40.c = 0x81;\r
- stgdaparamArray[ 0x27 ] = stgdaparam40;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam41 = stgdaparam62;\r
- stgdaparam41.s = "16";\r
- stgdaparam41.c = 130;\r
- stgdaparamArray[ 40 ] = stgdaparam41;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam42 = stgdaparam62;\r
- stgdaparam42.s = "17";\r
- stgdaparam42.c = 0x83;\r
- stgdaparamArray[ 0x29 ] = stgdaparam42;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam43 = stgdaparam62;\r
- stgdaparam43.s = "18";\r
- stgdaparam43.c = 0x84;\r
- stgdaparamArray[ 0x2a ] = stgdaparam43;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam44 = stgdaparam62;\r
- stgdaparam44.s = "19";\r
- stgdaparam44.c = 0x85;\r
- stgdaparamArray[ 0x2b ] = stgdaparam44;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam45 = stgdaparam62;\r
- stgdaparam45.s = "1A";\r
- stgdaparam45.c = 0x86;\r
- stgdaparamArray[ 0x2c ] = stgdaparam45;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam46 = stgdaparam62;\r
- stgdaparam46.s = "1B";\r
- stgdaparam46.c = 0x87;\r
- stgdaparamArray[ 0x2d ] = stgdaparam46;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam47 = stgdaparam62;\r
- stgdaparam47.s = "1C";\r
- stgdaparam47.c = 0x88;\r
- stgdaparamArray[ 0x2e ] = stgdaparam47;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam48 = stgdaparam62;\r
- stgdaparam48.s = "1D";\r
- stgdaparam48.c = 0x89;\r
- stgdaparamArray[ 0x2f ] = stgdaparam48;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam49 = stgdaparam62;\r
- stgdaparam49.s = "1E";\r
- stgdaparam49.c = 0x90;\r
- stgdaparamArray[ 0x30 ] = stgdaparam49;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam50 = stgdaparam62;\r
- stgdaparam50.s = "1F";\r
- stgdaparam50.c = 0x91;\r
- stgdaparamArray[ 0x31 ] = stgdaparam50;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam51 = stgdaparam62;\r
- stgdaparam51.s = "20";\r
- stgdaparam51.c = 0x92;\r
- stgdaparamArray[ 50 ] = stgdaparam51;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam52 = stgdaparam62;\r
- stgdaparam52.s = "B1";\r
- stgdaparam52.c = 0xa1;\r
- stgdaparamArray[ 0x33 ] = stgdaparam52;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam53 = stgdaparam62;\r
- stgdaparam53.s = "B2";\r
- stgdaparam53.c = 0xa2;\r
- stgdaparamArray[ 0x34 ] = stgdaparam53;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam54 = stgdaparam62;\r
- stgdaparam54.s = "B3";\r
- stgdaparam54.c = 0xa3;\r
- stgdaparamArray[ 0x35 ] = stgdaparam54;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam55 = stgdaparam62;\r
- stgdaparam55.s = "B4";\r
- stgdaparam55.c = 0xa4;\r
- stgdaparamArray[ 0x36 ] = stgdaparam55;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam56 = stgdaparam62;\r
- stgdaparam56.s = "B5";\r
- stgdaparam56.c = 0xa5;\r
- stgdaparamArray[ 0x37 ] = stgdaparam56;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam57 = stgdaparam62;\r
- stgdaparam57.s = "B6";\r
- stgdaparam57.c = 0xa6;\r
- stgdaparamArray[ 0x38 ] = stgdaparam57;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam58 = stgdaparam62;\r
- stgdaparam58.s = "B7";\r
- stgdaparam58.c = 0xa7;\r
- stgdaparamArray[ 0x39 ] = stgdaparam58;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam59 = stgdaparam62;\r
- stgdaparam59.s = "BW";\r
- stgdaparam59.c = 0xa8;\r
- stgdaparamArray[ 0x3a ] = stgdaparam59;\r
- stgdaparam62 = new STGDAPARAM();\r
- STGDAPARAM stgdaparam60 = stgdaparam62;\r
- stgdaparam60.s = "G0";\r
- stgdaparam60.c = 0x20;\r
- stgdaparamArray[ 0x3b ] = stgdaparam60;\r
- STGDAPARAM stgdaparam61 = new STGDAPARAM();\r
- stgdaparam61.s = "B0";\r
- stgdaparam61.c = 160;\r
- stgdaparamArray[ 60 ] = stgdaparam61;\r
-#endif\r
+\r
this.stGDAParam = stgdaparamArray;\r
this.nBGMAdjust = 0;\r
\r
{\r
foreach( CChip chip in this.listChip )\r
{\r
- if( chip.nチャンネル番号 == 0x54 )\r
+ #region [ AVI ]\r
+ if ( chip.nチャンネル番号 == 0x54 )\r
{\r
chip.eAVI種別 = EAVI種別.Unknown;\r
chip.rAVI = null;\r
chip.rAVI = this.listAVI[ chip.n整数値 ];\r
}\r
}\r
+ #endregion\r
}\r
}\r
}\r
+\r
+ #region [ 読み込みとテクスチャ定義をセットで並列化するやり方(D3D外のプロセスでテクスチャ定義すると問題なので結局未使用) ]\r
+ //private class Cbmp並列読み込み : CLoadInParallelBase<CBMP>\r
+ //{\r
+ // public Cbmp並列読み込み( string p, string f ) : base( p, f ) { }\r
+\r
+ // protected override void t読み込みMain( object tlws )\r
+ // {\r
+ // tLoadState t = (tLoadState) tlws;\r
+\r
+ // CBMP cbmp = (CBMP) t.cItem;\r
+ // cbmp.OnDeviceCreated();\r
+ // ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CBMP>.ErrCode.OK;\r
+ // base.t読み込みMain( tlws );\r
+ // }\r
+ //}\r
+\r
+ //private class Cbmptex並列読み込み : CLoadInParallelBase<CBMPTEX>\r
+ //{\r
+ // public Cbmptex並列読み込み( string p, string f ) : base( p, f ) { }\r
+\r
+ // protected override void t読み込みMain( object tlws )\r
+ // {\r
+ // tLoadState t = (tLoadState) tlws;\r
+\r
+ // CBMPTEX cbmptex = (CBMPTEX) t.cItem;\r
+ // cbmptex.OnDeviceCreated();\r
+ // ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CBMPTEX>.ErrCode.OK;\r
+ // // base.t読み込みMain( tlws );\r
+ // }\r
+ //}\r
+ #endregion\r
+ #region [ マルチスレッドでの読み込み用 デリゲート・コールバック定義 ]\r
+ private static int nLoadCompleted;\r
+ delegate byte[] ParallelLoadBMPDelegate( CBMPbase cbmp );\r
+ static ParallelLoadBMPDelegate parallelLoadBMPDelegate;\r
+ private static byte[] LoadTexture( CBMPbase cbmp ) // 別スレッドで動作する、ファイル読み込み部\r
+ {\r
+ string filename = cbmp.GetFullPathname;\r
+ if ( !File.Exists( filename ) )\r
+ {\r
+ Trace.TraceWarning( "ファイルが存在しません。({0})", filename );\r
+ return null;\r
+ }\r
+ return File.ReadAllBytes( filename );\r
+ }\r
+ private static void BMPLoadCallback( IAsyncResult ar ) // メインスレッドで動作する、コールバック部(テクスチャ定義部)\r
+ {\r
+ ParallelLoadBMPDelegate asyncCall = (ParallelLoadBMPDelegate) ( (System.Runtime.Remoting.Messaging.AsyncResult) ar ).AsyncDelegate;\r
+ CBMPbase cbmp = (CBMPbase) ar.AsyncState;\r
+ byte[] txData = asyncCall.EndInvoke( ar );\r
+ cbmp.OnDeviceCreated( txData, cbmp.GetFullPathname );\r
+ Interlocked.Increment( ref nLoadCompleted );\r
+ }\r
+ #endregion\r
public void tBMP_BMPTEXの読み込み()\r
{\r
- if( this.listBMP != null )\r
+ #region [ BMP読み込み ]\r
+ if ( this.listBMP != null )\r
{\r
- foreach( CBMP cbmp in this.listBMP.Values )\r
+ if ( CDTXMania.ConfigIni.bLoadBMPInParallel )\r
{\r
- cbmp.OnDeviceCreated();\r
+ nLoadCompleted = 0;\r
+ foreach ( CBMP cbmp in this.listBMP.Values )\r
+ {\r
+ parallelLoadBMPDelegate = new ParallelLoadBMPDelegate( LoadTexture );\r
+ parallelLoadBMPDelegate.BeginInvoke( cbmp,\r
+ new AsyncCallback( BMPLoadCallback ), cbmp );\r
+ }\r
+ while ( nLoadCompleted < this.listBMP.Count ) // テクスチャ定義が全て完了するまで待つ\r
+ {\r
+ Thread.Sleep( 100 );\r
+ }\r
+ }\r
+ else\r
+ {\r
+ foreach ( CBMP cbmp in this.listBMP.Values )\r
+ {\r
+ cbmp.OnDeviceCreated();\r
+ }\r
}\r
+ #region [ 読み込みとテクスチャ定義をセットで並列化するやり方(D3D外のプロセスでテクスチャ定義すると問題なので結局未使用) ]\r
+ // Cbmp並列読み込み c = new Cbmp並列読み込み( PATH_WAV, strフォルダ名 );\r
+ // c.bActivateParallelLoad = CDTXMania.ConfigIni.bLoadBMPInParallel;\r
+ // // Debug.WriteLine( "BEGIN BMP LOAD (" + listBMP.Count + ")" );\r
+ // c.t読み込み( listBMP );\r
+ // // Debug.WriteLine( "END BMP LOAD" );\r
+ #endregion\r
}\r
- if( this.listBMPTEX != null )\r
+ #endregion\r
+ #region [ BMPTEX読み込み ]\r
+ if ( this.listBMPTEX != null )\r
{\r
- foreach( CBMPTEX cbmptex in this.listBMPTEX.Values )\r
+ if ( CDTXMania.ConfigIni.bLoadBMPInParallel )\r
{\r
- cbmptex.OnDeviceCreated();\r
+ nLoadCompleted = 0;\r
+ foreach ( CBMPTEX cbmptex in this.listBMPTEX.Values )\r
+ {\r
+ parallelLoadBMPDelegate = new ParallelLoadBMPDelegate( LoadTexture );\r
+ parallelLoadBMPDelegate.BeginInvoke( cbmptex,\r
+ new AsyncCallback( BMPLoadCallback ), cbmptex );\r
+ }\r
+ while ( nLoadCompleted < this.listBMPTEX.Count ) // テクスチャ定義が全て完了するまで待つ\r
+ {\r
+ Thread.Sleep( 100 );\r
+ }\r
+ }\r
+ else\r
+ {\r
+ foreach ( CBMPTEX cbmptex in this.listBMPTEX.Values )\r
+ {\r
+ cbmptex.OnDeviceCreated();\r
+ }\r
}\r
+ #region [ 読み込みとテクスチャ定義をセットで並列化するやり方(D3D外のプロセスでテクスチャ定義すると問題なので結局未使用) ]\r
+ //Cbmptex並列読み込み c = new Cbmptex並列読み込み( PATH_WAV, strフォルダ名 );\r
+ //c.bActivateParallelLoad = CDTXMania.ConfigIni.bLoadBMPInParallel;\r
+ //// Debug.WriteLine( "BEGIN BMPTEX LOAD (" + listBMPTEX.Count + ")" );\r
+ //c.t読み込み( listBMPTEX );\r
+ //// Debug.WriteLine( "END BMPTEX LOAD" );\r
+ #endregion\r
}\r
- if( !this.bヘッダのみ )\r
+ #endregion\r
+ if ( !this.bヘッダのみ )\r
{\r
foreach( CChip chip in this.listChip )\r
{\r
- if( ( ( ( chip.nチャンネル番号 == 4 ) || ( chip.nチャンネル番号 == 7 ) ) || ( ( chip.nチャンネル番号 >= 0x55 ) && ( chip.nチャンネル番号 <= 0x59 ) ) ) || ( chip.nチャンネル番号 == 0x60 ) )\r
+ #region [ BGAPAN/BGA/BMPTEX/BMP ]\r
+ if ( ( ( ( chip.nチャンネル番号 == 4 ) || ( chip.nチャンネル番号 == 7 ) ) || ( ( chip.nチャンネル番号 >= 0x55 ) && ( chip.nチャンネル番号 <= 0x59 ) ) ) || ( chip.nチャンネル番号 == 0x60 ) )\r
{\r
chip.eBGA種別 = EBGA種別.Unknown;\r
chip.rBMP = null;\r
chip.rBMPTEX = null;\r
chip.rBGA = null;\r
chip.rBGAPan = null;\r
- if( this.listBGAPAN.ContainsKey( chip.n整数値 ) )\r
+ #region [ BGAPAN ]\r
+ if ( this.listBGAPAN.ContainsKey( chip.n整数値 ) )\r
{\r
CBGAPAN cbgapan = this.listBGAPAN[ chip.n整数値 ];\r
if( this.listBMPTEX.ContainsKey( cbgapan.nBMP番号 ) && this.listBMPTEX[ cbgapan.nBMP番号 ].bUse )\r
continue;\r
}\r
}\r
- if( this.listBGA.ContainsKey( chip.n整数値 ) )\r
+ #endregion\r
+ #region [ BGA ]\r
+ if ( this.listBGA.ContainsKey( chip.n整数値 ) )\r
{\r
CBGA cbga = this.listBGA[ chip.n整数値 ];\r
if( this.listBMPTEX.ContainsKey( cbga.nBMP番号 ) && this.listBMPTEX[ cbga.nBMP番号 ].bUse )\r
continue;\r
}\r
}\r
- if( this.listBMPTEX.ContainsKey( chip.n整数値 ) && this.listBMPTEX[ chip.n整数値 ].bUse )\r
+ #endregion\r
+ #region [ BMPTEX ]\r
+ if ( this.listBMPTEX.ContainsKey( chip.n整数値 ) && this.listBMPTEX[ chip.n整数値 ].bUse )\r
{\r
chip.eBGA種別 = EBGA種別.BMPTEX;\r
chip.rBMPTEX = this.listBMPTEX[ chip.n整数値 ];\r
continue;\r
}\r
- if( this.listBMP.ContainsKey( chip.n整数値 ) && this.listBMP[ chip.n整数値 ].bUse )\r
+ #endregion\r
+ #region [ BMP ]\r
+ if ( this.listBMP.ContainsKey( chip.n整数値 ) && this.listBMP[ chip.n整数値 ].bUse )\r
{\r
chip.eBGA種別 = EBGA種別.BMP;\r
chip.rBMP = this.listBMP[ chip.n整数値 ];\r
continue;\r
}\r
+ #endregion\r
}\r
- if( ( ( ( chip.nチャンネル番号 == 0xc4 ) || ( chip.nチャンネル番号 == 0xc7 ) ) || ( ( chip.nチャンネル番号 >= 0xd5 ) && ( chip.nチャンネル番号 <= 0xd9 ) ) ) || ( chip.nチャンネル番号 == 0xe0 ) )\r
+ #endregion\r
+ #region [ BGA入れ替え ]\r
+ if ( ( ( ( chip.nチャンネル番号 == 0xc4 ) || ( chip.nチャンネル番号 == 0xc7 ) ) || ( ( chip.nチャンネル番号 >= 0xd5 ) && ( chip.nチャンネル番号 <= 0xd9 ) ) ) || ( chip.nチャンネル番号 == 0xe0 ) )\r
{\r
chip.eBGA種別 = EBGA種別.Unknown;\r
chip.rBMP = null;\r
chip.rBMP = this.listBMP[ chip.n整数値 ];\r
}\r
}\r
+ #endregion\r
}\r
}\r
}\r
}\r
}\r
}\r
- public void tWAVの読み込み()\r
+\r
+\r
+ private class Cwav並列読み込み : CLoadInParallelBase<CWAV>\r
{\r
-// Trace.TraceInformation("WAV files={0}", this.listWAV.Count);\r
-// int count = 0;\r
- foreach (CWAV cwav in this.listWAV.Values)\r
+ public Cwav並列読み込み( string p, string f ) : base( p, f ) { }\r
+\r
+ protected override void t読み込みMain( object tlws )\r
{\r
-// string strCount = count.ToString() + " / " + this.listWAV.Count.ToString();\r
-// Debug.WriteLine(strCount);\r
-// CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, strCount);\r
-// count++;\r
+ // string strCount = count.ToString() + " / " + this.listWAV.Count.ToString();\r
+ // Debug.WriteLine(strCount);\r
+ // CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, strCount);\r
+ // count++;\r
\r
- string str = string.IsNullOrEmpty(this.PATH_WAV) ? this.strフォルダ名 : this.PATH_WAV;\r
+ tLoadState t = (tLoadState) tlws;\r
+\r
+ CWAV cwav = (CWAV) t.cItem;\r
+ string str = string.IsNullOrEmpty( this.PATH_WAV ) ? this.strフォルダ名 : this.PATH_WAV;\r
str = str + cwav.strファイル名;\r
+ //Debug.WriteLine( str + ": start loading" );\r
+ if ( cwav == null )\r
+ {\r
+ Trace.TraceError( "CWAVがnullです。" );\r
+ }\r
try\r
{\r
- try\r
- {\r
- cwav.rSound[ 0 ] = CDTXMania.Sound管理.tサウンドを生成する(str);\r
- cwav.rSound[ 0 ].n音量 = 100;\r
- if( CDTXMania.ConfigIni.bLog作成解放ログ出力 )\r
- {\r
- Trace.TraceInformation( "サウンドを作成しました。({3})({0})({1})({2}bytes)", cwav.strコメント文, str, cwav.rSound[ 0 ].nサウンドバッファサイズ, cwav.rSound[ 0 ].bストリーム再生する ? "Stream" : "OnMemory" );\r
- }\r
- }\r
- catch\r
- {\r
- cwav.rSound[ 0 ] = null;\r
- Trace.TraceError( "サウンドの作成に失敗しました。({0})({1})", cwav.strコメント文, str );\r
- }\r
- if ( cwav.rSound[ 0 ] == null || cwav.rSound[ 0 ].bストリーム再生する )\r
- {\r
- for ( int j = 1; j < cwav.rSound.GetLength(0); j++ )\r
- {\r
- cwav.rSound[ j ] = null;\r
- }\r
- }\r
- else\r
- {\r
- for ( int j = 1; j < cwav.rSound.GetLength(0); j++ )\r
- {\r
- cwav.rSound[ j ] = (CSound) cwav.rSound[ 0 ].Clone(); // #24007 2011.9.5 yyagi add: to accelerate loading chip sounds\r
- CDTXMania.Sound管理.tサウンドを登録する( cwav.rSound[ j ] );\r
- }\r
- }\r
+ cwav.rSound[ 0 ] = CDTXMania.Sound管理.tサウンドを生成する( str );\r
+ cwav.rSound[ 0 ].n音量 = 100;\r
+ ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CWAV>.ErrCode.OK;\r
+ if ( CDTXMania.ConfigIni.bLog作成解放ログ出力 )\r
+ {\r
+ Trace.TraceInformation( "サウンドを作成しました。({3})({0})({1})({2}bytes){4}", cwav.strコメント文, str, cwav.rSound[ 0 ].nサウンドバッファサイズ, cwav.rSound[ 0 ].bストリーム再生する ? "Stream" : "OnMemory", cwav.bIsOnBGMLane ? "(BGM)" : "" );\r
+ }\r
}\r
- catch( Exception exception )\r
+ catch ( ArgumentException )\r
{\r
- Trace.TraceError( "サウンドの生成に失敗しました。({0})({1})({2})", exception.Message, cwav.strコメント文, str );\r
- for( int j = 0; j < cwav.rSound.GetLength(0); j++ )\r
+ cwav.rSound[ 0 ] = null;\r
+ Trace.TraceError( "ファイルが見つからないか、0byteでした。({0})({1})", cwav.strコメント文, str );\r
+ ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CWAV>.ErrCode.FatalError;\r
+ // Trace.TraceError( e.Message );\r
+ }\r
+ catch ( AccessViolationException e )\r
+ {\r
+ cwav.rSound[ 0 ] = null;\r
+ ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CWAV>.ErrCode.TemporalError;\r
+ Trace.TraceError( "AccessViolationError。リトライします。({0})({1})", cwav.strコメント文, str );\r
+ Trace.TraceError( e.Message );\r
+ }\r
+ catch ( NullReferenceException e )\r
+ {\r
+ cwav.rSound[ 0 ] = null;\r
+ ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CWAV>.ErrCode.TemporalError;\r
+ Trace.TraceError( "NullReferenceException。リトライします。({0})({1})", cwav.strコメント文, str );\r
+ if ( e != null )\r
+ {\r
+ Trace.TraceError( e.Message );\r
+ }\r
+ else\r
+ {\r
+ Trace.TraceError( "Exception e==nullでした" );\r
+ }\r
+\r
+ }\r
+ catch ( Exception e )\r
+ {\r
+ cwav.rSound[ 0 ] = null;\r
+ ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CWAV>.ErrCode.OK;\r
+ Trace.TraceError( "サウンドの作成に失敗しました。({0})({1})", cwav.strコメント文, str );\r
+ if ( e != null ) // e==nullのことがある\r
+ {\r
+ //Trace.TraceError( e.Data.Values.ToString());\r
+ //if ( e.InnerException != null )\r
+ //{\r
+ // Trace.TraceError( e.InnerException.ToString() );\r
+ //}\r
+ //Trace.TraceError( e.StackTrace );\r
+ Trace.TraceError( e.Message );\r
+ }\r
+ else\r
+ {\r
+ Trace.TraceError( "Exception e==nullでした" );\r
+ }\r
+ }\r
+\r
+ if ( cwav.rSound[ 0 ] == null || cwav.rSound[ 0 ].bストリーム再生する )\r
+ {\r
+ for ( int j = 1; j < cwav.rSound.GetLength( 0 ); j++ )\r
{\r
cwav.rSound[ j ] = null;\r
}\r
- continue;\r
}\r
+ else\r
+ {\r
+ try\r
+ {\r
+ for ( int j = 1; j < cwav.rSound.GetLength( 0 ); j++ )\r
+ {\r
+ cwav.rSound[ j ] = (CSound) cwav.rSound[ 0 ].Clone(); // #24007 2011.9.5 yyagi add: to accelerate loading chip sounds\r
+ CDTXMania.Sound管理.tサウンドを登録する( cwav.rSound[ j ] );\r
+ }\r
+ }\r
+ catch ( Exception exception )\r
+ {\r
+ Trace.TraceError( "サウンドの生成に失敗しました。({0})({1})({2})", exception.Message, cwav.strコメント文, str );\r
+ ( (tLoadState) tlws ).errcode = CLoadInParallelBase<CWAV>.ErrCode.FatalError;\r
+ for ( int j = 0; j < cwav.rSound.GetLength( 0 ); j++ )\r
+ {\r
+ cwav.rSound[ j ] = null;\r
+ }\r
+ }\r
+ }\r
+ //Debug.WriteLine( str + ": end loading" );\r
+ //base.t読み込みMain( tlws );\r
}\r
}\r
+ public void tWAVの読み込み()\r
+ {\r
+ Cwav並列読み込み c = new Cwav並列読み込み( PATH_WAV, strフォルダ名 );\r
+ //Cwav並列読み込み c = new Cwav並列読み込み();\r
+ //c.SetPaths( PATH_WAV, strフォルダ名 ); \r
+ c.bActivateParallelLoad = CDTXMania.ConfigIni.bLoadWAVInParallel;\r
+ // Debug.WriteLine( "BEGIN WAV LOAD (" + listWAV.Count + ")" );\r
+ c.t読み込み( listWAV );\r
+ // Debug.WriteLine( "END WAV LOAD" );\r
+ }\r
+\r
+\r
public static string tZZ( int n )\r
{\r
if( n < 0 || n >= 36 * 36 )\r
}\r
if( this.e種別 != E種別.SMF )\r
{\r
- StreamReader reader = new StreamReader( strファイル名, Encoding.GetEncoding( "shift-jis" ) );\r
- string str2 = reader.ReadToEnd();\r
- reader.Close();\r
- this.t入力・全入力文字列から( str2, db再生速度, nBGMAdjust );\r
+ try\r
+ {\r
+ StreamReader reader = new StreamReader( strファイル名, Encoding.GetEncoding( "shift-jis" ) );\r
+ string str2 = reader.ReadToEnd();\r
+ reader.Close();\r
+ this.t入力・全入力文字列から( str2, db再生速度, nBGMAdjust );\r
+ }\r
+ catch\r
+ {\r
+ }\r
}\r
else\r
{\r
this.n無限管理SIZE = null;\r
if( !this.bヘッダのみ )\r
{\r
- int num26;\r
+ int ch;\r
CBPM cbpm = null;\r
foreach( CBPM cbpm2 in this.listBPM.Values )\r
{\r
cbpm.n表記上の番号 = 0;\r
cbpm.dbBPM値 = 120.0;\r
this.listBPM.Add( cbpm.n内部番号, cbpm );\r
- CChip item = new CChip();\r
- item.n発声位置 = 0;\r
- item.nチャンネル番号 = 8;\r
- item.n整数値 = 0;\r
- item.n整数値・内部番号 = cbpm.n内部番号;\r
- this.listChip.Add( item );\r
+ CChip chip = new CChip();\r
+ chip.n発声位置 = 0;\r
+ chip.nチャンネル番号 = 8; // 拡張BPM\r
+ chip.n整数値 = 0;\r
+ chip.n整数値・内部番号 = cbpm.n内部番号;\r
+ this.listChip.Add( chip );\r
}\r
else\r
{\r
- CChip chip2 = new CChip();\r
- chip2.n発声位置 = 0;\r
- chip2.nチャンネル番号 = 8;\r
- chip2.n整数値 = 0;\r
- chip2.n整数値・内部番号 = cbpm.n内部番号;\r
- this.listChip.Add( chip2 );\r
+ CChip chip = new CChip();\r
+ chip.n発声位置 = 0;\r
+ chip.nチャンネル番号 = 8; // 拡張BPM\r
+ chip.n整数値 = 0;\r
+ chip.n整数値・内部番号 = cbpm.n内部番号;\r
+ this.listChip.Add( chip );\r
}\r
if( this.listBMP.ContainsKey( 0 ) )\r
{\r
- CChip chip4 = new CChip();\r
- chip4.n発声位置 = 0;\r
- chip4.nチャンネル番号 = 4;\r
- chip4.n整数値 = 0;\r
- chip4.n整数値・内部番号 = 0;\r
- CChip chip3 = chip4;\r
- this.listChip.Add( chip3 );\r
+ CChip chip = new CChip();\r
+ chip.n発声位置 = 0;\r
+ chip.nチャンネル番号 = 4; // BGA (レイヤBGA1)\r
+ chip.n整数値 = 0;\r
+ chip.n整数値・内部番号 = 0;\r
+ //CChip chip3 = chip;\r
+ this.listChip.Add( chip );\r
}\r
foreach( CWAV cwav in this.listWAV.Values )\r
{\r
cwav.n音量 = 100;\r
}\r
}\r
- foreach( CWAV cwav2 in this.listWAV.Values )\r
+ foreach( CWAV cwav in this.listWAV.Values )\r
{\r
- foreach( CChip chip5 in this.listChip )\r
+ foreach( CChip chip in this.listChip )\r
{\r
- if( chip5.n整数値・内部番号 == cwav2.n内部番号 )\r
+ if( chip.n整数値・内部番号 == cwav.n内部番号 )\r
{\r
- chip5.dbチップサイズ倍率 = ( (double) cwav2.nチップサイズ ) / 100.0;\r
+ chip.dbチップサイズ倍率 = ( (double) cwav.nチップサイズ ) / 100.0;\r
+ if (chip.nチャンネル番号 == 0x01 ) // BGMだったら\r
+ {\r
+ cwav.bIsOnBGMLane = true;\r
+ }\r
}\r
}\r
}\r
- for( int m = 0xb1; m <= 0xbb; m++ )\r
+ for( int m = 0xb1; m <= 0xbb; m++ ) // 空打ち(ドラム, ギター, ベース) LCの空打ちが入ってないけど・・・\r
{\r
- foreach( CChip chip6 in this.listChip )\r
+ foreach( CChip chip in this.listChip )\r
{\r
- if( chip6.nチャンネル番号 == m )\r
+ if( chip.nチャンネル番号 == m )\r
{\r
- CChip chip7 = new CChip();\r
- chip7.n発声位置 = 0;\r
- chip7.nチャンネル番号 = chip6.nチャンネル番号;\r
- chip7.n整数値 = chip6.n整数値;\r
- chip7.n整数値・内部番号 = chip6.n整数値・内部番号;\r
- this.listChip.Add( chip7 );\r
+ CChip c = new CChip();\r
+ c.n発声位置 = 0;\r
+ c.nチャンネル番号 = chip.nチャンネル番号;\r
+ c.n整数値 = chip.n整数値;\r
+ c.n整数値・内部番号 = chip.n整数値・内部番号;\r
+ this.listChip.Add( c );\r
break;\r
}\r
}\r
if( this.listChip.Count > 0 )\r
{\r
this.listChip.Sort();\r
- double num4 = 1.0;\r
- int num5 = ( this.listChip[ this.listChip.Count - 1 ].n発声位置 + 384 ) - ( this.listChip[ this.listChip.Count - 1 ].n発声位置 % 384 );\r
- for( int num6 = 0; num6 <= num5; num6 += 384 )\r
+ double barlength = 1.0;\r
+ int nEndOfSong = ( this.listChip[ this.listChip.Count - 1 ].n発声位置 + 384 ) - ( this.listChip[ this.listChip.Count - 1 ].n発声位置 % 384 );\r
+ for( int bar = 0; bar <= nEndOfSong; bar += 384 )\r
{\r
- CChip chip8 = new CChip();\r
- chip8.n発声位置 = num6;\r
- chip8.nチャンネル番号 = 0x50;\r
- chip8.n整数値 = 36 * 36 - 1;\r
- this.listChip.Add( chip8 );\r
+ CChip chip = new CChip();\r
+ chip.n発声位置 = bar;\r
+ chip.nチャンネル番号 = 0x50; // 小節線\r
+ chip.n整数値 = 36 * 36 - 1;\r
+ this.listChip.Add( chip );\r
}\r
this.listChip.Sort();\r
int num7 = 0;\r
int num8 = 0;\r
- for( int num9 = 0; num9 < num5; num9 += 384 )\r
+ for( int num9 = 0; num9 < nEndOfSong; num9 += 384 )\r
{\r
int num10 = 0;\r
while( ( num8 < this.listChip.Count ) && ( this.listChip[ num8 ].n発声位置 < ( num9 + 384 ) ) )\r
{\r
- if( this.listChip[ num8 ].nチャンネル番号 == 0xc1 )\r
+ if( this.listChip[ num8 ].nチャンネル番号 == 0xc1 ) // 拍線シフト\r
{\r
num10 = this.listChip[ num8 ].n発声位置 - num9;\r
}\r
}\r
if( ( this.e種別 == E種別.BMS ) || ( this.e種別 == E種別.BME ) )\r
{\r
- num4 = 1.0;\r
+ barlength = 1.0;\r
}\r
while( ( num7 < this.listChip.Count ) && ( this.listChip[ num7 ].n発声位置 <= num9 ) )\r
{\r
- if( this.listChip[ num7 ].nチャンネル番号 == 2 )\r
+ if( this.listChip[ num7 ].nチャンネル番号 == 2 ) // bar length\r
{\r
- num4 = this.listChip[ num7 ].db実数値;\r
+ barlength = this.listChip[ num7 ].db実数値;\r
}\r
num7++;\r
}\r
for( int num11 = 0; num11 < 100; num11++ )\r
{\r
- int num12 = (int) ( ( (double) ( 384 * num11 ) ) / ( 4.0 * num4 ) );\r
+ int num12 = (int) ( ( (double) ( 384 * num11 ) ) / ( 4.0 * barlength ) );\r
if( ( num12 + num10 ) >= 384 )\r
{\r
break;\r
}\r
if( ( ( num12 + num10 ) % 384 ) != 0 )\r
{\r
- CChip chip9 = new CChip();\r
- chip9.n発声位置 = ( num9 + num12 ) + num10;\r
- chip9.nチャンネル番号 = 0x51;\r
- chip9.n整数値 = 36 * 36 - 1;\r
- this.listChip.Add( chip9 );\r
+ CChip chip = new CChip();\r
+ chip.n発声位置 = ( num9 + num12 ) + num10;\r
+ chip.nチャンネル番号 = 0x51;\r
+ chip.n整数値 = 36 * 36 - 1;\r
+ this.listChip.Add( chip );\r
}\r
}\r
}\r
}\r
startIndex++;\r
}\r
- if( ( ( this.listChip[ i ].nチャンネル番号 == 80 ) || ( this.listChip[ i ].nチャンネル番号 == 0x51 ) ) && ( this.listChip[ i ].n整数値 == 0x50f ) )\r
+ if( ( ( this.listChip[ i ].nチャンネル番号 == 0x50 ) || ( this.listChip[ i ].nチャンネル番号 == 0x51 ) ) && ( this.listChip[ i ].n整数値 == (36 * 36 - 1) ) )\r
{\r
this.listChip[ i ].b可視 = flag;\r
}\r
}\r
double bpm = 120.0;\r
- double num15 = 1.0;\r
- int num16 = 0;\r
- int num17 = 0;\r
+ double dbBarLength = 1.0;\r
+ int n発声位置 = 0;\r
+ int ms = 0;\r
int nBar = 0;\r
- foreach( CChip chip10 in this.listChip )\r
+ foreach( CChip chip in this.listChip )\r
{\r
- chip10.n発声時刻ms = num17 + ( (int) ( ( ( 0x271 * ( chip10.n発声位置 - num16 ) ) * num15 ) / bpm ) );\r
- if( ( ( this.e種別 == E種別.BMS ) || ( this.e種別 == E種別.BME ) ) && ( ( num15 != 1.0 ) && ( ( chip10.n発声位置 / 384) != nBar ) ) )\r
+ chip.n発声時刻ms = ms + ( (int) ( ( ( 0x271 * ( chip.n発声位置 - n発声位置 ) ) * dbBarLength ) / bpm ) );\r
+ if( ( ( this.e種別 == E種別.BMS ) || ( this.e種別 == E種別.BME ) ) && ( ( dbBarLength != 1.0 ) && ( ( chip.n発声位置 / 384) != nBar ) ) )\r
{\r
- num16 = chip10.n発声位置;\r
- num17 = chip10.n発声時刻ms;\r
- num15 = 1.0;\r
+ n発声位置 = chip.n発声位置;\r
+ ms = chip.n発声時刻ms;\r
+ dbBarLength = 1.0;\r
}\r
- nBar = chip10.n発声位置 / 384;\r
- num26 = chip10.nチャンネル番号;\r
- switch( num26 )\r
+ nBar = chip.n発声位置 / 384;\r
+ ch = chip.nチャンネル番号;\r
+ switch( ch )\r
{\r
case 0x02:\r
{\r
- num16 = chip10.n発声位置;\r
- num17 = chip10.n発声時刻ms;\r
- num15 = chip10.db実数値;\r
+ n発声位置 = chip.n発声位置;\r
+ ms = chip.n発声時刻ms;\r
+ dbBarLength = chip.db実数値;\r
continue;\r
}\r
- case 0x03:\r
+ case 0x03: // BPM\r
{\r
- num16 = chip10.n発声位置;\r
- num17 = chip10.n発声時刻ms;\r
- bpm = this.BASEBPM + chip10.n整数値;\r
+ n発声位置 = chip.n発声位置;\r
+ ms = chip.n発声時刻ms;\r
+ bpm = this.BASEBPM + chip.n整数値;\r
continue;\r
}\r
- case 0x04:\r
- case 0x07:\r
- case 0x55:\r
- case 0x56:\r
- case 0x57:\r
- case 0x58:\r
- case 0x59:\r
- case 0x60:\r
+ case 0x04: // BGA (レイヤBGA1)\r
+ case 0x07: // レイヤBGA2\r
+ case 0x55: // レイヤBGA3\r
+ case 0x56: // レイヤBGA4\r
+ case 0x57: // レイヤBGA5\r
+ case 0x58: // レイヤBGA6\r
+ case 0x59: // レイヤBGA7\r
+ case 0x60: // レイヤBGA8\r
break;\r
\r
- case 0x05:\r
- case 0x06:\r
- case 0x5A:\r
- case 0x5b:\r
- case 0x5c:\r
- case 0x5d:\r
- case 0x5e:\r
- case 0x5f:\r
+ case 0x05: // Extended Object (非対応)\r
+ case 0x06: // Missアニメ (非対応)\r
+ case 0x5A: // 未定義\r
+ case 0x5b: // 未定義\r
+ case 0x5c: // 未定義\r
+ case 0x5d: // 未定義\r
+ case 0x5e: // 未定義\r
+ case 0x5f: // 未定義\r
{\r
continue;\r
}\r
- case 8:\r
+ case 0x08: // 拡張BPM\r
{\r
- num16 = chip10.n発声位置;\r
- num17 = chip10.n発声時刻ms;\r
- if( this.listBPM.ContainsKey( chip10.n整数値・内部番号 ) )\r
+ n発声位置 = chip.n発声位置;\r
+ ms = chip.n発声時刻ms;\r
+ if( this.listBPM.ContainsKey( chip.n整数値・内部番号 ) )\r
{\r
- bpm = ( ( this.listBPM[ chip10.n整数値・内部番号 ].n表記上の番号 == 0 ) ? 0.0 : this.BASEBPM ) + this.listBPM[ chip10.n整数値・内部番号 ].dbBPM値;\r
+ bpm = ( ( this.listBPM[ chip.n整数値・内部番号 ].n表記上の番号 == 0 ) ? 0.0 : this.BASEBPM ) + this.listBPM[ chip.n整数値・内部番号 ].dbBPM値;\r
}\r
continue;\r
}\r
- case 0x54:\r
+ case 0x54: // 動画再生\r
{\r
- if( this.listAVIPAN.ContainsKey( chip10.n整数値 ) )\r
+ if( this.listAVIPAN.ContainsKey( chip.n整数値 ) )\r
{\r
- int num21 = num17 + ( (int) ( ( ( 0x271 * ( chip10.n発声位置 - num16 ) ) * num15 ) / bpm ) );\r
- int num22 = num17 + ( (int) ( ( ( 0x271 * ( ( chip10.n発声位置 + this.listAVIPAN[ chip10.n整数値 ].n移動時間ct ) - num16 ) ) * num15 ) / bpm ) );\r
- chip10.n総移動時間 = num22 - num21;\r
+ int num21 = ms + ( (int) ( ( ( 0x271 * ( chip.n発声位置 - n発声位置 ) ) * dbBarLength ) / bpm ) );\r
+ int num22 = ms + ( (int) ( ( ( 0x271 * ( ( chip.n発声位置 + this.listAVIPAN[ chip.n整数値 ].n移動時間ct ) - n発声位置 ) ) * dbBarLength ) / bpm ) );\r
+ chip.n総移動時間 = num22 - num21;\r
}\r
continue;\r
}\r
continue;\r
}\r
}\r
- if( this.listBGAPAN.ContainsKey( chip10.n整数値 ) )\r
+ if( this.listBGAPAN.ContainsKey( chip.n整数値 ) )\r
{\r
- int num19 = num17 + ( (int) ( ( ( 0x271 * ( chip10.n発声位置 - num16 ) ) * num15 ) / bpm ) );\r
- int num20 = num17 + ( (int) ( ( ( 0x271 * ( ( chip10.n発声位置 + this.listBGAPAN[ chip10.n整数値 ].n移動時間ct ) - num16 ) ) * num15 ) / bpm ) );\r
- chip10.n総移動時間 = num20 - num19;\r
+ int num19 = ms + ( (int) ( ( ( 0x271 * ( chip.n発声位置 - n発声位置 ) ) * dbBarLength ) / bpm ) );\r
+ int num20 = ms + ( (int) ( ( ( 0x271 * ( ( chip.n発声位置 + this.listBGAPAN[ chip.n整数値 ].n移動時間ct ) - n発声位置 ) ) * dbBarLength ) / bpm ) );\r
+ chip.n総移動時間 = num20 - num19;\r
}\r
}\r
if( this.db再生速度 > 0.0 )\r
{\r
- foreach( CChip chip11 in this.listChip )\r
+ foreach( CChip chip in this.listChip )\r
{\r
- chip11.n発声時刻ms = (int) ( ( (double) chip11.n発声時刻ms ) / this.db再生速度 );\r
+ chip.n発声時刻ms = (int) ( ( (double) chip.n発声時刻ms ) / this.db再生速度 );\r
}\r
}\r
this.nBGMAdjust = 0;\r
{\r
this.n可視チップ数[ n ] = 0;\r
}\r
- foreach( CChip chip12 in this.listChip )\r
+ foreach( CChip chip in this.listChip )\r
{\r
- int num24 = chip12.nチャンネル番号;\r
- if( ( 0x11 <= num24 ) && ( num24 <= 0x1a ) )\r
+ int c = chip.nチャンネル番号;\r
+ if( ( 0x11 <= c ) && ( c <= 0x1a ) )\r
{\r
- this.n可視チップ数[ num24 - 0x11 ]++;\r
+ this.n可視チップ数[ c - 0x11 ]++;\r
}\r
- if( ( 0x20 <= num24 ) && ( num24 <= 0x27 ) )\r
+ if( ( 0x20 <= c ) && ( c <= 0x27 ) )\r
{\r
this.n可視チップ数.Guitar++;\r
}\r
- if( ( 0xA0 <= num24 ) && ( num24 <= 0xa7 ) )\r
+ if( ( 0xA0 <= c ) && ( c <= 0xa7 ) )\r
{\r
this.n可視チップ数.Bass++;\r
}\r
}\r
- foreach( CChip chip13 in this.listChip )\r
+ foreach( CChip chip in this.listChip )\r
{\r
- if( ( chip13.bWAVを使うチャンネルである && this.listWAV.ContainsKey( chip13.n整数値・内部番号 ) ) && !this.listWAV[ chip13.n整数値・内部番号 ].listこのWAVを使用するチャンネル番号の集合.Contains( chip13.nチャンネル番号 ) )\r
+ if( ( chip.bWAVを使うチャンネルである && this.listWAV.ContainsKey( chip.n整数値・内部番号 ) ) && !this.listWAV[ chip.n整数値・内部番号 ].listこのWAVを使用するチャンネル番号の集合.Contains( chip.nチャンネル番号 ) )\r
{\r
- this.listWAV[ chip13.n整数値・内部番号 ].listこのWAVを使用するチャンネル番号の集合.Add( chip13.nチャンネル番号 );\r
+ this.listWAV[ chip.n整数値・内部番号 ].listこのWAVを使用するチャンネル番号の集合.Add( chip.nチャンネル番号 );\r
}\r
}\r
byte[] buffer = null;\r
if( buffer != null )\r
{\r
byte[] buffer2 = new MD5CryptoServiceProvider().ComputeHash( buffer );\r
- StringBuilder builder4 = new StringBuilder();\r
- foreach( byte num25 in buffer2 )\r
+ StringBuilder sb = new StringBuilder();\r
+ foreach( byte b in buffer2 )\r
{\r
- builder4.Append( num25.ToString( "x2" ) );\r
+ sb.Append( b.ToString( "x2" ) );\r
}\r
- this.strハッシュofDTXファイル = builder4.ToString();\r
+ this.strハッシュofDTXファイル = sb.ToString();\r
}\r
else\r
{\r
#region [ bLogDTX詳細ログ出力 ]\r
if ( CDTXMania.ConfigIni.bLogDTX詳細ログ出力 )\r
{\r
- foreach( CWAV cwav3 in this.listWAV.Values )\r
+ foreach( CWAV cwav in this.listWAV.Values )\r
{\r
- Trace.TraceInformation( cwav3.ToString() );\r
+ Trace.TraceInformation( cwav.ToString() );\r
}\r
foreach( CAVI cavi in this.listAVI.Values )\r
{\r
{\r
Trace.TraceInformation( cbpm3.ToString() );\r
}\r
- foreach( CChip chip14 in this.listChip )\r
+ foreach( CChip chip in this.listChip )\r
{\r
- Trace.TraceInformation( chip14.ToString() );\r
+ Trace.TraceInformation( chip.ToString() );\r
}\r
}\r
#endregion\r
n音量 = this.n無限管理VOL[ zz ],\r
strファイル名 = strパラメータ,\r
strコメント文 = strコメント,\r
+ bIsOnBGMLane= false\r
};\r
\r
#region [ WAVリストに {内部番号, wav} の組を登録。]\r