• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revision3fac3705623c715f196f1e644a9debbb8ca58bc1 (tree)
Zeit2013-04-01 00:39:46
Autoryyagi <yyagi@16f4...>
Commiteryyagi

Log Message

#31076 TimeStretch=ON時の動作を高速化。(hBassStreamをプロパティとして扱うのを止めた。少し設計が汚くなったが、やむなし。)
#xxxxx バージョン情報を変更。

git-svn-id: http://svn.osdn.jp/svnroot/dtxmania/trunk@547 16f42ceb-6dc6-49c8-ba94-f2d53467949d

Ändern Zusammenfassung

  • 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: "\345\256\237\350\241\214\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200(DTXCreator)/FDK.dll"
  • 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/FDK.dll"

Diff

--- "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"
@@ -20,7 +20,7 @@ namespace DTXMania
2020 {
2121 // プロパティ
2222 #region [ properties ]
23- public static readonly string VERSION = "097(130401)";
23+ public static readonly string VERSION = "097(130405)";
2424 public static readonly string SLIMDXDLL = "c_net20x86_Jun2010";
2525 public static readonly string D3DXDLL = "d3dx9_43.dll"; // June 2010
2626 //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"
@@ -393,6 +393,15 @@ namespace FDK
393393 bIs1倍速再生 = ( _db再生速度 == 1.000f );
394394 if ( bBASSサウンドである )
395395 {
396+ if ( _hTempoStream != 0 && !this.bIs1倍速再生 ) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する
397+ {
398+ this.hBassStream = _hTempoStream;
399+ }
400+ else
401+ {
402+ this.hBassStream = _hBassStream;
403+ }
404+
396405 if ( CSound管理.bIsTimeStretch )
397406 {
398407 Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_TEMPO, (float) ( db再生速度 * 100 - 100 ) );
@@ -1117,9 +1126,10 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
11171126 BassMix.BASS_Mixer_ChannelRemove( this._hTempoStream );
11181127 Bass.BASS_StreamFree( this._hTempoStream );
11191128 }
1120- BassMix.BASS_Mixer_ChannelRemove( this.hBassStream );
1121- Bass.BASS_StreamFree( this.hBassStream );
1129+ BassMix.BASS_Mixer_ChannelRemove( this._hBassStream );
1130+ Bass.BASS_StreamFree( this._hBassStream );
11221131 this.hBassStream = -1;
1132+ this._hBassStream = -1;
11231133 this._hTempoStream = 0;
11241134 //-----------------
11251135 #endregion
@@ -1208,24 +1218,27 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
12081218 protected GCHandle hGC;
12091219 protected int _hTempoStream = 0;
12101220 protected int _hBassStream = -1; // ASIO, WASAPI 用
1211- protected int hBassStream
1212- {
1213- get
1214- {
1215- if ( _hTempoStream != 0 && !this.bIs1倍速再生 ) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する
1216- {
1217- return _hTempoStream;
1218- }
1219- else
1220- {
1221- return _hBassStream;
1222- }
1223- }
1224- set
1225- {
1226- _hBassStream = value;
1227- }
1228- }
1221+ protected int hBassStream = 0; // #31076 2013.4.1 yyagi; プロパティとして実装すると動作が低速になったため、
1222+ // tBASSサウンドを作成する・ストリーム生成後の共通処理()のタイミングと、
1223+ // 再生速度を変更したタイミングでのみ、
1224+ // hBassStreamを更新するようにした。
1225+ //{
1226+ // get
1227+ // {
1228+ // if ( _hTempoStream != 0 && !this.bIs1倍速再生 ) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する
1229+ // {
1230+ // return _hTempoStream;
1231+ // }
1232+ // else
1233+ // {
1234+ // return _hBassStream;
1235+ // }
1236+ // }
1237+ // set
1238+ // {
1239+ // _hBassStream = value;
1240+ // }
1241+ //}
12291242 protected SoundBuffer Buffer = null; // DirectSound 用
12301243 protected DirectSound DirectSound;
12311244 protected int hMixer = -1; // 設計壊してゴメン Mixerに後で登録するときに使う
@@ -1273,11 +1286,11 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
12731286
12741287 // BASSファイルストリームを作成。
12751288
1276- this.hBassStream = Bass.BASS_StreamCreateFile( strファイル名, 0, 0, flags );
1277- if( this.hBassStream == 0 )
1289+ this._hBassStream = Bass.BASS_StreamCreateFile( strファイル名, 0, 0, flags );
1290+ if( this._hBassStream == 0 )
12781291 throw new Exception( string.Format( "サウンドストリームの生成に失敗しました。(BASS_StreamCreateFile)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
12791292
1280- nBytes = Bass.BASS_ChannelGetLength( this.hBassStream );
1293+ nBytes = Bass.BASS_ChannelGetLength( this._hBassStream );
12811294
12821295 tBASSサウンドを作成する・ストリーム生成後の共通処理( hMixer );
12831296 }
@@ -1290,11 +1303,11 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
12901303
12911304 // BASSファイルストリームを作成。
12921305
1293- this.hBassStream = Bass.BASS_StreamCreateFile( hGC.AddrOfPinnedObject(), 0, byArrWAVファイルイメージ.Length, flags );
1294- if ( this.hBassStream == 0 )
1306+ this._hBassStream = Bass.BASS_StreamCreateFile( hGC.AddrOfPinnedObject(), 0, byArrWAVファイルイメージ.Length, flags );
1307+ if ( this._hBassStream == 0 )
12951308 throw new Exception( string.Format( "サウンドストリームの生成に失敗しました。(BASS_StreamCreateFile)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
12961309
1297- nBytes = Bass.BASS_ChannelGetLength( this.hBassStream );
1310+ nBytes = Bass.BASS_ChannelGetLength( this._hBassStream );
12981311
12991312 tBASSサウンドを作成する・ストリーム生成後の共通処理( hMixer );
13001313 }
@@ -1319,8 +1332,8 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
13191332 // BASSファイルストリームを作成。
13201333
13211334 //this.hBassStream = Bass.BASS_StreamCreate( xa.xaheader.nSamplesPerSec, xa.xaheader.nChannels, BASSFlag.BASS_STREAM_DECODE, _myStreamCreate, IntPtr.Zero );
1322- this.hBassStream = Bass.BASS_StreamCreate( (int) wfx.nSamplesPerSec, (int) wfx.nChannels, BASSFlag.BASS_STREAM_DECODE, _cbStreamXA, IntPtr.Zero );
1323- if ( this.hBassStream == 0 )
1335+ this._hBassStream = Bass.BASS_StreamCreate( (int) wfx.nSamplesPerSec, (int) wfx.nChannels, BASSFlag.BASS_STREAM_DECODE, _cbStreamXA, IntPtr.Zero );
1336+ if ( this._hBassStream == 0 )
13241337 {
13251338 hGC.Free();
13261339 throw new Exception( string.Format( "サウンドストリームの生成に失敗しました。(BASS_SampleCreate)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
@@ -1334,25 +1347,11 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
13341347 {
13351348 CSound管理.nStreams++;
13361349
1337- // ミキサーにBASSファイルストリームを追加。
1338-
1339- //if ( !BassMix.BASS_Mixer_StreamAddChannel( hMixer, this.hBassStream, BASSFlag.BASS_SPEAKER_FRONT | BASSFlag.BASS_MIXER_PAUSE | BASSFlag.BASS_MIXER_NORAMPIN ) )
1340- //// if ( !tBASSサウンドをミキサーに追加する() )
1341- //{
1342- // hGC.Free();
1343- // throw new Exception( string.Format( "サウンドストリームの生成に失敗しました。(BASS_Mixer_StreamAddChannel)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
1344- //}
1345- //CSound管理.nStreams++;
1346-
1347- // _cbEndofStream = new SYNCPROC( CallbackEndofStream );
1348- // Bass.BASS_ChannelSetSync( hBassStream, BASSSync.BASS_SYNC_END |BASSSync.BASS_SYNC_MIXTIME, 0, _cbEndofStream, IntPtr.Zero );
1349-
1350-
13511350 // 個々のストリームの出力をテンポ変更のストリームに入力する。テンポ変更ストリームの出力を、Mixerに出力する。
13521351
1353- if ( CSound管理.bIsTimeStretch )
1352+// if ( CSound管理.bIsTimeStretch ) // TimeStretchのON/OFFに関わりなく、テンポ変更のストリームを生成する。後からON/OFF切り替え可能とするため。
13541353 {
1355- this._hTempoStream = BassFx.BASS_FX_TempoCreate( this.hBassStream, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_FX_FREESOURCE );
1354+ this._hTempoStream = BassFx.BASS_FX_TempoCreate( this._hBassStream, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_FX_FREESOURCE );
13561355 if ( this._hTempoStream == 0 )
13571356 {
13581357 hGC.Free();
@@ -1360,22 +1359,30 @@ Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.strファイ
13601359 }
13611360 else
13621361 {
1363- Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO, 1f ); // 高速化(音の品質は少し落ちる)
1362+ Bass.BASS_ChannelSetAttribute( this._hTempoStream, BASSAttribute.BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO, 1f ); // 高速化(音の品質は少し落ちる)
13641363 }
13651364 }
13661365
1366+ if ( _hTempoStream != 0 && !this.bIs1倍速再生 ) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する
1367+ {
1368+ this.hBassStream = _hTempoStream;
1369+ }
1370+ else
1371+ {
1372+ this.hBassStream = _hBassStream;
1373+ }
13671374
13681375 // インスタンスリストに登録。
13691376
13701377 CSound.listインスタンス.Add( this );
13711378
13721379 // n総演奏時間の取得; DTXMania用に追加。
1373- double seconds = Bass.BASS_ChannelBytes2Seconds( this.hBassStream, nBytes );
1380+ double seconds = Bass.BASS_ChannelBytes2Seconds( this._hBassStream, nBytes );
13741381 this.n総演奏時間ms = (int) ( seconds * 1000 );
13751382 this.pos = 0;
13761383 this.hMixer = hMixer;
13771384 float freq = 0.0f;
1378- if ( !Bass.BASS_ChannelGetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ref freq ) )
1385+ if ( !Bass.BASS_ChannelGetAttribute( this._hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ref freq ) )
13791386 {
13801387 hGC.Free();
13811388 throw new Exception( string.Format( "サウンドストリームの周波数取得に失敗しました。(BASS_ChannelGetAttribute)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
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)/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(DTXCreator)/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/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/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/FDK.dll" differ