• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版c58afd94ec5759ffb1251536d2d4af06822a21c6 (tree)
时间2017-05-06 22:23:32
作者くまかみ工房 <kumakamikoubou@gmai...>
Commiterくまかみ工房

Log Message

DirectSoundを選択すると例外が発生するミス、ならびにWASAPIを正常に選択できないミスを修正。

SharpDX.DirectSound.SecondarySoundBuffer.GetFormat() の使い方を誤っていたので、GetFormat() しなくてもいいように、private メンバでフォーマットを持っておくよう変更。
WASAPIの初期化時、BASS_Init() の device が 0 (no sound)ではなく -1 (default device) になっていたミスを修正。
WASAPIの初期化時、BASS_WASAPI_Init() の device を -1 (default output device) から、手動で列挙して見つけたデフォルトデバイス番号へせっかくなので変更。
DTXManiaのタイトルバーのバージョンを "108+(170506)"に修正。
sondlist.db, songs.dl を .gitignore に追加。

更改概述

  • delete: "DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\345\205\250\344\275\223/CDTXMania.cs"
  • delete: "FDK17\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/CSound.cs"
  • delete: "FDK17\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/CSoundDeviceWASAPI.cs"
  • delete: "\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/DTXCreator.exe"
  • delete: "\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/DTXManiaGR.exe"
  • delete: "\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/dll/FDK.dll"
  • delete: "\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/ja-JP/DTXCreator.resources.dll"
  • delete: "\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/ja-JP/DTXManiaGR.resources.dll"
  • modified: .gitignore (diff)

差异

--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@
88 *.sln.docstates
99 Config.xml
1010 DTXManiaLog.txt
11+songlist.db
12+songs.db
1113
1214 # User-specific files (MonoDevelop/Xamarin Studio)
1315 *.userprefs
--- "a/DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\345\205\250\344\275\223/CDTXMania.cs"
+++ "b/DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\345\205\250\344\275\223/CDTXMania.cs"
@@ -23,7 +23,7 @@ namespace DTXMania
2323 {
2424 // プロパティ
2525 #region [ properties ]
26- public static readonly string VERSION = "108(170401)";
26+ public static readonly string VERSION = "108+(170506)";
2727 public static readonly string SLIMDXDLL = "c_net20x86_Jun2010";
2828 public static readonly string D3DXDLL = "d3dx9_43.dll"; // June 2010
2929 //public static readonly string D3DXDLL = "d3dx9_42.dll"; // February 2010
--- "a/FDK17\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/CSound.cs"
+++ "b/FDK17\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/CSound.cs"
@@ -974,9 +974,11 @@ namespace FDK
974974 {
975975 // セカンダリバッファを作成し、PCMデータを書き込む。
976976
977+ this._Format = wfx;
978+
977979 this.Buffer = new SecondarySoundBuffer( DirectSound, new SoundBufferDescription()
978980 {
979- Format = ( wfx.Encoding == WaveFormatEncoding.Pcm ) ? wfx : (SharpDX.Multimedia.WaveFormatExtensible) wfx,
981+ Format = this._Format,
980982 Flags = flags,
981983 BufferBytes = nPCMサイズbyte,
982984 } );
@@ -991,13 +993,9 @@ namespace FDK
991993
992994 // DTXMania用に追加
993995 this.nオリジナルの周波数 = wfx.SampleRate;
994- var format = new SharpDX.Multimedia.WaveFormatExtensible[] { new SharpDX.Multimedia.WaveFormatExtensible( 0, 0, 0 ) };
995- this.Buffer.GetFormat( format, Marshal.SizeOf<SharpDX.Multimedia.WaveFormatExtensible>(), out _ );
996- n総演奏時間ms = (int) ( ( (double) nPCMサイズbyte ) / ( format[ 0 ].AverageBytesPerSecond * 0.001 ) );
997-
996+ n総演奏時間ms = (int) ( ( (double) nPCMサイズbyte ) / ( this._Format.AverageBytesPerSecond * 0.001 ) );
998997
999998 // インスタンスリストに登録。
1000-
1001999 CSound.listインスタンス.Add( this );
10021000 }
10031001
@@ -1238,13 +1236,10 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
12381236 }
12391237 else if( this.bDirectSoundである )
12401238 {
1241- var format = new SharpDX.Multimedia.WaveFormatExtensible[] { new SharpDX.Multimedia.WaveFormatExtensible( 0, 0, 0 ) };
1242- this.Buffer.GetFormat( format, Marshal.SizeOf<SharpDX.Multimedia.WaveFormatExtensible>(), out _ );
1243-
1244- int n位置sample = (int) ( format[ 0 ].SampleRate * n位置ms * 0.001 * _db周波数倍率 * _db再生速度 ); // #30839 2013.2.24 yyagi; add _db周波数倍率 and _db再生速度
1239+ int n位置sample = (int) ( this._Format.SampleRate * n位置ms * 0.001 * _db周波数倍率 * _db再生速度 ); // #30839 2013.2.24 yyagi; add _db周波数倍率 and _db再生速度
12451240 try
12461241 {
1247- this.Buffer.CurrentPosition = n位置sample * format[ 0 ].BlockAlign;
1242+ this.Buffer.CurrentPosition = n位置sample * this._Format.BlockAlign;
12481243 }
12491244 catch ( Exception e )
12501245 {
@@ -1272,11 +1267,7 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
12721267 {
12731268 this.Buffer.GetCurrentPosition( out int pos, out _ );
12741269 n位置byte = (long) pos;
1275-
1276- var format = new SharpDX.Multimedia.WaveFormatExtensible[] { new SharpDX.Multimedia.WaveFormatExtensible( 0, 0, 0 ) };
1277- this.Buffer.GetFormat( format, Marshal.SizeOf<SharpDX.Multimedia.WaveFormatExtensible>(), out _ );
1278-
1279- db位置ms = n位置byte / format[ 0 ].SampleRate / 0.001 / _db周波数倍率 / _db再生速度;
1270+ db位置ms = n位置byte / this._Format.SampleRate / 0.001 / _db周波数倍率 / _db再生速度;
12801271 }
12811272 else
12821273 {
@@ -1502,6 +1493,7 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
15021493 private double _db周波数倍率 = 1.0;
15031494 private double _db再生速度 = 1.0;
15041495 private bool bIs1倍速再生 = true;
1496+ private WaveFormat _Format;
15051497
15061498 private void tBASSサウンドを作成する( string strファイル名, int hMixer, BASSFlag flags )
15071499 {
--- "a/FDK17\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/CSoundDeviceWASAPI.cs"
+++ "b/FDK17\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/CSoundDeviceWASAPI.cs"
@@ -172,7 +172,6 @@ namespace FDK
172172
173173 // BASS の初期化。
174174
175- int nデバイス = 0; // 0:"no device" … BASS からはデバイスへアクセスさせない。アクセスは BASSWASAPI アドオンから行う。
176175 int n周波数 = 44100; // 仮決め。lデバイス(≠ドライバ)がネイティブに対応している周波数であれば何でもいい?ようだ。BASSWASAPIでデバイスの周波数は変えられる。いずれにしろBASSMXで自動的にリサンプリングされる。
177176 // BASS_Initは、WASAPI初期化の直前に行うよう変更。WASAPIのmix周波数を使って初期化することで、余計なリサンプリング処理を省き高速化するため。
178177 //if( !Bass.BASS_Init( nデバイス, n周波数, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) )
@@ -200,7 +199,6 @@ namespace FDK
200199
201200 // BASS WASAPI の初期化。
202201
203- nデバイス = -1;
204202 n周波数 = 0; // デフォルトデバイスの周波数 (0="mix format" sample rate)
205203 int nチャンネル数 = 0; // デフォルトデバイスのチャンネル数 (0="mix format" channels)
206204 this.tWasapiProc = new WASAPIPROC( this.tWASAPI処理 ); // アンマネージに渡す delegate は、フィールドとして保持しておかないとGCでアドレスが変わってしまう。
@@ -221,7 +219,7 @@ namespace FDK
221219 }
222220 if ( nDevNo != -1 )
223221 {
224- if ( !Bass.BASS_Init( nデバイス, deviceInfo.mixfreq, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) )
222+ if ( !Bass.BASS_Init( 0, deviceInfo.mixfreq, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) ) // device = 0:"no device": BASS からはデバイスへアクセスさせない。アクセスは BASSWASAPI アドオンから行う。
225223 throw new Exception( string.Format( "BASS (WASAPI) の初期化に失敗しました。(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
226224
227225
@@ -246,7 +244,7 @@ namespace FDK
246244 {
247245 flags |= BASSWASAPIInit.BASS_WASAPI_EVENT; // Win7以降の場合は、WASAPIをevent drivenで動作させてCPU負荷減、レイテインシ改善
248246 }
249- if ( BassWasapi.BASS_WASAPI_Init( nデバイス, n周波数, nチャンネル数, flags, ( n希望バッファサイズms / 1000.0f ), ( n更新間隔ms / 1000.0f ), this.tWasapiProc, IntPtr.Zero ) )
247+ if ( BassWasapi.BASS_WASAPI_Init( nDevNo, n周波数, nチャンネル数, flags, ( n希望バッファサイズms / 1000.0f ), ( n更新間隔ms / 1000.0f ), this.tWasapiProc, IntPtr.Zero ) )
250248 {
251249 if( mode == Eデバイスモード.排他 )
252250 {
Binary files "a/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/DTXCreator.exe" and "b/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/DTXCreator.exe" differ
Binary files "a/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/DTXManiaGR.exe" and "b/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/DTXManiaGR.exe" differ
Binary files "a/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/dll/FDK.dll" and "b/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/dll/FDK.dll" differ
Binary files "a/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/ja-JP/DTXCreator.resources.dll" and "b/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/ja-JP/DTXCreator.resources.dll" differ
Binary files "a/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/ja-JP/DTXManiaGR.resources.dll" and "b/\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200/ja-JP/DTXManiaGR.resources.dll" differ