diff --git a/Config.ini b/Config.ini
new file mode 100644
index 00000000..2015654c
--- /dev/null
+++ b/Config.ini
@@ -0,0 +1,389 @@
+;-------------------
+[System]
+
+; リリースバージョン
+; Release Version.
+Version=1.5.7
+
+; 譜面ファイルが格納されているフォルダへのパス。
+; セミコロン(;)で区切ることにより複数のパスを指定できます。(例: d:\tja\;e:\tja2\)
+; Pathes for TJA data.
+; You can specify many pathes separated with semicolon(;). (e.g. d:\tja\;e:\tja2\)
+TJAPath=.\
+
+; 使用するSkinのフォルダ名。
+; 例えば System\Default\Graphics\... などの場合は、SkinPath=.\Default\ を指定します。
+; Skin folder path.
+; e.g. System\Default\Graphics\... -> Set SkinPath=.\Default\
+SkinPath=SimpleStyle\
+
+; 事前画像描画機能を使うかどうか。(0: OFF, 1: ON)
+; Use pre-textures render.
+FastRender=1
+
+; 画面モード(0:ウィンドウ, 1:全画面)
+; Screen mode. (0:Window, 1:Fullscreen)
+FullScreen=0
+
+; ウインドウモード時の画面幅
+; A width size in the window mode.
+WindowWidth=1280
+
+; ウインドウモード時の画面高さ
+; A height size in the window mode.
+WindowHeight=720
+
+; ウィンドウモード時の位置X
+; X position in the window mode.
+WindowX=310
+
+; ウィンドウモード時の位置Y
+; Y position in the window mode.
+WindowY=152
+
+; ウインドウをダブルクリックした時にフルスクリーンに移行するか(0:移行しない,1:移行する)
+; Whether double click to go full screen mode or not.(0:No, 1:Yes)
+DoubleClickFullScreen=1
+
+; ALT+SPACEのメニュー表示を抑制するかどうか(0:抑制する 1:抑制しない)
+; Whether ALT+SPACE menu would be masked or not.(0=masked 1=not masked)
+EnableSystemMenu=1
+
+; 非フォーカス時のsleep値[ms]
+; A sleep time[ms] while the window is inactive.
+BackSleep=1
+
+; フォントレンダリングに使用するフォント名
+; Font name used for font rendering.
+FontName=FOT-大江戸勘亭流 Std E
+
+; 垂直帰線同期(0:OFF,1:ON)
+VSyncWait=1
+
+; フレーム毎のsleep値[ms] (-1でスリープ無し, 0以上で毎フレームスリープ。動画キャプチャ等で活用下さい)
+; A sleep time[ms] per frame.
+SleepTimePerFrame=-1
+
+; サウンド出力方式(0=ACM(って今はまだDirectSoundですが), 1=ASIO, 2=WASAPI)
+; WASAPIはVista以降のOSで使用可能。推奨方式はWASAPI。
+; なお、WASAPIが使用不可ならASIOを、ASIOが使用不可ならACMを使用します。
+; Sound device type(0=ACM, 1=ASIO, 2=WASAPI)
+; WASAPI can use on Vista or later OSs.
+; If WASAPI is not available, DTXMania try to use ASIO. If ASIO can't be used, ACM is used.
+SoundDeviceType=2
+
+; WASAPI使用時のサウンドバッファサイズ
+; (0=デバイスに設定されている値を使用, 1〜9999=バッファサイズ(単位:ms)の手動指定
+; WASAPI Sound Buffer Size.
+; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself)
+WASAPIBufferSizeMs=50
+
+; ASIO使用時のサウンドデバイス
+; 存在しないデバイスを指定すると、DTXManiaが起動しないことがあります。
+; Sound device used by ASIO.
+; Don't specify unconnected device, as the DTXMania may not bootup.
+; 0: None
+ASIODevice=0
+
+; WASAPI/ASIO時に使用する演奏タイマーの種類
+; Playback timer used for WASAPI/ASIO
+; (0=FDK Timer, 1=System Timer)
+SoundTimerType=0
+
+; 背景画像の半透明割合(0:透明〜255:不透明)
+; Transparency for background image in playing screen.(0:tranaparent - 255:no transparent)
+BGAlpha=100
+
+; ゲージゼロでSTAGE FAILED (0:OFF, 1:ON)
+StageFailed=1
+
+; AVIの表示(0:OFF, 1:ON)
+AVI=0
+
+; BGAの表示(0:OFF, 1:ON)
+BGA=1
+
+; 動画表示モード( 0:表示しない, 1:背景のみ, 2:窓表示のみ, 3:両方)
+ClipDispType=1
+
+; 曲選択からプレビュー音の再生までのウェイト[ms]
+PreviewSoundWait=1000
+
+; 曲選択からプレビュー画像表示までのウェイト[ms]
+PreviewImageWait=100
+
+; BGM の再生(0:OFF, 1:ON)
+BGMSound=1
+
+; 演奏記録(〜.score.ini)の出力 (0:OFF, 1:ON)
+SaveScoreIni=1
+
+; 最小表示コンボ数
+MinComboDrums=10
+
+; RANDOM SELECT で子BOXを検索対象に含める (0:OFF, 1:ON)
+RandomFromSubBox=1
+
+; 演奏情報を表示する (0:OFF, 1:ON)
+; Showing playing info on the playing screen. (0:OFF, 1:ON)
+ShowDebugStatus=0
+
+; BS1770GAIN によるラウドネスメータの測量を適用する (0:OFF, 1:ON)
+; Apply BS1770GAIN loudness metadata (0:OFF, 1:ON)
+ApplyLoudnessMetadata=1
+
+; BS1770GAIN によるラウドネスメータの目標値 (0). (-100-10)
+; Loudness Target in dB (decibels) relative to full scale (0). (-100-10)
+TargetLoudness=-7.4
+
+; .tjaファイルのSONGVOLヘッダを音源の音量に適用する (0:OFF, 1:ON)
+; Apply SONGVOL (0:OFF, 1:ON)
+ApplySongVol=0
+
+; 効果音の音量 (0-100%)
+; Sound effect level (0-100%)
+SoundEffectLevel=100
+
+; 各ボイス、コンボボイスの音量 (0-100%)
+; Voice level (0-100%)
+VoiceLevel=90
+
+; 選曲画面のプレビュー時の音量 (0-100%)
+; Song preview level (0-100%)
+SongPreviewLevel=80
+
+; ゲーム中の音源の音量 (0-100%)
+; Song playback level (0-100%)
+SongPlaybackLevel=100
+
+; キーボードによる音量変更の増加量、減少量 (1-20)
+; Keyboard sound level increment (1-20)
+KeyboardSoundLevelIncrement=5
+
+; 2P演奏時に叩いた音を左右別々にならすか (0:OFF, 1:ON)
+; Use panning for SE (0:OFF, 1:ON)
+UsePanning=1
+
+; 音源再生前の空白時間 (ms)
+; Blank time before music source to play. (ms)
+MusicPreTimeMs=1000
+
+; ストイックモード(0:OFF, 1:ON)
+; Stoic mode. (0:OFF, 1:ON)
+StoicMode=0
+
+; バッファ入力モード(0:OFF, 1:ON)
+; Using Buffered input (0:OFF, 1:ON)
+BufferedInput=1
+
+; リザルト画像自動保存機能(0:OFF, 1:ON)
+; Set "1" if you'd like to save result screen image automatically
+; when you get hiscore/hiskill.
+AutoResultCapture=0
+
+; Discordに再生中の譜面情報を送信する(0:OFF, 1:ON)
+; Share Playing .tja file infomation on Discord.
+SendDiscordPlayingInformation=1
+
+; 再生速度変更を、ピッチ変更で行うかどうか(0:ピッチ変更, 1:タイムストレッチ
+; (WASAPI/ASIO使用時のみ有効)
+; Set "0" if you'd like to use pitch shift with PlaySpeed.
+; Set "1" for time stretch.
+; (Only available when you're using using WASAPI or ASIO)
+TimeStretch=0
+
+; 動画再生にDirectShowを使用する(0:OFF, 1:ON)
+; 動画再生にDirectShowを使うことによって、再生時の負担を軽減できます。
+; ただし使用時にはセットアップが必要になるのでご注意ください。
+DirectShowMode=0
+
+; 判定タイミング調整(-99〜99)[ms]
+; Revision value to adjust judgment timing.
+InputAdjustTime=11
+
+; 判定ラインの表示位置調整(ドラム, ギター, ベース)(-99〜99)[px]
+; Offset value to adjust displaying judgement line for the drums, guitar and bass.
+JudgeLinePosOffsetDrums=0
+
+; 「また遊んでね」画面(0:OFF, 1:ON)
+EndingAnime=0
+
+;-------------------
+[AutoPlay]
+
+; 自動演奏(0:OFF, 1:ON)
+Taiko=0
+Taiko2P=0
+TaikoAutoRoll=1
+
+;-------------------
+[HitRange]
+
+; Perfect〜Poor とみなされる範囲[ms]
+Perfect=30
+Good=100
+Poor=130
+
+;-------------------
+[Log]
+
+; Log出力(0:OFF, 1:ON)
+OutputLog=1
+
+; 曲データ検索に関するLog出力(0:OFF, 1:ON)
+TraceSongSearch=0
+
+; 画像やサウンドの作成_解放に関するLog出力(0:OFF, 1:ON)
+TraceCreatedDisposed=0
+
+; DTX読み込み詳細に関するLog出力(0:OFF, 1:ON)
+TraceDTXDetails=0
+
+;-------------------
+[PlayOption]
+
+; 各画像の表示設定
+; キャラクター画像を表示する (0:OFF, 1:ON)
+ShowChara=1
+; ダンサー画像を表示する (0:OFF, 1:ON)
+ShowDancer=1
+; ランナー画像を表示する (0:OFF, 1:ON)
+ShowRunner=1
+; モブ画像を表示する (0:OFF, 1:ON)
+ShowMob=1
+; フッター画像 (0:OFF, 1:ON)
+ShowFooter=1
+; ぷちキャラ画像 (0:OFF, 1:ON)
+ShowPuchiChara=1
+
+; DARKモード(0:OFF, 1:HALF, 2:FULL)
+Dark=0
+
+
+; 選曲画面でのタイマーを有効にするかどうか(0:無効,1:有効)
+; Enable countdown in songselect.(0:No, 1:Yes)
+EnableCountDownTimer=1
+
+; ドラムSUDDENモード(0:OFF, 1:ON)
+DrumsSudden=0
+
+; ドラムHIDDENモード(0:OFF, 1:ON)
+DrumsHidden=0
+
+; ドラムチップ非表示モード (0:OFF, 1=SEMI, 2:FULL)
+; Drums chip invisible mode
+DrumsInvisible=0
+
+; ドラムREVERSEモード(0:OFF, 1:ON)
+DrumsReverse=0
+
+; RISKYモード(0:OFF, 1-10)
+; RISKY mode. 0=OFF, 1-10 is the times of misses to be Failed.
+Risky=0
+
+; TIGHTモード(0:OFF, 1:ON)
+; TIGHT mode. 0=OFF, 1=ON
+DrumsTight=0
+
+; ドラム譜面スクロール速度(0:x0.5, 1:x1.0, 2:x1.5,…,1999:x1000.0)
+DrumsScrollSpeed=1
+
+; 演奏速度(5〜40)(→x5/20〜x40/20)
+PlaySpeed=20
+
+; 演奏速度が一倍速であるときのみBGMを再生する(0:OFF, 1:ON)
+PlaySpeedNotEqualOneNoSound=0
+
+; デフォルトで選択される難易度
+DefaultCourse=3
+
+; 譜面分岐のガイド表示(0:OFF, 1:ON)
+BranchGuide=0
+
+; スコア計算方法(0:旧配点, 1:旧筐体配点, 2:新配点)
+ScoreMode=2
+
+; 真打モード (0:OFF, 1:ON)
+; Fixed score mode (0:OFF, 1:ON)
+ShinuchiMode=1
+; 大音符の両手入力待機時間(ms)
+BigNotesWaitTime=50
+
+; 大音符の両手判定(0:OFF, 1:ON)
+BigNotesJudge=0
+
+; NoInfo(0:OFF, 1:ON)
+NoInfo=0
+
+; 譜面分岐のアニメーション(0:7〜14, 1:15)
+BranchAnime=1
+
+; デフォルトの曲ソート(0:絶対パス順, 1:ジャンル名ソートOLD, 2:ジャンル名ソートNEW )
+0:Path, 1:GenreName(AC8〜AC14), 2GenreName(AC15〜)
+DefaultSongSort=2
+
+; RANDOMモード(0:OFF, 1:Random, 2:Mirorr 3:SuperRandom, 4:HyperRandom)
+TaikoRandom=0
+
+; STEALTHモード(0:OFF, 1:ドロン, 2:ステルス)
+TaikoStealth=0
+
+; ゲーム(0:OFF, 1:完走!叩ききりまショー!, 2:完走!叩ききりまショー!(激辛) )
+GameMode=0
+
+
+; 特訓モード時にPgUp/PgDnで何小節飛ばすか
+TokkunSkipMeasures=0
+
+; 特訓モード時にジャンプポイントに飛ばすための時間(ms)
+; 指定ms以内に5回縁を叩きましょう
+TokkunMashInterval=750
+
+; JUST(0:OFF, 1:ON)
+Just=0
+
+; 判定数の表示(0:OFF, 1:ON)
+JudgeCountDisplay=0
+
+; プレイ人数
+PlayerCount=1
+
+;-------------------
+[GUID]
+
+
+;-------------------
+; キーアサイン
+; 項 目:Keyboard → 'K'+'0'+キーコード(10進数)
+; Mouse → 'N'+'0'+ボタン番号(0〜7)
+; MIDI In → 'M'+デバイス番号1桁(0〜9,A〜Z)+ノート番号(10進数)
+; Joystick → 'J'+デバイス番号1桁(0〜9,A〜Z)+ 0 ...... X減少(左)ボタン
+; 1 ...... X増加(右)ボタン
+; 2 ...... Y減少(上)ボタン
+; 3 ...... Y増加(下)ボタン
+; 4 ...... Z減少(前)ボタン
+; 5 ...... Z増加(後)ボタン
+; 6〜133.. ボタン1〜128
+; これらの項目を 16 個まで指定可能(',' で区切って記述)。
+;
+; 表記例:HH=K044,M042,J16
+; → HiHat を Keyboard の 44 ('Z'), MidiIn#0 の 42, JoyPad#1 の 6(ボタン1) に割当て
+;
+; ※Joystick のデバイス番号とデバイスとの関係は [GUID] セクションに記してあるものが有効。
+;
+
+[DrumsKeyAssign]
+
+LeftRed=K016,K015
+RightRed=K017,K019
+LeftBlue=K028,K013
+RightBlue=K020,K021
+LeftRed2P=K031,K011
+RightRed2P=K022,K023
+LeftBlue2P=K033,K012
+RightBlue2P=K0111,K047
+
+[SystemKeyAssign]
+
+Capture=K065
+
diff --git a/FDK19/FDK19.csproj b/FDK19/FDK19.csproj
new file mode 100644
index 00000000..4cf3c82c
--- /dev/null
+++ b/FDK19/FDK19.csproj
@@ -0,0 +1,205 @@
+サソ
+
+
+ Debug
+ AnyCPU
+ 9.0.21022
+ 2.0
+ {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}
+ Library
+ Properties
+ FDK
+ FDK
+ v4.6.1
+ 512
+ true
+
+
+
+
+
+
+
+
+ 3.5
+
+
+
+ x86
+ bin\x86\Debug\
+ true
+
+
+ false
+ 0219
+ TRACE;TEST_CancelEnterCodeInAltEnter2 TEST_Direct3D9Ex_
+ false
+ full
+ 7.3
+ true
+ false
+
+
+ x86
+ bin\x86\Release\
+ true
+
+
+ true
+ 0219
+ TRACE;TEST_ENGLISH_ TEST_Direct3D9Ex_
+ true
+ 7.3
+ full
+ true
+ false
+
+
+
+ ..\Test\dll\Bass.Net.dll
+ True
+
+
+ False
+ ..\Test\dll\DirectShowLib-2005.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GameWindow.cs
+
+
+ Designer
+
+
+
+
+
+
+
+ 1.3.1.2
+
+
+ 4.2.0
+
+
+ 4.2.0
+
+
+ 4.2.0
+
+
+ 4.2.0
+
+
+ 4.0.13.44
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FDK19/FDK19.csproj.user b/FDK19/FDK19.csproj.user
new file mode 100644
index 00000000..eb6ef04a
--- /dev/null
+++ b/FDK19/FDK19.csproj.user
@@ -0,0 +1,7 @@
+サソ
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FDK19/Properties/AssemblyInfo.cs b/FDK19/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..6561304f
--- /dev/null
+++ b/FDK19/Properties/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+サソusing System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶
+// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲
+// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲
+[assembly: AssemblyTitle( "FDK繝ゥ繧、繝悶Λ繝ェ" )]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct( "FDK繝ゥ繧、繝悶Λ繝ェ ver.21" )]
+[assembly: AssemblyCopyright( "Copyright(C) 2000-2013 DTXMania Group" )]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+//[assembly: AssemblyKeyName( "FROMsCspContainer" )]
+
+// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√◎縺ョ蝙九ッ縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ァ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医°繧
+// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲
+// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲
+[assembly: ComVisible(false)]
+
+// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺
+[assembly: Guid("c5f9e698-bec1-4d94-b8a4-3e39b636ccb8")]
+
+// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝薙Ν繝峨♀繧医ウ繝ェ繝薙ず繝ァ繝ウ逡ェ蜿キ繧
+// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion( "21.0.0.0" )]
+[assembly: AssemblyFileVersion( "21.0.0.0" )]
+[assembly: NeutralResourcesLanguageAttribute("ja-JP")]
diff --git a/FDK19/packages.config b/FDK19/packages.config
new file mode 100644
index 00000000..5dd07c98
--- /dev/null
+++ b/FDK19/packages.config
@@ -0,0 +1,11 @@
+サソ
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CActivity.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CActivity.cs
new file mode 100644
index 00000000..6afd9ae7
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CActivity.cs
@@ -0,0 +1,176 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ public class CActivity
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public bool b豢サ諤ァ蛹悶@縺ヲ繧 { get; private set; }
+ public bool b豢サ諤ァ蛹悶@縺ヲ縺ェ縺
+ {
+ get
+ {
+ return !this.b豢サ諤ァ蛹悶@縺ヲ繧;
+ }
+ set
+ {
+ this.b豢サ諤ァ蛹悶@縺ヲ繧 = !value;
+ }
+ }
+ public List list蟄植ctivities;
+
+ ///
+ /// 蛻昴a縺ヲ On騾イ陦梧緒逕サ() 繧貞他縺ウ蜃コ縺吝エ蜷医↓ true 繧堤、コ縺吶ゑシOn豢サ諤ァ蛹() 蜀縺ァ true 縺ォ繧サ繝繝医&繧後k縲ゑシ
+ /// 縺薙ョ繝輔Λ繧ー縺ッ縲^n豢サ諤ァ蛹() 縺ァ縺ッ陦後∴縺ェ縺繧ソ繧、繝溘Φ繧ー縺ョ繧キ繝薙い縺ェ蛻晄悄蛹悶r On騾イ陦梧緒逕サ() 縺ァ陦後≧縺溘a縺ォ貅門y縺輔l縺ヲ縺繧九ょ茜逕ィ縺ッ蠢鬆医〒縺ッ縺ェ縺縲
+ /// On騾イ陦梧緒逕サ() 蛛エ縺ァ縺ッ縲∝ソ隕√↑蛻晄悄蛹悶r霑ス縺医◆繧 false 繧偵そ繝繝医☆繧九%縺ィ縲
+ ///
+ protected bool b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = true;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CActivity()
+ {
+ this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true;
+ this.list蟄植ctivities = new List();
+ }
+
+
+ // 繝ゥ繧、繝輔し繧、繧ッ繝ォ繝。繧ス繝繝
+
+ #region [ 蟄舌け繝ゥ繧ケ縺ァ蠢隕√↑繧ゅョ縺ョ縺ソ override 縺吶k縺薙→縲]
+ //-----------------
+
+ public virtual void On豢サ諤ァ蛹()
+ {
+ // 縺吶〒縺ォ豢サ諤ァ蛹悶@縺ヲ繧九↑繧我ス輔b縺励↑縺縲
+ if( this.b豢サ諤ァ蛹悶@縺ヲ繧 )
+ return;
+
+ this.b豢サ諤ァ蛹悶@縺ヲ繧 = true; // 縺薙ョ繝輔Λ繧ー縺ッ縲∽サ・荳九ョ蜃ヲ逅繧偵☆繧句燕縺ォ繧サ繝繝医☆繧九
+
+ // 閾ェ霄ォ縺ョ繝ェ繧ス繝シ繧ケ繧剃ス懈舌☆繧九
+ this.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ this.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+
+ // 縺吶∋縺ヲ縺ョ蟄 Activity 繧呈エサ諤ァ蛹悶☆繧九
+ foreach( CActivity activity in this.list蟄植ctivities )
+ activity.On豢サ諤ァ蛹();
+
+ // 縺昴ョ莉悶ョ蛻晄悄蛹
+ this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = true;
+ }
+ public virtual void On髱樊エサ諤ァ蛹()
+ {
+ // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲
+ if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ return;
+
+ // 閾ェ霄ォ縺ョ繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k縲
+ this.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ this.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+
+ // 縺吶∋縺ヲ縺ョ 蟄植ctivity 繧帝撼豢サ諤ァ蛹悶☆繧九
+ foreach( CActivity activity in this.list蟄植ctivities )
+ activity.On髱樊エサ諤ァ蛹();
+
+ this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; // 縺薙ョ繝輔Λ繧ー縺ッ縲∽サ・荳翫ョ繝。繧ス繝繝峨r蜻シ縺ウ蜃コ縺励◆蠕後↓繧サ繝繝医☆繧九
+ }
+
+ ///
+ /// Managed 繝ェ繧ス繝シ繧ケ縺ョ菴懈舌r陦後≧縲
+ /// Direct3D 繝繝舌う繧ケ縺御ス懈舌&繧後◆逶エ蠕後↓蜻シ縺ウ蜃コ縺輔l繧九ョ縺ァ縲∬ェ蛻縺梧エサ諤ァ蛹悶@縺ヲ縺繧区凾縺ォ髯舌j縲
+ /// Managed 繝ェ繧ス繝シ繧ケ繧剃ス懈撰シ医∪縺溘ッ蜀肴ァ狗ッ会シ峨☆繧九%縺ィ縲
+ /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺悟堺ス懈舌&繧後k縺具シ牙縺九i縺ェ縺縺ョ縺ァ縲
+ /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲
+ ///
+ public virtual void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()
+ {
+ // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲
+ if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ return;
+
+ // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Managed 繝ェ繧ス繝シ繧ケ繧剃ス懈舌☆繧九
+ foreach( CActivity activity in this.list蟄植ctivities )
+ activity.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ }
+
+ ///
+ /// Unmanaged 繝ェ繧ス繝シ繧ケ縺ョ菴懈舌r陦後≧縲
+ /// Direct3D 繝繝舌う繧ケ縺御ス懈舌∪縺溘ッ繝ェ繧サ繝繝医&繧後◆逶エ蠕後↓蜻シ縺ウ蜃コ縺輔l繧九ョ縺ァ縲∬ェ蛻縺梧エサ諤ァ蛹悶@縺ヲ縺繧区凾縺ォ髯舌j縲
+ /// Unmanaged 繝ェ繧ス繝シ繧ケ繧剃ス懈撰シ医∪縺溘ッ蜀肴ァ狗ッ会シ峨☆繧九%縺ィ縲
+ /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺悟堺ス懈舌∪縺溘ッ繝ェ繧サ繝繝医&繧後k縺具シ牙縺九i縺ェ縺縺ョ縺ァ縲
+ /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲
+ ///
+ public virtual void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()
+ {
+ // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲
+ if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ return;
+
+ // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Unmanaged 繝ェ繧ス繝シ繧ケ繧剃ス懈舌☆繧九
+ foreach( CActivity activity in this.list蟄植ctivities )
+ activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ }
+
+ ///
+ /// Unmanaged 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧定。後≧縲
+ /// Direct3D 繝繝舌う繧ケ縺ョ隗」謾セ逶エ蜑阪∪縺溘ッ繝ェ繧サ繝繝育峩蜑阪↓蜻シ縺ウ蜃コ縺輔l繧九
+ /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺瑚ァ」謾セ縺セ縺溘ッ繝ェ繧サ繝繝医&繧後k縺具シ牙縺九i縺ェ縺縺ョ縺ァ縲
+ /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲
+ ///
+ public virtual void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()
+ {
+ // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲
+ if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ return;
+
+ // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Unmanaged 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k縲
+ foreach( CActivity activity in this.list蟄植ctivities )
+ activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ }
+
+ ///
+ /// Managed 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧定。後≧縲
+ /// Direct3D 繝繝舌う繧ケ縺ョ隗」謾セ逶エ蜑阪↓蜻シ縺ウ蜃コ縺輔l繧九
+ /// シUnmanaged 繝ェ繧ス繝シ繧ケ縺ィ縺ッ逡ー縺ェ繧翫.irect3D 繝繝舌う繧ケ縺ョ繝ェ繧サ繝繝域凾縺ォ縺ッ蜻シ縺ウ蜃コ縺輔l縺ェ縺縲ゑシ
+ /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺瑚ァ」謾セ縺輔l繧九°シ牙縺九i縺ェ縺縺ョ縺ァ縲
+ /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲
+ ///
+ public virtual void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()
+ {
+ // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲
+ if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ return;
+
+ // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Managed 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k縲
+ foreach( CActivity activity in this.list蟄植ctivities )
+ activity.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ }
+
+ ///
+ /// 騾イ陦後→謠冗判繧定。後≧縲ゑシ医%繧後i縺ッ蛻髮「縺輔l縺壹√%縺ョシ代▽縺ョ繝。繧ス繝繝峨□縺代〒螳溯」縺吶k縲ゑシ
+ /// 縺薙ョ繝。繧ス繝繝峨ッ BeginScene() 縺ョ蠕後↓蜻シ縺ウ蜃コ縺輔l繧九ョ縺ァ縲√Γ繧ス繝繝牙縺ァ縺縺阪↑繧頑緒逕サ繧定。後▲縺ヲ縺九∪繧上↑縺縲
+ ///
+ /// 莉サ諢上ョ謨エ謨ー縲ょ他縺ウ蜃コ縺怜縺ィ縺ョ謨エ蜷域ァ繧貞粋繧上○縺ヲ縺翫¥縺薙→縲
+ public virtual int On騾イ陦梧緒逕サ()
+ {
+ // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲
+ if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ return 0;
+
+
+ /* 縺薙%縺ァ騾イ陦後→謠冗判繧定。後≧縲*/
+
+
+ // 謌サ繧雁、縺ィ縺昴ョ諢丞袖縺ッ蟄舌け繝ゥ繧ケ縺ァ閾ェ逕ア縺ォ豎コ繧√※縺縺縲
+ return 0;
+ }
+
+ //-----------------
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCounter.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCounter.cs
new file mode 100644
index 00000000..d209aa9d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCounter.cs
@@ -0,0 +1,315 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ ///
+ /// 荳螳夐俣髫斐〒蜊倡エ泌「怜刈縺吶k謨エ謨ーシ医き繧ヲ繝ウ繝亥、シ峨r謇ア縺縲
+ ///
+ ///
+ /// 笳倶スソ縺譁ケ
+ /// 1.CCounter縺ョ螟画焚繧偵▽縺上k縲
+ /// 2.CCounter繧堤函謌
+ /// ctCounter = new CCounter( 0, 3, 10, CDTXMania.Timer );
+ /// 3.騾イ陦後Γ繧ス繝繝峨r菴ソ逕ィ縺吶k縲
+ /// 4.繧ヲ繝槭シ縲
+ ///
+ /// double蛟、繧剃スソ縺蝣エ蜷医》騾イ陦慧b縲》騾イ陦鍬oopDb繧剃スソ縺縺薙→縲
+ /// 縺セ縺溘‥ouble迚医〒縺ッ髢馴囈縺ョ蛟、縺ッ繝溘Μ遘貞腰菴阪〒縺ッ縺ェ縺上騾壼クク縺ョ遘貞腰菴阪↓縺ェ繧翫∪縺吶
+ ///
+ public class CCounter
+ {
+ public bool b髢句ァ九@縺
+ {
+ get;
+ set;
+ }
+ // 蛟、繝励Ο繝代ユ繧」
+ public float n髢句ァ句、
+ {
+ get;
+ private set;
+ }
+ public float n邨ゆコ蛟、
+ {
+ get;
+ set;
+ }
+ public int n迴セ蝨ィ縺ョ蛟、
+ {
+ get;
+ set;
+ }
+
+ public double _n髢馴囈
+ {
+ get
+ {
+ return this.n髢馴囈;
+ }
+ set
+ {
+ this.n髢馴囈 = value >= 0 ? value : value * -1;
+ }
+ }
+
+ public float n迴セ蝨ィ縺ョ邨碁℃譎る俣ms
+ {
+ get;
+ set;
+ }
+ // 迥カ諷九励Ο繝代ユ繧」
+
+ public bool b騾イ陦御クュ
+ {
+ get { return (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != -1); }
+ }
+ public bool b蛛懈ュ「荳ュ
+ {
+ get { return !this.b騾イ陦御クュ; }
+ }
+ public bool b邨ゆコ蛟、縺ォ驕斐@縺
+ {
+ get { return (this.n迴セ蝨ィ縺ョ蛟、 >= this.n邨ゆコ蛟、); }
+ }
+ public bool b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺
+ {
+ get { return !this.b邨ゆコ蛟、縺ォ驕斐@縺; }
+ }
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CCounter()
+ {
+ this.timer = null;
+ this.n髢句ァ句、 = 0;
+ this.n邨ゆコ蛟、 = 0;
+ this.n迴セ蝨ィ縺ョ蛟、 = 0;
+ this.n迴セ蝨ィ縺ョ蛟、 = 0;
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = CSoundTimer.n譛ェ菴ソ逕ィ;
+ }
+
+ /// 逕滓舌→蜷梧凾縺ォ髢句ァ九☆繧九
+ public CCounter(float n髢句ァ句、, float n邨ゆコ蛟、, float n髢馴囈ms, CTimer timer)
+ : this()
+ {
+ this.t髢句ァ(n髢句ァ句、, n邨ゆコ蛟、, n髢馴囈ms, timer);
+ }
+
+ /// 逕滓舌→蜷梧凾縺ォ髢句ァ九☆繧九(double迚)
+ public CCounter(double db髢句ァ句、, double db邨ゆコ蛟、, double db髢馴囈, CSoundTimer timer)
+ : this()
+ {
+ this.t髢句ァ(db髢句ァ句、, db邨ゆコ蛟、, db髢馴囈 * 1000.0f, timer);
+ }
+
+
+ // 迥カ諷区桃菴懊Γ繧ス繝繝
+
+ ///
+ /// 繧ォ繧ヲ繝ウ繝医r髢句ァ九☆繧九
+ ///
+ /// 譛蛻昴ョ繧ォ繧ヲ繝ウ繝亥、縲
+ /// 譛蠕後ョ繧ォ繧ヲ繝ウ繝亥、縲
+ /// 繧ォ繧ヲ繝ウ繝亥、繧抵シ大「怜刈縺輔○繧九ョ縺ォ縺九¢繧区凾髢難シ医Α繝ェ遘貞腰菴搾シ峨
+ /// 繧ォ繧ヲ繝ウ繝医↓菴ソ逕ィ縺吶k繧ソ繧、繝槭
+ public void t髢句ァ(float n髢句ァ句、, float n邨ゆコ蛟、, float n髢馴囈ms, CTimer timer)
+ {
+ this.n髢句ァ句、 = n髢句ァ句、;
+ this.n邨ゆコ蛟、 = n邨ゆコ蛟、;
+ this._n髢馴囈 = n髢馴囈ms;
+ this.timer = timer;
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾;
+ this.n迴セ蝨ィ縺ョ蛟、 = (int)n髢句ァ句、;
+ this.b髢句ァ九@縺 = true;
+ }
+
+ ///
+ /// 繧ォ繧ヲ繝ウ繝医r髢句ァ九☆繧九(double迚)
+ ///
+ /// 譛蛻昴ョ繧ォ繧ヲ繝ウ繝亥、縲
+ /// 譛蠕後ョ繧ォ繧ヲ繝ウ繝亥、縲
+ /// 繧ォ繧ヲ繝ウ繝亥、繧抵シ大「怜刈縺輔○繧九ョ縺ォ縺九¢繧区凾髢難シ育ァ貞腰菴搾シ峨
+ /// 繧ォ繧ヲ繝ウ繝医↓菴ソ逕ィ縺吶k繧ソ繧、繝槭
+ public void t髢句ァ(double db髢句ァ句、, double db邨ゆコ蛟、, double db髢馴囈, CSoundTimer timer)
+ {
+ this.n髢句ァ句、 = (float)db髢句ァ句、;
+ this.n邨ゆコ蛟、 = (float)db邨ゆコ蛟、;
+ this._n髢馴囈 = db髢馴囈;
+ this.timerdb = timer;
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = (float)this.timerdb.db繧キ繧ケ繝繝譎ょ綾;
+ this.n迴セ蝨ィ縺ョ蛟、 = (int)db髢句ァ句、;
+ this.b髢句ァ九@縺 = true;
+ }
+
+ ///
+ /// 蜑榊屓縺ョ t騾イ陦() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九
+ /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲√◎繧御サ・荳雁「怜刈縺励↑縺シ育オゆコ蛟、繧堤カュ謖√☆繧具シ峨
+ ///
+ public void t騾イ陦()
+ {
+ if ((this.timer != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CTimer.n譛ェ菴ソ逕ィ))
+ {
+ long num = this.timer.n迴セ蝨ィ譎ょ綾;
+ if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms)
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = num;
+
+ while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈)
+ {
+ if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、)
+ this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n邨ゆコ蛟、;
+
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈;
+ }
+ }
+ }
+
+ ///
+ /// 蜑榊屓縺ョ t騾イ陦() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九
+ /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲√◎繧御サ・荳雁「怜刈縺励↑縺シ育オゆコ蛟、繧堤カュ謖√☆繧具シ峨
+ ///
+ public void t騾イ陦慧b()
+ {
+ if ((this.timerdb != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CSoundTimer.n譛ェ菴ソ逕ィ))
+ {
+ double num = this.timerdb.n迴セ蝨ィ譎ょ綾;
+ if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms)
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = (float)num;
+
+ while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈)
+ {
+ if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、)
+ this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n邨ゆコ蛟、;
+
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈;
+ }
+ }
+ }
+
+ ///
+ /// 蜑榊屓縺ョ t騾イ陦鍬oop() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九
+ /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲∵ャ。縺ョ蠅怜刈繧ソ繧、繝溘Φ繧ー縺ァ髢句ァ句、縺ォ謌サ繧具シ亥、縺後Ν繝シ繝励☆繧具シ峨
+ ///
+ public void t騾イ陦鍬oop()
+ {
+ if ((this.timer != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CTimer.n譛ェ菴ソ逕ィ))
+ {
+ long num = this.timer.n迴セ蝨ィ譎ょ綾;
+ if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms)
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = num;
+
+ while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈)
+ {
+ if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、)
+ this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n髢句ァ句、;
+
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈;
+ }
+ }
+ }
+
+ ///
+ /// 蜑榊屓縺ョ t騾イ陦鍬oop() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九
+ /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲∵ャ。縺ョ蠅怜刈繧ソ繧、繝溘Φ繧ー縺ァ髢句ァ句、縺ォ謌サ繧具シ亥、縺後Ν繝シ繝励☆繧具シ峨
+ ///
+ public void t騾イ陦鍬oopDb()
+ {
+ if ((this.timerdb != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CSoundTimer.n譛ェ菴ソ逕ィ))
+ {
+ double num = this.timerdb.n迴セ蝨ィ譎ょ綾;
+ if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms)
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = (float)num;
+
+ while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈)
+ {
+ if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、)
+ this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n髢句ァ句、;
+
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈;
+ }
+ }
+ }
+
+ ///
+ /// 繧ォ繧ヲ繝ウ繝医r蛛懈ュ「縺吶k縲
+ /// 縺薙l莉・髯阪↓ t騾イ陦() 繧 t騾イ陦鍬oop() 繧貞他縺ウ蜃コ縺励※繧ゆス輔b蜃ヲ逅縺輔l縺ェ縺縲
+ ///
+ public void t蛛懈ュ「()
+ {
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = CTimer.n譛ェ菴ソ逕ィ;
+ }
+
+ public void t髢馴囈蛟、螟画峩(double Value)
+ {
+ this._n髢馴囈 = Value;
+ }
+
+ // 縺昴ョ莉
+
+ #region [ 蠢懃畑シ壹く繝シ縺ョ蜿榊セゥ蜈・蜉帙r繧ィ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縺吶k ]
+ //-----------------
+
+ ///
+ /// 縲恵繧ュ繝シ謚シ荳九榊シ墓焚縺 true 縺ョ髢謎クュ縲√荊繧ュ繝シ蜃ヲ逅縲阪ョ繝ェ繧イ繝シ繝亥シ墓焚繧貞他縺ウ蜃コ縺吶
+ /// 縺溘□縺励2蝗樒岼縺ョ蜻シ縺ウ蜃コ縺励ッ1蝗樒岼縺九i 200ms 縺ョ髢薙r髢九¢縺ヲ縺九i陦後>縲3蝗樒岼莉・髯阪ョ蜻シ縺ウ蜃コ縺励ッ縺昴l縺槭l 30ms 縺ョ髢馴囈縺ァ蜻シ縺ウ蜃コ縺吶
+ /// 縲恵繧ュ繝シ謚シ荳九阪′ false 縺ョ蝣エ蜷医ッ菴輔b縺帙★縲∝他縺ウ蜃コ縺怜屓謨ー繧 0 縺ォ繝ェ繧サ繝繝医☆繧九
+ ///
+ /// 繧ュ繝シ縺梧款荳九&繧後※縺繧句エ蜷医ッ true縲
+ /// 繧ュ繝シ縺梧款荳九&繧後※縺繧句エ蜷医↓螳溯。後☆繧句ヲ逅縲
+ public void t繧ュ繝シ蜿榊セゥ(bool b繧ュ繝シ謚シ荳, DG繧ュ繝シ蜃ヲ逅 t繧ュ繝シ蜃ヲ逅)
+ {
+ const int n1蝗樒岼 = 0;
+ const int n2蝗樒岼 = 1;
+ const int n3蝗樒岼莉・髯 = 2;
+
+ if (b繧ュ繝シ謚シ荳)
+ {
+ switch (this.n迴セ蝨ィ縺ョ蛟、)
+ {
+ case n1蝗樒岼:
+
+ t繧ュ繝シ蜃ヲ逅();
+ this.n迴セ蝨ィ縺ョ蛟、 = n2蝗樒岼;
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾;
+ return;
+
+ case n2蝗樒岼:
+
+ if ((this.timer.n迴セ蝨ィ譎ょ綾 - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) > 200)
+ {
+ t繧ュ繝シ蜃ヲ逅();
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾;
+ this.n迴セ蝨ィ縺ョ蛟、 = n3蝗樒岼莉・髯;
+ }
+ return;
+
+ case n3蝗樒岼莉・髯:
+
+ if ((this.timer.n迴セ蝨ィ譎ょ綾 - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) > 30)
+ {
+ t繧ュ繝シ蜃ヲ逅();
+ this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾;
+ }
+ return;
+ }
+ }
+ else
+ {
+ this.n迴セ蝨ィ縺ョ蛟、 = n1蝗樒岼;
+ }
+ }
+ public delegate void DG繧ュ繝シ蜃ヲ逅();
+
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ private CTimer timer;
+ private CSoundTimer timerdb;
+ private double n髢馴囈;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCpuCores.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCpuCores.cs
new file mode 100644
index 00000000..02ecccfc
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCpuCores.cs
@@ -0,0 +1,26 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace FDK
+{
+ public static class CpuCores
+ {
+ [DllImport("kernel32")]
+ public static extern void GetSystemInfo(ref SYSTEM_INFO ptmpsi);
+ [StructLayout(LayoutKind.Sequential)]
+ public struct SYSTEM_INFO {
+ public uint dwOemId;
+ public uint dwPageSize;
+ public uint lpMinimumApplicationAddress;
+ public uint lpMaximumApplicationAddress;
+ public uint dwActiveProcessorMask;
+ public uint dwNumberOfProcessors;
+ public uint dwProcessorType;
+ public uint dwAllocationGranularity;
+ public uint dwProcessorLevel;
+ public uint dwProcessorRevision;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CFPS.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CFPS.cs
new file mode 100644
index 00000000..1d67b950
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CFPS.cs
@@ -0,0 +1,64 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ public class CFPS
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public int n迴セ蝨ィ縺ョFPS
+ {
+ get;
+ private set;
+ }
+ public bool bFPS縺ョ蛟、縺悟、牙喧縺励◆
+ {
+ get;
+ private set;
+ }
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CFPS()
+ {
+ this.n迴セ蝨ィ縺ョFPS = 0;
+ this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ this.蝓コ轤ケ譎ょ綾ms = this.timer.n迴セ蝨ィ譎ょ綾;
+ this.蜀驛ィFPS = 0;
+ this.bFPS縺ョ蛟、縺悟、牙喧縺励◆ = false;
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void t繧ォ繧ヲ繝ウ繧ソ譖エ譁ー()
+ {
+ this.timer.t譖エ譁ー();
+ this.bFPS縺ョ蛟、縺悟、牙喧縺励◆ = false;
+
+ const long INTERVAL = 1000;
+ while( ( this.timer.n迴セ蝨ィ譎ょ綾 - this.蝓コ轤ケ譎ょ綾ms ) >= INTERVAL )
+ {
+ this.n迴セ蝨ィ縺ョFPS = this.蜀驛ィFPS;
+ this.蜀驛ィFPS = 0;
+ this.bFPS縺ョ蛟、縺悟、牙喧縺励◆ = true;
+ this.蝓コ轤ケ譎ょ綾ms += INTERVAL;
+ }
+ this.蜀驛ィFPS++;
+ }
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private CTimer timer;
+ private long 蝓コ轤ケ譎ょ綾ms;
+ private int 蜀驛ィFPS;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CIniFile.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CIniFile.cs
new file mode 100644
index 00000000..a6422a6c
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CIniFile.cs
@@ -0,0 +1,134 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Diagnostics;
+
+namespace FDK
+{
+ ///
+ /// 豎守畑逧縺ェ .ini繝輔ぃ繧、繝ォ繧呈桶縺縲
+ ///
+ public class CIniFile
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public string str繝輔ぃ繧、繝ォ蜷
+ {
+ get;
+ private set;
+ }
+ public List Sections
+ {
+ get;
+ set;
+ }
+ public class CSection
+ {
+ public string str繧サ繧ッ繧キ繝ァ繝ウ蜷 = "";
+ public List> list繝代Λ繝。繝シ繧ソ繝ェ繧ケ繝 = new List>();
+ }
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CIniFile()
+ {
+ this.str繝輔ぃ繧、繝ォ蜷 = "";
+ this.Sections = new List();
+ }
+ public CIniFile( string str繝輔ぃ繧、繝ォ蜷 )
+ :this()
+ {
+ this.t隱ュ縺ソ霎シ縺ソ( str繝輔ぃ繧、繝ォ蜷 );
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void t隱ュ縺ソ霎シ縺ソ( string str繝輔ぃ繧、繝ォ蜷 )
+ {
+ this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷;
+
+ StreamReader sr = null;
+ CSection section = null;
+ try
+ {
+ sr = new StreamReader( this.str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) ); // 繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励↑縺蝣エ蜷医ッ萓句、也匱逕溘
+
+ string line;
+ while( ( line = sr.ReadLine() ) != null )
+ {
+ line = line.Replace( '\t', ' ' ).TrimStart( new char[] { '\t', ' ' } );
+ if( string.IsNullOrEmpty( line ) || line[ 0 ] == ';' ) // ';'莉・髯阪ッ繧ウ繝。繝ウ繝医→縺励※辟。隕
+ continue;
+
+ if( line[ 0 ] == '[' )
+ {
+ #region [ 繧サ繧ッ繧キ繝ァ繝ウ縺ョ螟画峩 ]
+ //-----------------------------
+ var builder = new StringBuilder( 32 );
+ int num = 1;
+ while( ( num < line.Length ) && ( line[ num ] != ']' ) )
+ builder.Append( line[ num++ ] );
+
+ // 螟画焚 section 縺御スソ逕ィ荳ュ縺ョ蝣エ蜷医ッ縲´ist 縺ォ霑ス蜉縺励※譁ー縺励> section 繧剃ス懈舌☆繧九
+ if( section != null )
+ this.Sections.Add( section );
+
+ section = new CSection();
+ section.str繧サ繧ッ繧キ繝ァ繝ウ蜷 = builder.ToString();
+ //-----------------------------
+ #endregion
+
+ continue;
+ }
+
+ string[] strArray = line.Split( new char[] { '=' } );
+ if( strArray.Length != 2 )
+ continue;
+
+ string key = strArray[ 0 ].Trim();
+ string value = strArray[ 1 ].Trim();
+
+ if( section != null && !string.IsNullOrEmpty( key ) && !string.IsNullOrEmpty( value ) )
+ section.list繝代Λ繝。繝シ繧ソ繝ェ繧ケ繝.Add( new KeyValuePair( key, value ) );
+ }
+
+ if( section != null )
+ this.Sections.Add( section );
+ }
+ finally
+ {
+ if( sr != null )
+ sr.Close();
+ }
+ }
+ public void t譖ク縺榊コ縺( string str繝輔ぃ繧、繝ォ蜷 )
+ {
+ this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷;
+ this.t譖ク縺榊コ縺();
+ }
+ public void t譖ク縺榊コ縺()
+ {
+ StreamWriter sw = null;
+ try
+ {
+ sw = new StreamWriter( this.str繝輔ぃ繧、繝ォ蜷, false, Encoding.GetEncoding( "Shift_JIS" ) ); // 繧ェ繝シ繝励Φ螟ア謨励ョ蝣エ蜷医ッ萓句、也匱逕溘
+
+ foreach( CSection section in this.Sections )
+ {
+ sw.WriteLine( "[{0}]", section.str繧サ繧ッ繧キ繝ァ繝ウ蜷 );
+
+ foreach( KeyValuePair kvp in section.list繝代Λ繝。繝シ繧ソ繝ェ繧ケ繝 )
+ sw.WriteLine( "{0}={1}", kvp.Key, kvp.Value );
+ }
+ }
+ finally
+ {
+ if( sw != null )
+ sw.Close();
+ }
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CJudgeTextEncoding.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CJudgeTextEncoding.cs
new file mode 100644
index 00000000..9d2952e5
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CJudgeTextEncoding.cs
@@ -0,0 +1,81 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using System.Diagnostics;
+
+namespace TJAPlayer3
+{
+ public class CJudgeTextEncoding
+ {
+ ///
+ /// Hnc8讒倥ョReadJEnc繧剃スソ逕ィ縺励※譁蟄励さ繝シ繝峨ョ蛻、蛻・繧偵☆繧九
+ ///
+ public static Encoding JudgeFileEncoding(string path)
+ {
+ if (!File.Exists(path)) return null;
+ Encoding enc;
+ FileInfo file = new FileInfo(path);
+
+ using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file))
+ {
+ // 蛻、蛻・隱ュ縺ソ蜃コ縺怜ョ溯。後ょ愛蛻・邨先棡縺ッRead繝。繧ス繝繝峨ョ謌サ繧雁、縺ァ謚頑升縺ァ縺阪∪縺
+ Hnx8.ReadJEnc.CharCode c = reader.Read(file);
+ // 謌サ繧雁、縺ョName繝励Ο繝代ユ繧」縺九i譁蟄励さ繝シ繝牙錐繧貞叙蠕励〒縺阪∪縺
+ string name = c.Name;
+ Console.WriteLine("縲" + name + "縲" + file.Name);
+ // GetEncoding()繧貞他縺ウ蜃コ縺吶→縲√お繝ウ繧ウ繝シ繝繧」繝ウ繧ー繧貞叙蠕励〒縺阪∪縺
+ enc = c.GetEncoding();
+ }
+ Debug.Print(path + " Encoding=" + enc.CodePage);
+
+ if (enc == null)
+ {
+ enc = Encoding.GetEncoding(932);
+ }
+ return enc;
+ }
+ ///
+ /// Hnc8讒倥ョReadJEnc繧剃スソ逕ィ縺励※繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ繧定ェュ縺ソ霎シ繧縲
+ /// 謾ケ陦梧枚蟄励ッ縲∝享謇九↓\n縺ォ邨ア荳縺吶k
+ ///
+ ///
+ ///
+ public static string ReadTextFile(string path)
+ {
+ if (!File.Exists(path)) return null;
+ string str = null;
+ FileInfo file = new FileInfo(path);
+
+ using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file))
+ {
+ reader.Read(file);
+ str = reader.Text;
+ }
+
+ str = str.Replace(JudgeNewLine(str), "\n");
+
+ return str;
+ }
+
+ ///
+ /// Environment.NewLine縺ッ繝励Λ繝繝医ヵ繧ゥ繝シ繝萓晏ュ倥〒縺ゅk縲
+ /// 縺縺後√ヵ繧。繧、繝ォ縺斐→縺ォ謾ケ陦後さ繝シ繝峨ッ驕輔≧縺ョ縺ァ縲∽スソ逕ィ縺吶∋縺阪〒縺ッ縺ェ縺縲
+ /// 縺ェ縺ョ縺ァ縲∝享謇九↓謾ケ陦梧枚蟄励r蛻、譁ュ縺吶k縲
+ ///
+ ///
+ ///
+ public static string JudgeNewLine(string str)
+ {
+ if (str.Contains("\r\n"))
+ return ("\r\n");
+
+ if (str.Contains("\r"))
+ return ("\r");
+
+ return ("\n");
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/COS.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/COS.cs
new file mode 100644
index 00000000..cb339761
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/COS.cs
@@ -0,0 +1,35 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ public static class COS
+ {
+ ///
+ /// OS縺傾P莉・蜑阪↑繧映alse, Vista莉・髯阪↑繧液rue繧定ソ斐☆
+ ///
+ ///
+ public static bool bIsVistaOrLater
+ {
+ get
+ {
+ //繝励Λ繝繝医ヵ繧ゥ繝シ繝縺ョ蜿門セ
+ System.OperatingSystem os = System.Environment.OSVersion;
+ if ( os.Platform != PlatformID.Win32NT ) // NT邉サ縺ァ縺ェ縺代l縺ー縲々P莉・蜑阪°縲 ̄C Windows邉サ莉・螟悶ョOS縺ョ縺溘a縲〃ista莉・髯阪〒縺ッ縺ェ縺縲ゅh縺」縺ヲfalse繧定ソ斐☆縲
+ {
+ return false;
+ }
+
+ if ( os.Version.Major >= 6 )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CPowerManagement.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CPowerManagement.cs
new file mode 100644
index 00000000..a746a413
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CPowerManagement.cs
@@ -0,0 +1,28 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ ///
+ /// 繧キ繧ケ繝繝縺ィ繝「繝九ち縺ョ逵髮サ蜉帛宛蠕。繧定。後≧
+ ///
+ public static class CPowerManagement
+ {
+ ///
+ /// 譛ャ菴/繝「繝九ち縺ョ逵髮サ蜉帙Δ繝シ繝臥ァサ陦後r謚第ュ「縺吶k
+ ///
+ public static void tDisableMonitorSuspend()
+ {
+ CWin32.SetThreadExecutionState( CWin32.ExecutionState.SystemRequired | CWin32.ExecutionState.DisplayRequired );
+ }
+
+ ///
+ /// 譛ャ菴/繝「繝九ち縺ョ逵髮サ蜉帙Δ繝シ繝臥ァサ陦梧椛蛻カ繧定ァ」髯、縺吶k
+ ///
+ public static void tEnableMonitorSuspend()
+ {
+ CWin32.SetThreadExecutionState( CWin32.ExecutionState.Continuous ); // 繧ケ繝ェ繝シ繝玲椛豁「迥カ諷九r隗」髯、
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CSendMessage.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CSendMessage.cs
new file mode 100644
index 00000000..80d84109
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CSendMessage.cs
@@ -0,0 +1,33 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using System.Text;
+
+namespace FDK
+{
+ public static class CSendMessage
+ {
+
+ [DllImport( "USER32.dll" )]
+ static extern uint SendMessage( IntPtr window, int msg, IntPtr wParam, ref SampleFramework.COPYDATASTRUCT lParam );
+
+
+ public static uint sendmessage( IntPtr MainWindowHandle, IntPtr FromWindowHandle, string arg)
+ {
+ uint len = (uint) arg.Length;
+
+ SampleFramework.COPYDATASTRUCT cds;
+ cds.dwData = IntPtr.Zero; // 菴ソ逕ィ縺励↑縺
+ cds.lpData = Marshal.StringToHGlobalUni( arg ); // 繝繧ュ繧ケ繝医ョ繝昴う繝ウ繧ソ繝シ繧偵そ繝繝
+ cds.cbData = ( len + 1 ) * 2; // 髟キ縺輔r繧サ繝繝
+
+ //譁蟄怜励r騾√k
+ uint result = SendMessage( MainWindowHandle, SampleFramework.WindowConstants.WM_COPYDATA, FromWindowHandle, ref cds );
+
+ Marshal.FreeHGlobal( cds.lpData );
+
+ return result;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimer.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimer.cs
new file mode 100644
index 00000000..d9e9fbb4
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimer.cs
@@ -0,0 +1,162 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using DirectShowLib;
+
+namespace FDK
+{
+ public class CTimer : CTimerBase
+ {
+ public enum E遞ョ蛻・
+ {
+ Unknown = -1,
+ PerformanceCounter = 0,
+ MultiMedia = 1,
+ GetTickCount = 2,
+ }
+ public E遞ョ蛻・ e繧ソ繧、繝樒ィョ蛻・
+ {
+ get;
+ protected set;
+ }
+
+
+ public override long n繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get
+ {
+ switch( this.e繧ソ繧、繝樒ィョ蛻・ )
+ {
+ case E遞ョ蛻・.PerformanceCounter:
+ {
+ double num = 0.0;
+ if( this.n迴セ蝨ィ縺ョ蜻ィ豕「謨ー != 0L )
+ {
+ long x = 0L;
+ QueryPerformanceCounter( ref x );
+ num = ( (double) x ) / ( ( (double) this.n迴セ蝨ィ縺ョ蜻ィ豕「謨ー ) / 1000.0 );
+ }
+ return (long) num;
+ }
+ case E遞ョ蛻・.MultiMedia:
+ return (long) timeGetTime();
+
+ case E遞ョ蛻・.GetTickCount:
+ return (long) Environment.TickCount;
+ }
+ return 0;
+ }
+ }
+
+ public CTimer( E遞ョ蛻・ e繧ソ繧、繝樒ィョ蛻・ )
+ :base()
+ {
+ this.e繧ソ繧、繝樒ィョ蛻・ = e繧ソ繧、繝樒ィョ蛻・;
+
+ if( n蜿らァ繧ォ繧ヲ繝ウ繝[ (int) this.e繧ソ繧、繝樒ィョ蛻・ ] == 0 )
+ {
+ switch( this.e繧ソ繧、繝樒ィョ蛻・ )
+ {
+ case E遞ョ蛻・.PerformanceCounter:
+ if( !this.b遒コ隱阪→險ュ螳喟PerformanceCounter() && !this.b遒コ隱阪→險ュ螳喟MultiMedia() )
+ this.b遒コ隱阪→險ュ螳喟GetTickCount();
+ break;
+
+ case E遞ョ蛻・.MultiMedia:
+ if( !this.b遒コ隱阪→險ュ螳喟MultiMedia() && !this.b遒コ隱阪→險ュ螳喟PerformanceCounter() )
+ this.b遒コ隱阪→險ュ螳喟GetTickCount();
+ break;
+
+ case E遞ョ蛻・.GetTickCount:
+ this.b遒コ隱阪→險ュ螳喟GetTickCount();
+ break;
+
+ default:
+ throw new ArgumentException( string.Format( "譛ェ遏・縺ョ繧ソ繧、繝樒ィョ蛻・縺ァ縺吶[{0}]", this.e繧ソ繧、繝樒ィョ蛻・ ) );
+ }
+ }
+
+ base.t繝ェ繧サ繝繝();
+
+ n蜿らァ繧ォ繧ヲ繝ウ繝[ (int) this.e繧ソ繧、繝樒ィョ蛻・ ]++;
+ }
+
+ public override void Dispose()
+ {
+ if( this.e繧ソ繧、繝樒ィョ蛻・ == E遞ョ蛻・.Unknown )
+ return;
+
+ int type = (int) this.e繧ソ繧、繝樒ィョ蛻・;
+
+ n蜿らァ繧ォ繧ヲ繝ウ繝[ type ] = Math.Max( n蜿らァ繧ォ繧ヲ繝ウ繝[ type ] - 1, 0 );
+
+ if( n蜿らァ繧ォ繧ヲ繝ウ繝[ type ] == 0 )
+ {
+ if( this.e繧ソ繧、繝樒ィョ蛻・ == E遞ョ蛻・.MultiMedia )
+ timeEndPeriod( this.timeCaps.wPeriodMin );
+ }
+
+ this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.Unknown;
+ }
+
+ #region [ protected ]
+ //-----------------
+ protected long n迴セ蝨ィ縺ョ蜻ィ豕「謨ー;
+ protected static int[] n蜿らァ繧ォ繧ヲ繝ウ繝 = new int[ 3 ];
+ protected TimeCaps timeCaps;
+
+ protected bool b遒コ隱阪→險ュ螳喟GetTickCount()
+ {
+ this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.GetTickCount;
+ return true;
+ }
+ protected bool b遒コ隱阪→險ュ螳喟MultiMedia()
+ {
+ this.timeCaps = new TimeCaps();
+ if( ( timeGetDevCaps( out this.timeCaps, (uint) Marshal.SizeOf( typeof( TimeCaps ) ) ) == 0 ) && ( this.timeCaps.wPeriodMin < 10 ) )
+ {
+ this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.MultiMedia;
+ timeBeginPeriod( this.timeCaps.wPeriodMin );
+ return true;
+ }
+ return false;
+ }
+ protected bool b遒コ隱阪→險ュ螳喟PerformanceCounter()
+ {
+ if( QueryPerformanceFrequency( ref this.n迴セ蝨ィ縺ョ蜻ィ豕「謨ー ) != 0 )
+ {
+ this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.PerformanceCounter;
+ return true;
+ }
+ return false;
+ }
+ //-----------------
+ #endregion
+
+ #region [ DllImport ]
+ //-----------------
+ [DllImport( "kernel32.dll" )]
+ protected static extern short QueryPerformanceCounter( ref long x );
+ [DllImport( "kernel32.dll" )]
+ protected static extern short QueryPerformanceFrequency( ref long x );
+ [DllImport( "winmm.dll" )]
+ protected static extern void timeBeginPeriod( uint x );
+ [DllImport( "winmm.dll" )]
+ protected static extern void timeEndPeriod( uint x );
+ [DllImport( "winmm.dll" )]
+ protected static extern uint timeGetDevCaps( out TimeCaps timeCaps, uint size );
+ [DllImport( "winmm.dll" )]
+ protected static extern uint timeGetTime();
+
+ [StructLayout( LayoutKind.Sequential )]
+ protected struct TimeCaps
+ {
+ public uint wPeriodMin;
+ public uint wPeriodMax;
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimerBase.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimerBase.cs
new file mode 100644
index 00000000..1e96177d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimerBase.cs
@@ -0,0 +1,179 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ ///
+ /// 繧ソ繧、繝槭ョ謚ス雎。繧ッ繝ゥ繧ケ縲
+ /// 縺薙ョ繧ッ繝ゥ繧ケ繧堤カ呎価縺励{verride 縺励◆繧ッ繝ゥ繧ケ繧剃ス懈舌☆繧九%縺ィ縺ァ縲∽ササ諢上ョ繧ッ繝ュ繝繧ッ繧呈戟縺、繧ソ繧、繝槭r菴懈舌〒縺阪k縲
+ ///
+ public abstract class CTimerBase : IDisposable
+ {
+ public const long n譛ェ菴ソ逕ィ = -1;
+
+ // 縺薙ョシ偵▽繧 override 縺吶k縲
+ public abstract long n繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get;
+ }
+ public double db繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get;
+ set;
+ }
+ public abstract void Dispose();
+
+ #region [ DTXMania逕ィ縺ォ縲∬ェ槫ーセ縺ォms縺ョ縺、縺九↑縺螳」險繧定ソス蜉 ]
+ public long n繧キ繧ケ繝繝譎ょ綾
+ {
+ get { return n繧キ繧ケ繝繝譎ょ綾ms; }
+ }
+ public long n迴セ蝨ィ譎ょ綾
+ {
+ get { return n迴セ蝨ィ譎ょ綾ms; }
+ set { n迴セ蝨ィ譎ょ綾ms = value; }
+ }
+ public long n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾
+ {
+ get { return n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms; }
+ }
+
+ //double
+ public double db繧キ繧ケ繝繝譎ょ綾
+ {
+ get { return db繧キ繧ケ繝繝譎ょ綾ms; }
+ }
+ public double db迴セ蝨ィ譎ょ綾
+ {
+ get { return db迴セ蝨ィ譎ょ綾ms; }
+ set { db迴セ蝨ィ譎ょ綾ms = value; }
+ }
+ public double db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾
+ {
+ get { return db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms; }
+ }
+ #endregion
+
+ public long n迴セ蝨ィ譎ょ綾ms
+ {
+ get
+ {
+ if( this.n蛛懈ュ「謨ー > 0 )
+ return ( this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+
+ return ( this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+ }
+ set
+ {
+ if( this.n蛛懈ュ「謨ー > 0 )
+ this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - value;
+ else
+ this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - value;
+ }
+ }
+ public long n繝ェ繧「繝ォ繧ソ繧、繝迴セ蝨ィ譎ょ綾ms
+ {
+ get
+ {
+ if( this.n蛛懈ュ「謨ー > 0 )
+ return ( this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+
+ return ( this.n繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+ }
+ }
+ public long n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get;
+ protected set;
+ }
+
+
+ public double db迴セ蝨ィ譎ょ綾ms
+ {
+ get
+ {
+ if( this.n蛛懈ュ「謨ー > 0 )
+ return ( this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+
+ return ( this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+ }
+ set
+ {
+ if( this.n蛛懈ュ「謨ー > 0 )
+ this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - value;
+ else
+ this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - value;
+ }
+ }
+ public double db繝ェ繧「繝ォ繧ソ繧、繝迴セ蝨ィ譎ょ綾ms
+ {
+ get
+ {
+ if( this.n蛛懈ュ「謨ー > 0 )
+ return ( this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+
+ return ( this.db繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms );
+ }
+ }
+ public double db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get;
+ protected set;
+ }
+
+ public bool b蛛懈ュ「縺励※縺縺ェ縺
+ {
+ get
+ {
+ return ( this.n蛛懈ュ「謨ー == 0 );
+ }
+ }
+
+ public void t繝ェ繧サ繝繝()
+ {
+ this.t譖エ譁ー();
+ this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms;
+ this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms;
+ this.n蛛懈ュ「謨ー = 0;
+ }
+ public void t荳譎ょ●豁「()
+ {
+ if( this.n蛛懈ュ「謨ー == 0 )
+ {
+ this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms;
+ this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms;
+ }
+
+ this.n蛛懈ュ「謨ー++;
+ }
+ public void t譖エ譁ー()
+ {
+ this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = this.n繧キ繧ケ繝繝譎ょ綾ms;
+ this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = this.db繧キ繧ケ繝繝譎ょ綾ms;
+ }
+ public void t蜀埼幕()
+ {
+ if( this.n蛛懈ュ「謨ー > 0 )
+ {
+ this.n蛛懈ュ「謨ー--;
+ if( this.n蛛懈ュ「謨ー == 0 )
+ {
+ this.t譖エ譁ー();
+ this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms += this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms;
+ this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms += this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms;
+ }
+ }
+ }
+
+ #region [ protected ]
+ //-----------------
+ protected long n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = 0;
+ protected long n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = 0;
+ protected double db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = 0;
+ protected double db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = 0;
+ protected int n蛛懈ュ「謨ー = 0;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTraceLogListener.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTraceLogListener.cs
new file mode 100644
index 00000000..d89ff96c
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTraceLogListener.cs
@@ -0,0 +1,157 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Diagnostics;
+
+namespace FDK
+{
+ public class CTraceLogListener : TraceListener
+ {
+ public CTraceLogListener( StreamWriter stream )
+ {
+ this.streamWriter = stream;
+ }
+
+ public override void Flush()
+ {
+ if( this.streamWriter != null )
+ {
+ try
+ {
+ this.streamWriter.Flush();
+ }
+ catch( ObjectDisposedException )
+ {
+ }
+ }
+ }
+ public override void TraceEvent( TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message )
+ {
+ if( this.streamWriter != null )
+ {
+ try
+ {
+ this.t繧、繝吶Φ繝育ィョ蛻・繧貞コ蜉帙☆繧( eventType );
+ this.t繧、繝ウ繝繝ウ繝医r蜃コ蜉帙☆繧();
+ this.streamWriter.WriteLine( message );
+ }
+ catch( ObjectDisposedException )
+ {
+ }
+ }
+ }
+ public override void TraceEvent( TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args )
+ {
+ if( this.streamWriter != null )
+ {
+ try
+ {
+ this.t繧、繝吶Φ繝育ィョ蛻・繧貞コ蜉帙☆繧( eventType );
+ this.t繧、繝ウ繝繝ウ繝医r蜃コ蜉帙☆繧();
+ this.streamWriter.WriteLine( string.Format( format, args ) );
+ }
+ catch( ObjectDisposedException )
+ {
+ }
+ }
+ }
+ public override void Write( string message )
+ {
+ if( this.streamWriter != null )
+ {
+ try
+ {
+ this.streamWriter.Write( message );
+ }
+ catch( ObjectDisposedException )
+ {
+ }
+ }
+ }
+ public override void WriteLine( string message )
+ {
+ if( this.streamWriter != null )
+ {
+ try
+ {
+ this.streamWriter.WriteLine( message );
+ }
+ catch( ObjectDisposedException )
+ {
+ }
+ }
+ }
+
+ protected override void Dispose( bool disposing )
+ {
+ if( this.streamWriter != null )
+ {
+ try
+ {
+ this.streamWriter.Close();
+ }
+ catch
+ {
+ }
+ this.streamWriter = null;
+ }
+ base.Dispose( disposing );
+ }
+
+ #region [ private ]
+ //-----------------
+ private StreamWriter streamWriter;
+
+ private void t繧、繝吶Φ繝育ィョ蛻・繧貞コ蜉帙☆繧( TraceEventType eventType )
+ {
+ if( this.streamWriter != null )
+ {
+ try
+ {
+ var now = DateTime.Now;
+ this.streamWriter.Write( string.Format( "{0:D4}/{1:D2}/{2:D2} {3:D2}:{4:D2}:{5:D2}.{6:D3} ", new object[] { now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Millisecond } ) );
+ switch( eventType )
+ {
+ case TraceEventType.Error:
+ this.streamWriter.Write( "[ERROR] " );
+ return;
+
+ case ( TraceEventType.Error | TraceEventType.Critical ):
+ return;
+
+ case TraceEventType.Warning:
+ this.streamWriter.Write( "[WARNING] " );
+ return;
+
+ case TraceEventType.Information:
+ break;
+
+ default:
+ return;
+ }
+ this.streamWriter.Write( "[INFO] " );
+ }
+ catch( ObjectDisposedException )
+ {
+ }
+ }
+ }
+ private void t繧、繝ウ繝繝ウ繝医r蜃コ蜉帙☆繧()
+ {
+ if( ( this.streamWriter != null ) && ( base.IndentLevel > 0 ) )
+ {
+ try
+ {
+ for( int i = 0; i < base.IndentLevel; i++ )
+ this.streamWriter.Write( " " );
+ }
+ catch( ObjectDisposedException )
+ {
+ }
+ }
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CWin32.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CWin32.cs
new file mode 100644
index 00000000..94b272ff
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CWin32.cs
@@ -0,0 +1,661 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Drawing;
+
+namespace FDK
+{
+ public class CWin32
+ {
+ #region [ Win32 螳壽焚 ]
+ //-----------------
+ public const int S_OK = 0x00000000;
+ public const int S_FALSE = 0x00000001;
+ public const int E_FAIL = unchecked( (int) 0x80004005 );
+ public const int E_ABORT = unchecked( (int) 0x80004004 );
+
+ public const int BROADCAST_QUERY_DENY = 0x424d5144;
+
+ public const uint CALLBACK_FUNCTION = 0x30000;
+ public const uint ES_CONTINUOUS = 0x80000000;
+ public const uint ES_DISPLAY_REQUIRED = 2;
+ public const uint ES_SYSTEM_REQUIRED = 1;
+ public const uint ES_USER_PRESENT = 4;
+
+ public const int GWL_EXSTYLE = -20;
+ public const int GWL_HINSTANCE = -6;
+ public const int GWL_HWNDPARENT = -8;
+ public const int GWL_ID = -12;
+ public const int GWL_STYLE = -16;
+ public const int GWL_USERDATA = -21;
+ public const int GWL_WNDPROC = -4;
+
+ public static readonly IntPtr HWND_NOTOPMOST = new IntPtr( -2 );
+ public static readonly IntPtr HWND_TOPMOST = new IntPtr( -1 );
+ public const uint MAXPNAMELEN = 0x20;
+
+ #region [ MIDI繝。繝繧サ繝シ繧ク ]
+ public const uint MIM_CLOSE = 0x3c2;
+ public const uint MIM_DATA = 0x3c3;
+ public const uint MIM_ERROR = 0x3c5;
+ public const uint MIM_LONGDATA = 0x3c4;
+ public const uint MIM_LONGERROR = 0x3c6;
+ public const uint MIM_OPEN = 0x3c1;
+ #endregion
+
+ public const int MONITOR_DEFAULTTOPRIMARY = 1;
+
+ public const int PBT_APMQUERYSTANDBY = 1;
+ public const int PBT_APMQUERYSUSPEND = 0;
+
+ public const int SC_MONITORPOWER = 0xf170;
+ public const int SC_SCREENSAVE = 0xf140;
+
+ public const int SIZE_MAXIMIZED = 2;
+ public const int SIZE_MINIMIZED = 1;
+ public const int SIZE_RESTORED = 0;
+
+ public const uint SWP_FRAMECHANGED = 0x20;
+ public const uint SWP_HIDEWINDOW = 0x80;
+ public const uint SWP_NOACTIVATE = 0x10;
+ public const uint SWP_NOCOPYBITS = 0x100;
+ public const uint SWP_NOMOVE = 2;
+ public const uint SWP_NOOWNERZORDER = 0x200;
+ public const uint SWP_NOREDRAW = 8;
+ public const uint SWP_NOSENDCHANGING = 0x400;
+ public const uint SWP_NOSIZE = 1;
+ public const uint SWP_NOZORDER = 4;
+ public const uint SWP_SHOWWINDOW = 0x40;
+
+ public const uint PM_NOREMOVE = 0;
+ public const uint PM_REMOVE = 1;
+
+ #region [ DirectShow, VFW 髢「騾」 ]
+ //-----------------
+ public const int S_WARN_OUTPUTRESET = 0x00009DD4;
+ public const int E_NOTINTREE = unchecked( (int) 0x80040400 );
+ public const int E_RENDER_ENGINE_IS_BROKEN = unchecked( (int) 0x80040401 );
+ public const int E_MUST_INIT_RENDERER = unchecked( (int) 0x80040402 );
+ public const int E_NOTDETERMINED = unchecked( (int) 0x80040403 );
+ public const int E_NO_TIMELINE = unchecked( (int) 0x80040404 );
+
+ public const int VFW_E_INVALIDMEDIATYPE = unchecked( (int) 0x80040200 );
+ public const int VFW_E_INVALIDSUBTYPE = unchecked( (int) 0x80040201 );
+ public const int VFW_E_NEED_OWNER = unchecked( (int) 0x80040202 );
+ public const int VFW_E_ENUM_OUT_OF_SYNC = unchecked( (int) 0x80040203 );
+ public const int VFW_E_ALREADY_CONNECTED = unchecked( (int) 0x80040204 );
+ public const int VFW_E_FILTER_ACTIVE = unchecked( (int) 0x80040205 );
+ public const int VFW_E_NO_TYPES = unchecked( (int) 0x80040206 );
+ public const int VFW_E_NO_ACCEPTABLE_TYPES = unchecked( (int) 0x80040207 );
+ public const int VFW_E_INVALID_DIRECTION = unchecked( (int) 0x80040208 );
+ public const int VFW_E_NOT_CONNECTED = unchecked( (int) 0x80040209 );
+ public const int VFW_E_NO_ALLOCATOR = unchecked( (int) 0x8004020A );
+ public const int VFW_E_RUNTIME_ERROR = unchecked( (int) 0x8004020B );
+ public const int VFW_E_BUFFER_NOTSET = unchecked( (int) 0x8004020C );
+ public const int VFW_E_BUFFER_OVERFLOW = unchecked( (int) 0x8004020D );
+ public const int VFW_E_BADALIGN = unchecked( (int) 0x8004020E );
+ public const int VFW_E_ALREADY_COMMITTED = unchecked( (int) 0x8004020F );
+ public const int VFW_E_BUFFERS_OUTSTANDING = unchecked( (int) 0x80040210 );
+ public const int VFW_E_NOT_COMMITTED = unchecked( (int) 0x80040211 );
+ public const int VFW_E_SIZENOTSET = unchecked( (int) 0x80040212 );
+ public const int VFW_E_NO_CLOCK = unchecked( (int) 0x80040213 );
+ public const int VFW_E_NO_SINK = unchecked( (int) 0x80040214 );
+ public const int VFW_E_NO_INTERFACE = unchecked( (int) 0x80040215 );
+ public const int VFW_E_NOT_FOUND = unchecked( (int) 0x80040216 );
+ public const int VFW_E_CANNOT_CONNECT = unchecked( (int) 0x80040217 );
+ public const int VFW_E_CANNOT_RENDER = unchecked( (int) 0x80040218 );
+ public const int VFW_E_CHANGING_FORMAT = unchecked( (int) 0x80040219 );
+ public const int VFW_E_NO_COLOR_KEY_SET = unchecked( (int) 0x8004021A );
+ public const int VFW_E_NOT_OVERLAY_CONNECTION = unchecked( (int) 0x8004021B );
+ public const int VFW_E_NOT_SAMPLE_CONNECTION = unchecked( (int) 0x8004021C );
+ public const int VFW_E_PALETTE_SET = unchecked( (int) 0x8004021D );
+ public const int VFW_E_COLOR_KEY_SET = unchecked( (int) 0x8004021E );
+ public const int VFW_E_NO_COLOR_KEY_FOUND = unchecked( (int) 0x8004021F );
+ public const int VFW_E_NO_PALETTE_AVAILABLE = unchecked( (int) 0x80040220 );
+ public const int VFW_E_NO_DISPLAY_PALETTE = unchecked( (int) 0x80040221 );
+ public const int VFW_E_TOO_MANY_COLORS = unchecked( (int) 0x80040222 );
+ public const int VFW_E_STATE_CHANGED = unchecked( (int) 0x80040223 );
+ public const int VFW_E_NOT_STOPPED = unchecked( (int) 0x80040224 );
+ public const int VFW_E_NOT_PAUSED = unchecked( (int) 0x80040225 );
+ public const int VFW_E_NOT_RUNNING = unchecked( (int) 0x80040226 );
+ public const int VFW_E_WRONG_STATE = unchecked( (int) 0x80040227 );
+ public const int VFW_E_START_TIME_AFTER_END = unchecked( (int) 0x80040228 );
+ public const int VFW_E_INVALID_RECT = unchecked( (int) 0x80040229 );
+ public const int VFW_E_TYPE_NOT_ACCEPTED = unchecked( (int) 0x8004022A );
+ public const int VFW_E_SAMPLE_REJECTED = unchecked( (int) 0x8004022B );
+ public const int VFW_E_SAMPLE_REJECTED_EOS = unchecked( (int) 0x8004022C );
+ public const int VFW_E_DUPLICATE_NAME = unchecked( (int) 0x8004022D );
+ public const int VFW_S_DUPLICATE_NAME = 0x0004022D;
+ public const int VFW_E_TIMEOUT = unchecked( (int) 0x8004022E );
+ public const int VFW_E_INVALID_FILE_FORMAT = unchecked( (int) 0x8004022F );
+ public const int VFW_E_ENUM_OUT_OF_RANGE = unchecked( (int) 0x80040230 );
+ public const int VFW_E_CIRCULAR_GRAPH = unchecked( (int) 0x80040231 );
+ public const int VFW_E_NOT_ALLOWED_TO_SAVE = unchecked( (int) 0x80040232 );
+ public const int VFW_E_TIME_ALREADY_PASSED = unchecked( (int) 0x80040233 );
+ public const int VFW_E_ALREADY_CANCELLED = unchecked( (int) 0x80040234 );
+ public const int VFW_E_CORRUPT_GRAPH_FILE = unchecked( (int) 0x80040235 );
+ public const int VFW_E_ADVISE_ALREADY_SET = unchecked( (int) 0x80040236 );
+ public const int VFW_S_STATE_INTERMEDIATE = 0x00040237;
+ public const int VFW_E_NO_MODEX_AVAILABLE = unchecked( (int) 0x80040238 );
+ public const int VFW_E_NO_ADVISE_SET = unchecked( (int) 0x80040239 );
+ public const int VFW_E_NO_FULLSCREEN = unchecked( (int) 0x8004023A );
+ public const int VFW_E_IN_FULLSCREEN_MODE = unchecked( (int) 0x8004023B );
+ public const int VFW_E_UNKNOWN_FILE_TYPE = unchecked( (int) 0x80040240 );
+ public const int VFW_E_CANNOT_LOAD_SOURCE_FILTER = unchecked( (int) 0x80040241 );
+ public const int VFW_S_PARTIAL_RENDER = 0x00040242;
+ public const int VFW_E_FILE_TOO_SHORT = unchecked( (int) 0x80040243 );
+ public const int VFW_E_INVALID_FILE_VERSION = unchecked( (int) 0x80040244 );
+ public const int VFW_S_SOME_DATA_IGNORED = 0x00040245;
+ public const int VFW_S_CONNECTIONS_DEFERRED = 0x00040246;
+ public const int VFW_E_INVALID_CLSID = unchecked( (int) 0x80040247 );
+ public const int VFW_E_INVALID_MEDIA_TYPE = unchecked( (int) 0x80040248 );
+ public const int VFW_E_SAMPLE_TIME_NOT_SET = unchecked( (int) 0x80040249 );
+ public const int VFW_S_RESOURCE_NOT_NEEDED = 0x00040250;
+ public const int VFW_E_MEDIA_TIME_NOT_SET = unchecked( (int) 0x80040251 );
+ public const int VFW_E_NO_TIME_FORMAT_SET = unchecked( (int) 0x80040252 );
+ public const int VFW_E_MONO_AUDIO_HW = unchecked( (int) 0x80040253 );
+ public const int VFW_S_MEDIA_TYPE_IGNORED = 0x00040254;
+ public const int VFW_E_NO_DECOMPRESSOR = unchecked( (int) 0x80040255 );
+ public const int VFW_E_NO_AUDIO_HARDWARE = unchecked( (int) 0x80040256 );
+ public const int VFW_S_VIDEO_NOT_RENDERED = 0x00040257;
+ public const int VFW_S_AUDIO_NOT_RENDERED = 0x00040258;
+ public const int VFW_E_RPZA = unchecked( (int) 0x80040259 );
+ public const int VFW_S_RPZA = 0x0004025A;
+ public const int VFW_E_PROCESSOR_NOT_SUITABLE = unchecked( (int) 0x8004025B );
+ public const int VFW_E_UNSUPPORTED_AUDIO = unchecked( (int) 0x8004025C );
+ public const int VFW_E_UNSUPPORTED_VIDEO = unchecked( (int) 0x8004025D );
+ public const int VFW_E_MPEG_NOT_CONSTRAINED = unchecked( (int) 0x8004025E );
+ public const int VFW_E_NOT_IN_GRAPH = unchecked( (int) 0x8004025F );
+ public const int VFW_S_ESTIMATED = 0x00040260;
+ public const int VFW_E_NO_TIME_FORMAT = unchecked( (int) 0x80040261 );
+ public const int VFW_E_READ_ONLY = unchecked( (int) 0x80040262 );
+ public const int VFW_S_RESERVED = 0x00040263;
+ public const int VFW_E_BUFFER_UNDERFLOW = unchecked( (int) 0x80040264 );
+ public const int VFW_E_UNSUPPORTED_STREAM = unchecked( (int) 0x80040265 );
+ public const int VFW_E_NO_TRANSPORT = unchecked( (int) 0x80040266 );
+ public const int VFW_S_STREAM_OFF = 0x00040267;
+ public const int VFW_S_CANT_CUE = 0x00040268;
+ public const int VFW_E_BAD_VIDEOCD = unchecked( (int) 0x80040269 );
+ public const int VFW_S_NO_STOP_TIME = 0x00040270;
+ public const int VFW_E_OUT_OF_VIDEO_MEMORY = unchecked( (int) 0x80040271 );
+ public const int VFW_E_VP_NEGOTIATION_FAILED = unchecked( (int) 0x80040272 );
+ public const int VFW_E_DDRAW_CAPS_NOT_SUITABLE = unchecked( (int) 0x80040273 );
+ public const int VFW_E_NO_VP_HARDWARE = unchecked( (int) 0x80040274 );
+ public const int VFW_E_NO_CAPTURE_HARDWARE = unchecked( (int) 0x80040275 );
+ public const int VFW_E_DVD_OPERATION_INHIBITED = unchecked( (int) 0x80040276 );
+ public const int VFW_E_DVD_INVALIDDOMAIN = unchecked( (int) 0x80040277 );
+ public const int VFW_E_DVD_NO_BUTTON = unchecked( (int) 0x80040278 );
+ public const int VFW_E_DVD_GRAPHNOTREADY = unchecked( (int) 0x80040279 );
+ public const int VFW_E_DVD_RENDERFAIL = unchecked( (int) 0x8004027A );
+ public const int VFW_E_DVD_DECNOTENOUGH = unchecked( (int) 0x8004027B );
+ public const int VFW_E_DVD_NOT_IN_KARAOKE_MODE = unchecked( (int) 0x8004028B );
+ public const int VFW_E_FRAME_STEP_UNSUPPORTED = unchecked( (int) 0x8004028E );
+ public const int VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD = unchecked( (int) 0x80040293 );
+ public const int VFW_E_PIN_ALREADY_BLOCKED = unchecked( (int) 0x80040294 );
+ public const int VFW_E_CERTIFICATION_FAILURE = unchecked( (int) 0x80040295 );
+ public const int VFW_E_BAD_KEY = unchecked( (int) 0x800403F2 );
+ //-----------------
+ #endregion
+
+ #region [ Windows繝。繝繧サ繝シ繧ク ]
+ public const uint WM_ACTIVATEAPP = 0x1c;
+ public const uint WM_COPYDATA = 0x4a;
+ public const uint WM_CLOSE = 0x10;
+ public const uint WM_POWERBROADCAST = 0x218;
+ public const uint WM_SIZE = 5;
+ public const uint WM_SYSCOMMAND = 0x112;
+ public const uint WM_SYSKEYDOWN = 260;
+ public const uint WM_APP = 0x00008000;
+ public const uint WM_QUIT = 0x12;
+ public const uint WPF_RESTORETOMAXIMIZED = 2;
+ #endregion
+
+ #region [ WindowsStyle 繝輔Λ繧ー]
+ public const long WS_BORDER = 0x800000L;
+ public const long WS_CAPTION = 0xc00000L;
+ public const long WS_CHILD = 0x40000000L;
+ public const long WS_CHILDWINDOW = 0x40000000L;
+ public const long WS_CLIPCHILDREN = 0x2000000L;
+ public const long WS_CLIPSIBLINGS = 0x4000000L;
+ public const long WS_DISABLED = 0x8000000L;
+ public const long WS_DLGFRAME = 0x400000L;
+ public const long WS_GROUP = 0x20000L;
+ public const long WS_HSCROLL = 0x100000L;
+ public const long WS_ICONIC = 0x20000000L;
+ public const long WS_MAXIMIZE = 0x1000000L;
+ public const long WS_MAXIMIZEBOX = 0x10000L;
+ public const long WS_MINIMIZE = 0x20000000L;
+ public const long WS_MINIMIZEBOX = 0x20000L;
+ public const long WS_OVERLAPPED = 0L;
+ public const long WS_OVERLAPPEDWINDOW = 0xcf0000L;
+ public const long WS_POPUP = 0x80000000L;
+ public const long WS_POPUPWINDOW = 0x80880000L;
+ public const long WS_SIZEBOX = 0x40000L;
+ public const long WS_SYSMENU = 0x80000L;
+ public const long WS_TABSTOP = 0x10000L;
+ public const long WS_THICKFRAME = 0x40000L;
+ public const long WS_TILED = 0L;
+ public const long WS_TILEDWINDOW = 0xcf0000L;
+ public const long WS_VISIBLE = 0x10000000L;
+ public const long WS_VSCROLL = 0x200000L;
+ public const long WS_EX_ACCEPTFILES = 0x10L;
+ public const long WS_EX_APPWINDOW = 0x40000L;
+ public const long WS_EX_CLIENTEDGE = 0x200L;
+ public const long WS_EX_COMPOSITED = 0x2000000L;
+ public const long WS_EX_CONTEXTHELP = 0x400L;
+ public const long WS_EX_CONTROLPARENT = 0x10000L;
+ public const long WS_EX_DLGMODALFRAME = 1L;
+ public const long WS_EX_LAYERED = 0x80000L;
+ public const long WS_EX_LAYOUTRTL = 0x400000L;
+ public const long WS_EX_LEFT = 0L;
+ public const long WS_EX_LEFTSCROLLBAR = 0x4000L;
+ public const long WS_EX_LTRREADING = 0L;
+ public const long WS_EX_MDICHILD = 0x40L;
+ public const long WS_EX_NOACTIVATE = 0x8000000L;
+ public const long WS_EX_NOINHERITLAYOUT = 0x100000L;
+ public const long WS_EX_NOPARENTNOTIFY = 4L;
+ public const long WS_EX_OVERLAPPEDWINDOW = 0x300L;
+ public const long WS_EX_PALETTEWINDOW = 0x188L;
+ public const long WS_EX_RIGHT = 0x1000L;
+ public const long WS_EX_RIGHTSCROLLBAR = 0L;
+ public const long WS_EX_RTLREADING = 0x2000L;
+ public const long WS_EX_STATICEDGE = 0x20000L;
+ public const long WS_EX_TOOLWINDOW = 0x80L;
+ public const long WS_EX_TOPMOST = 8L;
+ public const long WS_EX_TRANSPARENT = 0x20L;
+ public const long WS_EX_WINDOWEDGE = 0x100L;
+ #endregion
+
+
+ public enum EShowWindow
+ {
+ ForceMinimize = 11,
+ Hide = 0,
+ Maximize = 3,
+ Minimize = 6,
+ Normal = 1,
+ Restore = 9,
+ Show = 5,
+ ShowDefault = 10,
+ ShowMaximized = 3,
+ ShowMinimized = 2,
+ ShowMinNoActive = 7,
+ ShowNA = 8,
+ ShowNoActivate = 4
+ }
+ public enum MMSYSERR
+ {
+ NOERROR,
+ ERROR,
+ BADDEVICEID,
+ NOTENABLED,
+ ALLOCATED,
+ INVALHANDLE,
+ NODRIVER,
+ NOMEM,
+ NOTSUPPORTED,
+ BADERRNUM,
+ INVALFLAG,
+ INVALPARAM,
+ HANDLEBUSY,
+ INVALIDALIAS,
+ BADDB,
+ KEYNOTFOUND,
+ READERROR,
+ WRITEERROR,
+ DELETEERROR,
+ VALNOTFOUND,
+ NODRIVERCB,
+ MOREDATA
+ }
+ [FlagsAttribute]
+ internal enum ExecutionState : uint
+ {
+ Null = 0, // 髢「謨ー縺悟、ア謨励@縺滓凾縺ョ謌サ繧雁、
+ SystemRequired = 1, // 繧ケ繧ソ繝ウ繝舌う繧呈椛豁「
+ DisplayRequired = 2, // 逕サ髱「OFF繧呈椛豁「
+ Continuous = 0x80000000, // 蜉ケ譫懊r豌ク邯壹&縺帙k縲ゅ⊇縺九が繝励す繝ァ繝ウ縺ィ菴オ逕ィ縺吶k縲
+ }
+ //-----------------
+ #endregion
+
+ #region [ Win32 髢「謨ー ]
+ //-----------------
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern bool AdjustWindowRect( ref RECT lpRect, uint dwStyle, [MarshalAs( UnmanagedType.Bool )] bool bMenu );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern bool GetClientRect( IntPtr hWnd, out RECT lpRect );
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern uint GetWindowLong( IntPtr hWnd, int nIndex );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern bool GetWindowPlacement( IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto )]
+ public static extern bool IsIconic( IntPtr hWnd );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto )]
+ public static extern bool IsWindowVisible( IntPtr hWnd );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto )]
+ public static extern bool IsZoomed( IntPtr hWnd );
+ [DllImport("winmm.dll")]
+ public static extern uint midiInClose(IntPtr hMidiIn);
+ [DllImport("winmm.dll")]
+ public static extern uint midiInGetDevCaps(uint uDeviceID, ref MIDIINCAPS lpMidiInCaps, uint cbMidiInCaps);
+ [DllImport("winmm.dll")]
+ public static extern uint midiInGetID(IntPtr hMidiIn, ref IntPtr puDeviceID);
+ [DllImport("winmm.dll")]
+ public static extern uint midiInGetNumDevs();
+ [DllImport("winmm.dll")]
+ public static extern uint midiInOpen(ref IntPtr phMidiIn, uint uDeviceID, MidiInProc dwCallback, IntPtr dwInstance, int fdwOpen);
+ [DllImport("winmm.dll")]
+ public static extern uint midiInReset(IntPtr hMidiIn);
+ [DllImport("winmm.dll")]
+ public static extern uint midiInStart(IntPtr hMidiIn);
+ [DllImport("winmm.dll")]
+ public static extern uint midiInStop(IntPtr hMidiIn);
+ [DllImport( "user32.dll", CharSet = CharSet.Auto )]
+ public static extern IntPtr MonitorFromWindow( IntPtr hwnd, uint dwFlags );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto )]
+ public static extern bool PeekMessage( out WindowMessage message, IntPtr hwnd, uint messageFilterMin, uint messageFilterMax, uint flags );
+ [DllImport( "kernel32.dll", CharSet = CharSet.Auto )]
+ public static extern uint SetThreadExecutionState( uint esFlags );
+ [DllImport( "Kernel32.Dll" )]
+ public static unsafe extern void CopyMemory( void* pDest, void* pSrc, uint numOfBytes );
+
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern uint SetWindowLong( IntPtr hWnd, int nIndex, uint dwNewLong );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern bool SetWindowPlacement( IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern bool SetWindowPos( IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto )]
+ public static extern bool ShowWindow( IntPtr hWnd, EShowWindow nCmdShow );
+ [return: MarshalAs( UnmanagedType.Bool )]
+ [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
+ public static extern bool SystemParametersInfo( uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni );
+ [DllImport( "kernel32.dll" )]
+ public static extern void GetSystemInfo( ref SYSTEM_INFO ptmpsi );
+ [DllImport( "kernel32.dll" )]
+ internal static extern ExecutionState SetThreadExecutionState( ExecutionState esFlags );
+ //-----------------
+ #endregion
+
+ #region [ Win32 讒矩菴 ]
+ //-----------------
+ [StructLayout( LayoutKind.Sequential )]
+ private struct FILTERKEYS
+ {
+ public int cbSize;
+ public int dwFlags;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct MIDIINCAPS
+ {
+ public ushort wMid;
+ public ushort wPid;
+ public uint vDriverVersion;
+ [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 0x20 )]
+ public string szPname;
+ public uint dwSupport;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct RECT
+ {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ private struct STICKYKEYS
+ {
+ public int cbSize;
+ public int dwFlags;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ private struct TOGGLEKEYS
+ {
+ public int cbSize;
+ public int dwFlags;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct WAVEFORMATEX
+ {
+ public ushort wFormatTag;
+ public ushort nChannels;
+ public uint nSamplesPerSec;
+ public uint nAvgBytesPerSec;
+ public ushort nBlockAlign;
+ public ushort wBitsPerSample;
+ public ushort cbSize;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct WindowMessage
+ {
+ public IntPtr hWnd;
+ public uint msg;
+ public IntPtr wParam;
+ public IntPtr lParam;
+ public uint time;
+ public Point p;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct WINDOWPLACEMENT
+ {
+ public int length;
+ public int flags;
+ public CWin32.EShowWindow showCmd;
+ public Point ptMinPosition;
+ public Point ptMaxPosition;
+ public CWin32.RECT rcNormalPosition;
+ public static int Length
+ {
+ get
+ {
+ return Marshal.SizeOf( typeof( CWin32.WINDOWPLACEMENT ) );
+ }
+ }
+ }
+ [StructLayout( LayoutKind.Sequential )]
+ public struct SYSTEM_INFO
+ {
+ public uint dwOemId;
+ public uint dwPageSize;
+ public uint lpMinimumApplicationAddress;
+ public uint lpMaximumApplicationAddress;
+ public uint dwActiveProcessorMask;
+ public uint dwNumberOfProcessors;
+ public uint dwProcessorType;
+ public uint dwAllocationGranularity;
+ public uint dwProcessorLevel;
+ public uint dwProcessorRevision;
+ }
+ //-----------------
+ #endregion
+
+
+ // 繝励Ο繝代ユ繧」
+
+ public static bool b繧「繝励Μ縺栗dle迥カ諷九〒縺ゅk
+ {
+ get
+ {
+ WindowMessage message;
+ return !PeekMessage( out message, IntPtr.Zero, 0, 0, 0 );
+ }
+ }
+
+
+ // 繧ュ繝シ繝懊シ繝峨ョ迚ケ谿頑ゥ溯ス縺ョ蛻カ蠕。
+
+ public static class C繝医げ繝ォ繧ュ繝シ讖溯ス
+ {
+ public static void t辟。蜉ケ蛹悶☆繧()
+ {
+ if( ( stored.dwFlags & 1L ) == 0L )
+ {
+ CWin32.TOGGLEKEYS structure = new CWin32.TOGGLEKEYS();
+ structure.dwFlags = stored.dwFlags;
+ structure.cbSize = stored.cbSize;
+ structure.dwFlags &= -5;
+ structure.dwFlags &= -9;
+ int cb = Marshal.SizeOf( structure );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( structure, ptr, false );
+ CWin32.SystemParametersInfo( 0x35, (uint) cb, ptr, 0 );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+ }
+ public static void t蠕ゥ蜈縺吶k()
+ {
+ int cb = Marshal.SizeOf( stored );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( stored, ptr, false );
+ CWin32.SystemParametersInfo( 0x35, (uint) cb, ptr, 0 );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+
+ #region [ private ]
+ //-----------------
+ static C繝医げ繝ォ繧ュ繝シ讖溯ス()
+ {
+ int cb = Marshal.SizeOf( stored );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( stored, ptr, false );
+ CWin32.SystemParametersInfo( 0x34, (uint) cb, ptr, 0 );
+ stored = (CWin32.TOGGLEKEYS) Marshal.PtrToStructure( ptr, typeof( CWin32.TOGGLEKEYS ) );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+
+ private const uint SPI_GETTOGGLEKEYS = 0x34;
+ private const uint SPI_SETTOGGLEKEYS = 0x35;
+ private static CWin32.TOGGLEKEYS stored = new CWin32.TOGGLEKEYS();
+ private const uint TKF_CONFIRMHOTKEY = 8;
+ private const uint TKF_HOTKEYACTIVE = 4;
+ private const uint TKF_TOGGLEKEYSON = 1;
+ //-----------------
+ #endregion
+ }
+ public static class C繝輔ぅ繝ォ繧ソ繧ュ繝シ讖溯ス
+ {
+ public static void t辟。蜉ケ蛹悶☆繧()
+ {
+ if( ( stored.dwFlags & 1L ) == 0L )
+ {
+ CWin32.FILTERKEYS structure = new CWin32.FILTERKEYS();
+ structure.dwFlags = stored.dwFlags;
+ structure.cbSize = stored.cbSize;
+ structure.dwFlags &= -5;
+ structure.dwFlags &= -9;
+ int cb = Marshal.SizeOf( structure );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( structure, ptr, false );
+ CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+ }
+ public static void t蠕ゥ蜈縺吶k()
+ {
+ int cb = Marshal.SizeOf( stored );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( stored, ptr, false );
+ CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+
+ #region [ private ]
+ //-----------------
+ static C繝輔ぅ繝ォ繧ソ繧ュ繝シ讖溯ス()
+ {
+ stored.cbSize = 0;
+ stored.dwFlags = 0;
+ int cb = Marshal.SizeOf( stored );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( stored, ptr, false );
+ CWin32.SystemParametersInfo( 50, (uint) cb, ptr, 0 );
+ stored = (CWin32.FILTERKEYS) Marshal.PtrToStructure( ptr, typeof( CWin32.FILTERKEYS ) );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+
+ private const uint FKF_CONFIRMHOTKEY = 8;
+ private const uint FKF_FILTERKEYSON = 1;
+ private const uint FKF_HOTKEYACTIVE = 4;
+ private const uint SPI_GETFILTERKEYS = 50;
+ private const uint SPI_SETFILTERKEYS = 0x3b;
+ private static CWin32.FILTERKEYS stored = new CWin32.FILTERKEYS();
+ //-----------------
+ #endregion
+ }
+ public static class C蝗コ螳壹く繝シ讖溯ス
+ {
+ public static void t辟。蜉ケ蛹悶☆繧()
+ {
+ if( ( stored.dwFlags & 1L ) == 0L )
+ {
+ CWin32.STICKYKEYS structure = new CWin32.STICKYKEYS();
+ structure.dwFlags = stored.dwFlags;
+ structure.cbSize = stored.cbSize;
+ structure.dwFlags &= -5;
+ structure.dwFlags &= -9;
+ int cb = Marshal.SizeOf( structure );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( structure, ptr, false );
+ CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+ }
+ public static void t蠕ゥ蜈縺吶k()
+ {
+ int cb = Marshal.SizeOf( stored );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( stored, ptr, false );
+ CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+
+ #region [ private ]
+ //-----------------
+ static C蝗コ螳壹く繝シ讖溯ス()
+ {
+ stored.cbSize = 0;
+ stored.dwFlags = 0;
+ int cb = Marshal.SizeOf( stored );
+ IntPtr ptr = Marshal.AllocCoTaskMem( cb );
+ Marshal.StructureToPtr( stored, ptr, false );
+ CWin32.SystemParametersInfo( 0x3a, (uint) cb, ptr, 0 );
+ stored = (CWin32.STICKYKEYS) Marshal.PtrToStructure( ptr, typeof( CWin32.STICKYKEYS ) );
+ Marshal.FreeCoTaskMem( ptr );
+ }
+
+ private const uint SKF_CONFIRMHOTKEY = 8;
+ private const uint SKF_HOTKEYACTIVE = 4;
+ private const uint SKF_STICKYKEYSON = 1;
+ private const uint SPI_GETSTICKYKEYS = 0x3a;
+ private const uint SPI_SETSTICKYKEYS = 0x3b;
+ private static CWin32.STICKYKEYS stored = new CWin32.STICKYKEYS();
+ //-----------------
+ #endregion
+ }
+
+
+ // Win32 繝。繝繧サ繝シ繧ク蜃ヲ逅繝繝ェ繧イ繝シ繝
+
+ public delegate void MidiInProc(IntPtr hMidiIn, uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2);
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/C荳螳夐俣髫泌ヲ逅.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C荳螳夐俣髫泌ヲ逅.cs
new file mode 100644
index 00000000..60d2accf
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C荳螳夐俣髫泌ヲ逅.cs
@@ -0,0 +1,61 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ ///
+ /// 荳螳壹ョ髢馴囈縺ァ蜃ヲ逅繧定。後≧繝繝ウ繝励Ξ繝シ繝医ヱ繧ソ繝シ繝ウ縺ョ螳夂セゥ縲
+ /// 縺溘→縺医ー縲》騾イ陦() 縺ァ 5ms 縺斐→縺ォ陦後≧蜃ヲ逅繧貞燕蝗槭ョt騾イ陦()縺ョ蜻シ縺ウ蜃コ縺励°繧 15ms 蠕後↓蜻シ縺ウ蜃コ縺励◆蝣エ蜷医ッ縲∝ヲ逅縺 3蝗 螳溯。後&繧後k縲
+ ///
+ public class C荳螳夐俣髫泌ヲ逅 : IDisposable
+ {
+ public delegate void dg蜃ヲ逅();
+ public void t騾イ陦( long n髢馴囈ms, dg蜃ヲ逅 dg蜃ヲ逅 )
+ {
+ // 繧ソ繧、繝樊峩譁ー
+
+ if( this.timer == null )
+ return;
+ this.timer.t譖エ譁ー();
+
+
+ // 蛻昴a縺ヲ縺ョ騾イ陦悟ヲ逅
+
+ if( this.n蜑榊屓縺ョ譎ょ綾 == CTimer.n譛ェ菴ソ逕ィ )
+ this.n蜑榊屓縺ョ譎ょ綾 = this.timer.n迴セ蝨ィ譎ょ綾ms;
+
+
+ // 繧ソ繧、繝槭′荳蝗槭j縺励※縺励∪縺」縺滓凾縺ョ縺溘a窶ヲ窶ヲ
+
+ if( this.timer.n迴セ蝨ィ譎ょ綾ms < this.n蜑榊屓縺ョ譎ょ綾 )
+ this.n蜑榊屓縺ョ譎ょ綾 = this.timer.n迴セ蝨ィ譎ょ綾ms;
+
+
+ // 譎る俣蜀縺ョ蜃ヲ逅繧貞ョ溯。後
+
+ while( ( this.timer.n迴セ蝨ィ譎ょ綾ms - this.n蜑榊屓縺ョ譎ょ綾 ) >= n髢馴囈ms )
+ {
+ dg蜃ヲ逅();
+
+ this.n蜑榊屓縺ョ譎ょ綾 += n髢馴囈ms;
+ }
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ C蜈ア騾.tDispose縺吶k( ref this.timer );
+ }
+ //-----------------
+ #endregion
+
+ #region [ protected ]
+ //-----------------
+ protected CTimer timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ protected long n蜑榊屓縺ョ譎ょ綾 = CTimer.n譛ェ菴ソ逕ィ;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/C蜈ア騾.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C蜈ア騾.cs
new file mode 100644
index 00000000..6de72ecc
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C蜈ア騾.cs
@@ -0,0 +1,180 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.IO;
+using System.Runtime.InteropServices;
+
+namespace FDK
+{
+ public class C蜈ア騾
+ {
+ // 隗」謾セ
+
+ public static void tDispose縺吶k( ref T obj )
+ {
+ if( obj == null )
+ return;
+
+ var d = obj as IDisposable;
+
+ if( d != null )
+ {
+ d.Dispose();
+ obj = default( T );
+ }
+ }
+ public static void tDispose縺吶k( T obj )
+ {
+ if( obj == null )
+ return;
+
+ var d = obj as IDisposable;
+
+ if( d != null )
+ d.Dispose();
+ }
+ public static void tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref T obj )
+ {
+ if( obj != null )
+ {
+ try
+ {
+ Marshal.ReleaseComObject( obj );
+ }
+ catch
+ {
+ // COM縺後槭ロ繝シ繧ク繝峨さ繝シ繝峨〒譖ク縺九l縺ヲ縺繧句エ蜷医ヽeleaseComObject 縺ッ萓句、悶r逋コ逕溘&縺帙k縲
+ // http://www.infoq.com/jp/news/2010/03/ReleaseComObject-Dangerous
+ }
+
+ obj = default( T );
+ }
+ }
+
+ public static void t螳悟ィ縺ェ繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ滓命縺吶k()
+ {
+ GC.Collect(); // 繧「繧ッ繧サ繧ケ荳榊庄閭ス縺ェ繧ェ繝悶ず繧ァ繧ッ繝医r髯、蜴サ縺励√ヵ繧。繧、繝翫Λ繧、縺懊シ繧キ繝ァ繝ウ螳滓命縲
+ GC.WaitForPendingFinalizers(); // 繝輔ぃ繧、繝翫Λ繧、繧シ繝シ繧キ繝ァ繝ウ縺檎オゅo繧九∪縺ァ繧ケ繝ャ繝繝峨r蠕讖溘
+ GC.Collect(); // 繝輔ぃ繧、繝翫Λ繧、繧コ縺輔l縺溘ー縺九j縺ョ繧ェ繝悶ず繧ァ繧ッ繝医↓髢「騾」縺吶k繝。繝「繝ェ繧帝幕謾セ縲
+
+ // 蜃コ螻: http://msdn.microsoft.com/ja-jp/library/ms998547.aspx#scalenetchapt05_topic10
+ }
+
+
+ // 繝ュ繧ー
+
+ public static void LogBlock( string str蜃ヲ逅蜷, MethodInvoker method )
+ {
+ Trace.TraceInformation( "--------------------" );
+ Trace.TraceInformation( "髢句ァ - " + str蜃ヲ逅蜷 );
+ Trace.Indent();
+ try
+ {
+ method();
+ }
+ finally
+ {
+ Trace.Unindent();
+ Trace.TraceInformation( "邨ゆコ - " + str蜃ヲ逅蜷 );
+ Trace.TraceInformation( "--------------------" );
+ }
+ }
+ public static void t萓句、悶ョ隧ウ邏ー繧偵Ο繧ー縺ォ蜃コ蜉帙☆繧( Exception e )
+ {
+ Trace.WriteLine( "---萓句、悶%縺薙°繧----" );
+ Trace.WriteLine( e.ToString() );
+ Trace.WriteLine( "---萓句、悶%縺薙∪縺ァ----" );
+ }
+
+
+ // IO
+
+ public static string t謖螳壹@縺滓僑蠑オ蟄舌r謖√▽繝輔ぃ繧、繝ォ繧呈、懃エ「縺玲怙蛻昴↓隕九▽縺代◆繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ繧定ソ斐☆( string str繝輔か繝ォ繝繝代せ, List list諡。蠑オ蟄舌Μ繧ケ繝 )
+ {
+ string[] files = Directory.GetFiles( str繝輔か繝ォ繝繝代せ ); // GetFiles() 縺ッ螳悟ィ繝代せ繧定ソ斐☆縲
+
+
+ // 繝輔ぃ繧、繝ォ鬆繧医j諡。蠑オ蟄宣繧貞━蜈医@縺ヲ讀懃エ「縺吶k縲や 諡。蠑オ蟄舌Μ繧ケ繝医ョ蜑肴婿縺ョ諡。蠑オ蟄舌⊇縺ゥ蜈医↓逋コ隕九&繧後k繧医≧縺ォ縺吶k縺溘a縲
+
+ foreach( string ext in list諡。蠑オ蟄舌Μ繧ケ繝 )
+ {
+ foreach( string file in files )
+ {
+ string fileExt = Path.GetExtension( file );
+
+ if( fileExt.Equals( ext, StringComparison.OrdinalIgnoreCase ) )
+ return file; // 縺ゅ▲縺
+ }
+ }
+
+ return null; // 縺ェ縺九▲縺
+ }
+
+ public static void tXML繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧( string strXML繝輔ぃ繧、繝ォ蜷, out T xmlObject )
+ {
+ xmlObject = default( T );
+
+ FileStream fs = null;
+ StreamReader sr = null;
+ try
+ {
+ fs = new FileStream( strXML繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ); // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k縲
+ sr = new StreamReader( fs, Encoding.UTF8 );
+ var xmlsl = new System.Xml.Serialization.XmlSerializer( typeof( T ) );
+ xmlObject = (T) xmlsl.Deserialize( sr );
+ }
+ finally
+ {
+ if( sr != null )
+ sr.Close(); // fr 繧ゆク邱偵↓Close()縺輔l繧
+ }
+ }
+ public static void tXML繝輔ぃ繧、繝ォ繧剃ソ晏ュ倥☆繧( string strXML繝輔ぃ繧、繝ォ蜷, T xmlObject )
+ {
+ FileStream fs = null;
+ StreamWriter sw = null;
+ try
+ {
+ fs = new FileStream( strXML繝輔ぃ繧、繝ォ蜷, FileMode.Create, FileAccess.Write, FileShare.ReadWrite ); // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k縲
+ sw = new StreamWriter( fs, Encoding.UTF8 );
+ var xmlsl = new System.Xml.Serialization.XmlSerializer( typeof( T ) );
+ xmlsl.Serialize( sw, xmlObject );
+ }
+ finally
+ {
+ if( sw != null )
+ sw.Close(); // fs 繧ゆク邱偵↓Close()縺輔l繧
+ }
+ }
+
+
+ // 謨ー蟄ヲ
+
+ public static double DegreeToRadian( double angle )
+ {
+ return ( ( Math.PI * angle ) / 180.0 );
+ }
+ public static double RadianToDegree( double angle )
+ {
+ return ( angle * 180.0 / Math.PI );
+ }
+ public static float DegreeToRadian( float angle )
+ {
+ return (float) DegreeToRadian( (double) angle );
+ }
+ public static float RadianToDegree( float angle )
+ {
+ return (float) RadianToDegree( (double) angle );
+ }
+
+ public static bool bToggleBoolian( ref bool bFlag )
+ {
+ if( bFlag == true ) bFlag = false;
+ else if( bFlag == false ) bFlag = true;
+
+ return true;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/C螟画鋤.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C螟画鋤.cs
new file mode 100644
index 00000000..4e8b5ef3
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C螟画鋤.cs
@@ -0,0 +1,252 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ public class C螟画鋤
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public static readonly string str16騾イ謨ー譁蟄 = "0123456789ABCDEFabcdef";
+ public static readonly string str36騾イ謨ー譁蟄 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+
+ // 繝。繧ス繝繝
+
+ public static bool bONorOFF( char c )
+ {
+ return ( c != '0' );
+ }
+
+ public static double DegreeToRadian( double angle )
+ {
+ return ( ( Math.PI * angle ) / 180.0 );
+ }
+ public static double RadianToDegree( double angle )
+ {
+ return ( angle * 180.0 / Math.PI );
+ }
+ public static float DegreeToRadian( float angle )
+ {
+ return (float) DegreeToRadian( (double) angle );
+ }
+ public static float RadianToDegree( float angle )
+ {
+ return (float) RadianToDegree( (double) angle );
+ }
+
+ public static int n蛟、繧堤ッ蝗イ蜀縺ォ荳ク繧√※霑斐☆( int n蛟、, int n譛蟆丞、, int n譛螟ァ蛟、 )
+ {
+ if( n蛟、 < n譛蟆丞、 )
+ return n譛蟆丞、;
+
+ if( n蛟、 > n譛螟ァ蛟、 )
+ return n譛螟ァ蛟、;
+
+ return n蛟、;
+ }
+ public static int n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( string str謨ー蛟、譁蟄怜, int n譛蟆丞、, int n譛螟ァ蛟、, int n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、 )
+ {
+ int num;
+ if( ( int.TryParse( str謨ー蛟、譁蟄怜, out num ) && ( num >= n譛蟆丞、 ) ) && ( num <= n譛螟ァ蛟、 ) )
+ return num;
+
+ return n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、;
+ }
+
+ public static double db蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( string str謨ー蛟、譁蟄怜, double db譛蟆丞、, double db譛螟ァ蛟、, double db蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、 )
+ {
+ double num;
+ if( ( double.TryParse( str謨ー蛟、譁蟄怜, out num ) && ( num >= db譛蟆丞、 ) ) && ( num <= db譛螟ァ蛟、 ) )
+ return num;
+
+ return db蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、;
+ }
+
+ // #23568 2010.11.04 ikanick add
+ public static int n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ縺。繧繧薙→荳ク繧√※霑斐☆(string str謨ー蛟、譁蟄怜, int n譛蟆丞、, int n譛螟ァ蛟、, int n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、)
+ {
+ // 1 縺ィ驕輔▲縺ヲ遽蝗イ螟悶ョ蝣エ蜷医■繧繧薙→荳ク繧√※霑斐@縺セ縺吶
+ int num;
+ if (int.TryParse(str謨ー蛟、譁蟄怜, out num)) {
+ if ((num >= n譛蟆丞、) && (num <= n譛螟ァ蛟、))
+ return num;
+ if ( num < n譛蟆丞、 )
+ return n譛蟆丞、;
+ if ( num > n譛螟ァ蛟、 )
+ return n譛螟ァ蛟、;
+ }
+
+ return n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、;
+ }
+ // --------------------縺薙%縺セ縺ァ-------------------------/
+ public static int n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆( string str謨ー蛟、譁蟄怜, int n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、 )
+ {
+ int num;
+ if( !int.TryParse( str謨ー蛟、譁蟄怜, out num ) )
+ num = n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、;
+
+ return num;
+ }
+
+ public static int n16騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆( string strNum )
+ {
+ if( strNum.Length < 2 )
+ return -1;
+
+ int digit2 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 0 ] );
+ if( digit2 < 0 )
+ return -1;
+
+ if( digit2 >= 16 )
+ digit2 -= (16 - 10); // A,B,C... -> 1,2,3...
+
+ int digit1 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 1 ] );
+ if( digit1 < 0 )
+ return -1;
+
+ if( digit1 >= 16 )
+ digit1 -= (16 - 10);
+
+ return digit2 * 16 + digit1;
+ }
+ public static int n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆( string strNum )
+ {
+ if( strNum.Length < 2 )
+ return -1;
+
+ int digit2 = str36騾イ謨ー譁蟄.IndexOf( strNum[ 0 ] );
+ if( digit2 < 0 )
+ return -1;
+
+ if( digit2 >= 36 )
+ digit2 -= (36 - 10); // A,B,C... -> 1,2,3...
+
+ int digit1 = str36騾イ謨ー譁蟄.IndexOf( strNum[ 1 ] );
+ if( digit1 < 0 )
+ return -1;
+
+ if( digit1 >= 36 )
+ digit1 -= (36 - 10);
+
+ return digit2 * 36 + digit1;
+ }
+ public static int n蟆冗ッ逡ェ蜿キ縺ョ譁蟄怜3譯√r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆( string strNum )
+ {
+ if( strNum.Length >= 3 )
+ {
+ int digit3 = str36騾イ謨ー譁蟄.IndexOf( strNum[ 0 ] );
+ if( digit3 < 0 )
+ return -1;
+
+ if( digit3 >= 36 ) // 3譯∫岼縺ッ36騾イ謨ー
+ digit3 -= (36 - 10);
+
+ int digit2 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 1 ] ); // 2譯∫岼縺ッ10騾イ謨ー
+ if( ( digit2 < 0 ) || ( digit2 > 9 ) )
+ return -1;
+
+ int digit1 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 2 ] ); // 1譯∫岼繧10騾イ謨ー
+ if( ( digit1 >= 0 ) && ( digit1 <= 9 ) )
+ return digit3 * 100 + digit2 * 10 + digit1;
+ }
+ return -1;
+ }
+
+ public static string str蟆冗ッ逡ェ蜿キ繧呈枚蟄怜3譯√↓螟画鋤縺励※霑斐☆( int num )
+ {
+ if( ( num < 0 ) || ( num >= 3600 ) ) // 3600 == Z99 + 1
+ return "000";
+
+ int digit4 = num / 100;
+ int digit2 = ( num % 100 ) / 10;
+ int digit1 = ( num % 100 ) % 10;
+ char ch3 = str36騾イ謨ー譁蟄夕 digit4 ];
+ char ch2 = str16騾イ謨ー譁蟄夕 digit2 ];
+ char ch1 = str16騾イ謨ー譁蟄夕 digit1 ];
+ return ( ch3.ToString() + ch2.ToString() + ch1.ToString() );
+ }
+ public static string str謨ー蛟、繧16騾イ謨ー2譯√↓螟画鋤縺励※霑斐☆( int num )
+ {
+ if( ( num < 0 ) || ( num >= 0x100 ) )
+ return "00";
+
+ char ch2 = str16騾イ謨ー譁蟄夕 num / 0x10 ];
+ char ch1 = str16騾イ謨ー譁蟄夕 num % 0x10 ];
+ return ( ch2.ToString() + ch1.ToString() );
+ }
+ public static string str謨ー蛟、繧36騾イ謨ー2譯√↓螟画鋤縺励※霑斐☆( int num )
+ {
+ if( ( num < 0 ) || ( num >= 36 * 36 ) )
+ return "00";
+
+ char ch2 = str36騾イ謨ー譁蟄夕 num / 36 ];
+ char ch1 = str36騾イ謨ー譁蟄夕 num % 36 ];
+ return ( ch2.ToString() + ch1.ToString() );
+ }
+
+ public static int[] ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆( string str )
+ {
+ //0,1,2 ...縺ョ蠖「蠑上〒譖ク縺九l縺殱tring繧段nt驟榊励↓螟画鋤縺吶k縲
+ //荳蠢懷ョ溯」縺ッ縺励◆繧ゅョ縺ョ縲∽セ句、門ヲ逅縺ェ縺ゥ縺ッ縺セ縺螳梧舌@縺ヲ縺縺ェ縺縲
+ //str = "0,1,2";
+ if( String.IsNullOrEmpty( str ) )
+ return null;
+
+ string[] strArray = str.Split( ',' );
+ List listIntArray;
+ listIntArray = new List();
+
+ for( int n = 0; n < strArray.Length; n++ )
+ {
+ int n霑ス蜉縺吶k謨ー蛟、 = Convert.ToInt32( strArray[ n ] );
+ listIntArray.Add( n霑ス蜉縺吶k謨ー蛟、 );
+ }
+ int[] nArray = new int[] { 1 };
+ nArray = listIntArray.ToArray();
+
+ return nArray;
+ }
+
+
+ ///
+ /// 逋セ蛻邇謨ー蛟、繧255谿オ髫取焚蛟、縺ォ螟画鋤縺吶k繝。繧ス繝繝峨る乗主コヲ逕ィ縲
+ ///
+ ///
+ ///
+ public static int nParsentTo255( double num )
+ {
+ return (int)(255.0 * num);
+ }
+
+ ///
+ /// 255谿オ髫取焚蛟、繧堤卆蛻邇縺ォ螟画鋤縺吶k繝。繧ス繝繝峨
+ ///
+ ///
+ ///
+ public static int n255ToParsent( int num )
+ {
+ return (int)(100.0 / num);
+ }
+
+ public static SlimDX.Color4 n255ToColor4( int nR, int nG, int nB )
+ {
+ float fR = n255ToParsent( nR );
+ float fG = n255ToParsent( nG );
+ float fB = n255ToParsent( nB );
+
+ return new SlimDX.Color4( fR, fG, fB );
+ }
+
+ #region [ private ]
+ //-----------------
+
+ // private 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺ァ繧、繝ウ繧ケ繧ソ繝ウ繧ケ逕滓舌r遖∵ュ「縺吶k縲
+ private C螟画鋤()
+ {
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/DoubleExtensions.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/DoubleExtensions.cs
new file mode 100644
index 00000000..d7e94c11
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/DoubleExtensions.cs
@@ -0,0 +1,12 @@
+サソusing System;
+
+namespace FDK.ExtensionMethods
+{
+ public static class DoubleExtensions
+ {
+ public static double Clamp(this double value, double min, double max)
+ {
+ return Math.Min(Math.Max(value, min), max);
+ }
+ }
+}
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/Int32Extensions.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/Int32Extensions.cs
new file mode 100644
index 00000000..019d3f5d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/Int32Extensions.cs
@@ -0,0 +1,12 @@
+サソusing System;
+
+namespace FDK.ExtensionMethods
+{
+ public static class Int32Extensions
+ {
+ public static int Clamp(this int value, int min, int max)
+ {
+ return Math.Min(Math.Max(value, min), max);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/Game.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/Game.cs
new file mode 100644
index 00000000..64932ff0
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/Game.cs
@@ -0,0 +1,569 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.ComponentModel;
+using System.Threading;
+using System.Windows.Forms;
+using SlimDX;
+using SlimDX.Direct3D9;
+using System.Collections.ObjectModel;
+
+namespace SampleFramework
+{
+ ///
+ /// Presents an easy to use wrapper for making games and samples.
+ ///
+ public abstract class Game : IDisposable
+ {
+ GameClock clock = new GameClock();
+ GameTime gameTime = new GameTime();
+ TimeSpan maximumElapsedTime = TimeSpan.FromMilliseconds(500.0);
+ TimeSpan totalGameTime;
+ TimeSpan accumulatedElapsedGameTime;
+ TimeSpan lastFrameElapsedGameTime;
+ TimeSpan lastFrameElapsedRealTime;
+ TimeSpan targetElapsedTime = TimeSpan.FromTicks(166667);
+ TimeSpan inactiveSleepTime = TimeSpan.FromMilliseconds(20.0);
+ int updatesSinceRunningSlowly1 = int.MaxValue;
+ int updatesSinceRunningSlowly2 = int.MaxValue;
+ bool forceElapsedTimeToZero;
+ bool drawRunningSlowly;
+ long lastUpdateFrame;
+ float lastUpdateTime;
+
+ ///
+ /// Occurs when the game is disposed.
+ ///
+ public event EventHandler Disposed;
+
+ ///
+ /// Occurs when the game is activated.
+ ///
+ public event EventHandler Activated;
+
+ ///
+ /// Occurs when the game is deactivated.
+ ///
+ public event EventHandler Deactivated;
+
+ ///
+ /// Occurs when the game is exiting.
+ ///
+ public event EventHandler Exiting;
+
+ ///
+ /// Occurs when a drawing frame is about to start.
+ ///
+ public event CancelEventHandler FrameStart;
+
+ ///
+ /// Occurs when a drawing frame ends.
+ ///
+ public event EventHandler FrameEnd;
+
+ ///
+ /// Gets or sets the inactive sleep time.
+ ///
+ /// The inactive sleep time.
+ public TimeSpan InactiveSleepTime
+ {
+ get { return inactiveSleepTime; }
+ set
+ {
+ // error checking
+ if (value < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException("value", "Inactive sleep time cannot be less than zero.");
+ inactiveSleepTime = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the target elapsed time.
+ ///
+ /// The target elapsed time.
+ public TimeSpan TargetElapsedTime
+ {
+ get { return targetElapsedTime; }
+ set
+ {
+ // error checking
+ if (value <= TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException("value", "Target elapsed time must be greater than zero.");
+ targetElapsedTime = value;
+ }
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the game is using a fixed time step.
+ ///
+ ///
+ /// true if the game is using a fixed time step; otherwise, false.
+ ///
+ public bool IsFixedTimeStep
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets a value indicating whether this is exiting.
+ ///
+ /// true if exiting; otherwise, false.
+ public bool IsExiting
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether this instance is running.
+ ///
+ ///
+ /// true if this instance is running; otherwise, false.
+ ///
+ public bool IsRunning
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets the game window.
+ ///
+ /// The game window.
+ public GameWindow Window
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets the graphics device manager.
+ ///
+ /// The graphics device manager.
+ public GraphicsDeviceManager GraphicsDeviceManager
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether this is active.
+ ///
+ /// true if active; otherwise, false.
+ public bool IsActive
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Initializes the class.
+ ///
+ static Game()
+ {
+ // configure SlimDX
+ Configuration.ThrowOnError = true;
+ Configuration.AddResultWatch(ResultCode.DeviceLost, ResultWatchFlags.AlwaysIgnore);
+ Configuration.AddResultWatch(ResultCode.WasStillDrawing, ResultWatchFlags.AlwaysIgnore);
+
+#if DEBUG
+ Configuration.DetectDoubleDispose = true;
+ Configuration.EnableObjectTracking = true;
+#else
+ Configuration.DetectDoubleDispose = false;
+ Configuration.EnableObjectTracking = false;
+#endif
+
+ // setup the application
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected Game()
+ {
+ IsFixedTimeStep = true;
+
+ Window = new GameWindow();
+ Window.ApplicationActivated += Window_ApplicationActivated;
+ Window.ApplicationDeactivated += Window_ApplicationDeactivated;
+ Window.Suspend += Window_Suspend;
+ Window.Resume += Window_Resume;
+ Window.Paint += Window_Paint;
+
+ GraphicsDeviceManager = new GraphicsDeviceManager(this);
+ }
+
+ ///
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ ///
+ public void Dispose()
+ {
+ // GraphicsDeviceManager.Dispose will come around and call the Dispose(bool)
+ // overload, so we don't need to do it here. It's convoluted, but it works well.
+ if (GraphicsDeviceManager != null)
+ GraphicsDeviceManager.Dispose();
+ GraphicsDeviceManager = null;
+
+ if (Disposed != null)
+ Disposed(this, EventArgs.Empty);
+
+ GC.SuppressFinalize(this);
+ }
+
+ ///
+ /// Exits the game.
+ ///
+ public void Exit()
+ {
+ // request the game to terminate
+ IsExiting = true;
+ }
+
+ ///
+ /// Runs the game.
+ ///
+ public void Run()
+ {
+ IsRunning = true;
+
+ try
+ {
+ gameTime.ElapsedGameTime = 0;
+ gameTime.ElapsedRealTime = 0;
+ gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds;
+ gameTime.TotalRealTime = (float)clock.CurrentTime.TotalSeconds;
+ gameTime.IsRunningSlowly = false;
+
+ Update(gameTime);
+
+ Application.Idle += Application_Idle;
+ Application.Run(Window);
+ }
+ finally
+ {
+ Application.Idle -= Application_Idle;
+ IsRunning = false;
+ OnExiting(EventArgs.Empty);
+ }
+ }
+
+ ///
+ /// Performs one complete frame for the game.
+ ///
+ public void Tick()
+ {
+ // if we are exiting, do nothing
+ if (IsExiting)
+ return;
+
+ // if we are inactive, sleep for a bit
+ //if (!IsActive)
+ // Thread.Sleep((int)InactiveSleepTime.TotalMilliseconds);
+
+ clock.Step();
+
+ gameTime.TotalRealTime = (float)clock.CurrentTime.TotalSeconds;
+ gameTime.ElapsedRealTime = (float)clock.ElapsedTime.TotalSeconds;
+ lastFrameElapsedRealTime += clock.ElapsedTime;
+ TimeSpan elapsedAdjustedTime = clock.ElapsedAdjustedTime;
+ if (elapsedAdjustedTime < TimeSpan.Zero)
+ elapsedAdjustedTime = TimeSpan.Zero;
+
+ if (forceElapsedTimeToZero)
+ {
+ gameTime.ElapsedRealTime = 0;
+ lastFrameElapsedRealTime = elapsedAdjustedTime = TimeSpan.Zero;
+ forceElapsedTimeToZero = false;
+ }
+
+ // cap the adjusted time
+ if (elapsedAdjustedTime > maximumElapsedTime)
+ elapsedAdjustedTime = maximumElapsedTime;
+
+ // check if we are using a fixed or variable time step
+ if (IsFixedTimeStep)
+ {
+ accumulatedElapsedGameTime += elapsedAdjustedTime;
+ long ratio = accumulatedElapsedGameTime.Ticks / TargetElapsedTime.Ticks;
+ accumulatedElapsedGameTime = TimeSpan.FromTicks(accumulatedElapsedGameTime.Ticks % TargetElapsedTime.Ticks);
+ lastFrameElapsedGameTime = TimeSpan.Zero;
+ if (ratio == 0)
+ return;
+ TimeSpan targetElapsedTime = TargetElapsedTime;
+
+ if (ratio > 1)
+ {
+ updatesSinceRunningSlowly2 = updatesSinceRunningSlowly1;
+ updatesSinceRunningSlowly1 = 0;
+ }
+ else
+ {
+ if (updatesSinceRunningSlowly1 < int.MaxValue)
+ updatesSinceRunningSlowly1++;
+ if (updatesSinceRunningSlowly2 < int.MaxValue)
+ updatesSinceRunningSlowly2++;
+ }
+
+ drawRunningSlowly = updatesSinceRunningSlowly2 < 20;
+
+ // update until it's time to draw the next frame
+ while (ratio > 0 && !IsExiting)
+ {
+ ratio -= 1;
+
+ try
+ {
+ gameTime.ElapsedGameTime = (float)targetElapsedTime.TotalSeconds;
+ gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds;
+ gameTime.IsRunningSlowly = drawRunningSlowly;
+
+ Update(gameTime);
+ }
+ finally
+ {
+ lastFrameElapsedGameTime += targetElapsedTime;
+ totalGameTime += targetElapsedTime;
+ }
+ }
+ }
+ else
+ {
+ drawRunningSlowly = false;
+ updatesSinceRunningSlowly1 = int.MaxValue;
+ updatesSinceRunningSlowly2 = int.MaxValue;
+
+ // make sure we shouldn't be exiting
+ if (!IsExiting)
+ {
+ try
+ {
+ gameTime.ElapsedGameTime = 0;
+ lastFrameElapsedGameTime = elapsedAdjustedTime;
+ gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds;
+ gameTime.IsRunningSlowly = false;
+
+ Update(gameTime);
+ }
+ finally
+ {
+ totalGameTime += elapsedAdjustedTime;
+ }
+ }
+ }
+
+ DrawFrame();
+
+ // refresh the FPS counter once per second
+ lastUpdateFrame++;
+ if ((float)clock.CurrentTime.TotalSeconds - lastUpdateTime > 1.0f)
+ {
+ gameTime.FramesPerSecond = (float)lastUpdateFrame / (float)(clock.CurrentTime.TotalSeconds - lastUpdateTime);
+ lastUpdateTime = (float)clock.CurrentTime.TotalSeconds;
+ lastUpdateFrame = 0;
+ }
+ }
+
+ ///
+ /// Resets the elapsed time.
+ ///
+ public void ResetElapsedTime()
+ {
+ forceElapsedTimeToZero = true;
+ updatesSinceRunningSlowly1 = int.MaxValue;
+ updatesSinceRunningSlowly2 = int.MaxValue;
+ }
+
+ ///
+ /// Allows the game to perform logic processing.
+ ///
+ /// The time passed since the last update.
+ protected virtual void Update(GameTime gameTime)
+ {
+ }
+
+ ///
+ /// Called when a frame is ready to be drawn.
+ ///
+ /// The time passed since the last frame.
+ protected virtual void Draw(GameTime gameTime)
+ {
+ }
+
+ ///
+ /// Initializes the game.
+ ///
+ protected internal virtual void Initialize()
+ {
+ }
+
+ ///
+ /// Loads graphical resources.
+ ///
+ protected internal virtual void LoadContent()
+ {
+ }
+
+ ///
+ /// Unloads graphical resources.
+ ///
+ protected internal virtual void UnloadContent()
+ {
+ }
+
+ ///
+ /// Releases unmanaged and - optionally - managed resources
+ ///
+ /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+ protected internal virtual void Dispose(bool disposing)
+ {
+
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnActivated(EventArgs e)
+ {
+ if (Activated != null)
+ Activated(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnDeactivated(EventArgs e)
+ {
+ if (Deactivated != null)
+ Deactivated(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnExiting(EventArgs e)
+ {
+ if (Exiting != null)
+ Exiting(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnFrameStart(CancelEventArgs e)
+ {
+ if (FrameStart != null)
+ FrameStart(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnFrameEnd(EventArgs e)
+ {
+ if (FrameEnd != null)
+ FrameEnd(this, e);
+ }
+
+ void DrawFrame()
+ {
+ try
+ {
+ if ( !IsExiting /* && !Window.IsMinimized */ ) // #28230 2012.5.1 yyagi
+ {
+ CancelEventArgs e = new CancelEventArgs(false);
+ OnFrameStart(e);
+ if (!e.Cancel)
+ {
+ gameTime.TotalRealTime = (float)clock.CurrentTime.TotalSeconds;
+ gameTime.ElapsedRealTime = (float)lastFrameElapsedRealTime.TotalSeconds;
+ gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds;
+ gameTime.ElapsedGameTime = (float)lastFrameElapsedGameTime.TotalSeconds;
+ gameTime.IsRunningSlowly = drawRunningSlowly;
+
+ Draw(gameTime);
+
+ OnFrameEnd(EventArgs.Empty);
+ }
+ }
+ }
+ finally
+ {
+ lastFrameElapsedGameTime = TimeSpan.Zero;
+ lastFrameElapsedRealTime = TimeSpan.Zero;
+ }
+ }
+
+ void Application_Idle(object sender, EventArgs e)
+ {
+ NativeMessage message;
+ while (!NativeMethods.PeekMessage(out message, IntPtr.Zero, 0, 0, 0))
+ {
+ if (IsExiting)
+ Window.Close();
+ else
+ Tick();
+ }
+ }
+
+ void Window_ApplicationDeactivated(object sender, EventArgs e)
+ {
+ if (IsActive)
+ {
+ IsActive = false;
+ OnDeactivated(EventArgs.Empty);
+ }
+ }
+
+ void Window_ApplicationActivated(object sender, EventArgs e)
+ {
+ if (!IsActive)
+ {
+ IsActive = true;
+ OnActivated(EventArgs.Empty);
+ }
+ }
+
+ void Window_Paint(object sender, PaintEventArgs e)
+ {
+ DrawFrame();
+ }
+
+ void Window_Resume(object sender, EventArgs e)
+ {
+ clock.Resume();
+ }
+
+ void Window_Suspend(object sender, EventArgs e)
+ {
+ clock.Suspend();
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameClock.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameClock.cs
new file mode 100644
index 00000000..fe201f18
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameClock.cs
@@ -0,0 +1,153 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Diagnostics;
+
+namespace SampleFramework
+{
+ class GameClock
+ {
+ long baseRealTime;
+ long lastRealTime;
+ bool lastRealTimeValid;
+ int suspendCount;
+ long suspendStartTime;
+ long timeLostToSuspension;
+ TimeSpan currentTimeBase;
+ TimeSpan currentTimeOffset;
+
+ public TimeSpan CurrentTime
+ {
+ get { return currentTimeBase + currentTimeOffset; }
+ }
+
+ public TimeSpan ElapsedTime
+ {
+ get;
+ private set;
+ }
+
+ public TimeSpan ElapsedAdjustedTime
+ {
+ get;
+ private set;
+ }
+
+ public static long Frequency
+ {
+ get { return Stopwatch.Frequency; }
+ }
+
+ public GameClock()
+ {
+ Reset();
+ }
+
+ public void Reset()
+ {
+ currentTimeBase = TimeSpan.Zero;
+ currentTimeOffset = TimeSpan.Zero;
+ baseRealTime = Stopwatch.GetTimestamp();
+ lastRealTimeValid = false;
+ }
+
+ public void Suspend()
+ {
+ suspendCount++;
+ if (suspendCount == 1)
+ suspendStartTime = Stopwatch.GetTimestamp();
+ }
+
+ ///
+ /// Resumes a previously suspended clock.
+ ///
+ public void Resume()
+ {
+ suspendCount--;
+ if (suspendCount <= 0)
+ {
+ timeLostToSuspension += Stopwatch.GetTimestamp() - suspendStartTime;
+ suspendStartTime = 0;
+ }
+ }
+
+ public void Step()
+ {
+ long counter = Stopwatch.GetTimestamp();
+
+ if (!lastRealTimeValid)
+ {
+ lastRealTime = counter;
+ lastRealTimeValid = true;
+ }
+
+ try
+ {
+ currentTimeOffset = CounterToTimeSpan(counter - baseRealTime);
+ }
+ catch (OverflowException)
+ {
+ // update the base value and try again to adjust for overflow
+ currentTimeBase += currentTimeOffset;
+ baseRealTime = lastRealTime;
+
+ try
+ {
+ // get the current offset
+ currentTimeOffset = CounterToTimeSpan(counter - baseRealTime);
+ }
+ catch (OverflowException)
+ {
+ // account for overflow
+ baseRealTime = counter;
+ currentTimeOffset = TimeSpan.Zero;
+ }
+ }
+
+ try
+ {
+ ElapsedTime = CounterToTimeSpan(counter - lastRealTime);
+ }
+ catch (OverflowException)
+ {
+ ElapsedTime = TimeSpan.Zero;
+ }
+
+ try
+ {
+ ElapsedAdjustedTime = CounterToTimeSpan(counter - (lastRealTime + timeLostToSuspension));
+ timeLostToSuspension = 0;
+ }
+ catch (OverflowException)
+ {
+ ElapsedAdjustedTime = TimeSpan.Zero;
+ }
+
+ lastRealTime = counter;
+ }
+
+ static TimeSpan CounterToTimeSpan(long delta)
+ {
+ return TimeSpan.FromTicks((delta * 10000000) / Frequency);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameTime.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameTime.cs
new file mode 100644
index 00000000..904caf26
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameTime.cs
@@ -0,0 +1,120 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
+namespace SampleFramework
+{
+ ///
+ /// Contains the current timing state of the game.
+ ///
+ public class GameTime
+ {
+ private float m_FramesPerSecond;
+ ///
+ /// Gets the current frames-per-second measure.
+ ///
+ /// The current frames-per-second measure.
+ public float FramesPerSecond
+ {
+ get { return m_FramesPerSecond; }
+ internal set { m_FramesPerSecond = value; }
+ }
+
+ private float m_ElapsedGameTime;
+ ///
+ /// Gets the elapsed game time, in seconds.
+ ///
+ /// The elapsed game time.
+ public float ElapsedGameTime
+ {
+ get { return m_ElapsedGameTime; }
+ internal set { m_ElapsedGameTime = value; }
+ }
+
+ private float m_ElapsedRealTime;
+ ///
+ /// Gets the elapsed real time, in seconds.
+ ///
+ /// The elapsed real time.
+ public float ElapsedRealTime
+ {
+ get { return m_ElapsedRealTime; }
+ internal set { m_ElapsedRealTime = value; }
+ }
+
+ private float m_TotalGameTime;
+ ///
+ /// Gets the total game time, in seconds.
+ ///
+ /// The total game time.
+ public float TotalGameTime
+ {
+ get { return m_TotalGameTime; }
+ internal set { m_TotalGameTime = value; }
+ }
+
+ private float m_TotalRealTime;
+ ///
+ /// Gets the total real time, in seconds.
+ ///
+ /// The total real time.
+ public float TotalRealTime
+ {
+ get { return m_TotalRealTime; }
+ internal set { m_TotalRealTime = value; }
+ }
+
+ private bool m_IsRunningSlowly;
+ ///
+ /// Gets or sets a value indicating whether this instance is running slowly.
+ ///
+ ///
+ /// true if this instance is running slowly; otherwise, false.
+ ///
+ public bool IsRunningSlowly
+ {
+ get { return m_IsRunningSlowly; }
+ internal set { m_IsRunningSlowly = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public GameTime()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The total real time.
+ /// The elapsed real time.
+ /// The total game time.
+ /// The elapsed game time.
+ public GameTime(float totalRealTime, float elapsedRealTime, float totalGameTime, float elapsedGameTime)
+ {
+ TotalRealTime = totalRealTime;
+ ElapsedRealTime = elapsedRealTime;
+ TotalGameTime = totalGameTime;
+ ElapsedGameTime = elapsedGameTime;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.cs
new file mode 100644
index 00000000..e4cf1509
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.cs
@@ -0,0 +1,634 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.IO;
+using System.Reflection;
+using System.Security.Permissions;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using SampleFramework.Properties;
+
+namespace SampleFramework
+{
+ ///
+ /// Implements a specialized window for games and rendering.
+ ///
+ public class GameWindow : Form
+ {
+ const int DefaultWidth = 800;
+ const int DefaultHeight = 600;
+ const string DefaultTitle = "Game";
+
+ Size cachedSize;
+ bool minimized;
+ bool maximized;
+ bool inSizeMove;
+
+ ///
+ /// Occurs when the application is suspended.
+ ///
+ public event EventHandler Suspend;
+
+ ///
+ /// Occurs when the application is resumed.
+ ///
+ public event EventHandler Resume;
+
+ ///
+ /// Occurs when the user resizes the window.
+ ///
+ public event EventHandler UserResized;
+
+ ///
+ /// Occurs when the screen on which the window resides is changed.
+ ///
+ public event EventHandler ScreenChanged;
+
+ ///
+ /// Occurs when the application is activated.
+ ///
+ public event EventHandler ApplicationActivated;
+
+ ///
+ /// Occurs when the application is deactivated.
+ ///
+ public event EventHandler ApplicationDeactivated;
+
+ ///
+ /// Occurs when the system is suspended.
+ ///
+ public event EventHandler SystemSuspend;
+
+ ///
+ /// Occurs when the system is resumed.
+ ///
+ public event EventHandler SystemResume;
+
+ ///
+ /// Occurs when a screen saver is about to be activated.
+ ///
+ public event CancelEventHandler Screensaver;
+
+ ///
+ /// Gets a value indicating whether this instance is minimized.
+ ///
+ ///
+ /// true if this instance is minimized; otherwise, false.
+ ///
+ public bool IsMinimized
+ {
+ get { return minimized; }
+ }
+
+ ///
+ /// Gets a value indicating whether this instance is maximized.
+ ///
+ ///
+ /// true if this instance is maximized; otherwise, false.
+ ///
+ public bool IsMaximized
+ {
+ get { return maximized; }
+ }
+
+ ///
+ /// Gets or sets a value indicating whether System Menu is enabled.
+ ///
+ /// true if System Menu is enabled; otherwise, false.
+ public bool EnableSystemMenu // #28200 2012.5.1 yyagi
+ {
+ get;
+ set;
+ }
+ public string strMessage // #28821 2014.1.23 yyagi
+ {
+ get;
+ private set;
+ }
+ public bool IsReceivedMessage
+ {
+ get;
+ set;
+ }
+
+ private Screen m_Screen;
+ ///
+ /// Gets the screen on which the window resides.
+ ///
+ /// The screen.
+ public Screen Screen
+ {
+ get { return m_Screen; }
+ private set { m_Screen = value; }
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public GameWindow()
+ {
+ MinimumSize = new Size(200, 200);
+
+ Screen = ScreenFromHandle(Handle);
+
+ //Icon = GetDefaultIcon();
+ Text = GetDefaultTitle();
+ strMessage = "";
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnSuspend(EventArgs e)
+ {
+ if (Suspend != null)
+ Suspend(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnResume(EventArgs e)
+ {
+ if (Resume != null)
+ Resume(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnUserResized(EventArgs e)
+ {
+ if (UserResized != null)
+ UserResized(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnScreenChanged(EventArgs e)
+ {
+ if (ScreenChanged != null)
+ ScreenChanged(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnApplicationActivated(EventArgs e)
+ {
+ if (ApplicationActivated != null)
+ ApplicationActivated(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnApplicationDeactivated(EventArgs e)
+ {
+ if (ApplicationDeactivated != null)
+ ApplicationDeactivated(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnSystemSuspend(EventArgs e)
+ {
+ if (SystemSuspend != null)
+ SystemSuspend(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnSystemResume(EventArgs e)
+ {
+ if (SystemResume != null)
+ SystemResume(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// The instance containing the event data.
+ protected virtual void OnScreensaver(CancelEventArgs e)
+ {
+ if (Screensaver != null)
+ Screensaver(this, e);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// An that contains the event data.
+ protected override void OnLoad(EventArgs e)
+ {
+ base.OnLoad(e);
+
+ cachedSize = Size;
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// A that contains the event data.
+ protected override void OnResizeBegin(EventArgs e)
+ {
+ base.OnResizeBegin(e);
+
+ // suspend any processing until we are done being minimized
+ inSizeMove = true;
+ cachedSize = Size;
+ OnSuspend(EventArgs.Empty);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// A that contains the event data.
+ protected override void OnResizeEnd(EventArgs e)
+ {
+ base.OnResizeEnd(e);
+
+ // check for screen and size changes
+ OnUserResized(EventArgs.Empty);
+ UpdateScreen();
+ inSizeMove = false;
+
+ // resume application processing
+ OnResume(EventArgs.Empty);
+ }
+
+
+ #region #23510 2010.11.14 yyagi add: 邵ヲ讓ェ豈泌崋螳壹〒縺ョ繧ヲ繧、繝ウ繝峨え繧オ繧、繧コ螟画峩 螳壽焚螳夂セゥ from http://www.vcskicks.com/maintain-aspect-ratio.php
+ //double so division keeps decimal points
+ const double widthRatio = SampleFramework.GameWindowSize.Width;
+ const double heightRatio = SampleFramework.GameWindowSize.Height;
+ const int WM_SIZING = 0x214;
+ const int WMSZ_LEFT = 1;
+ const int WMSZ_RIGHT = 2;
+ const int WMSZ_TOP = 3;
+ const int WMSZ_TOPLEFT = 4;
+ const int WMSZ_TOPRIGHT = 5;
+ const int WMSZ_BOTTOM = 6;
+ const int WMSZ_BOTTOMLEFT = 7;
+ const int WMSZ_BOTTOMRIGHT = 8;
+
+ public struct RECT
+ {
+ public int Left;
+ public int Top;
+ public int Right;
+ public int Bottom;
+ }
+ #endregion
+
+
+
+ ///
+ /// Handles raw window messages.
+ ///
+ /// The raw message.
+ [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
+ protected override void WndProc(ref Message m)
+ {
+ if (m.Msg == WindowConstants.WM_SIZE)
+ {
+ if (m.WParam == WindowConstants.SIZE_MINIMIZED)
+ {
+ minimized = true;
+ maximized = false;
+
+ OnSuspend(EventArgs.Empty);
+ }
+ else
+ {
+ Rectangle client = NativeMethods.GetClientRectangle(m.HWnd);
+ if (client.Height == 0)
+ {
+ // rapidly clicking the task bar to minimize and restore a window
+ // can cause a WM_SIZE message with SIZE_RESTORED when
+ // the window has actually become minimized due to rapid change
+ // so just ignore this message
+ }
+ else if (m.WParam == WindowConstants.SIZE_MAXIMIZED)
+ {
+ if (minimized)
+ OnResume(EventArgs.Empty);
+
+ minimized = false;
+ maximized = true;
+
+ OnUserResized(EventArgs.Empty);
+ UpdateScreen();
+ }
+ else if (m.WParam == WindowConstants.SIZE_RESTORED)
+ {
+ if (minimized)
+ OnResume(EventArgs.Empty);
+
+ minimized = false;
+ maximized = false;
+
+ if (!inSizeMove && Size != cachedSize)
+ {
+ OnUserResized(EventArgs.Empty);
+ UpdateScreen();
+ cachedSize = Size;
+ }
+ }
+ }
+ }
+ else if (m.Msg == WindowConstants.WM_ACTIVATEAPP)
+ {
+ if (m.WParam != IntPtr.Zero)
+ OnApplicationActivated(EventArgs.Empty);
+ else
+ OnApplicationDeactivated(EventArgs.Empty);
+ }
+ else if (m.Msg == WindowConstants.WM_POWERBROADCAST)
+ {
+ if (m.WParam == WindowConstants.PBT_APMQUERYSUSPEND)
+ {
+ OnSystemSuspend(EventArgs.Empty);
+ m.Result = (IntPtr)1;
+ return;
+ }
+ else if (m.WParam == WindowConstants.PBT_APMRESUMESUSPEND)
+ {
+ OnSystemResume(EventArgs.Empty);
+ m.Result = (IntPtr)1;
+ return;
+ }
+ }
+ else if (m.Msg == WindowConstants.WM_SYSCOMMAND)
+ {
+ long wparam = m.WParam.ToInt64() & 0xFFF0;
+ if (wparam == WindowConstants.SC_MONITORPOWER || wparam == WindowConstants.SC_SCREENSAVE)
+ {
+ CancelEventArgs e = new CancelEventArgs();
+ OnScreensaver(e);
+ if (e.Cancel)
+ {
+ m.Result = IntPtr.Zero;
+ return;
+ }
+ }
+ #region #28200 2012.5.1 yyagi: Disable system menu
+ if ( ( m.WParam.ToInt32() & 0xFFFF ) == 0xF100 && !EnableSystemMenu ) // SC_KEYMENU
+ {
+ m.Result = IntPtr.Zero;
+ return;
+ }
+ #endregion
+ #region #23510 2010.11.13 yyagi: reset to 640x480
+ if ((m.WParam.ToInt32() & 0xFFFF) == MENU_VIEW)
+ {
+ base.ClientSize = new Size(SampleFramework.GameWindowSize.Width, SampleFramework.GameWindowSize.Height);
+ this.OnResizeEnd(new EventArgs()); // #23510 2010.11.20 yyagi: to set window size to Config.ini
+ }
+ #endregion
+ }
+ #region #28821 2014.1.23 yyagi (WM_COPYDATA)
+ else if ( m.Msg == WindowConstants.WM_COPYDATA )
+ {
+//Trace.WriteLine( "FDK;msg received" );
+ COPYDATASTRUCT cds = (COPYDATASTRUCT) Marshal.PtrToStructure( m.LParam, typeof( COPYDATASTRUCT ) );
+ strMessage = Marshal.PtrToStringUni( cds.lpData );
+ IsReceivedMessage = true;
+//Trace.WriteLine( "FDK;msg=" + strMessage + ", len=" + strMessage.Length + ", truelen=" + cds.cbData );
+ }
+ #endregion
+ #region #23510 2010.11.16 yyagi add: 邵ヲ讓ェ豈泌崋螳壹〒縺ョ繧ヲ繧、繝ウ繝峨え繧オ繧、繧コ螟画峩 from http://d.hatena.ne.jp/iselix/20080917/1221666614 http://hp.vector.co.jp/authors/VA016117/sizing.html
+ else if ( m.Msg == WM_SIZING )
+ {
+ RECT rc = (RECT) Marshal.PtrToStructure( m.LParam, typeof( RECT ) );
+ int w = rc.Right - rc.Left - ( Size.Width - ClientSize.Width );
+ int h = rc.Bottom - rc.Top - ( Size.Height - ClientSize.Height );
+ int dw = (int) ( h * widthRatio / heightRatio + 0.5 ) - w;
+ int dh = (int) ( w / ( widthRatio / heightRatio ) + 0.5 ) - h;
+
+ switch ( m.WParam.ToInt32() )
+ {
+ case WMSZ_LEFT:
+ case WMSZ_RIGHT:
+ rc.Bottom += dh;
+ break;
+ case WMSZ_TOP:
+ case WMSZ_BOTTOM:
+ rc.Right += dw;
+ break;
+ case WMSZ_BOTTOMRIGHT:
+ if ( dw > 0 )
+ {
+ rc.Right += dw;
+ }
+ else
+ {
+ rc.Bottom += dh;
+ }
+ break;
+ case WMSZ_TOPLEFT:
+ if ( dw > 0 )
+ {
+ rc.Left -= dw;
+ }
+ else
+ {
+ rc.Top -= dh;
+ }
+ break;
+ case WMSZ_TOPRIGHT:
+ if ( dw > 0 )
+ {
+ rc.Right += dw;
+ }
+ else
+ {
+ rc.Top -= dh;
+ }
+ break;
+ case WMSZ_BOTTOMLEFT:
+ if ( dw > 0 )
+ {
+ rc.Left -= dw;
+ }
+ else
+ {
+ rc.Bottom += dh;
+ }
+ break;
+ case 9: // #32383 2013.11.2 yyagi; exitting maximized window by using Aero snap
+ break;
+ default:
+ throw new ArgumentOutOfRangeException( "value", "Illegal WM_SIZING value." );
+ }
+ Marshal.StructureToPtr( rc, m.LParam, true );
+ }
+ #endregion
+
+
+ base.WndProc(ref m);
+ }
+
+ void UpdateScreen()
+ {
+ Screen current = Screen.FromHandle(Handle);
+ if (Screen == null || Screen.DeviceName != current.DeviceName)
+ {
+ Screen = current;
+ if (Screen != null)
+ OnScreenChanged(EventArgs.Empty);
+ }
+ }
+
+ static Screen ScreenFromHandle(IntPtr windowHandle)
+ {
+ Rectangle rectangle = NativeMethods.GetWindowRectangle(windowHandle);
+
+ Screen bestScreen = null;
+ int mostArea = 0;
+ foreach (Screen screen in Screen.AllScreens)
+ {
+ Rectangle r = Rectangle.Intersect(rectangle, screen.Bounds);
+ int area = r.Width * r.Height;
+
+ if (area > mostArea)
+ {
+ mostArea = area;
+ bestScreen = screen;
+ }
+ }
+
+ if (bestScreen == null)
+ bestScreen = Screen.PrimaryScreen;
+ return bestScreen;
+ }
+
+ static string GetAssemblyTitle(Assembly assembly)
+ {
+ if (assembly == null)
+ return null;
+
+ AssemblyTitleAttribute[] customAttributes = (AssemblyTitleAttribute[])assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), true);
+ if (customAttributes != null && customAttributes.Length > 0)
+ return customAttributes[0].Title;
+
+ return null;
+ }
+
+ static string GetDefaultTitle()
+ {
+ string assemblyTitle = GetAssemblyTitle(Assembly.GetEntryAssembly());
+ if (!string.IsNullOrEmpty(assemblyTitle))
+ return assemblyTitle;
+
+ try
+ {
+ Uri uri = new Uri(Application.ExecutablePath);
+ return Path.GetFileNameWithoutExtension(uri.LocalPath);
+ }
+ catch (ArgumentNullException e)
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (6216f3e1-e1a5-45ca-bfd8-30bbc44bfa9a)" );
+ }
+ catch (UriFormatException e)
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (771f37b5-0b56-4a47-933e-3c178b3e27a7)" );
+ }
+
+ return DefaultTitle;
+ }
+
+ static Icon GetDefaultIcon()
+ {
+ return (Icon)Resources.sdx_icon_black.Clone();
+ }
+
+ #region 繧キ繧ケ繝繝繝。繝九Η繝シ縺ォ"640x480"繧定ソス蜉 #23510 2010.11.13 yyagi add: to set "640x480" menu in systemmenu. See also http://cs2ch.blog123.fc2.com/blog-entry-80.html
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct MENUITEMINFO
+ {
+ public uint cbSize;
+ public uint fMask;
+ public uint fType;
+ public uint fState;
+ public uint wID;
+ public IntPtr hSubMenu;
+ public IntPtr hbmpChecked;
+ public IntPtr hbmpUnchecked;
+ public IntPtr dwItemData;
+ public string dwTypeData;
+ public uint cch;
+ public IntPtr hbmpItem;
+ }
+
+ [DllImport("user32", ExactSpelling = true)]
+ private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
+ [DllImport("user32", CharSet = CharSet.Auto)]
+ private static extern bool InsertMenuItem(IntPtr hMenu, uint uItem, bool fByPosition, ref MENUITEMINFO lpmii);
+
+ private const uint MENU_VIEW = 0x9999;
+ private const uint MFT_SEPARATOR = 0x00000800;
+ private const uint MIIM_FTYPE = 0x00000100;
+ private const uint MIIM_STRING = 0x00000040;
+ private const uint MIIM_ID = 0x00000002;
+
+ protected override void OnCreateControl()
+ {
+ base.OnCreateControl();
+
+ //繧キ繧ケ繝繝繝。繝九Η繝シ縺ョ繝上Φ繝峨Ν蜿門セ
+ IntPtr hSysMenu = GetSystemMenu(this.Handle, false);
+
+ //繧サ繝代Ξ繝シ繧ソ繝シ縺ョ謖ソ蜈・
+ MENUITEMINFO item1 = new MENUITEMINFO();
+ item1.cbSize = (uint)Marshal.SizeOf(item1);
+ item1.fMask = MIIM_FTYPE;
+ item1.fType = MFT_SEPARATOR;
+ InsertMenuItem(hSysMenu, 5, true, ref item1);
+
+ //繝。繝九Η繝シ鬆逶ョ縺ョ謖ソ蜈・
+ MENUITEMINFO item2 = new MENUITEMINFO();
+ item2.cbSize = (uint)Marshal.SizeOf(item2);
+ item2.fMask = MIIM_STRING | MIIM_ID;
+ item2.wID = MENU_VIEW;
+ item2.dwTypeData = "&" + SampleFramework.GameWindowSize.Width.ToString() + "x" + SampleFramework.GameWindowSize.Height.ToString();
+ InsertMenuItem(hSysMenu, 6, true, ref item2);
+ }
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.resx b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.resx
new file mode 100644
index 00000000..1af7de15
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.resx
@@ -0,0 +1,120 @@
+サソ
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindowSize.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindowSize.cs
new file mode 100644
index 00000000..2d7a1c58
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindowSize.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace SampleFramework
+{
+ public static class GameWindowSize
+ {
+ public const int Width = 1280;
+ public const int Height = 720;
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/ConversionMethods.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/ConversionMethods.cs
new file mode 100644
index 00000000..60915b37
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/ConversionMethods.cs
@@ -0,0 +1,204 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using SlimDX;
+using SlimDX.Direct3D9;
+using DXGI = SlimDX.DXGI;
+
+namespace SampleFramework
+{
+ static class ConversionMethods
+ {
+ public static int GetDepthBits(Format format)
+ {
+ switch (format)
+ {
+ case Format.D32SingleLockable:
+ case Format.D32:
+ return 32;
+
+ case Format.D24X8:
+ case Format.D24S8:
+ case Format.D24X4S4:
+ case Format.D24SingleS8:
+ return 24;
+
+ case Format.D16Lockable:
+ case Format.D16:
+ return 16;
+
+ case Format.D15S1:
+ return 15;
+
+ default:
+ return 0;
+ }
+ }
+
+ public static int GetStencilBits(Format format)
+ {
+ switch (format)
+ {
+ case Format.D15S1:
+ return 1;
+
+ case Format.D24X4S4:
+ return 4;
+
+ case Format.D24S8:
+ case Format.D24SingleS8:
+ return 8;
+
+ default:
+ return 0;
+ }
+ }
+
+ public static int GetColorBits(Format format)
+ {
+ switch (format)
+ {
+ case Format.R8G8B8:
+ case Format.A8R8G8B8:
+ case Format.A8B8G8R8:
+ case Format.X8R8G8B8:
+ return 8;
+
+ case Format.R5G6B5:
+ case Format.X1R5G5B5:
+ case Format.A1R5G5B5:
+ return 5;
+
+ case Format.A4R4G4B4:
+ case Format.X4R4G4B4:
+ return 4;
+
+ case Format.R3G3B2:
+ case Format.A8R3G3B2:
+ return 2;
+
+ case Format.A2R10G10B10:
+ case Format.A2B10G10R10:
+ return 10;
+
+ case Format.A16B16G16R16:
+ return 16;
+
+ default:
+ return 0;
+ }
+ }
+
+ public static int GetColorBits(DXGI.Format format)
+ {
+ switch (format)
+ {
+ case SlimDX.DXGI.Format.R32G32B32A32_Float:
+ case SlimDX.DXGI.Format.R32G32B32A32_SInt:
+ case SlimDX.DXGI.Format.R32G32B32A32_Typeless:
+ case SlimDX.DXGI.Format.R32G32B32A32_UInt:
+ case SlimDX.DXGI.Format.R32G32B32_Float:
+ case SlimDX.DXGI.Format.R32G32B32_SInt:
+ case SlimDX.DXGI.Format.R32G32B32_Typeless:
+ case SlimDX.DXGI.Format.R32G32B32_UInt:
+ return 32;
+
+ case SlimDX.DXGI.Format.R16G16B16A16_Float:
+ case SlimDX.DXGI.Format.R16G16B16A16_SInt:
+ case SlimDX.DXGI.Format.R16G16B16A16_SNorm:
+ case SlimDX.DXGI.Format.R16G16B16A16_Typeless:
+ case SlimDX.DXGI.Format.R16G16B16A16_UInt:
+ case SlimDX.DXGI.Format.R16G16B16A16_UNorm:
+ return 16;
+
+ case SlimDX.DXGI.Format.R10G10B10A2_Typeless:
+ case SlimDX.DXGI.Format.R10G10B10A2_UInt:
+ case SlimDX.DXGI.Format.R10G10B10A2_UNorm:
+ return 10;
+
+ case SlimDX.DXGI.Format.R8G8B8A8_SInt:
+ case SlimDX.DXGI.Format.R8G8B8A8_SNorm:
+ case SlimDX.DXGI.Format.R8G8B8A8_Typeless:
+ case SlimDX.DXGI.Format.R8G8B8A8_UInt:
+ case SlimDX.DXGI.Format.R8G8B8A8_UNorm:
+ case SlimDX.DXGI.Format.R8G8B8A8_UNorm_SRGB:
+ return 8;
+
+ case SlimDX.DXGI.Format.B5G5R5A1_UNorm:
+ case SlimDX.DXGI.Format.B5G6R5_UNorm:
+ return 5;
+
+ default:
+ return 0;
+ }
+ }
+
+ public static MultisampleType ToDirect3D9(int type)
+ {
+ return (MultisampleType)type;
+ }
+
+ public static Format ToDirect3D9(DXGI.Format format)
+ {
+ switch (format)
+ {
+ case SlimDX.DXGI.Format.R8G8B8A8_UNorm:
+ return Format.A8R8G8B8;
+ case SlimDX.DXGI.Format.B5G6R5_UNorm:
+ return Format.R5G6B5;
+ case SlimDX.DXGI.Format.B5G5R5A1_UNorm:
+ return Format.A1R5G5B5;
+ case SlimDX.DXGI.Format.A8_UNorm:
+ return Format.A8;
+ case SlimDX.DXGI.Format.R10G10B10A2_UNorm:
+ return Format.A2B10G10R10;
+ case SlimDX.DXGI.Format.B8G8R8A8_UNorm:
+ return Format.A8B8G8R8;
+ case SlimDX.DXGI.Format.R16G16_UNorm:
+ return Format.G16R16;
+ case SlimDX.DXGI.Format.R16G16B16A16_UNorm:
+ return Format.A16B16G16R16;
+ case SlimDX.DXGI.Format.R16_Float:
+ return Format.R16F;
+ case SlimDX.DXGI.Format.R16G16_Float:
+ return Format.G16R16F;
+ case SlimDX.DXGI.Format.R16G16B16A16_Float:
+ return Format.A16B16G16R16F;
+ case SlimDX.DXGI.Format.R32_Float:
+ return Format.R32F;
+ case SlimDX.DXGI.Format.R32G32_Float:
+ return Format.G32R32F;
+ case SlimDX.DXGI.Format.R32G32B32A32_Float:
+ return Format.A32B32G32R32F;
+ }
+
+ return Format.Unknown;
+ }
+
+ public static float ToFloat(Rational rational)
+ {
+ float denom = 1;
+ if (rational.Denominator != 0)
+ denom = rational.Denominator;
+ return rational.Numerator / denom;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/DeviceSettings.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/DeviceSettings.cs
new file mode 100644
index 00000000..80063121
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/DeviceSettings.cs
@@ -0,0 +1,285 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using SlimDX.Direct3D9;
+namespace SampleFramework
+{
+ ///
+ /// Contains settings for creating a 3D device.
+ ///
+ public class DeviceSettings : ICloneable
+ {
+ ///
+ /// Gets or sets the adapter ordinal.
+ ///
+ /// The adapter ordinal.
+ public int AdapterOrdinal
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the type of the device.
+ ///
+ /// The type of the device.
+ public DeviceType DeviceType
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the refresh rate.
+ ///
+ /// The refresh rate.
+ public int RefreshRate
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the width of the back buffer.
+ ///
+ /// The width of the back buffer.
+ public int BackBufferWidth
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the height of the back buffer.
+ ///
+ /// The height of the back buffer.
+ public int BackBufferHeight
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the back buffer format.
+ ///
+ /// The back buffer format.
+ public Format BackBufferFormat
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the back buffer count.
+ ///
+ /// The back buffer count.
+ public int BackBufferCount
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the device is windowed.
+ ///
+ /// true if windowed; otherwise, false.
+ public bool Windowed
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether VSync is enabled.
+ ///
+ /// true if VSync is enabled; otherwise, false.
+ public bool EnableVSync
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether this is multithreaded.
+ ///
+ /// true if multithreaded; otherwise, false.
+ /// This only has an effect for Direct3D9 devices.
+ public bool Multithreaded
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the multisample type.
+ ///
+ /// The multisample type.
+ public MultisampleType MultisampleType
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the multisample quality.
+ ///
+ /// The multisample quality.
+ public int MultisampleQuality
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the depth stencil format.
+ ///
+ /// The depth stencil format.
+ public Format DepthStencilFormat
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the Direct3D9 specific settings.
+ ///
+ /// The Direct3D9 specific settings.
+ internal Direct3D9Settings Direct3D9
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DeviceSettings()
+ {
+ // set sane defaults
+ DeviceType = DeviceType.Hardware;
+ BackBufferFormat = Format.Unknown;
+ BackBufferCount = 1;
+ MultisampleType = MultisampleType.None;
+ DepthStencilFormat = Format.Unknown;
+ Windowed = true;
+ EnableVSync = true;
+ }
+
+ ///
+ /// Creates a new object that is a copy of the current instance.
+ ///
+ ///
+ /// A new object that is a copy of this instance.
+ ///
+ public DeviceSettings Clone()
+ {
+ DeviceSettings result = new DeviceSettings();
+ result.DeviceType = DeviceType;
+ result.RefreshRate = RefreshRate;
+ result.BackBufferCount = BackBufferCount;
+ result.BackBufferFormat = BackBufferFormat;
+ result.BackBufferHeight = BackBufferHeight;
+ result.BackBufferWidth = BackBufferWidth;
+ result.DepthStencilFormat = DepthStencilFormat;
+ result.MultisampleQuality = MultisampleQuality;
+ result.MultisampleType = MultisampleType;
+ result.Windowed = Windowed;
+ result.EnableVSync = EnableVSync;
+ result.AdapterOrdinal = AdapterOrdinal;
+ result.Multithreaded = Multithreaded;
+
+ if (Direct3D9 != null)
+ result.Direct3D9 = Direct3D9.Clone();
+
+ return result;
+ }
+
+ ///
+ /// Creates a new object that is a copy of the current instance.
+ ///
+ ///
+ /// A new object that is a copy of this instance.
+ ///
+ object ICloneable.Clone()
+ {
+ return Clone();
+ }
+
+ ///
+ /// Finds valid device settings based upon the desired settings.
+ ///
+ /// The desired settings.
+ /// The best valid device settings matching the input settings.
+ public static DeviceSettings FindValidSettings( DeviceSettings settings )
+ {
+ try
+ {
+ GraphicsDeviceManager.EnsureD3D9();
+ }
+ catch( Exception e )
+ {
+ throw new NoCompatibleDevicesException( "Could not initialize Direct3D9.", e );
+ }
+
+ if( !Enumeration9.HasEnumerated )
+ Enumeration9.Enumerate();
+
+ DeviceSettings newSettings = settings.Clone();
+ Direct3D9Settings d3d9 = FindValidD3D9Settings( settings );
+ newSettings.Direct3D9 = d3d9;
+ return newSettings;
+ }
+
+ static Direct3D9Settings FindValidD3D9Settings(DeviceSettings settings)
+ {
+ Direct3D9Settings optimal = Direct3D9Settings.BuildOptimalSettings(settings);
+
+ SettingsCombo9 bestCombo = null;
+ float bestRanking = -1.0f;
+
+ foreach (AdapterInfo9 adapterInfo in Enumeration9.Adapters)
+ {
+ DisplayMode desktopMode = GraphicsDeviceManager.Direct3D9Object.GetAdapterDisplayMode(adapterInfo.AdapterOrdinal);
+ foreach (DeviceInfo9 deviceInfo in adapterInfo.Devices)
+ {
+ foreach (SettingsCombo9 combo in deviceInfo.DeviceSettings)
+ {
+ if (combo.Windowed && combo.AdapterFormat != desktopMode.Format)
+ continue;
+
+ float ranking = Direct3D9Settings.RankSettingsCombo(combo, optimal, desktopMode);
+ if (ranking > bestRanking)
+ {
+ bestCombo = combo;
+ bestRanking = ranking;
+ }
+ }
+ }
+ }
+
+ if (bestCombo == null)
+ throw new NoCompatibleDevicesException("No compatible Direct3D9 devices found.");
+
+ return Direct3D9Settings.BuildValidSettings(bestCombo, optimal);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/Direct3D9Settings.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/Direct3D9Settings.cs
new file mode 100644
index 00000000..b44a3aac
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/Direct3D9Settings.cs
@@ -0,0 +1,440 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Collections.Generic;
+using SlimDX.Direct3D9;
+
+namespace SampleFramework
+{
+ class Direct3D9Settings : ICloneable
+ {
+ public int AdapterOrdinal
+ {
+ get;
+ set;
+ }
+
+ public DeviceType DeviceType
+ {
+ get;
+ set;
+ }
+
+ public Format AdapterFormat
+ {
+ get;
+ set;
+ }
+
+ public CreateFlags CreationFlags
+ {
+ get;
+ set;
+ }
+
+ public PresentParameters PresentParameters
+ {
+ get;
+ private set;
+ }
+
+ public Direct3D9Settings()
+ {
+ PresentParameters = new PresentParameters();
+ DeviceType = DeviceType.Hardware;
+ PresentParameters.Windowed = true;
+ AdapterFormat = Format.Unknown;
+ CreationFlags = CreateFlags.HardwareVertexProcessing;
+ PresentParameters.BackBufferFormat = Format.Unknown;
+ PresentParameters.BackBufferCount = 1;
+ PresentParameters.Multisample = MultisampleType.None;
+ PresentParameters.SwapEffect = SwapEffect.Discard;
+ PresentParameters.EnableAutoDepthStencil = true;
+ PresentParameters.AutoDepthStencilFormat = Format.Unknown;
+ PresentParameters.PresentFlags = PresentFlags.DiscardDepthStencil;
+ PresentParameters.PresentationInterval = PresentInterval.Default;
+ }
+
+ public Direct3D9Settings Clone()
+ {
+ Direct3D9Settings clone = new Direct3D9Settings();
+ clone.AdapterFormat = AdapterFormat;
+ clone.AdapterOrdinal = AdapterOrdinal;
+ clone.CreationFlags = CreationFlags;
+ clone.DeviceType = DeviceType;
+ clone.PresentParameters = PresentParameters.Clone();
+
+ return clone;
+ }
+
+ object ICloneable.Clone()
+ {
+ return Clone();
+ }
+
+ public static Direct3D9Settings BuildOptimalSettings(DeviceSettings settings)
+ {
+ DisplayMode desktopMode = GraphicsDeviceManager.Direct3D9Object.GetAdapterDisplayMode(0);
+ Direct3D9Settings optimal = new Direct3D9Settings();
+
+ optimal.AdapterOrdinal = settings.AdapterOrdinal;
+ optimal.DeviceType = settings.DeviceType;
+ optimal.PresentParameters.Windowed = settings.Windowed;
+ optimal.PresentParameters.BackBufferCount = settings.BackBufferCount;
+ optimal.PresentParameters.Multisample = settings.MultisampleType;
+ optimal.PresentParameters.MultisampleQuality = settings.MultisampleQuality;
+ optimal.PresentParameters.FullScreenRefreshRateInHertz = settings.RefreshRate;
+
+ if(settings.Multithreaded)
+ optimal.CreationFlags |= CreateFlags.Multithreaded;
+
+ if(optimal.PresentParameters.Windowed || ConversionMethods.GetColorBits(desktopMode.Format) >= 8)
+ optimal.AdapterFormat = desktopMode.Format;
+ else
+ optimal.AdapterFormat = Format.X8R8G8B8;
+
+ if(settings.BackBufferWidth == 0 || settings.BackBufferHeight == 0)
+ {
+ if(optimal.PresentParameters.Windowed)
+ {
+ optimal.PresentParameters.BackBufferWidth = 640;
+ optimal.PresentParameters.BackBufferHeight = 480;
+ }
+ else
+ {
+ optimal.PresentParameters.BackBufferWidth = desktopMode.Width;
+ optimal.PresentParameters.BackBufferHeight = desktopMode.Height;
+ }
+ }
+ else
+ {
+ optimal.PresentParameters.BackBufferWidth = settings.BackBufferWidth;
+ optimal.PresentParameters.BackBufferHeight = settings.BackBufferHeight;
+ }
+
+ if(settings.BackBufferFormat == Format.Unknown)
+ optimal.PresentParameters.BackBufferFormat = optimal.AdapterFormat;
+ else
+ optimal.PresentParameters.BackBufferFormat = settings.BackBufferFormat;
+
+ if(settings.DepthStencilFormat == Format.Unknown)
+ {
+ if(ConversionMethods.GetColorBits(optimal.PresentParameters.BackBufferFormat) >= 8)
+ optimal.PresentParameters.AutoDepthStencilFormat = Format.D32;
+ else
+ optimal.PresentParameters.AutoDepthStencilFormat = Format.D16;
+ }
+ else
+ optimal.PresentParameters.AutoDepthStencilFormat = settings.DepthStencilFormat;
+
+ if(!settings.EnableVSync)
+ optimal.PresentParameters.PresentationInterval = PresentInterval.Immediate;
+
+ return optimal;
+ }
+
+ public static float RankSettingsCombo(SettingsCombo9 combo, Direct3D9Settings optimal, DisplayMode desktopMode)
+ {
+ float ranking = 0.0f;
+
+ if(combo.AdapterOrdinal == optimal.AdapterOrdinal)
+ ranking += 1000.0f;
+
+ if(combo.DeviceType == optimal.DeviceType)
+ ranking += 100.0f;
+
+ if(combo.DeviceType == DeviceType.Hardware)
+ ranking += 0.1f;
+
+ if(combo.Windowed == optimal.PresentParameters.Windowed)
+ ranking += 10.0f;
+
+ if(combo.AdapterFormat == optimal.AdapterFormat)
+ ranking += 1.0f;
+ else
+ {
+ int bitDepthDelta = Math.Abs(ConversionMethods.GetColorBits(combo.AdapterFormat) -
+ ConversionMethods.GetColorBits(optimal.AdapterFormat));
+ float scale = Math.Max(0.9f - bitDepthDelta * 0.2f, 0.0f);
+ ranking += scale;
+ }
+
+ if(!combo.Windowed)
+ {
+ bool match;
+ if(ConversionMethods.GetColorBits(desktopMode.Format) >= 8)
+ match = (combo.AdapterFormat == desktopMode.Format);
+ else
+ match = (combo.AdapterFormat == Format.X8R8G8B8);
+
+ if(match)
+ ranking += 0.1f;
+ }
+
+ if((optimal.CreationFlags & CreateFlags.HardwareVertexProcessing) != 0 &&
+ (optimal.CreationFlags & CreateFlags.MixedVertexProcessing) != 0)
+ {
+ if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0)
+ ranking += 1.0f;
+ }
+
+ if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0)
+ ranking += 0.1f;
+
+ foreach(DisplayMode displayMode in combo.AdapterInfo.DisplayModes)
+ {
+ if(displayMode.Format == combo.AdapterFormat &&
+ displayMode.Width == optimal.PresentParameters.BackBufferWidth &&
+ displayMode.Height == optimal.PresentParameters.BackBufferHeight)
+ {
+ ranking += 1.0f;
+ break;
+ }
+ }
+
+ if(combo.BackBufferFormat == optimal.PresentParameters.BackBufferFormat)
+ ranking += 1.0f;
+ else
+ {
+ int bitDepthDelta = Math.Abs(ConversionMethods.GetColorBits(combo.BackBufferFormat) -
+ ConversionMethods.GetColorBits(optimal.PresentParameters.BackBufferFormat));
+ float scale = Math.Max(0.9f - bitDepthDelta * 0.2f, 0.0f);
+ ranking += scale;
+ }
+
+ if(combo.BackBufferFormat == combo.AdapterFormat)
+ ranking += 0.1f;
+
+ for(int i = 0; i < combo.MultisampleTypes.Count; i++)
+ {
+ MultisampleType type = combo.MultisampleTypes[i];
+ int quality = combo.MultisampleQualities[i];
+
+ if(type == optimal.PresentParameters.Multisample && quality == optimal.PresentParameters.MultisampleQuality)
+ {
+ ranking += 1.0f;
+ break;
+ }
+ }
+
+ if(combo.DepthStencilFormats.Contains(optimal.PresentParameters.AutoDepthStencilFormat))
+ ranking += 1.0f;
+
+ foreach(DisplayMode displayMode in combo.AdapterInfo.DisplayModes)
+ {
+ if(displayMode.Format == combo.AdapterFormat &&
+ displayMode.RefreshRate == optimal.PresentParameters.FullScreenRefreshRateInHertz)
+ {
+ ranking += 1.0f;
+ break;
+ }
+ }
+
+ if(combo.PresentIntervals.Contains(optimal.PresentParameters.PresentationInterval))
+ ranking += 1.0f;
+
+ return ranking;
+ }
+
+ public static Direct3D9Settings BuildValidSettings(SettingsCombo9 combo, Direct3D9Settings input)
+ {
+ Direct3D9Settings settings = new Direct3D9Settings();
+
+ settings.AdapterOrdinal = combo.AdapterOrdinal;
+ settings.DeviceType = combo.DeviceType;
+ settings.PresentParameters.Windowed = combo.Windowed;
+ settings.AdapterFormat = combo.AdapterFormat;
+ settings.PresentParameters.BackBufferFormat = combo.BackBufferFormat;
+ settings.PresentParameters.SwapEffect = input.PresentParameters.SwapEffect;
+ settings.PresentParameters.PresentFlags = input.PresentParameters.PresentFlags | PresentFlags.DiscardDepthStencil;
+
+ settings.CreationFlags = input.CreationFlags;
+ if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) == 0 &&
+ ((settings.CreationFlags & CreateFlags.HardwareVertexProcessing) != 0 ||
+ (settings.CreationFlags & CreateFlags.MixedVertexProcessing) != 0))
+ {
+ settings.CreationFlags &= ~CreateFlags.HardwareVertexProcessing;
+ settings.CreationFlags &= ~CreateFlags.MixedVertexProcessing;
+ settings.CreationFlags |= CreateFlags.SoftwareVertexProcessing;
+ }
+
+ if((settings.CreationFlags & CreateFlags.HardwareVertexProcessing) == 0 &&
+ (settings.CreationFlags & CreateFlags.MixedVertexProcessing) == 0 &&
+ (settings.CreationFlags & CreateFlags.SoftwareVertexProcessing) == 0)
+ {
+ if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0)
+ settings.CreationFlags |= CreateFlags.HardwareVertexProcessing;
+ else
+ settings.CreationFlags |= CreateFlags.SoftwareVertexProcessing;
+ }
+
+ DisplayMode bestDisplayMode = FindValidResolution(combo, input);
+ settings.PresentParameters.BackBufferWidth = bestDisplayMode.Width;
+ settings.PresentParameters.BackBufferHeight = bestDisplayMode.Height;
+
+ settings.PresentParameters.BackBufferCount = input.PresentParameters.BackBufferCount;
+ if(settings.PresentParameters.BackBufferCount > 3)
+ settings.PresentParameters.BackBufferCount = 3;
+ if(settings.PresentParameters.BackBufferCount < 1)
+ settings.PresentParameters.BackBufferCount = 1;
+
+ if(input.PresentParameters.SwapEffect != SwapEffect.Discard)
+ {
+ settings.PresentParameters.Multisample = MultisampleType.None;
+ settings.PresentParameters.MultisampleQuality = 0;
+ }
+ else
+ {
+ MultisampleType bestType = MultisampleType.None;
+ int bestQuality = 0;
+
+ for(int i = 0; i < combo.MultisampleTypes.Count; i++)
+ {
+ MultisampleType type = combo.MultisampleTypes[i];
+ int quality = combo.MultisampleQualities[0];
+
+ if(Math.Abs(type - input.PresentParameters.Multisample) < Math.Abs(bestType -
+ input.PresentParameters.Multisample))
+ {
+ bestType = type;
+ bestQuality = Math.Min(quality - 1, input.PresentParameters.MultisampleQuality);
+ }
+ }
+
+ settings.PresentParameters.Multisample = bestType;
+ settings.PresentParameters.MultisampleQuality = bestQuality;
+ }
+
+ List rankings = new List();
+ int inputDepthBitDepth = ConversionMethods.GetDepthBits(input.PresentParameters.AutoDepthStencilFormat);
+ int inputStencilBitDepth = ConversionMethods.GetStencilBits(input.PresentParameters.AutoDepthStencilFormat);
+
+ foreach(Format format in combo.DepthStencilFormats)
+ {
+ int currentBitDepth = ConversionMethods.GetDepthBits(format);
+ int currentStencilDepth = ConversionMethods.GetStencilBits(format);
+
+ int ranking = Math.Abs(currentBitDepth - inputDepthBitDepth);
+ ranking += Math.Abs(currentStencilDepth - inputStencilBitDepth);
+ rankings.Add(ranking);
+ }
+
+ int bestRanking = int.MaxValue;
+ foreach(int ranking in rankings)
+ {
+ if(ranking < bestRanking)
+ bestRanking = ranking;
+ }
+ int bestIndex = rankings.IndexOf(bestRanking);
+
+ if(bestIndex >= 0)
+ {
+ settings.PresentParameters.AutoDepthStencilFormat = combo.DepthStencilFormats[bestIndex];
+ settings.PresentParameters.EnableAutoDepthStencil = true;
+ }
+ else
+ {
+ settings.PresentParameters.AutoDepthStencilFormat = Format.Unknown;
+ settings.PresentParameters.EnableAutoDepthStencil = false;
+ }
+
+ if(combo.Windowed)
+ settings.PresentParameters.FullScreenRefreshRateInHertz = 0;
+ else
+ {
+ int match = input.PresentParameters.FullScreenRefreshRateInHertz;
+ bestDisplayMode.RefreshRate = 0;
+ if(match != 0)
+ {
+ bestRanking = 100000;
+ foreach(DisplayMode displayMode in combo.AdapterInfo.DisplayModes)
+ {
+ if(displayMode.Format != combo.AdapterFormat ||
+ displayMode.Width != bestDisplayMode.Width ||
+ displayMode.Height != bestDisplayMode.Height)
+ continue;
+
+ int ranking = Math.Abs(displayMode.RefreshRate - match);
+
+ if(ranking < bestRanking)
+ {
+ bestDisplayMode.RefreshRate = displayMode.RefreshRate;
+ bestRanking = ranking;
+
+ if(bestRanking == 0)
+ break;
+ }
+ }
+ }
+
+ settings.PresentParameters.FullScreenRefreshRateInHertz = bestDisplayMode.RefreshRate;
+ }
+
+ if(combo.PresentIntervals.Contains(input.PresentParameters.PresentationInterval))
+ settings.PresentParameters.PresentationInterval = input.PresentParameters.PresentationInterval;
+ else
+ settings.PresentParameters.PresentationInterval = PresentInterval.Default;
+
+ return settings;
+ }
+
+ static DisplayMode FindValidResolution(SettingsCombo9 combo, Direct3D9Settings input)
+ {
+ DisplayMode bestMode = new DisplayMode();
+
+ if(combo.Windowed)
+ {
+ bestMode.Width = input.PresentParameters.BackBufferWidth;
+ bestMode.Height = input.PresentParameters.BackBufferHeight;
+ return bestMode;
+ }
+
+ int bestRanking = 100000;
+ int ranking;
+ foreach(DisplayMode mode in combo.AdapterInfo.DisplayModes)
+ {
+ if(mode.Format != combo.AdapterFormat)
+ continue;
+
+ ranking = Math.Abs(mode.Width - input.PresentParameters.BackBufferWidth) +
+ Math.Abs(mode.Height - input.PresentParameters.BackBufferHeight);
+
+ if(ranking < bestRanking)
+ {
+ bestMode = mode;
+ bestRanking = ranking;
+
+ if(bestRanking == 0)
+ break;
+ }
+ }
+
+ if(bestMode.Width == 0)
+ {
+ bestMode.Width = input.PresentParameters.BackBufferWidth;
+ bestMode.Height = input.PresentParameters.BackBufferHeight;
+ }
+
+ return bestMode;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Enumeration/Enumeration9.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Enumeration/Enumeration9.cs
new file mode 100644
index 00000000..0aa8f41d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Enumeration/Enumeration9.cs
@@ -0,0 +1,447 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System.Collections.Generic;
+using System.Globalization;
+using SlimDX.Direct3D9;
+
+namespace SampleFramework
+{
+ class AdapterInfo9
+ {
+ public int AdapterOrdinal
+ {
+ get;
+ set;
+ }
+
+ public AdapterDetails Details
+ {
+ get;
+ set;
+ }
+
+ public string Description
+ {
+ get;
+ set;
+ }
+
+ public List DisplayModes
+ {
+ get;
+ private set;
+ }
+
+ public List Devices
+ {
+ get;
+ private set;
+ }
+
+ public AdapterInfo9()
+ {
+ // create lists
+ DisplayModes = new List();
+ Devices = new List();
+ }
+ }
+
+ class DeviceInfo9
+ {
+ public DeviceType DeviceType
+ {
+ get;
+ set;
+ }
+
+ public Capabilities Capabilities
+ {
+ get;
+ set;
+ }
+
+ public List DeviceSettings
+ {
+ get;
+ private set;
+ }
+
+ public DeviceInfo9()
+ {
+ DeviceSettings = new List();
+ }
+ }
+
+ class SettingsCombo9
+ {
+ public int AdapterOrdinal
+ {
+ get;
+ set;
+ }
+
+ public DeviceType DeviceType
+ {
+ get;
+ set;
+ }
+
+ public Format AdapterFormat
+ {
+ get;
+ set;
+ }
+
+ public Format BackBufferFormat
+ {
+ get;
+ set;
+ }
+
+ public bool Windowed
+ {
+ get;
+ set;
+ }
+
+ public List DepthStencilFormats
+ {
+ get;
+ internal set;
+ }
+
+ public List MultisampleTypes
+ {
+ get;
+ private set;
+ }
+
+ public List MultisampleQualities
+ {
+ get;
+ private set;
+ }
+
+ public List PresentIntervals
+ {
+ get;
+ private set;
+ }
+
+ public AdapterInfo9 AdapterInfo
+ {
+ get;
+ set;
+ }
+
+ public DeviceInfo9 DeviceInfo
+ {
+ get;
+ set;
+ }
+
+ public SettingsCombo9()
+ {
+ DepthStencilFormats = new List();
+ MultisampleQualities = new List();
+ MultisampleTypes = new List();
+ PresentIntervals = new List();
+ }
+ }
+
+ class DisplayModeComparer9 : IComparer
+ {
+ static DisplayModeComparer9 comparer = new DisplayModeComparer9();
+
+ public static DisplayModeComparer9 Comparer
+ {
+ get { return comparer; }
+ }
+
+ public DisplayModeComparer9()
+ {
+ }
+
+ public int Compare(DisplayMode x, DisplayMode y)
+ {
+ if (x.Width > y.Width)
+ return 1;
+ if (x.Width < y.Width)
+ return -1;
+ if (x.Height > y.Height)
+ return 1;
+ if (x.Height < y.Height)
+ return -1;
+ if (x.Format > y.Format)
+ return 1;
+ if (x.Format < y.Format)
+ return -1;
+ if (x.RefreshRate > y.RefreshRate)
+ return 1;
+ if (x.RefreshRate < y.RefreshRate)
+ return -1;
+
+ return 0;
+ }
+ }
+
+ static class Enumeration9
+ {
+ public static DeviceSettings MinimumSettings
+ {
+ get;
+ set;
+ }
+
+ public static List Adapters
+ {
+ get;
+ private set;
+ }
+
+ public static bool HasEnumerated
+ {
+ get;
+ private set;
+ }
+
+ public static void Enumerate()
+ {
+ HasEnumerated = true;
+ Adapters = new List();
+ List adapterFormats = new List();
+ Format[] allowedAdapterFormats = { Format.X8R8G8B8, Format.X1R5G5B5, Format.R5G6B5,
+ Format.A2R10G10B10 };
+
+ foreach (AdapterInformation adapter in GraphicsDeviceManager.Direct3D9Object.Adapters) //
+ {
+ AdapterInfo9 info = new AdapterInfo9();
+ info.AdapterOrdinal = adapter.Adapter;
+ info.Details = adapter.Details;
+
+ adapterFormats.Clear();
+ foreach (Format adapterFormat in allowedAdapterFormats)
+ {
+ foreach (DisplayMode displayMode in adapter.GetDisplayModes(adapterFormat))
+ {
+ if (MinimumSettings != null)
+ {
+ if (displayMode.Width < MinimumSettings.BackBufferWidth ||
+ displayMode.Height < MinimumSettings.BackBufferHeight ||
+ displayMode.RefreshRate < MinimumSettings.RefreshRate)
+ continue;
+ }
+
+ info.DisplayModes.Add(displayMode);
+
+ if (!adapterFormats.Contains(displayMode.Format))
+ adapterFormats.Add(displayMode.Format);
+ }
+ }
+
+ if (!adapterFormats.Contains(adapter.CurrentDisplayMode.Format))
+ adapterFormats.Add(adapter.CurrentDisplayMode.Format);
+
+ info.DisplayModes.Sort(DisplayModeComparer9.Comparer);
+
+ EnumerateDevices(info, adapterFormats);
+
+ if (info.Devices.Count > 0)
+ Adapters.Add(info);
+ }
+
+ bool unique = true;
+ foreach (AdapterInfo9 adapter1 in Adapters)
+ {
+ foreach (AdapterInfo9 adapter2 in Adapters)
+ {
+ if (adapter1 == adapter2)
+ continue;
+ if (adapter1.Details.Description == adapter2.Details.Description)
+ {
+ unique = false;
+ break;
+ }
+ }
+
+ if (!unique)
+ break;
+ }
+
+ foreach (AdapterInfo9 info in Adapters)
+ {
+ info.Description = info.Details.Description;
+ if (!unique)
+ info.Description += " " + info.AdapterOrdinal.ToString(CultureInfo.CurrentCulture);
+ }
+ }
+
+ static void EnumerateDevices(AdapterInfo9 info, List adapterFormats)
+ {
+ DeviceType[] deviceTypes = { DeviceType.Hardware, DeviceType.Reference };
+
+ foreach (DeviceType deviceType in deviceTypes)
+ {
+ if (MinimumSettings != null && MinimumSettings.DeviceType != deviceType)
+ continue;
+
+ DeviceInfo9 deviceInfo = new DeviceInfo9();
+ deviceInfo.DeviceType = deviceType;
+ try
+ {
+ deviceInfo.Capabilities = GraphicsDeviceManager.Direct3D9Object.GetDeviceCaps(info.AdapterOrdinal, deviceInfo.DeviceType);
+
+ EnumerateSettingsCombos(info, deviceInfo, adapterFormats);
+
+ if (deviceInfo.DeviceSettings.Count > 0)
+ info.Devices.Add(deviceInfo);
+ }
+ catch (Direct3D9Exception)
+ {
+ // #23681 2010.11.17 yyagi: GetDeviceCaps()縺ァ萓句、悶′逋コ逕溘☆繧九Δ繝九ち縺ォ蟇セ縺励※縺ッ縲‘numerate繧偵せ繧ュ繝繝励☆繧九
+ }
+ }
+ }
+
+ static void EnumerateSettingsCombos(AdapterInfo9 adapterInfo, DeviceInfo9 deviceInfo, List adapterFormats)
+ {
+ Format[] backBufferFormats = { Format.A8R8G8B8, Format.X8R8G8B8, Format.A2R10G10B10,
+ Format.R5G6B5, Format.A1R5G5B5, Format.X1R5G5B5 };
+
+ foreach (Format adapterFormat in adapterFormats)
+ {
+ foreach (Format backBufferFormat in backBufferFormats)
+ {
+ for (int windowed = 0; windowed < 2; windowed++)
+ {
+ if (windowed == 0 && adapterInfo.DisplayModes.Count == 0)
+ continue;
+
+ if (!GraphicsDeviceManager.Direct3D9Object.CheckDeviceType(adapterInfo.AdapterOrdinal, deviceInfo.DeviceType,
+ adapterFormat, backBufferFormat, (windowed == 1)))
+ continue;
+
+ if (!GraphicsDeviceManager.Direct3D9Object.CheckDeviceFormat(adapterInfo.AdapterOrdinal,
+ deviceInfo.DeviceType, adapterFormat, Usage.QueryPostPixelShaderBlending,
+ ResourceType.Texture, backBufferFormat))
+ continue;
+
+ SettingsCombo9 combo = new SettingsCombo9();
+ combo.AdapterOrdinal = adapterInfo.AdapterOrdinal;
+ combo.DeviceType = deviceInfo.DeviceType;
+ combo.AdapterFormat = adapterFormat;
+ combo.BackBufferFormat = backBufferFormat;
+ combo.Windowed = (windowed == 1);
+ combo.AdapterInfo = adapterInfo;
+ combo.DeviceInfo = deviceInfo;
+
+ BuildDepthStencilFormatList(combo);
+ BuildMultisampleTypeList(combo);
+
+ if (combo.MultisampleTypes.Count == 0)
+ continue;
+
+ BuildPresentIntervalList(combo);
+
+ if (MinimumSettings != null)
+ {
+ if (MinimumSettings.BackBufferFormat != Format.Unknown &&
+ MinimumSettings.BackBufferFormat != backBufferFormat)
+ continue;
+
+ if (MinimumSettings.DepthStencilFormat != Format.Unknown &&
+ !combo.DepthStencilFormats.Contains(MinimumSettings.DepthStencilFormat))
+ continue;
+
+ if (!combo.MultisampleTypes.Contains(MinimumSettings.MultisampleType))
+ continue;
+ }
+
+ deviceInfo.DeviceSettings.Add(combo);
+ }
+ }
+ }
+ }
+
+ static void BuildDepthStencilFormatList(SettingsCombo9 combo)
+ {
+ List possibleDepthStencilFormats = new List {
+ Format.D16, Format.D15S1, Format.D24X8,
+ Format.D24S8, Format.D24X4S4, Format.D32 };
+
+ foreach (Format format in possibleDepthStencilFormats)
+ {
+ if (GraphicsDeviceManager.Direct3D9Object.CheckDeviceFormat(combo.AdapterOrdinal, combo.DeviceType, combo.AdapterFormat,
+ Usage.DepthStencil, ResourceType.Surface, format) &&
+ GraphicsDeviceManager.Direct3D9Object.CheckDepthStencilMatch(combo.AdapterOrdinal, combo.DeviceType,
+ combo.AdapterFormat, combo.BackBufferFormat, format))
+ combo.DepthStencilFormats.Add(format);
+ }
+ }
+
+ static void BuildMultisampleTypeList(SettingsCombo9 combo)
+ {
+ List possibleMultisampleTypes = new List() {
+ MultisampleType.None, MultisampleType.NonMaskable,
+ MultisampleType.TwoSamples, MultisampleType.ThreeSamples,
+ MultisampleType.FourSamples, MultisampleType.FiveSamples,
+ MultisampleType.SixSamples, MultisampleType.SevenSamples,
+ MultisampleType.EightSamples, MultisampleType.NineSamples,
+ MultisampleType.TenSamples, MultisampleType.ElevenSamples,
+ MultisampleType.TwelveSamples, MultisampleType.ThirteenSamples,
+ MultisampleType.FourteenSamples, MultisampleType.FifteenSamples,
+ MultisampleType.SixteenSamples
+ };
+
+ int quality;
+ foreach (MultisampleType type in possibleMultisampleTypes)
+ {
+ if (GraphicsDeviceManager.Direct3D9Object.CheckDeviceMultisampleType(combo.AdapterOrdinal, combo.DeviceType,
+ combo.AdapterFormat, combo.Windowed, type, out quality))
+ {
+ combo.MultisampleTypes.Add(type);
+ combo.MultisampleQualities.Add(quality);
+ }
+ }
+ }
+
+ static void BuildPresentIntervalList(SettingsCombo9 combo)
+ {
+ List possiblePresentIntervals = new List() {
+ PresentInterval.Immediate, PresentInterval.Default,
+ PresentInterval.One, PresentInterval.Two,
+ PresentInterval.Three, PresentInterval.Four
+ };
+
+ foreach (PresentInterval interval in possiblePresentIntervals)
+ {
+ if (combo.Windowed && (interval == PresentInterval.Two ||
+ interval == PresentInterval.Three || interval == PresentInterval.Four))
+ continue;
+
+ if (interval == PresentInterval.Default ||
+ (combo.DeviceInfo.Capabilities.PresentationIntervals & interval) != 0)
+ combo.PresentIntervals.Add(interval);
+ }
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.Designer.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..eecc3623
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.Designer.cs
@@ -0,0 +1,70 @@
+サソ//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.1434
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace SampleFramework.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleFramework.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ internal static System.Drawing.Icon sdx_icon_black {
+ get {
+ object obj = ResourceManager.GetObject("sdx_icon_black", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.resx b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.resx
new file mode 100644
index 00000000..827822b2
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.resx
@@ -0,0 +1,124 @@
+サソ
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\sdx_icon_black.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCache.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCache.cs
new file mode 100644
index 00000000..3a3dd8fe
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCache.cs
@@ -0,0 +1,200 @@
+サソusing System;
+using System.Drawing;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+namespace SampleFramework
+{
+ public sealed class DeviceCache
+ {
+ private readonly Device _device;
+
+ public DeviceCache(Device device)
+ {
+ _device = device;
+ }
+
+ public Device UnderlyingDevice => _device;
+
+ public void Dispose()
+ {
+ _device.Dispose();
+ }
+
+ public object Tag
+ {
+ get => _device.Tag;
+ set => _device.Tag = value;
+ }
+
+ public Result TestCooperativeLevel()
+ {
+ return _device.TestCooperativeLevel();
+ }
+
+ public Result Reset(PresentParameters presentParameters)
+ {
+ return _device.Reset(presentParameters);
+ }
+
+ public Result Clear(ClearFlags clearFlags, in Color4 color, float zdepth, int stencil)
+ {
+ return _device.Clear(clearFlags, color, zdepth, stencil);
+ }
+
+ public Result BeginScene()
+ {
+ return _device.BeginScene();
+ }
+
+ public Result EndScene()
+ {
+ return _device.EndScene();
+ }
+
+ public Result Present()
+ {
+ return _device.Present();
+ }
+
+ public Surface GetBackBuffer(int swapChain, int backBuffer)
+ {
+ return _device.GetBackBuffer(swapChain, backBuffer);
+ }
+
+ public Surface GetRenderTarget(int index)
+ {
+ return _device.GetRenderTarget(index);
+ }
+
+ public Result SetRenderState(RenderState state, T value) where T : Enum
+ {
+ return _device.SetRenderState(state, value);
+ }
+
+ private BlendOperation? _lastBlendOperation;
+ public void SetRenderState(RenderState state, BlendOperation value)
+ {
+ if (state == RenderState.BlendOperation)
+ {
+ if (_lastBlendOperation == value)
+ {
+ return;
+ }
+
+ _lastBlendOperation = value;
+ }
+
+ _device.SetRenderState(state, value);
+ }
+
+ private Blend? _lastSourceBlend;
+ private Blend? _lastDestinationBlend;
+ public void SetRenderState(RenderState state, Blend value)
+ {
+ if (state == RenderState.SourceBlend)
+ {
+ if (_lastSourceBlend == value)
+ {
+ return;
+ }
+
+ _lastSourceBlend = value;
+ }
+ else if (state == RenderState.DestinationBlend)
+ {
+ if (_lastDestinationBlend == value)
+ {
+ return;
+ }
+
+ _lastDestinationBlend = value;
+ }
+
+ _device.SetRenderState(state, value);
+ }
+
+ public Result SetRenderState(RenderState state, bool value)
+ {
+ return _device.SetRenderState(state, value);
+ }
+
+ public Result SetRenderState(RenderState state, int value)
+ {
+ return _device.SetRenderState(state, value);
+ }
+
+ public Result SetTextureStageState(int stage, TextureStage type, TextureOperation textureOperation)
+ {
+ return _device.SetTextureStageState(stage, type, textureOperation);
+ }
+
+ public Result SetTextureStageState(int stage, TextureStage type, int value)
+ {
+ return _device.SetTextureStageState(stage, type, value);
+ }
+
+ public Result SetSamplerState(int sampler, SamplerState type, TextureFilter textureFilter)
+ {
+ return _device.SetSamplerState(sampler, type, textureFilter);
+ }
+
+ public Result SetTransform(TransformState state, in Matrix value)
+ {
+ return _device.SetTransform(state, value);
+ }
+
+ private int? _lastSetTextureSampler;
+ private object _lastSetTextureTexture;
+ public void SetTexture(int sampler, BaseTexture texture)
+ {
+ if ( ReferenceEquals(_lastSetTextureTexture, texture) && _lastSetTextureSampler == sampler)
+ {
+ return;
+ }
+
+ _lastSetTextureSampler = sampler;
+ _lastSetTextureTexture = texture;
+ _device.SetTexture(sampler, texture);
+ }
+
+ public Result SetRenderTarget(int targetIndex, Surface target)
+ {
+ return _device.SetRenderTarget(targetIndex, target);
+ }
+
+ public Result DrawUserPrimitives(PrimitiveType primitiveType, int startIndex, int primitiveCount, in T[] data) where T : struct//, new()
+ {
+ return _device.DrawUserPrimitives(primitiveType, startIndex, primitiveCount, data);
+ }
+
+ public Result DrawUserPrimitives(PrimitiveType primitiveType, int primitiveCount, in T[] data) where T : struct//, new()
+ {
+ return _device.DrawUserPrimitives(primitiveType, primitiveCount, data);
+ }
+
+ public Result StretchRectangle(Surface source, Surface destination, TextureFilter filter)
+ {
+ return _device.StretchRectangle(source, destination, filter);
+ }
+
+ public Result UpdateSurface(Surface source, in Rectangle sourceRectangle, Surface destination, in Point destinationPoint)
+ {
+ return _device.UpdateSurface(source, sourceRectangle, destination, destinationPoint);
+ }
+
+ public Viewport Viewport
+ {
+ get => _device.Viewport;
+ set => _device.Viewport = value;
+ }
+
+ public VertexFormat VertexFormat
+ {
+ get => _device.VertexFormat;
+ set => _device.VertexFormat = value;
+ }
+
+ public Capabilities Capabilities => _device.Capabilities;
+ }
+}
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCreationException.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCreationException.cs
new file mode 100644
index 00000000..c6104b80
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCreationException.cs
@@ -0,0 +1,71 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Runtime.Serialization;
+
+namespace SampleFramework
+{
+ ///
+ /// Thrown when a graphics device cannot be created.
+ ///
+ [Serializable]
+ public class DeviceCreationException : Exception
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DeviceCreationException()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The message.
+ public DeviceCreationException(string message)
+ : base(message)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The message.
+ /// The inner exception.
+ public DeviceCreationException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The that holds the serialized object data about the exception being thrown.
+ /// The that contains contextual information about the source or destination.
+ /// The parameter is null.
+ /// The class name is null or is zero (0).
+ protected DeviceCreationException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Direct3D9Manager.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Direct3D9Manager.cs
new file mode 100644
index 00000000..f7cf7b85
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Direct3D9Manager.cs
@@ -0,0 +1,219 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+namespace SampleFramework
+{
+ ///
+ /// Manages aspects of the graphics device unique to Direct3D9.
+ ///
+ public class Direct3D9Manager
+ {
+ GraphicsDeviceManager manager;
+
+ ///
+ /// Gets the graphics device.
+ ///
+ /// The graphics device.
+#if TEST_Direct3D9Ex
+ public DeviceEx Device //yyagi
+#else
+ public DeviceCache Device
+#endif
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The parent manager.
+ internal Direct3D9Manager(GraphicsDeviceManager manager)
+ {
+ this.manager = manager;
+ }
+
+ ///
+ /// Creates a vertex declaration using the specified vertex type.
+ ///
+ /// Type of the vertex.
+ /// The vertex declaration for the specified vertex type.
+ [EnvironmentPermission(SecurityAction.LinkDemand)]
+ public VertexDeclaration CreateVertexDeclaration(Type vertexType)
+ {
+ // ensure that we have a value type
+ if (!vertexType.IsValueType)
+ throw new InvalidOperationException("Vertex types must be value types.");
+
+ // grab the list of elements in the vertex
+ List objectAttributes = new List();
+ FieldInfo[] fields = vertexType.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
+ foreach (FieldInfo field in fields)
+ {
+ // check for the custom attribute
+ VertexElementAttribute[] attributes = (VertexElementAttribute[])field.GetCustomAttributes(typeof(VertexElementAttribute), false);
+ if (field.Name.Contains("<") && field.Name.Contains(">"))
+ {
+ // look up the property matching this field to see if it has the attribute
+ int index1 = field.Name.IndexOf('<');
+ int index2 = field.Name.IndexOf('>');
+
+ // parse out the name
+ string propertyName = field.Name.Substring(index1 + 1, index2 - index1 - 1);
+ PropertyInfo property = vertexType.GetProperty(propertyName, field.FieldType);
+ if (property != null)
+ attributes = (VertexElementAttribute[])property.GetCustomAttributes(typeof(VertexElementAttribute), false);
+ }
+ if (attributes.Length == 1)
+ {
+ // add the attribute to the list
+ attributes[0].Offset = Marshal.OffsetOf(vertexType, field.Name).ToInt32();
+ objectAttributes.Add(attributes[0]);
+ }
+ }
+
+ // make sure we have at least one element
+ if (objectAttributes.Count < 1)
+ throw new InvalidOperationException("The vertex type must have at least one field or property marked with the VertexElement attribute.");
+
+ // loop through the attributes and start building vertex elements
+ List elements = new List();
+ Dictionary usages = new Dictionary();
+ foreach (VertexElementAttribute attribute in objectAttributes)
+ {
+ // check the current usage index
+ if (!usages.ContainsKey(attribute.Usage))
+ usages.Add(attribute.Usage, 0);
+
+ // advance the current usage count
+ int index = usages[attribute.Usage];
+ usages[attribute.Usage]++;
+
+ // create the element
+ elements.Add(new VertexElement((short)attribute.Stream, (short)attribute.Offset, attribute.Type,
+ attribute.Method, attribute.Usage, (byte)index));
+ }
+
+ elements.Add(VertexElement.VertexDeclarationEnd);
+ return new VertexDeclaration(Device.UnderlyingDevice, elements.ToArray());
+ }
+
+ ///
+ /// Creates a render target surface that is compatible with the current device settings.
+ ///
+ /// The width of the surface.
+ /// The height of the surface.
+ /// The newly created render target surface.
+ public Texture CreateRenderTarget(int width, int height)
+ {
+ return new Texture(Device.UnderlyingDevice, width, height, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default);
+ }
+
+ ///
+ /// Creates a resolve target for capturing the back buffer.
+ ///
+ /// The newly created resolve target.
+ public Texture CreateResolveTarget()
+ {
+ return new Texture(Device.UnderlyingDevice, manager.ScreenWidth, manager.ScreenHeight, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default);
+ }
+
+ ///
+ /// Resolves the current back buffer into a texture.
+ ///
+ /// The target texture.
+ /// Thrown when the resolve process fails.
+ public void ResolveBackBuffer(Texture target)
+ {
+ ResolveBackBuffer(target, 0);
+ }
+
+ ///
+ /// Resolves the current back buffer into a texture.
+ ///
+ /// The target texture.
+ /// The index of the back buffer.
+ /// Thrown when the resolve process fails.
+ public void ResolveBackBuffer(Texture target, int backBufferIndex)
+ {
+ // disable exceptions for this method
+ bool storedThrow = Configuration.ThrowOnError;
+ Configuration.ThrowOnError = false;
+ Surface destination = null;
+
+ try
+ {
+ // grab the current back buffer
+ Surface backBuffer = Device.GetBackBuffer(0, backBufferIndex);
+ if (backBuffer == null || Result.Last.IsFailure)
+ throw new InvalidOperationException("Could not obtain back buffer surface.");
+
+ // grab the destination surface
+ destination = target.GetSurfaceLevel(0);
+ if (destination == null || Result.Last.IsFailure)
+ throw new InvalidOperationException("Could not obtain resolve target surface.");
+
+ // first try to copy using linear filtering
+ if (Device.StretchRectangle(backBuffer, destination, TextureFilter.Linear).IsFailure)
+ {
+ // that failed, so try with no filtering
+ if (Device.StretchRectangle(backBuffer, destination, TextureFilter.None).IsFailure)
+ {
+ // that failed as well, so the last thing we can try is a load surface call
+ if (Surface.FromSurface(destination, backBuffer, Filter.Default, 0).IsFailure)
+ throw new InvalidOperationException("Could not copy surfaces.");
+ }
+ }
+ }
+ finally
+ {
+ if (destination != null)
+ destination.Dispose();
+ Configuration.ThrowOnError = storedThrow;
+ }
+ }
+
+ ///
+ /// Resets the render target.
+ ///
+ public void ResetRenderTarget()
+ {
+ Surface backBuffer = Device.GetBackBuffer(0, 0);
+
+ try
+ {
+ Device.SetRenderTarget(0, backBuffer);
+ }
+ finally
+ {
+ backBuffer.Dispose();
+ }
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Enums.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Enums.cs
new file mode 100644
index 00000000..2e6e35df
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Enums.cs
@@ -0,0 +1,25 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
+namespace SampleFramework
+{
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/GraphicsDeviceManager.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/GraphicsDeviceManager.cs
new file mode 100644
index 00000000..55dc16bc
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/GraphicsDeviceManager.cs
@@ -0,0 +1,701 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+using SlimDX;
+using SlimDX.Direct3D9;
+using SlimDX.DXGI;
+using System.Diagnostics;
+
+namespace SampleFramework
+{
+ ///
+ /// Handles the configuration and management of the graphics device.
+ ///
+ public class GraphicsDeviceManager : IDisposable
+ {
+ Game game;
+ bool ignoreSizeChanges;
+ bool deviceLost;
+// bool doNotStoreBufferSize;
+// bool renderingOccluded;
+
+ int fullscreenWindowWidth;
+ int fullscreenWindowHeight;
+ int windowedWindowWidth;
+ int windowedWindowHeight;
+ WINDOWPLACEMENT windowedPlacement;
+ long windowedStyle;
+ bool savedTopmost;
+
+#if TEST_Direct3D9Ex
+ internal static Direct3DEx Direct3D9Object // yyagi
+#else
+ internal static Direct3D Direct3D9Object
+#endif
+ {
+ get;
+ private set;
+ }
+
+ public DeviceSettings CurrentSettings
+ {
+ get;
+ private set;
+ }
+ public bool IsWindowed
+ {
+ get { return CurrentSettings.Windowed; }
+ }
+ public int ScreenWidth
+ {
+ get { return CurrentSettings.BackBufferWidth; }
+ }
+ public int ScreenHeight
+ {
+ get { return CurrentSettings.BackBufferHeight; }
+ }
+ public Size ScreenSize
+ {
+ get { return new Size(CurrentSettings.BackBufferWidth, CurrentSettings.BackBufferHeight); }
+ }
+ public Direct3D9Manager Direct3D9
+ {
+ get;
+ private set;
+ }
+ public string DeviceStatistics
+ {
+ get;
+ private set;
+ }
+ public string DeviceInformation
+ {
+ get;
+ private set;
+ }
+
+ public GraphicsDeviceManager( Game game )
+ {
+ if( game == null )
+ throw new ArgumentNullException( "game" );
+
+ this.game = game;
+
+ game.Window.ScreenChanged += Window_ScreenChanged;
+ game.Window.UserResized += Window_UserResized;
+
+ game.FrameStart += game_FrameStart;
+ game.FrameEnd += game_FrameEnd;
+
+ Direct3D9 = new Direct3D9Manager( this );
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ public void ChangeDevice( DeviceSettings settings, DeviceSettings minimumSettings )
+ {
+ if( settings == null )
+ throw new ArgumentNullException( "settings" );
+
+ Enumeration9.MinimumSettings = minimumSettings;
+
+ DeviceSettings validSettings = DeviceSettings.FindValidSettings( settings );
+
+ validSettings.Direct3D9.PresentParameters.DeviceWindowHandle = game.Window.Handle;
+
+ CreateDevice( validSettings );
+ }
+ public void ChangeDevice(bool windowed, int desiredWidth, int desiredHeight)
+ {
+ DeviceSettings desiredSettings = new DeviceSettings();
+ desiredSettings.Windowed = windowed;
+ desiredSettings.BackBufferWidth = desiredWidth;
+ desiredSettings.BackBufferHeight = desiredHeight;
+
+ ChangeDevice(desiredSettings, null);
+ }
+ public void ChangeDevice(DeviceSettings settings)
+ {
+ ChangeDevice(settings, null);
+ }
+
+ public void ToggleFullScreen()
+ {
+ if (!EnsureDevice())
+ throw new InvalidOperationException("No valid device.");
+
+ DeviceSettings newSettings = CurrentSettings.Clone();
+
+ newSettings.Windowed = !newSettings.Windowed;
+
+ int width = newSettings.Windowed ? windowedWindowWidth : fullscreenWindowWidth;
+ int height = newSettings.Windowed ? windowedWindowHeight : fullscreenWindowHeight;
+
+ newSettings.BackBufferWidth = width;
+ newSettings.BackBufferHeight = height;
+
+ ChangeDevice(newSettings);
+ }
+ public bool EnsureDevice()
+ {
+ if (Direct3D9.Device != null && !deviceLost)
+ return true;
+
+ return false;
+ }
+
+ protected virtual void Dispose( bool disposing )
+ {
+ if( this.bDisposed )
+ return;
+ this.bDisposed = true;
+
+ if( disposing )
+ ReleaseDevice();
+
+ }
+ private bool bDisposed = false;
+
+ void CreateDevice(DeviceSettings settings)
+ {
+ DeviceSettings oldSettings = CurrentSettings;
+ CurrentSettings = settings;
+
+ ignoreSizeChanges = true;
+
+ bool keepCurrentWindowSize = false;
+ if (settings.BackBufferWidth == 0 && settings.BackBufferHeight == 0)
+ keepCurrentWindowSize = true;
+
+ // handle the window state in Direct3D9 (it will be handled for us in DXGI)
+ // check if we are going to windowed or fullscreen mode
+ if( settings.Windowed )
+ {
+ if( oldSettings != null && !oldSettings.Windowed )
+ NativeMethods.SetWindowLong( game.Window.Handle, WindowConstants.GWL_STYLE, (uint) windowedStyle );
+ }
+ else
+ {
+ if( oldSettings == null || oldSettings.Windowed )
+ {
+ savedTopmost = game.Window.TopMost;
+ long style = NativeMethods.GetWindowLong( game.Window.Handle, WindowConstants.GWL_STYLE );
+ style &= ~WindowConstants.WS_MAXIMIZE & ~WindowConstants.WS_MINIMIZE;
+ windowedStyle = style;
+
+ windowedPlacement = new WINDOWPLACEMENT();
+ windowedPlacement.length = WINDOWPLACEMENT.Length;
+ NativeMethods.GetWindowPlacement( game.Window.Handle, ref windowedPlacement );
+ }
+
+ // hide the window until we are done messing with it
+ game.Window.Hide();
+ NativeMethods.SetWindowLong( game.Window.Handle, WindowConstants.GWL_STYLE, (uint) ( WindowConstants.WS_POPUP | WindowConstants.WS_SYSMENU ) );
+
+ WINDOWPLACEMENT placement = new WINDOWPLACEMENT();
+ placement.length = WINDOWPLACEMENT.Length;
+ NativeMethods.GetWindowPlacement( game.Window.Handle, ref placement );
+
+ // check if we are in the middle of a restore
+ if( ( placement.flags & WindowConstants.WPF_RESTORETOMAXIMIZED ) != 0 )
+ {
+ // update the flags to avoid sizing issues
+ placement.flags &= ~WindowConstants.WPF_RESTORETOMAXIMIZED;
+ placement.showCmd = WindowConstants.SW_RESTORE;
+ NativeMethods.SetWindowPlacement( game.Window.Handle, ref placement );
+ }
+ }
+
+ if (settings.Windowed)
+ {
+ if (oldSettings != null && !oldSettings.Windowed)
+ {
+ fullscreenWindowWidth = oldSettings.BackBufferWidth;
+ fullscreenWindowHeight = oldSettings.BackBufferHeight;
+ }
+ }
+ else
+ {
+ if (oldSettings != null && oldSettings.Windowed)
+ {
+ windowedWindowWidth = oldSettings.BackBufferWidth;
+ windowedWindowHeight = oldSettings.BackBufferHeight;
+ }
+ }
+
+ // check if the device can be reset, or if we need to completely recreate it
+ Result result = SlimDX.Direct3D9.ResultCode.Success;
+ bool canReset = CanDeviceBeReset(oldSettings, settings);
+ if (canReset)
+ result = ResetDevice();
+
+ if (result == SlimDX.Direct3D9.ResultCode.DeviceLost)
+ deviceLost = true;
+ else if (!canReset || result.IsFailure)
+ {
+ if (oldSettings != null)
+ ReleaseDevice();
+
+ InitializeDevice();
+ }
+
+ UpdateDeviceInformation();
+
+ // check if we changed from fullscreen to windowed mode
+ if (oldSettings != null && !oldSettings.Windowed && settings.Windowed)
+ {
+ NativeMethods.SetWindowPlacement(game.Window.Handle, ref windowedPlacement);
+ game.Window.TopMost = savedTopmost;
+ }
+
+ // check if we need to resize
+ if (settings.Windowed && !keepCurrentWindowSize)
+ {
+ int width;
+ int height;
+ if (NativeMethods.IsIconic(game.Window.Handle))
+ {
+ WINDOWPLACEMENT placement = new WINDOWPLACEMENT();
+ placement.length = WINDOWPLACEMENT.Length;
+ NativeMethods.GetWindowPlacement(game.Window.Handle, ref placement);
+
+ // check if we are being restored
+ if ((placement.flags & WindowConstants.WPF_RESTORETOMAXIMIZED) != 0 && placement.showCmd == WindowConstants.SW_SHOWMINIMIZED)
+ {
+ NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_RESTORE);
+
+ Rectangle rect = NativeMethods.GetClientRectangle(game.Window.Handle);
+
+ width = rect.Width;
+ height = rect.Height;
+ NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_MINIMIZE);
+ }
+ else
+ {
+ NativeRectangle frame = new NativeRectangle();
+ NativeMethods.AdjustWindowRect(ref frame, (uint)windowedStyle, false);
+ int frameWidth = frame.right - frame.left;
+ int frameHeight = frame.bottom - frame.top;
+
+ width = placement.rcNormalPosition.right - placement.rcNormalPosition.left - frameWidth;
+ height = placement.rcNormalPosition.bottom - placement.rcNormalPosition.top - frameHeight;
+ }
+ }
+ else
+ {
+ Rectangle rect = NativeMethods.GetClientRectangle(game.Window.Handle);
+ width = rect.Width;
+ height = rect.Height;
+ }
+
+ // check if we have a different desired size
+ if (width != settings.BackBufferWidth ||
+ height != settings.BackBufferHeight)
+ {
+ if (NativeMethods.IsIconic(game.Window.Handle))
+ NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_RESTORE);
+ if (NativeMethods.IsZoomed(game.Window.Handle))
+ NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_RESTORE);
+
+ NativeRectangle rect = new NativeRectangle();
+ rect.right = settings.BackBufferWidth;
+ rect.bottom = settings.BackBufferHeight;
+ NativeMethods.AdjustWindowRect(ref rect,
+ NativeMethods.GetWindowLong(game.Window.Handle, WindowConstants.GWL_STYLE), false);
+
+ NativeMethods.SetWindowPos(game.Window.Handle, IntPtr.Zero, 0, 0, rect.right - rect.left,
+ rect.bottom - rect.top, WindowConstants.SWP_NOZORDER | WindowConstants.SWP_NOMOVE);
+
+ Rectangle r = NativeMethods.GetClientRectangle(game.Window.Handle);
+ int clientWidth = r.Width;
+ int clientHeight = r.Height;
+
+ // check if the size was modified by Windows
+ if (clientWidth != settings.BackBufferWidth ||
+ clientHeight != settings.BackBufferHeight)
+ {
+ DeviceSettings newSettings = CurrentSettings.Clone();
+ newSettings.BackBufferWidth = 0;
+ newSettings.BackBufferHeight = 0;
+ if (newSettings.Direct3D9 != null)
+ {
+ newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize
+ newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize
+ }
+
+ CreateDevice(newSettings);
+ }
+ }
+ }
+
+ // if the window is still hidden, make sure it is shown
+ if (!game.Window.Visible)
+ NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_SHOW);
+
+ // set the execution state of the thread
+ if (!IsWindowed)
+ NativeMethods.SetThreadExecutionState(WindowConstants.ES_DISPLAY_REQUIRED | WindowConstants.ES_CONTINUOUS);
+ else
+ NativeMethods.SetThreadExecutionState(WindowConstants.ES_CONTINUOUS);
+
+ ignoreSizeChanges = false;
+ }
+
+ void Window_UserResized( object sender, EventArgs e )
+ {
+ if( ignoreSizeChanges || !EnsureDevice() || ( !IsWindowed ) )
+ return;
+
+ DeviceSettings newSettings = CurrentSettings.Clone();
+
+ Rectangle rect = NativeMethods.GetClientRectangle( game.Window.Handle );
+ if( rect.Width != newSettings.BackBufferWidth || rect.Height != newSettings.BackBufferHeight )
+ {
+ newSettings.BackBufferWidth = 0;
+ newSettings.BackBufferHeight = 0;
+ newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize
+ newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; //
+ CreateDevice( newSettings );
+ }
+ }
+ void Window_ScreenChanged( object sender, EventArgs e )
+ {
+ if( !EnsureDevice() || !CurrentSettings.Windowed || ignoreSizeChanges )
+ return;
+
+ IntPtr windowMonitor = NativeMethods.MonitorFromWindow( game.Window.Handle, WindowConstants.MONITOR_DEFAULTTOPRIMARY );
+
+ DeviceSettings newSettings = CurrentSettings.Clone();
+ int adapterOrdinal = GetAdapterOrdinal( windowMonitor );
+ if( adapterOrdinal == -1 )
+ return;
+ newSettings.Direct3D9.AdapterOrdinal = adapterOrdinal;
+
+ newSettings.BackBufferWidth = 0; // #23510 2010.11.1 add yyagi to avoid to reset to 640x480 for the first time in XP.
+ newSettings.BackBufferHeight = 0; //
+ newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; //
+ newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; //
+
+ CreateDevice(newSettings);
+ }
+
+ void game_FrameEnd( object sender, EventArgs e )
+ {
+ Result result = SlimDX.Direct3D9.ResultCode.Success;
+ try
+ {
+ result = Direct3D9.Device.Present();
+ }
+ catch (Direct3D9Exception) // #23842 2011.1.6 yyagi: catch D3D9Exception to avoid unexpected termination by changing VSyncWait in fullscreen.
+ {
+ deviceLost = true;
+ }
+ if( result == SlimDX.Direct3D9.ResultCode.DeviceLost )
+ deviceLost = true;
+ }
+ void game_FrameStart(object sender, CancelEventArgs e)
+ {
+ if (Direct3D9.Device == null )
+ {
+ e.Cancel = true;
+ return;
+ }
+
+// if (!game.IsActive || deviceLost) // #23568 2010.11.3 yyagi: separate conditions to support valiable sleep value when !IsActive.
+ if (deviceLost)
+ Thread.Sleep(50);
+ else if (!game.IsActive && !this.CurrentSettings.EnableVSync) // #23568 2010.11.4 yyagi: Don't add sleep() while VSync is enabled.
+ Thread.Sleep(this.game.InactiveSleepTime.Milliseconds);
+
+ if (deviceLost)
+ {
+ Result result = Direct3D9.Device.TestCooperativeLevel();
+ if (result == SlimDX.Direct3D9.ResultCode.DeviceLost)
+ {
+ e.Cancel = true;
+ return;
+ }
+
+ // if we are windowed, check the adapter format to see if the user
+ // changed the desktop format, causing a lost device
+ if (IsWindowed)
+ {
+ DisplayMode displayMode = GraphicsDeviceManager.Direct3D9Object.GetAdapterDisplayMode(CurrentSettings.Direct3D9.AdapterOrdinal);
+ if (CurrentSettings.Direct3D9.AdapterFormat != displayMode.Format)
+ {
+ DeviceSettings newSettings = CurrentSettings.Clone();
+ ChangeDevice(newSettings);
+ e.Cancel = true;
+ return;
+ }
+ }
+
+ result = ResetDevice();
+ if (result.IsFailure)
+ {
+ e.Cancel = true;
+ return;
+ }
+ }
+
+ deviceLost = false;
+ }
+
+ bool CanDeviceBeReset( DeviceSettings oldSettings, DeviceSettings newSettings )
+ {
+ if( oldSettings == null )
+ return false;
+
+ return Direct3D9.Device != null &&
+ oldSettings.Direct3D9.AdapterOrdinal == newSettings.Direct3D9.AdapterOrdinal &&
+ oldSettings.Direct3D9.DeviceType == newSettings.Direct3D9.DeviceType &&
+ oldSettings.Direct3D9.CreationFlags == newSettings.Direct3D9.CreationFlags;
+ }
+
+ void InitializeDevice()
+ {
+ try
+ {
+ EnsureD3D9();
+
+#if TEST_Direct3D9Ex
+ // 2011.4.26 yyagi
+ // Direct3D9.DeviceEx繧貞他縺カ髫(IDirect3D9Ex::CreateDeviceEx繧貞他縺カ髫)縲
+ // 繝輔Ν繧ケ繧ッ繝ェ繝シ繝ウ繝「繝シ繝峨〒蛻晄悄蛹悶☆繧句エ蜷医ッDisplayModeEx(D3DDISPLAYMODEEX *pFullscreenDisplayMode)縺ォ
+ // 驕ゥ蛻縺ェ蛟、繧定ィュ螳壹☆繧句ソ隕√≠繧翫
+ // 荳譁ケ縲√え繧、繝ウ繝峨え繝「繝シ繝峨〒蛻晄悄蛹悶☆繧句エ蜷医ッ縲.3DDISPLAYMODEEX繧誰ULL縺ォ縺吶k蠢隕√′縺ゅk縺後
+ // DisplayModeEx縺君ULL荳榊庄縺ィ螳夂セゥ縺輔l縺ヲ縺繧九◆繧√.eviceEx縺ョoverload縺ョ荳ュ縺ァDisplayModeEx繧貞シ墓焚縺ォ蜿悶i縺ェ縺繧ゅョ繧
+ // 菴ソ縺縲(DeviceEx蛛エ縺ァD3DDISPLAYMODEEX繧誰ULL縺ォ縺励※縺上l繧)
+ // 邨仙ア縲.eviceEx縺ョ蜻シ縺ウ蜃コ縺励ョ髫帙↓縲√ヵ繝ォ繧ケ繧ッ繝ェ繝シ繝ウ縺九←縺縺九〒蝣エ蜷亥縺代′蠢隕√→縺ェ繧九
+ if ( CurrentSettings.Direct3D9.PresentParameters.Windowed == false )
+ {
+ DisplayModeEx fullScreenDisplayMode = new DisplayModeEx();
+ fullScreenDisplayMode.Width = CurrentSettings.Direct3D9.PresentParameters.BackBufferWidth;
+ fullScreenDisplayMode.Height = CurrentSettings.Direct3D9.PresentParameters.BackBufferHeight;
+ fullScreenDisplayMode.RefreshRate = CurrentSettings.Direct3D9.PresentParameters.FullScreenRefreshRateInHertz;
+ fullScreenDisplayMode.Format = CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat;
+
+ Direct3D9.Device = new SlimDX.Direct3D9.DeviceEx( Direct3D9Object, CurrentSettings.Direct3D9.AdapterOrdinal,
+ CurrentSettings.Direct3D9.DeviceType, game.Window.Handle,
+ CurrentSettings.Direct3D9.CreationFlags, CurrentSettings.Direct3D9.PresentParameters, fullScreenDisplayMode );
+ }
+ else
+ {
+ Direct3D9.Device = new SlimDX.Direct3D9.DeviceEx( Direct3D9Object, CurrentSettings.Direct3D9.AdapterOrdinal,
+ CurrentSettings.Direct3D9.DeviceType, game.Window.Handle,
+ CurrentSettings.Direct3D9.CreationFlags, CurrentSettings.Direct3D9.PresentParameters );
+ }
+ Direct3D9.Device.MaximumFrameLatency = 1;
+#else
+ Direct3D9.Device = new DeviceCache( new SlimDX.Direct3D9.Device( Direct3D9Object, CurrentSettings.Direct3D9.AdapterOrdinal,
+ CurrentSettings.Direct3D9.DeviceType, game.Window.Handle,
+ CurrentSettings.Direct3D9.CreationFlags, CurrentSettings.Direct3D9.PresentParameters ) );
+#endif
+ if ( Result.Last == SlimDX.Direct3D9.ResultCode.DeviceLost )
+ {
+ deviceLost = true;
+ return;
+ }
+#if TEST_Direct3D9Ex
+ Direct3D9.Device.MaximumFrameLatency = 1; // yyagi
+#endif
+ }
+ catch( Exception e )
+ {
+ throw new DeviceCreationException( "Could not create graphics device.", e );
+ }
+
+ PropogateSettings();
+
+ UpdateDeviceStats();
+
+ game.Initialize();
+ game.LoadContent();
+ }
+
+ Result ResetDevice()
+ {
+ game.UnloadContent();
+
+ Result result = Direct3D9.Device.Reset( CurrentSettings.Direct3D9.PresentParameters );
+ if( result == SlimDX.Direct3D9.ResultCode.DeviceLost )
+ return result;
+
+ PropogateSettings();
+ UpdateDeviceStats();
+ game.LoadContent();
+
+ return Result.Last;
+ }
+
+ void ReleaseDevice()
+ {
+ ReleaseDevice9();
+ }
+ void ReleaseDevice9()
+ {
+ if (Direct3D9.Device == null)
+ return;
+
+ if (game != null)
+ {
+ game.UnloadContent();
+ game.Dispose(true);
+ }
+
+ try
+ {
+ Direct3D9.Device.Dispose();
+ }
+ catch( ObjectDisposedException e )
+ {
+ // 譎ゅ逋コ逕溘☆繧九ョ縺ァ繧ュ繝」繝繝√@縺ヲ縺翫¥縲
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (fc0b6e70-181e-410f-b47f-5490ca4ce0c3)" );
+ }
+ Direct3D9Object.Dispose();
+
+ Direct3D9Object = null;
+ Direct3D9.Device = null;
+ }
+ void PropogateSettings()
+ {
+ CurrentSettings.BackBufferCount = CurrentSettings.Direct3D9.PresentParameters.BackBufferCount;
+ CurrentSettings.BackBufferWidth = CurrentSettings.Direct3D9.PresentParameters.BackBufferWidth;
+ CurrentSettings.BackBufferHeight = CurrentSettings.Direct3D9.PresentParameters.BackBufferHeight;
+ CurrentSettings.BackBufferFormat = CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat;
+ CurrentSettings.DepthStencilFormat = CurrentSettings.Direct3D9.PresentParameters.AutoDepthStencilFormat;
+ CurrentSettings.DeviceType = CurrentSettings.Direct3D9.DeviceType;
+ CurrentSettings.MultisampleQuality = CurrentSettings.Direct3D9.PresentParameters.MultisampleQuality;
+ CurrentSettings.MultisampleType = CurrentSettings.Direct3D9.PresentParameters.Multisample;
+ CurrentSettings.RefreshRate = CurrentSettings.Direct3D9.PresentParameters.FullScreenRefreshRateInHertz;
+ CurrentSettings.Windowed = CurrentSettings.Direct3D9.PresentParameters.Windowed;
+ }
+
+ void UpdateDeviceInformation()
+ {
+ StringBuilder builder = new StringBuilder();
+
+ if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware )
+ builder.Append( "HAL" );
+ else if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Reference )
+ builder.Append( "REF" );
+ else if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Software )
+ builder.Append( "SW" );
+
+ if( ( CurrentSettings.Direct3D9.CreationFlags & CreateFlags.HardwareVertexProcessing ) != 0 )
+ if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware )
+ builder.Append( " (hw vp)" );
+ else
+ builder.Append( " (simulated hw vp)" );
+ else if( ( CurrentSettings.Direct3D9.CreationFlags & CreateFlags.MixedVertexProcessing ) != 0 )
+ if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware )
+ builder.Append( " (mixed vp)" );
+ else
+ builder.Append( " (simulated mixed vp)" );
+ else
+ builder.Append( " (sw vp)" );
+
+ if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware )
+ {
+ // loop through each adapter until we find the right one
+ foreach( AdapterInfo9 adapterInfo in Enumeration9.Adapters )
+ {
+ if( adapterInfo.AdapterOrdinal == CurrentSettings.Direct3D9.AdapterOrdinal )
+ {
+ builder.AppendFormat( ": {0}", adapterInfo.Description );
+ break;
+ }
+ }
+ }
+
+ DeviceInformation = builder.ToString();
+ }
+
+ void UpdateDeviceStats()
+ {
+ StringBuilder builder = new StringBuilder();
+
+ builder.Append( "D3D9 Vsync " );
+
+ if( CurrentSettings.Direct3D9.PresentParameters.PresentationInterval == PresentInterval.Immediate )
+ builder.Append( "off" );
+ else
+ builder.Append( "on" );
+
+ builder.AppendFormat( " ({0}x{1}), ", CurrentSettings.Direct3D9.PresentParameters.BackBufferWidth, CurrentSettings.Direct3D9.PresentParameters.BackBufferHeight );
+
+ if( CurrentSettings.Direct3D9.AdapterFormat == CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat )
+ builder.Append( Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.AdapterFormat ) );
+ else
+ builder.AppendFormat( "backbuf {0}, adapter {1}",
+ Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.AdapterFormat ),
+ Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat ) );
+
+ builder.AppendFormat( " ({0})", Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.PresentParameters.AutoDepthStencilFormat ) );
+
+ if( CurrentSettings.Direct3D9.PresentParameters.Multisample == MultisampleType.NonMaskable )
+ builder.Append( " (Nonmaskable Multisample)" );
+ else if( CurrentSettings.Direct3D9.PresentParameters.Multisample != MultisampleType.None )
+ builder.AppendFormat( " ({0}x Multisample)", (int) CurrentSettings.Direct3D9.PresentParameters.Multisample );
+
+ DeviceStatistics = builder.ToString();
+ }
+
+ int GetAdapterOrdinal( IntPtr screen )
+ {
+ AdapterInfo9 adapter = null;
+ foreach( AdapterInfo9 a in Enumeration9.Adapters )
+ {
+ if( Direct3D9Object.GetAdapterMonitor( a.AdapterOrdinal ) == screen )
+ {
+ adapter = a;
+ break;
+ }
+ }
+
+ if( adapter != null )
+ return adapter.AdapterOrdinal;
+
+ return -1;
+ }
+
+ internal static void EnsureD3D9()
+ {
+ if ( Direct3D9Object == null )
+#if TEST_Direct3D9Ex
+ Direct3D9Object = new Direct3DEx(); // yyagi
+#else
+ Direct3D9Object = new Direct3D();
+#endif
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/NoCompatibleDevicesException.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/NoCompatibleDevicesException.cs
new file mode 100644
index 00000000..0bb45d00
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/NoCompatibleDevicesException.cs
@@ -0,0 +1,71 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Runtime.Serialization;
+
+namespace SampleFramework
+{
+ ///
+ /// Thrown when no available graphics device fits the given device preferences.
+ ///
+ [Serializable]
+ public class NoCompatibleDevicesException : Exception
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public NoCompatibleDevicesException()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The message.
+ public NoCompatibleDevicesException(string message)
+ : base(message)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The message.
+ /// The inner exception.
+ public NoCompatibleDevicesException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The that holds the serialized object data about the exception being thrown.
+ /// The that contains contextual information about the source or destination.
+ /// The parameter is null.
+ /// The class name is null or is zero (0).
+ protected NoCompatibleDevicesException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/VertexElementAttribute.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/VertexElementAttribute.cs
new file mode 100644
index 00000000..cd598321
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/VertexElementAttribute.cs
@@ -0,0 +1,94 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using SlimDX.Direct3D9;
+
+namespace SampleFramework
+{
+ ///
+ /// Indicates that the target code element is part of a vertex declaration.
+ ///
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
+ public sealed class VertexElementAttribute : Attribute
+ {
+ ///
+ /// Gets or sets the stream index.
+ ///
+ /// The stream index.
+ public int Stream
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the tessellation method.
+ ///
+ /// The tessellation method.
+ public DeclarationMethod Method
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the element usage.
+ ///
+ /// The element usage.
+ public DeclarationUsage Usage
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets or sets the type of the data.
+ ///
+ /// The type of the data.
+ public DeclarationType Type
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets or sets the offset.
+ ///
+ /// The offset.
+ internal int Offset
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The type.
+ /// The vertex element usage.
+ public VertexElementAttribute(DeclarationType type, DeclarationUsage usage)
+ {
+ Type = type;
+ Usage = usage;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Resources/sdx_icon_black.ico b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Resources/sdx_icon_black.ico
new file mode 100644
index 00000000..a579579b
Binary files /dev/null and b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Resources/sdx_icon_black.ico differ
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/Camera.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/Camera.cs
new file mode 100644
index 00000000..a5651b66
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/Camera.cs
@@ -0,0 +1,197 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using SlimDX;
+
+namespace SampleFramework
+{
+ ///
+ /// Represents a view onto a 3D scene.
+ ///
+ public class Camera
+ {
+ Vector3 location;
+ Vector3 target;
+ float fieldOfView;
+ float aspectRatio;
+ float nearPlane;
+ float farPlane;
+ Matrix viewMatrix;
+ Matrix projectionMatrix;
+ bool viewDirty = true;
+ bool projectionDirty = true;
+
+ ///
+ /// Gets or sets the location of the camera eye point.
+ ///
+ /// The location of the camera eye point.
+ public Vector3 Location
+ {
+ get { return location; }
+ set
+ {
+ if (location == value)
+ return;
+
+ location = value;
+ viewDirty = true;
+ }
+ }
+
+ ///
+ /// Gets or sets the view target point.
+ ///
+ /// The view target point.
+ public Vector3 Target
+ {
+ get { return target; }
+ set
+ {
+ if (target == value)
+ return;
+
+ target = value;
+ viewDirty = true;
+ }
+ }
+
+ ///
+ /// Gets or sets the field of view.
+ ///
+ /// The field of view.
+ public float FieldOfView
+ {
+ get { return fieldOfView; }
+ set
+ {
+ if (fieldOfView == value)
+ return;
+
+ fieldOfView = value;
+ projectionDirty = true;
+ }
+ }
+
+ ///
+ /// Gets or sets the aspect ratio.
+ ///
+ /// The aspect ratio.
+ public float AspectRatio
+ {
+ get { return aspectRatio; }
+ set
+ {
+ if (aspectRatio == value)
+ return;
+
+ aspectRatio = value;
+ projectionDirty = true;
+ }
+ }
+
+ ///
+ /// Gets or sets the near plane.
+ ///
+ /// The near plane.
+ public float NearPlane
+ {
+ get { return nearPlane; }
+ set
+ {
+ if (nearPlane == value)
+ return;
+
+ nearPlane = value;
+ projectionDirty = true;
+ }
+ }
+
+ ///
+ /// Gets or sets the far plane.
+ ///
+ /// The far plane.
+ public float FarPlane
+ {
+ get { return farPlane; }
+ set
+ {
+ if (farPlane == value)
+ return;
+
+ farPlane = value;
+ projectionDirty = true;
+ }
+ }
+
+ ///
+ /// Gets the view matrix.
+ ///
+ /// The view matrix.
+ public Matrix ViewMatrix
+ {
+ get
+ {
+ if (viewDirty)
+ RebuildViewMatrix();
+ return viewMatrix;
+ }
+ }
+
+ ///
+ /// Gets the projection matrix.
+ ///
+ /// The projection matrix.
+ public Matrix ProjectionMatrix
+ {
+ get
+ {
+ if (projectionDirty)
+ RebuildProjectionMatrix();
+ return projectionMatrix;
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public Camera()
+ {
+ }
+
+ ///
+ /// Rebuilds the view matrix.
+ ///
+ protected virtual void RebuildViewMatrix()
+ {
+ viewMatrix = Matrix.LookAtLH(Location, Target, Vector3.UnitY);
+ viewDirty = false;
+ }
+
+ ///
+ /// Rebuilds the projection matrix.
+ ///
+ protected virtual void RebuildProjectionMatrix()
+ {
+ projectionMatrix = Matrix.PerspectiveFovLH(FieldOfView, AspectRatio, NearPlane, FarPlane);
+ projectionDirty = false;
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredTexturedVertex.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredTexturedVertex.cs
new file mode 100644
index 00000000..44299168
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredTexturedVertex.cs
@@ -0,0 +1,178 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Globalization;
+using System.Runtime.InteropServices;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+namespace SampleFramework
+{
+ ///
+ /// Represents a single transformed, colored, and textured vertex.
+ ///
+ [StructLayout(LayoutKind.Sequential)]
+ public struct TransformedColoredTexturedVertex : IEquatable
+ {
+ private Vector4 m_Position;
+ ///
+ /// Gets or sets the transformed position of the vertex.
+ ///
+ /// The transformed position of the vertex.
+ [VertexElement(DeclarationType.Float4, DeclarationUsage.PositionTransformed)]
+ public Vector4 Position
+ {
+ get { return m_Position; }
+ set { m_Position = value; }
+ }
+
+ private int m_Color;
+ ///
+ /// Gets or sets the color of the vertex.
+ ///
+ /// The color of the vertex.
+ [VertexElement(DeclarationType.Color, DeclarationUsage.Color)]
+ public int Color
+ {
+ get { return m_Color; }
+ set { m_Color = value; }
+ }
+
+ private Vector2 m_TextureCoordinates;
+ ///
+ /// Gets or sets the texture coordinates.
+ ///
+ /// The texture coordinates.
+ [VertexElement(DeclarationType.Float2, DeclarationUsage.TextureCoordinate)]
+ public Vector2 TextureCoordinates
+ {
+ get { return m_TextureCoordinates; }
+ set { m_TextureCoordinates = value; }
+ }
+
+ ///
+ /// Gets the size in bytes.
+ ///
+ /// The size in bytes.
+ public static int SizeInBytes
+ {
+ get { return Marshal.SizeOf(typeof(TransformedColoredTexturedVertex)); }
+ }
+
+ ///
+ /// Gets the format.
+ ///
+ /// The format.
+ public static VertexFormat Format
+ {
+ get { return VertexFormat.PositionRhw | VertexFormat.Diffuse | VertexFormat.Texture1; }
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The position.
+ /// The color.
+ /// The texture coordinates.
+ public TransformedColoredTexturedVertex(Vector4 position, int color, Vector2 textureCoordinates)
+ : this()
+ {
+ Position = position;
+ Color = color;
+ TextureCoordinates = textureCoordinates;
+ }
+
+ ///
+ /// Implements the operator ==.
+ ///
+ /// The left side of the operator.
+ /// The right side of the operator.
+ /// The result of the operator.
+ public static bool operator ==(TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right)
+ {
+ return left.Equals(right);
+ }
+
+ ///
+ /// Implements the operator !=.
+ ///
+ /// The left side of the operator.
+ /// The right side of the operator.
+ /// The result of the operator.
+ public static bool operator !=(TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right)
+ {
+ return !(left == right);
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer that is the hash code for this instance.
+ ///
+ public override int GetHashCode()
+ {
+ return Position.GetHashCode() + Color.GetHashCode() + TextureCoordinates.GetHashCode();
+ }
+
+ ///
+ /// Indicates whether this instance and a specified object are equal.
+ ///
+ /// Another object to compare to.
+ ///
+ /// true if and this instance are the same type and represent the same value; otherwise, false.
+ ///
+ public override bool Equals(object obj)
+ {
+ if (obj == null)
+ return false;
+
+ if (GetType() != obj.GetType())
+ return false;
+
+ return Equals((TransformedColoredTexturedVertex)obj);
+ }
+
+ ///
+ /// Indicates whether the current object is equal to another object of the same type.
+ ///
+ /// An object to compare with this object.
+ ///
+ /// true if the current object is equal to the parameter; otherwise, false.
+ ///
+ public bool Equals(TransformedColoredTexturedVertex other)
+ {
+ return (Position == other.Position && Color == other.Color && TextureCoordinates == other.TextureCoordinates);
+ }
+
+ ///
+ /// Returns a string representation of the current object.
+ ///
+ ///
+ /// A representing the vertex.
+ ///
+ public override string ToString()
+ {
+ return string.Format(CultureInfo.CurrentCulture, "{0} ({1}, {2})", Position.ToString(), System.Drawing.Color.FromArgb(Color).ToString(), TextureCoordinates.ToString());
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredVertex.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredVertex.cs
new file mode 100644
index 00000000..92d92566
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredVertex.cs
@@ -0,0 +1,162 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Globalization;
+using System.Runtime.InteropServices;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+namespace SampleFramework
+{
+ ///
+ /// Represents a single transformed and colored vertex.
+ ///
+ [StructLayout(LayoutKind.Sequential)]
+ public struct TransformedColoredVertex : IEquatable
+ {
+ ///
+ /// Gets or sets the transformed position of the vertex.
+ ///
+ /// The transformed position of the vertex.
+ [VertexElement(DeclarationType.Float4, DeclarationUsage.PositionTransformed)]
+ public Vector4 Position
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the color of the vertex.
+ ///
+ /// The color of the vertex.
+ [VertexElement(DeclarationType.Color, DeclarationUsage.Color)]
+ public int Color
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets the size in bytes.
+ ///
+ /// The size in bytes.
+ public static int SizeInBytes
+ {
+ get { return Marshal.SizeOf(typeof(TransformedColoredVertex)); }
+ }
+
+ ///
+ /// Gets the format.
+ ///
+ /// The format.
+ public static VertexFormat Format
+ {
+ get { return VertexFormat.PositionRhw | VertexFormat.Diffuse; }
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The position.
+ /// The color.
+ public TransformedColoredVertex(Vector4 position, int color)
+ : this()
+ {
+ Position = position;
+ Color = color;
+ }
+
+ ///
+ /// Implements the operator ==.
+ ///
+ /// The left side of the operator.
+ /// The right side of the operator.
+ /// The result of the operator.
+ public static bool operator ==(TransformedColoredVertex left, TransformedColoredVertex right)
+ {
+ return left.Equals(right);
+ }
+
+ ///
+ /// Implements the operator !=.
+ ///
+ /// The left side of the operator.
+ /// The right side of the operator.
+ /// The result of the operator.
+ public static bool operator !=(TransformedColoredVertex left, TransformedColoredVertex right)
+ {
+ return !(left == right);
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer that is the hash code for this instance.
+ ///
+ public override int GetHashCode()
+ {
+ return Position.GetHashCode() + Color.GetHashCode();
+ }
+
+ ///
+ /// Indicates whether this instance and a specified object are equal.
+ ///
+ /// Another object to compare to.
+ ///
+ /// true if and this instance are the same type and represent the same value; otherwise, false.
+ ///
+ public override bool Equals(object obj)
+ {
+ if (obj == null)
+ return false;
+
+ if (GetType() != obj.GetType())
+ return false;
+
+ return Equals((TransformedColoredVertex)obj);
+ }
+
+ ///
+ /// Indicates whether the current object is equal to another object of the same type.
+ ///
+ /// An object to compare with this object.
+ ///
+ /// true if the current object is equal to the parameter; otherwise, false.
+ ///
+ public bool Equals(TransformedColoredVertex other)
+ {
+ return (Position == other.Position && Color == other.Color);
+ }
+
+ ///
+ /// Returns a string representation of the current object.
+ ///
+ ///
+ /// A representing the vertex.
+ ///
+ public override string ToString()
+ {
+ return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", Position.ToString(), System.Drawing.Color.FromArgb(Color).ToString());
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeMethods.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeMethods.cs
new file mode 100644
index 00000000..6cd66ec8
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeMethods.cs
@@ -0,0 +1,115 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace SampleFramework
+{
+ static class NativeMethods
+ {
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool PeekMessage(out NativeMessage message, IntPtr hwnd, uint messageFilterMin, uint messageFilterMax, uint flags);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool GetClientRect(IntPtr hWnd, out NativeRectangle lpRect);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool GetWindowRect(IntPtr hWnd, out NativeRectangle lpRect);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern uint SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern uint GetWindowLong(IntPtr hWnd, int nIndex);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool IsIconic(IntPtr hWnd);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool IsZoomed(IntPtr hWnd);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool AdjustWindowRect(ref NativeRectangle lpRect, uint dwStyle, [MarshalAs(UnmanagedType.Bool)]bool bMenu);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = false)]
+ public static extern uint SetThreadExecutionState(uint esFlags);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
+
+ [SuppressUnmanagedCodeSecurityAttribute]
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
+ public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags);
+
+ public static Rectangle GetClientRectangle(IntPtr handle)
+ {
+ NativeRectangle rect;
+ if (!GetClientRect(handle, out rect))
+ return Rectangle.Empty;
+
+ return Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom);
+ }
+
+ public static Rectangle GetWindowRectangle(IntPtr handle)
+ {
+ NativeRectangle rect;
+ if (!GetWindowRect(handle, out rect))
+ return Rectangle.Empty;
+
+ return Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeStructures.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeStructures.cs
new file mode 100644
index 00000000..3506cee4
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeStructures.cs
@@ -0,0 +1,72 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+using System.Drawing;
+using System.Runtime.InteropServices;
+
+namespace SampleFramework
+{
+ [StructLayout(LayoutKind.Sequential)]
+ struct NativeRectangle
+ {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ struct NativeMessage
+ {
+ public IntPtr hWnd;
+ public uint msg;
+ public IntPtr wParam;
+ public IntPtr lParam;
+ public uint time;
+ public Point p;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ struct WINDOWPLACEMENT
+ {
+ public int length;
+ public int flags;
+ public int showCmd;
+ public Point ptMinPosition;
+ public Point ptMaxPosition;
+ public NativeRectangle rcNormalPosition;
+
+ public static int Length
+ {
+ get { return Marshal.SizeOf(typeof(WINDOWPLACEMENT)); }
+ }
+ }
+ #region #28821 2014.1.23 yyagi add: 螟夜Κ縺九i縺ョ譁蟄怜励Γ繝繧サ繝シ繧ク騾∝女菫。 螳壽焚螳夂セゥ
+ [StructLayout( LayoutKind.Sequential )]
+ public struct COPYDATASTRUCT
+ {
+ public IntPtr dwData;
+ public UInt32 cbData;
+ public IntPtr lpData;
+ }
+ #endregion
+}
diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/WindowConstants.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/WindowConstants.cs
new file mode 100644
index 00000000..f212024c
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/WindowConstants.cs
@@ -0,0 +1,77 @@
+サソ/*
+* Copyright (c) 2007-2009 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+using System;
+
+namespace SampleFramework
+{
+ static class WindowConstants
+ {
+ public const int WM_SIZE = 0x5;
+ public const int WM_SYSCOMMAND = 0x112;
+ public const int WM_ACTIVATEAPP = 0x001C;
+ public const int WM_POWERBROADCAST = 0x0218;
+ public const int WM_COPYDATA = 0x004A;
+
+ public const int SC_SCREENSAVE = 0xF140;
+ public const int SC_MONITORPOWER = 0xF170;
+
+ public const int VK_LWIN = 0x5B;
+ public const int VK_RWIN = 0x5C;
+
+ public static readonly IntPtr SIZE_MINIMIZED = new IntPtr(1);
+ public static readonly IntPtr SIZE_MAXIMIZED = new IntPtr(2);
+ public static readonly IntPtr SIZE_RESTORED = new IntPtr(0);
+
+ public static readonly IntPtr PBT_APMQUERYSUSPEND = new IntPtr(0x0000);
+ public static readonly IntPtr PBT_APMRESUMESUSPEND = new IntPtr(0x0007);
+
+ public const int WPF_RESTORETOMAXIMIZED = 2;
+
+ public const int SW_RESTORE = 9;
+ public const int SW_SHOWMINIMIZED = 2;
+ public const int SW_MAXIMIZE = 3;
+ public const int SW_SHOW = 5;
+ public const int SW_MINIMIZE = 6;
+
+ public const int GWL_STYLE = -16;
+ public const int GWL_EXSTYLE = -20;
+
+ public const long WS_MAXIMIZE = 0x01000000;
+ public const long WS_MINIMIZE = 0x20000000;
+ public const long WS_POPUP = 0x80000000;
+ public const long WS_SYSMENU = 0x00080000;
+
+ public const long WS_EX_TOPMOST = 0x00000008;
+
+ public const uint SWP_NOSIZE = 0x0001;
+ public const uint SWP_NOMOVE = 0x0002;
+ public const uint SWP_NOZORDER = 0x0004;
+ public const uint SWP_NOREDRAW = 0x0008;
+
+ public const uint ES_CONTINUOUS = 0x80000000;
+ public const uint ES_DISPLAY_REQUIRED = 0x00000002;
+
+ public const int MONITOR_DEFAULTTOPRIMARY = 1;
+
+ public const int WM_USER = 0x400;
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputJoystick.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputJoystick.cs
new file mode 100644
index 00000000..90889d5e
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputJoystick.cs
@@ -0,0 +1,820 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using SharpDX;
+using SharpDX.DirectInput;
+
+namespace FDK
+{
+ public class CInputJoystick : IInputDevice, IDisposable
+ {
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CInputJoystick( IntPtr hWnd, DeviceInstance di, DirectInput directInput )
+ {
+ this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick;
+ this.GUID = di.InstanceGuid.ToString();
+ this.ID = 0;
+ try
+ {
+ this.devJoystick = new Joystick( directInput, di.InstanceGuid );
+ this.devJoystick.SetCooperativeLevel( hWnd, CooperativeLevel.Foreground | CooperativeLevel.Exclusive );
+ this.devJoystick.Properties.BufferSize = 32;
+ Trace.TraceInformation( this.devJoystick.Information.InstanceName + "繧堤函謌舌@縺セ縺励◆縲" );
+ this.strDeviceName = this.devJoystick.Information.InstanceName;
+ }
+ catch
+ {
+ if( this.devJoystick != null )
+ {
+ this.devJoystick.Dispose();
+ this.devJoystick = null;
+ }
+ Trace.TraceError( this.devJoystick.Information.InstanceName, new object[] { " 縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲" } );
+ throw;
+ }
+ foreach( DeviceObjectInstance instance in this.devJoystick.GetObjects() )
+ {
+ if ((instance.ObjectId.Flags & DeviceObjectTypeFlags.Axis) != DeviceObjectTypeFlags.All)
+ {
+ this.devJoystick.GetObjectPropertiesById(instance.ObjectId).Range = new InputRange(-1000, 1000);
+ this.devJoystick.GetObjectPropertiesById(instance.ObjectId).DeadZone = 5000; // 50%繧偵ョ繝繝峨だ繝シ繝ウ縺ォ險ュ螳
+ // 霆ク繧丹N/OFF縺ョ2蛟、縺ァ菴ソ縺縺ェ繧峨%繧後〒蜊∝
+ }
+ }
+ try
+ {
+ this.devJoystick.Acquire();
+ }
+ catch
+ {
+ }
+
+ for( int i = 0; i < this.bButtonState.Length; i++ )
+ this.bButtonState[ i ] = false;
+ for ( int i = 0; i < this.nPovState.Length; i++ )
+ this.nPovState[ i ] = -1;
+
+ //this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+
+ this.list蜈・蜉帙う繝吶Φ繝 = new List(32);
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void SetID( int nID )
+ {
+ this.ID = nID;
+ }
+
+ #region [ IInputDevice 螳溯」 ]
+ //-----------------
+ public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・
+ {
+ get;
+ private set;
+ }
+ public string GUID
+ {
+ get;
+ private set;
+ }
+ public int ID
+ {
+ get;
+ private set;
+ }
+ public List list蜈・蜉帙う繝吶Φ繝
+ {
+ get;
+ private set;
+ }
+ public string strDeviceName
+ {
+ get;
+ set;
+ }
+
+ #region [ 繝ュ繝シ繧ォ繝ォ髢「謨ー ]
+ private void POV縺ョ蜃ヲ逅(int p, JoystickUpdate data)
+ {
+ int nPovDegree = data.Value;
+ STInputEvent e = new STInputEvent();
+ int nWay = (nPovDegree + 2250) / 4500;
+ if (nWay == 8) nWay = 0;
+ //Debug.WriteLine( "POVS:" + povs[ 0 ].ToString( CultureInfo.CurrentCulture ) + ", " +stevent.nKey );
+ //Debug.WriteLine( "nPovDegree=" + nPovDegree );
+ if (nPovDegree == -1)
+ {
+ e.nKey = 8 + 128 + this.nPovState[p];
+ this.nPovState[p] = -1;
+ //Debug.WriteLine( "POVS髮「縺輔l縺" + data.TimeStamp + " " + e.nKey );
+ e.b謚シ縺輔l縺 = false;
+ e.nVelocity = 0;
+ this.bButtonState[e.nKey] = false;
+ this.bButtonPullUp[e.nKey] = true;
+ }
+ else
+ {
+ this.nPovState[p] = nWay;
+ e.nKey = 8 + 128 + nWay;
+ e.b謚シ縺輔l縺 = true;
+ e.nVelocity = CInput邂。逅.n騾壼クク髻ウ驥;
+ this.bButtonState[e.nKey] = true;
+ this.bButtonPushDown[e.nKey] = true;
+ //Debug.WriteLine( "POVS謚シ縺輔l縺" + data.TimeStamp + " " + e.nKey );
+ }
+ //e.nTimeStamp = data.TimeStamp;
+ e.nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp);
+ this.list蜈・蜉帙う繝吶Φ繝.Add(e);
+ }
+ #endregion
+
+ public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k)
+ {
+ #region [ bButton繝輔Λ繧ー蛻晄悄蛹 ]
+ for ( int i = 0; i < 256; i++ )
+ {
+ this.bButtonPushDown[i] = false;
+ this.bButtonPullUp[i] = false;
+ }
+ #endregion
+
+ if (bWindow縺後い繧ッ繝繧」繝紋クュ)
+ {
+ this.devJoystick.Acquire();
+ this.devJoystick.Poll();
+
+ // this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 );
+ this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new();
+
+
+ if( b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k )
+ {
+ #region [ a.繝舌ャ繝輔ぃ蜈・蜉 ]
+ //-----------------------------
+
+ var bufferedData = this.devJoystick.GetBufferedData();
+ //if( Result.Last.IsSuccess && bufferedData != null )
+ {
+ foreach (JoystickUpdate data in bufferedData)
+ {
+ switch (data.Offset)
+ {
+ case JoystickOffset.X:
+ #region [ X霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 0, 1);
+ //-----------------------------
+ #endregion
+ #region [ X霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 1, 0);
+ //-----------------------------
+ #endregion
+ break;
+ case JoystickOffset.Y:
+ #region [ Y霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 2, 3);
+ //-----------------------------
+ #endregion
+ #region [ Y霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 3, 2);
+ //-----------------------------
+ #endregion
+ break;
+ case JoystickOffset.Z:
+ #region [ Z霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 4, 5);
+ //-----------------------------
+ #endregion
+ #region [ Z霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 5, 4);
+ //-----------------------------
+ #endregion
+ break;
+ case JoystickOffset.RotationZ:
+ #region [ Z霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 6, 7);
+ //-----------------------------
+ #endregion
+ #region [ Z霆クシ ]
+ //-----------------------------
+ bButtonUpDown(data, data.Value, 7, 6);
+ //-----------------------------
+ #endregion
+ break;
+ // #24341 2011.3.12 yyagi: POV support
+ // #26880 2011.12.6 yyagi: improve to support "pullup" of POV buttons
+ case JoystickOffset.PointOfViewControllers0:
+ #region [ POV HAT 4/8way ]
+ POV縺ョ蜃ヲ逅(0, data);
+ #endregion
+ break;
+ case JoystickOffset.PointOfViewControllers1:
+ #region [ POV HAT 4/8way ]
+ POV縺ョ蜃ヲ逅(1, data);
+ #endregion
+ break;
+ case JoystickOffset.PointOfViewControllers2:
+ #region [ POV HAT 4/8way ]
+ POV縺ョ蜃ヲ逅(2, data);
+ #endregion
+ break;
+ case JoystickOffset.PointOfViewControllers3:
+ #region [ POV HAT 4/8way ]
+ POV縺ョ蜃ヲ逅(3, data);
+ #endregion
+ break;
+ default:
+ #region [ 繝懊ち繝ウ ]
+ //-----------------------------
+
+ //for ( int i = 0; i < 32; i++ )
+ if (data.Offset >= JoystickOffset.Buttons0 && data.Offset <= JoystickOffset.Buttons31)
+ {
+ int i = data.Offset - JoystickOffset.Buttons0;
+
+ if ((data.Value & 0x80) != 0)
+ {
+ STInputEvent e = new STInputEvent()
+ {
+ nKey = 8 + i,
+ b謚シ縺輔l縺 = true,
+ b髮「縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp),
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(e);
+
+ this.bButtonState[8 + i] = true;
+ this.bButtonPushDown[8 + i] = true;
+ }
+ else //if ( ( data.Value & 0x80 ) == 0 )
+ {
+ var ev = new STInputEvent()
+ {
+ nKey = 8 + i,
+ b謚シ縺輔l縺 = false,
+ b髮「縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp),
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥,
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[8 + i] = false;
+ this.bButtonPullUp[8 + i] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ break;
+ }
+ }
+ }
+ //-----------------------------
+ #endregion
+ }
+ else
+ {
+ #region [ b.迥カ諷句・蜉 ]
+ //-----------------------------
+ JoystickState currentState = this.devJoystick.GetCurrentState();
+ //if( Result.Last.IsSuccess && currentState != null )
+ {
+ #region [ X霆クシ ]
+ //-----------------------------
+ if( currentState.X < -500 )
+ {
+ if( this.bButtonState[ 0 ] == false )
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 0,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[0] = true;
+ this.bButtonPushDown[0] = true;
+ }
+ }
+ else
+ {
+ if( this.bButtonState[0] == true )
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 0,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[0] = false;
+ this.bButtonPullUp[0] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ X霆クシ ]
+ //-----------------------------
+ if(currentState.X > 500)
+ {
+ if(this.bButtonState[1] == false)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 1,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[1] = true;
+ this.bButtonPushDown[1] = true;
+ }
+ }
+ else
+ {
+ if(this.bButtonState[1] == true)
+ {
+ STInputEvent event7 = new STInputEvent()
+ {
+ nKey = 1,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(event7);
+
+ this.bButtonState[1] = false;
+ this.bButtonPullUp[1] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ Y霆クシ ]
+ //-----------------------------
+ if(currentState.Y < -500)
+ {
+ if(this.bButtonState[ 2 ] == false)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 2,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[2] = true;
+ this.bButtonPushDown[2] = true;
+ }
+ }
+ else
+ {
+ if(this.bButtonState[2] == true)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 2,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[2] = false;
+ this.bButtonPullUp[2] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ Y霆クシ ]
+ //-----------------------------
+ if(currentState.Y > 500)
+ {
+ if(this.bButtonState[3] == false)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 3,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[3] = true;
+ this.bButtonPushDown[3] = true;
+ }
+ }
+ else
+ {
+ if(this.bButtonState[3] == true)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 3,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[3] = false;
+ this.bButtonPullUp[3] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ Z霆クシ ]
+ //-----------------------------
+ if(currentState.Z < -500)
+ {
+ if(this.bButtonState[4] == false)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 4,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[4] = true;
+ this.bButtonPushDown[4] = true;
+ }
+ }
+ else
+ {
+ if(this.bButtonState[4] == true)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 4,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[4] = false;
+ this.bButtonPullUp[4] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ Z霆クシ ]
+ //-----------------------------
+ if(currentState.Z > 500)
+ {
+ if( this.bButtonState[5] == false )
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 5,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add( ev );
+
+ this.bButtonState[5] = true;
+ this.bButtonPushDown[5] = true;
+ }
+ }
+ else
+ {
+ if(this.bButtonState[5] == true)
+ {
+ STInputEvent event15 = new STInputEvent()
+ {
+ nKey = 5,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(event15);
+
+ this.bButtonState[5] = false;
+ this.bButtonPullUp[5] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ Z霆ク蝗櫁サ「シ ]
+ //-----------------------------
+ if (currentState.RotationZ < -500)
+ {
+ if (this.bButtonState[6] == false)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 6,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[6] = true;
+ this.bButtonPushDown[6] = true;
+ }
+ }
+ else
+ {
+ if (this.bButtonState[6] == true)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 6,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[6] = false;
+ this.bButtonPullUp[6] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ Z霆ク蝗櫁サ「シ ]
+ //-----------------------------
+ if (currentState.RotationZ > 500)
+ {
+ if (this.bButtonState[7] == false)
+ {
+ STInputEvent ev = new STInputEvent()
+ {
+ nKey = 7,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bButtonState[7] = true;
+ this.bButtonPushDown[7] = true;
+ }
+ }
+ else
+ {
+ if (this.bButtonState[7] == true)
+ {
+ STInputEvent event15 = new STInputEvent()
+ {
+ nKey = 7,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(event15);
+
+ this.bButtonState[7] = false;
+ this.bButtonPullUp[7] = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ #region [ 繝懊ち繝ウ ]
+ //-----------------------------
+ bool bIsButtonPressedReleased = false;
+ bool[] buttons = currentState.Buttons;
+ for (int j = 0; (j < buttons.Length) && (j < 128); j++)
+ {
+ if (this.bButtonState[8 + j] == false && buttons[j])
+ {
+ STInputEvent item = new STInputEvent()
+ {
+ nKey = 8 + j,
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(item);
+
+ this.bButtonState[8 + j] = true;
+ this.bButtonPushDown[8 + j] = true;
+ bIsButtonPressedReleased = true;
+ }
+ else if( this.bButtonState[8 + j] == true && !buttons[j] )
+ {
+ STInputEvent item = new STInputEvent()
+ {
+ nKey = 8 + j,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(item);
+
+ this.bButtonState[8 + j] = false;
+ this.bButtonPullUp[8 + j] = true;
+ bIsButtonPressedReleased = true;
+ }
+ }
+ //-----------------------------
+ #endregion
+ // #24341 2011.3.12 yyagi: POV support
+ #region [ POV HAT 4/8way (only single POV switch is supported)]
+ int[] povs = currentState.PointOfViewControllers;
+ if (povs != null)
+ {
+ if ( povs[0] >= 0 )
+ {
+ int nPovDegree = povs[0];
+ int nWay = (nPovDegree + 2250) / 4500;
+ if (nWay == 8) nWay = 0;
+
+ if (this.bButtonState[8 + 128 + nWay] == false)
+ {
+ STInputEvent stevent = new STInputEvent()
+ {
+ nKey = 8 + 128 + nWay,
+ //Debug.WriteLine( "POVS:" + povs[ 0 ].ToString( CultureInfo.CurrentCulture ) + ", " +stevent.nKey );
+ b謚シ縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(stevent);
+
+ this.bButtonState[stevent.nKey] = true;
+ this.bButtonPushDown[stevent.nKey] = true;
+ }
+ }
+ else if (bIsButtonPressedReleased == false) // #xxxxx 2011.12.3 yyagi 莉悶ョ繝懊ち繝ウ縺御ス輔b謚シ縺輔l/髮「縺輔l縺ヲ縺ェ縺シ抉OV縺碁屬縺輔l縺
+ {
+ int nWay = 0;
+ for (int i = 8 + 0x80; i < 8 + 0x80 + 8; i++)
+ { // 髮「縺輔l縺溘懊ち繝ウ繧定ェソ縺ケ繧九◆繧√↓縲∝縲謚シ縺輔l縺ヲ縺縺溘懊ち繝ウ繧呈爾縺吶
+ if (this.bButtonState[i] == true) // DirectInput繧堤峩謗・縺縺倥k縺ェ繧峨%繧薙↑縺薙→縺励↑縺上※濶ッ縺縺ョ縺ォ縲√≠縺髱「蛟偵
+ { // 縺薙ョ蜃ヲ逅縺悟ソ隕√↑縺溘a縺ォ縲 ̄OV繧1蛟九@縺九し繝昴シ繝医〒縺阪↑縺縲ら┌蠢オ縲
+ nWay = i;
+ break;
+ }
+ }
+ if (nWay != 0)
+ {
+ STInputEvent stevent = new STInputEvent()
+ {
+ nKey = nWay,
+ b謚シ縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = 0
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(stevent);
+
+ this.bButtonState[nWay] = false;
+ this.bButtonPullUp[nWay] = true;
+ }
+ }
+ }
+ #endregion
+ }
+ //-----------------------------
+ #endregion
+ }
+ }
+ }
+
+ public bool b繧ュ繝シ縺梧款縺輔l縺(int nButton)
+ {
+ return this.bButtonPushDown[nButton];
+ }
+ public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nButton)
+ {
+ return this.bButtonState[nButton];
+ }
+ public bool b繧ュ繝シ縺碁屬縺輔l縺(int nButton)
+ {
+ return this.bButtonPullUp[nButton];
+ }
+ public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nButton)
+ {
+ return !this.bButtonState[nButton];
+ }
+ //-----------------
+ #endregion
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if(!this.bDispose螳御コ貂医∩)
+ {
+ if(this.devJoystick != null)
+ {
+ this.devJoystick.Dispose();
+ this.devJoystick = null;
+ }
+ //if( this.timer != null )
+ //{
+ // this.timer.Dispose();
+ // this.timer = null;
+ //}
+ if (this.list蜈・蜉帙う繝吶Φ繝 != null)
+ {
+ this.list蜈・蜉帙う繝吶Φ繝 = null;
+ }
+ this.bDispose螳御コ貂医∩ = true;
+ }
+ }
+ //-----------------
+ #endregion
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private bool[] bButtonPullUp = new bool[0x100];
+ private bool[] bButtonPushDown = new bool[0x100];
+ private bool[] bButtonState = new bool[0x100]; // 0-5: XYZ, 6 - 0x128+5: buttons, 0x128+6 - 0x128+6+8: POV/HAT
+ private int[] nPovState = new int[4];
+ private bool bDispose螳御コ貂医∩;
+ private Joystick devJoystick;
+ //private CTimer timer;
+
+ private void bButtonUpDown(JoystickUpdate data, int axisdata, int target, int contrary) // #26871 2011.12.3 霆ク縺ョ蜿崎サ「縺ォ蟇セ蠢懊☆繧九◆繧√↓繝ェ繝輔ぃ繧ッ繧ソ
+ {
+ int targetsign = (target < contrary) ? -1 : 1;
+ if (Math.Abs(axisdata) > 500 && (targetsign == Math.Sign(axisdata))) // 霆ク縺ョ譛螟ァ蛟、縺ョ蜊雁繧定カ縺医※縺縺ヲ縲√°縺、
+ {
+ if (bDoUpDownCore(target, data, false)) // 逶エ蜑阪∪縺ァ縺ッ雜縺医※縺縺ェ縺代l縺ー縲∽サ雁屓ON
+ {
+ //Debug.WriteLine( "X-ON " + data.TimeStamp + " " + axisdata );
+ }
+ else
+ {
+ //Debug.WriteLine( "X-ONx " + data.TimeStamp + " " + axisdata );
+ }
+ bDoUpDownCore(contrary, data, true); // X霆ク+ == ON 縺九i X霆ク-縺ョON繝ャ繝ウ繧ク縺ォ譚・縺溘i縲々霆ク+縺ッOFF
+ }
+ else if ((axisdata <= 0 && targetsign <= 0) || (axisdata >= 0 && targetsign >= 0)) // 霆ク縺ョ譛螟ァ蛟、縺ョ蜊雁繧定カ縺医※縺翫i縺壹√°縺、
+ {
+ //Debug.WriteLine( "X-OFF? " + data.TimeStamp + " " + axisdata );
+ if (bDoUpDownCore(target, data, true)) // 逶エ蜑阪∪縺ァ縺ッ雜縺医※縺縺溘ョ縺ェ繧峨ー縲∽サ雁屓OFF
+ {
+ //Debug.WriteLine( "X-OFF " + data.TimeStamp + " " + axisdata );
+ }
+ else if (bDoUpDownCore(contrary, data, true)) // X霆ク+ == ON 縺九i X霆ク-縺ョOFF繝ャ繝ウ繧ク縺ォ縺阪◆繧峨々霆ク+縺ッOFF
+ {
+ //Debug.WriteLine( "X-OFFx " + data.TimeStamp + " " + axisdata );
+ }
+ }
+ }
+
+ ///
+ /// 蠢隕√↓蠢懊§縺ヲ霆ク繝懊ち繝ウ縺ョ荳翫£荳九£繧、繝吶Φ繝医r逋コ逕溘☆繧
+ ///
+ /// 霆ク繝懊ち繝ウ逡ェ蜿キ 0=-X 1=+X ... 5=+Z
+ ///
+ /// 逶エ蜑阪ョ繝懊ち繝ウ迥カ諷 true=謚シ縺輔l縺ヲ縺縺
+ /// 荳翫£荳九£繧、繝吶Φ繝育匱逕滓凾true
+ private bool bDoUpDownCore(int target, JoystickUpdate data, bool lastMode)
+ {
+ if ( this.bButtonState[target] == lastMode )
+ {
+ STInputEvent e = new STInputEvent()
+ {
+ nKey = target,
+ b謚シ縺輔l縺 = !lastMode,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp),
+ nVelocity = (lastMode) ? 0 : CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(e);
+
+ this.bButtonState[target] = !lastMode;
+ if (lastMode)
+ {
+ this.bButtonPullUp[target] = true;
+ }
+ else
+ {
+ this.bButtonPushDown[target] = true;
+ }
+ return true;
+ }
+ return false;
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputKeyboard.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputKeyboard.cs
new file mode 100644
index 00000000..44d49609
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputKeyboard.cs
@@ -0,0 +1,296 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using SharpDX;
+using SharpDX.DirectInput;
+
+using SlimDXKey = SlimDXKeys.Key;
+using SharpDXKey = SharpDX.DirectInput.Key;
+
+namespace FDK
+{
+ public class CInputKeyboard : IInputDevice, IDisposable
+ {
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CInputKeyboard(IntPtr hWnd, DirectInput directInput)
+ {
+ this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Keyboard;
+ this.GUID = "";
+ this.ID = 0;
+ try
+ {
+ this.devKeyboard = new Keyboard(directInput);
+ this.devKeyboard.SetCooperativeLevel(hWnd, CooperativeLevel.NoWinKey | CooperativeLevel.Foreground | CooperativeLevel.NonExclusive);
+ this.devKeyboard.Properties.BufferSize = 32;
+ Trace.TraceInformation(this.devKeyboard.Information.ProductName.Trim(new char[] { '\0' }) + " 繧堤函謌舌@縺セ縺励◆縲"); // 縺ェ縺懊°0x00縺ョ繧エ繝溘′蜃コ繧九ョ縺ァ蜑企勁
+ this.strDeviceName = this.devKeyboard.Information.ProductName.Trim(new char[] { '\0' });
+ }
+ catch
+ {
+ if(this.devKeyboard != null)
+ {
+ this.devKeyboard.Dispose();
+ this.devKeyboard = null;
+ }
+ Trace.TraceWarning("Keyboard 繝繝舌う繧ケ縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲");
+ throw;
+ }
+ try
+ {
+ this.devKeyboard.Acquire();
+ }
+ catch
+ {
+ }
+
+ for (int i = 0; i < this.bKeyState.Length; i++)
+ this.bKeyState[i] = false;
+
+ //this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ this.list蜈・蜉帙う繝吶Φ繝 = new List(32);
+ // this.ct = new CTimer( CTimer.E遞ョ蛻・.PerformanceCounter );
+ }
+
+
+ // 繝。繧ス繝繝
+
+ #region [ IInputDevice 螳溯」 ]
+ //-----------------
+ public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ { get; private set; }
+ public string GUID { get; private set; }
+ public int ID { get; private set; }
+ public List list蜈・蜉帙う繝吶Φ繝 { get; private set; }
+ public string strDeviceName { get; set; }
+
+ public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k)
+ {
+ for (int i = 0; i < 256; i++)
+ {
+ this.bKeyPushDown[i] = false;
+ this.bKeyPullUp[i] = false;
+ }
+
+ if (bWindow縺後い繧ッ繝繧」繝紋クュ && (this.devKeyboard != null))
+ {
+ this.devKeyboard.Acquire();
+ this.devKeyboard.Poll();
+
+ //this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 );
+ this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new();
+ int posEnter = -1;
+ //string d = DateTime.Now.ToString( "yyyy/MM/dd HH:mm:ss.ffff" );
+
+ if (b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k)
+ {
+ #region [ a.繝舌ャ繝輔ぃ蜈・蜉 ]
+ //-----------------------------
+ var bufferedData = this.devKeyboard.GetBufferedData();
+ //if ( Result.Last.IsSuccess && bufferedData != null )
+ {
+ foreach (KeyboardUpdate data in bufferedData)
+ {
+ // #xxxxx: 2017.5.7: from: DIK (SharpDX.DirectInput.Key) 繧 SlimDX.DirectInput.Key 縺ォ螟画鋤縲
+ var key = DeviceConstantConverter.DIKtoKey(data.Key);
+ if (SlimDXKey.Unknown == key)
+ continue; // 譛ェ蟇セ蠢懊く繝シ縺ッ辟。隕悶
+
+ //foreach ( Key key in data.PressedKeys )
+ if (data.IsPressed)
+ {
+ // #23708 2016.3.19 yyagi; Even if we remove ALT+ENTER key input by SuppressKeyPress = true in Form,
+ // it doesn't affect to DirectInput (ALT+ENTER does not remove)
+ // So we ignore ENTER input in ALT+ENTER combination here.
+ // Note: ENTER will be alived if you keyup ALT after ALT+ENTER.
+ if (key != SlimDXKey.Return || (bKeyState[(int)SlimDXKey.LeftAlt] == false && bKeyState[(int)SlimDXKey.RightAlt] == false))
+ {
+ STInputEvent item = new STInputEvent()
+ {
+ nKey = (int)key,
+ b謚シ縺輔l縺 = true,
+ b髮「縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp),
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(item);
+
+ this.bKeyState[(int)key] = true;
+ this.bKeyPushDown[(int)key] = true;
+ }
+ //if ( item.nKey == (int) SlimDXKey.Space )
+ //{
+ // Trace.TraceInformation( "FDK(buffered): SPACE key registered. " + ct.n繧キ繧ケ繝繝譎ょ綾 );
+ //}
+ }
+ //foreach ( Key key in data.ReleasedKeys )
+ if (data.IsReleased)
+ {
+ STInputEvent item = new STInputEvent()
+ {
+ nKey = (int)key,
+ b謚シ縺輔l縺 = false,
+ b髮「縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp),
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(item);
+ this.bKeyState[(int)key] = false;
+ this.bKeyPullUp[(int)key] = true;
+ }
+ }
+ }
+ //-----------------------------
+ #endregion
+ }
+ else
+ {
+ #region [ b.迥カ諷句・蜉 ]
+ //-----------------------------
+ KeyboardState currentState = this.devKeyboard.GetCurrentState();
+ //if ( Result.Last.IsSuccess && currentState != null )
+ {
+ foreach (SharpDXKey dik in currentState.PressedKeys)
+ {
+ // #xxxxx: 2017.5.7: from: DIK (SharpDX.DirectInput.Key) 繧 SlimDX.DirectInput.Key 縺ォ螟画鋤縲
+ var key = DeviceConstantConverter.DIKtoKey(dik);
+ if (SlimDXKey.Unknown == key)
+ continue; // 譛ェ蟇セ蠢懊く繝シ縺ッ辟。隕悶
+
+ if (this.bKeyState[(int)key] == false)
+ {
+ if (key != SlimDXKey.Return || (bKeyState[(int)SlimDXKey.LeftAlt] == false && bKeyState[(int)SlimDXKey.RightAlt] == false)) // #23708 2016.3.19 yyagi
+ {
+ var ev = new STInputEvent()
+ {
+ nKey = (int)key,
+ b謚シ縺輔l縺 = true,
+ b髮「縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥,
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bKeyState[(int)key] = true;
+ this.bKeyPushDown[(int)key] = true;
+ }
+
+ //if ( (int) key == (int) SlimDXKey.Space )
+ //{
+ // Trace.TraceInformation( "FDK(direct): SPACE key registered. " + ct.n繧キ繧ケ繝繝譎ょ綾 );
+ //}
+ }
+ }
+ //foreach ( Key key in currentState.ReleasedKeys )
+ foreach (SharpDXKey dik in currentState.AllKeys)
+ {
+ // #xxxxx: 2017.5.7: from: DIK (SharpDX.DirectInput.Key) 繧 SlimDX.DirectInput.Key 縺ォ螟画鋤縲
+ var key = DeviceConstantConverter.DIKtoKey(dik);
+ if (SlimDXKey.Unknown == key)
+ continue; // 譛ェ蟇セ蠢懊く繝シ縺ッ辟。隕悶
+
+ if (this.bKeyState[(int)key] == true && !currentState.IsPressed(dik)) // 蜑榊屓縺ッ謚シ縺輔l縺ヲ縺繧九ョ縺ォ莉雁屓縺ッ謚シ縺輔l縺ヲ縺縺ェ縺 竊 髮「縺輔l縺
+ {
+ var ev = new STInputEvent()
+ {
+ nKey = (int)key,
+ b謚シ縺輔l縺 = false,
+ b髮「縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥,
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bKeyState[(int) key] = false;
+ this.bKeyPullUp[(int) key] = true;
+ }
+ }
+ }
+ //-----------------------------
+ #endregion
+ }
+ #region [#23708 2011.4.8 yyagi Alt縺梧款縺輔l縺ヲ縺繧九→縺阪ッ縲・nter謚シ荳区ュ蝣ア繧貞炎髯、縺吶k -> 蜑ッ菴懃畑縺瑚ヲ九▽縺九j蜑企勁]
+ //if ( this.bKeyState[ (int) SlimDXKey.RightAlt ] ||
+ // this.bKeyState[ (int) SlimDXKey.LeftAlt ] )
+ //{
+ // int cr = (int) SlimDXKey.Return;
+ // this.bKeyPushDown[ cr ] = false;
+ // this.bKeyPullUp[ cr ] = false;
+ // this.bKeyState[ cr ] = false;
+ //}
+ #endregion
+ }
+ }
+ ///
+ /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ
+ ///
+ public bool b繧ュ繝シ縺梧款縺輔l縺(int nKey)
+ {
+ return this.bKeyPushDown[nKey];
+ }
+ ///
+ /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ
+ ///
+ public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nKey)
+ {
+ return this.bKeyState[ nKey ];
+ }
+ ///
+ /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ
+ ///
+ public bool b繧ュ繝シ縺碁屬縺輔l縺(int nKey)
+ {
+ return this.bKeyPullUp[nKey];
+ }
+ ///
+ /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ
+ ///
+ public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nKey)
+ {
+ return !this.bKeyState[nKey];
+ }
+ //-----------------
+ #endregion
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if(!this.bDispose螳御コ貂医∩)
+ {
+ if(this.devKeyboard != null)
+ {
+ this.devKeyboard.Dispose();
+ this.devKeyboard = null;
+ }
+ //if( this.timer != null )
+ //{
+ // this.timer.Dispose();
+ // this.timer = null;
+ //}
+ if (this.list蜈・蜉帙う繝吶Φ繝 != null)
+ {
+ this.list蜈・蜉帙う繝吶Φ繝 = null;
+ }
+ this.bDispose螳御コ貂医∩ = true;
+ }
+ }
+ //-----------------
+ #endregion
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private bool[] bKeyPullUp = new bool[256];
+ private bool[] bKeyPushDown = new bool[256];
+ private bool[] bKeyState = new bool[256];
+ private bool bDispose螳御コ貂医∩;
+ private Keyboard devKeyboard;
+ //private CTimer timer;
+ //private CTimer ct;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMIDI.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMIDI.cs
new file mode 100644
index 00000000..8b8308d9
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMIDI.cs
@@ -0,0 +1,124 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace FDK
+{
+ public class CInputMIDI : IInputDevice, IDisposable
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public IntPtr hMidiIn;
+ public List listEventBuffer;
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CInputMIDI(uint nID)
+ {
+ this.hMidiIn = IntPtr.Zero;
+ this.listEventBuffer = new List(32);
+ this.list蜈・蜉帙う繝吶Φ繝 = new List(32);
+ this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.MidiIn;
+ this.GUID = "";
+ this.ID = (int)nID;
+ this.strDeviceName = ""; // CInput邂。逅縺ァ蛻晄悄蛹悶☆繧
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void t繝。繝繧サ繝シ繧ク縺九iMIDI菫。蜿キ縺ョ縺ソ蜿嶺ソ。(uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2, long n蜿嶺ソ。繧キ繧ケ繝繝譎ょ綾)
+ {
+ if (wMsg == CWin32.MIM_DATA)
+ {
+ int nMIDIevent = (int)dwParam1 & 0xF0;
+ int nPara1 = ((int)dwParam1 >> 8) & 0xFF;
+ int nPara2 = ((int)dwParam1 >> 16) & 0xFF;
+ int nPara3 = ((int)dwParam2 >> 8) & 0xFF;
+ int nPara4 = ((int)dwParam2 >> 16) & 0xFF;
+
+ // Trace.TraceInformation( "MIDIevent={0:X2} para1={1:X2} para2={2:X2}", nMIDIevent, nPara1, nPara2 ,nPara3,nPara4);
+
+ if ((nMIDIevent == 0x90) && (nPara2 != 0)) // Note ON
+ {
+ STInputEvent item = new STInputEvent();
+ item.nKey = nPara1;
+ item.b謚シ縺輔l縺 = true;
+ item.nTimeStamp = n蜿嶺ソ。繧キ繧ケ繝繝譎ょ綾;
+ item.nVelocity = nPara2;
+ this.listEventBuffer.Add(item);
+ }
+ //else if ( ( nMIDIevent == 0xB0 ) && ( nPara1 == 4 ) ) // Ctrl Chg #04: Foot Controller
+ //{
+ // STInputEvent item = new STInputEvent();
+ // item.nKey = nPara1;
+ // item.b謚シ縺輔l縺 = true;
+ // item.nTimeStamp = n蜿嶺ソ。繧キ繧ケ繝繝譎ょ綾;
+ // item.nVelocity = nPara2;
+ // this.listEventBuffer.Add( item );
+ //}
+ }
+ }
+
+ #region [ IInputDevice 螳溯」 ]
+ //-----------------
+ public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ { get; private set; }
+ public string GUID { get; private set; }
+ public int ID { get; private set; }
+ public List list蜈・蜉帙う繝吶Φ繝 { get; private set; }
+ public string strDeviceName { get; set; }
+
+ public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k)
+ {
+ // this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 );
+ this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new();
+
+ for (int i = 0; i < this.listEventBuffer.Count; i++)
+ this.list蜈・蜉帙う繝吶Φ繝.Add(this.listEventBuffer[i]);
+
+ this.listEventBuffer.Clear();
+ }
+ public bool b繧ュ繝シ縺梧款縺輔l縺(int nKey)
+ {
+ foreach (STInputEvent event2 in this.list蜈・蜉帙う繝吶Φ繝)
+ {
+ if ((event2.nKey == nKey) && event2.b謚シ縺輔l縺)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nKey)
+ {
+ return false;
+ }
+ public bool b繧ュ繝シ縺碁屬縺輔l縺(int nKey)
+ {
+ return false;
+ }
+ public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nKey)
+ {
+ return false;
+ }
+ //-----------------
+ #endregion
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if (this.listEventBuffer != null)
+ {
+ this.listEventBuffer = null;
+ }
+ if (this.list蜈・蜉帙う繝吶Φ繝 != null)
+ {
+ this.list蜈・蜉帙う繝吶Φ繝 = null;
+ }
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMouse.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMouse.cs
new file mode 100644
index 00000000..01d2dd9c
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMouse.cs
@@ -0,0 +1,251 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using SharpDX;
+using SharpDX.DirectInput;
+
+namespace FDK
+{
+ public class CInputMouse : IInputDevice, IDisposable
+ {
+ // 螳壽焚
+
+ public const int n繝槭え繧ケ縺ョ譛螟ァ繝懊ち繝ウ謨ー = 8;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CInputMouse(IntPtr hWnd, DirectInput directInput)
+ {
+ this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Mouse;
+ this.GUID = "";
+ this.ID = 0;
+ try
+ {
+ this.devMouse = new Mouse(directInput);
+ this.devMouse.SetCooperativeLevel(hWnd, CooperativeLevel.Foreground | CooperativeLevel.NonExclusive);
+ this.devMouse.Properties.BufferSize = 0x20;
+ Trace.TraceInformation(this.devMouse.Information.ProductName.Trim(new char[] { '\0' }) + " 繧堤函謌舌@縺セ縺励◆縲"); // 縺ェ縺懊°0x00縺ョ繧エ繝溘′蜃コ繧九ョ縺ァ蜑企勁
+ this.strDeviceName = this.devMouse.Information.ProductName.Trim(new char[] { '\0' });
+ }
+ catch
+ {
+ if (this.devMouse != null)
+ {
+ this.devMouse.Dispose();
+ this.devMouse = null;
+ }
+ Trace.TraceWarning("Mouse 繝繝舌う繧ケ縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲");
+ throw;
+ }
+ try
+ {
+ this.devMouse.Acquire();
+ }
+ catch
+ {
+ }
+
+ for (int i = 0; i < this.bMouseState.Length; i++)
+ this.bMouseState[i] = false;
+
+ //this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ this.list蜈・蜉帙う繝吶Φ繝 = new List(32);
+ }
+
+
+ // 繝。繧ス繝繝
+
+ #region [ IInputDevice 螳溯」 ]
+ //-----------------
+ public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ { get; private set; }
+ public string GUID { get; private set; }
+ public int ID { get; private set; }
+ public List list蜈・蜉帙う繝吶Φ繝 { get; private set; }
+ public string strDeviceName { get; set; }
+
+ public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k)
+ {
+ for (int i = 0; i < 8; i++)
+ {
+ this.bMousePushDown[i] = false;
+ this.bMousePullUp[i] = false;
+ }
+
+ if (bWindow縺後い繧ッ繝繧」繝紋クュ && (this.devMouse != null))
+ {
+ this.devMouse.Acquire();
+ this.devMouse.Poll();
+
+ // this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 );
+ this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new();
+
+ if (b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k)
+ {
+ #region [ a.繝舌ャ繝輔ぃ蜈・蜉 ]
+ //-----------------------------
+ var bufferedData = this.devMouse.GetBufferedData();
+ //if( Result.Last.IsSuccess && bufferedData != null )
+ {
+ foreach (MouseUpdate data in bufferedData)
+ {
+ var mouseButton = new[] {
+ MouseOffset.Buttons0,
+ MouseOffset.Buttons1,
+ MouseOffset.Buttons2,
+ MouseOffset.Buttons3,
+ MouseOffset.Buttons4,
+ MouseOffset.Buttons5,
+ MouseOffset.Buttons6,
+ MouseOffset.Buttons7,
+ };
+
+ for (int k = 0; k < 8; k++)
+ {
+ //if( data.IsPressed( k ) )
+ if (data.Offset == mouseButton[k] && ((data.Value & 0x80) != 0))
+ {
+ STInputEvent item = new STInputEvent()
+ {
+ nKey = k,
+ b謚シ縺輔l縺 = true,
+ b髮「縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp),
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(item);
+
+ this.bMouseState[k] = true;
+ this.bMousePushDown[k] = true;
+ }
+ else if (data.Offset == mouseButton[k] && this.bMouseState[k] == true && ((data.Value & 0x80) == 0))
+ //else if( data.IsReleased( k ) )
+ {
+ STInputEvent item = new STInputEvent()
+ {
+ nKey = k,
+ b謚シ縺輔l縺 = false,
+ b髮「縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp),
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(item);
+
+ this.bMouseState[k] = false;
+ this.bMousePullUp[k] = true;
+ }
+ }
+ }
+ }
+ //-----------------------------
+ #endregion
+ }
+ else
+ {
+ #region [ b.迥カ諷句・蜉 ]
+ //-----------------------------
+ MouseState currentState = this.devMouse.GetCurrentState();
+ //if( Result.Last.IsSuccess && currentState != null )
+ {
+ bool[] buttons = currentState.Buttons;
+
+ for (int j = 0; (j < buttons.Length) && (j < 8); j++)
+ {
+ if (this.bMouseState[j] == false && buttons[j] == true)
+ {
+ var ev = new STInputEvent()
+ {
+ nKey = j,
+ b謚シ縺輔l縺 = true,
+ b髮「縺輔l縺 = false,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥,
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bMouseState[j] = true;
+ this.bMousePushDown[j] = true;
+ }
+ else if(this.bMouseState[j] == true && buttons[j] == false)
+ {
+ var ev = new STInputEvent()
+ {
+ nKey = j,
+ b謚シ縺輔l縺 = false,
+ b髮「縺輔l縺 = true,
+ nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ nVelocity = CInput邂。逅.n騾壼クク髻ウ驥,
+ };
+ this.list蜈・蜉帙う繝吶Φ繝.Add(ev);
+
+ this.bMouseState[j] = false;
+ this.bMousePullUp[j] = true;
+ }
+ }
+ }
+ //-----------------------------
+ #endregion
+ }
+ }
+ }
+ public bool b繧ュ繝シ縺梧款縺輔l縺(int nButton)
+ {
+ return (((0 <= nButton) && (nButton < 8)) && this.bMousePushDown[nButton]);
+ }
+ public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nButton)
+ {
+ return (((0 <= nButton) && (nButton < 8)) && this.bMouseState[nButton]);
+ }
+ public bool b繧ュ繝シ縺碁屬縺輔l縺(int nButton)
+ {
+ return (((0 <= nButton) && (nButton < 8)) && this.bMousePullUp[nButton]);
+ }
+ public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nButton)
+ {
+ return (((0 <= nButton) && (nButton < 8)) && !this.bMouseState[nButton]);
+ }
+ //-----------------
+ #endregion
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if(!this.bDispose螳御コ貂医∩)
+ {
+ if(this.devMouse != null)
+ {
+ this.devMouse.Dispose();
+ this.devMouse = null;
+ }
+ //if( this.timer != null )
+ //{
+ // this.timer.Dispose();
+ // this.timer = null;
+ //}
+ if (this.list蜈・蜉帙う繝吶Φ繝 != null)
+ {
+ this.list蜈・蜉帙う繝吶Φ繝 = null;
+ }
+ this.bDispose螳御コ貂医∩ = true;
+ }
+ }
+ //-----------------
+ #endregion
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private bool bDispose螳御コ貂医∩;
+ private bool[] bMousePullUp = new bool[8];
+ private bool[] bMousePushDown = new bool[8];
+ private bool[] bMouseState = new bool[8];
+ private Mouse devMouse;
+ //private CTimer timer;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInput邂。逅.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInput邂。逅.cs
new file mode 100644
index 00000000..63475af1
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInput邂。逅.cs
@@ -0,0 +1,297 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using SharpDX.DirectInput;
+
+namespace FDK
+{
+ public class CInput邂。逅 : IDisposable
+ {
+ // 螳壽焚
+
+ public static int n騾壼クク髻ウ驥 = 110;
+
+
+ // 繝励Ο繝代ユ繧」
+
+ public List list蜈・蜉帙ョ繝舌う繧ケ
+ {
+ get;
+ private set;
+ }
+ public IInputDevice Keyboard
+ {
+ get
+ {
+ if (this._Keyboard != null)
+ {
+ return this._Keyboard;
+ }
+ foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ if (device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Keyboard)
+ {
+ this._Keyboard = device;
+ return device;
+ }
+ }
+ return null;
+ }
+ }
+ public IInputDevice Mouse
+ {
+ get
+ {
+ if (this._Mouse != null)
+ {
+ return this._Mouse;
+ }
+ foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ if (device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Mouse)
+ {
+ this._Mouse = device;
+ return device;
+ }
+ }
+ return null;
+ }
+ }
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+ public CInput邂。逅(IntPtr hWnd, bool bUseMidiIn = true)
+ {
+ CInput邂。逅蛻晄悄蛹(hWnd, bUseMidiIn);
+ }
+
+ public void CInput邂。逅蛻晄悄蛹(IntPtr hWnd, bool bUseMidiIn)
+ {
+ this.directInput = new DirectInput();
+ // this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+
+ this.list蜈・蜉帙ョ繝舌う繧ケ = new List(10);
+ #region [ Enumerate keyboard/mouse: exception is masked if keyboard/mouse is not connected ]
+ CInputKeyboard cinputkeyboard = null;
+ CInputMouse cinputmouse = null;
+ try
+ {
+ cinputkeyboard = new CInputKeyboard(hWnd, directInput);
+ cinputmouse = new CInputMouse(hWnd, directInput);
+ }
+
+ catch
+ {
+ }
+ if (cinputkeyboard != null)
+ {
+ this.list蜈・蜉帙ョ繝舌う繧ケ.Add(cinputkeyboard);
+ }
+ if (cinputmouse != null)
+ {
+ this.list蜈・蜉帙ョ繝舌う繧ケ.Add(cinputmouse);
+ }
+ #endregion
+ #region [ Enumerate joypad ]
+ foreach (DeviceInstance instance in this.directInput.GetDevices(DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly))
+ {
+ this.list蜈・蜉帙ョ繝舌う繧ケ.Add(new CInputJoystick(hWnd, instance, directInput));
+ }
+ #endregion
+ if (bUseMidiIn)
+ {
+ this.proc = new CWin32.MidiInProc(this.MidiInCallback);
+ uint nMidiDevices = CWin32.midiInGetNumDevs();
+ Trace.TraceInformation("MIDI蜈・蜉帙ョ繝舌う繧ケ謨ー: {0}", nMidiDevices);
+ for (uint i = 0; i < nMidiDevices; i++)
+ {
+ CInputMIDI item = new CInputMIDI(i);
+ CWin32.MIDIINCAPS lpMidiInCaps = new CWin32.MIDIINCAPS();
+ uint num3 = CWin32.midiInGetDevCaps(i, ref lpMidiInCaps, (uint)Marshal.SizeOf(lpMidiInCaps));
+ if (num3 != 0)
+ {
+ Trace.TraceError("MIDI In: Device{0}: midiInDevCaps(): {1:X2}: ", i, num3);
+ }
+ else
+ {
+ uint ret = CWin32.midiInOpen(ref item.hMidiIn, i, this.proc, IntPtr.Zero, 0x30000);
+ Trace.TraceInformation("midiInOpen()==" + ret);
+ Trace.TraceInformation("item.hMidiIn==" + item.hMidiIn.ToString());
+ if ((ret == 0) && (item.hMidiIn != IntPtr.Zero))
+ {
+ CWin32.midiInStart(item.hMidiIn);
+ Trace.TraceInformation("MIDI In: [{0}] \"{1}\" 縺ョ蜈・蜉帛女莉倥r髢句ァ九@縺セ縺励◆縲", i, lpMidiInCaps.szPname);
+ item.strDeviceName = lpMidiInCaps.szPname;
+ this.list蜈・蜉帙ョ繝舌う繧ケ.Add(item);
+ continue;
+ }
+ }
+ Trace.TraceError("MIDI In: [{0}] \"{1}\" 縺ョ蜈・蜉帛女莉倥ョ髢句ァ九↓螟ア謨励@縺セ縺励◆縲", i, lpMidiInCaps.szPname);
+ }
+ }
+ else
+ {
+ Trace.TraceInformation("DTXV繝「繝シ繝峨ョ縺溘a縲`IDI蜈・蜉帙ッ菴ソ逕ィ縺励∪縺帙s縲");
+ }
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public IInputDevice Joystick(int ID)
+ {
+ foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ if ((device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick) && (device.ID == ID))
+ {
+ return device;
+ }
+ }
+ return null;
+ }
+ public IInputDevice Joystick(string GUID)
+ {
+ foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ if ((device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick) && device.GUID.Equals(GUID))
+ {
+ return device;
+ }
+ }
+ return null;
+ }
+ public IInputDevice MidiIn(int ID)
+ {
+ foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ if ((device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.MidiIn) && (device.ID == ID))
+ {
+ return device;
+ }
+ }
+ return null;
+ }
+ public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k)
+ {
+ lock (this.objMidiIn謗剃サ也畑)
+ {
+ // foreach( IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ )
+ for (int i = this.list蜈・蜉帙ョ繝舌う繧ケ.Count - 1; i >= 0; i--) // #24016 2011.1.6 yyagi: change not to use "foreach" to avoid InvalidOperation exception by Remove().
+ {
+ IInputDevice device = this.list蜈・蜉帙ョ繝舌う繧ケ[i];
+ try
+ {
+ device.t繝昴シ繝ェ繝ウ繧ー(bWindow縺後い繧ッ繝繧」繝紋クュ, b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k);
+ }
+ catch (SharpDX.SharpDXException e) // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items.
+ {
+ if (e.ResultCode == ResultCode.OtherApplicationHasPriority)
+ {
+ // #xxxxx: 2017.5.9: from: 縺薙ョ繧ィ繝ゥ繝シ縺ョ譎ゅッ縲∽ス輔b縺励↑縺縲
+ }
+ else
+ {
+ // #xxxxx: 2017.5.9: from: 縺昴ョ莉悶ョ繧ィ繝ゥ繝シ縺ョ蝣エ蜷医ッ縲√ョ繝舌う繧ケ縺悟、悶&繧後◆縺ィ諠ウ螳壹@縺ヲRemove縺吶k縲
+ this.list蜈・蜉帙ョ繝舌う繧ケ.Remove(device);
+ device.Dispose();
+ Trace.TraceError("t繝昴シ繝ェ繝ウ繧ー譎ゅ↓蟇セ雎。device縺梧栢縺九l縺ヲ縺翫j萓句、也匱逕溘ょ酔device繧偵昴シ繝ェ繝ウ繧ー蟇セ雎。縺九iRemove縺励∪縺励◆縲");
+ }
+ }
+ }
+ }
+ }
+
+ #region [ IDisposableシ勤ア ]
+ //-----------------
+ public void Dispose()
+ {
+ this.Dispose(true);
+ }
+ public void Dispose(bool disposeManagedObjects)
+ {
+ if (!this.bDisposed貂医∩)
+ {
+ if (disposeManagedObjects)
+ {
+ foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ CInputMIDI tmidi = device as CInputMIDI;
+ if (tmidi != null)
+ {
+ CWin32.midiInStop(tmidi.hMidiIn);
+ CWin32.midiInReset(tmidi.hMidiIn);
+ CWin32.midiInClose(tmidi.hMidiIn);
+ Trace.TraceInformation("MIDI In: [{0}] 繧貞●豁「縺励∪縺励◆縲", new object[] { tmidi.ID });
+ }
+ }
+ foreach (IInputDevice device2 in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ device2.Dispose();
+ }
+ lock (this.objMidiIn謗剃サ也畑)
+ {
+ this.list蜈・蜉帙ョ繝舌う繧ケ.Clear();
+ }
+
+ this.directInput.Dispose();
+
+ //if( this.timer != null )
+ //{
+ // this.timer.Dispose();
+ // this.timer = null;
+ //}
+ }
+ this.bDisposed貂医∩ = true;
+ }
+ }
+ ~CInput邂。逅()
+ {
+ this.Dispose(false);
+ GC.KeepAlive(this);
+ }
+ //-----------------
+ #endregion
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private DirectInput directInput;
+ private IInputDevice _Keyboard;
+ private IInputDevice _Mouse;
+ private bool bDisposed貂医∩;
+ private List listHMIDIIN = new List(8);
+ private object objMidiIn謗剃サ也畑 = new object();
+ private CWin32.MidiInProc proc;
+ //private CTimer timer;
+
+ private void MidiInCallback(IntPtr hMidiIn, uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2)
+ {
+ int p = (int)dwParam1 & 0xF0;
+ if (wMsg != CWin32.MIM_DATA || (p != 0x80 && p != 0x90 && p != 0xB0))
+ return;
+
+ long time = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾; // lock蜑阪↓蜿門セ励よシ泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌
+ lock (this.objMidiIn謗剃サ也畑)
+ {
+ if ((this.list蜈・蜉帙ョ繝舌う繧ケ != null) && (this.list蜈・蜉帙ョ繝舌う繧ケ.Count != 0))
+ {
+ foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ)
+ {
+ CInputMIDI tmidi = device as CInputMIDI;
+ if ((tmidi != null) && (tmidi.hMidiIn == hMidiIn))
+ {
+ tmidi.t繝。繝繧サ繝シ繧ク縺九iMIDI菫。蜿キ縺ョ縺ソ蜿嶺ソ。(wMsg, dwInstance, dwParam1, dwParam2, time);
+ break;
+ }
+ }
+ }
+ }
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/DeviceConstantConverter.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/DeviceConstantConverter.cs
new file mode 100644
index 00000000..0228a86b
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/DeviceConstantConverter.cs
@@ -0,0 +1,1666 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using SlimDXKeys;
+
+using WindowsKey = System.Windows.Forms.Keys;
+using SlimDXKey = SlimDXKeys.Key;
+using SharpDXKey = SharpDX.DirectInput.Key;
+
+namespace FDK
+{
+ public class DeviceConstantConverter
+ {
+ // 繝。繧ス繝繝
+
+ public static Key DIKtoKey( int dik )
+ {
+ switch( dik )
+ {
+ case 1:
+ return Key.Escape;
+
+ case 2:
+ return Key.D1;
+
+ case 3:
+ return Key.D2;
+
+ case 4:
+ return Key.D3;
+
+ case 5:
+ return Key.D4;
+
+ case 6:
+ return Key.D5;
+
+ case 7:
+ return Key.D6;
+
+ case 8:
+ return Key.D7;
+
+ case 9:
+ return Key.D8;
+
+ case 10:
+ return Key.D9;
+
+ case 11:
+ return Key.D0;
+
+ case 12:
+ return Key.Minus;
+
+ case 13:
+ return Key.Equals;
+
+ case 14:
+ return Key.Backspace;
+
+ case 15:
+ return Key.Tab;
+
+ case 0x10:
+ return Key.Q;
+
+ case 0x11:
+ return Key.W;
+
+ case 0x12:
+ return Key.E;
+
+ case 0x13:
+ return Key.R;
+
+ case 20:
+ return Key.T;
+
+ case 0x15:
+ return Key.Y;
+
+ case 0x16:
+ return Key.U;
+
+ case 0x17:
+ return Key.I;
+
+ case 0x18:
+ return Key.O;
+
+ case 0x19:
+ return Key.P;
+
+ case 0x1a:
+ return Key.LeftBracket;
+
+ case 0x1b:
+ return Key.RightBracket;
+
+ case 0x1c:
+ return Key.Return;
+
+ case 0x1d:
+ return Key.LeftControl;
+
+ case 30:
+ return Key.A;
+
+ case 0x1f:
+ return Key.S;
+
+ case 0x20:
+ return Key.D;
+
+ case 0x21:
+ return Key.F;
+
+ case 0x22:
+ return Key.G;
+
+ case 0x23:
+ return Key.H;
+
+ case 0x24:
+ return Key.J;
+
+ case 0x25:
+ return Key.K;
+
+ case 0x26:
+ return Key.L;
+
+ case 0x27:
+ return Key.Semicolon;
+
+ case 40:
+ return Key.Apostrophe;
+
+ case 0x29:
+ return Key.Grave;
+
+ case 0x2a:
+ return Key.LeftShift;
+
+ case 0x2b:
+ return Key.Backslash;
+
+ case 0x2c:
+ return Key.Z;
+
+ case 0x2d:
+ return Key.X;
+
+ case 0x2e:
+ return Key.C;
+
+ case 0x2f:
+ return Key.V;
+
+ case 0x30:
+ return Key.B;
+
+ case 0x31:
+ return Key.N;
+
+ case 50:
+ return Key.M;
+
+ case 0x33:
+ return Key.Comma;
+
+ case 0x34:
+ return Key.Period;
+
+ case 0x35:
+ return Key.Slash;
+
+ case 0x36:
+ return Key.RightShift;
+
+ case 0x37:
+ return Key.NumberPadStar;
+
+ case 0x38:
+ return Key.LeftAlt;
+
+ case 0x39:
+ return Key.Space;
+
+ case 0x3a:
+ return Key.CapsLock;
+
+ case 0x3b:
+ return Key.F1;
+
+ case 60:
+ return Key.F2;
+
+ case 0x3d:
+ return Key.F3;
+
+ case 0x3e:
+ return Key.F4;
+
+ case 0x3f:
+ return Key.F5;
+
+ case 0x40:
+ return Key.F6;
+
+ case 0x41:
+ return Key.F7;
+
+ case 0x42:
+ return Key.F8;
+
+ case 0x43:
+ return Key.F9;
+
+ case 0x44:
+ return Key.F10;
+
+ case 0x45:
+ return Key.NumberLock;
+
+ case 70:
+ return Key.ScrollLock;
+
+ case 0x47:
+ return Key.NumberPad7;
+
+ case 0x48:
+ return Key.NumberPad8;
+
+ case 0x49:
+ return Key.NumberPad9;
+
+ case 0x4a:
+ return Key.NumberPadMinus;
+
+ case 0x4b:
+ return Key.NumberPad4;
+
+ case 0x4c:
+ return Key.NumberPad5;
+
+ case 0x4d:
+ return Key.NumberPad6;
+
+ case 0x4e:
+ return Key.NumberPadPlus;
+
+ case 0x4f:
+ return Key.NumberPad1;
+
+ case 80:
+ return Key.NumberPad2;
+
+ case 0x51:
+ return Key.NumberPad3;
+
+ case 0x52:
+ return Key.NumberPad0;
+
+ case 0x53:
+ return Key.NumberPadPeriod;
+
+ case 0x56:
+ return Key.Oem102;
+
+ case 0x57:
+ return Key.F11;
+
+ case 0x58:
+ return Key.F12;
+
+ case 100:
+ return Key.F13;
+
+ case 0x65:
+ return Key.F14;
+
+ case 0x66:
+ return Key.F15;
+
+ case 0x70:
+ return Key.Kana;
+
+ case 0x73:
+ return Key.AbntC1;
+
+ case 0x79:
+ return Key.Convert;
+
+ case 0x7b:
+ return Key.NoConvert;
+
+ case 0x7d:
+ return Key.Yen;
+
+ case 0x7e:
+ return Key.AbntC2;
+
+ case 0x8d:
+ return Key.NumberPadEquals;
+
+ case 0x90:
+ return Key.PreviousTrack;
+
+ case 0x91:
+ return Key.AT;
+
+ case 0x92:
+ return Key.Colon;
+
+ case 0x93:
+ return Key.Underline;
+
+ case 0x94:
+ return Key.Kanji;
+
+ case 0x95:
+ return Key.Stop;
+
+ case 150:
+ return Key.AX;
+
+ case 0x97:
+ return Key.Unlabeled;
+
+ case 0x99:
+ return Key.NextTrack;
+
+ case 0x9c:
+ return Key.NumberPadEnter;
+
+ case 0x9d:
+ return Key.RightControl;
+
+ case 160:
+ return Key.Mute;
+
+ case 0xa1:
+ return Key.Calculator;
+
+ case 0xa2:
+ return Key.PlayPause;
+
+ case 0xa4:
+ return Key.MediaStop;
+
+ case 0xae:
+ return Key.VolumeDown;
+
+ case 0xb0:
+ return Key.VolumeUp;
+
+ case 0xb2:
+ return Key.WebHome;
+
+ case 0xb3:
+ return Key.NumberPadComma;
+
+ case 0xb5:
+ return Key.NumberPadSlash;
+
+ case 0xb7:
+ return Key.PrintScreen;
+
+ case 0xb8:
+ return Key.RightAlt;
+
+ case 0xc5:
+ return Key.Pause;
+
+ case 0xc7:
+ return Key.Home;
+
+ case 200:
+ return Key.UpArrow;
+
+ case 0xc9:
+ return Key.PageUp;
+
+ case 0xcb:
+ return Key.LeftArrow;
+
+ case 0xcd:
+ return Key.RightArrow;
+
+ case 0xcf:
+ return Key.End;
+
+ case 0xd0:
+ return Key.DownArrow;
+
+ case 0xd1:
+ return Key.PageDown;
+
+ case 210:
+ return Key.Insert;
+
+ case 0xd3:
+ return Key.Delete;
+
+ case 0xdb:
+ return Key.LeftWindowsKey;
+
+ case 220:
+ return Key.RightWindowsKey;
+
+ case 0xdd:
+ return Key.Applications;
+
+ case 0xde:
+ return Key.Power;
+
+ case 0xdf:
+ return Key.Sleep;
+
+ case 0xe3:
+ return Key.Wake;
+
+ case 0xe5:
+ return Key.WebSearch;
+
+ case 230:
+ return Key.WebFavorites;
+
+ case 0xe7:
+ return Key.WebRefresh;
+
+ case 0xe8:
+ return Key.WebStop;
+
+ case 0xe9:
+ return Key.WebForward;
+
+ case 0xea:
+ return Key.WebBack;
+
+ case 0xeb:
+ return Key.MyComputer;
+
+ case 0xec:
+ return Key.Mail;
+
+ case 0xed:
+ return Key.MediaSelect;
+ }
+ return Key.Unknown;
+ }
+ public static int KeyToDIK( Key key )
+ {
+ switch( key )
+ {
+ case Key.D0:
+ return 11;
+
+ case Key.D1:
+ return 2;
+
+ case Key.D2:
+ return 3;
+
+ case Key.D3:
+ return 4;
+
+ case Key.D4:
+ return 5;
+
+ case Key.D5:
+ return 6;
+
+ case Key.D6:
+ return 7;
+
+ case Key.D7:
+ return 8;
+
+ case Key.D8:
+ return 9;
+
+ case Key.D9:
+ return 10;
+
+ case Key.A:
+ return 30;
+
+ case Key.B:
+ return 0x30;
+
+ case Key.C:
+ return 0x2e;
+
+ case Key.D:
+ return 0x20;
+
+ case Key.E:
+ return 0x12;
+
+ case Key.F:
+ return 0x21;
+
+ case Key.G:
+ return 0x22;
+
+ case Key.H:
+ return 0x23;
+
+ case Key.I:
+ return 0x17;
+
+ case Key.J:
+ return 0x24;
+
+ case Key.K:
+ return 0x25;
+
+ case Key.L:
+ return 0x26;
+
+ case Key.M:
+ return 50;
+
+ case Key.N:
+ return 0x31;
+
+ case Key.O:
+ return 0x18;
+
+ case Key.P:
+ return 0x19;
+
+ case Key.Q:
+ return 0x10;
+
+ case Key.R:
+ return 0x13;
+
+ case Key.S:
+ return 0x1f;
+
+ case Key.T:
+ return 20;
+
+ case Key.U:
+ return 0x16;
+
+ case Key.V:
+ return 0x2f;
+
+ case Key.W:
+ return 0x11;
+
+ case Key.X:
+ return 0x2d;
+
+ case Key.Y:
+ return 0x15;
+
+ case Key.Z:
+ return 0x2c;
+
+ case Key.AbntC1:
+ return 0x73;
+
+ case Key.AbntC2:
+ return 0x7e;
+
+ case Key.Apostrophe:
+ return 40;
+
+ case Key.Applications:
+ return 0xdd;
+
+ case Key.AT:
+ return 0x91;
+
+ case Key.AX:
+ return 150;
+
+ case Key.Backspace:
+ return 14;
+
+ case Key.Backslash:
+ return 0x2b;
+
+ case Key.Calculator:
+ return 0xa1;
+
+ case Key.CapsLock:
+ return 0x3a;
+
+ case Key.Colon:
+ return 0x92;
+
+ case Key.Comma:
+ return 0x33;
+
+ case Key.Convert:
+ return 0x79;
+
+ case Key.Delete:
+ return 0xd3;
+
+ case Key.DownArrow:
+ return 0xd0;
+
+ case Key.End:
+ return 0xcf;
+
+ case Key.Equals:
+ return 13;
+
+ case Key.Escape:
+ return 1;
+
+ case Key.F1:
+ return 0x3b;
+
+ case Key.F2:
+ return 60;
+
+ case Key.F3:
+ return 0x3d;
+
+ case Key.F4:
+ return 0x3e;
+
+ case Key.F5:
+ return 0x3f;
+
+ case Key.F6:
+ return 0x40;
+
+ case Key.F7:
+ return 0x41;
+
+ case Key.F8:
+ return 0x42;
+
+ case Key.F9:
+ return 0x43;
+
+ case Key.F10:
+ return 0x44;
+
+ case Key.F11:
+ return 0x57;
+
+ case Key.F12:
+ return 0x58;
+
+ case Key.F13:
+ return 100;
+
+ case Key.F14:
+ return 0x65;
+
+ case Key.F15:
+ return 0x66;
+
+ case Key.Grave:
+ return 0x29;
+
+ case Key.Home:
+ return 0xc7;
+
+ case Key.Insert:
+ return 210;
+
+ case Key.Kana:
+ return 0x70;
+
+ case Key.Kanji:
+ return 0x94;
+
+ case Key.LeftBracket:
+ return 0x1a;
+
+ case Key.LeftControl:
+ return 0x1d;
+
+ case Key.LeftArrow:
+ return 0xcb;
+
+ case Key.LeftAlt:
+ return 0x38;
+
+ case Key.LeftShift:
+ return 0x2a;
+
+ case Key.LeftWindowsKey:
+ return 0xdb;
+
+ case Key.Mail:
+ return 0xec;
+
+ case Key.MediaSelect:
+ return 0xed;
+
+ case Key.MediaStop:
+ return 0xa4;
+
+ case Key.Minus:
+ return 12;
+
+ case Key.Mute:
+ return 160;
+
+ case Key.MyComputer:
+ return 0xeb;
+
+ case Key.NextTrack:
+ return 0x99;
+
+ case Key.NoConvert:
+ return 0x7b;
+
+ case Key.NumberLock:
+ return 0x45;
+
+ case Key.NumberPad0:
+ return 0x52;
+
+ case Key.NumberPad1:
+ return 0x4f;
+
+ case Key.NumberPad2:
+ return 80;
+
+ case Key.NumberPad3:
+ return 0x51;
+
+ case Key.NumberPad4:
+ return 0x4b;
+
+ case Key.NumberPad5:
+ return 0x4c;
+
+ case Key.NumberPad6:
+ return 0x4d;
+
+ case Key.NumberPad7:
+ return 0x47;
+
+ case Key.NumberPad8:
+ return 0x48;
+
+ case Key.NumberPad9:
+ return 0x49;
+
+ case Key.NumberPadComma:
+ return 0xb3;
+
+ case Key.NumberPadEnter:
+ return 0x9c;
+
+ case Key.NumberPadEquals:
+ return 0x8d;
+
+ case Key.NumberPadMinus:
+ return 0x4a;
+
+ case Key.NumberPadPeriod:
+ return 0x53;
+
+ case Key.NumberPadPlus:
+ return 0x4e;
+
+ case Key.NumberPadSlash:
+ return 0xb5;
+
+ case Key.NumberPadStar:
+ return 0x37;
+
+ case Key.Oem102:
+ return 0x56;
+
+ case Key.PageDown:
+ return 0xd1;
+
+ case Key.PageUp:
+ return 0xc9;
+
+ case Key.Pause:
+ return 0xc5;
+
+ case Key.Period:
+ return 0x34;
+
+ case Key.PlayPause:
+ return 0xa2;
+
+ case Key.Power:
+ return 0xde;
+
+ case Key.PreviousTrack:
+ return 0x90;
+
+ case Key.RightBracket:
+ return 0x1b;
+
+ case Key.RightControl:
+ return 0x9d;
+
+ case Key.Return:
+ return 0x1c;
+
+ case Key.RightArrow:
+ return 0xcd;
+
+ case Key.RightAlt:
+ return 0xb8;
+
+ case Key.RightShift:
+ return 0x36;
+
+ case Key.RightWindowsKey:
+ return 220;
+
+ case Key.ScrollLock:
+ return 70;
+
+ case Key.Semicolon:
+ return 0x27;
+
+ case Key.Slash:
+ return 0x35;
+
+ case Key.Sleep:
+ return 0xdf;
+
+ case Key.Space:
+ return 0x39;
+
+ case Key.Stop:
+ return 0x95;
+
+ case Key.PrintScreen:
+ return 0xb7;
+
+ case Key.Tab:
+ return 15;
+
+ case Key.Underline:
+ return 0x93;
+
+ case Key.Unlabeled:
+ return 0x97;
+
+ case Key.UpArrow:
+ return 200;
+
+ case Key.VolumeDown:
+ return 0xae;
+
+ case Key.VolumeUp:
+ return 0xb0;
+
+ case Key.Wake:
+ return 0xe3;
+
+ case Key.WebBack:
+ return 0xea;
+
+ case Key.WebFavorites:
+ return 230;
+
+ case Key.WebForward:
+ return 0xe9;
+
+ case Key.WebHome:
+ return 0xb2;
+
+ case Key.WebRefresh:
+ return 0xe7;
+
+ case Key.WebSearch:
+ return 0xe5;
+
+ case Key.WebStop:
+ return 0xe8;
+
+ case Key.Yen:
+ return 0x7d;
+ }
+ return 0;
+ }
+ public static Keys KeyToKeyCode(SlimDXKey key)
+ {
+ switch ( key )
+ {
+ case Key.D0:
+ return Keys.D0;
+
+ case Key.D1:
+ return Keys.D1;
+
+ case Key.D2:
+ return Keys.D2;
+
+ case Key.D3:
+ return Keys.D3;
+
+ case Key.D4:
+ return Keys.D4;
+
+ case Key.D5:
+ return Keys.D5;
+
+ case Key.D6:
+ return Keys.D6;
+
+ case Key.D7:
+ return Keys.D7;
+
+ case Key.D8:
+ return Keys.D8;
+
+ case Key.D9:
+ return Keys.D9;
+
+ case Key.A:
+ return Keys.A;
+
+ case Key.B:
+ return Keys.B;
+
+ case Key.C:
+ return Keys.C;
+
+ case Key.D:
+ return Keys.D;
+
+ case Key.E:
+ return Keys.E;
+
+ case Key.F:
+ return Keys.F;
+
+ case Key.G:
+ return Keys.G;
+
+ case Key.H:
+ return Keys.H;
+
+ case Key.I:
+ return Keys.I;
+
+ case Key.J:
+ return Keys.J;
+
+ case Key.K:
+ return Keys.K;
+
+ case Key.L:
+ return Keys.L;
+
+ case Key.M:
+ return Keys.M;
+
+ case Key.N:
+ return Keys.N;
+
+ case Key.O:
+ return Keys.O;
+
+ case Key.P:
+ return Keys.P;
+
+ case Key.Q:
+ return Keys.Q;
+
+ case Key.R:
+ return Keys.R;
+
+ case Key.S:
+ return Keys.S;
+
+ case Key.T:
+ return Keys.T;
+
+ case Key.U:
+ return Keys.U;
+
+ case Key.V:
+ return Keys.V;
+
+ case Key.W:
+ return Keys.W;
+
+ case Key.X:
+ return Keys.X;
+
+ case Key.Y:
+ return Keys.Y;
+
+ case Key.Z:
+ return Keys.Z;
+
+// case Key.AbntC1:
+// return Keys.A; //0x73;
+ //147
+// case Key.AbntC2:
+// return Keys.A; //0x7e;
+
+// case Key.Apostrophe:
+// return Keys.A; ///
+
+ case Key.Applications:
+ return Keys.Apps;
+
+ case Key.AT:
+ return Keys.Oem3;
+
+// case Key.AX:
+// return Keys.A; ///
+
+ case Key.Backspace:
+ return Keys.Back;
+
+ case Key.Backslash:
+ return Keys.Oem5;
+
+// case Key.Calculator:
+// return Keys.A; ///
+
+ case Key.CapsLock:
+ return Keys.CapsLock;
+
+ case Key.Colon:
+ return Keys.Oem1;
+
+ case Key.Comma:
+ return Keys.Oemcomma;
+
+ case Key.Convert:
+ return Keys.IMEConvert;
+
+ case Key.Delete:
+ return Keys.Delete;
+
+ case Key.DownArrow:
+ return Keys.Down;
+
+ case Key.End:
+ return Keys.End;
+
+ case Key.Equals:
+ return Keys.A; ///
+
+ case Key.Escape:
+ return Keys.Escape;
+
+ case Key.F1:
+ return Keys.F1;
+
+ case Key.F2:
+ return Keys.F2;
+
+ case Key.F3:
+ return Keys.F3;
+
+ case Key.F4:
+ return Keys.F4;
+
+ case Key.F5:
+ return Keys.F5;
+
+ case Key.F6:
+ return Keys.F6;
+
+ case Key.F7:
+ return Keys.F7;
+
+ case Key.F8:
+ return Keys.F8;
+
+ case Key.F9:
+ return Keys.F9;
+
+ case Key.F10:
+ return Keys.F10;
+
+ case Key.F11:
+ return Keys.F11;
+
+ case Key.F12:
+ return Keys.F12;
+
+ case Key.F13:
+ return Keys.F13;
+
+ case Key.F14:
+ return Keys.F14;
+
+ case Key.F15:
+ return Keys.F15;
+
+ case Key.Grave:
+ return Keys.A; ///
+
+ case Key.Home:
+ return Keys.Home;
+
+ case Key.Insert:
+ return Keys.Insert;
+
+ case Key.Kana:
+ return Keys.KanaMode;
+
+ case Key.Kanji:
+ return Keys.KanjiMode;
+
+ case Key.LeftBracket:
+ return Keys.Oem4;
+
+ case Key.LeftControl:
+ return Keys.LControlKey;
+
+ case Key.LeftArrow:
+ return Keys.Left;
+
+ case Key.LeftAlt:
+ return Keys.LMenu;
+
+ case Key.LeftShift:
+ return Keys.LShiftKey;
+
+ case Key.LeftWindowsKey:
+ return Keys.LWin;
+
+ case Key.Mail:
+ return Keys.LaunchMail;
+
+ case Key.MediaSelect:
+ return Keys.SelectMedia;
+
+ case Key.MediaStop:
+ return Keys.MediaStop;
+
+ case Key.Minus:
+ return Keys.OemMinus;
+
+ case Key.Mute:
+ return Keys.VolumeMute;
+
+ case Key.MyComputer: ///
+ return Keys.A;
+
+ case Key.NextTrack:
+ return Keys.MediaNextTrack;
+
+ case Key.NoConvert:
+ return Keys.IMENonconvert;
+
+ case Key.NumberLock:
+ return Keys.NumLock;
+
+ case Key.NumberPad0:
+ return Keys.NumPad0;
+
+ case Key.NumberPad1:
+ return Keys.NumPad1;
+
+ case Key.NumberPad2:
+ return Keys.NumPad2;
+
+ case Key.NumberPad3:
+ return Keys.NumPad3;
+
+ case Key.NumberPad4:
+ return Keys.NumPad4;
+
+ case Key.NumberPad5:
+ return Keys.NumPad5;
+
+ case Key.NumberPad6:
+ return Keys.NumPad6;
+
+ case Key.NumberPad7:
+ return Keys.NumPad7;
+
+ case Key.NumberPad8:
+ return Keys.NumPad8;
+
+ case Key.NumberPad9:
+ return Keys.NumPad9;
+
+ case Key.NumberPadComma:
+ return Keys.Separator;
+
+ case Key.NumberPadEnter:
+ return Keys.A; //
+
+ case Key.NumberPadEquals:
+ return Keys.A; //
+
+ case Key.NumberPadMinus:
+ return Keys.Subtract;
+
+ case Key.NumberPadPeriod:
+ return Keys.Decimal;
+
+ case Key.NumberPadPlus:
+ return Keys.Add;
+
+ case Key.NumberPadSlash:
+ return Keys.Divide;
+
+ case Key.NumberPadStar:
+ return Keys.Multiply; //
+
+ case Key.Oem102:
+ return Keys.Oem102;
+
+ case Key.PageDown:
+ return Keys.PageDown;
+
+ case Key.PageUp:
+ return Keys.PageUp;
+
+ case Key.Pause:
+ return Keys.Pause;
+
+ case Key.Period:
+ return Keys.OemPeriod;
+
+ case Key.PlayPause:
+ return Keys.MediaPlayPause;
+
+ case Key.Power:
+ return Keys.A; ///
+
+ case Key.PreviousTrack:
+ return Keys.MediaPreviousTrack;
+
+ case Key.RightBracket:
+ return Keys.Oem6;
+
+ case Key.RightControl:
+ return Keys.RControlKey;
+
+ case Key.Return:
+ return Keys.Return;
+
+ case Key.RightArrow:
+ return Keys.Right;
+
+ case Key.RightAlt:
+ return Keys.RMenu;
+
+ case Key.RightShift:
+ return Keys.A;
+
+ case Key.RightWindowsKey:
+ return Keys.RWin;
+
+ case Key.ScrollLock:
+ return Keys.Scroll;
+
+ case Key.Semicolon:
+ return Keys.Oemplus; ///??
+
+ case Key.Slash:
+ return Keys.Oem2;
+
+ case Key.Sleep:
+ return Keys.Sleep;
+
+ case Key.Space:
+ return Keys.Space;
+
+ case Key.Stop:
+ return Keys.MediaStop;
+
+ case Key.PrintScreen:
+ return Keys.PrintScreen;
+
+ case Key.Tab:
+ return Keys.Tab;
+
+ case Key.Underline:
+ return Keys.Oem102;
+
+// case Key.Unlabeled: ///
+// return Keys.A;
+
+ case Key.UpArrow:
+ return Keys.Up;
+
+ case Key.VolumeDown:
+ return Keys.VolumeDown;
+
+ case Key.VolumeUp:
+ return Keys.VolumeUp;
+
+ case Key.Wake:
+ return Keys.A; ///
+
+ case Key.WebBack:
+ return Keys.BrowserBack;
+
+ case Key.WebFavorites:
+ return Keys.BrowserFavorites;
+
+ case Key.WebForward:
+ return Keys.BrowserForward;
+
+ case Key.WebHome:
+ return Keys.BrowserHome;
+
+ case Key.WebRefresh:
+ return Keys.BrowserRefresh;
+
+ case Key.WebSearch:
+ return Keys.BrowserSearch;
+
+ case Key.WebStop:
+ return Keys.BrowserStop;
+
+ case Key.Yen:
+ return Keys.OemBackslash;
+ }
+ return 0;
+ }
+
+ ///
+ /// 蟇セ蠢懊☆繧句、縺後↑縺代l縺ー SlimDX.DirectInput.Unknown 繧定ソ斐☆縲
+ ///
+ public static SlimDXKey DIKtoKey(SharpDXKey key)
+ {
+ if (_DIKtoKey.ContainsKey(key))
+ {
+ return _DIKtoKey[key];
+ }
+ else
+ {
+ return SlimDXKey.Unknown;
+ }
+ }
+
+ ///
+ /// 蟇セ蠢懊☆繧句、縺後↑縺代l縺ー System.Windows.Forms.Keys.None 繧定ソ斐☆縲
+ ///
+ public static WindowsKey KeyToKeys(SlimDXKey key)
+ {
+ if (_KeyToKeys.ContainsKey(key))
+ {
+ return _KeyToKeys[key];
+ }
+ else
+ {
+ return WindowsKey.None;
+ }
+ }
+
+
+ ///
+ /// DIK (SharpDX.DirectInput.Key) 縺九i SlimDX.DirectInput.Key 縺ク縺ョ螟画鋤陦ィ縲
+ ///
+ private static readonly Dictionary _DIKtoKey = new Dictionary() {
+ #region [ *** ]
+ { SharpDXKey.Unknown, SlimDXKey.Unknown },
+ { SharpDXKey.Escape, SlimDXKey.Escape },
+ { SharpDXKey.D1, SlimDXKey.D1 },
+ { SharpDXKey.D2, SlimDXKey.D2 },
+ { SharpDXKey.D3, SlimDXKey.D3 },
+ { SharpDXKey.D4, SlimDXKey.D4 },
+ { SharpDXKey.D5, SlimDXKey.D5 },
+ { SharpDXKey.D6, SlimDXKey.D6 },
+ { SharpDXKey.D7, SlimDXKey.D7 },
+ { SharpDXKey.D8, SlimDXKey.D8 },
+ { SharpDXKey.D9, SlimDXKey.D9 },
+ { SharpDXKey.D0, SlimDXKey.D0 },
+ { SharpDXKey.Minus, SlimDXKey.Minus },
+ { SharpDXKey.Equals, SlimDXKey.Equals },
+ { SharpDXKey.Back, SlimDXKey.Backspace },
+ { SharpDXKey.Tab, SlimDXKey.Tab },
+ { SharpDXKey.Q, SlimDXKey.Q },
+ { SharpDXKey.W, SlimDXKey.W },
+ { SharpDXKey.E, SlimDXKey.E },
+ { SharpDXKey.R, SlimDXKey.R },
+ { SharpDXKey.T, SlimDXKey.T },
+ { SharpDXKey.Y, SlimDXKey.Y },
+ { SharpDXKey.U, SlimDXKey.U },
+ { SharpDXKey.I, SlimDXKey.I },
+ { SharpDXKey.O, SlimDXKey.O },
+ { SharpDXKey.P, SlimDXKey.P },
+ { SharpDXKey.LeftBracket, SlimDXKey.LeftBracket },
+ { SharpDXKey.RightBracket, SlimDXKey.RightBracket },
+ { SharpDXKey.Return, SlimDXKey.Return },
+ { SharpDXKey.LeftControl, SlimDXKey.LeftControl },
+ { SharpDXKey.A, SlimDXKey.A },
+ { SharpDXKey.S, SlimDXKey.S },
+ { SharpDXKey.D, SlimDXKey.D },
+ { SharpDXKey.F, SlimDXKey.F },
+ { SharpDXKey.G, SlimDXKey.G },
+ { SharpDXKey.H, SlimDXKey.H },
+ { SharpDXKey.J, SlimDXKey.J },
+ { SharpDXKey.K, SlimDXKey.K },
+ { SharpDXKey.L, SlimDXKey.L },
+ { SharpDXKey.Semicolon, SlimDXKey.Semicolon },
+ { SharpDXKey.Apostrophe, SlimDXKey.Apostrophe },
+ { SharpDXKey.Grave, SlimDXKey.Grave },
+ { SharpDXKey.LeftShift, SlimDXKey.LeftShift },
+ { SharpDXKey.Backslash, SlimDXKey.Backslash },
+ { SharpDXKey.Z, SlimDXKey.Z },
+ { SharpDXKey.X, SlimDXKey.X },
+ { SharpDXKey.C, SlimDXKey.C },
+ { SharpDXKey.V, SlimDXKey.V },
+ { SharpDXKey.B, SlimDXKey.B },
+ { SharpDXKey.N, SlimDXKey.N },
+ { SharpDXKey.M, SlimDXKey.M },
+ { SharpDXKey.Comma, SlimDXKey.Comma },
+ { SharpDXKey.Period, SlimDXKey.Period },
+ { SharpDXKey.Slash, SlimDXKey.Slash },
+ { SharpDXKey.RightShift, SlimDXKey.RightShift },
+ { SharpDXKey.Multiply, SlimDXKey.NumberPadStar },
+ { SharpDXKey.LeftAlt, SlimDXKey.LeftAlt },
+ { SharpDXKey.Space, SlimDXKey.Space },
+ { SharpDXKey.Capital, SlimDXKey.CapsLock },
+ { SharpDXKey.F1, SlimDXKey.F1 },
+ { SharpDXKey.F2, SlimDXKey.F2 },
+ { SharpDXKey.F3, SlimDXKey.F3 },
+ { SharpDXKey.F4, SlimDXKey.F4 },
+ { SharpDXKey.F5, SlimDXKey.F5 },
+ { SharpDXKey.F6, SlimDXKey.F6 },
+ { SharpDXKey.F7, SlimDXKey.F7 },
+ { SharpDXKey.F8, SlimDXKey.F8 },
+ { SharpDXKey.F9, SlimDXKey.F9 },
+ { SharpDXKey.F10, SlimDXKey.F10 },
+ { SharpDXKey.NumberLock, SlimDXKey.NumberLock },
+ { SharpDXKey.ScrollLock, SlimDXKey.ScrollLock },
+ { SharpDXKey.NumberPad7, SlimDXKey.NumberPad7 },
+ { SharpDXKey.NumberPad8, SlimDXKey.NumberPad8 },
+ { SharpDXKey.NumberPad9, SlimDXKey.NumberPad9 },
+ { SharpDXKey.Subtract, SlimDXKey.NumberPadMinus },
+ { SharpDXKey.NumberPad4, SlimDXKey.NumberPad4 },
+ { SharpDXKey.NumberPad5, SlimDXKey.NumberPad5 },
+ { SharpDXKey.NumberPad6, SlimDXKey.NumberPad6 },
+ { SharpDXKey.Add, SlimDXKey.NumberPadPlus },
+ { SharpDXKey.NumberPad1, SlimDXKey.NumberPad1 },
+ { SharpDXKey.NumberPad2, SlimDXKey.NumberPad2 },
+ { SharpDXKey.NumberPad3, SlimDXKey.NumberPad3 },
+ { SharpDXKey.NumberPad0, SlimDXKey.NumberPad0 },
+ { SharpDXKey.Decimal, SlimDXKey.NumberPadPeriod },
+ { SharpDXKey.Oem102, SlimDXKey.Oem102 },
+ { SharpDXKey.F11, SlimDXKey.F11 },
+ { SharpDXKey.F12, SlimDXKey.F12 },
+ { SharpDXKey.F13, SlimDXKey.F13 },
+ { SharpDXKey.F14, SlimDXKey.F14 },
+ { SharpDXKey.F15, SlimDXKey.F15 },
+ { SharpDXKey.Kana, SlimDXKey.Kana },
+ { SharpDXKey.AbntC1, SlimDXKey.AbntC1 },
+ { SharpDXKey.Convert, SlimDXKey.Convert },
+ { SharpDXKey.NoConvert, SlimDXKey.NoConvert },
+ { SharpDXKey.Yen, SlimDXKey.Yen },
+ { SharpDXKey.AbntC2, SlimDXKey.AbntC2 },
+ { SharpDXKey.NumberPadEquals, SlimDXKey.NumberPadEquals },
+ { SharpDXKey.PreviousTrack, SlimDXKey.PreviousTrack },
+ { SharpDXKey.AT, SlimDXKey.AT },
+ { SharpDXKey.Colon, SlimDXKey.Colon },
+ { SharpDXKey.Underline, SlimDXKey.Underline },
+ { SharpDXKey.Kanji, SlimDXKey.Kanji },
+ { SharpDXKey.Stop, SlimDXKey.Stop },
+ { SharpDXKey.AX, SlimDXKey.AX },
+ { SharpDXKey.Unlabeled, SlimDXKey.Unlabeled },
+ { SharpDXKey.NextTrack, SlimDXKey.NextTrack },
+ { SharpDXKey.NumberPadEnter, SlimDXKey.NumberPadEnter },
+ { SharpDXKey.RightControl, SlimDXKey.RightControl },
+ { SharpDXKey.Mute, SlimDXKey.Mute },
+ { SharpDXKey.Calculator, SlimDXKey.Calculator },
+ { SharpDXKey.PlayPause, SlimDXKey.PlayPause },
+ { SharpDXKey.MediaStop, SlimDXKey.MediaStop },
+ { SharpDXKey.VolumeDown, SlimDXKey.VolumeDown },
+ { SharpDXKey.VolumeUp, SlimDXKey.VolumeUp },
+ { SharpDXKey.WebHome, SlimDXKey.WebHome },
+ { SharpDXKey.PrintScreen, SlimDXKey.PrintScreen },
+ { SharpDXKey.RightAlt, SlimDXKey.RightAlt },
+ { SharpDXKey.Pause, SlimDXKey.Pause },
+ { SharpDXKey.Home, SlimDXKey.Home },
+ { SharpDXKey.Up, SlimDXKey.UpArrow },
+ { SharpDXKey.PageUp, SlimDXKey.PageUp },
+ { SharpDXKey.Left, SlimDXKey.LeftArrow },
+ { SharpDXKey.Right, SlimDXKey.RightArrow },
+ { SharpDXKey.End, SlimDXKey.End },
+ { SharpDXKey.Down, SlimDXKey.DownArrow },
+ { SharpDXKey.PageDown, SlimDXKey.PageDown },
+ { SharpDXKey.Insert, SlimDXKey.Insert },
+ { SharpDXKey.Delete, SlimDXKey.Delete },
+ { SharpDXKey.LeftWindowsKey, SlimDXKey.LeftWindowsKey },
+ { SharpDXKey.RightWindowsKey, SlimDXKey.RightWindowsKey },
+ { SharpDXKey.Applications, SlimDXKey.Applications },
+ { SharpDXKey.Power, SlimDXKey.Power },
+ { SharpDXKey.Sleep, SlimDXKey.Sleep },
+ { SharpDXKey.Wake, SlimDXKey.Wake },
+ { SharpDXKey.WebSearch, SlimDXKey.WebSearch },
+ { SharpDXKey.WebFavorites, SlimDXKey.WebFavorites },
+ { SharpDXKey.WebRefresh, SlimDXKey.WebRefresh },
+ { SharpDXKey.WebStop, SlimDXKey.WebStop },
+ { SharpDXKey.WebForward, SlimDXKey.WebForward },
+ { SharpDXKey.WebBack, SlimDXKey.WebBack },
+ { SharpDXKey.MyComputer, SlimDXKey.MyComputer },
+ { SharpDXKey.Mail, SlimDXKey.Mail },
+ { SharpDXKey.MediaSelect, SlimDXKey.MediaSelect },
+ #endregion
+ };
+
+ ///
+ /// SlimDX.DirectInput.Key 縺九i System.Windows.Form.Keys 縺ク縺ョ螟画鋤陦ィ縲
+ ///
+ private static readonly Dictionary _KeyToKeys = new Dictionary() {
+ #region [ *** ]
+ { SlimDXKey.D0, WindowsKey.D0 },
+ { SlimDXKey.D1, WindowsKey.D1 },
+ { SlimDXKey.D2, WindowsKey.D2 },
+ { SlimDXKey.D3, WindowsKey.D3 },
+ { SlimDXKey.D4, WindowsKey.D4 },
+ { SlimDXKey.D5, WindowsKey.D5 },
+ { SlimDXKey.D6, WindowsKey.D6 },
+ { SlimDXKey.D7, WindowsKey.D7 },
+ { SlimDXKey.D8, WindowsKey.D8 },
+ { SlimDXKey.D9, WindowsKey.D9 },
+ { SlimDXKey.A, WindowsKey.A },
+ { SlimDXKey.B, WindowsKey.B },
+ { SlimDXKey.C, WindowsKey.C },
+ { SlimDXKey.D, WindowsKey.D },
+ { SlimDXKey.E, WindowsKey.E },
+ { SlimDXKey.F, WindowsKey.F },
+ { SlimDXKey.G, WindowsKey.G },
+ { SlimDXKey.H, WindowsKey.H },
+ { SlimDXKey.I, WindowsKey.I },
+ { SlimDXKey.J, WindowsKey.J },
+ { SlimDXKey.K, WindowsKey.K },
+ { SlimDXKey.L, WindowsKey.L },
+ { SlimDXKey.M, WindowsKey.M },
+ { SlimDXKey.N, WindowsKey.N },
+ { SlimDXKey.O, WindowsKey.O },
+ { SlimDXKey.P, WindowsKey.P },
+ { SlimDXKey.Q, WindowsKey.Q },
+ { SlimDXKey.R, WindowsKey.R },
+ { SlimDXKey.S, WindowsKey.S },
+ { SlimDXKey.T, WindowsKey.T },
+ { SlimDXKey.U, WindowsKey.U },
+ { SlimDXKey.V, WindowsKey.V },
+ { SlimDXKey.W, WindowsKey.W },
+ { SlimDXKey.X, WindowsKey.X },
+ { SlimDXKey.Y, WindowsKey.Y },
+ { SlimDXKey.Z, WindowsKey.Z },
+ //{ SlimDXKey.AbntC1, WindowsKey.A },
+ //{ SlimDXKey.AbntC2, WindowsKey.A },
+ { SlimDXKey.Apostrophe, WindowsKey.OemQuotes },
+ { SlimDXKey.Applications, WindowsKey.Apps },
+ { SlimDXKey.AT, WindowsKey.Oem3 }, // OemTilde 縺ィ蜷悟、
+ //{ SlimDXKey.AX, WindowsKey.A }, // OemAX (225) 縺ッ譛ェ螳夂セゥ
+ { SlimDXKey.Backspace, WindowsKey.Back },
+ { SlimDXKey.Backslash, WindowsKey.OemBackslash },
+ //{ SlimDXKey.Calculator, WindowsKey.A },
+ { SlimDXKey.CapsLock, WindowsKey.CapsLock },
+ { SlimDXKey.Colon, WindowsKey.Oem1 },
+ { SlimDXKey.Comma, WindowsKey.Oemcomma },
+ { SlimDXKey.Convert, WindowsKey.IMEConvert },
+ { SlimDXKey.Delete, WindowsKey.Delete },
+ { SlimDXKey.DownArrow, WindowsKey.Down },
+ { SlimDXKey.End, WindowsKey.End },
+ { SlimDXKey.Equals, WindowsKey.A }, // ?
+ { SlimDXKey.Escape, WindowsKey.Escape },
+ { SlimDXKey.F1, WindowsKey.F1 },
+ { SlimDXKey.F2, WindowsKey.F2 },
+ { SlimDXKey.F3, WindowsKey.F3 },
+ { SlimDXKey.F4, WindowsKey.F4 },
+ { SlimDXKey.F5, WindowsKey.F5 },
+ { SlimDXKey.F6, WindowsKey.F6 },
+ { SlimDXKey.F7, WindowsKey.F7 },
+ { SlimDXKey.F8, WindowsKey.F8 },
+ { SlimDXKey.F9, WindowsKey.F9 },
+ { SlimDXKey.F10, WindowsKey.F10 },
+ { SlimDXKey.F11, WindowsKey.F11 },
+ { SlimDXKey.F12, WindowsKey.F12 },
+ { SlimDXKey.F13, WindowsKey.F13 },
+ { SlimDXKey.F14, WindowsKey.F14 },
+ { SlimDXKey.F15, WindowsKey.F15 },
+ { SlimDXKey.Grave, WindowsKey.A }, // ?
+ { SlimDXKey.Home, WindowsKey.Home },
+ { SlimDXKey.Insert, WindowsKey.Insert },
+ { SlimDXKey.Kana, WindowsKey.KanaMode },
+ { SlimDXKey.Kanji, WindowsKey.KanjiMode },
+ { SlimDXKey.LeftBracket, WindowsKey.Oem4 },
+ { SlimDXKey.LeftControl, WindowsKey.LControlKey },
+ { SlimDXKey.LeftArrow, WindowsKey.Left },
+ { SlimDXKey.LeftAlt, WindowsKey.LMenu },
+ { SlimDXKey.LeftShift, WindowsKey.LShiftKey },
+ { SlimDXKey.LeftWindowsKey, WindowsKey.LWin },
+ { SlimDXKey.Mail, WindowsKey.LaunchMail },
+ { SlimDXKey.MediaSelect, WindowsKey.SelectMedia },
+ { SlimDXKey.MediaStop, WindowsKey.MediaStop },
+ { SlimDXKey.Minus, WindowsKey.OemMinus },
+ { SlimDXKey.Mute, WindowsKey.VolumeMute },
+ { SlimDXKey.MyComputer, WindowsKey.A }, // ?
+ { SlimDXKey.NextTrack, WindowsKey.MediaNextTrack },
+ { SlimDXKey.NoConvert, WindowsKey.IMENonconvert },
+ { SlimDXKey.NumberLock, WindowsKey.NumLock },
+ { SlimDXKey.NumberPad0, WindowsKey.NumPad0 },
+ { SlimDXKey.NumberPad1, WindowsKey.NumPad1 },
+ { SlimDXKey.NumberPad2, WindowsKey.NumPad2 },
+ { SlimDXKey.NumberPad3, WindowsKey.NumPad3 },
+ { SlimDXKey.NumberPad4, WindowsKey.NumPad4 },
+ { SlimDXKey.NumberPad5, WindowsKey.NumPad5 },
+ { SlimDXKey.NumberPad6, WindowsKey.NumPad6 },
+ { SlimDXKey.NumberPad7, WindowsKey.NumPad7 },
+ { SlimDXKey.NumberPad8, WindowsKey.NumPad8 },
+ { SlimDXKey.NumberPad9, WindowsKey.NumPad9 },
+ { SlimDXKey.NumberPadComma, WindowsKey.Separator },
+ { SlimDXKey.NumberPadEnter, WindowsKey.A }, // ?
+ { SlimDXKey.NumberPadEquals, WindowsKey.A }, // ?
+ { SlimDXKey.NumberPadMinus, WindowsKey.Subtract },
+ { SlimDXKey.NumberPadPeriod, WindowsKey.Decimal },
+ { SlimDXKey.NumberPadPlus, WindowsKey.Add },
+ { SlimDXKey.NumberPadSlash, WindowsKey.Divide },
+ { SlimDXKey.NumberPadStar, WindowsKey.Multiply },
+ { SlimDXKey.Oem102, WindowsKey.Oem102 },
+ { SlimDXKey.PageDown, WindowsKey.PageDown },
+ { SlimDXKey.PageUp, WindowsKey.PageUp },
+ { SlimDXKey.Pause, WindowsKey.Pause },
+ { SlimDXKey.Period, WindowsKey.OemPeriod },
+ { SlimDXKey.PlayPause, WindowsKey.MediaPlayPause },
+ { SlimDXKey.Power, WindowsKey.A }, // ?
+ { SlimDXKey.PreviousTrack, WindowsKey.MediaPreviousTrack },
+ { SlimDXKey.RightBracket, WindowsKey.Oem6 },
+ { SlimDXKey.RightControl, WindowsKey.RControlKey },
+ { SlimDXKey.Return, WindowsKey.Return },
+ { SlimDXKey.RightArrow, WindowsKey.Right },
+ { SlimDXKey.RightAlt, WindowsKey.RMenu },
+ { SlimDXKey.RightShift, WindowsKey.A }, // ?
+ { SlimDXKey.RightWindowsKey, WindowsKey.RWin },
+ { SlimDXKey.ScrollLock, WindowsKey.Scroll },
+ { SlimDXKey.Semicolon, WindowsKey.Oemplus }, // OemSemicolon 縺倥c縺ェ縺上※シ
+ { SlimDXKey.Slash, WindowsKey.Oem2 },
+ { SlimDXKey.Sleep, WindowsKey.Sleep },
+ { SlimDXKey.Space, WindowsKey.Space },
+ { SlimDXKey.Stop, WindowsKey.MediaStop },
+ { SlimDXKey.PrintScreen, WindowsKey.PrintScreen },
+ { SlimDXKey.Tab, WindowsKey.Tab },
+ { SlimDXKey.Underline, WindowsKey.Oem102 },
+ //{ SlimDXKey.Unlabeled, WindowsKey.A }, // ?
+ { SlimDXKey.UpArrow, WindowsKey.Up },
+ { SlimDXKey.VolumeDown, WindowsKey.VolumeDown },
+ { SlimDXKey.VolumeUp, WindowsKey.VolumeUp },
+ { SlimDXKey.Wake, WindowsKey.A }, // ?
+ { SlimDXKey.WebBack, WindowsKey.BrowserBack },
+ { SlimDXKey.WebFavorites, WindowsKey.BrowserFavorites },
+ { SlimDXKey.WebForward, WindowsKey.BrowserForward },
+ { SlimDXKey.WebHome, WindowsKey.BrowserHome },
+ { SlimDXKey.WebRefresh, WindowsKey.BrowserRefresh },
+ { SlimDXKey.WebSearch, WindowsKey.BrowserSearch },
+ { SlimDXKey.WebStop, WindowsKey.BrowserStop },
+ { SlimDXKey.Yen, WindowsKey.OemBackslash },
+ #endregion
+ };
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.cs
new file mode 100644
index 00000000..2109b159
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.cs
@@ -0,0 +1,17 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ // 螳壽焚
+
+ public enum E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・
+ {
+ Keyboard,
+ Mouse,
+ Joystick,
+ MidiIn,
+ Unknown
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/IInputDevice.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/IInputDevice.cs
new file mode 100644
index 00000000..7b42faa4
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/IInputDevice.cs
@@ -0,0 +1,37 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ public interface IInputDevice : IDisposable
+ {
+ // 繝励Ο繝代ユ繧」
+
+ E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・
+ {
+ get;
+ }
+ string GUID
+ {
+ get;
+ }
+ int ID
+ {
+ get;
+ }
+ List list蜈・蜉帙う繝吶Φ繝
+ {
+ get;
+ }
+
+
+ // 繝。繧ス繝繝峨う繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ
+
+ void t繝昴シ繝ェ繝ウ繧ー( bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k );
+ bool b繧ュ繝シ縺梧款縺輔l縺( int nKey );
+ bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( int nKey );
+ bool b繧ュ繝シ縺碁屬縺輔l縺( int nKey );
+ bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧( int nKey );
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/STInputEvent.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/STInputEvent.cs
new file mode 100644
index 00000000..1903df4f
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/STInputEvent.cs
@@ -0,0 +1,19 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace FDK
+{
+ // 讒矩菴
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STInputEvent
+ {
+ public int nKey { get; set; }
+ public bool b謚シ縺輔l縺 { get; set; }
+ public bool b髮「縺輔l縺 { get; set; }
+ public long nTimeStamp { get; set; }
+ public int nVelocity { get; set; }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/SlimDXKeys.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/SlimDXKeys.cs
new file mode 100644
index 00000000..3a876285
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/SlimDXKeys.cs
@@ -0,0 +1,171 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SlimDXKeys
+{
+ public enum Key
+ {
+ D0 = 0,
+ D1 = 1,
+ D2 = 2,
+ D3 = 3,
+ D4 = 4,
+ D5 = 5,
+ D6 = 6,
+ D7 = 7,
+ D8 = 8,
+ D9 = 9,
+ A = 10,
+ B = 11,
+ C = 12,
+ D = 13,
+ E = 14,
+ F = 15,
+ G = 16,
+ H = 17,
+ I = 18,
+ J = 19,
+ K = 20,
+ L = 21,
+ M = 22,
+ N = 23,
+ O = 24,
+ P = 25,
+ Q = 26,
+ R = 27,
+ S = 28,
+ T = 29,
+ U = 30,
+ V = 31,
+ W = 32,
+ X = 33,
+ Y = 34,
+ Z = 35,
+ AbntC1 = 36,
+ AbntC2 = 37,
+ Apostrophe = 38,
+ Applications = 39,
+ AT = 40,
+ AX = 41,
+ Backspace = 42,
+ Backslash = 43,
+ Calculator = 44,
+ CapsLock = 45,
+ Colon = 46,
+ Comma = 47,
+ Convert = 48,
+ Delete = 49,
+ DownArrow = 50,
+ End = 51,
+ Equals = 52,
+ Escape = 53,
+ F1 = 54,
+ F2 = 55,
+ F3 = 56,
+ F4 = 57,
+ F5 = 58,
+ F6 = 59,
+ F7 = 60,
+ F8 = 61,
+ F9 = 62,
+ F10 = 63,
+ F11 = 64,
+ F12 = 65,
+ F13 = 66,
+ F14 = 67,
+ F15 = 68,
+ Grave = 69,
+ Home = 70,
+ Insert = 71,
+ Kana = 72,
+ Kanji = 73,
+ LeftBracket = 74,
+ LeftControl = 75,
+ LeftArrow = 76,
+ LeftAlt = 77,
+ LeftShift = 78,
+ LeftWindowsKey = 79,
+ Mail = 80,
+ MediaSelect = 81,
+ MediaStop = 82,
+ Minus = 83,
+ Mute = 84,
+ MyComputer = 85,
+ NextTrack = 86,
+ NoConvert = 87,
+ NumberLock = 88,
+ NumberPad0 = 89,
+ NumberPad1 = 90,
+ NumberPad2 = 91,
+ NumberPad3 = 92,
+ NumberPad4 = 93,
+ NumberPad5 = 94,
+ NumberPad6 = 95,
+ NumberPad7 = 96,
+ NumberPad8 = 97,
+ NumberPad9 = 98,
+ NumberPadComma = 99,
+ NumberPadEnter = 100,
+ NumberPadEquals = 101,
+ NumberPadMinus = 102,
+ NumberPadPeriod = 103,
+ NumberPadPlus = 104,
+ NumberPadSlash = 105,
+ NumberPadStar = 106,
+ Oem102 = 107,
+ PageDown = 108,
+ PageUp = 109,
+ Pause = 110,
+ Period = 111,
+ PlayPause = 112,
+ Power = 113,
+ PreviousTrack = 114,
+ RightBracket = 115,
+ RightControl = 116,
+ Return = 117,
+ RightArrow = 118,
+ RightAlt = 119,
+ RightShift = 120,
+ RightWindowsKey = 121,
+ ScrollLock = 122,
+ Semicolon = 123,
+ Slash = 124,
+ Sleep = 125,
+ Space = 126,
+ Stop = 127,
+ PrintScreen = 128,
+ Tab = 129,
+ Underline = 130,
+ Unlabeled = 131,
+ UpArrow = 132,
+ VolumeDown = 133,
+ VolumeUp = 134,
+ Wake = 135,
+ WebBack = 136,
+ WebFavorites = 137,
+ WebForward = 138,
+ WebHome = 139,
+ WebRefresh = 140,
+ WebSearch = 141,
+ WebStop = 142,
+ Yen = 143,
+ Unknown = 144
+ }
+ public enum MouseObject
+ {
+ Button1 = 0,
+ Button2 = 1,
+ Button3 = 2,
+ Button4 = 3,
+ Button5 = 4,
+ Button6 = 5,
+ Button7 = 6,
+ Button8 = 7,
+ XAxis = 8,
+ YAxis = 9,
+ ZAxis = 10
+ }
+}
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSound.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSound.cs
new file mode 100644
index 00000000..ba66b6fc
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSound.cs
@@ -0,0 +1,2052 @@
+using System;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using FDK.ExtensionMethods;
+using SharpDX.DirectSound;
+using SharpDX.Multimedia;
+using Un4seen.Bass;
+using Un4seen.BassAsio;
+using Un4seen.BassWasapi;
+using Un4seen.Bass.AddOn.Mix;
+using Un4seen.Bass.AddOn.Fx;
+
+
+namespace FDK
+{
+ #region [ DTXMania逕ィ諡。蠑オ ]
+ public class CSound邂。逅 // : CSound
+ {
+ private static ISoundDevice SoundDevice
+ {
+ get; set;
+ }
+ private static ESoundDeviceType SoundDeviceType
+ {
+ get; set;
+ }
+ public static CSoundTimer rc貍泌・冗畑繧ソ繧、繝 = null;
+ public static bool bUseOSTimer = false; // OS縺ョ繧ソ繧、繝槭シ繧剃スソ縺縺九,SoundTimer繧剃スソ縺縺九DTXC縺ァ縺ッfalse, DTXMania縺ァ縺ッtrue縲
+ // DTXC(DirectSound)縺ァCSoundTimer繧剃スソ縺縺ィ縲∝驛ィ縺ァ辟。髻ウ縺ョ繝ォ繝シ繝励し繧ヲ繝ウ繝峨r蜀咲函縺吶k縺溘a
+ // 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧貞頃譛峨@縺ヲ縺励∪縺縲〃iewer縺ィ縺励※蜻シ縺ウ蜃コ縺輔l繧汽TXMania縺ァ縲、SIO縺御スソ縺医↑縺上↑繧九
+
+ // DTXMania蜊倅ス薙〒縺薙l繧稚rue縺ォ縺吶k縺ィ縲仝ASAPI/ASIO譎ゅ↓貍泌・上ち繧、繝槭シ縺ィ縺励※FDK繧ソ繧、繝槭シ縺ァ縺ッ縺ェ縺
+ // 繧キ繧ケ繝繝縺ョ繧ソ繧、繝槭シ繧剃スソ縺繧医≧縺ォ縺ェ繧九ゅ%縺縺吶k縺ィ繧ケ繧ッ繝ュ繝シ繝ォ縺ッ貊代i縺九↓縺ェ繧九′縲髻ウ繧コ繝ャ縺悟コ繧九°繧ゅ@繧後↑縺縲
+
+ public static IntPtr WindowHandle;
+
+ public static bool bIsTimeStretch = false;
+
+ private static int _nMasterVolume;
+ public int nMasterVolume
+ {
+ get
+ {
+ return _nMasterVolume;
+ }
+ //get
+ //{
+ // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO )
+ // {
+ // return Bass.BASS_GetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM ) / 100;
+ // }
+ // else
+ // {
+ // return 100;
+ // }
+ //}
+ //set
+ //{
+ // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI )
+ // {
+ // // LINEAR縺ァ縺ェ縺集INDOWS(2)繧剃スソ縺蠢隕√′縺ゅk縺後‘xclusive譎ゅッ菴ソ逕ィ荳榊庄縲√∪縺溘ョ繝舌う繧ケ蛛エ縺悟ッセ蠢懊@縺ヲ縺ェ縺縺ィ菴ソ逕ィ荳榊庄
+ // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_LINEAR, value / 100.0f );
+ // if ( !b )
+ // {
+ // BASSError be = Bass.BASS_ErrorGetCode();
+ // Trace.TraceInformation( "WASAPI Master Volume Set Error: " + be.ToString() );
+ // }
+ // }
+ //}
+ //set
+ //{
+ // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO )
+ // {
+ // bool b = Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM, value * 100 );
+ // if ( !b )
+ // {
+ // BASSError be = Bass.BASS_ErrorGetCode();
+ // Trace.TraceInformation( "Master Volume Set Error: " + be.ToString() );
+ // }
+ // }
+ //}
+ //set
+ //{
+ // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO )
+ // {
+ // var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) };
+ // BassMix.BASS_Mixer_ChannelSetEnvelope( SoundDevice.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes );
+ // }
+ //}
+ set
+ {
+ SoundDevice.nMasterVolume = value;
+ _nMasterVolume = value;
+ }
+ }
+
+ /////
+ ///// BASS譎ゅ[p3繧偵せ繝医Μ繝シ繝溘Φ繧ー蜀咲函縺帙★縺ォ縲√ョ繧ウ繝シ繝峨@縺殲aw wav繧偵が繝ウ繝。繝「繝ェ蜀咲函縺吶k蝣エ蜷医ッtrue縺ォ縺吶k縲
+ ///// 迚ケ谿翫↑mp3繧剃スソ逕ィ譎ゅッ繧キ繝シ繧ッ縺御ケア繧後k縺ョ縺ァ縲∝ソ隕√↓蠢懊§縺ヲtrue縺ォ縺吶k縺薙→縲(Config.ini縺ョNoMP3Streaming縺ァ險ュ螳壼庄閭ス縲)
+ ///// 縺溘□縺励》rue縺ォ縺吶k縺ィ縲√◎縺ョ蛻蜀咲函髢句ァ九∪縺ァ縺ョ譎る俣縺碁聞縺上↑繧九
+ /////
+ //public static bool bIsMP3DecodeByWindowsCodec = false;
+
+ public static int nMixing = 0;
+ public int GetMixingStreams()
+ {
+ return nMixing;
+ }
+ public static int nStreams = 0;
+ public int GetStreams()
+ {
+ return nStreams;
+ }
+ #region [ WASAPI/ASIO/DirectSound險ュ螳壼、 ]
+ ///
+ /// WASAPI 謗剃サ悶Δ繝シ繝牙コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]シ医ョ蟶梧悍蛟、シ峨よ怙邨ら噪縺ォ縺ッ縺薙ョ謨ー蛟、繧貞渕縺ォ繝峨Λ繧、繝舌′豎コ螳壹☆繧具シ峨
+ /// 0莉・荳九ョ蛟、繧呈欠螳壹☆繧九→縲√%縺ョ謨ー蛟、縺ッWASAPI蛻晄悄蛹匁凾縺ォ閾ェ蜍戊ィュ螳壹☆繧九よュ」謨ー繧呈欠螳壹☆繧九→縲√◎縺ョ蛟、繧定ィュ螳壹@繧医≧縺ィ隧ヲ縺ソ繧九
+ ///
+ public static int SoundDelayExclusiveWASAPI = 0; // SST縺ァ縺ッ縲50ms
+ public int GetSoundExclusiveWASAPI()
+ {
+ return SoundDelayExclusiveWASAPI;
+ }
+ public void SetSoundDelayExclusiveWASAPI( int value )
+ {
+ SoundDelayExclusiveWASAPI = value;
+ }
+ ///
+ /// WASAPI 蜈ア譛峨Δ繝シ繝牙コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]縲ゅΘ繝シ繧カ縺梧アコ螳壹☆繧九
+ ///
+ public static int SoundDelaySharedWASAPI = 100;
+ ///
+ /// 謗剃サ妨ASAPI繝舌ャ繝輔ぃ縺ョ譖エ譁ー髢馴囈縲ょコ蜉幃俣髫斐〒縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上
+ /// 竊 閾ェ蜍戊ィュ螳壹&繧後k縺ョ縺ァSoundDelay 繧医j繧ょー上&縺蛟、縺ァ縺ゅk縺薙→縲ゑシ亥ー上&縺吶℃繧句エ蜷医ッBASS縺ォ繧医▲縺ヲ閾ェ蜍穂ソョ豁」縺輔l繧九ゑシ
+ ///
+ public static int SoundUpdatePeriodExclusiveWASAPI = 6;
+ ///
+ /// 蜈ア譛姥ASAPI繝舌ャ繝輔ぃ縺ョ譖エ譁ー髢馴囈縲ょコ蜉幃俣髫斐〒縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上
+ /// SoundDelay 繧医j繧ょー上&縺蛟、縺ァ縺ゅk縺薙→縲ゑシ亥ー上&縺吶℃繧句エ蜷医ッBASS縺ォ繧医▲縺ヲ閾ェ蜍穂ソョ豁」縺輔l繧九ゑシ
+ ///
+ public static int SoundUpdatePeriodSharedWASAPI = 6;
+ /////
+ ///// ASIO 蜃コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]シ医ョ蟶梧悍蛟、シ峨よ怙邨ら噪縺ォ縺ッ縺薙ョ謨ー蛟、繧貞渕縺ォ繝峨Λ繧、繝舌′豎コ螳壹☆繧具シ峨
+ /////
+ //public static int SoundDelayASIO = 0; // SST縺ァ縺ッ50ms縲0縺ォ縺吶k縺ィ縲√ョ繝舌う繧ケ縺ョ險ュ螳壼、繧偵◎縺ョ縺セ縺セ菴ソ縺縲
+ ///
+ /// ASIO 蜃コ蜉帙↓縺翫¢繧九ヰ繝繝輔ぃ繧オ繧、繧コ縲
+ ///
+ public static int SoundDelayASIO = 0; // 0縺ォ縺吶k縺ィ縲√ョ繝舌う繧ケ縺ョ險ュ螳壼、繧偵◎縺ョ縺セ縺セ菴ソ縺縲
+ public int GetSoundDelayASIO()
+ {
+ return SoundDelayASIO;
+ }
+ public void SetSoundDelayASIO(int value)
+ {
+ SoundDelayASIO = value;
+ }
+ public static int ASIODevice = 0;
+ public int GetASIODevice()
+ {
+ return ASIODevice;
+ }
+ public void SetASIODevice(int value)
+ {
+ ASIODevice = value;
+ }
+ ///
+ /// DirectSound 蜃コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]縲ゅΘ繝シ繧カ縺梧アコ螳壹☆繧九
+ ///
+ public static int SoundDelayDirectSound = 100;
+
+ public long GetSoundDelay()
+ {
+ if ( SoundDevice != null )
+ {
+ return SoundDevice.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms;
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ #endregion
+
+
+ ///
+ /// DTXMania逕ィ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public CSound邂。逅( IntPtr handle, ESoundDeviceType soundDeviceType, int nSoundDelayExclusiveWASAPI, int nSoundDelayASIO, int nASIODevice, bool _bUseOSTimer )
+ {
+ WindowHandle = handle;
+ SoundDevice = null;
+ //bUseOSTimer = false;
+ t蛻晄悄蛹( soundDeviceType, nSoundDelayExclusiveWASAPI, nSoundDelayASIO, nASIODevice, _bUseOSTimer );
+ }
+ public void Dispose()
+ {
+ t邨ゆコ();
+ }
+
+ //public static void t蛻晄悄蛹()
+ //{
+ // t蛻晄悄蛹( ESoundDeviceType.DirectSound, 0, 0, 0 );
+ //}
+
+ public void t蛻晄悄蛹( ESoundDeviceType soundDeviceType, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, IntPtr handle )
+ {
+ //if ( !bInitialized )
+ {
+ WindowHandle = handle;
+ t蛻晄悄蛹( soundDeviceType, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice );
+ //bInitialized = true;
+ }
+ }
+ public void t蛻晄悄蛹( ESoundDeviceType soundDeviceType, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice )
+ {
+ t蛻晄悄蛹( soundDeviceType, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice, false );
+ }
+
+ public void t蛻晄悄蛹( ESoundDeviceType soundDeviceType, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, bool _bUseOSTimer )
+ {
+ //SoundDevice = null; // 蠕後〒蜀榊晄悄蛹悶☆繧九%縺ィ縺後≠繧九ョ縺ァ縲]ull蛻晄悄蛹悶ッ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺ォ蝗槭☆
+ rc貍泌・冗畑繧ソ繧、繝 = null; // Global.Bass 萓晏ュ假シ医▽縺セ繧翫Θ繝シ繧カ萓晏ュ假シ
+ nMixing = 0;
+
+ SoundDelayExclusiveWASAPI = _nSoundDelayExclusiveWASAPI;
+ SoundDelayASIO = _nSoundDelayASIO;
+ ASIODevice = _nASIODevice;
+ bUseOSTimer = _bUseOSTimer;
+
+ ESoundDeviceType[] ESoundDeviceTypes = new ESoundDeviceType[ 4 ]
+ {
+ ESoundDeviceType.ExclusiveWASAPI,
+ ESoundDeviceType.ASIO,
+ ESoundDeviceType.DirectSound,
+ ESoundDeviceType.Unknown
+ };
+
+ int n蛻晄悄繝繝舌う繧ケ;
+ switch ( soundDeviceType )
+ {
+ case ESoundDeviceType.ExclusiveWASAPI:
+ n蛻晄悄繝繝舌う繧ケ = 0;
+ break;
+ case ESoundDeviceType.ASIO:
+ n蛻晄悄繝繝舌う繧ケ = 1;
+ break;
+ case ESoundDeviceType.DirectSound:
+ n蛻晄悄繝繝舌う繧ケ = 2;
+ break;
+ default:
+ n蛻晄悄繝繝舌う繧ケ = 3;
+ break;
+ }
+ for ( SoundDeviceType = ESoundDeviceTypes[ n蛻晄悄繝繝舌う繧ケ ]; ; SoundDeviceType = ESoundDeviceTypes[ ++n蛻晄悄繝繝舌う繧ケ ] )
+ {
+ try
+ {
+ t迴セ蝨ィ縺ョ繝ヲ繝シ繧カConfig縺ォ蠕薙▲縺ヲ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ縺吶∋縺ヲ縺ョ譌「蟄倥し繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧();
+ break;
+ }
+ catch ( Exception e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (2609806d-23e8-45c2-9389-b427e80915bc)" );
+ if ( ESoundDeviceTypes[ n蛻晄悄繝繝舌う繧ケ ] == ESoundDeviceType.Unknown )
+ {
+ Trace.TraceError( string.Format( "繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ) );
+ break;
+ }
+ }
+ }
+ if ( soundDeviceType == ESoundDeviceType.ExclusiveWASAPI || soundDeviceType == ESoundDeviceType.ASIO )
+ {
+ //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 4 );
+ //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 );
+
+ Trace.TraceInformation( "BASS_CONFIG_UpdatePeriod=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD ) );
+ Trace.TraceInformation( "BASS_CONFIG_UpdateThreads=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS ) );
+ }
+ }
+
+ public void tDisableUpdateBufferAutomatically()
+ {
+ //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 );
+ //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 );
+
+ //Trace.TraceInformation( "BASS_CONFIG_UpdatePeriod=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD ) );
+ //Trace.TraceInformation( "BASS_CONFIG_UpdateThreads=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS ) );
+ }
+
+
+ public static void t邨ゆコ()
+ {
+ C蜈ア騾.tDispose縺吶k( SoundDevice ); SoundDevice = null;
+ C蜈ア騾.tDispose縺吶k( ref rc貍泌・冗畑繧ソ繧、繝 ); // Global.Bass 繧定ァ」謾セ縺励◆蠕後↓隗」謾セ縺吶k縺薙→縲ゑシGlobal.Bass 縺ァ蜿らァ縺輔l縺ヲ縺繧九◆繧シ
+ }
+
+
+ public static void t迴セ蝨ィ縺ョ繝ヲ繝シ繧カConfig縺ォ蠕薙▲縺ヲ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ縺吶∋縺ヲ縺ョ譌「蟄倥し繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧()
+ {
+ #region [ 縺吶〒縺ォ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ貍泌・上ち繧、繝槭′讒狗ッ峨&繧後※縺繧後ー隗」謾セ縺吶k縲]
+ //-----------------
+ if ( SoundDevice != null )
+ {
+ // 縺吶〒縺ォ逕滓先ク医∩縺ョ繧オ繧ヲ繝ウ繝峨′縺ゅl縺ー蛻晄悄迥カ諷九↓謌サ縺吶
+
+ CSound.t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蛻晄悄迥カ諷九↓謌サ縺(); // 繝ェ繧ス繝シ繧ケ縺ッ隗」謾セ縺吶k縺後,Sound縺ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ッ谿九☆縲
+
+
+ // 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ貍泌・上ち繧、繝槭r隗」謾セ縺吶k縲
+
+ C蜈ア騾.tDispose縺吶k( SoundDevice ); SoundDevice = null;
+ C蜈ア騾.tDispose縺吶k( ref rc貍泌・冗畑繧ソ繧、繝 ); // Global.SoundDevice 繧定ァ」謾セ縺励◆蠕後↓隗」謾セ縺吶k縺薙→縲ゑシGlobal.SoundDevice 縺ァ蜿らァ縺輔l縺ヲ縺繧九◆繧シ
+ }
+ //-----------------
+ #endregion
+
+ #region [ 譁ー縺励>繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧呈ァ狗ッ峨☆繧九]
+ //-----------------
+ switch ( SoundDeviceType )
+ {
+ case ESoundDeviceType.ExclusiveWASAPI:
+ SoundDevice = new CSoundDeviceWASAPI( CSoundDeviceWASAPI.E繝繝舌う繧ケ繝「繝シ繝.蜈ア譛, SoundDelayExclusiveWASAPI, SoundUpdatePeriodExclusiveWASAPI );
+ break;
+
+ case ESoundDeviceType.SharedWASAPI:
+ SoundDevice = new CSoundDeviceWASAPI( CSoundDeviceWASAPI.E繝繝舌う繧ケ繝「繝シ繝.蜈ア譛, SoundDelaySharedWASAPI, SoundUpdatePeriodSharedWASAPI );
+ break;
+
+ case ESoundDeviceType.ASIO:
+ SoundDevice = new CSoundDeviceASIO( SoundDelayASIO, ASIODevice );
+ break;
+
+ case ESoundDeviceType.DirectSound:
+ SoundDevice = new CSoundDeviceDirectSound( WindowHandle, SoundDelayDirectSound, bUseOSTimer );
+ break;
+
+ default:
+ throw new Exception( string.Format( "譛ェ蟇セ蠢懊ョ SoundDeviceType 縺ァ縺吶[{0}]", SoundDeviceType.ToString() ) );
+ }
+ //-----------------
+ #endregion
+ #region [ 譁ー縺励>貍泌・上ち繧、繝槭r讒狗ッ峨☆繧九]
+ //-----------------
+ rc貍泌・冗畑繧ソ繧、繝 = new CSoundTimer( SoundDevice );
+ //-----------------
+ #endregion
+
+ SoundDevice.nMasterVolume = _nMasterVolume; // 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ォ蟇セ縺励※縲√槭せ繧ソ繝シ繝懊Μ繝・繝シ繝繧貞崎ィュ螳壹☆繧
+
+ CSound.t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧( SoundDevice ); // 縺吶〒縺ォ逕滓先ク医∩縺ョ繧オ繧ヲ繝ウ繝峨′縺ゅl縺ー菴懊j逶エ縺吶
+ }
+ public CSound t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( string filename, ESoundGroup soundGroup )
+ {
+ if( !File.Exists( filename ) )
+ {
+ Trace.TraceWarning($"[i18n] File does not exist: {filename}");
+ return null;
+ }
+
+ if ( SoundDeviceType == ESoundDeviceType.Unknown )
+ {
+ throw new Exception( string.Format( "譛ェ蟇セ蠢懊ョ SoundDeviceType 縺ァ縺吶[{0}]", SoundDeviceType.ToString() ) );
+ }
+ return SoundDevice.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( filename, soundGroup );
+ }
+
+ private static DateTime lastUpdateTime = DateTime.MinValue;
+ public void t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧( object o ) // #26122 2011.9.1 yyagi; delegate邨檎罰縺ョ蜻シ縺ウ蜃コ縺礼畑
+ {
+ t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧();
+ }
+ public void t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧()
+ {
+//笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘繝繝溘シ笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘
+// Debug.Write( "蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧()" );
+ //DateTime now = DateTime.Now;
+ //TimeSpan ts = now - lastUpdateTime;
+ //if ( ts.Milliseconds > 5 )
+ //{
+ // bool b = Bass.BASS_Update( 100 * 2 );
+ // lastUpdateTime = DateTime.Now;
+ // if ( !b )
+ // {
+ // Trace.TraceInformation( "BASS_UPdate() failed: " + Bass.BASS_ErrorGetCode().ToString() );
+ // }
+ //}
+ }
+
+ public void t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k( CSound csound )
+ {
+ csound?.t隗」謾セ縺吶k( true ); // 繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ッ蟄倡カ壺堤エ譽縺ォ縺吶k縲
+ }
+
+ public float GetCPUusage()
+ {
+ float f;
+ switch ( SoundDeviceType )
+ {
+ case ESoundDeviceType.ExclusiveWASAPI:
+ case ESoundDeviceType.SharedWASAPI:
+ f = BassWasapi.BASS_WASAPI_GetCPU();
+ break;
+ case ESoundDeviceType.ASIO:
+ f = BassAsio.BASS_ASIO_GetCPU();
+ break;
+ case ESoundDeviceType.DirectSound:
+ f = 0.0f;
+ break;
+ default:
+ f = 0.0f;
+ break;
+ }
+ return f;
+ }
+
+ public string GetCurrentSoundDeviceType()
+ {
+ switch ( SoundDeviceType )
+ {
+ case ESoundDeviceType.ExclusiveWASAPI:
+ case ESoundDeviceType.SharedWASAPI:
+ return "WASAPI";
+ case ESoundDeviceType.ASIO:
+ return "ASIO";
+ case ESoundDeviceType.DirectSound:
+ return "DirectSound";
+ default:
+ return "Unknown";
+ }
+ }
+
+ public void AddMixer( CSound cs, double db蜀咲函騾溷コヲ, bool _b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk )
+ {
+ cs.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = _b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk;
+ cs.db蜀咲函騾溷コヲ = db蜀咲函騾溷コヲ;
+ cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k();
+ }
+ public void AddMixer( CSound cs, double db蜀咲函騾溷コヲ )
+ {
+ cs.db蜀咲函騾溷コヲ = db蜀咲函騾溷コヲ;
+ cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k();
+ }
+ public void AddMixer( CSound cs )
+ {
+ cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k();
+ }
+ public void RemoveMixer( CSound cs )
+ {
+ cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k();
+ }
+ }
+ #endregion
+
+ // CSound 縺ッ縲√し繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺悟、画峩縺輔l縺溘→縺阪b縲√う繝ウ繧ケ繧ソ繝ウ繧ケ繧貞堺ス懈舌☆繧九%縺ィ縺ェ縺上∵眠縺励>繝繝舌う繧ケ縺ァ菴懊j逶エ縺帙k蠢隕√′縺ゅk縲
+ // 縺昴ョ縺溘a縲√ョ繝舌う繧ケ縺斐→縺ォ蛻・縺ョ繧ッ繝ゥ繧ケ縺ォ蛻蜑イ縺吶k縺ョ縺ァ縺ッ縺ェ縺上シ代▽縺ョ繧ッ繝ゥ繧ケ縺ォ髮邏縺吶k繧ゅョ縺ィ縺吶k縲
+
+ public class CSound : IDisposable
+ {
+ public const int MinimumSongVol = 0;
+ public const int MaximumSongVol = 200; // support an approximate doubling in volume.
+ public const int DefaultSongVol = 100;
+
+ // 2018-08-19 twopointzero: Note the present absence of a MinimumAutomationLevel.
+ // We will revisit this if/when song select BGM fade-in/fade-out needs
+ // updating due to changing the type or range of AutomationLevel
+ public const int MaximumAutomationLevel = 100;
+ public const int DefaultAutomationLevel = 100;
+
+ public const int MinimumGroupLevel = 0;
+ public const int MaximumGroupLevel = 100;
+ public const int DefaultGroupLevel = 100;
+ public const int DefaultSoundEffectLevel = 80;
+ public const int DefaultVoiceLevel = 90;
+ public const int DefaultSongPlaybackLevel = 90;
+
+ public static readonly Lufs MinimumLufs = new Lufs(-100.0);
+ public static readonly Lufs MaximumLufs = new Lufs(10.0); // support an approximate doubling in volume.
+
+ private static readonly Lufs DefaultGain = new Lufs(0.0);
+
+ public readonly ESoundGroup SoundGroup;
+
+ #region [ DTXMania逕ィ諡。蠑オ ]
+
+ public int n邱乗シ泌・乗凾髢杜s
+ {
+ get;
+ private set;
+ }
+ public int n繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ // 蜿悶j縺ゅ∴縺0蝗コ螳壺笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘
+ {
+ get { return 0; }
+ }
+ public bool b繧ケ繝医Μ繝シ繝蜀咲函縺吶k // 蜿悶j縺ゅ∴縺喃alse蝗コ螳壺笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘
+ // true縺ォ縺吶k縺ィ蜷御ク繝√ャ繝鈴浹縺ョ螟夐榊咲函縺ァ蝠城。後′蜃コ繧(4POLY髻ウ貅舌→縺励※蜍輔°縺ェ縺)
+ {
+ get { return false; }
+ }
+ public double db蜻ィ豕「謨ー蛟咲紫
+ {
+ get
+ {
+ return _db蜻ィ豕「謨ー蛟咲紫;
+ }
+ set
+ {
+ if ( _db蜻ィ豕「謨ー蛟咲紫 != value )
+ {
+ _db蜻ィ豕「謨ー蛟咲紫 = value;
+ if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ( float ) ( _db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー ) );
+ }
+ else
+ {
+ try
+ {
+ this.Buffer.Frequency = (int)(_db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー);
+ }
+ catch
+ {
+ //萓句、門ヲ逅縺ッ蜃コ縺輔↑縺
+ this.b騾溷コヲ荳翫£縺吶℃蝠城。 = true;
+ }
+ }
+ }
+ }
+ }
+ public double db蜀咲函騾溷コヲ
+ {
+ get
+ {
+ return _db蜀咲函騾溷コヲ;
+ }
+ set
+ {
+ if ( _db蜀咲函騾溷コヲ != value )
+ {
+ _db蜀咲函騾溷コヲ = value;
+ bIs1蛟埼溷咲函 = ( _db蜀咲函騾溷コヲ == 1.000f );
+ if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ if ( _hTempoStream != 0 && !this.bIs1蛟埼溷咲函 ) // 蜀咲函騾溷コヲ縺警1.000縺ョ縺ィ縺阪ッ縲ゝempoStream繧堤畑縺縺ェ縺繧医≧縺ォ縺励※鬮倬溷喧縺吶k
+ {
+ this.hBassStream = _hTempoStream;
+ }
+ else
+ {
+ this.hBassStream = _hBassStream;
+ }
+
+ if ( CSound邂。逅.bIsTimeStretch )
+ {
+ Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_TEMPO, (float) ( db蜀咲函騾溷コヲ * 100 - 100 ) );
+ //double seconds = Bass.BASS_ChannelBytes2Seconds( this.hTempoStream, nBytes );
+ //this.n邱乗シ泌・乗凾髢杜s = (int) ( seconds * 1000 );
+ }
+ else
+ {
+ Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ( float ) ( _db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー ) );
+ }
+ }
+ else
+ {
+ try
+ {
+ this.Buffer.Frequency = (int)(_db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー);
+ }
+ catch
+ {
+ //萓句、門ヲ逅縺ッ蜃コ縺輔↑縺
+ this.b騾溷コヲ荳翫£縺吶℃蝠城。 = true;
+ }
+ }
+ }
+ }
+ }
+ #endregion
+
+ public bool b騾溷コヲ荳翫£縺吶℃蝠城。 = false;
+ public bool b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = false; // 縺薙l縺荊rue縺ェ繧峨∵悽繧オ繧ヲ繝ウ繝峨ョ蜀咲函邨ゆコ縺ョ繧ウ繝シ繝ォ繝舌ャ繧ッ譎ゅ↓閾ェ蜍輔〒繝溘く繧オ繝シ縺九i蜑企勁縺吶k
+
+ //private STREAMPROC _cbStreamXA; // make it global, so that the GC can not remove it
+ private SYNCPROC _cbEndofStream; // 繧ケ繝医Μ繝シ繝縺ョ邨らォッ縺セ縺ァ蜀咲函縺輔l縺溘→縺阪↓蜻シ縺ウ蜃コ縺輔l繧九さ繝シ繝ォ繝舌ャ繧ッ
+// private WaitCallback _cbRemoveMixerChannel;
+
+ ///
+ /// Gain is applied "first" to the audio data, much as in a physical or
+ /// software mixer. Later steps in the flow of audio apply "channel" level
+ /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before
+ /// the audio is output.
+ ///
+ /// This method, taking an integer representing a percent value, is used
+ /// for mixing in the SONGVOL value, when available. It is also used for
+ /// DTXViewer preview mode.
+ ///
+ public void SetGain(int songVol)
+ {
+ SetGain(LinearIntegerPercentToLufs(songVol), null);
+ }
+
+ private static Lufs LinearIntegerPercentToLufs(int percent)
+ {
+ // 2018-08-27 twopointzero: We'll use the standard conversion until an appropriate curve can be selected
+ return new Lufs(20.0 * Math.Log10(percent / 100.0));
+ }
+
+ ///
+ /// Gain is applied "first" to the audio data, much as in a physical or
+ /// software mixer. Later steps in the flow of audio apply "channel" level
+ /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before
+ /// the audio is output.
+ ///
+ /// This method, taking a LUFS gain value and a LUFS true audio peak value,
+ /// is used for mixing in the loudness-metadata-base gain value, when available.
+ ///
+ public void SetGain(Lufs gain, Lufs? truePeak)
+ {
+ if (Equals(_gain, gain))
+ {
+ return;
+ }
+
+ _gain = gain;
+ _truePeak = truePeak;
+
+ if (SoundGroup == ESoundGroup.SongPlayback)
+ {
+ Trace.TraceInformation($"{nameof(CSound)}.{nameof(SetGain)}: Gain: {_gain}. True Peak: {_truePeak}");
+ }
+
+ SetVolume();
+ }
+
+ ///
+ /// AutomationLevel is applied "second" to the audio data, much as in a
+ /// physical or sofware mixer and its channel level. Before this Gain is
+ /// applied, and after this the mixing group level is applied.
+ ///
+ /// This is currently used only for automated fade in and out as is the
+ /// case right now for the song selection screen background music fade
+ /// in and fade out.
+ ///
+ public int AutomationLevel
+ {
+ get => _automationLevel;
+ set
+ {
+ if (_automationLevel == value)
+ {
+ return;
+ }
+
+ _automationLevel = value;
+
+ if (SoundGroup == ESoundGroup.SongPlayback)
+ {
+ Trace.TraceInformation($"{nameof(CSound)}.{nameof(AutomationLevel)} set: {AutomationLevel}");
+ }
+
+ SetVolume();
+ }
+ }
+
+ ///
+ /// GroupLevel is applied "third" to the audio data, much as in the sub
+ /// mixer groups of a physical or software mixer. Before this both the
+ /// Gain and AutomationLevel are applied, and after this the audio
+ /// flows into the audio subsystem for mixing and output based on the
+ /// master volume.
+ ///
+ /// This is currently automatically managed for each sound based on the
+ /// configured and dynamically adjustable sound group levels for each of
+ /// sound effects, voice, song preview, and song playback.
+ ///
+ /// See the SoundGroupLevelController and related classes for more.
+ ///
+ public int GroupLevel
+ {
+ private get => _groupLevel;
+ set
+ {
+ if (_groupLevel == value)
+ {
+ return;
+ }
+
+ _groupLevel = value;
+
+ if (SoundGroup == ESoundGroup.SongPlayback)
+ {
+ Trace.TraceInformation($"{nameof(CSound)}.{nameof(GroupLevel)} set: {GroupLevel}");
+ }
+
+ SetVolume();
+ }
+ }
+
+ private void SetVolume()
+ {
+ var automationLevel = LinearIntegerPercentToLufs(AutomationLevel);
+ var groupLevel = LinearIntegerPercentToLufs(GroupLevel);
+
+ var gain =
+ _gain +
+ automationLevel +
+ groupLevel;
+
+ var safeTruePeakGain = _truePeak?.Negate() ?? new Lufs(0);
+ var finalGain = gain.Min(safeTruePeakGain);
+
+ if (SoundGroup == ESoundGroup.SongPlayback)
+ {
+ Trace.TraceInformation(
+ $"{nameof(CSound)}.{nameof(SetVolume)}: Gain:{_gain}. Automation Level: {automationLevel}. Group Level: {groupLevel}. Summed Gain: {gain}. Safe True Peak Gain: {safeTruePeakGain}. Final Gain: {finalGain}.");
+ }
+
+ lufs髻ウ驥 = finalGain;
+ }
+
+ private Lufs lufs髻ウ驥
+ {
+ set
+ {
+ if (this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk)
+ {
+ var db髻ウ驥 = ((value.ToDouble() / 100.0) + 1.0).Clamp(0, 1);
+ Bass.BASS_ChannelSetAttribute(this.hBassStream, BASSAttribute.BASS_ATTRIB_VOL, (float) db髻ウ驥);
+ }
+ else if (this.bDirectSound縺ァ縺ゅk)
+ {
+ var db髻ウ驥 = (value.ToDouble() * 100.0).Clamp(-10000, 0);
+ this.Buffer.Volume = (int) Math.Round(db髻ウ驥);
+ }
+ }
+ }
+
+ ///
+ /// 蟾ヲ:-100ス樔クュ螟ョ:0ス100:蜿ウ縲Tet 縺ョ縺ソ縲
+ ///
+ public int n菴咲スョ
+ {
+ get
+ {
+ if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ float f菴咲スョ = 0.0f;
+ if ( !Bass.BASS_ChannelGetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_PAN, ref f菴咲スョ ) )
+ //if( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, ref f菴咲スョ ) == -1 )
+ return 0;
+ return (int) ( f菴咲スョ * 100 );
+ }
+ else if( this.bDirectSound縺ァ縺ゅk )
+ {
+ return this._n菴咲スョ;
+ }
+ return -9999;
+ }
+ set
+ {
+ if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ float f菴咲スョ = Math.Min( Math.Max( value, -100 ), 100 ) / 100.0f; // -100ス100 竊 -1.0ス1.0
+ //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, f菴咲スョ ) };
+ //BassMix.BASS_Mixer_ChannelSetEnvelope( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, nodes );
+ Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_PAN, f菴咲スョ );
+ }
+ else if( this.bDirectSound縺ァ縺ゅk )
+ {
+ this._n菴咲スョ = Math.Min( Math.Max( -100, value ), 100 ); // -100ス100
+
+ if( this._n菴咲スョ == 0 )
+ {
+ this._n菴咲スョdb = 0;
+ }
+ else if( this._n菴咲スョ == -100 )
+ {
+ this._n菴咲スョdb = -10000;
+ }
+ else if( this._n菴咲スョ == 100 )
+ {
+ this._n菴咲スョdb = 10000;
+ }
+ else if( this._n菴咲スョ < 0 )
+ {
+ this._n菴咲スョdb = (int) ( ( 20.0 * Math.Log10( ( (double) ( this._n菴咲スョ + 100 ) ) / 100.0 ) ) * 100.0 );
+ }
+ else
+ {
+ this._n菴咲スョdb = (int) ( ( -20.0 * Math.Log10( ( (double) ( 100 - this._n菴咲スョ ) ) / 100.0 ) ) * 100.0 );
+ }
+
+ this.Buffer.Pan = this._n菴咲スョdb;
+ }
+ }
+ }
+
+ ///
+ /// DirectSound縺ョ繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縲
+ ///
+ //public SecondarySoundBuffer DirectSoundBuffer
+ public SoundBuffer DirectSoundBuffer
+ {
+ get { return this.Buffer; }
+ }
+
+ ///
+ /// DirectSound縺ョ繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ菴懈先凾縺ョ繝輔Λ繧ー縲
+ ///
+ public BufferFlags DirectSoundBufferFlags
+ {
+ get;
+ protected set;
+ }
+
+ ///
+ /// 蜈ィ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医
+ /// ス槭r菴懈舌☆繧() 縺ァ霑ス蜉縺輔l縲》隗」謾セ縺吶k() or Dispose() 縺ァ隗」謾セ縺輔l繧九
+ ///
+ public static readonly ObservableCollection list繧、繝ウ繧ケ繧ソ繝ウ繧ケ = new ObservableCollection();
+
+ public static void ShowAllCSoundFiles()
+ {
+ int i = 0;
+ foreach ( CSound cs in list繧、繝ウ繧ケ繧ソ繝ウ繧ケ )
+ {
+ Debug.WriteLine( i++.ToString( "d3" ) + ": " + Path.GetFileName( cs.str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+ }
+
+ public CSound(ESoundGroup soundGroup)
+ {
+ SoundGroup = soundGroup;
+ this.n菴咲スョ = 0;
+ this._db蜻ィ豕「謨ー蛟咲紫 = 1.0;
+ this._db蜀咲函騾溷コヲ = 1.0;
+// this._cbRemoveMixerChannel = new WaitCallback( RemoveMixerChannelLater );
+ this._hBassStream = -1;
+ this._hTempoStream = 0;
+ }
+
+ public void tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, int hMixer )
+ {
+ this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.ASIO; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ
+ this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, hMixer, BASSFlag.BASS_STREAM_DECODE );
+ }
+ public void tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, int hMixer )
+ {
+ this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.ASIO; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ
+ this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, hMixer, BASSFlag.BASS_STREAM_DECODE );
+ }
+ public void tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, int hMixer, ESoundDeviceType e繝繝舌う繧ケ遞ョ蛻・ )
+ {
+ this.e繝繝舌う繧ケ遞ョ蛻・ = e繝繝舌う繧ケ遞ョ蛻・; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ
+ this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, hMixer, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT );
+ }
+ public void tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, int hMixer, ESoundDeviceType e繝繝舌う繧ケ遞ョ蛻・ )
+ {
+ this.e繝繝舌う繧ケ遞ョ蛻・ = e繝繝舌う繧ケ遞ョ蛻・; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ
+ this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, hMixer, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT );
+ }
+ public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, DirectSound DirectSound )
+ {
+ this.e菴懈先婿豕 = E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i;
+ this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷;
+ if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".xa", true ) == 0 ||
+ String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".mp3", true ) == 0 ||
+ String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".ogg", true ) == 0 ) // caseless縺ァ譁蟄怜玲ッ碑シ
+ {
+ tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜aOggMp3( str繝輔ぃ繧、繝ォ蜷, DirectSound );
+ return;
+ }
+
+ // 縺吶∋縺ヲ縺ョ繝輔ぃ繧、繝ォ繧 DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九→譎る俣縺後°縺九k縺ョ縺ァ縲√ヵ繧。繧、繝ォ縺 WAV 縺九▽ PCM 繝輔か繝シ繝槭ャ繝医〒縺ェ縺蝣エ蜷医ョ縺ソ DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九
+
+ byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null;
+ bool b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = true;
+
+ {
+ #region [ 繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医°蜷ヲ縺玖ェソ縺ケ繧九]
+ //-----------------
+ try
+ {
+ Stream str = File.Open(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read);
+ using (var ws = new SoundStream(str))
+ {
+ if (ws.Format.Encoding != WaveFormatEncoding.Pcm)
+ b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false;
+ }
+ }
+ catch
+ {
+ b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false;
+ }
+ //-----------------
+ #endregion
+
+ if ( b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk )
+ {
+ #region [ 繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙〒 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪]
+ //-----------------
+ var fs = File.Open( str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read );
+ var br = new BinaryReader( fs );
+
+ byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = new byte[ fs.Length ];
+ br.Read( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, 0, (int) fs.Length );
+
+ br.Close();
+ fs.Close();
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ #region [ DirectShow 縺ァ繝繧ウ繝シ繝牙、画鋤縺励 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪]
+ //-----------------
+ CDStoWAVFileImage.t螟画鋤( str繝輔ぃ繧、繝ォ蜷, out byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク );
+ //-----------------
+ #endregion
+ }
+ }
+
+ // 縺ゅ→縺ッ縺ゅ■繧峨〒縲
+
+ this.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound );
+ }
+ public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜aOggMp3( string str繝輔ぃ繧、繝ォ蜷, DirectSound DirectSound )
+ {
+ try
+ {
+ this.e菴懈先婿豕 = E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i;
+ this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷;
+ WaveFormat wfx = new WaveFormat();
+ int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = 0;
+ // int nPCM繧オ繧、繧コbyte = (int) ( xa.xaheader.nSamples * xa.xaheader.nChannels * 2 ); // nBytes = Bass.BASS_ChannelGetLength( this.hBassStream );
+
+
+
+ int nPCM繧オ繧、繧コbyte;
+ CWin32.WAVEFORMATEX cw32wfx;
+ t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧(str繝輔ぃ繧、繝ォ蜷, out this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク,
+ out nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, out nPCM繧オ繧、繧コbyte, out cw32wfx, false);
+
+ wfx = WaveFormat.CreateCustomFormat((WaveFormatEncoding)cw32wfx.wFormatTag, (int)cw32wfx.nSamplesPerSec, cw32wfx.nChannels, (int)cw32wfx.nAvgBytesPerSec, cw32wfx.nBlockAlign, cw32wfx.wBitsPerSample);
+
+ // 繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ繧剃ス懈舌@縲 ̄CM繝繝シ繧ソ繧呈嶌縺崎セシ繧縲
+ tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縺ョ菴懈舌→WAV繝繝シ繧ソ譖ク縺崎セシ縺ソ
+ (ref this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound, CSoundDeviceDirectSound.DefaultFlags, wfx,
+ nPCM繧オ繧、繧コbyte, nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ);
+ return;
+ }
+ catch (Exception e)
+ {
+ string s = Path.GetFileName(str繝輔ぃ繧、繝ォ蜷);
+ Trace.TraceWarning($"Failed to create DirectSound buffer by using BASS.DLL.({s}: {e.Message})");
+ Trace.TraceWarning("Retrying by using DirectShow decoder.");
+ }
+ // 縺吶∋縺ヲ縺ョ繝輔ぃ繧、繝ォ繧 DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九→譎る俣縺後°縺九k縺ョ縺ァ縲√ヵ繧。繧、繝ォ縺 WAV 縺九▽ PCM 繝輔か繝シ繝槭ャ繝医〒縺ェ縺蝣エ蜷医ョ縺ソ DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九
+
+ byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null;
+ bool b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = true;
+
+ {
+ #region [ 繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医°蜷ヲ縺玖ェソ縺ケ繧九]
+ //-----------------
+ SoundStream ws = null;
+ try
+ {
+ using (ws = new SoundStream(new FileStream(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
+ {
+ if (ws.Format.Encoding != WaveFormatEncoding.Pcm)
+ b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false;
+ }
+ }
+ catch
+ {
+ b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false;
+ }
+ finally
+ {
+ if (ws != null)
+ {
+ ws.Close();
+ ws.Dispose();
+ }
+ }
+ //-----------------
+ #endregion
+
+ if (b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk)
+ {
+ #region [ 繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙〒 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪]
+ //-----------------
+ var fs = File.Open(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ var br = new BinaryReader(fs);
+
+ byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = new byte[fs.Length];
+ br.Read(byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, 0, (int)fs.Length);
+
+ br.Close();
+ fs.Close();
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ #region [ DirectShow 縺ァ繝繧ウ繝シ繝牙、画鋤縺励 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪]
+ //-----------------
+ CDStoWAVFileImage.t螟画鋤(str繝輔ぃ繧、繝ォ蜷, out byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク);
+ //-----------------
+ #endregion
+ }
+ }
+
+ // 縺ゅ→縺ッ縺ゅ■繧峨〒縲
+
+ this.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧(byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound);
+ }
+
+ public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound DirectSound )
+ {
+ this.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound, CSoundDeviceDirectSound.DefaultFlags );
+ }
+ public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound DirectSound, BufferFlags flags )
+ {
+ if( this.e菴懈先婿豕 == E菴懈先婿豕.Unknown )
+ this.e菴懈先婿豕 = E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i;
+
+ WaveFormat wfx = null;
+ int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = -1;
+ int nPCM繧オ繧、繧コbyte = -1;
+
+ #region [ byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク[] 縺九i荳願ィ假シ薙▽縺ョ繝繝シ繧ソ繧貞叙蠕励]
+ //-----------------
+ var ms = new MemoryStream( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク );
+ var br = new BinaryReader( ms );
+
+ try
+ {
+ // 'RIFF'シ騎IFF繝繝シ繧ソ繧オ繧、繧コ
+
+ if( br.ReadUInt32() != 0x46464952 )
+ throw new InvalidDataException( "RIFF繝輔ぃ繧、繝ォ縺ァ縺ッ縺ゅj縺セ縺帙s縲" );
+ br.ReadInt32();
+
+ // 'WAVE'
+ if( br.ReadUInt32() != 0x45564157 )
+ throw new InvalidDataException( "WAVE繝輔ぃ繧、繝ォ縺ァ縺ッ縺ゅj縺セ縺帙s縲" );
+
+ // 繝√Ε繝ウ繧ッ
+ while( ( ms.Position + 8 ) < ms.Length ) // +8 縺ッ縲√メ繝」繝ウ繧ッ蜷搾シ九メ繝」繝ウ繧ッ繧オ繧、繧コ縲よョ九j8繝舌う繝域悴貅縺ェ繧峨Ν繝シ繝礼オゆコ縲
+ {
+ uint chunkName = br.ReadUInt32();
+
+ // 'fmt '
+ if( chunkName == 0x20746D66 )
+ {
+ long chunkSize = (long) br.ReadUInt32();
+
+ var tag = (WaveFormatEncoding)br.ReadUInt16();
+ int Channels = br.ReadInt16();
+ int SamplesPerSecond = br.ReadInt32();
+ int AverageBytesPerSecond = br.ReadInt32();
+ int BlockAlignment = br.ReadInt16();
+ int BitsPerSample = br.ReadInt16();
+
+ if (tag == WaveFormatEncoding.Pcm) wfx = new WaveFormat();
+ else if (tag == WaveFormatEncoding.Extensible) wfx = new WaveFormatExtensible(SamplesPerSecond, BitsPerSample, Channels); // 縺薙ョ繧ッ繝ゥ繧ケ縺ッ WaveFormat 繧堤カ呎価縺励※縺繧九
+ else
+ throw new InvalidDataException( string.Format( "譛ェ蟇セ蠢懊ョWAVE繝輔か繝シ繝槭ャ繝医ち繧ー縺ァ縺吶(Tag:{0})", tag.ToString() ) );
+
+ wfx = WaveFormat.CreateCustomFormat((WaveFormatEncoding)tag, SamplesPerSecond, Channels, AverageBytesPerSecond, BlockAlignment, BitsPerSample);
+
+ long n繝輔か繝シ繝槭ャ繝医し繧、繧コbyte = 16;
+
+ if (wfx.Encoding == WaveFormatEncoding.Extensible)
+ {
+ br.ReadUInt16(); // 諡。蠑オ鬆伜沺繧オ繧、繧コbyte
+ var wfxEx = (SharpDX.Multimedia.WaveFormatExtensible)wfx;
+ int ValidBitsPerSample = br.ReadInt16();
+ wfxEx.ChannelMask = (Speakers) br.ReadInt32();
+ wfxEx.GuidSubFormat = new Guid(br.ReadBytes(16)); // GUID 縺ッ 16byte (128bit)
+
+ n繝輔か繝シ繝槭ャ繝医し繧、繧コbyte += 24;
+ }
+
+ ms.Seek( chunkSize - n繝輔か繝シ繝槭ャ繝医し繧、繧コbyte, SeekOrigin.Current );
+ continue;
+ }
+
+ // 'data'
+ else if( chunkName == 0x61746164 )
+ {
+ nPCM繧オ繧、繧コbyte = br.ReadInt32();
+ nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = (int) ms.Position;
+
+ ms.Seek( nPCM繧オ繧、繧コbyte, SeekOrigin.Current );
+ continue;
+ }
+
+ // 縺昴ョ莉
+ else
+ {
+ long chunkSize = (long) br.ReadUInt32();
+ ms.Seek( chunkSize, SeekOrigin.Current );
+ continue;
+ }
+ }
+
+ if( wfx == null )
+ throw new InvalidDataException( "fmt 繝√Ε繝ウ繧ッ縺悟ュ伜惠縺励∪縺帙s縲ゆク肴ュ」縺ェ繧オ繧ヲ繝ウ繝峨ョ繝シ繧ソ縺ァ縺吶" );
+ if( nPCM繧オ繧、繧コbyte < 0 )
+ throw new InvalidDataException( "data 繝√Ε繝ウ繧ッ縺悟ュ伜惠縺励∪縺帙s縲ゆク肴ュ」縺ェ繧オ繧ヲ繝ウ繝峨ョ繝シ繧ソ縺ァ縺吶" );
+ }
+ finally
+ {
+ ms.Close();
+ br.Close();
+ }
+ //-----------------
+ #endregion
+
+
+ // 繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ繧剃ス懈舌@縲 ̄CM繝繝シ繧ソ繧呈嶌縺崎セシ繧縲
+ tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縺ョ菴懈舌→WAV繝繝シ繧ソ譖ク縺崎セシ縺ソ(
+ ref byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound, flags, wfx, nPCM繧オ繧、繧コbyte, nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ );
+ }
+
+ private void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縺ョ菴懈舌→WAV繝繝シ繧ソ譖ク縺崎セシ縺ソ
+ ( ref byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound DirectSound, BufferFlags flags, WaveFormat wfx,
+ int nPCM繧オ繧、繧コbyte, int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ )
+ {
+ this._Format = wfx;
+ // 繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ繧剃ス懈舌@縲 ̄CM繝繝シ繧ソ繧呈嶌縺崎セシ繧縲
+
+ this.Buffer = new SecondarySoundBuffer( DirectSound, new SoundBufferDescription()
+ {
+ Format = (wfx.Encoding == WaveFormatEncoding.Pcm) ? wfx : (SharpDX.Multimedia.WaveFormatExtensible)wfx,
+ Flags = flags,
+ BufferBytes = nPCM繧オ繧、繧コbyte,
+ });
+ this.Buffer.Write( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, nPCM繧オ繧、繧コbyte, 0, LockFlags.None );
+
+ // 菴懈仙ョ御コ縲
+
+ this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.DirectSound;
+ this.DirectSoundBufferFlags = flags;
+ this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク;
+ this.DirectSound = DirectSound;
+
+ // DTXMania逕ィ縺ォ霑ス蜉
+ this.n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー = wfx.SampleRate;
+ n邱乗シ泌・乗凾髢杜s = (int)(((double)nPCM繧オ繧、繧コbyte) / (this._Format.AverageBytesPerSecond * 0.001));
+
+
+ // 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医↓逋サ骭イ縲
+
+ CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Add( this );
+ }
+
+ #region [ DTXMania逕ィ縺ョ螟画鋤 ]
+
+ public void t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k( CSound cs )
+ {
+ cs.t隗」謾セ縺吶k();
+ }
+ public void t蜀咲函繧帝幕蟋九☆繧()
+ {
+ t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺();
+ if (!b騾溷コヲ荳翫£縺吶℃蝠城。)
+ t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k(false);
+ }
+ public void t蜀咲函繧帝幕蟋九☆繧( bool b繝ォ繝シ繝励☆繧 )
+ {
+ if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ if ( b繝ォ繝シ繝励☆繧 )
+ {
+ Bass.BASS_ChannelFlags( this.hBassStream, BASSFlag.BASS_SAMPLE_LOOP, BASSFlag.BASS_SAMPLE_LOOP );
+ }
+ else
+ {
+ Bass.BASS_ChannelFlags( this.hBassStream, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_DEFAULT );
+ }
+ }
+ t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺();
+ t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( b繝ォ繝シ繝励☆繧 );
+ }
+ public void t蜀咲函繧貞●豁「縺吶k()
+ {
+ t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k();
+ t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺();
+ }
+ public void t蜀咲函繧剃ク譎ょ●豁「縺吶k()
+ {
+ t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k(true);
+ this.n荳譎ょ●豁「蝗樊焚++;
+ }
+ public void t蜀咲函繧貞埼幕縺吶k( long t ) // 笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘
+ {
+ Debug.WriteLine( "t蜀咲函繧貞埼幕縺吶k(long " + t + ")" );
+ t蜀咲函菴咲スョ繧貞、画峩縺吶k( t );
+ t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k();
+ this.n荳譎ょ●豁「蝗樊焚--;
+ }
+ public bool b荳譎ょ●豁「荳ュ
+ {
+ get
+ {
+ if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ bool ret = ( BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) == BASSActive.BASS_ACTIVE_PAUSED ) &
+ ( BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) > 0 );
+ return ret;
+ }
+ else
+ {
+ return ( this.n荳譎ょ●豁「蝗樊焚 > 0 );
+ }
+ }
+ }
+ public bool b蜀咲函荳ュ
+ {
+ get
+ {
+ if ( this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.DirectSound )
+ {
+ return ((this.Buffer.Status & (int)BufferStatus.Playing) != (int)BufferStatus.None);
+ }
+ else
+ {
+ // 蝓コ譛ャ逧縺ォ縺ッBASS_ACTIVE_PLAYING縺ェ繧牙咲函荳ュ縺縺後∵怙蠕後∪縺ァ蜀咲函縺励″縺」縺歡hannel繧
+ // BASS_ACTIVE_PLAYING縺ョ縺セ縺セ縺ォ縺ェ縺」縺ヲ縺繧九ョ縺ァ縲∝ー冗エー蟾・縺悟ソ隕√
+ bool ret = ( BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) == BASSActive.BASS_ACTIVE_PLAYING );
+ if ( BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) >= nBytes )
+ {
+ ret = false;
+ }
+ return ret;
+ }
+ }
+ }
+ //public lint t譎ょ綾縺九i菴咲スョ繧定ソ斐☆( long t )
+ //{
+ // double num = ( n譎ょ綾 * this.db蜀咲函騾溷コヲ ) * this.db蜻ィ豕「謨ー蛟咲紫;
+ // return (int) ( ( num * 0.01 ) * this.nSamplesPerSecond );
+ //}
+ #endregion
+
+
+ public void t隗」謾セ縺吶k()
+ {
+ t隗」謾セ縺吶k( false );
+ }
+
+ public void t隗」謾セ縺吶k( bool _b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 )
+ {
+ if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) // stream謨ー縺ョ蜑頑ク帷畑
+ {
+ tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k();
+ _cbEndofStream = null;
+ //_cbStreamXA = null;
+ CSound邂。逅.nStreams--;
+ }
+ bool bManaged繧りァ」謾セ縺吶k = true;
+ bool b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 = _b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁; // CSound縺ョ蜀榊晄悄蛹匁凾縺ッ縲√う繝ウ繧ケ繧ソ繝ウ繧ケ縺ッ蟄倡カ壹☆繧九
+ this.Dispose( bManaged繧りァ」謾セ縺吶k, b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 );
+//Debug.WriteLine( "Disposed: " + _b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 + " : " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k()
+ {
+ t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( false );
+ }
+ private void t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( bool b繝ォ繝シ繝励☆繧 )
+ {
+ if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) // BASS繧オ繧ヲ繝ウ繝画凾縺ョ繝ォ繝シ繝怜ヲ逅縺ッ縲》蜀咲函繧帝幕蟋九☆繧()蛛エ縺ォ螳溯」縲ゅ%縺薙〒縺ッ縲恵繝ォ繝シ繝励☆繧九阪ッ譛ェ菴ソ逕ィ縲
+ {
+//Debug.WriteLine( "蜀咲函荳ュ?: " + System.IO.Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes );
+ bool b = BassMix.BASS_Mixer_ChannelPlay( this.hBassStream );
+ if ( !b )
+ {
+//Debug.WriteLine( "蜀咲函縺励h縺縺ィ縺励◆縺後`ixer縺ォ逋サ骭イ縺輔l縺ヲ縺縺ェ縺九▲縺: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ", stream#=" + this.hBassStream + ", ErrCode=" + Bass.BASS_ErrorGetCode() );
+
+ bool bb = tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k();
+ if ( !bb )
+ {
+Debug.WriteLine( "Mixer縺ク縺ョ逋サ骭イ縺ォ螟ア謨: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ", ErrCode=" + Bass.BASS_ErrorGetCode() );
+ }
+ else
+ {
+//Debug.WriteLine( "Mixer縺ク縺ョ逋サ骭イ縺ォ謌仙粥: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": " + Bass.BASS_ErrorGetCode() );
+ }
+ //this.t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺();
+
+ bool bbb = BassMix.BASS_Mixer_ChannelPlay( this.hBassStream );
+ if (!bbb)
+ {
+Debug.WriteLine("譖エ縺ォ蜀咲函縺ォ螟ア謨: " + Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷) + ", ErrCode=" + Bass.BASS_ErrorGetCode() );
+ }
+ else
+ {
+// Debug.WriteLine("蜀咲函謌仙粥(繝溘く繧オ繝シ霑ス蜉蠕) : " + Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷));
+ }
+ }
+ else
+ {
+//Debug.WriteLine( "蜀咲函謌仙粥: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " (" + hBassStream + ")" );
+ }
+ }
+ else if( this.bDirectSound縺ァ縺ゅk )
+ {
+ PlayFlags pf = ( b繝ォ繝シ繝励☆繧 ) ? PlayFlags.Looping : PlayFlags.None;
+ this.Buffer.Play( 0, pf );
+ }
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺励※Mixer縺九i繧ょ炎髯、縺吶k()
+ {
+ t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k( false );
+ if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k();
+ }
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k()
+ {
+ t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k( false );
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k( bool pause )
+ {
+ if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+//Debug.WriteLine( "蛛懈ュ「: " + System.IO.Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes );
+ BassMix.BASS_Mixer_ChannelPause( this.hBassStream );
+ if ( !pause )
+ {
+ // tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k(); // PAUSE縺ィ蜀咲函蛛懈ュ「繧貞玄蛻・縺ァ縺阪k繧医≧縺ォ縺吶k縺薙→!!
+ }
+ }
+ else if( this.bDirectSound縺ァ縺ゅk )
+ {
+ try
+ {
+ this.Buffer.Stop();
+ }
+ catch ( Exception )
+ {
+ // WASAPI/ASIO縺ィDirectSound繧貞酔譎ゆスソ逕ィ縺吶k縺ィ縲。uffer縺畦ost縺励※縺薙%縺ァ萓句、也匱逕溘☆繧九や catch縺励※辟。隕悶☆繧九
+ // DTXC縺九iDTXMania繧貞他縺ウ蜃コ縺吶→縲.TXC邨ゆコ譎ゅ↓縺薙ョ迴セ雎。縺檎匱逕溘☆繧九
+ }
+ }
+ this.n荳譎ょ●豁「蝗樊焚 = 0;
+ }
+
+ public void t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺()
+ {
+ if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ BassMix.BASS_Mixer_ChannelSetPosition( this.hBassStream, 0 );
+ //pos = 0;
+ }
+ else if( this.bDirectSound縺ァ縺ゅk )
+ {
+ this.Buffer.CurrentPosition = 0;
+ }
+ }
+ public void t蜀咲函菴咲スョ繧貞、画峩縺吶k( long n菴咲スョms )
+ {
+ if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ bool b = true;
+ try
+ {
+ b = BassMix.BASS_Mixer_ChannelSetPosition( this.hBassStream, Bass.BASS_ChannelSeconds2Bytes( this.hBassStream, n菴咲スョms * this.db蜻ィ豕「謨ー蛟咲紫 * this.db蜀咲函騾溷コヲ / 1000.0 ), BASSMode.BASS_POS_BYTES );
+ }
+ catch( Exception e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seek error: " + e.ToString() + ": " + n菴咲スョms + "ms" );
+ }
+ finally
+ {
+ if ( !b )
+ {
+ BASSError be = Bass.BASS_ErrorGetCode();
+ Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seek error: " + be.ToString() + ": " + n菴咲スョms + "MS" );
+ }
+ }
+ //if ( this.n邱乗シ泌・乗凾髢杜s > 5000 )
+ //{
+ // Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seeked to " + n菴咲スョms + "ms = " + Bass.BASS_ChannelSeconds2Bytes( this.hBassStream, n菴咲スョms * this.db蜻ィ豕「謨ー蛟咲紫 * this.db蜀咲函騾溷コヲ / 1000.0 ) );
+ //}
+ }
+ else if( this.bDirectSound縺ァ縺ゅk )
+ {
+ int n菴咲スョsample = (int)(this._Format.SampleRate * n菴咲スョms * 0.001 * _db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ); // #30839 2013.2.24 yyagi; add _db蜻ィ豕「謨ー蛟咲紫 and _db蜀咲函騾溷コヲ
+ try
+ {
+ this.Buffer.CurrentPosition = n菴咲スョsample * this._Format.BlockAlign;
+ }
+ catch
+ {
+ Trace.TraceError( "{0}: Seek error: {1}", Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ), n菴咲スョms);
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (95dee242-1f92-4fcf-aaf6-b162ad2bfc03)" );
+ }
+ //if ( this.n邱乗シ泌・乗凾髢杜s > 5000 )
+ //{
+ // Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seeked to " + n菴咲スョms + "ms = " + n菴咲スョsample );
+ //}
+ }
+ }
+ ///
+ /// 繝繝舌ャ繧ー逕ィ
+ ///
+ ///
+ ///
+ public void t蜀咲函菴咲スョ繧貞叙蠕励☆繧( out long n菴咲スョbyte, out double db菴咲スョms )
+ {
+ if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ n菴咲スョbyte = BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream );
+ db菴咲スョms = Bass.BASS_ChannelBytes2Seconds( this.hBassStream, n菴咲スョbyte );
+ }
+ else if ( this.bDirectSound縺ァ縺ゅk )
+ {
+ this.Buffer.GetCurrentPosition(out int n菴咲スョtmp, out int _);
+ n菴咲スョbyte = (long)n菴咲スョtmp;
+ db菴咲スョms = n菴咲スョbyte / this._Format.SampleRate / 0.001 / _db蜻ィ豕「謨ー蛟咲紫 / _db蜀咲函騾溷コヲ;
+ }
+ else
+ {
+ n菴咲スョbyte = 0;
+ db菴咲スョms = 0.0;
+ }
+ }
+
+
+ public static void t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蛻晄悄迥カ諷九↓謌サ縺()
+ {
+ foreach ( var sound in CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ )
+ {
+ sound.t隗」謾セ縺吶k( false );
+ }
+ }
+ internal static void t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧( ISoundDevice device )
+ {
+ if( CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count == 0 )
+ return;
+
+
+ // 繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k髫帙↓繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医b譖エ譁ー縺輔l繧九ョ縺ァ縲驟榊励↓繧ウ繝斐シ繧貞叙縺」縺ヲ縺翫″縲√Μ繧ケ繝医ッ繧ッ繝ェ繧「縺吶k縲
+
+ var sounds = CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.ToArray();
+ CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Clear();
+
+
+ // 驟榊励↓蝓コ縺・縺縺ヲ蛟九縺ョ繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧九
+
+ for( int i = 0; i < sounds.Length; i++ )
+ {
+ switch( sounds[ i ].e菴懈先婿豕 )
+ {
+ #region [ 繝輔ぃ繧、繝ォ縺九i ]
+ case E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i:
+ string str繝輔ぃ繧、繝ォ蜷 = sounds[ i ].str繝輔ぃ繧、繝ォ蜷;
+ sounds[ i ].Dispose( true, false );
+ device.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, sounds[ i ] );
+ break;
+ #endregion
+ #region [ WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i ]
+ case E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i:
+ if( sounds[ i ].bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ byte[] byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = sounds[ i ].byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク;
+ sounds[ i ].Dispose( true, false );
+ device.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, sounds[ i ] );
+ }
+ else if( sounds[ i ].bDirectSound縺ァ縺ゅk )
+ {
+ byte[] byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = sounds[ i ].byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク;
+ var flags = sounds[ i ].DirectSoundBufferFlags;
+ sounds[ i ].Dispose( true, false );
+ ( (CSoundDeviceDirectSound) device ).t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, flags, sounds[ i ] );
+ }
+ break;
+ #endregion
+ }
+ }
+ }
+
+ #region [ Dispose-Finalize繝代ち繝シ繝ウ螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ this.Dispose( true, true );
+ GC.SuppressFinalize( this );
+ }
+ private void Dispose( bool bManaged繧りァ」謾セ縺吶k, bool b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 )
+ {
+ if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk )
+ {
+ #region [ ASIO, WASAPI 縺ョ隗」謾セ ]
+ //-----------------
+ if ( _hTempoStream != 0 )
+ {
+ BassMix.BASS_Mixer_ChannelRemove( this._hTempoStream );
+ Bass.BASS_StreamFree( this._hTempoStream );
+ }
+ BassMix.BASS_Mixer_ChannelRemove( this._hBassStream );
+ Bass.BASS_StreamFree( this._hBassStream );
+ this.hBassStream = -1;
+ this._hBassStream = -1;
+ this._hTempoStream = 0;
+ //-----------------
+ #endregion
+ }
+
+ if( bManaged繧りァ」謾セ縺吶k )
+ {
+ //int freeIndex = -1;
+
+ //if ( CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ != null )
+ //{
+ // freeIndex = CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.IndexOf( this );
+ // if ( freeIndex == -1 )
+ // {
+ // Debug.WriteLine( "ERR: freeIndex==-1 : Count=" + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count + ", filename=" + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) );
+ // }
+ //}
+
+ if( this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.DirectSound )
+ {
+ #region [ DirectSound 縺ョ隗」謾セ ]
+ //-----------------
+ if( this.Buffer != null )
+ {
+ try
+ {
+ this.Buffer.Stop();
+ }
+ catch (Exception e)
+ {
+ // 貍泌・冗オゆコ蠕後髟キ譎る俣隗」謾セ縺励↑縺縺ァ縺繧九→縲√◆縺セ縺ォ AccessViolationException 縺檎匱逕溘☆繧九%縺ィ縺後≠繧九
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (19bcaa24-5259-4198-bf74-41eb1114ba28)" );
+ }
+ C蜈ア騾.tDispose縺吶k( ref this.Buffer );
+ }
+ //-----------------
+ #endregion
+ }
+
+ if( this.e菴懈先婿豕 == E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i &&
+ this.e繝繝舌う繧ケ遞ョ蛻・ != ESoundDeviceType.DirectSound ) // DirectSound 縺ッ hGC 譛ェ菴ソ逕ィ縲
+ {
+ if ( this.hGC != null && this.hGC.IsAllocated )
+ {
+ this.hGC.Free();
+ this.hGC = default( GCHandle );
+ }
+ }
+ if ( this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク != null )
+ {
+ this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null;
+ }
+
+ this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.Unknown;
+
+ if ( b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 )
+ {
+ //try
+ //{
+ // CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.RemoveAt( freeIndex );
+ //}
+ //catch
+ //{
+ // Debug.WriteLine( "FAILED to remove CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ: Count=" + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count + ", filename=" + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) );
+ //}
+ bool b = CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Remove( this ); // 縺薙l縺縺ィ縲,lone()縺励◆繧オ繧ヲ繝ウ繝峨ョremove縺ォ螟ア謨励☆繧
+ if ( !b )
+ {
+ Debug.WriteLine( "FAILED to remove CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ: Count=" + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count + ", filename=" + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+
+ }
+ }
+ }
+ ~CSound()
+ {
+ this.Dispose( false, true );
+ }
+ //-----------------
+ #endregion
+
+ #region [ protected ]
+ //-----------------
+ protected enum E菴懈先婿豕 { 繝輔ぃ繧、繝ォ縺九i, WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i, Unknown }
+ protected E菴懈先婿豕 e菴懈先婿豕 = E菴懈先婿豕.Unknown;
+ protected ESoundDeviceType e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.Unknown;
+ public string str繝輔ぃ繧、繝ォ蜷 = null;
+ protected byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null; // WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縲√b縺励¥縺ッchunk縺ョDATA驛ィ縺ョ縺ソ
+ protected GCHandle hGC;
+ protected int _hTempoStream = 0;
+ protected int _hBassStream = -1; // ASIO, WASAPI 逕ィ
+ protected int hBassStream = 0; // #31076 2013.4.1 yyagi; 繝励Ο繝代ユ繧」縺ィ縺励※螳溯」縺吶k縺ィ蜍穂ス懊′菴朱溘↓縺ェ縺」縺溘◆繧√
+ // tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅()縺ョ繧ソ繧、繝溘Φ繧ー縺ィ縲
+ // 蜀咲函騾溷コヲ繧貞、画峩縺励◆繧ソ繧、繝溘Φ繧ー縺ァ縺ョ縺ソ縲
+ // hBassStream繧呈峩譁ー縺吶k繧医≧縺ォ縺励◆縲
+ //{
+ // get
+ // {
+ // if ( _hTempoStream != 0 && !this.bIs1蛟埼溷咲函 ) // 蜀咲函騾溷コヲ縺警1.000縺ョ縺ィ縺阪ッ縲ゝempoStream繧堤畑縺縺ェ縺繧医≧縺ォ縺励※鬮倬溷喧縺吶k
+ // {
+ // return _hTempoStream;
+ // }
+ // else
+ // {
+ // return _hBassStream;
+ // }
+ // }
+ // set
+ // {
+ // _hBassStream = value;
+ // }
+ //}
+ protected SoundBuffer Buffer = null; // DirectSound 逕ィ
+ protected DirectSound DirectSound;
+ protected int hMixer = -1; // 險ュ險亥」翫@縺ヲ繧エ繝。繝ウ Mixer縺ォ蠕後〒逋サ骭イ縺吶k縺ィ縺阪↓菴ソ縺
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ private bool bDirectSound縺ァ縺ゅk
+ {
+ get { return ( this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.DirectSound ); }
+ }
+ private bool bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk
+ {
+ get
+ {
+ return (
+ this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.ASIO ||
+ this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.ExclusiveWASAPI ||
+ this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.SharedWASAPI );
+ }
+ }
+ private int _n菴咲スョ = 0;
+ private int _n菴咲スョdb;
+ private Lufs _gain = DefaultGain;
+ private Lufs? _truePeak = null;
+ private int _automationLevel = DefaultAutomationLevel;
+ private int _groupLevel = DefaultGroupLevel;
+ private long nBytes = 0;
+ private int n荳譎ょ●豁「蝗樊焚 = 0;
+ private int n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー = 0;
+ private double _db蜻ィ豕「謨ー蛟咲紫 = 1.0;
+ private double _db蜀咲函騾溷コヲ = 1.0;
+ private bool bIs1蛟埼溷咲函 = true;
+ private WaveFormat _Format;
+
+ private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, int hMixer, BASSFlag flags )
+ {
+ #region [ xa縺ィwav(RIFF chunked vorbis)縺ォ蟇セ縺励※縺ッ蟆ら畑縺ョ蜃ヲ逅繧偵☆繧 ]
+ switch ( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ).ToLower() )
+ {
+ case ".xa":
+ tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜A( str繝輔ぃ繧、繝ォ蜷, hMixer, flags );
+ return;
+
+ case ".wav":
+ if ( tRIFFchunkedVorbis縺ェ繧吋irectShow縺ァDecode縺吶k( str繝輔ぃ繧、繝ォ蜷, ref byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク ) )
+ {
+ tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, hMixer, flags );
+ return;
+ }
+ break;
+
+ default:
+ break;
+ }
+ #endregion
+
+ this.e菴懈先婿豕 = E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i;
+ this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷;
+
+
+ // BASS繝輔ぃ繧、繝ォ繧ケ繝医Μ繝シ繝繧剃ス懈舌
+
+ this._hBassStream = Bass.BASS_StreamCreateFile( str繝輔ぃ繧、繝ォ蜷, 0, 0, flags );
+ if( this._hBassStream == 0 )
+ throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_StreamCreateFile)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+
+ nBytes = Bass.BASS_ChannelGetLength( this._hBassStream );
+
+ tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( hMixer );
+ }
+ private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, int hMixer, BASSFlag flags )
+ {
+ this.e菴懈先婿豕 = E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i;
+ this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク;
+ this.hGC = GCHandle.Alloc( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, GCHandleType.Pinned ); // byte[] 繧偵ヴ繝ウ逡吶a
+
+
+ // BASS繝輔ぃ繧、繝ォ繧ケ繝医Μ繝シ繝繧剃ス懈舌
+
+ this._hBassStream = Bass.BASS_StreamCreateFile( hGC.AddrOfPinnedObject(), 0, byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク.Length, flags );
+ if ( this._hBassStream == 0 )
+ throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_StreamCreateFile)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+
+ nBytes = Bass.BASS_ChannelGetLength( this._hBassStream );
+
+ tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( hMixer );
+ }
+
+ ///
+ /// Decode "RIFF chunked Vorbis" to "raw wave"
+ /// because BASE.DLL has two problems for RIFF chunked Vorbis;
+ /// 1. time seek is not fine 2. delay occurs (about 10ms)
+ ///
+ /// wave filename
+ /// wav file image
+ ///
+ private bool tRIFFchunkedVorbis縺ェ繧吋irectShow縺ァDecode縺吶k( string str繝輔ぃ繧、繝ォ蜷, ref byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク )
+ {
+ bool b繝輔ぃ繧、繝ォ縺ォVorbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧 = false;
+
+ #region [ 繝輔ぃ繧、繝ォ縺係AV縺九▽縲〃orbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧九°繧定ェソ縺ケ縲√◎繧後↓隧イ蠖薙☆繧九↑繧峨.irectShow縺ァ繝繧ウ繝シ繝峨☆繧九]
+ //-----------------
+ try
+ {
+ Stream str = File.Open(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read);
+ using (var ws = new SoundStream(str))
+ {
+ if (ws.Format.Encoding == (WaveFormatEncoding)0x6770 || // Ogg Vorbis Mode 2+
+ ws.Format.Encoding == (WaveFormatEncoding)0x6771) // Ogg Vorbis Mode 3+
+ {
+ Trace.TraceInformation( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": RIFF chunked Vorbis. Decode to raw Wave first, to avoid BASS.DLL troubles" );
+ try
+ {
+ CDStoWAVFileImage.t螟画鋤( str繝輔ぃ繧、繝ォ蜷, out byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク );
+ b繝輔ぃ繧、繝ォ縺ォVorbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧 = true;
+ }
+ catch
+ {
+ Trace.TraceWarning( "Warning: " + Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + " : RIFF chunked Vorbis縺ョ繝繧ウ繝シ繝峨↓螟ア謨励@縺セ縺励◆縲" );
+ }
+ }
+ }
+ }
+ catch ( InvalidDataException )
+ {
+ // DirectShow縺ョ繝繧ウ繝シ繝峨↓螟ア謨励@縺溘i縲∵ャ。縺ッACM縺ァ縺ョ繝繧ウ繝シ繝峨r隧ヲ縺吶%縺ィ縺ォ縺ェ繧九◆繧√√%縺薙〒縺ッ繧ィ繝ゥ繝シ繝ュ繧ー繧貞コ縺輔↑縺縲
+ // Trace.TraceWarning( "Warning: " + Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + " : 繝繧ウ繝シ繝峨↓螟ア謨励@縺セ縺励◆縲" );
+ }
+ catch ( Exception e )
+ {
+ Trace.TraceWarning( e.ToString() );
+ Trace.TraceWarning( "Warning: " + Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + " : 隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ #endregion
+
+ return b繝輔ぃ繧、繝ォ縺ォVorbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧;
+ }
+
+ private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜A( string str繝輔ぃ繧、繝ォ蜷, int hMixer, BASSFlag flags )
+ {
+ int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ;
+ CWin32.WAVEFORMATEX wfx;
+ int totalPCMSize;
+
+ t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧( str繝輔ぃ繧、繝ォ蜷, out this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク,
+ out nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, out totalPCMSize, out wfx, true );
+
+ nBytes = totalPCMSize;
+
+ this.e菴懈先婿豕 = E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i; //.繝輔ぃ繧、繝ォ縺九i; // 蜀肴ァ狗ッ画凾縺ッ繝繧ウ繝シ繝牙セ後ョ繧、繝。繝シ繧ク繧呈オ∫畑縺吶k&Dispose譎ゅ↓hGC繧定ァ」謾セ縺吶k
+ this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷;
+ this.hGC = GCHandle.Alloc( this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, GCHandleType.Pinned ); // byte[] 繧偵ヴ繝ウ逡吶a
+
+ //_cbStreamXA = new STREAMPROC( CallbackPlayingXA );
+
+ // BASS繝輔ぃ繧、繝ォ繧ケ繝医Μ繝シ繝繧剃ス懈舌
+
+ //this.hBassStream = Bass.BASS_StreamCreate( xa.xaheader.nSamplesPerSec, xa.xaheader.nChannels, BASSFlag.BASS_STREAM_DECODE, _myStreamCreate, IntPtr.Zero );
+ //this._hBassStream = Bass.BASS_StreamCreate( (int) wfx.nSamplesPerSec, (int) wfx.nChannels, BASSFlag.BASS_STREAM_DECODE, _cbStreamXA, IntPtr.Zero );
+
+ // StreamCreate()縺ァ菴懈舌@縺殱tream縺ッseek荳榊庄縺ョ縺溘a縲ヾtreamCreateFile()繧剃スソ縺縲
+ this._hBassStream = Bass.BASS_StreamCreateFile( this.hGC.AddrOfPinnedObject(), 0L, totalPCMSize, flags );
+ if ( this._hBassStream == 0 )
+ {
+ hGC.Free();
+ throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_SampleCreate)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+ }
+
+ nBytes = Bass.BASS_ChannelGetLength( this._hBassStream );
+
+
+ tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( hMixer );
+ }
+
+
+ private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( int hMixer )
+ {
+ CSound邂。逅.nStreams++;
+
+ // 蛟九縺ョ繧ケ繝医Μ繝シ繝縺ョ蜃コ蜉帙r繝繝ウ繝晏、画峩縺ョ繧ケ繝医Μ繝シ繝縺ォ蜈・蜉帙☆繧九ゅユ繝ウ繝晏、画峩繧ケ繝医Μ繝シ繝縺ョ蜃コ蜉帙r縲`ixer縺ォ蜃コ蜉帙☆繧九
+
+// if ( CSound邂。逅.bIsTimeStretch ) // TimeStretch縺ョON/OFF縺ォ髢「繧上j縺ェ縺上√ユ繝ウ繝晏、画峩縺ョ繧ケ繝医Μ繝シ繝繧堤函謌舌☆繧九ょセ後°繧碓N/OFF蛻繧頑崛縺亥庄閭ス縺ィ縺吶k縺溘a縲
+ {
+ this._hTempoStream = BassFx.BASS_FX_TempoCreate( this._hBassStream, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_FX_FREESOURCE );
+ if ( this._hTempoStream == 0 )
+ {
+ hGC.Free();
+ throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_FX_TempoCreate)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+ }
+ else
+ {
+ Bass.BASS_ChannelSetAttribute( this._hTempoStream, BASSAttribute.BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO, 1f ); // 鬮倬溷喧(髻ウ縺ョ蜩∬ウェ縺ッ蟆代@關ス縺。繧)
+ }
+ }
+
+ if ( _hTempoStream != 0 && !this.bIs1蛟埼溷咲函 ) // 蜀咲函騾溷コヲ縺警1.000縺ョ縺ィ縺阪ッ縲ゝempoStream繧堤畑縺縺ェ縺繧医≧縺ォ縺励※鬮倬溷喧縺吶k
+ {
+ this.hBassStream = _hTempoStream;
+ }
+ else
+ {
+ this.hBassStream = _hBassStream;
+ }
+
+ // #32248 蜀咲函邨ゆコ譎ゅ↓逋コ轣ォ縺吶kcallback繧堤匳骭イ縺吶k (貍泌・冗オゆコ蠕後↓蜀咲函邨ゆコ縺吶k繝√ャ繝励r髱槫酔譛溽噪縺ォ繝溘く繧オ繝シ縺九i蜑企勁縺吶k縺溘a縲)
+ _cbEndofStream = new SYNCPROC( CallbackEndofStream );
+ Bass.BASS_ChannelSetSync( hBassStream, BASSSync.BASS_SYNC_END | BASSSync.BASS_SYNC_MIXTIME, 0, _cbEndofStream, IntPtr.Zero );
+
+ // n邱乗シ泌・乗凾髢薙ョ蜿門セ; DTXMania逕ィ縺ォ霑ス蜉縲
+ double seconds = Bass.BASS_ChannelBytes2Seconds( this._hBassStream, nBytes );
+ this.n邱乗シ泌・乗凾髢杜s = (int) ( seconds * 1000 );
+ //this.pos = 0;
+ this.hMixer = hMixer;
+ float freq = 0.0f;
+ if ( !Bass.BASS_ChannelGetAttribute( this._hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ref freq ) )
+ {
+ hGC.Free();
+ throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ蜻ィ豕「謨ー蜿門セ励↓螟ア謨励@縺セ縺励◆縲(BASS_ChannelGetAttribute)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+ }
+ this.n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー = (int) freq;
+
+ // 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医↓逋サ骭イ縲
+
+ CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Add( this );
+ }
+ //-----------------
+
+ //private int pos = 0;
+ //private int CallbackPlayingXA( int handle, IntPtr buffer, int length, IntPtr user )
+ //{
+ // int bytesread = ( pos + length > Convert.ToInt32( nBytes ) ) ? Convert.ToInt32( nBytes ) - pos : length;
+
+ // Marshal.Copy( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, pos, buffer, bytesread );
+ // pos += bytesread;
+ // if ( pos >= nBytes )
+ // {
+ // // set indicator flag
+ // bytesread |= (int) BASSStreamProc.BASS_STREAMPROC_END;
+ // }
+ // return bytesread;
+ //}
+ ///
+ /// 繧ケ繝医Μ繝シ繝縺ョ邨らォッ縺セ縺ァ蜀咲函縺励◆縺ィ縺阪↓蜻シ縺ウ蜃コ縺輔l繧九さ繝シ繝ォ繝舌ャ繧ッ
+ ///
+ ///
+ ///
+ ///
+ ///
+ private void CallbackEndofStream( int handle, int channel, int data, IntPtr user ) // #32248 2013.10.14 yyagi
+ {
+// Trace.TraceInformation( "Callback!(remove): " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) );
+ if ( b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ) // 貍泌・冗オゆコ蠕後↓蜀咲函邨ゆコ縺吶k繝√ャ繝鈴浹縺ョ繝溘く繧オ繝シ蜑企勁縺ッ縲∝咲函邨ゆコ縺ョ繧ウ繝シ繝ォ繝舌ャ繧ッ縺ォ蠑輔▲謗帙¢縺ヲ縲∬ェ蜑阪〒陦後≧縲
+ { // 縺昴≧縺ァ縺ェ縺繧ゅョ縺ッ縲√Α繧ュ繧オ繝シ蜑企勁莠亥ョ壽凾蛻サ縺ォ蜑企勁縺吶k縲
+ tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k( channel );
+ }
+ }
+
+// mixer縺九i縺ョ蜑企勁
+
+ public bool tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k()
+ {
+ return tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k( this.hBassStream );
+ }
+ public bool tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k( int channel )
+ {
+ bool b = BassMix.BASS_Mixer_ChannelRemove( channel );
+ if ( b )
+ {
+ Interlocked.Decrement( ref CSound邂。逅.nMixing );
+// Debug.WriteLine( "Removed: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " (" + channel + ")" + " MixedStreams=" + CSound邂。逅.nMixing );
+ }
+ return b;
+ }
+
+
+// mixer 縺ク縺ョ霑ス蜉
+
+ public bool tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k()
+ {
+ if ( BassMix.BASS_Mixer_ChannelGetMixer( hBassStream ) == 0 )
+ {
+ BASSFlag bf = BASSFlag.BASS_SPEAKER_FRONT | BASSFlag.BASS_MIXER_NORAMPIN | BASSFlag.BASS_MIXER_PAUSE;
+ Interlocked.Increment( ref CSound邂。逅.nMixing );
+
+ // preload縺輔l繧九%縺ィ繧呈悄蠕縺励※縲∵覆縺医※flag縺九i縺ッBASS_MIXER_PAUSE繧貞、悶@縺ヲAddChannel縺励◆荳翫〒縲√☆縺舌↓PAUSE縺吶k
+ // -> ChannelUpdate縺ァprebuffer縺ァ縺阪k縺薙→縺悟縺九▲縺溘◆繧√。ASS_MIXER_PAUSE繧剃スソ逕ィ縺吶k縺薙→縺ォ縺励◆
+
+ bool b1 = BassMix.BASS_Mixer_StreamAddChannel( this.hMixer, this.hBassStream, bf );
+ //bool b2 = BassMix.BASS_Mixer_ChannelPause( this.hBassStream );
+ t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺(); // StreamAddChannel縺ョ蠕後〒蜀咲函菴咲スョ繧呈綾縺輔↑縺縺ィ繝繝。縲る縺縺ィ蜀咲函菴咲スョ縺悟、峨o繧峨↑縺縲
+//Trace.TraceInformation( "Add Mixer: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " (" + hBassStream + ")" + " MixedStreams=" + CSound邂。逅.nMixing );
+ Bass.BASS_ChannelUpdate( this.hBassStream, 0 ); // pre-buffer
+ return b1; // &b2;
+ }
+ return true;
+ }
+
+ #region [ t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧() ]
+ public void t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧( string str繝輔ぃ繧、繝ォ蜷, out byte[] buffer,
+ out int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, out int totalPCMSize, out CWin32.WAVEFORMATEX wfx,
+ bool bIntegrateWaveHeader )
+ {
+ nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = 0;
+ //int nPCM繧オ繧、繧コbyte = (int) ( xa.xaheader.nSamples * xa.xaheader.nChannels * 2 ); // nBytes = Bass.BASS_ChannelGetLength( this.hBassStream );
+
+ SoundDecoder sounddecoder;
+
+ if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".xa", true ) == 0 )
+ {
+ sounddecoder = new Cxa();
+ }
+ else if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".ogg", true ) == 0 )
+ {
+ sounddecoder = new Cogg();
+ }
+ else if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".mp3", true ) == 0 )
+ {
+ sounddecoder = new Cmp3();
+ }
+ else
+ {
+ throw new NotImplementedException();
+ }
+
+ if ( !File.Exists( str繝輔ぃ繧、繝ォ蜷 ) )
+ {
+ throw new Exception( string.Format( "繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+ int nHandle = sounddecoder.Open( str繝輔ぃ繧、繝ォ蜷 );
+ if ( nHandle < 0 )
+ {
+ throw new Exception( string.Format( "Open() 縺ォ螟ア謨励@縺セ縺励◆縲({0})({1})", nHandle, str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+ wfx = new CWin32.WAVEFORMATEX();
+ if ( sounddecoder.GetFormat( nHandle, ref wfx ) < 0 )
+ {
+ sounddecoder.Close( nHandle );
+ throw new Exception( string.Format( "GetFormat() 縺ォ螟ア謨励@縺セ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+ //totalPCMSize = (int) sounddecoder.nTotalPCMSize; // t繝繧ウ繝シ繝牙セ後ョ繧オ繧、繧コ繧定ェソ縺ケ繧()縺ァ譌「縺ォ蜿門セ玲ク医∩縺ョ蛟、繧呈オ∫畑縺吶k縲Ns蜊倅ス阪ョ鬮倬溷喧縺縺後√メ繝繝鈴浹縺後◆縺上&繧薙≠繧九→蝪オ遨阪〒邨先ァ句柑譫懊′縺ゅk
+ totalPCMSize = (int) sounddecoder.GetTotalPCMSize( nHandle );
+ if ( totalPCMSize == 0 )
+ {
+ sounddecoder.Close( nHandle );
+ throw new Exception( string.Format( "GetTotalPCMSize() 縺ォ螟ア謨励@縺セ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+ totalPCMSize += ( ( totalPCMSize % 2 ) != 0 ) ? 1 : 0;
+ int wavheadersize = ( bIntegrateWaveHeader ) ? 44 : 0;
+ byte[] buffer_rawdata = new byte[ totalPCMSize ];
+ buffer = new byte[ wavheadersize + totalPCMSize ];
+ GCHandle handle = GCHandle.Alloc( buffer_rawdata, GCHandleType.Pinned );
+ try
+ {
+ if ( sounddecoder.Decode( nHandle, handle.AddrOfPinnedObject(), (uint) totalPCMSize, 0 ) < 0 )
+ {
+ buffer = null;
+ throw new Exception( string.Format( "繝繧ウ繝シ繝峨↓螟ア謨励@縺セ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) );
+ }
+ if ( bIntegrateWaveHeader )
+ {
+ // wave header繧呈嶌縺崎セシ繧
+
+ int wfx諡。蠑オ鬆伜沺_Length = 0;
+ var ms = new MemoryStream();
+ var bw = new BinaryWriter( ms );
+ bw.Write( new byte[] { 0x52, 0x49, 0x46, 0x46 } ); // 'RIFF'
+ bw.Write( (UInt32) totalPCMSize + 44 - 8 ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8 [byte]シ帑サ翫ッ荳肴弱↑縺ョ縺ァ蠕後〒荳頑嶌縺阪☆繧九
+ bw.Write( new byte[] { 0x57, 0x41, 0x56, 0x45 } ); // 'WAVE'
+ bw.Write( new byte[] { 0x66, 0x6D, 0x74, 0x20 } ); // 'fmt '
+ bw.Write( (UInt32) ( 16 + ( ( wfx諡。蠑オ鬆伜沺_Length > 0 ) ? ( 2/*sizeof(WAVEFORMATEX.cbSize)*/ + wfx諡。蠑オ鬆伜沺_Length ) : 0 ) ) ); // fmt繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte]
+ bw.Write( (UInt16) wfx.wFormatTag ); // 繝輔か繝シ繝槭ャ繝IDシ医Μ繝九いPCM縺ェ繧1シ
+ bw.Write( (UInt16) wfx.nChannels ); // 繝√Ε繝ウ繝阪Ν謨ー
+ bw.Write( (UInt32) wfx.nSamplesPerSec ); // 繧オ繝ウ繝励Μ繝ウ繧ー繝ャ繝シ繝
+ bw.Write( (UInt32) wfx.nAvgBytesPerSec ); // 繝繝シ繧ソ騾溷コヲ
+ bw.Write( (UInt16) wfx.nBlockAlign ); // 繝悶Ο繝繧ッ繧オ繧、繧コ
+ bw.Write( (UInt16) wfx.wBitsPerSample ); // 繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝薙ャ繝域焚
+ //if ( wfx諡。蠑オ鬆伜沺_Length > 0 )
+ //{
+ // bw.Write( (UInt16) wfx諡。蠑オ鬆伜沺.Length ); // 諡。蠑オ鬆伜沺縺ョ繧オ繧、繧コ[byte]
+ // bw.Write( wfx諡。蠑オ鬆伜沺 ); // 諡。蠑オ繝繝シ繧ソ
+ //}
+ bw.Write( new byte[] { 0x64, 0x61, 0x74, 0x61 } ); // 'data'
+ //int nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ = (int) ms.Position;
+ bw.Write( (UInt32) totalPCMSize ); // data繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte]
+
+ byte[] bs = ms.ToArray();
+
+ bw.Close();
+ ms.Close();
+
+ for ( int i = 0; i < bs.Length; i++ )
+ {
+ buffer[ i ] = bs[ i ];
+ }
+ }
+ int s = ( bIntegrateWaveHeader ) ? 44 : 0;
+ for ( int i = 0; i < totalPCMSize; i++ )
+ {
+ buffer[ i + s ] = buffer_rawdata[ i ];
+ }
+ totalPCMSize += wavheadersize;
+ nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = wavheadersize;
+ }
+ finally
+ {
+ handle.Free();
+ sounddecoder.Close( nHandle );
+ sounddecoder = null;
+ }
+ }
+ #endregion
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceASIO.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceASIO.cs
new file mode 100644
index 00000000..8012b8e7
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceASIO.cs
@@ -0,0 +1,455 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using Un4seen.Bass;
+using Un4seen.BassAsio;
+using Un4seen.Bass.AddOn.Mix;
+
+namespace FDK
+{
+ ///
+ /// 蜈ィASIO繝繝舌う繧ケ繧貞玲嫌縺吶k髱咏噪繧ッ繝ゥ繧ケ縲
+ /// BASS_Init()繧ВASS_ASIO_Init()縺ョ迥カ諷九→縺ッ辟。髢「菫ゅ↓菴ソ逕ィ蜿ッ閭ス縲
+ ///
+ public static class CEnumerateAllAsioDevices
+ {
+ public static string[] GetAllASIODevices()
+ {
+ //Debug.WriteLine( "BassAsio.BASS_ASIO_GetDeviceInfos():" );
+ BASS_ASIO_DEVICEINFO[] bassAsioDevInfo = BassAsio.BASS_ASIO_GetDeviceInfos();
+
+ List asioDeviceList = new List();
+
+ if ( bassAsioDevInfo.Length == 0 )
+ {
+ asioDeviceList.Add( "None" );
+ }
+ else
+ {
+ for ( int i = 0; i < bassAsioDevInfo.Length; i++ )
+ {
+ asioDeviceList.Add( bassAsioDevInfo[ i ].name );
+ //Trace.TraceInformation( "ASIO Device {0}: {1}", i, bassAsioDevInfo[ i ].name );
+ }
+ }
+
+ return asioDeviceList.ToArray();
+ }
+ }
+
+ internal class CSoundDeviceASIO : ISoundDevice
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ
+ {
+ get;
+ protected set;
+ }
+ public long n螳溷コ蜉幃≦蟒カms
+ {
+ get;
+ protected set;
+ }
+ public long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms
+ {
+ get;
+ protected set;
+ }
+ public int nASIODevice
+ {
+ get;
+ set;
+ }
+
+ // CSoundTimer 逕ィ縺ォ蜈ャ髢九@縺ヲ縺繧九励Ο繝代ユ繧」
+
+ public long n邨碁℃譎る俣ms
+ {
+ get;
+ protected set;
+ }
+ public long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get;
+ protected set;
+ }
+ public CTimer tm繧キ繧ケ繝繝繧ソ繧、繝
+ {
+ get;
+ protected set;
+ }
+
+
+ // 繝槭せ繧ソ繝シ繝懊Μ繝・繝シ繝縺ョ蛻カ蠕。繧ウ繝シ繝峨ッ縲仝ASAPI/ASIO縺ァ蜈ィ縺丞酔縺倥
+ public int nMasterVolume
+ {
+ get
+ {
+ float f髻ウ驥 = 0.0f;
+ bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f髻ウ驥 );
+ if ( !b )
+ {
+ BASSError be = Bass.BASS_ErrorGetCode();
+ Trace.TraceInformation( "ASIO Master Volume Get Error: " + be.ToString() );
+ }
+ else
+ {
+ //Trace.TraceInformation( "ASIO Master Volume Get Success: " + (f髻ウ驥 * 100) );
+
+ }
+ return (int) ( f髻ウ驥 * 100 );
+ }
+ set
+ {
+ bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, (float) ( value / 100.0 ) );
+ if ( !b )
+ {
+ BASSError be = Bass.BASS_ErrorGetCode();
+ Trace.TraceInformation( "ASIO Master Volume Set Error: " + be.ToString() );
+ }
+ else
+ {
+ // int n = this.nMasterVolume;
+ // Trace.TraceInformation( "ASIO Master Volume Set Success: " + value );
+ }
+ }
+ }
+
+ // 繝。繧ス繝繝
+
+ public CSoundDeviceASIO( long n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms, int _nASIODevice )
+ {
+ // 蛻晄悄蛹悶
+
+ Trace.TraceInformation( "BASS (ASIO) 縺ョ蛻晄悄蛹悶r髢句ァ九@縺セ縺吶" );
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown;
+ this.n螳溷コ蜉幃≦蟒カms = 0;
+ this.n邨碁℃譎る俣ms = 0;
+ this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = CTimer.n譛ェ菴ソ逕ィ;
+ this.tm繧キ繧ケ繝繝繧ソ繧、繝 = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ this.nASIODevice = _nASIODevice;
+
+ #region [ BASS registration ]
+ // BASS.NET 繝ヲ繝シ繧カ逋サ骭イシBASS繧ケ繝励Λ繝繧キ繝・縺碁撼陦ィ遉コ縺ォ縺ェ繧具シ峨
+ BassNet.Registration( "dtx2013@gmail.com", "2X9181017152222" );
+ #endregion
+
+ #region [ BASS Version Check ]
+ // BASS 縺ョ繝舌シ繧ク繝ァ繝ウ繝√ぉ繝繧ッ縲
+ int nBASSVersion = Utils.HighWord( Bass.BASS_GetVersion() );
+ if( nBASSVersion != Bass.BASSVERSION )
+ throw new DllNotFoundException( string.Format( "bass.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSVersion, Bass.BASSVERSION ) );
+
+ int nBASSMixVersion = Utils.HighWord( BassMix.BASS_Mixer_GetVersion() );
+ if( nBASSMixVersion != BassMix.BASSMIXVERSION )
+ throw new DllNotFoundException( string.Format( "bassmix.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSMixVersion, BassMix.BASSMIXVERSION ) );
+
+ int nBASSASIO = Utils.HighWord( BassAsio.BASS_ASIO_GetVersion() );
+ if( nBASSASIO != BassAsio.BASSASIOVERSION )
+ throw new DllNotFoundException( string.Format( "bassasio.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSASIO, BassAsio.BASSASIOVERSION ) );
+ #endregion
+
+ // BASS 縺ョ險ュ螳壹
+
+ this.bIsBASSFree = true;
+
+ if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲
+ {
+ Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATEPERIOD)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]");
+ }
+ if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲
+ {
+ Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATETHREADS)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]");
+ }
+
+ // BASS 縺ョ蛻晄悄蛹悶
+
+ int n繝繝舌う繧ケ = 0; // 0:"no device" 窶ヲ BASS 縺九i縺ッ繝繝舌う繧ケ縺ク繧「繧ッ繧サ繧ケ縺輔○縺ェ縺縲ゅい繧ッ繧サ繧ケ縺ッ BASSASIO 繧「繝峨が繝ウ縺九i陦後≧縲
+ int n蜻ィ豕「謨ー = 44100; // 莉ョ豎コ繧√よ怙邨ら噪縺ェ蜻ィ豕「謨ー縺ッ繝繝舌う繧ケシ遺旺繝峨Λ繧、繝撰シ峨′豎コ繧√k縲
+ if( !Bass.BASS_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) )
+ throw new Exception( string.Format( "BASS 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+
+ Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_CURVE_VOL, true);
+
+//Debug.WriteLine( "BASS_Init()螳御コ縲" );
+ #region [ 繝繝舌ャ繧ー逕ィ: ASIO繝繝舌う繧ケ縺ョenumerate縺ィ縲√Ο繧ー蜃コ蜉 ]
+// CEnumerateAllAsioDevices.GetAllASIODevices();
+//Debug.WriteLine( "BassAsio.BASS_ASIO_GetDeviceInfo():" );
+// int a, count = 0;
+// BASS_ASIO_DEVICEINFO asioDevInfo;
+// for ( a = 0; ( asioDevInfo = BassAsio.BASS_ASIO_GetDeviceInfo( a ) ) != null; a++ )
+// {
+// Trace.TraceInformation( "ASIO Device {0}: {1}, driver={2}", a, asioDevInfo.name, asioDevInfo.driver );
+// count++; // count it
+// }
+ #endregion
+
+ // BASS ASIO 縺ョ蛻晄悄蛹悶
+ BASS_ASIO_INFO asioInfo = null;
+ if ( BassAsio.BASS_ASIO_Init( nASIODevice, BASSASIOInit.BASS_ASIO_THREAD ) ) // 蟆ら畑繧ケ繝ャ繝繝峨↓縺ヲ襍キ蜍
+ {
+ #region [ ASIO 縺ョ蛻晄悄蛹悶↓謌仙粥縲]
+ //-----------------
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.ASIO;
+ asioInfo = BassAsio.BASS_ASIO_GetInfo();
+ this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー = asioInfo.outputs;
+ this.db蜻ィ豕「謨ー = BassAsio.BASS_ASIO_GetRate();
+ this.fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝 = BassAsio.BASS_ASIO_ChannelGetFormat( false, 0 );
+
+ Trace.TraceInformation( "BASS 繧貞晄悄蛹悶@縺セ縺励◆縲(ASIO, 繝繝舌う繧ケ:\"{0}\", 蜈・蜉學1}, 蜃コ蜉學2}, {3}Hz, 繝舌ャ繝輔ぃ{4}ス桀6}sample ({5:0.###}ス桀7:0.###}ms), 繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝:{8})",
+ asioInfo.name,
+ asioInfo.inputs,
+ asioInfo.outputs,
+ this.db蜻ィ豕「謨ー.ToString( "0.###" ),
+ asioInfo.bufmin, asioInfo.bufmin * 1000 / this.db蜻ィ豕「謨ー,
+ asioInfo.bufmax, asioInfo.bufmax * 1000 / this.db蜻ィ豕「謨ー,
+ this.fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝.ToString()
+ );
+ this.bIsBASSFree = false;
+ #region [ debug: channel format ]
+ //BASS_ASIO_CHANNELINFO chinfo = new BASS_ASIO_CHANNELINFO();
+ //int chan = 0;
+ //while ( true )
+ //{
+ // if ( !BassAsio.BASS_ASIO_ChannelGetInfo( false, chan, chinfo ) )
+ // break;
+ // Debug.WriteLine( "Ch=" + chan + ": " + chinfo.name.ToString() + ", " + chinfo.group.ToString() + ", " + chinfo.format.ToString() );
+ // chan++;
+ //}
+ #endregion
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ #region [ ASIO 縺ョ蛻晄悄蛹悶↓螟ア謨励]
+ //-----------------
+ BASSError errcode = Bass.BASS_ErrorGetCode();
+ string errmes = errcode.ToString();
+ if ( errcode == BASSError.BASS_OK )
+ {
+ errmes = "BASS_OK; The device may be dissconnected";
+ }
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS (ASIO) 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_ASIO_Init)[{0}]", errmes ) );
+ //-----------------
+ #endregion
+ }
+
+
+ // ASIO 蜃コ蜉帙メ繝」繝ウ繝阪Ν縺ョ蛻晄悄蛹悶
+
+ this.tAsioProc = new ASIOPROC( this.tAsio蜃ヲ逅 ); // 繧「繝ウ繝槭ロ繝シ繧ク縺ォ貂。縺 delegate 縺ッ縲√ヵ繧」繝シ繝ォ繝峨→縺励※菫晄戟縺励※縺翫°縺ェ縺縺ィGC縺ァ繧「繝峨Ξ繧ケ縺悟、峨o縺」縺ヲ縺励∪縺縲
+ if ( !BassAsio.BASS_ASIO_ChannelEnable( false, 0, this.tAsioProc, IntPtr.Zero ) ) // 蜃コ蜉帙メ繝」繝ウ繝阪Ν0 縺ョ譛牙柑蛹悶
+ {
+ #region [ ASIO 蜃コ蜉帙メ繝」繝ウ繝阪Ν縺ョ蛻晄悄蛹悶↓螟ア謨励]
+ //-----------------
+ BassAsio.BASS_ASIO_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "Failed BASS_ASIO_ChannelEnable() [{0}]", BassAsio.BASS_ASIO_ErrorGetCode().ToString() ) );
+ //-----------------
+ #endregion
+ }
+ for ( int i = 1; i < this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー; i++ ) // 蜃コ蜉帙メ繝」繝阪Ν繧貞ィ縺ヲ繝√Ε繝阪Ν0縺ィ繧ー繝ォ繝シ繝怜喧縺吶k縲
+ { // 繝√Ε繝阪Ν1縺縺代r0縺ィ繧ー繝ォ繝シ繝怜喧縺吶k縺ィ縲3ch莉・荳翫ョ蜃コ蜉帙r繧オ繝昴シ繝医@縺溘き繝シ繝峨〒縺ョ蜍穂ス懊′縺翫°縺励¥縺ェ繧
+ if ( !BassAsio.BASS_ASIO_ChannelJoin( false, i, 0 ) )
+ {
+ #region [ 蛻晄悄蛹悶↓螟ア謨励]
+ //-----------------
+ BassAsio.BASS_ASIO_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "Failed BASS_ASIO_ChannelJoin({1}) [{0}]", BassAsio.BASS_ASIO_ErrorGetCode().ToString(), i ) );
+ //-----------------
+ #endregion
+ }
+ }
+ if ( !BassAsio.BASS_ASIO_ChannelSetFormat( false, 0, this.fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 ) ) // 蜃コ蜉帙メ繝」繝ウ繝阪Ν0縺ョ繝輔か繝シ繝槭ャ繝
+ {
+ #region [ ASIO 蜃コ蜉帙メ繝」繝ウ繝阪Ν縺ョ蛻晄悄蛹悶↓螟ア謨励]
+ //-----------------
+ BassAsio.BASS_ASIO_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "Failed BASS_ASIO_ChannelSetFormat() [{0}]", BassAsio.BASS_ASIO_ErrorGetCode().ToString() ) );
+ //-----------------
+ #endregion
+ }
+
+ // ASIO 蜃コ蜉帙→蜷後§繝輔か繝シ繝槭ャ繝医r謖√▽ BASS 繝溘く繧オ繝シ繧剃ス懈舌
+
+ var flag = BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_STREAM_DECODE; // 繝繧ウ繝シ繝峨ョ縺ソシ晉匱螢ー縺励↑縺縲ASIO 縺ォ蜃コ蜉帙&繧後k縺縺代
+ if( this.fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝 == BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT )
+ flag |= BASSFlag.BASS_SAMPLE_FLOAT;
+ this.hMixer = BassMix.BASS_Mixer_StreamCreate( (int) this.db蜻ィ豕「謨ー, this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー, flag );
+
+ if ( this.hMixer == 0 )
+ {
+ BASSError err = Bass.BASS_ErrorGetCode();
+ BassAsio.BASS_ASIO_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS繝溘く繧オ(mixing)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", err ) );
+ }
+
+ // BASS 繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚繧堤ョ怜コ縲
+
+ var mixerInfo = Bass.BASS_ChannelGetInfo( this.hMixer );
+ int n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 0;
+ switch( this.fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 )
+ {
+ case BASSASIOFormat.BASS_ASIO_FORMAT_16BIT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 2; break;
+ case BASSASIOFormat.BASS_ASIO_FORMAT_24BIT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 3; break;
+ case BASSASIOFormat.BASS_ASIO_FORMAT_32BIT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 4; break;
+ case BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 4; break;
+ }
+ //long n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 = /*mixerInfo.chans*/ 2 * n繧オ繝ウ繝励Ν繧オ繧、繧コbyte;
+ long n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 = mixerInfo.chans * n繧オ繝ウ繝励Ν繧オ繧、繧コbyte;
+ this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 * mixerInfo.freq;
+
+
+ // 蜊倡エ斐↓縲”Mixer縺ョ髻ウ驥上rMasterVolume縺ィ縺励※蛻カ蠕。縺励※繧ゅ
+ // ChannelGetData()縺ョ蜀螳ケ縺ォ縺ッ蜿肴丐縺輔l縺ェ縺縲
+ // 縺昴ョ縺溘a縲√b縺荳谿オmixer繧貞剱縺セ縺帙※縲∽ク谿オ蜈医ョmixer縺九iChannelGetData()縺吶k縺薙→縺ァ縲
+ // hMixer縺ョ髻ウ驥丞宛蠕。繧貞渚譏縺輔○繧九
+ this.hMixer_DeviceOut = BassMix.BASS_Mixer_StreamCreate(
+ (int) this.db蜻ィ豕「謨ー, this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー, flag );
+ if ( this.hMixer_DeviceOut == 0 )
+ {
+ BASSError errcode = Bass.BASS_ErrorGetCode();
+ BassAsio.BASS_ASIO_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) );
+ }
+ {
+ bool b1 = BassMix.BASS_Mixer_StreamAddChannel( this.hMixer_DeviceOut, this.hMixer, BASSFlag.BASS_DEFAULT );
+ if ( !b1 )
+ {
+ BASSError errcode = Bass.BASS_ErrorGetCode();
+ BassAsio.BASS_ASIO_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ縺ィmixing)縺ョ謗・邯壹↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) );
+ };
+ }
+
+
+ // 蜃コ蜉帙r髢句ァ九
+
+ this.n繝舌ャ繝輔ぃ繧オ繧、繧コsample = (int) ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms * this.db蜻ィ豕「謨ー / 1000.0 );
+ //this.n繝舌ャ繝輔ぃ繧オ繧、繧コsample = (int) n繝舌ャ繝輔ぃ繧オ繧、繧コbyte;
+ if ( !BassAsio.BASS_ASIO_Start( this.n繝舌ャ繝輔ぃ繧オ繧、繧コsample ) ) // 遽蝗イ螟悶ョ蛟、繧呈欠螳壹@縺溷エ蜷医ッ閾ェ蜍慕噪縺ォ繝繝輔か繝ォ繝亥、縺ォ險ュ螳壹&繧後k縲
+ {
+ BASSError err = BassAsio.BASS_ASIO_ErrorGetCode();
+ BassAsio.BASS_ASIO_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( "ASIO 繝繝舌う繧ケ蜃コ蜉幃幕蟋九↓螟ア謨励@縺セ縺励◆縲" + err.ToString() );
+ }
+ else
+ {
+ int n驕蟒カsample = BassAsio.BASS_ASIO_GetLatency( false ); // 縺薙ョ髢「謨ー縺ッ BASS_ASIO_Start() 蠕後↓縺励°蜻シ縺ウ蜃コ縺帙↑縺縲
+ int n蟶梧悍驕蟒カsample = (int) ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms * this.db蜻ィ豕「謨ー / 1000.0 );
+ this.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms = this.n螳溷コ蜉幃≦蟒カms = (long) ( n驕蟒カsample * 1000.0f / this.db蜻ィ豕「謨ー );
+ Trace.TraceInformation( "ASIO 繝繝舌う繧ケ蜃コ蜉幃幕蟋具シ壹ヰ繝繝輔ぃ{0}sample(蟶梧悍{1}) [{2}ms(蟶梧悍{3}ms)]", n驕蟒カsample, n蟶梧悍驕蟒カsample, this.n螳溷コ蜉幃≦蟒カms, n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms );
+ }
+ }
+
+ #region [ t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧() ]
+ public CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup )
+ {
+ var sound = new CSound(soundGroup);
+ sound.tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer );
+ return sound;
+ }
+
+ public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound )
+ {
+ sound.tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer );
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound )
+ {
+ sound.tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.hMixer );
+ }
+ #endregion
+
+
+ #region [ Dispose-Finallize繝代ち繝シ繝ウ螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ this.Dispose( true );
+ GC.SuppressFinalize( this );
+ }
+ protected void Dispose( bool bManagedDispose )
+ {
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; // 縺セ縺壼コ蜉帛●豁「縺吶k(Dispose荳ュ縺ォ繧ッ繝ゥ繧ケ蜀縺ォ繧「繧ッ繧サ繧ケ縺輔l繧九%縺ィ繧帝亟縺)
+ if ( hMixer != -1 )
+ {
+ Bass.BASS_StreamFree( this.hMixer );
+ }
+ if ( !this.bIsBASSFree )
+ {
+ BassAsio.BASS_ASIO_Free(); // 繧キ繧ケ繝繝繧ソ繧、繝槭h繧雁医↓蜻シ縺ウ蜃コ縺吶%縺ィ縲ゑシtAsio蜃ヲ逅() 縺ョ荳ュ縺ァ繧キ繧ケ繝繝繧ソ繧、繝槭r蜿らァ縺励※繧九◆繧シ
+ Bass.BASS_Free();
+ }
+
+ if( bManagedDispose )
+ {
+ C蜈ア騾.tDispose縺吶k( this.tm繧キ繧ケ繝繝繧ソ繧、繝 );
+ this.tm繧キ繧ケ繝繝繧ソ繧、繝 = null;
+ }
+ }
+ ~CSoundDeviceASIO()
+ {
+ this.Dispose( false );
+ }
+ //-----------------
+ #endregion
+
+
+ protected int hMixer = -1;
+ protected int hMixer_DeviceOut = -1;
+ protected int n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー = 0;
+ protected double db蜻ィ豕「謨ー = 0.0;
+ protected int n繝舌ャ繝輔ぃ繧オ繧、繧コsample = 0;
+ protected BASSASIOFormat fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝 = BASSASIOFormat.BASS_ASIO_FORMAT_UNKNOWN;
+ protected BASSASIOFormat fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 = BASSASIOFormat.BASS_ASIO_FORMAT_16BIT; // 16bit 蝗コ螳
+ //protected BASSASIOFormat fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 = BASSASIOFormat.BASS_ASIO_FORMAT_32BIT;// 16bit 蝗コ螳
+ protected ASIOPROC tAsioProc = null;
+
+ protected int tAsio蜃ヲ逅( bool input, int channel, IntPtr buffer, int length, IntPtr user )
+ {
+ if( input ) return 0;
+
+
+ // BASS繝溘く繧オ縺九i縺ョ蜃コ蜉帙ョ繝シ繧ソ繧偵◎縺ョ縺セ縺セ ASIO buffer 縺ク荳ク謚輔£縲
+
+ int num = Bass.BASS_ChannelGetData( this.hMixer_DeviceOut, buffer, length ); // num = 螳滄圀縺ォ霆「騾√@縺滄聞縺
+
+ if ( num == -1 ) num = 0;
+
+
+ // 邨碁℃譎る俣繧呈峩譁ー縲
+ // 繝繝シ繧ソ縺ョ霆「騾∝キョ蛻縺ァ縺ッ縺ェ縺冗エッ遨崎サ「騾√ヰ繧、繝域焚縺九i邂怜コ縺吶k縲
+
+ this.n邨碁℃譎る俣ms = ( this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 * 1000 / this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 ) - this.n螳溷コ蜉幃≦蟒カms;
+ this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+
+
+ // 邨碁℃譎る俣繧呈峩譁ー蠕後↓縲∽サ雁屓蛻縺ョ邏ッ遨崎サ「騾√ヰ繧、繝域焚繧貞渚譏縲
+
+ this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 += num;
+ return num;
+ }
+
+ private long n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = 0;
+ private long n邏ッ遨崎サ「騾√ヰ繧、繝域焚 = 0;
+ private bool bIsBASSFree = true;
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceDirectSound.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceDirectSound.cs
new file mode 100644
index 00000000..13a27965
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceDirectSound.cs
@@ -0,0 +1,278 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using System.IO;
+using System.Threading;
+using SlimDX;
+using SharpDX.DirectSound;
+
+namespace FDK
+{
+ internal class CSoundDeviceDirectSound : ISoundDevice
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ
+ {
+ get;
+ protected set;
+ }
+ public long n螳溷コ蜉幃≦蟒カms
+ {
+ get;
+ protected set;
+ }
+ public long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms
+ {
+ get;
+ protected set;
+ }
+
+ public static readonly BufferFlags DefaultFlags = BufferFlags.Defer | BufferFlags.GetCurrentPosition2 | BufferFlags.GlobalFocus | BufferFlags.ControlVolume | BufferFlags.ControlPan | BufferFlags.ControlFrequency;
+
+ // CSoundTimer 逕ィ縺ォ蜈ャ髢九@縺ヲ縺繧九励Ο繝代ユ繧」
+
+ public long n邨碁℃譎る俣ms
+ {
+ get
+ {
+ if ( ctimer != null )
+ {
+ this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ.DirectSoundBuffer.GetCurrentPosition(out int n迴セ蝨ィ菴咲スョ, out int _);
+ long n迴セ蝨ィ縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+
+
+ // 繝ォ繝シ繝怜屓謨ー繧定ェソ謨エ縲
+
+ long n繧キ繧ケ繝繝譎ょ綾縺ァ縺ョ髢馴囈ms = n迴セ蝨ィ縺ョ繧キ繧ケ繝繝譎ょ綾ms - this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms;
+
+ while ( n繧キ繧ケ繝繝譎ょ綾縺ァ縺ョ髢馴囈ms >= n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms ) // 蜑榊屓縺九i蜊倅ス咲ケー繧贋ク翫£髢馴囈莉・荳顔オ碁℃縺励※繧九↑繧臥「コ螳溘↓繝ォ繝シ繝励@縺ヲ縺繧九りェ、蟾ョ縺ッ螟ァ縺阪¥縺ェ縺縺繧阪≧縺九i辟。隕悶
+ {
+ this.n繝ォ繝シ繝怜屓謨ー++;
+ n繧キ繧ケ繝繝譎ょ綾縺ァ縺ョ髢馴囈ms -= n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms;
+ }
+
+ if ( n迴セ蝨ィ菴咲スョ < this.n蜑榊屓縺ョ菴咲スョ ) // 蜊倅ス咲ケー繧贋ク翫£髢馴囈莉・蜀縺ァ縺ゅ▲縺ヲ繧ゅ∫樟蝨ィ菴咲スョ縺悟燕蝗槭h繧頑焔蜑阪↓縺ゅk縺ェ繧1蝗槭Ν繝シ繝励@縺ヲ縺繧九
+ this.n繝ォ繝シ繝怜屓謨ー++;
+
+
+ // 邨碁℃譎る俣繧堤ョ怜コ縲
+
+ long n邨碁℃譎る俣ms = (long) ( ( this.n繝ォ繝シ繝怜屓謨ー * n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms ) + ( n迴セ蝨ィ菴咲スョ * 1000.0 / ( 44100.0 * 2 * 2 ) ) );
+
+
+ // 莉雁屓縺ョ蛟、繧呈ャ。蝗槭↓蜷代¢縺ヲ菫晏ュ倥
+
+ this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = n迴セ蝨ィ縺ョ繧キ繧ケ繝繝譎ょ綾ms;
+ this.n蜑榊屓縺ョ菴咲スョ = n迴セ蝨ィ菴咲スョ;
+
+ return n邨碁℃譎る俣ms;
+ }
+ else
+ {
+ long nRet = ctimer.n繧キ繧ケ繝繝譎ょ綾ms - this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms;
+ if ( nRet < 0 ) // 繧ォ繧ヲ繝ウ繧ソ縺後Ν繝シ繝励@縺溘→縺阪ッ
+ {
+ nRet = ( ctimer.n繧キ繧ケ繝繝譎ょ綾 - long.MinValue ) + ( long.MaxValue - this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms ) + 1;
+ }
+ this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = ctimer.n繧キ繧ケ繝繝譎ょ綾ms;
+
+ return nRet;
+ }
+ }
+ }
+ public long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get { throw new NotImplementedException(); }
+ }
+ public CTimer tm繧キ繧ケ繝繝繧ソ繧、繝
+ {
+ get;
+ protected set;
+ }
+
+ public int nMasterVolume
+ {
+ get
+ {
+ return (int) 100;
+ }
+ set
+ {
+ // 迚ケ縺ォ菴輔b縺励↑縺
+ }
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public CSoundDeviceDirectSound( IntPtr hWnd, long n驕蟒カ譎る俣ms, bool bUseOSTimer )
+ {
+ Trace.TraceInformation( "DirectSound 縺ョ蛻晄悄蛹悶r髢句ァ九@縺セ縺吶" );
+
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown;
+ this.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms = this.n螳溷コ蜉幃≦蟒カms = n驕蟒カ譎る俣ms;
+ this.tm繧キ繧ケ繝繝繧ソ繧、繝 = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+
+ #region [ DirectSound 繝繝舌う繧ケ繧剃ス懈舌☆繧九]
+ //-----------------
+ this.DirectSound = new DirectSound(); // 螟ア謨励@縺溘i萓句、悶r縺昴ョ縺セ縺セ逋コ蜃コ縲
+
+ // 繝繝舌う繧ケ縺ョ蜊碑ェソ繝ャ繝吶Ν繧定ィュ螳壹☆繧九
+
+ bool priority = true;
+ try
+ {
+ this.DirectSound.SetCooperativeLevel( hWnd, CooperativeLevel.Priority );
+ }
+ catch
+ {
+ this.DirectSound.SetCooperativeLevel( hWnd, CooperativeLevel.Normal ); // 縺薙l縺ァ繧ょ、ア謨励@縺溘i萓句、悶r縺昴ョ縺セ縺セ逋コ蜃コ縲
+ priority = false;
+ }
+
+ // 繝繝舌う繧ケ菴懈仙ョ御コ縲
+
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.DirectSound;
+ //-----------------
+ #endregion
+
+ if ( !bUseOSTimer )
+ {
+ #region [ 邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧剃ス懈舌@縲√Ν繝シ繝怜咲函繧帝幕蟋九☆繧九]
+ //-----------------
+
+ // 蜊倅ス咲ケー繧贋ク翫£髢馴囈[遘綻縺ョ髟キ縺輔r謖√▽辟。髻ウ縺ョ繧オ繧ヲ繝ウ繝峨r菴懈舌
+
+ uint n繝繝シ繧ソ繧オ繧、繧コbyte = n蜊倅ス咲ケー繧贋ク翫£髢馴囈sec * 44100 * 2 * 2;
+ var ms = new MemoryStream();
+ var bw = new BinaryWriter( ms );
+ bw.Write( (uint) 0x46464952 ); // 'RIFF'
+ bw.Write( (uint) ( 44 + n繝繝シ繧ソ繧オ繧、繧コbyte - 8 ) ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8
+ bw.Write( (uint) 0x45564157 ); // 'WAVE'
+ bw.Write( (uint) 0x20746d66 ); // 'fmt '
+ bw.Write( (uint) 16 ); // 繝舌う繝域焚
+ bw.Write( (ushort) 1 ); // 繝輔か繝シ繝槭ャ繝ID(繝ェ繝九いPCM)
+ bw.Write( (ushort) 2 ); // 繝√Ε繝ウ繝阪Ν謨ー
+ bw.Write( (uint) 44100 ); // 繧オ繝ウ繝励Μ繝ウ繧ー蜻ィ豕「謨ー
+ bw.Write( (uint) ( 44100 * 2 * 2 ) ); // bytes/sec
+ bw.Write( (ushort) ( 2 * 2 ) ); // block繧オ繧、繧コ
+ bw.Write( (ushort) 16 ); // bit/sample
+ bw.Write( (uint) 0x61746164 ); // 'data'
+ bw.Write( (uint) n繝繝シ繧ソ繧オ繧、繧コbyte ); // 繝繝シ繧ソ髟キ
+ for ( int i = 0; i < n繝繝シ繧ソ繧オ繧、繧コbyte / sizeof( long ); i++ ) // PCM繝繝シ繧ソ
+ bw.Write( (long) 0 );
+ var byArrWaveFleImage = ms.ToArray();
+ bw.Close();
+ ms = null;
+ bw = null;
+ this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ = this.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWaveFleImage, ESoundGroup.Unknown );
+
+ CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Remove( this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ ); // 迚ケ谿顔畑騾斐↑縺ョ縺ァ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医°繧峨ッ髯、螟悶☆繧九
+
+ // 繧オ繧ヲ繝ウ繝峨ョ繝ォ繝シ繝怜咲函髢句ァ九
+
+ this.n繝ォ繝シ繝怜屓謨ー = 0;
+ this.n蜑榊屓縺ョ菴咲スョ = 0;
+ this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ.DirectSoundBuffer.Play( 0, PlayFlags.Looping );
+ this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ ctimer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ }
+ Trace.TraceInformation( "DirectSound 繧貞晄悄蛹悶@縺セ縺励◆縲({0})({1})", ( priority ) ? "Priority" : "Normal", bUseOSTimer? "OStimer" : "FDKtimer" );
+ }
+
+ public CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup )
+ {
+ var sound = new CSound(soundGroup);
+ sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.DirectSound );
+ return sound;
+ }
+
+ private CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, ESoundGroup soundGroup )
+ {
+ var sound = new CSound(soundGroup);
+ sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.DirectSound );
+ return sound;
+ }
+
+ // 譌「蟄倥ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケシ育函謌千峩蠕 or Dispose貂医∩シ峨↓蟇セ縺励※繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧九
+ public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound )
+ {
+ sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.DirectSound );
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound )
+ {
+ sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.DirectSound );
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, BufferFlags flags, CSound sound )
+ {
+ sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.DirectSound, flags );
+ }
+
+ #region [ Dispose-Finallize繝代ち繝シ繝ウ螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ this.Dispose( true );
+ GC.SuppressFinalize( this );
+ }
+ protected void Dispose( bool bManagedDispose )
+ {
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; // 縺セ縺壼コ蜉帛●豁「縺吶k(Dispose荳ュ縺ォ繧ッ繝ゥ繧ケ蜀縺ォ繧「繧ッ繧サ繧ケ縺輔l繧九%縺ィ繧帝亟縺)
+ if ( bManagedDispose )
+ {
+ #region [ 邨檎キッ譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧定ァ」謾セ縲]
+ //-----------------
+ if ( this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ != null )
+ {
+ this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ.t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k();
+ C蜈ア騾.tDispose縺吶k( ref this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ );
+ }
+ //-----------------
+ #endregion
+ #region [ 蜊倅ス咲ケー繧贋ク翫£逕ィ繧ケ繝ャ繝繝牙●豁「縲]
+ //-----------------
+ if( this.th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝 != null )
+ {
+ this.th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝.Abort();
+ this.th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝 = null;
+
+ }
+ //-----------------
+ #endregion
+
+ C蜈ア騾.tDispose縺吶k( ref this.DirectSound );
+ C蜈ア騾.tDispose縺吶k( this.tm繧キ繧ケ繝繝繧ソ繧、繝 );
+ }
+ if ( ctimer != null )
+ {
+ C蜈ア騾.tDispose縺吶k( ref this.ctimer );
+ }
+ }
+ ~CSoundDeviceDirectSound()
+ {
+ this.Dispose( false );
+ }
+ //-----------------
+ #endregion
+
+ protected DirectSound DirectSound = null;
+ protected CSound sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ = null;
+ protected Thread th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝 = null;
+// protected AutoResetEvent autoResetEvent = new AutoResetEvent( false );
+ protected const uint n蜊倅ス咲ケー繧贋ク翫£髢馴囈sec = 1; // [遘綻
+ protected const uint n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms = n蜊倅ス咲ケー繧贋ク翫£髢馴囈sec * 1000; // [繝溘Μ遘綻
+ protected int n繝ォ繝シ繝怜屓謨ー = 0;
+
+ private long n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = CTimer.n譛ェ菴ソ逕ィ;
+ private int n蜑榊屓縺ョ菴咲スョ = 0;
+
+ private CTimer ctimer = null;
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceWASAPI.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceWASAPI.cs
new file mode 100644
index 00000000..8e1cd920
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceWASAPI.cs
@@ -0,0 +1,447 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using Un4seen.Bass;
+using Un4seen.BassWasapi;
+using Un4seen.Bass.AddOn.Mix;
+
+namespace FDK
+{
+ internal class CSoundDeviceWASAPI : ISoundDevice
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ
+ {
+ get;
+ protected set;
+ }
+ public long n螳溷コ蜉幃≦蟒カms
+ {
+ get;
+ protected set;
+ }
+ public long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms
+ {
+ get;
+ protected set;
+ }
+
+ // CSoundTimer 逕ィ縺ォ蜈ャ髢九@縺ヲ縺繧九励Ο繝代ユ繧」
+
+ public long n邨碁℃譎る俣ms
+ {
+ get;
+ protected set;
+ }
+ public long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get;
+ protected set;
+ }
+ public CTimer tm繧キ繧ケ繝繝繧ソ繧、繝
+ {
+ get;
+ protected set;
+ }
+
+ public enum E繝繝舌う繧ケ繝「繝シ繝 { 謗剃サ, 蜈ア譛 }
+
+ public int nMasterVolume
+ {
+ get
+ {
+ float f髻ウ驥 = 0.0f;
+ //if ( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, ref f髻ウ驥 ) == -1 )
+ // return 100;
+ //bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f髻ウ驥 );
+ bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f髻ウ驥 );
+ if ( !b )
+ {
+ BASSError be = Bass.BASS_ErrorGetCode();
+ Trace.TraceInformation( "WASAPI Master Volume Get Error: " + be.ToString() );
+ }
+ else
+ {
+ Trace.TraceInformation( "WASAPI Master Volume Get Success: " + (f髻ウ驥 * 100) );
+
+ }
+ return (int) ( f髻ウ驥 * 100 );
+ }
+ set
+ {
+ // bool b = Bass.BASS_SetVolume( value / 100.0f );
+ // 竊脱xclusive繝「繝シ繝画凾縺ッ辟。蜉ケ
+
+// bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_VOL_SESSION, (float) ( value / 100 ) );
+// bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_WINDOWS, (float) ( value / 100 ) );
+ bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, (float) ( value / 100.0 ) );
+ // If you would like to have a volume control in exclusive mode too, and you're using the BASSmix add-on,
+ // you can adjust the source's BASS_ATTRIB_VOL setting via BASS_ChannelSetAttribute.
+ // 縺励°縺励”Mixer縺ォ蟇セ縺吶kBASS_ChannelSetAttribute()縺ァBASS_ATTRIB_VOL繧貞、画峩: 縺ェ縺懊°蜃コ蜉幃浹驥上↓蜿肴丐縺輔l縺
+
+ // Bass_SetVolume(): BASS_ERROR_NOTAVIL ("no sound" device縺ォ縺ッ驕ゥ逕ィ荳榊庄)
+
+ // Mixer_ChannelSetEnvelope():
+
+ //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) };
+ //bool b = BassMix.BASS_Mixer_ChannelSetEnvelope( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes );
+ //bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, value / 100.0f );
+ if ( !b )
+ {
+ BASSError be = Bass.BASS_ErrorGetCode();
+ Trace.TraceInformation( "WASAPI Master Volume Set Error: " + be.ToString() );
+ }
+ else
+ {
+ // int n = this.nMasterVolume;
+ // Trace.TraceInformation( "WASAPI Master Volume Set Success: " + value );
+
+ }
+ }
+ }
+ // 繝。繧ス繝繝
+
+ ///
+ /// WASAPI縺ョ蛻晄悄蛹
+ ///
+ ///
+ /// (譛ェ菴ソ逕ィ; 譛ャ繝。繧ス繝繝牙縺ァ閾ェ蜍戊ィュ螳壹☆繧)
+ /// (譛ェ菴ソ逕ィ; 譛ャ繝。繧ス繝繝牙縺ァ閾ェ蜍戊ィュ螳壹☆繧)
+ public CSoundDeviceWASAPI( E繝繝舌う繧ケ繝「繝シ繝 mode, long n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms, long n譖エ譁ー髢馴囈ms )
+ {
+ // 蛻晄悄蛹悶
+
+ Trace.TraceInformation( "BASS (WASAPI) 縺ョ蛻晄悄蛹悶r髢句ァ九@縺セ縺吶" );
+
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown;
+ this.n螳溷コ蜉幃≦蟒カms = 0;
+ this.n邨碁℃譎る俣ms = 0;
+ this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = CTimer.n譛ェ菴ソ逕ィ;
+ this.tm繧キ繧ケ繝繝繧ソ繧、繝 = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ this.b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ = true;
+
+ #region [ BASS registration ]
+ // BASS.NET 繝ヲ繝シ繧カ逋サ骭イシBASS繧ケ繝励Λ繝繧キ繝・縺碁撼陦ィ遉コ縺ォ縺ェ繧具シ峨
+
+ BassNet.Registration( "dtx2013@gmail.com", "2X9181017152222" );
+ #endregion
+
+ #region [ BASS Version Check ]
+ // BASS 縺ョ繝舌シ繧ク繝ァ繝ウ繝√ぉ繝繧ッ縲
+ int nBASSVersion = Utils.HighWord( Bass.BASS_GetVersion() );
+ if( nBASSVersion != Bass.BASSVERSION )
+ throw new DllNotFoundException( string.Format( "bass.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSVersion, Bass.BASSVERSION ) );
+
+ int nBASSMixVersion = Utils.HighWord( BassMix.BASS_Mixer_GetVersion() );
+ if( nBASSMixVersion != BassMix.BASSMIXVERSION )
+ throw new DllNotFoundException( string.Format( "bassmix.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSMixVersion, BassMix.BASSMIXVERSION ) );
+
+ int nBASSWASAPIVersion = Utils.HighWord( BassWasapi.BASS_WASAPI_GetVersion() );
+ if( nBASSWASAPIVersion != BassWasapi.BASSWASAPIVERSION )
+ throw new DllNotFoundException( string.Format( "basswasapi.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSWASAPIVersion, BassWasapi.BASSWASAPIVERSION ) );
+ #endregion
+
+ // BASS 縺ョ險ュ螳壹
+
+ this.bIsBASSFree = true;
+
+ if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲
+ {
+ Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATEPERIOD)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]");
+ }
+ if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲
+ {
+ Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATETHREADS)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]");
+ }
+
+ // BASS 縺ョ蛻晄悄蛹悶
+
+ int n繝繝舌う繧ケ = 0; // 0:"no device" 窶ヲ BASS 縺九i縺ッ繝繝舌う繧ケ縺ク繧「繧ッ繧サ繧ケ縺輔○縺ェ縺縲ゅい繧ッ繧サ繧ケ縺ッ BASSWASAPI 繧「繝峨が繝ウ縺九i陦後≧縲
+ int n蜻ィ豕「謨ー = 44100; // 莉ョ豎コ繧√M繝繝舌う繧ケシ遺旺繝峨Λ繧、繝撰シ峨′繝阪う繝繧」繝悶↓蟇セ蠢懊@縺ヲ縺繧句捉豕「謨ー縺ァ縺ゅl縺ー菴輔〒繧ゅ>縺シ溘h縺縺縲BASSWASAPI縺ァ繝繝舌う繧ケ縺ョ蜻ィ豕「謨ー縺ッ螟峨∴繧峨l繧九ゅ>縺壹l縺ォ縺励mBASSMX縺ァ閾ェ蜍慕噪縺ォ繝ェ繧オ繝ウ繝励Μ繝ウ繧ー縺輔l繧九
+ if( !Bass.BASS_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) )
+ throw new Exception( string.Format( "BASS (WASAPI) 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+
+ Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_CURVE_VOL, true);
+
+ #region [ 繝繝舌ャ繧ー逕ィ: WASAPI繝繝舌う繧ケ縺ョenumerate縺ィ縲√Ο繧ー蜃コ蜉 ]
+ // (繝繝舌ャ繧ー逕ィ)
+ //Trace.TraceInformation( "WASAPI繝繝舌う繧ケ荳隕ァ:" );
+ //int a, count = 0;
+ //BASS_WASAPI_DEVICEINFO wasapiDevInfo;
+ //for ( a = 0; ( wasapiDevInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( a ) ) != null; a++ )
+ //{
+ // if ( ( wasapiDevInfo.flags & BASSWASAPIDeviceInfo.BASS_DEVICE_INPUT ) == 0 // device is an output device (not input)
+ // && ( wasapiDevInfo.flags & BASSWASAPIDeviceInfo.BASS_DEVICE_ENABLED ) != 0 ) // and it is enabled
+ // {
+ // Trace.TraceInformation( "WASAPI Device #{0}: {1}", a, wasapiDevInfo.name );
+ // count++; // count it
+ // }
+ //}
+ #endregion
+
+ // BASS WASAPI 縺ョ蛻晄悄蛹悶
+
+ n繝繝舌う繧ケ = -1;
+ n蜻ィ豕「謨ー = 0; // 繝繝輔か繝ォ繝医ョ繝舌う繧ケ縺ョ蜻ィ豕「謨ー (0="mix format" sample rate)
+ int n繝√Ε繝ウ繝阪Ν謨ー = 0; // 繝繝輔か繝ォ繝医ョ繝舌う繧ケ縺ョ繝√Ε繝ウ繝阪Ν謨ー (0="mix format" channels)
+ this.tWasapiProc = new WASAPIPROC( this.tWASAPI蜃ヲ逅 ); // 繧「繝ウ繝槭ロ繝シ繧ク縺ォ貂。縺 delegate 縺ッ縲√ヵ繧」繝シ繝ォ繝峨→縺励※菫晄戟縺励※縺翫°縺ェ縺縺ィGC縺ァ繧「繝峨Ξ繧ケ縺悟、峨o縺」縺ヲ縺励∪縺縲
+
+ // WASAPI縺ョ譖エ譁ー髢馴囈(period)縺ッ縲√ヰ繝繝輔ぃ繧オ繧、繧コ縺ォ繧ょスア髻ソ繧剃ク弱∴繧九
+ // 譖エ譁ー髢馴囈繧呈怙蟆上↓縺吶k縺ォ縺ッ縲。assWasapi.BASS_WASAPI_GetDeviceInfo( ndevNo ).minperiod 縺ョ蛟、繧剃スソ縺医ー繧医>縲
+ // 縺薙l繧偵d繧峨↑縺縺ィ縲∵峩譁ー髢馴囈ms=6ms 縺ィ縺ェ繧翫√ヰ繝繝輔ぃ繧オ繧、繧コ繧 6ms x 4 = 24ms繧医j蟆上&縺上〒縺阪↑縺縲
+ #region [ 譌「螳壹ョ蜃コ蜉帙ョ繝舌う繧ケ縺ィ險ュ螳壹&繧後※縺繧妓ASAPI繝繝舌う繧ケ繧呈、懃エ「縺励∵峩譁ー髢馴囈ms繧定ィュ螳壹〒縺阪k譛蟆丞、縺ォ縺吶k ]
+ int nDevNo = -1;
+ BASS_WASAPI_DEVICEINFO deviceInfo;
+ for ( int n = 0; ( deviceInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( n ) ) != null; n++ )
+ {
+ if ( deviceInfo.IsDefault )
+ {
+ nDevNo = n;
+ break;
+ }
+ }
+ if ( nDevNo != -1 )
+ {
+ // Trace.TraceInformation( "Selected Default WASAPI Device: {0}", deviceInfo.name );
+ // Trace.TraceInformation( "MinPeriod={0}, DefaultPeriod={1}", deviceInfo.minperiod, deviceInfo.defperiod );
+ n譖エ譁ー髢馴囈ms = (long) ( deviceInfo.minperiod * 1000 );
+ if ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms <= 0 || n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms < n譖エ譁ー髢馴囈ms + 1 )
+ {
+ n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms = n譖エ譁ー髢馴囈ms + 1; // 2013.4.25 #31237 yyagi; 繝舌ャ繝輔ぃ繧オ繧、繧コ險ュ螳壹ョ螳悟ィ閾ェ蜍募喧縲よ峩譁ー髢馴囈シ昴ヰ繝繝輔ぃ繧オ繧、繧コ縺ォ縺吶k縺ィBASS_ERROR_UNKNOWN縺ォ縺ェ繧九ョ縺ァ+1縺吶k縲
+ }
+ }
+ else
+ {
+ Trace.TraceError( "Error: Default WASAPI Device is not found." );
+ }
+ #endregion
+
+//Retry:
+ var flags = ( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ ) ? BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE : BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT;
+ //var flags = ( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ ) ? BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT | BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE : BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT;
+ if ( BassWasapi.BASS_WASAPI_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, n繝√Ε繝ウ繝阪Ν謨ー, flags, ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms / 1000.0f ), ( n譖エ譁ー髢馴囈ms / 1000.0f ), this.tWasapiProc, IntPtr.Zero ) )
+ {
+ if( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ )
+ {
+ #region [ 謗剃サ悶Δ繝シ繝峨〒菴懈先仙粥縲]
+ //-----------------
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.ExclusiveWASAPI;
+
+ nDevNo = BassWasapi.BASS_WASAPI_GetDevice();
+ deviceInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( nDevNo );
+ var wasapiInfo = BassWasapi.BASS_WASAPI_GetInfo();
+ int n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 2 * wasapiInfo.chans; // default;
+ switch( wasapiInfo.format ) // BASS WASAPI 縺ァ謇ア縺繧オ繝ウ繝励Ν縺ッ縺吶∋縺ヲ 32bit float 縺ァ蝗コ螳壹&繧後※縺繧九′縲√ョ繝舌う繧ケ縺ッ縺昴≧縺ィ縺ッ髯舌i縺ェ縺縲
+ {
+ case BASSWASAPIFormat.BASS_WASAPI_FORMAT_8BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 1 * wasapiInfo.chans; break;
+ case BASSWASAPIFormat.BASS_WASAPI_FORMAT_16BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 2 * wasapiInfo.chans; break;
+ case BASSWASAPIFormat.BASS_WASAPI_FORMAT_24BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 3 * wasapiInfo.chans; break;
+ case BASSWASAPIFormat.BASS_WASAPI_FORMAT_32BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 4 * wasapiInfo.chans; break;
+ case BASSWASAPIFormat.BASS_WASAPI_FORMAT_FLOAT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 4 * wasapiInfo.chans; break;
+ }
+ int n1遘偵ョ繝舌う繝域焚 = n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 * wasapiInfo.freq;
+ this.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms = (long) ( wasapiInfo.buflen * 1000.0f / n1遘偵ョ繝舌う繝域焚 );
+ this.n螳溷コ蜉幃≦蟒カms = 0; // 蛻晄悄蛟、縺ッ繧シ繝ュ
+ Trace.TraceInformation( "菴ソ逕ィ繝繝舌う繧ケ: #" + nDevNo + " : " + deviceInfo.name + ", flags=" + deviceInfo.flags );
+ Trace.TraceInformation( "BASS 繧貞晄悄蛹悶@縺セ縺励◆縲(WASAPI謗剃サ悶Δ繝シ繝, {0}Hz, {1}ch, 繝輔か繝シ繝槭ャ繝:{2}, 繝舌ャ繝輔ぃ{3}bytes [{4}ms(蟶梧悍{5}ms)], 譖エ譁ー髢馴囈{6}ms)",
+ wasapiInfo.freq,
+ wasapiInfo.chans,
+ wasapiInfo.format.ToString(),
+ wasapiInfo.buflen,
+ n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms.ToString(),
+ n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms.ToString(),
+ n譖エ譁ー髢馴囈ms.ToString() );
+ Trace.TraceInformation( "繝繝舌う繧ケ縺ョ譛蟆乗峩譁ー譎る俣={0}ms, 譌「螳壹ョ譖エ譁ー譎る俣={1}ms", deviceInfo.minperiod * 1000, deviceInfo.defperiod * 1000 );
+ this.bIsBASSFree = false;
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ #region [ 蜈ア譛峨Δ繝シ繝峨〒菴懈先仙粥縲]
+ //-----------------
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.SharedWASAPI;
+
+ this.n螳溷コ蜉幃≦蟒カms = 0; // 蛻晄悄蛟、縺ッ繧シ繝ュ
+ var devInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( BassWasapi.BASS_WASAPI_GetDevice() ); // 蜈ア譛峨Δ繝シ繝峨ョ蝣エ蜷医∵峩譁ー髢馴囈縺ッ繝繝舌う繧ケ縺ョ繝繝輔か繝ォ繝亥、縺ォ蝗コ螳壹&繧後k縲
+ Trace.TraceInformation( "BASS 繧貞晄悄蛹悶@縺セ縺励◆縲(WASAPI蜈ア譛峨Δ繝シ繝, {0}ms, 譖エ譁ー髢馴囈{1}ms)", n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms, devInfo.defperiod * 1000.0f );
+ this.bIsBASSFree = false;
+ //-----------------
+ #endregion
+ }
+ }
+ #region [ #31737 WASAPI謗剃サ悶Δ繝シ繝峨ョ縺ソ蛻ゥ逕ィ蜿ッ閭ス縺ィ縺励仝ASAPI蜈ア譛峨Δ繝シ繝峨ッ菴ソ逕ィ縺ァ縺阪↑縺繧医≧縺ォ縺吶k縺溘a縺ォ縲仝ASAPI蜈ア譛峨Δ繝シ繝峨〒縺ョ蛻晄悄蛹悶ヵ繝ュ繝シ繧貞炎髯、縺吶k縲 ]
+ //else if ( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ )
+ //{
+ // Trace.TraceInformation("Failed to initialize setting BASS (WASAPI) mode [{0}]", Bass.BASS_ErrorGetCode().ToString() );
+ // #region [ 謗剃サ悶Δ繝シ繝峨↓螟ア謨励@縺溘ョ縺ェ繧牙ア譛峨Δ繝シ繝峨〒繝ェ繝医Λ繧、縲]
+ // //-----------------
+ // mode = E繝繝舌う繧ケ繝「繝シ繝.蜈ア譛;
+ // goto Retry;
+ // //-----------------
+ // #endregion
+ //}
+ #endregion
+ else
+ {
+ #region [ 縺昴l縺ァ繧ょ、ア謨励@縺溘i萓句、也匱逕溘]
+ //-----------------
+ BASSError errcode = Bass.BASS_ErrorGetCode();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS (WASAPI) 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_WASAPI_Init)[{0}]", errcode ) );
+ //-----------------
+ #endregion
+ }
+
+
+ // WASAPI蜃コ蜉帙→蜷後§繝輔か繝シ繝槭ャ繝医r謖√▽ BASS 繝溘く繧オ繝シ繧剃ス懈舌
+
+ var info = BassWasapi.BASS_WASAPI_GetInfo();
+ this.hMixer = BassMix.BASS_Mixer_StreamCreate(
+ info.freq,
+ info.chans,
+ BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE ); // 繝繧ウ繝シ繝峨ョ縺ソシ晉匱螢ー縺励↑縺縲8ASAPI縺ォ蜃コ蜉帙&繧後k縺縺代
+ if ( this.hMixer == 0 )
+ {
+ BASSError errcode = Bass.BASS_ErrorGetCode();
+ BassWasapi.BASS_WASAPI_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS繝溘く繧オ(mixing)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) );
+ }
+
+
+ // BASS 繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚繧堤ョ怜コ縲
+
+ var mixerInfo = Bass.BASS_ChannelGetInfo( this.hMixer );
+ long n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 = mixerInfo.chans * 4; // 4 = sizeof(FLOAT)
+ this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 * mixerInfo.freq;
+
+
+
+ // 蜊倡エ斐↓縲”Mixer縺ョ髻ウ驥上rMasterVolume縺ィ縺励※蛻カ蠕。縺励※繧ゅ
+ // ChannelGetData()縺ョ蜀螳ケ縺ォ縺ッ蜿肴丐縺輔l縺ェ縺縲
+ // 縺昴ョ縺溘a縲√b縺荳谿オmixer繧貞剱縺セ縺帙※縲∽ク谿オ蜈医ョmixer縺九iChannelGetData()縺吶k縺薙→縺ァ縲
+ // hMixer縺ョ髻ウ驥丞宛蠕。繧貞渚譏縺輔○繧九
+ this.hMixer_DeviceOut = BassMix.BASS_Mixer_StreamCreate(
+ info.freq,
+ info.chans,
+ BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE ); // 繝繧ウ繝シ繝峨ョ縺ソシ晉匱螢ー縺励↑縺縲8ASAPI縺ォ蜃コ蜉帙&繧後k縺縺代
+ if ( this.hMixer_DeviceOut == 0 )
+ {
+ BASSError errcode = Bass.BASS_ErrorGetCode();
+ BassWasapi.BASS_WASAPI_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) );
+ }
+
+ {
+ bool b1 = BassMix.BASS_Mixer_StreamAddChannel( this.hMixer_DeviceOut, this.hMixer, BASSFlag.BASS_DEFAULT );
+ if ( !b1 )
+ {
+ BASSError errcode = Bass.BASS_ErrorGetCode();
+ BassWasapi.BASS_WASAPI_Free();
+ Bass.BASS_Free();
+ this.bIsBASSFree = true;
+ throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ縺ィmixing)縺ョ謗・邯壹↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) );
+ };
+ }
+
+
+ // 蜃コ蜉帙r髢句ァ九
+
+ BassWasapi.BASS_WASAPI_Start();
+ }
+ #region [ t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧() ]
+ public CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup )
+ {
+ var sound = new CSound(soundGroup);
+ sound.tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer, this.e蜃コ蜉帙ョ繝舌う繧ケ );
+ return sound;
+ }
+
+ public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound )
+ {
+ sound.tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer, this.e蜃コ蜉帙ョ繝舌う繧ケ );
+ }
+ public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound )
+ {
+ sound.tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.hMixer, this.e蜃コ蜉帙ョ繝舌う繧ケ );
+ }
+ #endregion
+
+ #region [ Dispose-Finallize繝代ち繝シ繝ウ螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ this.Dispose( true );
+ GC.SuppressFinalize( this );
+ }
+ protected void Dispose( bool bManagedDispose )
+ {
+ this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; // 縺セ縺壼コ蜉帛●豁「縺吶k(Dispose荳ュ縺ォ繧ッ繝ゥ繧ケ蜀縺ォ繧「繧ッ繧サ繧ケ縺輔l繧九%縺ィ繧帝亟縺)
+ if ( hMixer != -1 )
+ {
+ Bass.BASS_StreamFree( this.hMixer );
+ }
+ if ( !this.bIsBASSFree )
+ {
+ BassWasapi.BASS_WASAPI_Free(); // 繧キ繧ケ繝繝繧ソ繧、繝槭h繧雁医↓蜻シ縺ウ蜃コ縺吶%縺ィ縲ゑシtWasapi蜃ヲ逅() 縺ョ荳ュ縺ァ繧キ繧ケ繝繝繧ソ繧、繝槭r蜿らァ縺励※繧九◆繧シ
+ Bass.BASS_Free();
+ }
+ if( bManagedDispose )
+ {
+ C蜈ア騾.tDispose縺吶k( this.tm繧キ繧ケ繝繝繧ソ繧、繝 );
+ this.tm繧キ繧ケ繝繝繧ソ繧、繝 = null;
+ }
+ }
+ ~CSoundDeviceWASAPI()
+ {
+ this.Dispose( false );
+ }
+ //-----------------
+ #endregion
+
+ protected int hMixer = -1;
+ protected int hMixer_DeviceOut = -1;
+ protected WASAPIPROC tWasapiProc = null;
+
+ protected int tWASAPI蜃ヲ逅( IntPtr buffer, int length, IntPtr user )
+ {
+ // BASS繝溘く繧オ縺九i縺ョ蜃コ蜉帙ョ繝シ繧ソ繧偵◎縺ョ縺セ縺セ WASAPI buffer 縺ク荳ク謚輔£縲
+
+ int num = Bass.BASS_ChannelGetData( this.hMixer_DeviceOut, buffer, length ); // num = 螳滄圀縺ォ霆「騾√@縺滄聞縺
+ if ( num == -1 ) num = 0;
+
+
+ // 邨碁℃譎る俣繧呈峩譁ー縲
+ // 繝繝シ繧ソ縺ョ霆「騾∝キョ蛻縺ァ縺ッ縺ェ縺冗エッ遨崎サ「騾√ヰ繧、繝域焚縺九i邂怜コ縺吶k縲
+
+ int n譛ェ蜀咲函繝舌う繝域焚 = BassWasapi.BASS_WASAPI_GetData( null, (int) BASSData.BASS_DATA_AVAILABLE ); // 隱、蟾ョ蜑頑ク帙ョ縺溘a縲∝ソ隕√→縺ェ繧九ぐ繝ェ繧ョ繝ェ逶エ蜑阪↓蜿門セ励☆繧九
+ this.n邨碁℃譎る俣ms = ( this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 - n譛ェ蜀咲函繝舌う繝域焚 ) * 1000 / this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚;
+ this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+
+ // 螳溷コ蜉幃≦蟒カ繧呈峩譁ー縲
+ // 譛ェ蜀咲函繝舌う繝域焚縺ョ蟷ウ蝮蛟、縲
+
+ long n莉雁屓縺ョ驕蟒カms = n譛ェ蜀咲函繝舌う繝域焚 * 1000 / this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚;
+ this.n螳溷コ蜉幃≦蟒カms = ( this.b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ ) ? n莉雁屓縺ョ驕蟒カms : ( this.n螳溷コ蜉幃≦蟒カms + n莉雁屓縺ョ驕蟒カms ) / 2;
+ this.b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ = false;
+
+
+ // 邨碁℃譎る俣繧呈峩譁ー蠕後↓縲∽サ雁屓蛻縺ョ邏ッ遨崎サ「騾√ヰ繧、繝域焚繧貞渚譏縲
+
+ this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 += num;
+ return num;
+ }
+
+ private long n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = 0;
+ private long n邏ッ遨崎サ「騾√ヰ繧、繝域焚 = 0;
+ private bool b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ = true;
+ private bool bIsBASSFree = true;
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundTimer.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundTimer.cs
new file mode 100644
index 00000000..86060758
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundTimer.cs
@@ -0,0 +1,214 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+
+namespace FDK
+{
+ public class CSoundTimer : CTimerBase
+ {
+ public override long n繧キ繧ケ繝繝譎ょ綾ms
+ {
+ get
+ {
+ if( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.ExclusiveWASAPI ||
+ this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.SharedWASAPI ||
+ this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.ASIO )
+ {
+ // BASS 邉サ縺ョ ISoundDevice.n邨碁℃譎る俣ms 縺ッ繧ェ繝シ繝繧」繧ェ繝舌ャ繝輔ぃ縺ョ譖エ譁ー髢馴囈縺壹▽縺ァ縺励°譖エ譁ー縺輔l縺ェ縺縺溘a縲∝腰縺ォ縺薙l繧定ソ斐☆縺縺代〒縺ッ縺ィ縺ウ縺ィ縺ウ縺ョ蛟、縺ォ縺ェ繧九
+ // 縺昴%縺ァ縲∵峩譁ー髢馴囈縺ョ譛荳ュ縺ォ蜻シ縺ー繧後◆蝣エ蜷医ッ縲√す繧ケ繝繝繧ソ繧、繝槭r菴ソ縺」縺ヲ陬憺俣縺吶k縲
+ // 縺薙ョ蝣エ蜷医ョ邨碁℃譎る俣縺ィ縺ョ隱、蟾ョ縺ッ譖エ譁ー髢馴囈莉・蜀縺ォ蜿弱∪繧九ョ縺ァ蝠城。後↑縺縺ィ蛻、譁ュ縺吶k縲
+ // 縺溘□縺励、SIO縺ョ蝣エ蜷医ッ縲∬サ「騾|yte謨ー縺九i譎る俣邂怜コ縺励※縺繧九◆繧√、SIO縺ョ髻ウ螢ー蜷域仙ヲ逅縺ョ雋闕キ縺悟、ァ縺阪☆縺弱k蝣エ蜷(蜃ヲ逅譎る俣縺悟ョ滓凾髢薙r雜縺医※縺繧句エ蜷)縺ッ
+ // 蜍穂ス懊′縺翫°縺励¥縺ェ繧九(蜈キ菴鍋噪縺ォ縺ッ縲√%縺薙〒霑斐☆繧ソ繧、繝槭シ蛟、縺ョ騾陦後′逋コ逕溘@縲√せ繧ッ繝ュ繝シ繝ォ縺悟キサ縺肴綾繧)
+ // 縺薙ョ蝣エ蜷医ョ蟇セ遲悶ッ縲、SIO縺ョ繝舌ャ繝輔ぃ驥上r蠅励d縺励※縲、SIO縺ョ髻ウ螢ー蜷域仙ヲ逅縺ョ雋闕キ繧剃ク九£繧九%縺ィ縲
+
+ if ( this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms == CTimer.n譛ェ菴ソ逕ィ ) // #33890 2014.5.27 yyagi
+ {
+ // 迺ー蠅縺ォ繧医▲縺ヲ縺ッ縲、SIO繝吶シ繧ケ縺ョ貍泌・上ち繧、繝槭シ縺悟虚菴懊☆繧句燕(縺、縺セ繧晦SIO縺ョ繧オ繧ヲ繝ウ繝芽サ「騾√′蟋九∪繧句燕)縺ォ
+ // DTX繝繝シ繧ソ縺ョ貍泌・上′蟋九∪繧句エ蜷医′縺ゅk縲
+ // 縺昴ョ蝣エ蜷医"this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾" 縺梧ュ」縺励>蛟、縺ァ縺ェ縺縺溘a縲
+ // 貍泌・上ち繧、繝槭ョ蛟、縺梧ュ」縺励>繧ゅョ縺ィ縺ッ縺ェ繧峨↑縺縲ゅ◎縺励※縲∵シ泌・上ち繧、繝槭シ縺ョ蜍穂ス懊′蟋九∪繧九→蜷梧凾縺ォ縲
+ // 貍泌・上ち繧、繝槭ョ蛟、縺後☆縺」鬟帙カ(讌オ遶ッ縺ェ雋縺ョ蛟、縺ォ縺ェ繧)縺溘a縲∵シ泌・上ョ縺ソ縺ェ繧峨★逕サ髱「陦ィ遉コ繧ゅ&繧後↑縺迥カ諷九→縺ェ繧九
+ // (逕サ髱「陦ィ遉コ縺ッ繧ソ繧、繝槭ョ蛟、縺ォ騾」蜍輔@縺ヲ陦後o繧後k縺後0莉・荳翫ョ繧ソ繧、繝槫、縺ォ蜷医o縺帙※蜍穂ス懊☆繧九◆繧√
+ // 荳阪ョ蛟、縺梧擂繧九→逕サ髱「縺ォ菴輔b陦ィ遉コ縺輔l縺ェ縺上↑繧)
+
+ // 縺昴%縺ァ縲∵シ泌・上ち繧、繝槭′蜍穂ス懊r蟋九a繧句燕(this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms == CTimer.n譛ェ菴ソ逕ィ)縺ッ縲
+ // 陬懈ュ」驛ィ蛻繧偵ぞ繝ュ縺ォ縺励※縲]邨碁℃譎る俣ms縺縺代r霑斐☆繧医≧縺ォ縺吶k縲
+ // 縺薙≧縺吶k縺薙→縺ァ縲∵シ泌・上ち繧、繝槭′蜍穂ス懊r蟋九a縺ヲ繧ゅ∫エ邯サ縺励↑縺上↑繧九
+ return this.Device.n邨碁℃譎る俣ms;
+ }
+ else
+ {
+ if ( FDK.CSound邂。逅.bUseOSTimer )
+ //if ( true )
+ {
+ return ctDInputTimer.n繧キ繧ケ繝繝譎ょ綾ms; // 莉ョ縺ォCSoundTimer繧辰Timer逶ク蠖薙ョ蜍穂ス懊↓縺励※縺ソ縺
+ }
+ else
+ {
+ return this.Device.n邨碁℃譎る俣ms
+ + ( this.Device.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms );
+ }
+ }
+ }
+ else if( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.DirectSound )
+ {
+ //return this.Device.n邨碁℃譎る俣ms; // #24820 2013.2.3 yyagi TESTCODE DirectSound縺ァ繧ケ繧ッ繝ュ繝シ繝ォ縺梧サ代i縺九↓縺ェ繧峨↑縺縺溘a縲
+ return ct.n繧キ繧ケ繝繝譎ょ綾ms; // 莉ョ縺ォCSoundTimer繧辰Timer逶ク蠖薙ョ蜍穂ス懊↓縺励※縺ソ縺
+ }
+ return CTimerBase.n譛ェ菴ソ逕ィ;
+ }
+ }
+
+ internal CSoundTimer( ISoundDevice device )
+ {
+ this.Device = device;
+
+ if ( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ != ESoundDeviceType.DirectSound )
+ {
+ TimerCallback timerDelegate = new TimerCallback( SnapTimers ); // CSoundTimer繧偵す繧ケ繝繝譎ょ綾縺ォ螟画鋤縺吶k縺溘a縺ォ縲
+ timer = new Timer( timerDelegate, null, 0, 1000 ); // CSoundTimer縺ィCTimer繧剃ク。譁ケ縺ィ繧りオー繧峨○縺ヲ縺翫″縲
+ ctDInputTimer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); // 1遘偵↓1蝗樊凾蟾ョ繧呈クャ螳壹☆繧九h縺縺ォ縺励※縺翫¥
+ }
+ else // TESTCODE DirectSound譎ゅョ縺ソ縲,SoundTimer縺ァ縺ェ縺修Timer繧剃スソ縺
+ {
+ ct = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ }
+ }
+
+ private void SnapTimers(object o) // 1遘偵↓1蝗槫他縺ウ蜃コ縺輔l縲2縺、縺ョ繧ソ繧、繝槭シ髢薙ョ迴セ蝨ィ蛟、繧偵◎繧後◇繧御ソ晄戟縺吶k縲
+ {
+ if ( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ != ESoundDeviceType.DirectSound )
+ {
+ try
+ {
+ this.nDInputTimerCounter = this.ctDInputTimer.n繧キ繧ケ繝繝譎ょ綾ms;
+ this.nSoundTimerCounter = this.n繧キ繧ケ繝繝譎ょ綾ms;
+ //Debug.WriteLine( "BaseCounter: " + nDInputTimerCounter + ", " + nSoundTimerCounter );
+ }
+ catch ( Exception e )
+ // 繧オ繧ヲ繝ウ繝芽ィュ螳壼、画峩譎ゅ↓縲》imer.Dispose()縺励◆蠕後》imer縺悟ョ滄圀縺ォ蛛懈ュ「縺吶k蜑阪↓縺薙%縺ォ譚・縺ヲ縺励∪縺蝣エ蜷医′縺ゅj
+ // 縺昴ョ髫帙↓NullReferenceException縺檎匱逕溘☆繧
+ // timer縺悟ョ滄圀縺ォ蛛懈ュ「縺励◆縺薙→繧呈、懷コ縺励※縺九i谺。縺ョ險ュ螳壹r縺吶∋縺阪□縺後∝ョ溯」縺碁屮縺励>縺溘a縲
+ // 縺薙%縺ァ蜊倥↓萓句、也エ譽縺吶k縺薙→縺ァ莉」譖ソ縺吶k
+ {
+ Trace.TraceInformation( e.ToString() );
+ Trace.TraceInformation("FDK: CSoundTimer.SnapTimers(): 萓句、也匱逕溘@縺セ縺励◆縺後∫カ咏カ壹@縺セ縺吶" );
+ }
+ }
+ }
+ public long n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤( long nDInput縺ョ繧ソ繧、繝繧ケ繧ソ繝ウ繝 )
+ {
+ return nDInput縺ョ繧ソ繧、繝繧ケ繧ソ繝ウ繝 - this.nDInputTimerCounter + this.nSoundTimerCounter; // Timer驕輔>縺ォ繧医k譎ょキョ繧定」懈ュ」縺吶k
+ }
+
+#if false
+ // 繧ュ繝シ繝懊シ繝峨う繝吶Φ繝(keybd_event縺ョ蠑墓焚縺ィ蜷梧ァ倥ョ繝繝シ繧ソ)
+ [StructLayout( LayoutKind.Sequential )]
+ private struct KEYBDINPUT
+ {
+ public ushort wVk;
+ public ushort wScan;
+ public uint dwFlags;
+ public uint time;
+ public IntPtr dwExtraInfo;
+ };
+ // 蜷遞ョ繧、繝吶Φ繝(SendInput縺ョ蠑墓焚繝繝シ繧ソ)
+ [StructLayout( LayoutKind.Sequential )]
+ private struct INPUT
+ {
+ public int type;
+ public KEYBDINPUT ki;
+ };
+ // 繧ュ繝シ謫堺ス懊√槭え繧ケ謫堺ス懊r繧キ繝溘Η繝ャ繝シ繝(謫ャ莨シ逧縺ォ謫堺ス懊☆繧)
+ [DllImport( "user32.dll" )]
+ private extern static void SendInput(
+ int nInputs, ref INPUT pInputs, int cbsize );
+
+ // 莉ョ諠ウ繧ュ繝シ繧ウ繝シ繝峨r繧ケ繧ュ繝」繝ウ繧ウ繝シ繝峨↓螟画鋤
+ [DllImport( "user32.dll", EntryPoint = "MapVirtualKeyA" )]
+ private extern static int MapVirtualKey(
+ int wCode, int wMapType );
+
+ [DllImport( "user32.dll" )]
+ static extern IntPtr GetMessageExtraInfo();
+
+ private const int INPUT_MOUSE = 0; // 繝槭え繧ケ繧、繝吶Φ繝
+ private const int INPUT_KEYBOARD = 1; // 繧ュ繝シ繝懊シ繝峨う繝吶Φ繝
+ private const int INPUT_HARDWARE = 2; // 繝上シ繝峨え繧ァ繧「繧、繝吶Φ繝
+ private const int KEYEVENTF_KEYDOWN = 0x0; // 繧ュ繝シ繧呈款縺
+ private const int KEYEVENTF_KEYUP = 0x2; // 繧ュ繝シ繧帝屬縺
+ private const int KEYEVENTF_EXTENDEDKEY = 0x1; // 諡。蠑オ繧ウ繝シ繝
+ private const int KEYEVENTF_SCANCODE = 0x8;
+ private const int KEYEVENTF_UNIOCODE = 0x4;
+ private const int VK_SHIFT = 0x10; // SHIFT繧ュ繝シ
+
+ private void pollingSendInput()
+ {
+// INPUT[] inp = new INPUT[ 2 ];
+ INPUT inp = new INPUT();
+ while ( true )
+ {
+ // (2)繧ュ繝シ繝懊シ繝(A)繧呈款縺
+ //inp[0].type = INPUT_KEYBOARD;
+ //inp[ 0 ].ki.wVk = ( ushort ) Key.B;
+ //inp[ 0 ].ki.wScan = ( ushort ) MapVirtualKey( inp[ 0 ].ki.wVk, 0 );
+ //inp[ 0 ].ki.dwFlags = KEYEVENTF_KEYDOWN;
+ //inp[ 0 ].ki.dwExtraInfo = IntPtr.Zero;
+ //inp[ 0 ].ki.time = 0;
+ inp.type = INPUT_KEYBOARD;
+ inp.ki.wVk = ( ushort ) Key.B;
+ inp.ki.wScan = ( ushort ) MapVirtualKey( inp.ki.wVk, 0 );
+ inp.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYDOWN;
+ inp.ki.dwExtraInfo = GetMessageExtraInfo();
+ inp.ki.time = 0;
+
+ //// (3)繧ュ繝シ繝懊シ繝(A)繧帝屬縺
+ //inp[ 1 ].type = INPUT_KEYBOARD;
+ //inp[ 1 ].ki.wVk = ( short ) Key.B;
+ //inp[ 1 ].ki.wScan = ( short ) MapVirtualKey( inp[ 1 ].ki.wVk, 0 );
+ //inp[ 1 ].ki.dwFlags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP;
+ //inp[ 1 ].ki.dwExtraInfo = 0;
+ //inp[ 1 ].ki.time = 0;
+
+ // 繧ュ繝シ繝懊シ繝画桃菴懷ョ溯。
+ SendInput( 1, ref inp, Marshal.SizeOf( inp ) );
+Debug.WriteLine( "B" );
+ Thread.Sleep( 1000 );
+ }
+ }
+#endif
+ public override void Dispose()
+ {
+ // 迚ケ縺ォ縺ェ縺暦シ ISoundDevice 縺ョ隗」謾セ縺ッ蜻シ縺ウ蜃コ縺怜縺ァ陦後≧縺薙→縲
+
+ //sendinput繧ケ繝ャ繝繝牙炎髯、
+ if ( timer != null )
+ {
+ timer.Change( System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite );
+ // 縺薙%縺ァ縲∝ョ滄圀縺ォtimer縺悟●豁「縺励◆縺薙→繧堤「コ隱阪☆繧九さ繝シ繝峨r霑ス蜉縺吶∋縺阪□縺後√d繧頑婿繧上°繧峨★縲
+ // 莉」譖ソ遲悶→縺励※縲ヾnapTimers()荳ュ縺ァ縲∽セ句、也匱逕溘r遐エ譽縺励※縺繧九
+ timer.Dispose();
+ timer = null;
+ }
+ if ( ct != null )
+ {
+ ct.t荳譎ょ●豁「();
+ ct.Dispose();
+ ct = null;
+ }
+ }
+
+ internal ISoundDevice Device = null; // debug縺ョ縺溘a縲∽ク譎ら噪縺ォprotected繧恥ublic縺ォ縺吶k縲ょセ後〒蜈縺ォ謌サ縺励※縺翫¥縺薙→縲
+ //protected Thread thSendInput = null;
+ //protected Thread thSnapTimers = null;
+ private CTimer ctDInputTimer = null;
+ private long nDInputTimerCounter = 0;
+ private long nSoundTimerCounter = 0;
+ Timer timer = null;
+
+ private CTimer ct = null; // TESTCODE
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cmp3.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cmp3.cs
new file mode 100644
index 00000000..761122be
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cmp3.cs
@@ -0,0 +1,62 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.IO;
+using System.Diagnostics;
+using System.Threading;
+
+
+namespace FDK
+{
+ public unsafe class Cmp3 : SoundDecoder
+ {
+// static byte[] FOURCC = Encoding.ASCII.GetBytes( "SggO" ); // OggS 縺ョ little endian
+
+
+ #region [ SoundDecoder.dll 繧、繝ウ繝昴シ繝茨シmpr 髢「騾」シ云
+ //-----------------
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern void mp3Close( int nHandle );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int mp3Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int mp3GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern uint mp3GetTotalPCMSize( int nHandle );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int mp3Open( string fileName );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int mp3Seek( int nHandle, uint dwPosition );
+ //-----------------
+ #endregion
+
+
+ public override int Open( string filename )
+ {
+ return mp3Open( filename );
+ }
+ public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx )
+ {
+ return mp3GetFormat( nHandle, ref wfx );
+ }
+ public override uint GetTotalPCMSize( int nHandle )
+ {
+ return mp3GetTotalPCMSize( nHandle );
+ }
+ public override int Seek( int nHandle, uint dwPosition )
+ {
+ return mp3Seek( nHandle, dwPosition );
+ }
+ public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop )
+ {
+ return mp3Decode( nHandle, pDest, szDestSize, bLoop );
+ }
+
+ public override void Close( int nHandle )
+ {
+ mp3Close( nHandle );
+ }
+
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cogg.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cogg.cs
new file mode 100644
index 00000000..c99b9ebe
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cogg.cs
@@ -0,0 +1,62 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.IO;
+using System.Diagnostics;
+using System.Threading;
+
+
+namespace FDK
+{
+ public unsafe class Cogg : SoundDecoder
+ {
+ static byte[] FOURCC = Encoding.ASCII.GetBytes( "SggO" ); // OggS 縺ョ little endian
+
+
+ #region [ SoundDecoder.dll 繧、繝ウ繝昴シ繝茨シogg 髢「騾」シ云
+ //-----------------
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern void oggClose( int nHandle );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int oggDecode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int oggGetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern uint oggGetTotalPCMSize( int nHandle );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int oggOpen( string fileName );
+ [DllImport( "SoundDecoder.dll" )]
+ private static extern int oggSeek( int nHandle, uint dwPosition );
+ //-----------------
+ #endregion
+
+
+ public override int Open( string filename )
+ {
+ return oggOpen( filename );
+ }
+ public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx )
+ {
+ return oggGetFormat( nHandle, ref wfx );
+ }
+ public override uint GetTotalPCMSize( int nHandle )
+ {
+ return oggGetTotalPCMSize( nHandle );
+ }
+ public override int Seek( int nHandle, uint dwPosition )
+ {
+ return oggSeek( nHandle, dwPosition );
+ }
+ public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop )
+ {
+ return oggDecode( nHandle, pDest, szDestSize, bLoop );
+ }
+
+ public override void Close( int nHandle )
+ {
+ oggClose( nHandle );
+ }
+
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cxa.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cxa.cs
new file mode 100644
index 00000000..ee239fe0
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cxa.cs
@@ -0,0 +1,380 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.IO;
+using System.Diagnostics;
+using System.Threading;
+
+
+namespace FDK
+{
+ public unsafe class Cxa : SoundDecoder //, IDisposable
+ {
+ static byte[] FOURCC = Encoding.ASCII.GetBytes( "1DWK" ); // KWD1 縺ョ little endian
+
+ #region [ XA逕ィ讒矩菴薙ョ螳」險 ]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XASTREAMHEADER {
+ public byte* pSrc;
+ public uint nSrcLen;
+ public uint nSrcUsed;
+ public byte* pDst;
+ public uint nDstLen;
+ public uint nDstUsed;
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct XAHEADER
+ {
+ public uint id;
+ public uint nDataLen;
+ public uint nSamples;
+ public ushort nSamplesPerSec;
+ public byte nBits;
+ public byte nChannels;
+ public uint nLoopPtr;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
+ public short[] befL;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
+ public short[] befR;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
+ public byte[] pad;
+ }
+ #endregion
+
+ #region [ xadec.dll縺ィ縺ョ繝ェ繝ウ繧ッ ]
+ [DllImport( "xadec.dll", EntryPoint = "xaDecodeOpen", CallingConvention = CallingConvention.Cdecl )]
+ public extern static IntPtr xaDecodeOpen( ref XAHEADER pxah, out FDK.CWin32.WAVEFORMATEX pwfx );
+ [DllImport( "xadec.dll", EntryPoint = "xaDecodeClose", CallingConvention = CallingConvention.Cdecl )]
+ public extern static bool xaDecodeClose( IntPtr hxas );
+ [DllImport( "xadec.dll", EntryPoint = "xaDecodeSize", CallingConvention = CallingConvention.Cdecl )]
+ public extern static bool xaDecodeSize( IntPtr hxas, uint slen, out uint pdlen );
+ [DllImport( "xadec.dll", EntryPoint = "xaDecodeConvert", CallingConvention = CallingConvention.Cdecl )]
+ public extern static bool xaDecodeConvert( IntPtr hxas, ref XASTREAMHEADER psh );
+ #endregion
+
+ public XAHEADER xaheader;
+ public XASTREAMHEADER xastreamheader;
+ public CWin32.WAVEFORMATEX waveformatex;
+
+ private string filename;
+ private byte[] srcBuf = null;
+ private int nHandle = -1;
+
+ public override int Open( string filename )
+ {
+ this.filename = filename;
+
+ #region [ XA繝倥ャ繝縺ィ縲々A繝繝シ繧ソ縺ョ隱ュ縺ソ蜃コ縺 ]
+ xaheader = new XAHEADER();
+ using ( FileStream fs = new FileStream( filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ) ) // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k??
+ {
+ using ( BinaryReader br = new BinaryReader( fs ) )
+ {
+ xaheader.id = br.ReadUInt32();
+ xaheader.nDataLen = br.ReadUInt32();
+ xaheader.nSamples = br.ReadUInt32();
+ xaheader.nSamplesPerSec = br.ReadUInt16();
+ xaheader.nBits = br.ReadByte();
+ xaheader.nChannels = br.ReadByte();
+ xaheader.nLoopPtr = br.ReadUInt32();
+
+ xaheader.befL = new short[ 2 ];
+ xaheader.befR = new short[ 2 ];
+ xaheader.pad = new byte[ 4 ];
+
+ xaheader.befL[ 0 ] = br.ReadInt16();
+ xaheader.befL[ 1 ] = br.ReadInt16();
+ xaheader.befR[ 0 ] = br.ReadInt16();
+ xaheader.befR[ 1 ] = br.ReadInt16();
+ xaheader.pad = br.ReadBytes( 4 );
+
+ srcBuf = new byte[ xaheader.nDataLen ];
+ srcBuf = br.ReadBytes( (int) xaheader.nDataLen );
+ }
+ }
+ //string xaid = Encoding.ASCII.GetString( xah.id );
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**XAHEADER**" );
+ //Debug.WriteLine( "id= " + xaheader.id.ToString( "X8" ) );
+ //Debug.WriteLine( "nDataLen= " + xaheader.nDataLen.ToString( "X8" ) );
+ //Debug.WriteLine( "nSamples= " + xaheader.nSamples.ToString( "X8" ) );
+ //Debug.WriteLine( "nSamplesPerSec= " + xaheader.nSamplesPerSec.ToString( "X4" ) );
+ //Debug.WriteLine( "nBits= " + xaheader.nBits.ToString( "X2" ) );
+ //Debug.WriteLine( "nChannels= " + xaheader.nChannels.ToString( "X2" ) );
+ //Debug.WriteLine( "nLoopPtr= " + xaheader.nLoopPtr.ToString( "X8" ) );
+ //Debug.WriteLine( "befL[0]= " + xaheader.befL[ 0 ].ToString( "X4" ) );
+ //Debug.WriteLine( "befL[1]= " + xaheader.befL[ 1 ].ToString( "X4" ) );
+ //Debug.WriteLine( "befR[0]= " + xaheader.befR[ 0 ].ToString( "X4" ) );
+ //Debug.WriteLine( "befR[1]= " + xaheader.befR[ 1 ].ToString( "X4" ) );
+ #endregion
+ #endregion
+
+ IntPtr hxas;
+
+ #region [ WAVEFORMEX諠蝣ア縺ョ蜿門セ ]
+ waveformatex = new CWin32.WAVEFORMATEX();
+ hxas = xaDecodeOpen( ref xaheader, out waveformatex );
+ if ( hxas == null )
+ {
+ Trace.TraceError( "Error: xa: Open(): xaDecodeOpen(): " + Path.GetFileName( filename ) );
+ return -1;
+ }
+
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**WAVEFORMATEX**" );
+ //Debug.WriteLine( "wFormatTag= " + waveformatex.wFormatTag.ToString( "X4" ) );
+ //Debug.WriteLine( "nChannels = " + waveformatex.nChannels.ToString( "X4" ) );
+ //Debug.WriteLine( "nSamplesPerSec= " + waveformatex.nSamplesPerSec.ToString( "X8" ) );
+ //Debug.WriteLine( "nAvgBytesPerSec= " + waveformatex.nAvgBytesPerSec.ToString( "X8" ) );
+ //Debug.WriteLine( "nBlockAlign= " + waveformatex.nBlockAlign.ToString( "X4" ) );
+ //Debug.WriteLine( "wBitsPerSample= " + waveformatex.wBitsPerSample.ToString( "X4" ) );
+ //Debug.WriteLine( "cbSize= " + waveformatex.cbSize.ToString( "X4" ) );
+ #endregion
+ #endregion
+
+ this.nHandle = (int) hxas;
+ return (int) hxas;
+ }
+ public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx )
+ {
+ #region [ WAVEFORMATEX讒矩菴薙ョ謇句虚繧ウ繝斐シ ]
+ wfx.nAvgBytesPerSec = waveformatex.nAvgBytesPerSec;
+ wfx.wBitsPerSample = waveformatex.wBitsPerSample;
+ wfx.nBlockAlign = waveformatex.nBlockAlign;
+ wfx.nChannels = waveformatex.nChannels;
+ wfx.wFormatTag = waveformatex.wFormatTag;
+ wfx.nSamplesPerSec = waveformatex.nSamplesPerSec;
+
+ return 0;
+ #endregion
+ }
+ public override uint GetTotalPCMSize( int nHandle )
+ {
+ #region [ 繝繝シ繧ソ髟キ縺ョ蜿門セ ]
+ uint dlen;
+ xaDecodeSize( (IntPtr) nHandle, xaheader.nDataLen, out dlen );
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**INTERNAL VALUE**" );
+ //Debug.WriteLine( "dlen= " + dlen );
+ #endregion
+ #endregion
+
+ return dlen;
+ }
+ public override int Seek( int nHandle, uint dwPosition )
+ {
+ return 0;
+ }
+ public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop )
+ {
+ #region [ xa繝繝シ繧ソ縺ョ繝繧ウ繝シ繝 ]
+ xastreamheader = new XASTREAMHEADER();
+ unsafe
+ {
+ fixed ( byte* pXaBuf = srcBuf )
+ {
+ byte* pWavBuf = (byte*) pDest;
+
+ xastreamheader.pSrc = pXaBuf;
+ xastreamheader.nSrcLen = xaheader.nDataLen;
+ xastreamheader.nSrcUsed = 0;
+ xastreamheader.pDst = pWavBuf;
+ xastreamheader.nDstLen = szDestSize;
+ xastreamheader.nDstUsed = 0;
+ if ( !xaDecodeConvert( (IntPtr) nHandle, ref xastreamheader ) )
+ {
+ Trace.TraceError( "Error: xaDecodeConvert(): " + Path.GetFileName( filename ) );
+ return -1;
+ }
+ }
+ }
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**XASTREAMHEADER**" );
+ //Debug.WriteLine( "nSrcLen= " + xastreamheader.nSrcLen );
+ //Debug.WriteLine( "nSrcUsed= " + xastreamheader.nSrcUsed );
+ //Debug.WriteLine( "nDstLen= " + xastreamheader.nDstLen );
+ //Debug.WriteLine( "nDstUsed= " + xastreamheader.nDstUsed );
+ #endregion
+ #endregion
+
+ return 0;
+ }
+ public override void Close( int nHandle )
+ {
+ #region [ xa繝輔ぃ繧、繝ォ縺ョ繧ッ繝ュ繝シ繧コ ]
+ if ( !xaDecodeClose( (IntPtr) nHandle ) )
+ {
+ Trace.TraceError( "Error: xaDecodeClose(): " + Path.GetFileName( filename ) );
+ }
+ srcBuf = null;
+ #endregion
+ }
+
+
+
+ //#region [ IDisposable 螳溯」 ]
+ ////-----------------
+ //private bool bDispose螳御コ貂医∩ = false;
+ //public void Dispose()
+ //{
+ // if ( !this.bDispose螳御コ貂医∩ )
+ // {
+ // if ( srcBuf != null )
+ // {
+ // srcBuf = null;
+ // }
+ // if ( dstBuf != null )
+ // {
+ // dstBuf = null;
+ // }
+
+ // if ( this.nHandle >= 0 )
+ // {
+ // this.Close( this.nHandle );
+ // this.nHandle = -1;
+ // }
+ // this.bDispose螳御コ貂医∩ = true;
+ // }
+ //}
+ ////-----------------
+ //#endregion
+
+#if false
+ ///
+ /// xa繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙〒縲『av縺ォdecode縺吶k
+ ///
+ /// xa繝輔ぃ繧、繝ォ蜷
+ /// wav繝輔ぃ繧、繝ォ縺梧シ邏阪&繧後k繝舌ャ繝輔ぃ
+ ///
+ public bool Decode( string filename, out byte[] wavBuf )
+ {
+ // Debug.WriteLine( "xa: Decode: " + Path.GetFileName( filename ) );
+
+ #region [ XA繝倥ャ繝縺ィ縲々A繝繝シ繧ソ縺ョ隱ュ縺ソ蜃コ縺 ]
+ xaheader = new XAHEADER();
+ byte[] xaBuf;
+ using ( FileStream fs = new FileStream( filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ) ) // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k??
+ {
+ using ( BinaryReader br = new BinaryReader( fs ) )
+ {
+ xaheader.id = br.ReadUInt32();
+ xaheader.nDataLen = br.ReadUInt32();
+ xaheader.nSamples = br.ReadUInt32();
+ xaheader.nSamplesPerSec = br.ReadUInt16();
+ xaheader.nBits = br.ReadByte();
+ xaheader.nChannels = br.ReadByte();
+ xaheader.nLoopPtr = br.ReadUInt32();
+
+ xaheader.befL = new short[ 2 ];
+ xaheader.befR = new short[ 2 ];
+ xaheader.pad = new byte[ 4 ];
+
+ xaheader.befL[ 0 ] = br.ReadInt16();
+ xaheader.befL[ 1 ] = br.ReadInt16();
+ xaheader.befR[ 0 ] = br.ReadInt16();
+ xaheader.befR[ 1 ] = br.ReadInt16();
+ xaheader.pad = br.ReadBytes( 4 );
+
+ xaBuf = new byte[ xaheader.nDataLen ];
+ xaBuf = br.ReadBytes( (int) xaheader.nDataLen );
+ }
+ }
+ //string xaid = Encoding.ASCII.GetString( xah.id );
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**XAHEADER**" );
+ //Debug.WriteLine( "id= " + xaheader.id.ToString( "X8" ) );
+ //Debug.WriteLine( "nDataLen= " + xaheader.nDataLen.ToString( "X8" ) );
+ //Debug.WriteLine( "nSamples= " + xaheader.nSamples.ToString( "X8" ) );
+ //Debug.WriteLine( "nSamplesPerSec= " + xaheader.nSamplesPerSec.ToString( "X4" ) );
+ //Debug.WriteLine( "nBits= " + xaheader.nBits.ToString( "X2" ) );
+ //Debug.WriteLine( "nChannels= " + xaheader.nChannels.ToString( "X2" ) );
+ //Debug.WriteLine( "nLoopPtr= " + xaheader.nLoopPtr.ToString( "X8" ) );
+ //Debug.WriteLine( "befL[0]= " + xaheader.befL[ 0 ].ToString( "X4" ) );
+ //Debug.WriteLine( "befL[1]= " + xaheader.befL[ 1 ].ToString( "X4" ) );
+ //Debug.WriteLine( "befR[0]= " + xaheader.befR[ 0 ].ToString( "X4" ) );
+ //Debug.WriteLine( "befR[1]= " + xaheader.befR[ 1 ].ToString( "X4" ) );
+ #endregion
+ #endregion
+
+ object lockobj = new object();
+ lock ( lockobj ) // 繧ケ繝ャ繝繝峨そ繝シ繝輔§繧縺ェ縺縺九b遏・繧後↑縺縺ョ縺ァ縲∝ソオ縺ョ縺溘a
+ {
+ #region [ WAVEFORMEX諠蝣ア縺ョ蜿門セ ]
+ waveformatex = new CWin32.WAVEFORMATEX();
+ IntPtr hxas = xaDecodeOpen( ref xaheader, out waveformatex );
+ if ( hxas == null )
+ {
+ Trace.TraceError( "Error: xaDecodeOpen(): " + Path.GetFileName( filename ) );
+ wavBuf = null;
+ return false;
+ }
+
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**WAVEFORMATEX**" );
+ //Debug.WriteLine( "wFormatTag= " + waveformatex.wFormatTag.ToString( "X4" ) );
+ //Debug.WriteLine( "nChannels = " + waveformatex.nChannels.ToString( "X4" ) );
+ //Debug.WriteLine( "nSamplesPerSec= " + waveformatex.nSamplesPerSec.ToString( "X8" ) );
+ //Debug.WriteLine( "nAvgBytesPerSec= " + waveformatex.nAvgBytesPerSec.ToString( "X8" ) );
+ //Debug.WriteLine( "nBlockAlign= " + waveformatex.nBlockAlign.ToString( "X4" ) );
+ //Debug.WriteLine( "wBitsPerSample= " + waveformatex.wBitsPerSample.ToString( "X4" ) );
+ //Debug.WriteLine( "cbSize= " + waveformatex.cbSize.ToString( "X4" ) );
+ #endregion
+ #endregion
+
+ #region [ 繝繝シ繧ソ髟キ縺ョ蜿門セ ]
+ uint dlen;
+ xaDecodeSize( hxas, xaheader.nDataLen, out dlen );
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**INTERNAL VALUE**" );
+ //Debug.WriteLine( "dlen= " + dlen );
+ #endregion
+ #endregion
+
+ #region [ xa繝繝シ繧ソ縺ョ繝繧ウ繝シ繝 ]
+ wavBuf = new byte[ dlen ];
+ xastreamheader = new XASTREAMHEADER();
+
+ unsafe
+ {
+ fixed ( byte* pXaBuf = xaBuf, pWavBuf = wavBuf )
+ {
+ xastreamheader.pSrc = pXaBuf;
+ xastreamheader.nSrcLen = xaheader.nDataLen;
+ xastreamheader.nSrcUsed = 0;
+ xastreamheader.pDst = pWavBuf;
+ xastreamheader.nDstLen = dlen;
+ xastreamheader.nDstUsed = 0;
+ bool b = xaDecodeConvert( hxas, ref xastreamheader );
+ if ( !b )
+ {
+ Trace.TraceError( "Error: xaDecodeConvert(): " + Path.GetFileName( filename ) );
+ wavBuf = null;
+ return false;
+ }
+ }
+ }
+ #region [ 繝繝舌ャ繧ー陦ィ遉コ ]
+ //Debug.WriteLine( "**XASTREAMHEADER**" );
+ //Debug.WriteLine( "nSrcLen= " + xastreamheader.nSrcLen );
+ //Debug.WriteLine( "nSrcUsed= " + xastreamheader.nSrcUsed );
+ //Debug.WriteLine( "nDstLen= " + xastreamheader.nDstLen );
+ //Debug.WriteLine( "nDstUsed= " + xastreamheader.nDstUsed );
+ #endregion
+ #endregion
+
+ #region [ xa繝輔ぃ繧、繝ォ縺ョ繧ッ繝ュ繝シ繧コ ]
+ bool bb = xaDecodeClose( hxas );
+ if ( !bb )
+ {
+ Trace.TraceError( "Error: xaDecodeClose(): " + Path.GetFileName( filename ) );
+ }
+ #endregion
+ }
+
+ return true;
+ }
+#endif
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundDeviceType.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundDeviceType.cs
new file mode 100644
index 00000000..fe0edf0e
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundDeviceType.cs
@@ -0,0 +1,15 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FDK
+{
+ public enum ESoundDeviceType
+ {
+ ExclusiveWASAPI,
+ SharedWASAPI,
+ ASIO,
+ DirectSound,
+ Unknown,
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundGroup.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundGroup.cs
new file mode 100644
index 00000000..23d91f8d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundGroup.cs
@@ -0,0 +1,11 @@
+サソnamespace FDK
+{
+ public enum ESoundGroup
+ {
+ SoundEffect = 1,
+ Voice = 2,
+ SongPreview = 3,
+ SongPlayback = 4,
+ Unknown = 0
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ISoundDevice.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ISoundDevice.cs
new file mode 100644
index 00000000..b362eb22
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ISoundDevice.cs
@@ -0,0 +1,26 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using Un4seen.Bass;
+using Un4seen.BassAsio;
+using Un4seen.BassWasapi;
+using Un4seen.Bass.AddOn.Mix;
+
+namespace FDK
+{
+ internal interface ISoundDevice : IDisposable
+ {
+ ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ { get; }
+ int nMasterVolume { get; set; }
+ long n螳溷コ蜉幃≦蟒カms { get; }
+ long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms { get; }
+ long n邨碁℃譎る俣ms { get; }
+ long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms { get; }
+ CTimer tm繧キ繧ケ繝繝繧ソ繧、繝 { get; }
+
+ CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup );
+ void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound );
+ void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound );
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadata.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadata.cs
new file mode 100644
index 00000000..8c0f6ee9
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadata.cs
@@ -0,0 +1,22 @@
+サソusing System;
+
+namespace FDK
+{
+ ///
+ /// The LoudnessMetadata structure is used to carry, and assist with
+ /// calculations related to, integrated loudness and true peak
+ /// loudness.
+ ///
+ [Serializable]
+ public struct LoudnessMetadata
+ {
+ public readonly Lufs Integrated;
+ public readonly Lufs? TruePeak;
+
+ public LoudnessMetadata(Lufs integrated, Lufs? truePeak)
+ {
+ Integrated = integrated;
+ TruePeak = truePeak;
+ }
+ }
+}
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadataScanner.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadataScanner.cs
new file mode 100644
index 00000000..f3d26467
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadataScanner.cs
@@ -0,0 +1,357 @@
+サソusing System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Xml.XPath;
+
+namespace FDK
+{
+ ///
+ /// The LoudnessMetadataScanner plays two roles:
+ /// 1. Scanning of song audio files using BS1770GAIN (http://bs1770gain.sourceforge.net/)
+ /// to determine their perceived loudness. Running on a background thread while not
+ /// in song gameplay, songs without existing loudness metadata files (e.g. *.bs1770gain.xml)
+ /// have their perceived loudness determined and saved into an associated metadata file
+ /// without modifying the original audio file. This scanning process begins running
+ /// with scanning jobs ordered based on the order in which songs are enumerated when
+ /// the application starts, but shifts to prioritize songs which are browsed and previewed
+ /// while on the song select screen.
+ /// 2. Loading of loudness metadata from the BS1770GAIN metadata file alongside each audio file.
+ /// This occurs when parsing .tja files, when song preview begins, and when song playback
+ /// begins. When no file is available on disk, a scanning job is passed to the background
+ /// scanning thread for processing. The loaded metadata is then passed into the
+ /// SongGainController for combination with a configured target loudness, resulting in a
+ /// gain value assigned to the sound object just before playback begins.
+ ///
+ public static class LoudnessMetadataScanner
+ {
+ private const string Bs1770GainExeFileName = "bs1770gain.exe";
+
+ private static readonly Stack Jobs = new Stack();
+ private static readonly object LockObject = new object();
+ private static readonly Queue RecentFileScanDurations = new Queue();
+
+ private static Thread ScanningThread;
+ private static Semaphore Semaphore;
+
+ public static void StartBackgroundScanning()
+ {
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StartBackgroundScanning)}";
+
+ if (!IsBs1770GainAvailable())
+ {
+ Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is not available. A background scanning thread will not be started.");
+ return;
+ }
+
+ Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is available. Starting background scanning thread...");
+
+ lock (LockObject)
+ {
+ Semaphore = new Semaphore(Jobs.Count, int.MaxValue);
+ ScanningThread = new Thread(Scan)
+ {
+ IsBackground = true,
+ Name = "LoudnessMetadataScanner background scanning thread.",
+ Priority = ThreadPriority.Lowest
+ };
+ ScanningThread.Start();
+ }
+
+ Trace.TraceInformation($"{tracePrefix}: Background scanning thread started.");
+ }
+
+ public static void StopBackgroundScanning(bool joinImmediately)
+ {
+ var scanningThread = ScanningThread;
+
+ if (scanningThread == null)
+ {
+ return;
+ }
+
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StopBackgroundScanning)}";
+
+ Trace.TraceInformation($"{tracePrefix}: Stopping background scanning thread...");
+
+ lock (LockObject)
+ {
+ ScanningThread = null;
+ Semaphore.Release();
+ Semaphore = null;
+ }
+
+ if (joinImmediately)
+ {
+ scanningThread.Join();
+ }
+
+ Trace.TraceInformation($"{tracePrefix}: Background scanning thread stopped.");
+ }
+
+ public static LoudnessMetadata? LoadForAudioPath(string absoluteBgmPath)
+ {
+ try
+ {
+ var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath);
+
+ if (File.Exists(loudnessMetadataPath))
+ {
+ return LoadFromMetadataPath(loudnessMetadataPath);
+ }
+
+ SubmitForBackgroundScanning(absoluteBgmPath);
+ }
+ catch (Exception e)
+ {
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadForAudioPath)}";
+ Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to load {absoluteBgmPath}");
+ Trace.TraceError(e.ToString());
+ }
+
+ return null;
+ }
+
+ private static string GetLoudnessMetadataPath(string absoluteBgmPath)
+ {
+ return Path.Combine(
+ Path.GetDirectoryName(absoluteBgmPath),
+ Path.GetFileNameWithoutExtension(absoluteBgmPath) + ".bs1770gain.xml");
+ }
+
+ private static LoudnessMetadata? LoadFromMetadataPath(string loudnessMetadataPath)
+ {
+ XPathDocument xPathDocument;
+ try
+ {
+ xPathDocument = new XPathDocument(loudnessMetadataPath);
+ }
+ catch (IOException)
+ {
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}";
+ Trace.TraceWarning($"{tracePrefix}: Encountered IOException while attempting to read {loudnessMetadataPath}. This can occur when attempting to load while scanning the same file. Returning null...");
+ return null;
+ }
+
+ var trackNavigator = xPathDocument.CreateNavigator()
+ .SelectSingleNode(@"//bs1770gain/track[@ToTal=""1"" and @Number=""1""]");
+
+ var integratedLufsNode = trackNavigator?.SelectSingleNode(@"integrated/@lufs");
+ var truePeakTpfsNode = trackNavigator?.SelectSingleNode(@"true-peak/@tpfs");
+
+ if (trackNavigator == null || integratedLufsNode == null || truePeakTpfsNode == null)
+ {
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}";
+ Trace.TraceWarning($"{tracePrefix}: Encountered incorrect xml element structure while parsing {loudnessMetadataPath}. Returning null...");
+ return null;
+ }
+
+ var integrated = integratedLufsNode.ValueAsDouble;
+ var truePeak = truePeakTpfsNode.ValueAsDouble;
+
+ if (integrated <= -70.0 || truePeak >= 12.04)
+ {
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}";
+ Trace.TraceWarning($"{tracePrefix}: Encountered evidence of extreme clipping while parsing {loudnessMetadataPath}. Returning null...");
+ return null;
+ }
+
+ return new LoudnessMetadata(new Lufs(integrated), new Lufs(truePeak));
+ }
+
+ private static void SubmitForBackgroundScanning(string absoluteBgmPath)
+ {
+ lock (LockObject)
+ {
+ // Quite often, the loading process will cause the same job to be submitted many times.
+ // As such, we'll do a quick check as when this happens an equivalent job will often
+ // already be at the top of the stack and we need not add it again.
+ //
+ // Note that we will not scan the whole stack as that is an O(n) operation on the main
+ // thread, whereas redundant file existence checks on the background thread are not harmful.
+ //
+ // We also do not want to scan the whole stack, for example to skip pushing a new item onto it,
+ // because we want to re-submit jobs as the user interacts with their data, usually by
+ // scrolling through songs and previewing them. Their current interests should drive
+ // scanning priorities, and it is for this reason that a stack is used instead of a queue.
+ var semaphore = Semaphore;
+ if (semaphore != null && (Jobs.Count == 0 || Jobs.Peek() != absoluteBgmPath))
+ {
+ Jobs.Push(absoluteBgmPath);
+ semaphore.Release();
+ }
+ }
+ }
+
+ private static void Scan()
+ {
+ try
+ {
+ while (true)
+ {
+ RaiseScanningStateChanged(false);
+
+ Semaphore?.WaitOne();
+
+ if (ScanningThread == null)
+ {
+ return;
+ }
+
+ RaiseScanningStateChanged(true);
+
+ int jobCount;
+ string absoluteBgmPath;
+ lock (LockObject)
+ {
+ jobCount = Jobs.Count;
+ absoluteBgmPath = Jobs.Pop();
+ }
+
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}";
+
+ try
+ {
+ if (!File.Exists(absoluteBgmPath))
+ {
+ Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Missing audio file. Skipping {absoluteBgmPath}...");
+ continue;
+ }
+
+ var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath);
+
+ if (File.Exists(loudnessMetadataPath))
+ {
+ Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Pre-existing metadata. Skipping {absoluteBgmPath}...");
+ continue;
+ }
+
+ Trace.TraceInformation($"{tracePrefix}: Scanning jobs outstanding: {jobCount}. Scanning {absoluteBgmPath}...");
+ var stopwatch = Stopwatch.StartNew();
+
+ File.Delete(loudnessMetadataPath);
+ var arguments = $"-it --xml -f \"{Path.GetFileName(loudnessMetadataPath)}\" \"{Path.GetFileName(absoluteBgmPath)}\"";
+ Execute(Path.GetDirectoryName(absoluteBgmPath), Bs1770GainExeFileName, arguments, true);
+
+ var seconds = stopwatch.Elapsed.TotalSeconds;
+ RecentFileScanDurations.Enqueue(seconds);
+ while (RecentFileScanDurations.Count > 20)
+ {
+ RecentFileScanDurations.Dequeue();
+ }
+ var averageSeconds = RecentFileScanDurations.Average();
+ Trace.TraceInformation($"{tracePrefix}: Scanned in {seconds}s. Estimated remaining: {(int)(averageSeconds * (jobCount - 1))}s.");
+ }
+ catch (Exception e)
+ {
+ Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to scan {absoluteBgmPath}");
+ Trace.TraceError(e.ToString());
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}";
+ Trace.TraceError($"{tracePrefix}: caught an exception at the level of the thread method. The background scanning thread will now terminate.");
+ Trace.TraceError(e.ToString());
+ }
+ }
+
+ private static bool IsBs1770GainAvailable()
+ {
+ try
+ {
+ Execute(null, Bs1770GainExeFileName, "-h");
+ return true;
+ }
+ catch (Win32Exception)
+ {
+ return false;
+ }
+ catch (Exception e)
+ {
+ var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(IsBs1770GainAvailable)}";
+ Trace.TraceError($"{tracePrefix}: Encountered an exception. Returning false...");
+ Trace.TraceError(e.ToString());
+
+ return false;
+ }
+ }
+
+ private static string Execute(
+ string workingDirectory, string fileName, string arguments, bool shouldFailOnStdErrDataReceived = false)
+ {
+ var processStartInfo = new ProcessStartInfo(fileName, arguments)
+ {
+ CreateNoWindow = true,
+ RedirectStandardError = true,
+ RedirectStandardOutput = true,
+ UseShellExecute = false,
+ WorkingDirectory = workingDirectory ?? ""
+ };
+
+ var stdoutWriter = new StringWriter();
+ var stderrWriter = new StringWriter();
+ using (var process = Process.Start(processStartInfo))
+ {
+ process.OutputDataReceived += (s, e) =>
+ {
+ if (e.Data != null)
+ {
+ stdoutWriter.Write(e.Data);
+ stdoutWriter.Write(Environment.NewLine);
+ }
+ };
+
+ var errorDataReceived = false;
+ process.ErrorDataReceived += (s, e) =>
+ {
+ if (e.Data != null)
+ {
+ errorDataReceived = true;
+ stderrWriter.Write(e.Data);
+ stderrWriter.Write(Environment.NewLine);
+ }
+ };
+
+ process.BeginOutputReadLine();
+ process.BeginErrorReadLine();
+ process.WaitForExit();
+
+ if ((shouldFailOnStdErrDataReceived && errorDataReceived) || process.ExitCode != 0)
+ {
+ var stderr = stderrWriter.ToString();
+ if (string.IsNullOrEmpty(stderr))
+ {
+ stderr = stdoutWriter.ToString();
+ }
+
+ throw new Exception(
+ $"Execution of {processStartInfo.FileName} with arguments {processStartInfo.Arguments} failed with exit code {process.ExitCode}: {stderr}");
+ }
+
+ return stdoutWriter.ToString();
+ }
+ }
+
+ private static void RaiseScanningStateChanged(bool isActivelyScanning)
+ {
+ ScanningStateChanged?.Invoke(null, new ScanningStateChangedEventArgs(isActivelyScanning));
+ }
+
+ public class ScanningStateChangedEventArgs : EventArgs
+ {
+ public ScanningStateChangedEventArgs(bool isActivelyScanning)
+ {
+ IsActivelyScanning = isActivelyScanning;
+ }
+
+ public bool IsActivelyScanning { get; private set; }
+ }
+
+ public static event EventHandler ScanningStateChanged;
+ }
+}
\ No newline at end of file
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Lufs.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Lufs.cs
new file mode 100644
index 00000000..aad1efd5
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Lufs.cs
@@ -0,0 +1,47 @@
+サソusing System;
+
+namespace FDK
+{
+ ///
+ /// The Lufs structure is used to carry, and assist with calculations related to,
+ /// Loudness Units relative to Full Scale. LUFS are measured in absolute scale
+ /// and whole values represent one decibel.
+ ///
+ [Serializable]
+ public struct Lufs
+ {
+ private readonly double _value;
+
+ public Lufs(double value)
+ {
+ _value = value;
+ }
+
+ public double ToDouble() => _value;
+
+ public Lufs Min(Lufs lufs)
+ {
+ return new Lufs(Math.Min(_value, lufs._value));
+ }
+
+ public Lufs Negate()
+ {
+ return new Lufs(-_value);
+ }
+
+ public override string ToString()
+ {
+ return _value.ToString();
+ }
+
+ public static Lufs operator- (Lufs left, Lufs right)
+ {
+ return new Lufs(left._value - right._value);
+ }
+
+ public static Lufs operator+ (Lufs left, Lufs right)
+ {
+ return new Lufs(left._value + right._value);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SongGainController.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SongGainController.cs
new file mode 100644
index 00000000..7020e323
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SongGainController.cs
@@ -0,0 +1,32 @@
+サソnamespace FDK
+{
+ ///
+ /// SongGainController provides a central place through which song preview
+ /// and song playback attempt to apply BS1770GAIN-based loudness metadata
+ /// or .tja SONGVOL as the Gain of a song sound.
+ ///
+ /// By doing so through SongGainController instead of directly against the
+ /// song (preview) CSound object, SongGainController can override the Gain
+ /// value based on configuration or other information.
+ ///
+ public sealed class SongGainController
+ {
+ public bool ApplyLoudnessMetadata { private get; set; }
+ public Lufs TargetLoudness { private get; set; }
+ public bool ApplySongVol { private get; set; }
+
+ public void Set(int songVol, LoudnessMetadata? songLoudnessMetadata, CSound sound)
+ {
+ if (ApplyLoudnessMetadata && songLoudnessMetadata.HasValue)
+ {
+ var gain = TargetLoudness - songLoudnessMetadata.Value.Integrated;
+
+ sound.SetGain(gain, songLoudnessMetadata.Value.TruePeak);
+ }
+ else
+ {
+ sound.SetGain(ApplySongVol ? songVol : CSound.DefaultSongVol);
+ }
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundDecoder.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundDecoder.cs
new file mode 100644
index 00000000..94d77ad1
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundDecoder.cs
@@ -0,0 +1,20 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace FDK
+{
+ ///
+ /// xa,ogg繝繧ウ繝シ繝臥畑縺ョ蝓コ蠎輔け繝ゥ繧ケ
+ ///
+ public abstract class SoundDecoder //: IDisposable
+ {
+ public abstract int Open( string filename );
+ public abstract int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx );
+ public abstract uint GetTotalPCMSize( int nHandle );
+ public abstract int Seek( int nHandle, uint dwPosition );
+ public abstract int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop );
+ public abstract void Close( int nHandle );
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundGroupLevelController.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundGroupLevelController.cs
new file mode 100644
index 00000000..1b3e9d6c
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundGroupLevelController.cs
@@ -0,0 +1,132 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using FDK.ExtensionMethods;
+
+namespace FDK
+{
+ ///
+ /// SoundGroupLevelController holds the current sound level value for each
+ /// of the unique sound groups, along with an increment by which they can
+ /// easily be adjusted.
+ ///
+ /// Configuration changes to the sound group levels are provided to the
+ /// controller via binding code which allows CConfigIni and
+ /// SoundGroupLevelController to be unaware of one another.
+ /// See ConfigIniToSoundGroupLevelControllerBinder for more details.
+ ///
+ /// Dynamic adjustment of sound group levels during song selection and song
+ /// playback are managed via a small dependency taken by the respective
+ /// stage classes. See KeyboardSoundGroupLevelControlHandler and its usages
+ /// for more details.
+ ///
+ /// As new sound objects are created, including when reloading sounds due
+ /// to a changer in audio output device, SoundGroupLevelController ensures
+ /// that they are provided with the current level for their associated
+ /// sound group by subscribing to notifications regarding changes to a
+ /// collection of sound objects provided during construction. This
+ /// observable collection comes from the sound manager, but without either
+ /// it or this class being directly aware of one another.
+ ///
+ /// As sound group levels are changed, SoundGroupLevelController updates
+ /// all existing sound objects group levels by iterating that same
+ /// observable collection.
+ ///
+ public sealed class SoundGroupLevelController
+ {
+ private readonly Dictionary _levelBySoundGroup = new Dictionary
+ {
+ [ESoundGroup.SoundEffect] = CSound.MaximumGroupLevel,
+ [ESoundGroup.Voice] = CSound.MaximumGroupLevel,
+ [ESoundGroup.SongPreview] = CSound.MaximumGroupLevel,
+ [ESoundGroup.SongPlayback] = CSound.MaximumGroupLevel,
+ [ESoundGroup.Unknown] = CSound.MaximumGroupLevel
+ };
+
+ private readonly ObservableCollection _sounds;
+
+ private int _keyboardSoundLevelIncrement;
+
+ public SoundGroupLevelController(ObservableCollection sounds)
+ {
+ _sounds = sounds;
+
+ _sounds.CollectionChanged += SoundsOnCollectionChanged;
+ }
+
+ public void SetLevel(ESoundGroup soundGroup, int level)
+ {
+ var clampedLevel = level.Clamp(CSound.MinimumGroupLevel, CSound.MaximumGroupLevel);
+
+ if (_levelBySoundGroup[soundGroup] == clampedLevel)
+ {
+ return;
+ }
+
+ _levelBySoundGroup[soundGroup] = clampedLevel;
+
+ foreach (var sound in _sounds)
+ {
+ if (sound.SoundGroup == soundGroup)
+ {
+ SetLevel(sound);
+ }
+ }
+
+ RaiseLevelChanged(soundGroup, clampedLevel);
+ }
+
+ public void SetKeyboardSoundLevelIncrement(int keyboardSoundLevelIncrement)
+ {
+ _keyboardSoundLevelIncrement = keyboardSoundLevelIncrement;
+ }
+
+ public void AdjustLevel(ESoundGroup soundGroup, bool isAdjustmentPositive)
+ {
+ var adjustmentIncrement = isAdjustmentPositive
+ ? _keyboardSoundLevelIncrement
+ : -_keyboardSoundLevelIncrement;
+
+ SetLevel(soundGroup, _levelBySoundGroup[soundGroup] + adjustmentIncrement);
+ }
+
+ private void SetLevel(CSound sound)
+ {
+ sound.GroupLevel = _levelBySoundGroup[sound.SoundGroup];
+ }
+
+ private void SoundsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ switch (e.Action)
+ {
+ case NotifyCollectionChangedAction.Add:
+ case NotifyCollectionChangedAction.Replace:
+ foreach (CSound sound in e.NewItems)
+ {
+ SetLevel(sound);
+ }
+ break;
+ }
+ }
+
+ private void RaiseLevelChanged(ESoundGroup soundGroup, int level)
+ {
+ LevelChanged?.Invoke(this, new LevelChangedEventArgs(soundGroup, level));
+ }
+
+ public class LevelChangedEventArgs : EventArgs
+ {
+ public LevelChangedEventArgs(ESoundGroup soundGroup, int level)
+ {
+ SoundGroup = soundGroup;
+ Level = level;
+ }
+
+ public ESoundGroup SoundGroup { get; private set; }
+ public int Level { get; private set; }
+ }
+
+ public event EventHandler LevelChanged;
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/BitmapUtil.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/BitmapUtil.cs
new file mode 100644
index 00000000..83061321
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/BitmapUtil.cs
@@ -0,0 +1,74 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Drawing;
+using System.IO;
+
+namespace FDK
+{
+ public static class BitmapUtil
+ {
+ // 螳壽焚
+
+ public const uint DIB_PAL_COLORS = 1;
+ public const uint DIB_RGB_COLORS = 0;
+
+
+ // 讒矩菴
+
+ [StructLayout( LayoutKind.Sequential, Pack = 1 )]
+ public struct BITMAPFILEHEADER
+ {
+ public ushort bfType;
+ public uint bfSize;
+ public ushort bfReserved1;
+ public ushort bfReserved2;
+ public uint bfOffBits;
+ }
+
+ [StructLayout( LayoutKind.Sequential, Pack = 1 )]
+ public struct BITMAPINFOHEADER
+ {
+ public const int BI_RGB = 0;
+ public uint biSize讒矩菴薙ョ繧オ繧、繧コ;
+ public int biWidth繝薙ャ繝医槭ャ繝励ョ蟷dot;
+ public int biHeight繝薙ャ繝医槭ャ繝励ョ鬮倥&dot;
+ public ushort biPlanes髱「縺ョ謨ー;
+ public ushort biBitCount;
+ public uint biCompression蝨ァ邵ョ蠖「蠑;
+ public uint biSizeImage逕サ蜒上う繝。繝シ繧ク縺ョ繧オ繧、繧コ;
+ public int biXPelsPerMete豌エ蟷ウ譁ケ蜷代ョ隗」蜒丞コヲ;
+ public int biYPelsPerMeter蝙ら峩譁ケ蜷代ョ隗」蜒丞コヲ;
+ public uint biClrUsed濶イ繝繝シ繝悶Ν縺ョ繧、繝ウ繝繝繧ッ繧ケ謨ー;
+ public uint biClrImportant陦ィ遉コ縺ォ蠢隕√↑濶イ繧、繝ウ繝繝繧ッ繧ケ縺ョ謨ー;
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public static unsafe Bitmap ToBitmap( IntPtr pBITMAPINFOHEADER )
+ {
+ BITMAPFILEHEADER bitmapfileheader;
+ BITMAPINFOHEADER* bitmapinfoheaderPtr = (BITMAPINFOHEADER*) pBITMAPINFOHEADER;
+ bitmapfileheader.bfType = 0x4d42;
+ bitmapfileheader.bfOffBits = (uint) ( sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) );
+ bitmapfileheader.bfSize = bitmapfileheader.bfOffBits + bitmapinfoheaderPtr->biSizeImage逕サ蜒上う繝。繝シ繧ク縺ョ繧オ繧、繧コ;
+ MemoryStream output = new MemoryStream();
+ BinaryWriter writer = new BinaryWriter( output );
+ byte[] destination = new byte[ sizeof( BITMAPFILEHEADER ) ];
+ Marshal.Copy( (IntPtr) ( &bitmapfileheader ), destination, 0, destination.Length );
+ writer.Write( destination );
+ destination = new byte[ sizeof( BITMAPINFOHEADER ) ];
+ Marshal.Copy( pBITMAPINFOHEADER, destination, 0, destination.Length );
+ writer.Write( destination );
+ destination = new byte[ bitmapinfoheaderPtr->biSizeImage逕サ蜒上う繝。繝シ繧ク縺ョ繧オ繧、繧コ ];
+ bitmapinfoheaderPtr++;
+ Marshal.Copy( (IntPtr) bitmapinfoheaderPtr, destination, 0, destination.Length );
+ writer.Write( destination );
+ writer.Flush();
+ writer.BaseStream.Position = 0L;
+ return new Bitmap( writer.BaseStream );
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAero.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAero.cs
new file mode 100644
index 00000000..98765b2e
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAero.cs
@@ -0,0 +1,78 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Drawing;
+using SlimDX;
+
+namespace FDK
+{
+ //http://spazzarama.wordpress.com/2009/09/30/enable-or-disable-dwm-composition-aero/
+ ///
+ /// To control Aerograph in Vista and Windows7. Don't use this class in XP.
+ ///
+ public static class DWM
+ {
+ const uint DWM_EC_DISABLECOMPOSITION = 0;
+ const uint DWM_EC_ENABLECOMPOSITION = 1;
+
+ [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableComposition" )]
+ extern static uint DwmEnableComposition( uint compositionAction );
+ [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableComposition" )]
+ public extern static bool DwmIsCompositionEnabled(out bool pfEnabled);
+ [DllImport( "dwmapi.dll", EntryPoint = "DwmFlush" )]
+ extern static int DwmFlush();
+// [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableMMCSS" )]
+// extern static int DwmEnableMMCSS( bool fEnableMMCSS );
+ [DllImport( "dwmapi.dll", EntryPoint = "DwmFlush" )]
+ extern static int DwmEnableMMCSS( bool fEnableMMCSS );
+
+ public static int IsCompositionEnabled(out bool enabled)
+ {
+#if TEST_Direct3DEx
+ return DwmIsCompositionEnabled( out enabled );
+#else
+ enabled = false;
+ return 0;
+#endif
+ }
+ public static int Flush()
+ {
+#if TEST_Direct3DEx
+ return DwmFlush();
+#else
+ return 0; // 0(S_OK)縺ェ繧画仙粥
+#endif
+ }
+
+ ///
+ /// Enable/Disable DWM composition (aka Aero)
+ ///
+ /// True to enable composition, false to disable composition.
+ /// True if the operation was successful.
+ public static bool EnableComposition( bool bIsAeroEnabled )
+ {
+// DwmEnableMMCSS( true );
+#if TEST_Direct3D9Ex
+ try
+ {
+ if ( bIsAeroEnabled )
+ {
+ DwmEnableComposition( DWM_EC_ENABLECOMPOSITION );
+ }
+ else
+ {
+ DwmEnableComposition( DWM_EC_DISABLECOMPOSITION );
+ }
+ return true;
+ }
+ catch ( DllNotFoundException )
+ {
+ return false;
+ }
+#else
+ return true;
+#endif
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAvi.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAvi.cs
new file mode 100644
index 00000000..9e8244f4
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAvi.cs
@@ -0,0 +1,306 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Drawing;
+using SlimDX;
+
+namespace FDK
+{
+ public class CAvi : IDisposable
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public uint dw繧ケ繧ア繝シ繝ォ
+ {
+ get;
+ set;
+ }
+ public uint dw繝ャ繝シ繝
+ {
+ get;
+ set;
+ }
+ public uint n繝輔Ξ繝シ繝鬮倥&
+ {
+ get;
+ set;
+ }
+ public uint n繝輔Ξ繝シ繝蟷
+ {
+ get;
+ set;
+ }
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CAvi( string filename )
+ {
+ if ( AVIFileOpen( out this.aviFile, filename, OpenFileFlags.OF_READ, IntPtr.Zero ) != 0 )
+ {
+ this.Release();
+ throw new Exception( "AVIFileOpen failed." );
+ }
+ if ( AVIFileGetStream( this.aviFile, out this.aviStream, streamtypeVIDEO, 0 ) != 0 )
+ {
+ this.Release();
+ throw new Exception( "AVIFileGetStream failed." );
+ }
+ var info = new AVISTREAMINFO();
+ AVIStreamInfo( this.aviStream, ref info, Marshal.SizeOf( info ) );
+ this.dw繝ャ繝シ繝 = info.dwRate;
+ this.dw繧ケ繧ア繝シ繝ォ = info.dwScale;
+ this.n繝輔Ξ繝シ繝蟷 = info.rcFrame.right - info.rcFrame.left;
+ this.n繝輔Ξ繝シ繝鬮倥& = info.rcFrame.bottom - info.rcFrame.top;
+ try
+ {
+ this.frame = AVIStreamGetFrameOpen( this.aviStream, 0 );
+ }
+ catch
+ {
+ this.Release();
+ throw new Exception( "AVIStreamGetFrameOpen failed." );
+ }
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public static void t蛻晄悄蛹()
+ {
+ AVIFileInit();
+ }
+ public static void t邨ゆコ()
+ {
+ AVIFileExit();
+ }
+
+ public Bitmap GetFrame( int no )
+ {
+ if( this.aviStream == IntPtr.Zero )
+ throw new InvalidOperationException();
+
+ return BitmapUtil.ToBitmap( AVIStreamGetFrame( this.frame, no ) );
+ }
+ public int GetFrameNoFromTime( int time )
+ {
+ return (int) ( time * ( ( (double) this.dw繝ャ繝シ繝 ) / ( 1000.0 * this.dw繧ケ繧ア繝シ繝ォ ) ) );
+ }
+ public IntPtr GetFramePtr( int no )
+ {
+ if( this.aviStream == IntPtr.Zero )
+ throw new InvalidOperationException();
+
+ return AVIStreamGetFrame( this.frame, no );
+ }
+ public int GetMaxFrameCount()
+ {
+ if( this.aviStream == IntPtr.Zero )
+ throw new InvalidOperationException();
+
+ return AVIStreamLength( this.aviStream );
+ }
+
+ public unsafe void tBitmap24ToGraphicsStreamR5G6B5( BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER, DataStream gs, int nWidth, int nHeight )
+ {
+ int nBmpWidth = pBITMAPINFOHEADER->biWidth繝薙ャ繝医槭ャ繝励ョ蟷dot;
+ int nBmpHeight = pBITMAPINFOHEADER->biHeight繝薙ャ繝医槭ャ繝励ョ鬮倥&dot;
+ int nBmpLineByte = ( nBmpWidth * 3 ) + ( ( 4 - ( ( nBmpWidth * 3 ) % 4 ) ) % 4 );
+
+ ushort* pTexture = (ushort*) gs.DataPointer.ToPointer();
+ byte* pBitmap = (byte*) ( pBITMAPINFOHEADER + 1 );
+
+ for( int i = 0; i < nBmpHeight; i++ )
+ {
+ if( i >= nHeight )
+ break;
+
+ for( int j = 0; j < nBmpWidth; j++ )
+ {
+ if( j >= nWidth )
+ break;
+
+ ushort B = (ushort) ( ( *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 0 ) >> 3 ) & 0x1f );
+ ushort G = (ushort) ( ( *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 1 ) >> 2 ) & 0x3f );
+ ushort R = (ushort) ( ( *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 2 ) >> 3 ) & 0x1f );
+ *( pTexture + ( i * nWidth ) + j ) = (ushort) ( ( R << 11 ) | ( G << 5 ) | B );
+ }
+ }
+ }
+ public unsafe void tBitmap24ToGraphicsStreamX8R8G8B8( BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER, DataStream ds, int nWidth, int nHeight )
+ {
+ int nBmpWidth = pBITMAPINFOHEADER->biWidth繝薙ャ繝医槭ャ繝励ョ蟷dot;
+ int nBmpHeight = pBITMAPINFOHEADER->biHeight繝薙ャ繝医槭ャ繝励ョ鬮倥&dot;
+ int nBmpLineByte = ( nBmpWidth * 3 ) + ( ( 4 - ( ( nBmpWidth * 3 ) % 4 ) ) % 4 );
+
+ uint* pTexture = (uint*) ds.DataPointer.ToPointer();
+ byte* pBitmap = (byte*) ( pBITMAPINFOHEADER + 1 );
+
+ for( int i = 0; i < nBmpHeight; i++ )
+ {
+ if( i >= nHeight )
+ break;
+
+ for( int j = 0; j < nBmpWidth; j++ )
+ {
+ if( j >= nWidth )
+ break;
+
+ uint B = *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 0 );
+ uint G = *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 1 );
+ uint R = *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 2 );
+ *( pTexture + ( i * nWidth ) + j ) = ( R << 16 ) | ( G << 8 ) | B;
+ }
+ }
+ }
+
+ #region [ Dispose-Finalize 繝代ち繝シ繝ウ螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ this.Dispose( true );
+ GC.SuppressFinalize( this ); // 2011.8.19 from: 蠢倥l縺ヲ縺溘
+ }
+ protected void Dispose( bool disposeManagedObjects )
+ {
+ if( this.bDispose螳御コ貂医∩ )
+ return;
+
+ if( disposeManagedObjects )
+ {
+ // (A) Managed 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ
+ }
+
+ // (B) Unamanaged 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ
+
+ if( this.frame != IntPtr.Zero )
+ AVIStreamGetFrameClose( this.frame );
+
+ this.Release();
+ this.bDispose螳御コ貂医∩ = true;
+ }
+ ~CAvi()
+ {
+ this.Dispose( false );
+ }
+ //-----------------
+ #endregion
+
+
+ // 縺昴ョ莉
+
+ #region [ Win32 AVI髢「騾」髢「謨ー繧、繝ウ繝昴シ繝 ]
+ //-----------------
+ internal enum OpenFileFlags : uint
+ {
+ OF_CANCEL = 0x800,
+ OF_CREATE = 0x1000,
+ OF_DELETE = 0x200,
+ OF_EXIST = 0x4000,
+ OF_PARSE = 0x100,
+ OF_PROMPT = 0x2000,
+ OF_READ = 0,
+ OF_READWRITE = 2,
+ OF_REOPEN = 0x8000,
+ OF_SHARE_COMPAT = 0,
+ OF_SHARE_DENY_NONE = 0x40,
+ OF_SHARE_DENY_READ = 0x30,
+ OF_SHARE_DENY_WRITE = 0x20,
+ OF_SHARE_EXCLUSIVE = 0x10,
+ OF_VERIFY = 0x400,
+ OF_WRITE = 1
+ }
+
+ [StructLayout( LayoutKind.Sequential, Pack = 1 )]
+ internal struct AVISTREAMINFO
+ {
+ public uint fccType;
+ public uint fccHandler;
+ public uint dwFlags;
+ public uint dwCaps;
+ public ushort wPriority;
+ public ushort wLanguage;
+ public uint dwScale;
+ public uint dwRate;
+ public uint dwStart;
+ public uint dwLength;
+ public uint dwInitialFrames;
+ public uint dwSuggestedBufferSize;
+ public uint dwQuality;
+ public uint dwSampleSize;
+ public CAvi.RECT rcFrame;
+ public uint dwEditCount;
+ public uint dwFormatChangeCount;
+ [MarshalAs( UnmanagedType.ByValArray, SizeConst = 0x40 )]
+ public ushort[] szName;
+ }
+
+ [StructLayout( LayoutKind.Sequential, Pack = 1 )]
+ internal struct RECT
+ {
+ public uint left;
+ public uint top;
+ public uint right;
+ public uint bottom;
+ }
+
+ [DllImport( "AVIFIL32" )]
+ private static extern void AVIFileExit();
+ [DllImport( "AVIFIL32" )]
+ private static extern uint AVIFileGetStream( IntPtr pfile, out IntPtr ppavi, uint fccType, int lParam );
+ [DllImport( "AVIFIL32" )]
+ private static extern void AVIFileInit();
+ [DllImport( "AVIFIL32" )]
+ private static extern uint AVIFileOpen( out IntPtr ppfile, string szFile, OpenFileFlags mode, IntPtr pclsidHandler );
+ [DllImport( "AVIFIL32" )]
+ private static extern int AVIFileRelease( IntPtr pfile );
+ [DllImport( "AVIFIL32" )]
+ private static extern IntPtr AVIStreamGetFrame( IntPtr pgf, int lPos );
+ [DllImport( "AVIFIL32" )]
+ private static extern uint AVIStreamGetFrameClose( IntPtr pget );
+ [DllImport( "AVIFIL32" )]
+ private static extern IntPtr AVIStreamGetFrameOpen( IntPtr pavi, int lpbiWanted );
+ [DllImport( "AVIFIL32" )]
+ private static extern int AVIStreamInfo( IntPtr pavi, ref AVISTREAMINFO psi, int lSize );
+ [DllImport( "AVIFIL32" )]
+ private static extern int AVIStreamLength( IntPtr pavi );
+ [DllImport( "AVIFIL32" )]
+ private static extern int AVIStreamRelease( IntPtr pavi );
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ private IntPtr aviFile = IntPtr.Zero;
+ private const string AVIFILE32 = "AVIFIL32";
+ private const int AVIGETFRAMEF_BESTDISPLAYFMT = 1;
+ private IntPtr aviStream = IntPtr.Zero;
+ private bool bDispose螳御コ貂医∩;
+ private IntPtr frame = IntPtr.Zero;
+ private static readonly uint streamtypeAUDIO = mmioFOURCC( 'a', 'u', 'd', 's' );
+ private static readonly uint streamtypeMIDI = mmioFOURCC( 'm', 'i', 'd', 's' );
+ private static readonly uint streamtypeTEXT = mmioFOURCC( 't', 'x', 't', 's' );
+ private static readonly uint streamtypeVIDEO = mmioFOURCC( 'v', 'i', 'd', 's' );
+
+ private static uint mmioFOURCC( char c0, char c1, char c2, char c3 )
+ {
+ return ( (uint) c3 << 0x18 ) | ( (uint) c2 << 0x10 ) | ( (uint) c1 << 0x08 ) | (uint) c0;
+ }
+ private void Release()
+ {
+ if( this.aviStream != IntPtr.Zero )
+ {
+ AVIStreamRelease( this.aviStream );
+ this.aviStream = IntPtr.Zero;
+ }
+ if( this.aviFile != IntPtr.Zero )
+ {
+ AVIFileRelease( this.aviFile );
+ this.aviFile = IntPtr.Zero;
+ }
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTaskBar.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTaskBar.cs
new file mode 100644
index 00000000..05d6732a
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTaskBar.cs
@@ -0,0 +1,145 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Reflection;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+
+namespace FDK
+{
+ // referenced from http://dalmore.blog7.fc2.com/blog-entry-34.html
+
+ public static class CTaskBar
+ {
+ public static void ShowTaskBar( bool bShowTaskBar )
+ {
+ Int32 hWnd1 = FindWindow( "Shell_TrayWnd", null );
+ if( hWnd1 != 0 )
+ { //繧ソ繧ケ繧ッ繝舌シ縺ョ陦ィ遉コ
+ if ( bShowTaskBar )
+ {
+ ShowWindow( hWnd1, TASKBAR_SHOW ); //// 繧ソ繧ケ繧ッ繝舌シ繧貞クク縺ォ陦ィ遉コ
+ }
+ else
+ {
+ ShowWindow( hWnd1, TASKBAR_HIDE );
+ }
+ APPBARDATA pData = new APPBARDATA();
+ pData.cbSize = Marshal.SizeOf( pData );
+ pData.hWnd = (IntPtr)hWnd1;
+ pData.lParam = (int)ABMsg.ABM_NEW; //REMOVE縺ォ縺吶k縺ィ繧ェ繝シ繝医ワ繧、繝峨↓縺ェ繧
+ //繧ソ繧ケ繧ッ繝舌シ縺ォ繝。繝繧サ繝シ繧ク騾∽ソ。
+ SHAppBarMessage( ABMsg.ABM_SETSTATE, ref pData );
+ }
+
+ Int32 hWnd2 = FindWindow( "Button", "繧ケ繧ソ繝シ繝" );
+ if ( hWnd2 != 0 )
+ { //繧ソ繧ケ繧ッ繝舌シ縺ョ陦ィ遉コ
+ if ( bShowTaskBar )
+ {
+ ShowWindow( hWnd2, TASKBAR_SHOW ); //// 繧ソ繧ケ繧ッ繝舌シ繧貞クク縺ォ陦ィ遉コ
+ }
+ else
+ {
+ ShowWindow( hWnd2, TASKBAR_HIDE );
+ }
+ APPBARDATA pData = new APPBARDATA();
+ pData.cbSize = Marshal.SizeOf( pData );
+ pData.hWnd = (IntPtr) hWnd2;
+ pData.lParam = (int) ABMsg.ABM_NEW; //REMOVE縺ォ縺吶k縺ィ繧ェ繝シ繝医ワ繧、繝峨↓縺ェ繧
+ //繧ソ繧ケ繧ッ繝舌シ縺ォ繝。繝繧サ繝シ繧ク騾∽ソ。
+ SHAppBarMessage( ABMsg.ABM_SETSTATE, ref pData );
+ }
+ }
+
+ ///
+ /// ABMsg 騾√kAppBar繝。繝繧サ繝シ繧ク縺ョ隴伜挨蟄撰シ井サ・荳九ョ縺縺壹l縺1縺、シ
+ /// _ABM_ACTIVATE---AppBar縺後い繧ッ繝繧」繝悶↓縺ェ縺」縺滉コ九r繧キ繧ケ繝繝縺ォ騾夂衍
+ /// _ABM_GETAUTOHIDEBAR---繧ケ繧ッ繝ェ繝シ繝ウ縺ョ迚ケ螳壹ョ遶ッ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧九が繝シ繝医ワ繧、繝陰ppBar縺ョ繝上Φ繝峨Ν繧定ソ斐☆
+ /// _ABM_GETSTATE---繧ソ繧ケ繧ッ繝舌シ縺後が繝シ繝医ワ繧、繝峨°蟶ク縺ォ譛蜑埼擇縺ョ縺ゥ縺。繧峨ョ蟶ク諷九↓縺ゅk縺九r霑斐☆
+ /// _ABM_GETTASKBARPOS---繧ソ繧ケ繧ッ繝舌シ縺ョ菴ソ逕ィ鬆伜沺繧定ソ斐☆
+ /// _ABM_NEW---譁ー縺励>AppBar繧堤匳骭イ縺励√す繧ケ繝繝縺碁夂衍縺ォ菴ソ逕ィ縺吶k繝。繝繧サ繝シ繧クID繧呈欠螳壹☆繧
+ /// _ABM_QUERYPOS---AppBar縺ョ縺溘a縺ョ繧オ繧、繧コ縺ィ繧ケ繧ッ繝ェ繝シ繝ウ菴咲スョ繧定ヲ∵アゅ☆繧
+ /// _ABM_REMOVE---AppBar縺ョ逋サ骭イ繧貞炎髯、縺吶k
+ /// _ABM_SETAUTOHIDEBAR---繧ケ繧ッ繝ェ繝シ繝ウ縺ョ遶ッ縺ォ繧ェ繝シ繝医ワ繧、繝陰ppBar繧堤匳骭イ縺セ縺溘ッ蜑企勁縺吶k
+ /// _ABM_SETPOS---AppBar縺ョ繧オ繧、繧コ縺ィ繧ケ繧ッ繝ェ繝シ繝ウ蠎ァ讓吶r險ュ螳壹☆繧
+ /// _ABM_WINDOWPOSCHANGED---AppBar縺ョ菴咲スョ縺悟、画峩縺輔l縺溘%縺ィ繧偵す繧ケ繝繝縺ォ騾夂衍縺吶k
+ /// pDataシ TAppBarData讒矩菴難シ亥推繝輔ぅ繝シ繝ォ繝峨ッdwMessage縺ォ萓晏ュ倥☆繧具シ
+ ///
+ private enum ABMsg : int
+ {
+ ABM_NEW = 0,
+ ABM_REMOVE = 1,
+ ABM_QUERYPOS = 2,
+ ABM_SETPOS = 3,
+ ABM_GETSTATE = 4,
+ ABM_GETTASKBARPOS = 5,
+ ABM_ACTIVATE = 6,
+ ABM_GETAUTOHIDEBAR = 7,
+ ABM_SETAUTOHIDEBAR = 8,
+ ABM_WINDOWPOSCHANGED = 9,
+ ABM_SETSTATE = 10
+ }
+
+ ///
+ /// APPBARDATA SHAppBarMessage髢「謨ー縺ォ縺ヲ菴ソ逕ィ縺輔l繧帰ppBar縺ォ髢「縺吶k讒矩菴薙
+ /// cbSize.....SizeOf(TAppBarData)
+ /// hWnd.....AppBar縺ョ繝上Φ繝峨Ν
+ /// uCallbackMessage.....莉サ諢上ョ繝。繝繧サ繝シ繧クIDシhWnd縺ョAppBar縺ォ繝。繝繧サ繝シ繧ク繧帝夂衍縺吶k髫幢シABM_NEW繝。繝繧サ繝シ繧ク繧帝√k髫幢シ峨↓菴ソ逕ィシ
+ /// uEdge.....繧ケ繧ッ繝ェ繝シ繝ウ縺ョ遶ッ繧呈欠螳壹☆繧九ヵ繝ゥ繧ーシABM_GETAUTOHIDEBAR縲、BM_QUERYPOS縲、BM_SETAUTOHIDEBAR縲、BM_SETPOS繝。繝繧サ繝シ繧ク繧帝√k髫帙↓菴ソ逕ィ縺励∽サ・荳九ョ縺縺壹l縺1縺、シ
+ /// _ABE_BOTTOM---荳九し繧、繝
+ /// _ABE_LEFT--- 蟾ヲ繧オ繧、繝
+ /// _ABE_RIGHT---蜿ウ繧オ繧、繝
+ /// _ABE_TOP---荳翫し繧、繝
+ /// rc.....AppBar繧繧ソ繧ケ繧ッ繝舌シ縺ョ繧ケ繧ッ繝ェ繝シ繝ウ蠎ァ讓吶〒縺ョ陦ィ遉コ鬆伜沺シABM_GETTASKBARPOS縲、BM_QUERYPOS縲、BM_SETPOS繝。繝繧サ繝シ繧ク繧帝√k髫帙↓菴ソ逕ィ縺吶kシ
+ /// lParam.....繝。繝繧サ繝シ繧ク萓晏ュ倥ョ繝代Λ繝。繝シ繧ソシABM_SETAUTOHIDEBAR繝。繝繧サ繝シ繧ク縺ィ蜈ア縺ォ菴ソ逕ィ縺輔l繧具シ
+ ///
+ [StructLayout( LayoutKind.Sequential )]
+ private struct APPBARDATA
+ {
+ public int cbSize;
+ public IntPtr hWnd;
+ public uint uCallbackMessage;
+ public ABEdge uEdge;
+ public RECT rc;
+ public int lParam;
+ }
+ ///
+ /// ABEdge
+ ///
+ private enum ABEdge : int
+ {
+ ABE_LEFT = 0,
+ ABE_TOP = 1,
+ ABE_RIGHT = 2,
+ ABE_BOTTOM = 3
+ }
+ ///
+ /// RECT
+ ///
+ [StructLayout( LayoutKind.Sequential )]
+ private struct RECT
+ {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+ }
+ ///
+ /// SHAppBarMessage
+ ///
+ ///
+ ///
+ ///
+ [DllImport( "shell32.dll", CallingConvention = CallingConvention.StdCall )]
+ private static extern int SHAppBarMessage( ABMsg dwMessage, ref APPBARDATA pData );
+
+ [DllImport("user32.dll", EntryPoint = "ShowWindow")]
+ private static extern int ShowWindow(Int32 hWnd, int nCmdShow);
+ private const int TASKBAR_HIDE = 0;
+ private const int TASKBAR_SHOW = 5;
+
+ [DllImport( "user32.dll", EntryPoint = "FindWindow" )]
+ private static extern Int32 FindWindow( String lpClassName, String lpWindowName );
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTexture.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTexture.cs
new file mode 100644
index 00000000..7975124a
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTexture.cs
@@ -0,0 +1,1240 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Diagnostics;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+using Device = SampleFramework.DeviceCache;
+
+namespace FDK
+{
+ public class CTexture : IDisposable
+ {
+ // 繝励Ο繝代ユ繧」
+ public bool b蜉邂怜粋謌
+ {
+ get;
+ set;
+ }
+ public bool b荵礼ョ怜粋謌
+ {
+ get;
+ set;
+ }
+ public bool b貂帷ョ怜粋謌
+ {
+ get;
+ set;
+ }
+ public bool b繧ケ繧ッ繝ェ繝シ繝ウ蜷域
+ {
+ get;
+ set;
+ }
+ public float fZ霆ク荳ュ蠢蝗櫁サ「
+ {
+ get;
+ set;
+ }
+ public int Opacity
+ {
+ get
+ {
+ return this._opacity;
+ }
+ set
+ {
+ if (value < 0)
+ {
+ this._opacity = 0;
+ }
+ else if (value > 0xff)
+ {
+ this._opacity = 0xff;
+ }
+ else
+ {
+ this._opacity = value;
+ }
+ }
+ }
+ public Size sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ
+ {
+ get;
+ private set;
+ }
+ public Size sz逕サ蜒上し繧、繧コ
+ {
+ get;
+ protected set;
+ }
+ public Texture texture
+ {
+ get;
+ private set;
+ }
+ public Format Format
+ {
+ get;
+ protected set;
+ }
+ public Vector3 vc諡。螟ァ邵ョ蟆丞咲紫;
+
+ // 逕サ髱「縺悟、峨o繧九◆縺ウ莉・荳九ョ繝励Ο繝代ユ繧」繧定ィュ螳壹@豐サ縺吶%縺ィ縲
+
+ public static Size sz隲也炊逕サ髱「 = Size.Empty;
+ public static Size sz迚ゥ逅逕サ髱「 = Size.Empty;
+ public static Rectangle rc迚ゥ逅逕サ髱「謠冗判鬆伜沺 = Rectangle.Empty;
+ ///
+ /// 隲也炊逕サ髱「繧1縺ィ縺吶k蝣エ蜷医ョ迚ゥ逅逕サ髱「縺ョ蛟咲紫縲
+ /// 隲也炊蛟、テ礼判髱「豈皮紫シ晉黄逅蛟、縲
+ ///
+ public static float f逕サ髱「豈皮紫 = 1.0f;
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CTexture()
+ {
+ this.sz逕サ蜒上し繧、繧コ = new Size(0, 0);
+ this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = new Size(0, 0);
+ this._opacity = 0xff;
+ this.texture = null;
+ this.cvPositionColoredVertexies = null;
+ this.b蜉邂怜粋謌 = false;
+ this.fZ霆ク荳ュ蠢蝗櫁サ「 = 0f;
+ this.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3(1f, 1f, 1f);
+ // this._txData = null;
+ }
+
+ ///
+ /// 謖螳壹&繧後◆繝薙ャ繝医槭ャ繝励が繝悶ず繧ァ繧ッ繝医°繧 Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲。ITMAP逕サ蜒上ョ繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九
+ /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲
+ /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲 ̄ool 縺ッ Managed縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ
+ /// None縲√き繝ゥ繝シ繧ュ繝シ縺ッ 0xFFFFFFFFシ亥ョ悟ィ縺ェ繧矩サ偵r騾城℃シ峨↓縺ェ繧九
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 菴懈仙縺ョ繝薙ャ繝医槭ャ繝励
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ public CTexture(Device device, Bitmap bitmap, Format format)
+ : this()
+ {
+ try
+ {
+ this.Format = format;
+ this.sz逕サ蜒上し繧、繧コ = new Size(bitmap.Width, bitmap.Height);
+ this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ);
+ this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height);
+
+ using (var stream = new MemoryStream())
+ {
+ bitmap.Save(stream, ImageFormat.Bmp);
+ stream.Seek(0L, SeekOrigin.Begin);
+ int colorKey = unchecked((int)0xFF000000);
+ this.texture = Texture.FromStream(device.UnderlyingDevice, stream, this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height, 1, Usage.None, format, poolvar, Filter.Point, Filter.None, colorKey);
+ }
+ }
+ catch (Exception e)
+ {
+ this.Dispose();
+ throw new CTextureCreateFailedException("繝薙ャ繝医槭ャ繝励°繧峨ョ繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲", e);
+ }
+ }
+
+ ///
+ /// 遨コ縺ョ Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∵欠螳壹&繧後◆蟶梧悍繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九
+ /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝繧ッ繧サ繝ォ繝繝シ繧ソ縺ッ譛ェ蛻晄悄蛹悶ゑシ医♀縺昴i縺上ざ繝溘ョ繝シ繧ソ縺悟・縺」縺溘∪縺セ縲ゑシ
+ /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None縲
+ /// 繧ォ繝ゥ繝シ繧ュ繝シ縺ッ 0x00000000シ磯城℃縺励↑縺シ峨↓縺ェ繧九
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ蟷シ亥ク梧悍蛟、シ峨
+ /// 繝繧ッ繧ケ繝√Ε縺ョ鬮倥&シ亥ク梧悍蛟、シ峨
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ public CTexture(Device device, int n蟷, int n鬮倥&, Format format)
+ : this(device, n蟷, n鬮倥&, format, Pool.Managed)
+ {
+ }
+
+ ///
+ /// 謖螳壹&繧後◆逕サ蜒上ヵ繧。繧、繝ォ縺九i Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九
+ /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医
+ /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ public CTexture(Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k)
+ : this(device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, Pool.Managed)
+ {
+ }
+ public CTexture(Device device, byte[] txData, Format format, bool b鮟偵r騾城℃縺吶k)
+ : this(device, txData, format, b鮟偵r騾城℃縺吶k, Pool.Managed)
+ {
+ }
+ public CTexture(Device device, Bitmap bitmap, Format format, bool b鮟偵r騾城℃縺吶k)
+ : this(device, bitmap, format, b鮟偵r騾城℃縺吶k, Pool.Managed)
+ {
+ }
+
+ ///
+ /// 遨コ縺ョ繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∵欠螳壹&繧後◆蟶梧悍繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九
+ /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝繧ッ繧サ繝ォ繝繝シ繧ソ縺ッ譛ェ蛻晄悄蛹悶ゑシ医♀縺昴i縺上ざ繝溘ョ繝シ繧ソ縺悟・縺」縺溘∪縺セ縲ゑシ
+ /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None縲
+ /// 繧ォ繝ゥ繝シ繧ュ繝シ縺ッ 0x00000000シ磯城℃縺励↑縺シ峨↓縺ェ繧九
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ蟷シ亥ク梧悍蛟、シ峨
+ /// 繝繧ッ繧ケ繝√Ε縺ョ鬮倥&シ亥ク梧悍蛟、シ峨
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医
+ /// 繝繧ッ繧ケ繝√Ε縺ョ邂。逅譁ケ豕輔
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ public CTexture(Device device, int n蟷, int n鬮倥&, Format format, Pool pool)
+ : this(device, n蟷, n鬮倥&, format, pool, Usage.None)
+ {
+ }
+
+ public CTexture(Device device, int n蟷, int n鬮倥&, Format format, Pool pool, Usage usage)
+ : this()
+ {
+ try
+ {
+ this.Format = format;
+ this.sz逕サ蜒上し繧、繧コ = new Size(n蟷, n鬮倥&);
+ this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ);
+ this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height);
+
+ using (var bitmap = new Bitmap(1, 1))
+ {
+ using (var graphics = Graphics.FromImage(bitmap))
+ {
+ graphics.FillRectangle(Brushes.Black, 0, 0, 1, 1);
+ }
+ using (var stream = new MemoryStream())
+ {
+ bitmap.Save(stream, ImageFormat.Bmp);
+ stream.Seek(0L, SeekOrigin.Begin);
+#if TEST_Direct3D9Ex
+ pool = poolvar;
+#endif
+ // 荳ュ縺ァ譖エ縺ォ繝。繝「繝ェ隱ュ縺ソ霎シ縺ソ縺礼峩縺励※縺縺ヲ辟。鬧縺ェ縺ョ縺ァ縲ヾtream繧剃スソ縺縺ョ縺ッ豁「繧√◆縺縺ィ縺薙m
+ this.texture = Texture.FromStream(device.UnderlyingDevice, stream, n蟷, n鬮倥&, 1, usage, format, pool, Filter.Point, Filter.None, 0);
+ }
+ }
+ }
+ catch
+ {
+ this.Dispose();
+ throw new CTextureCreateFailedException(string.Format("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n({0}x{1}, {2})", n蟷, n鬮倥&, format));
+ }
+ }
+
+ ///
+ /// 逕サ蜒上ヵ繧。繧、繝ォ縺九i繝繧ッ繧ケ繝√Ε繧堤函謌舌☆繧九
+ /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∫判蜒上ョ繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九
+ /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲
+ /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None 縺ォ縺ェ繧九
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医
+ /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ邂。逅譁ケ豕輔
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ public CTexture(Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool)
+ : this()
+ {
+ MakeTexture(device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool);
+ }
+ public void MakeTexture(Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool)
+ {
+ if (!File.Exists(str繝輔ぃ繧、繝ォ蜷)) // #27122 2012.1.13 from: ImageInformation 縺ァ縺ッ FileNotFound 萓句、悶ッ霑斐▲縺ヲ縺薙↑縺縺ョ縺ァ縲√%縺薙〒閾ェ蛻縺ァ繝√ぉ繝繧ッ縺吶k縲ゅo縺九j繧縺吶>繝ュ繧ー縺ョ縺溘a縺ォ縲
+ throw new FileNotFoundException(string.Format("繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲\n[{0}]", str繝輔ぃ繧、繝ォ蜷));
+
+ Byte[] _txData = File.ReadAllBytes(str繝輔ぃ繧、繝ォ蜷);
+ MakeTexture(device, _txData, format, b鮟偵r騾城℃縺吶k, pool);
+ }
+
+ public CTexture(Device device, byte[] txData, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool)
+ : this()
+ {
+ MakeTexture(device, txData, format, b鮟偵r騾城℃縺吶k, pool);
+ }
+ public void MakeTexture(Device device, byte[] txData, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool)
+ {
+ try
+ {
+ var information = ImageInformation.FromMemory(txData);
+ this.Format = format;
+ this.sz逕サ蜒上し繧、繧コ = new Size(information.Width, information.Height);
+ this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height);
+ int colorKey = (b鮟偵r騾城℃縺吶k) ? unchecked((int)0xFF000000) : 0;
+ this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ);
+#if TEST_Direct3D9Ex
+ pool = poolvar;
+#endif
+ // lock ( lockobj )
+ // {
+ //Trace.TraceInformation( "CTexture() start: " );
+ this.texture = Texture.FromMemory(device.UnderlyingDevice, txData, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height, 1, Usage.None, format, pool, Filter.Point, Filter.None, colorKey);
+ //Trace.TraceInformation( "CTexture() end: " );
+ // }
+ }
+ catch
+ {
+ this.Dispose();
+ // throw new CTextureCreateFailedException( string.Format( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n{0}", str繝輔ぃ繧、繝ォ蜷 ) );
+ throw new CTextureCreateFailedException(string.Format("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n"));
+ }
+ }
+
+ public CTexture(Device device, Bitmap bitmap, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool)
+ : this()
+ {
+ MakeTexture(device, bitmap, format, b鮟偵r騾城℃縺吶k, pool);
+ }
+ public void MakeTexture(Device device, Bitmap bitmap, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool)
+ {
+ try
+ {
+ this.Format = format;
+ this.sz逕サ蜒上し繧、繧コ = new Size(bitmap.Width, bitmap.Height);
+ this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height);
+ int colorKey = (b鮟偵r騾城℃縺吶k) ? unchecked((int)0xFF000000) : 0;
+ this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ);
+#if TEST_Direct3D9Ex
+ pool = poolvar;
+#endif
+ //Trace.TraceInformation( "CTExture() start: " );
+ unsafe // Bitmap縺ョ蜀驛ィ繝繝シ繧ソ(a8r8g8b8)繧定ェ蜑阪〒繧エ繝ェ繧エ繝ェ繧ウ繝斐シ縺吶k
+ {
+ int tw =
+#if TEST_Direct3D9Ex
+ 288; // 32縺ョ蛟肴焚縺ォ縺吶k(繧ー繝ゥ繝輔↓繧医▲縺ヲ縺ッ2縺ョ縺ケ縺堺ケ励↓縺励↑縺縺ィ繝繝。縺九b)
+#else
+ this.sz逕サ蜒上し繧、繧コ.Width;
+#endif
+#if TEST_Direct3D9Ex
+ this.texture = new Texture( device, tw, this.sz逕サ蜒上し繧、繧コ.Height, 1, Usage.Dynamic, format, Pool.Default );
+#else
+ this.texture = new Texture(device.UnderlyingDevice, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height, 1, Usage.None, format, pool);
+#endif
+ BitmapData srcBufData = bitmap.LockBits(new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
+ DataRectangle destDataRectangle = texture.LockRectangle(0, LockFlags.Discard); // None
+#if TEST_Direct3D9Ex
+ byte[] filldata = null;
+ if ( tw > this.sz逕サ蜒上し繧、繧コ.Width )
+ {
+ filldata = new byte[ (tw - this.sz逕サ蜒上し繧、繧コ.Width) * 4 ];
+ }
+ for ( int y = 0; y < this.sz逕サ蜒上し繧、繧コ.Height; y++ )
+ {
+ IntPtr src_scan0 = (IntPtr) ( (Int64) srcBufData.Scan0 + y * srcBufData.Stride );
+ destDataRectangle.Data.WriteRange( src_scan0, this.sz逕サ蜒上し繧、繧コ.Width * 4 );
+ if ( tw > this.sz逕サ蜒上し繧、繧コ.Width )
+ {
+ destDataRectangle.Data.WriteRange( filldata );
+ }
+ }
+#else
+ IntPtr src_scan0 = (IntPtr)((Int64)srcBufData.Scan0);
+ destDataRectangle.Data.WriteRange(src_scan0, this.sz逕サ蜒上し繧、繧コ.Width * 4 * this.sz逕サ蜒上し繧、繧コ.Height);
+#endif
+ texture.UnlockRectangle(0);
+ bitmap.UnlockBits(srcBufData);
+ }
+ //Trace.TraceInformation( "CTExture() End: " );
+ }
+ catch
+ {
+ this.Dispose();
+ // throw new CTextureCreateFailedException( string.Format( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n{0}", str繝輔ぃ繧、繝ォ蜷 ) );
+ throw new CTextureCreateFailedException(string.Format("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n"));
+ }
+ }
+ // 繝。繧ス繝繝
+
+ // 2016.11.10 kairera0467 諡。蠑オ
+ // Rectangle繧剃スソ縺蝣エ蜷医∝コァ讓呵ェソ謨エ縺ョ縺溘a縺ォ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ョ蛟、繧偵◎縺ョ縺セ縺セ菴ソ縺縺ィ縺セ縺壹>縺薙→縺ォ縺ェ繧九◆繧√ヽectragle縺九i蟷繧貞叙蠕励@縺ヲ隱ソ謨エ繧偵☆繧九
+ public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y)
+ {
+ this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), y - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2), 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2), 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y)
+ {
+ this.t2D謠冗判(device, (int)x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), (int)y - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2), 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, (int)x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), (int)y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2), 1.0f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, (int)x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), (int)y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2), depth, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+
+ // 荳九r蝓コ貅悶↓縺励※謠冗判縺吶k(諡。螟ァ邇閠諷ョ)繝。繧ス繝繝峨r霑ス蜉縲 (AioiLight)
+ public void t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(Device device, int x, int y)
+ {
+ this.t2D謠冗判(device, x, y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, x, y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y)
+ {
+ this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y)
+ {
+ this.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(device, (int)x, (int)y);
+ }
+
+ public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, x - ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2)), y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(device, (int)x, (int)y, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y)
+ {
+ this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height), this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height), rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ //this.t2D謠冗判(devicek x, y, rc逕サ蜒丞縺ョ謠冗判鬆伜沺;
+ }
+
+
+ public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y)
+ {
+ this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y, RectangleF rc)
+ {
+ this.t2D謠冗判(device, x - (rc.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (rc.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳贋クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y, RectangleF rc)
+ {
+ this.t2D謠冗判(device, x - (rc.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y, 1f, rc);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳贋クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y)
+ {
+ this.t2D謠冗判(device, x - (rc蜈ィ逕サ蜒.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y, 1f, rc蜈ィ逕サ蜒);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, float x, float y)
+ {
+ this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, float x, float y, RectangleF rc)
+ {
+ this.t2D謠冗判(device, x - (rc.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (rc.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ謠冗判(Device device, RefPnt refpnt, float x, float y)
+ {
+ this.t2D諡。螟ァ邇閠諷ョ謠冗判(device, refpnt, x, y, rc蜈ィ逕サ蜒);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ謠冗判(Device device, RefPnt refpnt, float x, float y, Rectangle rect)
+ {
+ this.t2D諡。螟ァ邇閠諷ョ謠冗判(device, refpnt, x, y, 1f, rect);
+ }
+ public void t2D諡。螟ァ邇閠諷ョ謠冗判(Device device, RefPnt refpnt, float x, float y, float depth, Rectangle rect)
+ {
+ switch (refpnt)
+ {
+ case RefPnt.UpLeft:
+ this.t2D謠冗判(device, x, y, depth, rect);
+ break;
+ case RefPnt.Up:
+ this.t2D謠冗判(device, x - (rect.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y, depth, rect);
+ break;
+ case RefPnt.UpRight:
+ this.t2D謠冗判(device, x - rect.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X, y, depth, rect);
+ break;
+ case RefPnt.Left:
+ this.t2D謠冗判(device, x, y - (rect.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), depth, rect);
+ break;
+ case RefPnt.Center:
+ this.t2D謠冗判(device, x - (rect.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (rect.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), depth, rect);
+ break;
+ case RefPnt.Right:
+ this.t2D謠冗判(device, x - rect.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X, y - (rect.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), depth, rect);
+ break;
+ case RefPnt.DownLeft:
+ this.t2D謠冗判(device, x, y - rect.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y, depth, rect);
+ break;
+ case RefPnt.Down:
+ this.t2D謠冗判(device, x - (rect.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - rect.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y, depth, rect);
+ break;
+ case RefPnt.DownRight:
+ this.t2D謠冗判(device, x - rect.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X, y - rect.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y, depth, rect);
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ public enum RefPnt
+ {
+ UpLeft,
+ Up,
+ UpRight,
+ Left,
+ Center,
+ Right,
+ DownLeft,
+ Down,
+ DownRight,
+ }
+
+ ///
+ /// 繝繧ッ繧ケ繝√Ε繧 2D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ X 蠎ァ讓兌dot]シ峨
+ /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ Y 蠎ァ讓兌dot]シ峨
+ public void t2D謠冗判(Device device, int x, int y)
+ {
+ this.t2D謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D謠冗判(Device device, int x, int y, RectangleF rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, x, y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D謠冗判(Device device, float x, float y)
+ {
+ this.t2D謠冗判(device, (int)x, (int)y, 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D謠冗判(Device device, float x, float y, RectangleF rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D謠冗判(device, (int)x, (int)y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D謠冗判(Device device, float x, float y, float depth, RectangleF rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ if (this.texture == null)
+ return;
+
+ this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device);
+
+ if (this.fZ霆ク荳ュ蠢蝗櫁サ「 == 0f)
+ {
+ #region [ (A) 蝗櫁サ「縺ェ縺 ]
+ //-----------------
+ float f陬懈ュ」蛟、X = -0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ)
+ float f陬懈ュ」蛟、Y = -0.5f; //
+ float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width;
+ float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+ if (this.cvTransformedColoredVertexies == null)
+ this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4];
+
+ // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九
+
+ this.cvTransformedColoredVertexies[0].Position.X = x + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[0].Position.Y = y + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[0].Position.Z = depth;
+ this.cvTransformedColoredVertexies[0].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[0].Color = color;
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvTransformedColoredVertexies[1].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[1].Position.Y = y + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[1].Position.Z = depth;
+ this.cvTransformedColoredVertexies[1].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[1].Color = color;
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvTransformedColoredVertexies[2].Position.X = x + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[2].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[2].Position.Z = depth;
+ this.cvTransformedColoredVertexies[2].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[2].Color = color;
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.cvTransformedColoredVertexies[3].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[3].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[3].Position.Z = depth;
+ this.cvTransformedColoredVertexies[3].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[3].Color = color;
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、;
+
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = TransformedColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, in this.cvTransformedColoredVertexies);
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ #region [ (B) 蝗櫁サ「縺ゅj ]
+ //-----------------
+ float f陬懈ュ」蛟、X = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width % 2) == 0) ? -0.5f : 0f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ)
+ float f陬懈ュ」蛟、Y = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height % 2) == 0) ? -0.5f : 0f; // 3Dシ亥屓霆「縺吶kシ峨↑繧芽」懈ュ」縺ッ縺繧峨↑縺縲
+ float f荳ュ螟ョX = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width) / 2f;
+ float f荳ュ螟ョY = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height) / 2f;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+ if (this.cvPositionColoredVertexies == null)
+ this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4];
+
+ // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九
+
+ this.cvPositionColoredVertexies[0].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[0].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[0].Position.Z = depth;
+ this.cvPositionColoredVertexies[0].Color = color;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[1].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[1].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[1].Position.Z = depth;
+ this.cvPositionColoredVertexies[1].Color = color;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[2].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[2].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[2].Position.Z = depth;
+ this.cvPositionColoredVertexies[2].Color = color;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.cvPositionColoredVertexies[3].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[3].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[3].Position.Z = depth;
+ this.cvPositionColoredVertexies[3].Color = color;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、;
+
+ float n謠冗判鬆伜沺蜀X = x + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2.0f);
+ float n謠冗判鬆伜沺蜀Y = y + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2.0f);
+ var vc3遘サ蜍暮 = new Vector3(n謠冗判鬆伜沺蜀X - (((float)device.Viewport.Width) / 2f), -(n謠冗判鬆伜沺蜀Y - (((float)device.Viewport.Height) / 2f)), 0f);
+
+ var matrix = Matrix.Identity * Matrix.Scaling(this.vc諡。螟ァ邵ョ蟆丞咲紫);
+ matrix *= Matrix.RotationZ(this.fZ霆ク荳ュ蠢蝗櫁サ「);
+ matrix *= Matrix.Translation(vc3遘サ蜍暮);
+ device.SetTransform(TransformState.World, matrix);
+
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = PositionColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies);
+ //-----------------
+ #endregion
+ }
+ }
+ public void t2D謠冗判(Device device, int x, int y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ if (this.texture == null)
+ return;
+
+ this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device);
+
+ if (this.fZ霆ク荳ュ蠢蝗櫁サ「 == 0f)
+ {
+ #region [ (A) 蝗櫁サ「縺ェ縺 ]
+ //-----------------
+ float f陬懈ュ」蛟、X = -0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ)
+ float f陬懈ュ」蛟、Y = -0.5f; //
+ float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width;
+ float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+ if (this.cvTransformedColoredVertexies == null)
+ this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4];
+
+ // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九
+
+ this.cvTransformedColoredVertexies[0].Position.X = x + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[0].Position.Y = y + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[0].Position.Z = depth;
+ this.cvTransformedColoredVertexies[0].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[0].Color = color;
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvTransformedColoredVertexies[1].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[1].Position.Y = y + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[1].Position.Z = depth;
+ this.cvTransformedColoredVertexies[1].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[1].Color = color;
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvTransformedColoredVertexies[2].Position.X = x + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[2].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[2].Position.Z = depth;
+ this.cvTransformedColoredVertexies[2].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[2].Color = color;
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.cvTransformedColoredVertexies[3].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X;
+ this.cvTransformedColoredVertexies[3].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y;
+ this.cvTransformedColoredVertexies[3].Position.Z = depth;
+ this.cvTransformedColoredVertexies[3].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[3].Color = color;
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、;
+
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = TransformedColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, in this.cvTransformedColoredVertexies);
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ #region [ (B) 蝗櫁サ「縺ゅj ]
+ //-----------------
+ float f陬懈ュ」蛟、X = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width % 2) == 0) ? -0.5f : 0f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ)
+ float f陬懈ュ」蛟、Y = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height % 2) == 0) ? -0.5f : 0f; // 3Dシ亥屓霆「縺吶kシ峨↑繧芽」懈ュ」縺ッ縺繧峨↑縺縲
+ float f荳ュ螟ョX = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width) / 2f;
+ float f荳ュ螟ョY = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height) / 2f;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+ if (this.cvPositionColoredVertexies == null)
+ this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4];
+
+ // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九
+
+ this.cvPositionColoredVertexies[0].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[0].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[0].Position.Z = depth;
+ this.cvPositionColoredVertexies[0].Color = color;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[1].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[1].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[1].Position.Z = depth;
+ this.cvPositionColoredVertexies[1].Color = color;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[2].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[2].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[2].Position.Z = depth;
+ this.cvPositionColoredVertexies[2].Color = color;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.cvPositionColoredVertexies[3].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X;
+ this.cvPositionColoredVertexies[3].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y;
+ this.cvPositionColoredVertexies[3].Position.Z = depth;
+ this.cvPositionColoredVertexies[3].Color = color;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、;
+
+ int n謠冗判鬆伜沺蜀X = x + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2);
+ int n謠冗判鬆伜沺蜀Y = y + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2);
+ var vc3遘サ蜍暮 = new Vector3(n謠冗判鬆伜沺蜀X - (((float)device.Viewport.Width) / 2f), -(n謠冗判鬆伜沺蜀Y - (((float)device.Viewport.Height) / 2f)), 0f);
+
+ var matrix = Matrix.Identity * Matrix.Scaling(this.vc諡。螟ァ邵ョ蟆丞咲紫);
+ matrix *= Matrix.RotationZ(this.fZ霆ク荳ュ蠢蝗櫁サ「);
+ matrix *= Matrix.Translation(vc3遘サ蜍暮);
+ device.SetTransform(TransformState.World, matrix);
+
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = PositionColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies);
+ //-----------------
+ #endregion
+ }
+ }
+ public void t2D荳贋ク句渚霆「謠冗判(Device device, int x, int y)
+ {
+ this.t2D荳贋ク句渚霆「謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D荳贋ク句渚霆「謠冗判(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D荳贋ク句渚霆「謠冗判(device, x, y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, int x, int y)
+ {
+ this.t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, float x, float y)
+ {
+ this.t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(device, x, y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, float x, float y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ if (this.texture == null)
+ throw new InvalidOperationException("繝繧ッ繧ケ繝√Ε縺ッ逕滓舌&繧後※縺縺セ縺帙s縲");
+
+ this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device);
+
+ float fx = x * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.X - 0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ)
+ float fy = y * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.Y - 0.5f; //
+ float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X * CTexture.f逕サ髱「豈皮紫;
+ float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y * CTexture.f逕サ髱「豈皮紫;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+
+ if (this.cvTransformedColoredVertexies == null)
+ this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4];
+
+ // 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝医ョ驥冗肇繧呈椛縺医k縺溘a new 縺ッ菴ソ繧上↑縺縲
+
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蜿ウU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、;
+ this.cvTransformedColoredVertexies[0].Position.X = fx;
+ this.cvTransformedColoredVertexies[0].Position.Y = fy;
+ this.cvTransformedColoredVertexies[0].Position.Z = depth;
+ this.cvTransformedColoredVertexies[0].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[0].Color = color;
+
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蟾ヲU蛟、; // 蜿ウ荳 竊 蜿ウ荳
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、;
+ this.cvTransformedColoredVertexies[1].Position.X = fx + w;
+ this.cvTransformedColoredVertexies[1].Position.Y = fy;
+ this.cvTransformedColoredVertexies[1].Position.Z = depth;
+ this.cvTransformedColoredVertexies[1].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[1].Color = color;
+
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蜿ウU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、;
+ this.cvTransformedColoredVertexies[2].Position.X = fx;
+ this.cvTransformedColoredVertexies[2].Position.Y = fy + h;
+ this.cvTransformedColoredVertexies[2].Position.Z = depth;
+ this.cvTransformedColoredVertexies[2].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[2].Color = color;
+
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蟾ヲU蛟、; // 蜿ウ荳 竊 蜿ウ荳
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、;
+ this.cvTransformedColoredVertexies[3].Position.X = fx + w;
+ this.cvTransformedColoredVertexies[3].Position.Y = fy + h;
+ this.cvTransformedColoredVertexies[3].Position.Z = depth;
+ this.cvTransformedColoredVertexies[3].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[3].Color = color;
+
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = TransformedColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, this.cvTransformedColoredVertexies);
+ }
+ public void t2D荳贋ク句渚霆「謠冗判(Device device, int x, int y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ if (this.texture == null)
+ throw new InvalidOperationException("繝繧ッ繧ケ繝√Ε縺ッ逕滓舌&繧後※縺縺セ縺帙s縲");
+
+ this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device);
+
+ float fx = x * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.X - 0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ)
+ float fy = y * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.Y - 0.5f; //
+ float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X * CTexture.f逕サ髱「豈皮紫;
+ float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y * CTexture.f逕サ髱「豈皮紫;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+ if (this.cvTransformedColoredVertexies == null)
+ this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4];
+
+ // 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝医ョ驥冗肇繧呈椛縺医k縺溘a new 縺ッ菴ソ繧上↑縺縲
+
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳
+ this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳儀蛟、;
+ this.cvTransformedColoredVertexies[0].Position.X = fx;
+ this.cvTransformedColoredVertexies[0].Position.Y = fy;
+ this.cvTransformedColoredVertexies[0].Position.Z = depth;
+ this.cvTransformedColoredVertexies[0].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[0].Color = color;
+
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; // 蜿ウ荳 竊 蜿ウ荳
+ this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳儀蛟、;
+ this.cvTransformedColoredVertexies[1].Position.X = fx + w;
+ this.cvTransformedColoredVertexies[1].Position.Y = fy;
+ this.cvTransformedColoredVertexies[1].Position.Z = depth;
+ this.cvTransformedColoredVertexies[1].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[1].Color = color;
+
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳
+ this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳碍蛟、;
+ this.cvTransformedColoredVertexies[2].Position.X = fx;
+ this.cvTransformedColoredVertexies[2].Position.Y = fy + h;
+ this.cvTransformedColoredVertexies[2].Position.Z = depth;
+ this.cvTransformedColoredVertexies[2].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[2].Color = color;
+
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; // 蜿ウ荳 竊 蜿ウ荳
+ this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳碍蛟、;
+ this.cvTransformedColoredVertexies[3].Position.X = fx + w;
+ this.cvTransformedColoredVertexies[3].Position.Y = fy + h;
+ this.cvTransformedColoredVertexies[3].Position.Z = depth;
+ this.cvTransformedColoredVertexies[3].Position.W = 1.0f;
+ this.cvTransformedColoredVertexies[3].Color = color;
+
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = TransformedColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvTransformedColoredVertexies);
+ }
+ public void t2D荳贋ク句渚霆「謠冗判(Device device, Point pt)
+ {
+ this.t2D荳贋ク句渚霆「謠冗判(device, pt.X, pt.Y, 1f, this.rc蜈ィ逕サ蜒);
+ }
+ public void t2D荳贋ク句渚霆「謠冗判(Device device, Point pt, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D荳贋ク句渚霆「謠冗判(device, pt.X, pt.Y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+ public void t2D荳贋ク句渚霆「謠冗判(Device device, Point pt, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ this.t2D荳贋ク句渚霆「謠冗判(device, pt.X, pt.Y, depth, rc逕サ蜒丞縺ョ謠冗判鬆伜沺);
+ }
+
+ public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(int x, int y)
+ {
+ return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3((float)x, (float)y, 0f));
+ }
+ public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(float x, float y)
+ {
+ return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3(x, y, 0f));
+ }
+ public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(Point pt隲也炊逕サ髱「蠎ァ讓)
+ {
+ return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3(pt隲也炊逕サ髱「蠎ァ讓.X, pt隲也炊逕サ髱「蠎ァ讓.Y, 0.0f));
+ }
+ public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(Vector2 v2隲也炊逕サ髱「蠎ァ讓)
+ {
+ return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3(v2隲也炊逕サ髱「蠎ァ讓, 0f));
+ }
+ public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(Vector3 v3隲也炊逕サ髱「蠎ァ讓)
+ {
+ return new Vector3(
+ (v3隲也炊逕サ髱「蠎ァ讓.X - (CTexture.sz隲也炊逕サ髱「.Width / 2.0f)) * CTexture.f逕サ髱「豈皮紫,
+ (-(v3隲也炊逕サ髱「蠎ァ讓.Y - (CTexture.sz隲也炊逕サ髱「.Height / 2.0f)) * CTexture.f逕サ髱「豈皮紫),
+ v3隲也炊逕サ髱「蠎ァ讓.Z);
+ }
+
+ ///
+ /// 繝繧ッ繧ケ繝√Ε繧 3D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲
+ ///
+ public void t3D謠冗判(Device device, Matrix mat)
+ {
+ this.t3D謠冗判(device, mat, this.rc蜈ィ逕サ蜒);
+ }
+ public void t3D謠冗判(Device device, Matrix mat, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ if (this.texture == null)
+ return;
+
+ float x = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width) / 2f;
+ float y = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height) / 2f;
+ float z = 0.0f;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+ if (this.cvPositionColoredVertexies == null)
+ this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4];
+
+ // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九
+
+ this.cvPositionColoredVertexies[0].Position.X = -x;
+ this.cvPositionColoredVertexies[0].Position.Y = y;
+ this.cvPositionColoredVertexies[0].Position.Z = z;
+ this.cvPositionColoredVertexies[0].Color = color;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[1].Position.X = x;
+ this.cvPositionColoredVertexies[1].Position.Y = y;
+ this.cvPositionColoredVertexies[1].Position.Z = z;
+ this.cvPositionColoredVertexies[1].Color = color;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[2].Position.X = -x;
+ this.cvPositionColoredVertexies[2].Position.Y = -y;
+ this.cvPositionColoredVertexies[2].Position.Z = z;
+ this.cvPositionColoredVertexies[2].Color = color;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.cvPositionColoredVertexies[3].Position.X = x;
+ this.cvPositionColoredVertexies[3].Position.Y = -y;
+ this.cvPositionColoredVertexies[3].Position.Z = z;
+ this.cvPositionColoredVertexies[3].Color = color;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device);
+
+ device.SetTransform(TransformState.World, mat);
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = PositionColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies);
+ }
+
+ public void t3D蟾ヲ荳雁渕貅匁緒逕サ(Device device, Matrix mat)
+ {
+ this.t3D蟾ヲ荳雁渕貅匁緒逕サ(device, mat, this.rc蜈ィ逕サ蜒);
+ }
+ ///
+ /// 笳玖ヲ壽嶌
+ /// SlimDX.Matrix mat = SlimDX.Matrix.Identity;
+ /// mat *= SlimDX.Matrix.Translation( x, y, z );
+ /// 縲稽at =縲阪〒縺ッ縺ェ縺上稽at *=縲阪〒縺ゅk縺薙→繧貞ソ倥l縺ェ縺縺薙→縲
+ ///
+ public void t3D蟾ヲ荳雁渕貅匁緒逕サ(Device device, Matrix mat, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺)
+ {
+ //縺ィ繧翫≠縺医★陬懈ュ」蛟、縺ェ縺ゥ縺ッ辟。縺励ゅ↓縺励※繧ゆスソ縺讖滉シ壼ー代↑縺輔◎縺縺縺ェ繝シ
+ if (this.texture == null)
+ return;
+
+ float x = 0.0f;
+ float y = 0.0f;
+ float z = 0.0f;
+ float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width);
+ float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height);
+ this.color4.Alpha = ((float)this._opacity) / 255f;
+ int color = this.color4.ToArgb();
+
+ if (this.cvPositionColoredVertexies == null)
+ this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4];
+
+ // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九
+
+ this.cvPositionColoredVertexies[0].Position.X = -x;
+ this.cvPositionColoredVertexies[0].Position.Y = y;
+ this.cvPositionColoredVertexies[0].Position.Z = z;
+ this.cvPositionColoredVertexies[0].Color = color;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[1].Position.X = x;
+ this.cvPositionColoredVertexies[1].Position.Y = y;
+ this.cvPositionColoredVertexies[1].Position.Z = z;
+ this.cvPositionColoredVertexies[1].Color = color;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、;
+
+ this.cvPositionColoredVertexies[2].Position.X = -x;
+ this.cvPositionColoredVertexies[2].Position.Y = -y;
+ this.cvPositionColoredVertexies[2].Position.Z = z;
+ this.cvPositionColoredVertexies[2].Color = color;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、;
+ this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.cvPositionColoredVertexies[3].Position.X = x;
+ this.cvPositionColoredVertexies[3].Position.Y = -y;
+ this.cvPositionColoredVertexies[3].Position.Z = z;
+ this.cvPositionColoredVertexies[3].Color = color;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、;
+ this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、;
+
+ this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device);
+
+ device.SetTransform(TransformState.World, mat);
+ device.SetTexture(0, this.texture);
+ device.VertexFormat = PositionColoredTexturedVertex.Format;
+ device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies);
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if (!this.bDispose螳御コ貂医∩)
+ {
+ // 繝繧ッ繧ケ繝√Ε縺ョ遐エ譽
+ if (this.texture != null)
+ {
+ this.texture.Dispose();
+ this.texture = null;
+ }
+
+ this.bDispose螳御コ貂医∩ = true;
+ }
+ }
+ //-----------------
+ #endregion
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private int _opacity;
+ private bool bDispose螳御コ貂医∩;
+ private PositionColoredTexturedVertex[] cvPositionColoredVertexies;
+ protected TransformedColoredTexturedVertex[] cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[]
+ {
+ new TransformedColoredTexturedVertex(),
+ new TransformedColoredTexturedVertex(),
+ new TransformedColoredTexturedVertex(),
+ new TransformedColoredTexturedVertex(),
+ };
+ private const Pool poolvar = // 2011.4.25 yyagi
+#if TEST_Direct3D9Ex
+ Pool.Default;
+#else
+ Pool.Managed;
+#endif
+ // byte[] _txData;
+ static object lockobj = new object();
+
+ ///
+ /// 縺ゥ繧後°荳縺、縺梧怏蜉ケ縺ォ縺ェ繧翫∪縺吶
+ ///
+ /// Direct3D縺ョ繝繝舌う繧ケ
+ private void t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(Device device)
+ {
+ if (this.b蜉邂怜粋謌)
+ {
+ device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha); // 5
+ device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One); // 2
+ }
+ else if (this.b荵礼ョ怜粋謌)
+ {
+ //蜿り:http://sylphylunar.seesaa.net/article/390331341.html
+ //C++縺九i蠑輔▲蠑オ縺」縺ヲ縺阪◆縺ョ縺ァ縺。繧縺」縺ィ荳榊ョ峨
+ device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.DestinationColor);
+ device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.Zero);
+ }
+ else if (this.b貂帷ョ怜粋謌)
+ {
+ //蜿り:http://www3.pf-x.net/~chopper/home2/DirectX/MD20.html
+ device.SetRenderState(RenderState.BlendOperation, SlimDX.Direct3D9.BlendOperation.Subtract);
+ device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.One);
+ device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One);
+ }
+ else if (this.b繧ケ繧ッ繝ェ繝シ繝ウ蜷域)
+ {
+ //蜿り:http://sylphylunar.seesaa.net/article/390331341.html
+ //C++縺九i蠑輔▲蠑オ縺」縺ヲ縺阪◆縺ョ縺ァ縺。繧縺」縺ィ荳榊ョ峨
+ device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.InverseDestinationColor);
+ device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One);
+ }
+ else
+ {
+ device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha); // 5
+ device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.InverseSourceAlpha); // 6
+ }
+ }
+ private Size t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(Device device, Size sz謖螳壹し繧、繧コ)
+ {
+ var deviceCapabilities = device.Capabilities;
+ var deviceCapabilitiesTextureCaps = deviceCapabilities.TextureCaps;
+
+ bool b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K = (deviceCapabilitiesTextureCaps & TextureCaps.NonPow2Conditional) != 0;
+ bool b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 = (deviceCapabilitiesTextureCaps & TextureCaps.Pow2) != 0;
+ bool b豁」譁ケ蠖「縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺 = (deviceCapabilitiesTextureCaps & TextureCaps.SquareOnly) != 0;
+ int n譛螟ァ蟷 = deviceCapabilities.MaxTextureWidth;
+ int n譛螟ァ鬮 = deviceCapabilities.MaxTextureHeight;
+ var sz繧オ繧、繧コ = new Size(sz謖螳壹し繧、繧コ.Width, sz謖螳壹し繧、繧コ.Height);
+
+ if (b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 && !b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K)
+ {
+ // 蟷繧抵シ偵ョ邏ッ荵励↓縺吶k
+ int n = 1;
+ do
+ {
+ n *= 2;
+ }
+ while (n <= sz謖螳壹し繧、繧コ.Width);
+ sz謖螳壹し繧、繧コ.Width = n;
+
+ // 鬮倥&繧抵シ偵ョ邏ッ荵励↓縺吶k
+ n = 1;
+ do
+ {
+ n *= 2;
+ }
+ while (n <= sz謖螳壹し繧、繧コ.Height);
+ sz謖螳壹し繧、繧コ.Height = n;
+ }
+
+ if (sz謖螳壹し繧、繧コ.Width > n譛螟ァ蟷)
+ sz謖螳壹し繧、繧コ.Width = n譛螟ァ蟷;
+
+ if (sz謖螳壹し繧、繧コ.Height > n譛螟ァ鬮)
+ sz謖螳壹し繧、繧コ.Height = n譛螟ァ鬮;
+
+ if (b豁」譁ケ蠖「縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺)
+ {
+ if (sz繧オ繧、繧コ.Width > sz繧オ繧、繧コ.Height)
+ {
+ sz繧オ繧、繧コ.Height = sz繧オ繧、繧コ.Width;
+ }
+ else if (sz繧オ繧、繧コ.Width < sz繧オ繧、繧コ.Height)
+ {
+ sz繧オ繧、繧コ.Width = sz繧オ繧、繧コ.Height;
+ }
+ }
+
+ return sz繧オ繧、繧コ;
+ }
+
+
+ // 2012.3.21 縺輔i縺ェ繧 new 縺ョ逵∫払菴懈姶
+
+ protected Rectangle rc蜈ィ逕サ蜒; // 繝繧ッ繧ケ繝√Ε菴懊▲縺溘i縺ゅ→縺ッ荳榊、
+ public Color4 color4 = new Color4(1f, 1f, 1f, 1f); // 繧「繝ォ繝輔ぃ莉・螟悶ッ荳榊、
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureAutofold.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureAutofold.cs
new file mode 100644
index 00000000..34566f82
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureAutofold.cs
@@ -0,0 +1,390 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Diagnostics;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+using Device = SampleFramework.DeviceCache;
+
+namespace FDK
+{
+ ///
+ /// 邵ヲ髟キ_讓ェ髟キ縺ョ逕サ蜒上r閾ェ蜍輔〒謚倥j縺溘◆繧薙〒繝繧ッ繧ケ繝√Ε蛹悶☆繧気Texture縲
+ /// 萓九∴縺ー縲768x30 縺ョ繝繧ッ繧ケ繝√Ε繝輔ぃ繧、繝ォ縺悟・蜉帙&繧後◆繧峨
+ /// 蜀驛ィ縺ァ256x90 縺ェ縺ゥ縲2縺ョ縺ケ縺堺ケ励し繧、繧コ縺ォ蜿弱a繧九h縺縲∝驛ィ縺ァ繝繧ッ繧ケ繝√Ε逕サ蜒上r閾ェ蜍慕噪縺ォ謚倥j霑斐☆縲
+ /// 蠢隕√↓蠢懊§縺ヲ縲∵ュ」譁ケ蠖「繝繧ッ繧ケ繝√Ε縺ォ繧ゅ☆繧九
+ /// 縺セ縺溘》2D謠冗判縺ッ縲√◎縺ョ謚倥j霑斐@繧貞刈蜻ウ縺励※螳溯。後☆繧九
+ ///
+ public class CTextureAf : CTexture, IDisposable
+ {
+
+ ///
+ /// 謖螳壹&繧後◆逕サ蜒上ヵ繧。繧、繝ォ縺九i Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九
+ /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医
+ /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ public CTextureAf( Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k )
+ : this( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, Pool.Managed )
+ {
+ }
+
+ ///
+ /// 逕サ蜒上ヵ繧。繧、繝ォ縺九i繝繧ッ繧ケ繝√Ε繧堤函謌舌☆繧九
+ /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∫判蜒上ョ繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九
+ /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲
+ /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None 縺ォ縺ェ繧九
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪
+ /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医
+ /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲
+ /// 繝繧ッ繧ケ繝√Ε縺ョ邂。逅譁ケ豕輔
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ public CTextureAf( Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool )
+ {
+ MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool );
+ }
+
+
+
+
+ public new void MakeTexture( Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool )
+ {
+ if ( !File.Exists( str繝輔ぃ繧、繝ォ蜷 ) ) // #27122 2012.1.13 from: ImageInformation 縺ァ縺ッ FileNotFound 萓句、悶ッ霑斐▲縺ヲ縺薙↑縺縺ョ縺ァ縲√%縺薙〒閾ェ蛻縺ァ繝√ぉ繝繧ッ縺吶k縲ゅo縺九j繧縺吶>繝ュ繧ー縺ョ縺溘a縺ォ縲
+ throw new FileNotFoundException( string.Format( "繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲\n[{0}]", str繝輔ぃ繧、繝ォ蜷 ) );
+
+ Byte[] _txData = File.ReadAllBytes( str繝輔ぃ繧、繝ォ蜷 );
+ bool b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K = ( device.Capabilities.TextureCaps & TextureCaps.NonPow2Conditional ) != 0;
+ bool b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 = ( device.Capabilities.TextureCaps & TextureCaps.Pow2 ) != 0;
+ bool b豁」譁ケ蠖「縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺 = ( device.Capabilities.TextureCaps & TextureCaps.SquareOnly ) != 0;
+
+ // 縺昴b縺昴b縺薙s縺ェ譛驕ゥ蛹悶r縺励↑縺上※繧医>縺ョ縺ェ繧峨√&縺」縺輔→base縺ォ蜃ヲ逅繧貞ァ斐ュ縺ヲ邨ゆコ
+ if ( !b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 && b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K )
+ {
+ //Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": 譛驕ゥ蛹悶ッ荳崎ヲ√〒縺吶" );
+ base.MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool );
+ return;
+ }
+
+ var information = ImageInformation.FromMemory( _txData );
+ int orgWidth = information.Width, orgHeight = information.Height;
+ int w = orgWidth, h = orgHeight, foldtimes;
+
+ #region [ 謚倥j縺溘◆縺ソ縺ゅj縺ァ譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ縺後←縺縺ェ繧九°繧堤「コ隱阪☆繧(豁」譁ケ蠖「縺ォ縺吶k縺九ッ閠諷ョ縺帙★) ]
+ if ( orgWidth >= orgHeight ) // 讓ェ髟キ逕サ蜒上↑繧
+ {
+ this.b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk = true;
+ if ( !GetFoldedTextureSize( ref w, ref h, out foldtimes ) )
+ {
+//Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": 譛驕ゥ蛹悶r譁ュ蠢オ縲" );
+ base.MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool );
+ return;
+ }
+ }
+ else // 邵ヲ髟キ逕サ蜒上↑繧
+ {
+ this.b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk = false;
+ if ( !GetFoldedTextureSize( ref h, ref w, out foldtimes ) ) // 邵ヲ讓ェ蜈・繧梧崛縺医※蜻シ縺ウ蜃コ縺
+ {
+//Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": 譛驕ゥ蛹悶r譁ュ蠢オ縲" );
+ base.MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool );
+ return;
+ }
+ }
+ #endregion
+
+//Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": texture譛驕ゥ蛹也オ先棡: width=" + w + ", height=" + h + ", 謚倥j縺溘◆縺ソ蝗樊焚=" + foldtimes );
+ #region [ 謚倥j縺溘◆縺ソ繝繧ッ繧ケ繝√Ε逕サ蜒上r菴懊j縲√ユ繧ッ繧ケ繝√Ε逋サ骭イ縺吶k ]
+ // 繝舌う繝翫Μ(Byte驟榊)繧達itmap縺ォ螟画鋤
+ MemoryStream mms = new MemoryStream( _txData );
+ Bitmap bmpOrg = new Bitmap( mms );
+ mms.Close();
+
+ Bitmap bmpNew = new Bitmap( w, h );
+ Graphics g = Graphics.FromImage( bmpNew );
+
+ for ( int n = 0; n <= foldtimes; n++ )
+ {
+ if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk )
+ {
+ int x = n * w;
+ int currentHeight = n * orgHeight;
+ int currentWidth = ( n < foldtimes ) ? w : orgWidth - x;
+ Rectangle r = new Rectangle( x, 0, currentWidth, orgHeight );
+ Bitmap bmpTmp = bmpOrg.Clone( r, bmpOrg.PixelFormat ); // 縺薙%縺後懊ヨ繝ォ繝阪ャ繧ッ縺ォ縺ェ繧九h縺縺ェ繧峨∝セ梧律unsafe繧ウ繝シ繝峨↓縺吶k縲
+ g.DrawImage( bmpTmp, 0, currentHeight, currentWidth, orgHeight );
+ bmpTmp.Dispose();
+ }
+ else
+ {
+ int y = n * h;
+ int currentWidth = n * orgWidth;
+ int currentHeight = ( n < foldtimes ) ? h : orgHeight - y;
+ Rectangle r = new Rectangle( 0, y, orgWidth, currentHeight );
+ Bitmap bmpTmp = bmpOrg.Clone( r, bmpOrg.PixelFormat ); // 縺薙%縺後懊ヨ繝ォ繝阪ャ繧ッ縺ォ縺ェ繧九h縺縺ェ繧峨∝セ梧律unsafe繧ウ繝シ繝峨↓縺吶k縲
+ g.DrawImage( bmpTmp, currentWidth, 0, orgWidth, currentHeight );
+ bmpTmp.Dispose();
+ }
+ };
+ if ( b鮟偵r騾城℃縺吶k )
+ {
+ bmpNew.MakeTransparent( Color.Black );
+ }
+ g.Dispose();
+ g = null;
+ bmpOrg.Dispose();
+ bmpOrg = null;
+ base.MakeTexture( device, bmpNew, format, b鮟偵r騾城℃縺吶k, pool );
+ bmpNew.Dispose();
+ bmpNew = null;
+ #endregion
+
+ _orgWidth = orgWidth;
+ _orgHeight = orgHeight;
+ _foldtimes = foldtimes;
+ this.sz逕サ蜒上し繧、繧コ = new Size( orgWidth, orgHeight );
+ }
+
+ ///
+ /// 讓ェ髟キ逕サ蜒上r驕ゥ蛻縺ェ繧オ繧、繧コ縺ォ謚倥j縺溘◆繧薙□縺ィ縺阪ョ譛驕ゥ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧貞セ励k縲
+ /// 邵ヲ髟キ逕サ蜒上↓蟇セ縺励※縺ッ縲『idth/height繧貞・繧梧崛縺医※蜻シ縺ウ蜃コ縺吶%縺ィ縲
+ ///
+ ///
+ ///
+ ///
+ ///
+ private bool GetFoldedTextureSize( ref int width, ref int height, out int foldtimes )
+ {
+ int orgWidth = width, orgHeight = height;
+
+ #region [ width縺後2縺ョ縺ケ縺堺ケ励°繧峨←繧後¥繧峨>貅「繧後※縺繧九°遒コ隱 ]
+ int pow = 1;
+ while ( orgWidth >= pow )
+ {
+ pow *= 2;
+ }
+ pow /= 2;
+ #endregion
+ #region [ 縺セ縺壹2縺ョ縺ケ縺堺ケ励°繧峨≠縺オ繧後k蛻繧呈釜繧願ソ斐@縺ヲ縲2縺ョ縺ケ縺堺ケ励ョ豁」譁ケ蠖「繧オ繧、繧コ縺ォ蜿弱∪繧九°繧堤「コ隱 ]
+ foldtimes = ( orgWidth == pow ) ? 0 : 1; // 2縺ョ縺ケ縺堺ケ励°繧峨ョ貅「繧後′縺ゅl縺ー縲√∪縺壹◎縺ョ貅「繧悟縺ァ1蝗樊釜繧顔糞繧
+ if ( foldtimes != 0 )
+ {
+//Debug.WriteLine( "pow縺。繧縺縺ゥ縺ァ縺ッ縺ェ縺縺ョ縺ァ縲∵コ「繧後≠繧翫ゅ∪縺壹ッ1蝗樊釜繧翫◆縺溘縲" );
+ // 隧ヲ縺励↓縲『idth繧恥ow縺ォ蛻繧願ゥー繧√1蝗樊釜繧願ソ斐@縺ヲ縺ソ繧九
+ // width>height繧堤カュ謖√@縺ヲ縺繧九↑繧峨√ユ繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ッ繧医j譛驕ゥ縺ェ迥カ諷九↓縺ェ縺」縺溘→縺縺縺薙→縺ォ縺ェ繧九
+ if ( pow <= orgHeight * 2 ) // 譁ーwidth > 譁ーheight繧堤カュ謖√〒縺阪↑縺上↑縺」縺溘↑繧
+ { // 譛驕ゥ蛹紋ク榊庄縺ィ縺ソ縺ェ縺励|ase縺ョ蜃ヲ逅縺ォ蟋斐ュ繧
+ return false;
+ }
+ }
+ #endregion
+ #region [ width > height 縺ァ縺ッ縺ェ縺上↑繧九∪縺ァ縲∵釜繧翫◆縺溘∩邯壹¢繧 ]
+ width = pow;
+ height = orgHeight * 2; // 蛻晄悄蛟、シ1蝗樊釜繧翫◆縺溘s縺迥カ諷
+ do
+ {
+ width /= 2;
+ foldtimes = ( orgWidth / width ) + ( ( orgWidth % width > 0 ) ? 1 : 0 ) - 1;
+ height = orgHeight * ( foldtimes + 1 );
+ } while ( width > height );
+ width *= 2;
+ foldtimes = ( orgWidth / width ) + ( ( orgWidth % width > 0 ) ? 1 : 0 ) - 1;
+ height = orgHeight * ( foldtimes + 1 );
+ #endregion
+
+ return true;
+ }
+
+
+
+ ///
+ /// 繝繧ッ繧ケ繝√Ε繧 2D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ X 蠎ァ讓兌dot]シ峨
+ /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ Y 蠎ァ讓兌dot]シ峨
+ public new void t2D謠冗判( Device device, int x, int y )
+ {
+#if TEST_FOLDTEXTURE
+ base.t2D謠冗判( device, x, y, 1f, rc蜈ィ逕サ蜒 );
+#else
+ for ( int n = 0; n <= _foldtimes; n++ )
+ {
+ Rectangle r;
+ if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk )
+ {
+ int currentHeight = n * _orgHeight;
+ r = new Rectangle( 0, currentHeight, this.rc蜈ィ逕サ蜒.Width, _orgHeight );
+ base.t2D謠冗判( device, x + n * this.rc蜈ィ逕サ蜒.Width, y, 1f, r );
+ }
+ else
+ {
+ int currentWidth = n * _orgWidth;
+ r = new Rectangle( currentWidth, 0, _orgWidth, this.rc蜈ィ逕サ蜒.Height );
+ base.t2D謠冗判( device, x, y + n * this.rc蜈ィ逕サ蜒.Height, 1f, r );
+ }
+ }
+#endif
+ }
+ public new void t2D謠冗判( Device device, int x, int y, Rectangle rc )
+ {
+ Rectangle r;
+ if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk )
+ {
+ int beginFold = rc.X / this.rc蜈ィ逕サ蜒.Width;
+ int endFold = ( rc.X + rc.Width ) / rc蜈ィ逕サ蜒.Width;
+ for ( int i = beginFold; i <= endFold; i++ )
+ {
+ if ( i > _foldtimes ) break;
+
+ int newRcY = i * _orgHeight + rc.Y;
+ int newRcX = ( i == beginFold ) ? ( rc.X % this.rc蜈ィ逕サ蜒.Width ) : 0;
+ int newRcWidth = ( newRcX + rc.Width > rc蜈ィ逕サ蜒.Width ) ? rc蜈ィ逕サ蜒.Width - newRcX : rc.Width;
+
+ r = new Rectangle( newRcX, newRcY, newRcWidth, rc.Height );
+ base.t2D謠冗判( device, x, y, 1f, r );
+
+ int deltaX = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Width - rc.X : rc蜈ィ逕サ蜒.Width;
+ int newWidth = rc.Width - deltaX;
+ x += deltaX;
+ rc.Width = newWidth;
+ }
+ }
+ else
+ {
+ int beginFold = rc.Y / this.rc蜈ィ逕サ蜒.Height;
+ int endFold = ( rc.Y + rc.Height ) / rc蜈ィ逕サ蜒.Height;
+ for ( int i = beginFold; i <= endFold; i++ )
+ {
+ if ( i > _foldtimes ) break;
+
+ int newRcX = i * _orgWidth + rc.X;
+ int newRcY = ( i == beginFold ) ? ( rc.Y % this.rc蜈ィ逕サ蜒.Height ) : 0;
+ int newRcHeight = ( newRcY + rc.Height > rc蜈ィ逕サ蜒.Height ) ? rc蜈ィ逕サ蜒.Height - newRcY : rc.Height;
+
+ r = new Rectangle( newRcX, newRcY, rc.Width, newRcHeight );
+ base.t2D謠冗判( device, x, y, 1f, r );
+
+ int deltaY = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Height - rc.Y : rc蜈ィ逕サ蜒.Height;
+ int newHeight = rc.Height - deltaY;
+ y += deltaY;
+ rc.Height = newHeight;
+ }
+ }
+
+ }
+ public new void t2D謠冗判( Device device, float x, float y )
+ {
+ t2D謠冗判( device, (int) x, (int) y );
+ }
+ public void t2D謠冗判( Device device, float x, float y, Rectangle rc )
+ {
+ t2D謠冗判( device, (int) x, (int) y, rc );
+ }
+
+ ///
+ /// 繝繧ッ繧ケ繝√Ε繧 2D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲
+ ///
+ /// Direct3D9 繝繝舌う繧ケ縲
+ /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ X 蠎ァ讓兌dot]シ峨
+ /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ Y 蠎ァ讓兌dot]シ峨
+ public void t3D謠冗判( Device device, Matrix mat, float x, float y )
+ {
+#if TEST_FOLDTEXTURE
+ base.t2D謠冗判( device, x, y, 1f, rc蜈ィ逕サ蜒 );
+#else
+ for ( int n = 0; n <= _foldtimes; n++ )
+ {
+ Rectangle r;
+ if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk )
+ {
+ int currentHeight = n * _orgHeight;
+ r = new Rectangle( 0, currentHeight, this.rc蜈ィ逕サ蜒.Width, _orgHeight );
+ base.t3D謠冗判( device, mat );
+ }
+ else
+ {
+ int currentWidth = n * _orgWidth;
+ r = new Rectangle( currentWidth, 0, _orgWidth, this.rc蜈ィ逕サ蜒.Height );
+ base.t3D謠冗判( device, mat );
+ }
+ }
+#endif
+ }
+ public void t3D謠冗判( Device device, Matrix mat, float x, float y, Rectangle rc )
+ {
+ Rectangle r;
+ if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk )
+ {
+ int beginFold = rc.X / this.rc蜈ィ逕サ蜒.Width;
+ int endFold = ( rc.X + rc.Width ) / rc蜈ィ逕サ蜒.Width;
+ for ( int i = beginFold; i <= endFold; i++ )
+ {
+ if ( i > _foldtimes ) break;
+
+ int newRcY = i * _orgHeight + rc.Y;
+ int newRcX = ( i == beginFold ) ? ( rc.X % this.rc蜈ィ逕サ蜒.Width ) : 0;
+ int newRcWidth = ( newRcX + rc.Width > rc蜈ィ逕サ蜒.Width ) ? rc蜈ィ逕サ蜒.Width - newRcX : rc.Width;
+
+ r = new Rectangle( newRcX, newRcY, newRcWidth, rc.Height );
+ base.t3D謠冗判( device, mat, r );
+
+ int deltaX = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Width - rc.X : rc蜈ィ逕サ蜒.Width;
+ int newWidth = rc.Width - deltaX;
+ x += deltaX;
+ rc.Width = newWidth;
+ }
+ }
+ else
+ {
+ int beginFold = rc.Y / this.rc蜈ィ逕サ蜒.Height;
+ int endFold = ( rc.Y + rc.Height ) / rc蜈ィ逕サ蜒.Height;
+ for ( int i = beginFold; i <= endFold; i++ )
+ {
+ if ( i > _foldtimes ) break;
+
+ int newRcX = i * _orgWidth + rc.X;
+ int newRcY = ( i == beginFold ) ? ( rc.Y % this.rc蜈ィ逕サ蜒.Height ) : 0;
+ int newRcHeight = ( newRcY + rc.Height > rc蜈ィ逕サ蜒.Height ) ? rc蜈ィ逕サ蜒.Height - newRcY : rc.Height;
+
+ r = new Rectangle( newRcX, newRcY, rc.Width, newRcHeight );
+ base.t3D謠冗判( device, mat, r );
+
+ int deltaY = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Height - rc.Y : rc蜈ィ逕サ蜒.Height;
+ int newHeight = rc.Height - deltaY;
+ y += deltaY;
+ rc.Height = newHeight;
+ }
+ }
+
+ }
+
+ #region [ private ]
+ //-----------------
+ private bool b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk;
+
+ ///
+ /// 蜈逕サ蜒上ョWidth
+ ///
+ private int _orgWidth;
+ ///
+ /// 蜈逕サ蜒上ョHeight
+ ///
+ private int _orgHeight;
+ ///
+ /// 謚倥j縺溘◆縺ソ蝗樊焚
+ ///
+ private int _foldtimes;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureCreateFailedException.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureCreateFailedException.cs
new file mode 100644
index 00000000..1644e050
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureCreateFailedException.cs
@@ -0,0 +1,29 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.Serialization;
+
+namespace FDK
+{
+ ///
+ /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲
+ ///
+ public class CTextureCreateFailedException : Exception
+ {
+ public CTextureCreateFailedException()
+ {
+ }
+ public CTextureCreateFailedException( string message )
+ : base( message )
+ {
+ }
+ public CTextureCreateFailedException( SerializationInfo info, StreamingContext context )
+ : base( info, context )
+ {
+ }
+ public CTextureCreateFailedException( string message, Exception innerException )
+ : base( message, innerException )
+ {
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/ColoredVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/ColoredVertex.cs
new file mode 100644
index 00000000..9bfe05d9
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/ColoredVertex.cs
@@ -0,0 +1,120 @@
+サソ/*
+* Copyright (c) 2007-2010 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
+using System;
+using System.Globalization;
+using System.Runtime.InteropServices;
+
+using SlimDX;
+
+namespace FDK {
+ ///
+ /// Represents a vertex with a position and a color.
+ ///
+ [StructLayout(LayoutKind.Sequential)]
+ public struct ColoredVertex : IEquatable {
+ ///
+ /// Gets or sets the position of the vertex.
+ ///
+ public Vector3 Position {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the color of the vertex.
+ ///
+ public int Color {
+ get;
+ set;
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The position.
+ /// The color.
+ public ColoredVertex(Vector3 position, int color)
+ : this() {
+ Position = position;
+ Color = color;
+ }
+
+ ///
+ /// Implements operator ==.
+ ///
+ /// The left.
+ /// The right.
+ /// The result of the operator.
+ public static bool operator ==(ColoredVertex left, ColoredVertex right) {
+ return left.Equals(right);
+ }
+
+ ///
+ /// Implements operator !=.
+ ///
+ /// The left side of the operator.
+ /// The right side of the operator.
+ /// The result of the operator.
+ public static bool operator !=(ColoredVertex left, ColoredVertex right) {
+ return !(left == right);
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer that is the hash code for this instance.
+ ///
+ public override int GetHashCode() {
+ return Position.GetHashCode() + Color.GetHashCode();
+ }
+
+ ///
+ /// Indicates whether this instance and a specified object are equal.
+ ///
+ /// Another object to compare to.
+ ///
+ /// true if and this instance are the same type and represent the same value; otherwise, false.
+ ///
+ public override bool Equals(object obj) {
+ if (obj == null)
+ return false;
+
+ if (GetType() != obj.GetType())
+ return false;
+
+ return Equals((ColoredVertex)obj);
+ }
+
+ ///
+ /// Indicates whether the current object is equal to another object of the same type.
+ ///
+ /// An object to compare with this object.
+ ///
+ /// true if the current object is equal to the parameter; otherwise, false.
+ ///
+ public bool Equals(ColoredVertex other) {
+ return (Position == other.Position && Color == other.Color);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/PositionColoredTexturedVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/PositionColoredTexturedVertex.cs
new file mode 100644
index 00000000..ea0110cb
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/PositionColoredTexturedVertex.cs
@@ -0,0 +1,73 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Globalization;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+namespace FDK
+{
+ [StructLayout( LayoutKind.Sequential )]
+ public struct PositionColoredTexturedVertex : IEquatable
+ {
+ public Vector3 Position;
+ public int Color;
+ public Vector2 TextureCoordinates;
+
+ public static int SizeInBytes
+ {
+ get
+ {
+ return Marshal.SizeOf( typeof( PositionColoredTexturedVertex ) );
+ }
+ }
+ public static VertexFormat Format
+ {
+ get
+ {
+ return ( VertexFormat.Texture1 | VertexFormat.Diffuse | VertexFormat.Position );
+ }
+ }
+ public PositionColoredTexturedVertex( Vector3 position, int color, Vector2 textureCoordinates )
+ {
+ this = new PositionColoredTexturedVertex();
+ this.Position = position;
+ this.Color = color;
+ this.TextureCoordinates = textureCoordinates;
+ }
+
+ public static bool operator ==( PositionColoredTexturedVertex left, PositionColoredTexturedVertex right )
+ {
+ return left.Equals( right );
+ }
+ public static bool operator !=( PositionColoredTexturedVertex left, PositionColoredTexturedVertex right )
+ {
+ return !( left == right );
+ }
+ public override int GetHashCode()
+ {
+ return ( ( this.Position.GetHashCode() + this.Color.GetHashCode() ) + this.TextureCoordinates.GetHashCode() );
+ }
+ public override bool Equals( object obj )
+ {
+ if( obj == null )
+ {
+ return false;
+ }
+ if( base.GetType() != obj.GetType() )
+ {
+ return false;
+ }
+ return this.Equals( (PositionColoredTexturedVertex) obj );
+ }
+ public bool Equals( PositionColoredTexturedVertex other )
+ {
+ return ( ( ( this.Position == other.Position ) && ( this.Color == other.Color ) ) && ( this.TextureCoordinates == other.TextureCoordinates ) );
+ }
+ public override string ToString()
+ {
+ return string.Format( CultureInfo.CurrentCulture, "{0} ({1}, {2})", new object[] { this.Position.ToString(), System.Drawing.Color.FromArgb( this.Color ).ToString(), this.TextureCoordinates.ToString() } );
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TexturedVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TexturedVertex.cs
new file mode 100644
index 00000000..22356fdc
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TexturedVertex.cs
@@ -0,0 +1,120 @@
+サソ/*
+* Copyright (c) 2007-2010 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
+using System;
+using System.Globalization;
+using System.Runtime.InteropServices;
+
+using SlimDX;
+
+namespace FDK {
+ ///
+ /// Represents a vertex with a position and a texture coordinate.
+ ///
+ [StructLayout(LayoutKind.Sequential)]
+ public struct TexturedVertex : IEquatable {
+ ///
+ /// Gets or sets the position of the vertex.
+ ///
+ public Vector3 Position {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the texture coordinate for the vertex.
+ ///
+ public Vector2 TextureCoordinate {
+ get;
+ set;
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The position.
+ /// The color.
+ public TexturedVertex(Vector3 position, Vector2 textureCoordinate)
+ : this() {
+ Position = position;
+ TextureCoordinate = textureCoordinate;
+ }
+
+ ///
+ /// Implements operator ==.
+ ///
+ /// The left.
+ /// The right.
+ /// The result of the operator.
+ public static bool operator ==(TexturedVertex left, TexturedVertex right) {
+ return left.Equals(right);
+ }
+
+ ///
+ /// Implements operator !=.
+ ///
+ /// The left side of the operator.
+ /// The right side of the operator.
+ /// The result of the operator.
+ public static bool operator !=(TexturedVertex left, TexturedVertex right) {
+ return !(left == right);
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer that is the hash code for this instance.
+ ///
+ public override int GetHashCode() {
+ return Position.GetHashCode() + TextureCoordinate.GetHashCode();
+ }
+
+ ///
+ /// Indicates whether this instance and a specified object are equal.
+ ///
+ /// Another object to compare to.
+ ///
+ /// true if and this instance are the same type and represent the same value; otherwise, false.
+ ///
+ public override bool Equals(object obj) {
+ if (obj == null)
+ return false;
+
+ if (GetType() != obj.GetType())
+ return false;
+
+ return Equals((TexturedVertex)obj);
+ }
+
+ ///
+ /// Indicates whether the current object is equal to another object of the same type.
+ ///
+ /// An object to compare with this object.
+ ///
+ /// true if the current object is equal to the parameter; otherwise, false.
+ ///
+ public bool Equals(TexturedVertex other) {
+ return (Position == other.Position && TextureCoordinate == other.TextureCoordinate);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredTexturedVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredTexturedVertex.cs
new file mode 100644
index 00000000..44ad7770
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredTexturedVertex.cs
@@ -0,0 +1,73 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Globalization;
+using SlimDX;
+using SlimDX.Direct3D9;
+
+namespace FDK
+{
+ [StructLayout( LayoutKind.Sequential )]
+ public struct TransformedColoredTexturedVertex : IEquatable
+ {
+ public Vector4 Position;
+ public int Color;
+ public Vector2 TextureCoordinates;
+
+ public static int SizeInBytes
+ {
+ get
+ {
+ return Marshal.SizeOf( typeof( TransformedColoredTexturedVertex ) );
+ }
+ }
+ public static VertexFormat Format
+ {
+ get
+ {
+ return ( VertexFormat.Texture1 | VertexFormat.Diffuse | VertexFormat.PositionRhw );
+ }
+ }
+ public TransformedColoredTexturedVertex( Vector4 position, int color, Vector2 textureCoordinates )
+ {
+ this = new TransformedColoredTexturedVertex();
+ this.Position = position;
+ this.Color = color;
+ this.TextureCoordinates = textureCoordinates;
+ }
+
+ public static bool operator ==( TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right )
+ {
+ return left.Equals( right );
+ }
+ public static bool operator !=( TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right )
+ {
+ return !( left == right );
+ }
+ public override int GetHashCode()
+ {
+ return ( ( this.Position.GetHashCode() + this.Color.GetHashCode() ) + this.TextureCoordinates.GetHashCode() );
+ }
+ public override bool Equals( object obj )
+ {
+ if( obj == null )
+ {
+ return false;
+ }
+ if( base.GetType() != obj.GetType() )
+ {
+ return false;
+ }
+ return this.Equals( (TransformedColoredTexturedVertex) obj );
+ }
+ public bool Equals( TransformedColoredTexturedVertex other )
+ {
+ return ( ( ( this.Position == other.Position ) && ( this.Color == other.Color ) ) && ( this.TextureCoordinates == other.TextureCoordinates ) );
+ }
+ public override string ToString()
+ {
+ return string.Format( CultureInfo.CurrentCulture, "{0} ({1}, {2})", new object[] { this.Position.ToString(), System.Drawing.Color.FromArgb( this.Color ).ToString(), this.TextureCoordinates.ToString() } );
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredVertex.cs
new file mode 100644
index 00000000..71bd1a7d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredVertex.cs
@@ -0,0 +1,120 @@
+サソ/*
+* Copyright (c) 2007-2010 SlimDX Group
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
+using System;
+using System.Globalization;
+using System.Runtime.InteropServices;
+
+using SlimDX;
+
+namespace FDK {
+ ///
+ /// Represents a vertex with a pre-transformed position and a color.
+ ///
+ [StructLayout(LayoutKind.Sequential)]
+ public struct TransformedColoredVertex : IEquatable {
+ ///
+ /// Gets or sets the pre-transformed position of the vertex.
+ ///
+ public Vector4 Position {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the color of the vertex.
+ ///
+ public int Color {
+ get;
+ set;
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The position.
+ /// The color.
+ public TransformedColoredVertex(Vector4 position, int color)
+ : this() {
+ Position = position;
+ Color = color;
+ }
+
+ ///
+ /// Implements operator ==.
+ ///
+ /// The left.
+ /// The right.
+ /// The result of the operator.
+ public static bool operator ==(TransformedColoredVertex left, TransformedColoredVertex right) {
+ return left.Equals(right);
+ }
+
+ ///
+ /// Implements operator !=.
+ ///
+ /// The left side of the operator.
+ /// The right side of the operator.
+ /// The result of the operator.
+ public static bool operator !=(TransformedColoredVertex left, TransformedColoredVertex right) {
+ return !(left == right);
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer that is the hash code for this instance.
+ ///
+ public override int GetHashCode() {
+ return Position.GetHashCode() + Color.GetHashCode();
+ }
+
+ ///
+ /// Indicates whether this instance and a specified object are equal.
+ ///
+ /// Another object to compare to.
+ ///
+ /// true if and this instance are the same type and represent the same value; otherwise, false.
+ ///
+ public override bool Equals(object obj) {
+ if (obj == null)
+ return false;
+
+ if (GetType() != obj.GetType())
+ return false;
+
+ return Equals((TransformedColoredVertex)obj);
+ }
+
+ ///
+ /// Indicates whether the current object is equal to another object of the same type.
+ ///
+ /// An object to compare with this object.
+ ///
+ /// true if the current object is equal to the parameter; otherwise, false.
+ ///
+ public bool Equals(TransformedColoredVertex other) {
+ return (Position == other.Position && Color == other.Color);
+ }
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/05.DirectShow/CDStoWAVFileImage.cs b/FDK19/繧ウ繝シ繝/05.DirectShow/CDStoWAVFileImage.cs
new file mode 100644
index 00000000..9a1bbbab
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/05.DirectShow/CDStoWAVFileImage.cs
@@ -0,0 +1,198 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using DirectShowLib;
+using SharpDX.Multimedia;
+
+namespace FDK
+{
+ public class CDStoWAVFileImage
+ {
+ ///
+ /// 謖螳壹&繧後◆蜍慕判繝輔ぃ繧、繝ォ縺九i髻ウ螢ー縺ョ縺ソ繧偵お繝ウ繧ウ繝シ繝峨@縲仝AV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク繧剃ス懈舌@縺ヲ霑斐☆縲
+ ///
+ public static void t螟画鋤( string fileName, out byte[] wavFileImage )
+ {
+ int hr = 0;
+
+ IGraphBuilder graphBuilder = null;
+
+ try
+ {
+ graphBuilder = (IGraphBuilder) new FilterGraph();
+
+ #region [ 繧ェ繝シ繝繧」繧ェ逕ィ繧オ繝ウ繝励Ν繧ー繝ゥ繝舌ョ菴懈舌→霑ス蜉縲]
+ //-----------------
+ ISampleGrabber sampleGrabber = null;
+ try
+ {
+ sampleGrabber = (ISampleGrabber) new SampleGrabber();
+
+
+ // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌ョ繝。繝繧」繧「繧ソ繧、繝励ョ險ュ螳壹
+
+ var mediaType = new AMMediaType() {
+ majorType = MediaType.Audio,
+ subType = MediaSubType.PCM,
+ formatType = FormatType.WaveEx,
+ };
+ try
+ {
+ hr = sampleGrabber.SetMediaType( mediaType );
+ DsError.ThrowExceptionForHR( hr );
+ }
+ finally
+ {
+ if( mediaType != null )
+ DsUtils.FreeAMMediaType( mediaType );
+ }
+
+
+ // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌ョ繝舌ャ繝輔ぃ繝ェ繝ウ繧ー繧呈怏蜉ケ縺ォ縺吶k縲
+
+ hr = sampleGrabber.SetBufferSamples( true );
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌↓繧ウ繝シ繝ォ繝舌ャ繧ッ繧定ソス蜉縺吶k縲
+
+ sampleGrabberProc = new CSampleGrabberCallBack();
+ hr = sampleGrabber.SetCallback( sampleGrabberProc, 1 ); // 1:繧ウ繝シ繝ォ繝舌ャ繧ッ縺ョ BufferCB() 繝。繧ス繝繝峨ョ譁ケ繧貞他縺ウ蜃コ縺吶
+
+
+ // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌r繧ー繝ゥ繝輔↓霑ス蜉縺吶k縲
+
+ hr = graphBuilder.AddFilter( (IBaseFilter) sampleGrabber, "SampleGrabber for Audio/PCM" );
+ DsError.ThrowExceptionForHR( hr );
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref sampleGrabber );
+ }
+ //-----------------
+ #endregion
+
+ var e = new DirectShowLib.DsROTEntry( graphBuilder );
+
+ // fileName 縺九i繧ー繝ゥ繝輔r閾ェ蜍慕函謌舌
+
+ hr = graphBuilder.RenderFile( fileName, null ); // IMediaControl.RenderFile() 縺ッ謗ィ螂ィ縺輔l縺ェ縺
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧帝勁蜴サ縲
+
+ CDirectShow.t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺吶k( graphBuilder ); // 繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull縺ォ螟峨∴繧九h繧雁燕縺ォ螳溯。後☆繧九%縺ィ縲ゑシCDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧() 縺ョ荳ュ縺ァ荳蠎ヲ蜀咲函縺吶k縺ョ縺ァ縲√◎縺ョ縺ィ縺阪↓Active繧ヲ繧」繝ウ繝峨え縺瑚。ィ遉コ縺輔l縺ヲ縺励∪縺縺溘a縲ゑシ
+
+
+ // 繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧 NullRenderer 縺ォ鄂ョ謠帙
+
+ WaveFormat wfx;
+ byte[] wfx諡。蠑オ鬆伜沺;
+ CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧( graphBuilder, out wfx, out wfx諡。蠑オ鬆伜沺 );
+
+
+ // 蝓コ貅悶け繝ュ繝繧ッ繧 NULLシ域怙鬮倬滂シ峨↓險ュ螳壹☆繧九
+
+ IMediaFilter mediaFilter = graphBuilder as IMediaFilter;
+ mediaFilter.SetSyncSource( null );
+ mediaFilter = null;
+
+
+ // 繝。繝「繝ェ繧ケ繝医Μ繝シ繝縺ォ繝繧ウ繝シ繝峨ョ繝シ繧ソ繧貞コ蜉帙☆繧九
+
+ sampleGrabberProc.MemoryStream = new MemoryStream(); // CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧() 縺ァ荳蠎ヲ蜀咲函縺励※縺繧九ョ縺ァ縲√せ繝医Μ繝シ繝繧偵け繝ェ繧「縺吶k縲
+ var ms = sampleGrabberProc.MemoryStream;
+ var bw = new BinaryWriter( ms );
+ bw.Write( new byte[] { 0x52, 0x49, 0x46, 0x46 } ); // 'RIFF'
+ bw.Write( (UInt32) 0 ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8 [byte]シ帑サ翫ッ荳肴弱↑縺ョ縺ァ蠕後〒荳頑嶌縺阪☆繧九
+ bw.Write( new byte[] { 0x57, 0x41, 0x56, 0x45 } ); // 'WAVE'
+ bw.Write( new byte[] { 0x66, 0x6D, 0x74, 0x20 } ); // 'fmt '
+ bw.Write( (UInt32) ( 16 + ( ( wfx諡。蠑オ鬆伜沺.Length > 0 ) ? ( 2/*sizeof(WAVEFORMATEX.cbSize)*/ + wfx諡。蠑オ鬆伜沺.Length ) : 0 ) ) ); // fmt繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte]
+ bw.Write( (UInt16) wfx.Encoding); // 繝輔か繝シ繝槭ャ繝IDシ医Μ繝九いPCM縺ェ繧1シ
+ bw.Write( (UInt16) wfx.Channels ); // 繝√Ε繝ウ繝阪Ν謨ー
+ bw.Write( (UInt32) wfx.SampleRate); // 繧オ繝ウ繝励Μ繝ウ繧ー繝ャ繝シ繝
+ bw.Write( (UInt32) wfx.AverageBytesPerSecond ); // 繝繝シ繧ソ騾溷コヲ
+ bw.Write( (UInt16) wfx.BlockAlign); // 繝悶Ο繝繧ッ繧オ繧、繧コ
+ bw.Write( (UInt16) wfx.BitsPerSample ); // 繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝薙ャ繝域焚
+ if( wfx諡。蠑オ鬆伜沺.Length > 0 )
+ {
+ bw.Write( (UInt16) wfx諡。蠑オ鬆伜沺.Length ); // 諡。蠑オ鬆伜沺縺ョ繧オ繧、繧コ[byte]
+ bw.Write( wfx諡。蠑オ鬆伜沺 ); // 諡。蠑オ繝繝シ繧ソ
+ }
+ bw.Write( new byte[] { 0x64, 0x61, 0x74, 0x61 } ); // 'data'
+ int nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ = (int) ms.Position;
+ bw.Write( (UInt32) 0 ); // data繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte]シ帑サ翫ッ荳肴弱↑縺ョ縺ァ蠕後〒荳頑嶌縺阪☆繧九
+
+ #region [ 蜀咲函繧帝幕蟋九@縲∫オゆコ繧貞セ縺、縲- 蜀咲函荳ュ縲《ampleGrabberProc.MemoryStream 縺ォ PCM 繝繝シ繧ソ縺瑚塘遨阪&繧後※縺縺上]
+ //-----------------
+ IMediaControl mediaControl = graphBuilder as IMediaControl;
+ mediaControl.Run(); // 蜀咲函髢句ァ
+
+ IMediaEvent mediaEvent = graphBuilder as IMediaEvent;
+ EventCode eventCode;
+ hr = mediaEvent.WaitForCompletion( -1, out eventCode );
+ DsError.ThrowExceptionForHR( hr );
+ if( eventCode != EventCode.Complete )
+ throw new Exception( "蜀咲函蠕縺。縺ォ螟ア謨励@縺セ縺励◆縲" );
+
+ mediaControl.Stop();
+ mediaEvent = null;
+ mediaControl = null;
+ //-----------------
+ #endregion
+
+ bw.Seek( 4, SeekOrigin.Begin );
+ bw.Write( (UInt32) ms.Length - 8 ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8 [byte]
+
+ bw.Seek( nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ, SeekOrigin.Begin );
+ bw.Write( (UInt32) ms.Length - ( nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ + 4 ) ); // data繝√Ε繝ウ繧ッ繧オ繧、繧コ [byte]
+
+
+ // 蜃コ蜉帙◎縺ョシ偵r菴懈舌
+
+ wavFileImage = ms.ToArray();
+
+
+ // 邨ゆコ蜃ヲ逅縲
+
+ bw.Close();
+ sampleGrabberProc.Dispose(); // ms.Close()
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref graphBuilder );
+ }
+ }
+
+ #region [ private ]
+ //-----------------
+ private class CSampleGrabberCallBack : ISampleGrabberCB, IDisposable
+ {
+ public MemoryStream MemoryStream = new MemoryStream();
+
+ public int BufferCB( double SampleTime, IntPtr pBuffer, int BufferLen )
+ {
+ var bytes = new byte[ BufferLen ];
+ Marshal.Copy( pBuffer, bytes, 0, BufferLen ); // unmanage 竊 manage
+ this.MemoryStream.Write( bytes, 0, BufferLen ); // byte[] 竊 Stream
+ return CWin32.S_OK;
+ }
+ public int SampleCB( double SampleTime, IMediaSample pSample )
+ {
+ throw new NotImplementedException( "螳溯」縺輔l縺ヲ縺縺セ縺帙s縲" );
+ }
+
+ public void Dispose()
+ {
+ this.MemoryStream.Close();
+ }
+ }
+ private static CSampleGrabberCallBack sampleGrabberProc = null;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/05.DirectShow/CDirectShow.cs b/FDK19/繧ウ繝シ繝/05.DirectShow/CDirectShow.cs
new file mode 100644
index 00000000..b7ca2f2d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/05.DirectShow/CDirectShow.cs
@@ -0,0 +1,1610 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.IO;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Threading;
+using SlimDX;
+using SlimDX.Direct3D9;
+using SharpDX.Multimedia;
+using DirectShowLib;
+
+namespace FDK
+{
+ ///
+ /// DirectShow繧堤畑縺縺溘け繝ェ繝繝暦シ亥虚逕サシ矩浹螢ーシ峨r謇ア縺縲
+ /// シ代▽縺ョ繧ッ繝ェ繝繝励↓縺、縺搾シ代▽縺ョ CDirectShow 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤函謌舌☆繧九
+ /// 蜀咲函縺ョ髢句ァ九d蛛懈ュ「縺ェ縺ゥ縺ョ謫堺ス懊ョ莉悶∽ササ諢上ョ譎らせ縺ァ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧貞叙蠕励☆繧九%縺ィ縺後〒縺阪k縲
+ ///
+ public class CDirectShow : IDisposable
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public const uint WM_DSGRAPHNOTIFY = CWin32.WM_APP + 1;
+
+ public enum E繧ー繝ゥ繝輔ョ迥カ諷 { 螳悟ィ蛛懈ュ「荳ュ, 蜀咲函縺ョ縺ソ蛛懈ュ「荳ュ, 蜀咲函荳ュ, 螳悟ィ蛛懈ュ「縺ク驕キ遘サ荳ュ, 蜀咲函縺ョ縺ソ蛛懈ュ「縺ク驕キ遘サ荳ュ, 蜀咲函縺ク驕キ遘サ荳ュ, 譛ェ螳 }
+ public E繧ー繝ゥ繝輔ョ迥カ諷 e繧ー繝ゥ繝輔ョ迥カ諷
+ {
+ get
+ {
+ var status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳;
+
+ if( this.MediaCtrl != null )
+ {
+ FilterState fs;
+ int hr = this.MediaCtrl.GetState( 0, out fs ); // 縺昴l縺ェ繧翫↓驥阪◆縺縺ョ縺ァ豕ィ諢上
+
+ if( hr == CWin32.E_FAIL )
+ {
+ #region [ 螟ア謨励]
+ //-----------------
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳;
+ //-----------------
+ #endregion
+ }
+ else if( hr == CWin32.VFW_S_STATE_INTERMEDIATE )
+ {
+ #region [ 驕キ遘サ荳ュ縲]
+ //-----------------
+ switch( fs )
+ {
+ case FilterState.Running:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函縺ク驕キ遘サ荳ュ;
+ break;
+
+ case FilterState.Paused:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函縺ョ縺ソ蛛懈ュ「縺ク驕キ遘サ荳ュ;
+ break;
+
+ case FilterState.Stopped:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.螳悟ィ蛛懈ュ「縺ク驕キ遘サ荳ュ;
+ break;
+
+ default:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳;
+ break;
+ }
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ #region [ 螳牙ョ夂憾諷九]
+ //-----------------
+ switch( fs )
+ {
+ case FilterState.Running:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函荳ュ;
+ break;
+
+ case FilterState.Paused:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函縺ョ縺ソ蛛懈ュ「荳ュ;
+ break;
+
+ case FilterState.Stopped:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.螳悟ィ蛛懈ュ「荳ュ;
+ break;
+
+ default:
+ status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳;
+ break;
+ }
+ //-----------------
+ #endregion
+ }
+ }
+ return status;
+ }
+ }
+ public bool b蜀咲函荳ュ;
+ public bool b繝ォ繝シ繝怜咲函;
+
+ public int n蟷px
+ {
+ get;
+ protected set;
+ }
+ public int n鬮倥&px
+ {
+ get;
+ protected set;
+ }
+ public int n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte
+ {
+ get;
+ protected set;
+ }
+ public int n繝繝シ繧ソ繧オ繧、繧コbyte
+ {
+ get;
+ protected set;
+ }
+ public bool b荳贋ク句渚霆「
+ {
+ get;
+ protected set;
+ }
+
+ public bool b髻ウ螢ー縺ョ縺ソ
+ {
+ get;
+ protected set;
+ }
+
+ public long n迴セ蝨ィ縺ョ繧ー繝ゥ繝輔ョ蜀咲函菴咲スョms
+ {
+ get
+ {
+ if( this.MediaSeeking == null )
+ return 0;
+
+ long current;
+ int hr = this.MediaSeeking.GetCurrentPosition( out current );
+ DsError.ThrowExceptionForHR( hr );
+ return (long) ( current / ( 1000.0 * 10.0 ) );
+ }
+ }
+ ///
+ /// 辟。髻ウ:0ス100:蜴滄浹縲Tet 縺ョ縺ソ縲
+ ///
+ public int n髻ウ驥
+ {
+ get
+ {
+ return this._n髻ウ驥;
+ }
+ set
+ {
+ if( this.BasicAudio == null )
+ return;
+
+
+ // 蛟、繧剃ソ晏ュ倥
+
+ this._n髻ウ驥 = value;
+
+
+ // 繝ェ繝九い髻ウ驥上r繝繧キ繝吶Ν髻ウ驥上↓螟画鋤縲
+
+ int n髻ウ驥重b = 0;
+
+ if( value == 0 )
+ {
+ n髻ウ驥重b = -10000; // 螳悟ィ辟。髻ウ
+ }
+ else
+ {
+ n髻ウ驥重b = (int) ( ( 20.0 * Math.Log10( ( (double) value ) / 100.0 ) ) * 100.0 );
+ }
+
+
+ // 繝繧キ繝吶Ν髻ウ驥上〒繧ー繝ゥ繝輔ョ髻ウ驥上r螟画峩縲
+
+ this.BasicAudio.put_Volume( n髻ウ驥重b );
+ }
+ }
+ ///
+ /// 蟾ヲ:-100ス樔クュ螟ョ:0ス100:蜿ウ縲Tet 縺ョ縺ソ縲
+ ///
+ public int n菴咲スョ
+ {
+ set
+ {
+ if( this.BasicAudio == null )
+ return;
+
+ // 繝ェ繝九い菴咲スョ繧偵ョ繧キ繝吶Ν菴咲スョ縺ォ螟画鋤縲
+
+ int n菴咲スョ = Math.Min( Math.Max( value, -100 ), +100 );
+ int n菴咲スョdb = 0;
+
+ if( n菴咲スョ == 0 )
+ {
+ n菴咲スョdb = 0;
+ }
+ else if( n菴咲スョ == -100 )
+ {
+ n菴咲スョdb = -10000;
+ }
+ else if( n菴咲スョ == 100 )
+ {
+ n菴咲スョdb = +10000;
+ }
+ else if( n菴咲スョ < 0 )
+ {
+ n菴咲スョdb = (int) ( ( 20.0 * Math.Log10( ( (double) ( n菴咲スョ + 100 ) ) / 100.0 ) ) * 100.0 );
+ }
+ else
+ {
+ n菴咲スョdb = (int) ( ( -20.0 * Math.Log10( ( (double) ( 100 - n菴咲スョ ) ) / 100.0 ) ) * 100.0 );
+ }
+
+ // 繝繧キ繝吶Ν菴咲スョ縺ァ繧ー繝ゥ繝輔ョ菴咲スョ繧貞、画峩縲
+
+ this.BasicAudio.put_Balance( n菴咲スョdb );
+ }
+ }
+ public IMediaControl MediaCtrl;
+ public IMediaEventEx MediaEventEx;
+ public IMediaSeeking MediaSeeking;
+ public IBasicAudio BasicAudio;
+ public IGraphBuilder graphBuilder;
+
+ ///
+ /// CDirectShow繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ォ蝗コ譛峨ョID縲
+ /// DirectShow 繧、繝吶Φ繝医r繧ヲ繧」繝ウ繝峨え縺ォ逋コ菫。縺吶k髫帙`essageID 縺ィ縺励※ "WM_APP+繧、繝ウ繧ケ繧ソ繝ウ繧ケID" 繧堤匱菫。縺吶k縲
+ /// 縺薙l縺ォ繧医j縲∝女縺大エ縺ァ繧、繝吶Φ繝育匱菫。繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤音螳壹☆繧九%縺ィ縺悟庄閭ス縺ォ縺ェ繧九
+ ///
+ public int n繧、繝ウ繧ケ繧ソ繝ウ繧ケID
+ {
+ get;
+ protected set;
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public CDirectShow()
+ {
+ }
+ public CDirectShow( string fileName, IntPtr hWnd, bool b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺 )
+ {
+ // 蛻晄悄蛹悶
+
+ this.n蟷px = 0;
+ this.n鬮倥&px = 0;
+ this.b荳贋ク句渚霆「 = false;
+ this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte = 0;
+ this.n繝繝シ繧ソ繧オ繧、繧コbyte = 0;
+ this.b髻ウ螢ー縺ョ縺ソ = false;
+ this.graphBuilder = null;
+ this.MediaCtrl = null;
+ this.b蜀咲函荳ュ = false;
+ this.b繝ォ繝シ繝怜咲函 = false;
+
+
+ // 髱咏噪繝ェ繧ケ繝医↓逋サ骭イ縺励√う繝ウ繧ケ繧ソ繝ウ繧ケID繧貞セ励k縲
+
+ CDirectShow.t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤匳骭イ縺吶k( this );
+
+
+ // 荳ヲ蛻怜ヲ逅貅門y縲
+
+ if( CDirectShow.n荳ヲ蛻怜コヲ == 0 ) // 邂怜コ縺後∪縺縺ェ繧臥ョ怜コ縺吶k縲
+ CDirectShow.n荳ヲ蛻怜コヲ = Environment.ProcessorCount; // 荳ヲ蛻怜コヲシ戮PU謨ー縺ィ縺吶k縲
+
+ unsafe
+ {
+ this.dg繝ゥ繧、繝ウ謠冗判ARGB32 = new DG繝ゥ繧、繝ウ謠冗判[ CDirectShow.n荳ヲ蛻怜コヲ ];
+ this.dg繝ゥ繧、繝ウ謠冗判XRGB32 = new DG繝ゥ繧、繝ウ謠冗判[ CDirectShow.n荳ヲ蛻怜コヲ ];
+
+ for( int i = 0; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ )
+ {
+ this.dg繝ゥ繧、繝ウ謠冗判ARGB32[ i ] = new DG繝ゥ繧、繝ウ謠冗判( this.t繝ゥ繧、繝ウ謠冗判ARGB32 );
+ this.dg繝ゥ繧、繝ウ謠冗判XRGB32[ i ] = new DG繝ゥ繧、繝ウ謠冗判( this.t繝ゥ繧、繝ウ謠冗判XRGB32 );
+ }
+ }
+
+ try
+ {
+ int hr = 0;
+
+
+ // 繧ー繝ゥ繝輔ン繝ォ繝繧堤函謌舌
+
+ this.graphBuilder = (IGraphBuilder) new FilterGraph();
+#if DEBUG
+ // ROT 縺ク縺ョ逋サ骭イ縲
+ this.rot = new DsROTEntry( graphBuilder );
+#endif
+
+
+ // QueryInterface縲ょュ伜惠縺励↑縺代l縺ー null縲
+
+ this.MediaCtrl = this.graphBuilder as IMediaControl;
+ this.MediaEventEx = this.graphBuilder as IMediaEventEx;
+ this.MediaSeeking = this.graphBuilder as IMediaSeeking;
+ this.BasicAudio = this.graphBuilder as IBasicAudio;
+
+
+ // IMemoryRenderer 繧偵げ繝ゥ繝輔↓謖ソ蜈・縲
+
+ AMMediaType mediaType = null;
+
+ this.memoryRendererObject = new MemoryRenderer();
+ this.memoryRenderer = (IMemoryRenderer) this.memoryRendererObject;
+ var baseFilter = (IBaseFilter) this.memoryRendererObject;
+
+ hr = this.graphBuilder.AddFilter( baseFilter, "MemoryRenderer" );
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // fileName 縺九i繧ー繝ゥ繝輔r閾ェ蜍慕函謌舌
+
+ hr = this.graphBuilder.RenderFile( fileName, null ); // IMediaControl.RenderFile() 縺ッ謗ィ螂ィ縺輔l縺ェ縺
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // 髻ウ螢ー縺ョ縺ソシ
+
+ {
+ IBaseFilter videoRenderer;
+ IPin videoInputPin;
+ IBaseFilter audioRenderer;
+ IPin audioInputPin;
+#if MemoryRenderer
+ CDirectShow.t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ縺昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( this.graphBuilder, out videoRenderer, out videoInputPin );
+#else
+ CDirectShow.SearchMMRenderers( this.graphBuilder, out videoRenderer, out videoInputPin, out audioRenderer, out audioInputPin );
+#endif
+ if( videoRenderer == null && audioRenderer != null )
+ this.b髻ウ螢ー縺ョ縺ソ = true;
+ else
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref videoInputPin );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref videoRenderer );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref audioInputPin );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref audioRenderer );
+ }
+ }
+
+
+ // 繧、繝。繝シ繧ク諠蝣ア繧貞叙蠕励
+
+ if( !this.b髻ウ螢ー縺ョ縺ソ )
+ {
+ long n;
+ int m;
+ this.memoryRenderer.GetWidth( out n );
+ this.n蟷px = (int) n;
+ this.memoryRenderer.GetHeight( out n );
+ this.n鬮倥&px = (int) n;
+ this.memoryRenderer.IsBottomUp( out m );
+ this.b荳贋ク句渚霆「 = ( m != 0 );
+ this.memoryRenderer.GetBufferSize( out n );
+ this.n繝繝シ繧ソ繧オ繧、繧コbyte = (int) n;
+ this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte = (int) this.n繝繝シ繧ソ繧オ繧、繧コbyte / this.n鬮倥&px;
+ // C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref baseFilter ); 縺ェ繧薙°繧ュ繝」繧ケ繝亥縺ョ繧ェ繝悶ず繧ァ繧ッ繝医∪縺ァ隗」謾セ縺輔l繧九ョ縺ァ隗」謾セ遖∵ュ「縲
+ }
+
+
+ // 繧ー繝ゥ繝輔r菫ョ豁」縺吶k縲
+
+ if( b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺 )
+ {
+ WaveFormat dummy1;
+ byte[] dummy2;
+ CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧( this.graphBuilder, out dummy1, out dummy2 );
+ }
+
+
+ // 縺昴ョ莉悶ョ蜃ヲ逅縲
+
+ this.t蜀咲函貅門y髢句ァ(); // 1蝗樔サ・荳 IMediaControl 繧貞他縺ウ蜃コ縺励※縺ェ縺縺ィ縲!ReferenceClock 縺ッ蜿門セ励〒縺阪↑縺縲
+ this.t驕キ遘サ螳御コ縺セ縺ァ蠕縺」縺ヲ迥カ諷九r蜿門セ励☆繧(); // 螳悟ィ縺ォ Pause 縺ク驕キ遘サ縺吶k縺ョ繧貞セ縺、縲ゑシ育腸蠅萓晏ュ假シ
+
+
+ // 繧、繝吶Φ繝育畑繧ヲ繧」繝ウ繝峨え繝上Φ繝峨Ν繧定ィュ螳壹
+
+ this.MediaEventEx.SetNotifyWindow( hWnd, (int) WM_DSGRAPHNOTIFY, new IntPtr( this.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID ) );
+ }
+#if !DEBUG
+ catch( Exception e )
+ {
+ C蜈ア騾.t萓句、悶ョ隧ウ邏ー繧偵Ο繧ー縺ォ蜃コ蜉帙☆繧( e );
+ this.Dispose();
+ throw; // 萓句、也匱蜃コ縲
+ }
+#endif
+ finally
+ {
+ }
+ }
+
+ public void t蜀咲函貅門y髢句ァ()
+ {
+ if( this.MediaCtrl != null )
+ {
+ int hr = this.MediaCtrl.Pause(); // 蜀咲函貅門y繧帝幕蟋九☆繧九ゅ%縺薙〒縺ッ貅門y縺悟ョ御コ縺吶k縺セ縺ァ蠕縺溘↑縺縲
+ DsError.ThrowExceptionForHR( hr );
+ }
+ }
+ public void t蜀咲函髢句ァ()
+ {
+ if( this.MediaCtrl != null && --this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー <= 0 )
+ {
+ //this.t驕キ遘サ螳御コ縺セ縺ァ蠕縺」縺ヲ迥カ諷九r蜿門セ励☆繧(); // 蜀咲函貅門yシ医□繧阪≧シ峨′縺セ縺螳御コ縺励※縺ェ縺代l縺ー縲∝セ縺、縲 竊 諢丞、悶→驥阪>蜃ヲ逅縺ェ縺ョ縺ァ螟夜Κ縺ァ蛻、譁ュ縺励※螳溯。後☆繧九h縺螟画峩縺吶k縲(2011.8.7)
+
+ int hr = this.MediaCtrl.Run(); // 蜀咲函髢句ァ九
+ DsError.ThrowExceptionForHR( hr );
+
+ this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー = 0; // 荳譎ょ●豁「蝗樊焚縺ッ縺薙%縺ァ繝ェ繧サ繝繝医&繧後k縲
+ this.b蜀咲函荳ュ = true;
+ }
+ }
+ public void t蜀咲函荳譎ょ●豁「()
+ {
+ if( this.MediaCtrl != null && this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー == 0 )
+ {
+ int hr = this.MediaCtrl.Pause();
+ DsError.ThrowExceptionForHR( hr );
+ }
+ this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー++;
+ this.b蜀咲函荳ュ = false;
+ }
+ public void t蜀咲函蛛懈ュ「()
+ {
+ if( this.MediaCtrl != null )
+ {
+ int hr = this.MediaCtrl.Stop();
+ DsError.ThrowExceptionForHR( hr );
+ }
+
+ // 谺。縺ク縺ョ貅門y縲
+ //this.t蜀咲函菴咲スョ繧貞、画峩縺吶k( 0.0 ); 竊 繧医j邏ー縺九¥蛻カ蠕。縺吶k縺溘a縺ォ縲:DK螟夜Κ縺ァ蛻カ蠕。縺吶k繧医≧縺ォ螟画峩縲(2011.8.7)
+ //this.t蜀咲函貅門y髢句ァ();
+
+ this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー = 0; // 蛛懈ュ「縺吶k縺ィ縲∽ク譎ょ●豁「蜻シ縺ウ蜃コ縺礼エッ遨榊屓謨ー縺ッ繝ェ繧サ繝繝医&繧後k縲
+ this.b蜀咲函荳ュ = false;
+ }
+ public void t蜀咲函菴咲スョ繧貞、画峩( double db蜀咲函菴咲スョms )
+ {
+ if( this.MediaSeeking == null )
+ return;
+
+ int hr = this.MediaSeeking.SetPositions(
+ DsLong.FromInt64( (long) ( db蜀咲函菴咲スョms * 1000.0 * 10.0 ) ),
+ AMSeekingSeekingFlags.AbsolutePositioning,
+ null,
+ AMSeekingSeekingFlags.NoPositioning );
+
+ DsError.ThrowExceptionForHR( hr );
+ }
+ public void t譛蛻昴°繧牙咲函髢句ァ()
+ {
+ this.t蜀咲函菴咲スョ繧貞、画峩( 0.0 );
+ this.t蜀咲函髢句ァ();
+ }
+ public E繧ー繝ゥ繝輔ョ迥カ諷 t驕キ遘サ螳御コ縺セ縺ァ蠕縺」縺ヲ迥カ諷九r蜿門セ励☆繧()
+ {
+ var status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳;
+
+ if( this.MediaCtrl != null )
+ {
+ FilterState fs;
+ int hr = this.MediaCtrl.GetState( 1000, out fs ); // 驕キ遘サ螳御コ縺セ縺ァ譛螟ァ1000ms蠕縺、縲
+ }
+ return this.e繧ー繝ゥ繝輔ョ迥カ諷;
+ }
+ public unsafe void t迴セ譎らせ縺ォ縺翫¢繧区怙譁ー縺ョ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧探exture縺ォ霆「蜀吶☆繧( CTexture texture )
+ {
+ int hr;
+
+ #region [ 蜀咲函縺励※縺ェ縺縺ェ繧我ス輔b縺帙★蟶ー驍縲ゑシ井ク譎ょ●豁「荳ュ縺ッOK縲ゑシ云
+ //-----------------
+ if( !this.b蜀咲函荳ュ )
+ return;
+ //-----------------
+ #endregion
+ #region [ 髻ウ螢ー縺ョ縺ソ縺ェ繧我ス輔b縺励↑縺縲]
+ //-----------------
+ if( this.b髻ウ螢ー縺ョ縺ソ )
+ return;
+ //-----------------
+ #endregion
+
+ DataRectangle dr = texture.texture.LockRectangle( 0, LockFlags.Discard );
+ try
+ {
+ if( this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte == dr.Pitch )
+ {
+ #region [ (A) 繝斐ャ繝√′蜷医≧縺ョ縺ァ縲√ユ繧ッ繧ケ繝√Ε縺ォ逶エ謗・霆「騾√☆繧九]
+ //-----------------
+ hr = this.memoryRenderer.GetCurrentBuffer( dr.Data.DataPointer, this.n繝繝シ繧ソ繧オ繧、繧コbyte );
+ DsError.ThrowExceptionForHR( hr );
+ //-----------------
+ #endregion
+ }
+ else
+ {
+ this.b荳贋ク句渚霆「 = false; // 縺薙■繧峨ョ譁ケ豕輔〒縺ッ蟶ク縺ォ豁」蟶ク
+
+ #region [ (B) 繝斐ャ繝√′蜷医o縺ェ縺縺ョ縺ァ縲√Γ繝「繝ェ縺ォ霆「騾√@縺ヲ縺九i繝繧ッ繧ケ繝√Ε縺ォ霆「騾√☆繧九]
+ //-----------------
+
+ #region [ IMemoryRenderer 縺九i繝舌ャ繝輔ぃ縺ォ繧、繝。繝シ繧ク繝繝シ繧ソ繧定ェュ縺ソ霎シ繧縲]
+ //-----------------
+ if( this.ip == IntPtr.Zero )
+ this.ip = Marshal.AllocCoTaskMem( this.n繝繝シ繧ソ繧オ繧、繧コbyte );
+
+ hr = this.memoryRenderer.GetCurrentBuffer( this.ip, this.n繝繝シ繧ソ繧オ繧、繧コbyte );
+ DsError.ThrowExceptionForHR( hr );
+ //-----------------
+ #endregion
+
+ #region [ 繝繧ッ繧ケ繝√Ε縺ォ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧定サ「騾√]
+ //-----------------
+ bool bARGB32 = true;
+
+ switch( texture.Format )
+ {
+ case Format.A8R8G8B8:
+ bARGB32 = true;
+ break;
+
+ case Format.X8R8G8B8:
+ bARGB32 = false;
+ break;
+
+ default:
+ return; // 譛ェ蟇セ蠢懊ョ繝輔か繝シ繝槭ャ繝医ッ辟。隕悶
+ }
+
+ // 繧ケ繝ャ繝繝峨励シ繝ォ繧剃スソ縺」縺ヲ荳ヲ蛻苓サ「騾√☆繧区コ門y縲
+
+ this.ptrSnap = (byte*) this.ip.ToPointer();
+ var ptr = stackalloc UInt32*[ CDirectShow.n荳ヲ蛻怜コヲ ]; // stackallocシGC蟇セ雎。螟悶√Γ繧ス繝繝臥オゆコ譎ゅ↓閾ェ蜍暮幕謾セシ峨ッ縲√せ繧ソ繝繧ッ螟画焚逶ク謇九↓縺励°菴ソ縺医↑縺縲
+ ptr[ 0 ] = (UInt32*) dr.Data.DataPointer.ToPointer(); // 竊
+ for( int i = 1; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ ) // 繧ケ繧ソ繝繧ッ螟画焚縺ァ遒コ菫昴∝晄悄蛹悶@縺ヲ窶ヲ
+ ptr[ i ] = ptr[ i - 1 ] + this.n蟷px; // 竊
+ this.ptrTexture = ptr; // 繧ケ繧ソ繝繧ッ螟画焚繧偵け繝ゥ繧ケ繝。繝ウ繝舌↓貂。縺呻シ医%繧後↑繧碓Kシ峨
+
+
+ // 荳ヲ蛻怜コヲ縺鯉シ代↑繧峨す繝ウ繧ー繝ォ繧ケ繝ャ繝繝峨シ剃サ・荳翫↑繧峨槭Ν繝√せ繝ャ繝繝峨〒霆「騾√☆繧九
+ // 竊 CPU縺鯉シ代▽縺ョ蝣エ蜷医√o縺悶o縺悶せ繝ャ繝繝峨励シ繝ォ縺ョ繧ケ繝ャ繝繝峨〒蜃ヲ逅縺吶k縺ョ縺ッ辟。鬧縲
+
+ if( CDirectShow.n荳ヲ蛻怜コヲ == 1 )
+ {
+ if( bARGB32 )
+ this.t繝ゥ繧、繝ウ謠冗判ARGB32( 0 );
+ else
+ this.t繝ゥ繧、繝ウ謠冗判XRGB32( 0 );
+ }
+ else
+ {
+ // 霆「騾髢句ァ九
+
+ var ar = new IAsyncResult[ CDirectShow.n荳ヲ蛻怜コヲ ];
+ for( int i = 0; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ )
+ {
+ ar[ i ] = ( bARGB32 ) ?
+ this.dg繝ゥ繧、繝ウ謠冗判ARGB32[ i ].BeginInvoke( i, null, null ) :
+ this.dg繝ゥ繧、繝ウ謠冗判XRGB32[ i ].BeginInvoke( i, null, null );
+ }
+
+
+ // 霆「騾∝ョ御コ蠕縺。縲
+
+ for( int i = 0; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ )
+ {
+ if( bARGB32 )
+ this.dg繝ゥ繧、繝ウ謠冗判ARGB32[ i ].EndInvoke( ar[ i ] );
+ else
+ this.dg繝ゥ繧、繝ウ謠冗判XRGB32[ i ].EndInvoke( ar[ i ] );
+ }
+ }
+
+ this.ptrSnap = null;
+ this.ptrTexture = null;
+ //-----------------
+ #endregion
+
+ //-----------------
+ #endregion
+ }
+ }
+ finally
+ {
+ texture.texture.UnlockRectangle( 0 );
+ }
+ }
+
+ private IntPtr ip = IntPtr.Zero;
+
+ public static void t繧ー繝ゥ繝輔r隗」譫舌@繝繝舌ャ繧ー蜃コ蜉帙☆繧( IGraphBuilder graphBuilder )
+ {
+ if( graphBuilder == null )
+ {
+ Debug.WriteLine( "謖螳壹&繧後◆繧ー繝ゥ繝輔′ null 縺ァ縺吶" );
+ return;
+ }
+
+ int hr = 0;
+
+ IEnumFilters eFilters;
+ hr = graphBuilder.EnumFilters( out eFilters );
+ DsError.ThrowExceptionForHR( hr );
+ {
+ var filters = new IBaseFilter[ 1 ];
+ while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ FilterInfo filterInfo;
+ hr = filters[ 0 ].QueryFilterInfo( out filterInfo );
+ DsError.ThrowExceptionForHR( hr );
+ {
+ Debug.WriteLine( filterInfo.achName ); // 繝輔ぅ繝ォ繧ソ蜷崎。ィ遉コ縲
+ if( filterInfo.pGraph != null )
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filterInfo.pGraph );
+ }
+
+ IEnumPins ePins;
+ hr = filters[ 0 ].EnumPins( out ePins );
+ DsError.ThrowExceptionForHR( hr );
+ {
+ var pins = new IPin[ 1 ];
+ while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ PinInfo pinInfo;
+ hr = pins[ 0 ].QueryPinInfo( out pinInfo );
+ DsError.ThrowExceptionForHR( hr );
+ {
+ Debug.Write( " " + pinInfo.name ); // 繝斐Φ蜷崎。ィ遉コ縲
+ Debug.Write( ( pinInfo.dir == PinDirection.Input ) ? " 竊 " : " 竊 " );
+
+ IPin connectPin;
+ hr = pins[ 0 ].ConnectedTo( out connectPin );
+ if( hr != CWin32.S_OK )
+ Debug.WriteLine( "(譛ェ謗・邯)" );
+ else
+ {
+ DsError.ThrowExceptionForHR( hr );
+
+ PinInfo connectPinInfo;
+ hr = connectPin.QueryPinInfo( out connectPinInfo );
+ DsError.ThrowExceptionForHR( hr );
+ {
+ FilterInfo connectFilterInfo;
+ hr = connectPinInfo.filter.QueryFilterInfo( out connectFilterInfo );
+ DsError.ThrowExceptionForHR( hr );
+ {
+ Debug.Write( "[" + connectFilterInfo.achName + "]." ); // 謗・邯壼医ヵ繧」繝ォ繧ソ蜷
+
+ if( connectFilterInfo.pGraph != null )
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectFilterInfo.pGraph );
+ }
+
+ Debug.WriteLine( connectPinInfo.name ); // 謗・邯壼医ヴ繝ウ蜷
+ if( connectPinInfo.filter != null )
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectPinInfo.filter );
+ DsUtils.FreePinInfo( connectPinInfo );
+ }
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectPin );
+ }
+ if( pinInfo.filter != null )
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pinInfo.filter );
+ DsUtils.FreePinInfo( pinInfo );
+ }
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] );
+ }
+ }
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins );
+
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] );
+ }
+ }
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters );
+
+ Debug.Flush();
+ }
+ public static void t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧( IGraphBuilder graphBuilder, out WaveFormat wfx, out byte[] wfx諡。蠑オ繝繝シ繧ソ )
+ {
+ int hr = 0;
+
+ IBaseFilter audioRenderer = null;
+ IPin rendererInputPin = null;
+ IPin rendererConnectedOutputPin = null;
+ IBaseFilter nullRenderer = null;
+ IPin nullRendererInputPin = null;
+ wfx = null;
+ wfx諡。蠑オ繝繝シ繧ソ = new byte[ 0 ];
+
+ try
+ {
+ // audioRenderer 繧呈爾縺吶
+
+ audioRenderer = CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧呈爾縺励※霑斐☆( graphBuilder );
+ if( audioRenderer == null )
+ return; // 縺ェ縺九▲縺
+
+ #region [ 髻ウ驥上ぞ繝ュ縺ァ荳蠎ヲ蜀咲函縺吶k縲ゑシ医が繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウMediaType縺後∵磁邯壽凾縺ィ縺ッ逡ー縺ェ繧九梧ュ」縺励>繧ゅョ縲阪↓螟峨o繧句庄閭ス諤ァ縺後≠繧九◆繧√ゑシ云
+ //-----------------
+ {
+ // 縺薙%縺ォ譚・縺滓凾轤ケ縺ァ縲√げ繝ゥ繝輔ョ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ッ辟。蜉ケ蛹厄シNullRenderer縺ク縺ョ鄂ョ謠帙d髯、蜴サ縺ェ縺ゥシ峨@縺ヲ縺翫¥縺薙→縲
+ // 縺輔b縺ェ縺縺ィ縲ヾtopWhenReady() 譎ゅ↓荳迸ャ縺縺 Active繧ヲ繧」繝ウ繝峨え縺瑚。ィ遉コ縺輔l縺ヲ縺励∪縺縲
+
+ var mediaCtrl = (IMediaControl) graphBuilder;
+ var basicAudio = (IBasicAudio) graphBuilder;
+
+ basicAudio.put_Volume( -10000 ); // 譛蟆城浹驥
+
+
+ // 繧ー繝ゥ繝輔r蜀咲函縺励※縺吶$豁「繧√k縲ゑシPaused 竊 Stopped 縺ク驕キ遘サ縺吶kシ
+
+ mediaCtrl.StopWhenReady();
+
+
+ // 繧ー繝ゥ繝輔′ Stopped 縺ォ驕キ遘サ螳御コ縺吶k縺セ縺ァ蠕縺、縲ゑシStopWhenReady() 縺ッ繧ー繝ゥ繝輔′ Stopped 縺ォ縺ェ繧九ョ繧貞セ縺溘★縺ォ蟶ー縺」縺ヲ縺上k縲ゑシ
+
+ FilterState fs = FilterState.Paused;
+ hr = CWin32.S_FALSE;
+ while( fs != FilterState.Stopped || hr != CWin32.S_OK )
+ hr = mediaCtrl.GetState( 10, out fs );
+
+
+ // 邨ゆコ蜃ヲ逅縲
+
+ basicAudio.put_Volume( 0 ); // 譛螟ァ髻ウ驥
+
+ basicAudio = null;
+ mediaCtrl = null;
+ }
+ //-----------------
+ #endregion
+
+ // audioRenderer 縺ョ蜈・蜉帙ヴ繝ウ繧呈爾縺吶
+
+ rendererInputPin = t譛蛻昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( audioRenderer );
+ if( rendererInputPin == null )
+ return;
+
+
+ // WAVE繝輔か繝シ繝槭ャ繝医r蜿門セ励@縲『fx 蠑墓焚縺ク譬シ邏阪☆繧九
+
+ var type = new AMMediaType();
+ hr = rendererInputPin.ConnectionMediaType( type );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ wfx = new WaveFormat();
+
+ #region [ type.formatPtr 縺九i wfx 縺ォ縲∵僑蠑オ鬆伜沺繧帝勁縺上ョ繝シ繧ソ繧偵さ繝斐シ縺吶k縲]
+ //-----------------
+ var wfxTemp = new WaveFormatEx(); // SlimDX.Multimedia.WaveFormat 縺ッ Marshal.PtrToStructure() 縺ァ菴ソ縺医↑縺縺ョ縺ァ縲√◎繧後′菴ソ縺医k DirectShowLib.WaveFormatEx 繧剃サ九@縺ヲ蜿門セ励☆繧九ゑシ磯擇蛟停ヲシ
+ Marshal.PtrToStructure( type.formatPtr, (object) wfxTemp );
+ wfx = WaveFormat.CreateCustomFormat((WaveFormatEncoding)wfxTemp.wFormatTag, wfxTemp.nSamplesPerSec, wfxTemp.nChannels, wfxTemp.nAvgBytesPerSec, wfxTemp.nBlockAlign, wfxTemp.wBitsPerSample);
+ //-----------------
+ #endregion
+ #region [ 諡。蠑オ鬆伜沺縺悟ュ伜惠縺吶k縺ェ繧峨◎繧後r wfx諡。蠑オ繝繝シ繧ソ 縺ォ譬シ邏阪☆繧九 ]
+ //-----------------
+ int nWaveFormatEx譛ャ菴薙し繧、繧コ = 16 + 2; // sizeof( WAVEFORMAT ) + sizof( WAVEFORMATEX.cbSize )
+ int n縺ッ縺ソ蜃コ縺励し繧、繧コbyte = type.formatSize - nWaveFormatEx譛ャ菴薙し繧、繧コ;
+
+ if( n縺ッ縺ソ蜃コ縺励し繧、繧コbyte > 0 )
+ {
+ wfx諡。蠑オ繝繝シ繧ソ = new byte[ n縺ッ縺ソ蜃コ縺励し繧、繧コbyte ];
+ var hGC = GCHandle.Alloc( wfx諡。蠑オ繝繝シ繧ソ, GCHandleType.Pinned ); // 蜍輔¥縺ェ繧医シ
+ unsafe
+ {
+ byte* src = (byte*) type.formatPtr.ToPointer();
+ byte* dst = (byte*) hGC.AddrOfPinnedObject().ToPointer();
+ CWin32.CopyMemory( dst, src + nWaveFormatEx譛ャ菴薙し繧、繧コ, (uint) n縺ッ縺ソ蜃コ縺励し繧、繧コbyte );
+ }
+ hGC.Free();
+ }
+ //-----------------
+ #endregion
+ }
+ finally
+ {
+ if( type != null )
+ DsUtils.FreeAMMediaType( type );
+ }
+
+
+ // audioRenderer 縺ォ縺、縺ェ縺後k蜃コ蜉帙ヴ繝ウ繧呈爾縺吶
+
+ hr = rendererInputPin.ConnectedTo( out rendererConnectedOutputPin );
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // audioRenderer 繧偵げ繝ゥ繝輔°繧牙譁ュ縺吶k縲
+
+ rendererInputPin.Disconnect();
+ rendererConnectedOutputPin.Disconnect();
+
+
+ // audioRenderer 繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺吶k縲
+
+ hr = graphBuilder.RemoveFilter( audioRenderer );
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // nullRenderer 繧剃ス懈舌@縲√げ繝ゥ繝輔↓霑ス蜉縺吶k縲
+
+ nullRenderer = (IBaseFilter) new NullRenderer();
+ hr = graphBuilder.AddFilter( nullRenderer, "Audio Null Renderer" );
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // nullRenderer 縺ョ蜈・蜉帙ヴ繝ウ繧呈爾縺吶
+
+ hr = nullRenderer.FindPin( "In", out nullRendererInputPin );
+ DsError.ThrowExceptionForHR( hr );
+
+
+ // nullRenderer 繧偵げ繝ゥ繝輔↓謗・邯壹☆繧九
+
+ hr = rendererConnectedOutputPin.Connect( nullRendererInputPin, null );
+ DsError.ThrowExceptionForHR( hr );
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref nullRendererInputPin );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref nullRenderer );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref rendererConnectedOutputPin );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref rendererInputPin );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref audioRenderer );
+ }
+ }
+ public static void ConnectNullRendererFromSampleGrabber(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber)
+ {
+ int hr = 0;
+ IBaseFilter videoRenderer = null;
+ IPin videoRendererInputPin = null;
+ IBaseFilter audioRenderer = null;
+ IPin audioRendererInputPin = null;
+ IPin connectedOutputPin = null;
+ IPin nullRendererInputPin = null;
+ IPin grabberOutputPin = null;
+ IPin grabberOutputConnectedPin = null;
+
+ try
+ {
+ // videoRenderer 繧呈爾縺吶
+ CDirectShow.SearchMMRenderers(graphBuilder, out videoRenderer, out videoRendererInputPin, out audioRenderer, out audioRendererInputPin);
+ if (videoRenderer != null && videoRendererInputPin != null)
+ {
+ // 譌「蟄倥ョ繝ャ繝ウ繝繝ゥ縺ォ縺、縺ェ縺後▲縺ヲ縺繧九ヴ繝ウ蟇セ繧貞叙蠕
+ hr = videoRendererInputPin.ConnectedTo(out connectedOutputPin);
+ DsError.ThrowExceptionForHR(hr);
+
+ // 縺昴l繧峨r蛻譁ュ縲ょ燕谿オ縺ョ蜃コ蜉帙ヴ繝ウ縺ィ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウ繧貞譁ュ縺吶k縲ょ曙譁ケ蜷代°繧牙譁ュ縺励↑縺縺ィ繧ー繝ゥ繝輔°繧牙繧企屬縺輔l縺ェ縺縺ョ縺ァ豕ィ諢上
+ hr = videoRendererInputPin.Disconnect();
+ DsError.ThrowExceptionForHR(hr);
+ hr = connectedOutputPin.Disconnect();
+ DsError.ThrowExceptionForHR(hr);
+
+ // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺励√レ繝ォ繝ャ繝ウ繝繝ゥ繧定ソス蜉
+ hr = graphBuilder.RemoveFilter(videoRenderer);
+ DsError.ThrowExceptionForHR(hr);
+ IBaseFilter nullRenderer = new NullRenderer() as IBaseFilter;
+ hr = graphBuilder.AddFilter(nullRenderer, "Video Null Renderer");
+ DsError.ThrowExceptionForHR(hr);
+
+ // nullRenderer 縺ョ蜈・蜉帙ヴ繝ウ繧呈爾縺吶
+ hr = nullRenderer.FindPin("In", out nullRendererInputPin);
+ DsError.ThrowExceptionForHR(hr);
+ hr = nullRendererInputPin.Disconnect();
+ DsError.ThrowExceptionForHR(hr);
+
+ // 繧ー繝ゥ繝舌ョ Out 縺ィ Null Renderer 縺ョ In 繧呈磁邯壹☆繧九
+ hr = sampleGrabber.FindPin("Out", out grabberOutputPin);
+ DsError.ThrowExceptionForHR(hr);
+ hr = grabberOutputPin.ConnectedTo(out grabberOutputConnectedPin);
+ // grabber縺ョout縺ォ菴輔b縺、縺ェ縺後▲縺ヲ縺縺ェ縺蝣エ蜷(縺、縺セ繧翫“rabber縺ョout縺ィrenderer縺ョin縺檎峩邨舌@縺ヲ縺繧句エ蜷)縺ッ縲
+ // grabber縺ョout縺ィ縲∝挨縺ョ繝輔ぅ繝ォ繧ソ縺ョin縺ョ髢薙ョ蛻譁ュ蜃ヲ逅繧定。後o縺ェ縺縲
+ if (hr != CWin32.S_OK)
+ {
+ //Debug.WriteLine("grabber out: 譛ェ謗・邯:");
+ }
+ else
+ {
+ hr = grabberOutputConnectedPin.Disconnect();
+ DsError.ThrowExceptionForHR(hr);
+ hr = grabberOutputPin.Disconnect();
+ DsError.ThrowExceptionForHR(hr);
+ }
+ hr = grabberOutputPin.Connect(nullRendererInputPin, null);
+ DsError.ThrowExceptionForHR(hr);
+ }
+
+ if ( audioRenderer != null && audioRendererInputPin != null )
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref connectedOutputPin);
+
+ // 譌「蟄倥ョ繝ャ繝ウ繝繝ゥ縺ォ縺、縺ェ縺後▲縺ヲ縺繧九ヴ繝ウ蟇セ繧貞叙蠕
+ hr = audioRendererInputPin.ConnectedTo(out connectedOutputPin);
+ DsError.ThrowExceptionForHR(hr);
+
+ // 縺昴l繧峨r蛻譁ュ縲ょ燕谿オ縺ョ蜃コ蜉帙ヴ繝ウ縺ィ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウ繧貞譁ュ縺吶k縲ょ曙譁ケ蜷代°繧牙譁ュ縺励↑縺縺ィ繧ー繝ゥ繝輔°繧牙繧企屬縺輔l縺ェ縺縺ョ縺ァ豕ィ諢上
+ hr = audioRendererInputPin.Disconnect();
+ DsError.ThrowExceptionForHR(hr);
+ hr = connectedOutputPin.Disconnect();
+ DsError.ThrowExceptionForHR(hr);
+
+ // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺励√レ繝ォ繝ャ繝ウ繝繝ゥ繧定ソス蜉
+ hr = graphBuilder.RemoveFilter(audioRenderer);
+ DsError.ThrowExceptionForHR(hr);
+ IBaseFilter nullRenderer = new NullRenderer() as IBaseFilter;
+ hr = graphBuilder.AddFilter(nullRenderer, "Audio Null Renderer");
+ DsError.ThrowExceptionForHR(hr);
+
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref nullRendererInputPin);
+ hr = nullRenderer.FindPin("In", out nullRendererInputPin);
+ DsError.ThrowExceptionForHR(hr);
+ hr = connectedOutputPin.Connect(nullRendererInputPin, null);
+ DsError.ThrowExceptionForHR(hr);
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref connectedOutputPin);
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref videoRendererInputPin);
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref videoRenderer);
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref audioRenderer);
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref audioRendererInputPin);
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref nullRendererInputPin);
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref grabberOutputPin);
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref grabberOutputConnectedPin);
+ }
+ }
+ private static void SearchMMRenderers( IFilterGraph graph, out IBaseFilter videoRenderer, out IPin inputVPin, out IBaseFilter audioRenderer, out IPin inputAPin )
+ {
+ int hr = 0;
+ string strVR繝輔ぅ繝ォ繧ソ蜷 = null;
+ string strVR繝斐ΦID = null;
+ string strAR繝輔ぅ繝ォ繧ソ蜷 = null;
+ string strAR繝斐ΦID = null;
+
+ // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ蜈・蜉帙ヴ繝ウ繧呈爾縺励√◎縺ョ繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID繧呈而縺医k縲
+
+ IEnumFilters eFilters;
+ hr = graph.EnumFilters( out eFilters );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var filters = new IBaseFilter[ 1 ];
+ while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ try
+ {
+ #region [ 蜃コ蜉帙ヴ繝ウ縺後↑縺シ医Ξ繝ウ繝繝ゥ縺ァ縺ゅkシ峨%縺ィ繧堤「コ隱阪☆繧九]
+ //-----------------
+ IEnumPins ePins;
+ bool b蜃コ蜉帙ヴ繝ウ縺後≠繧 = false;
+
+ hr = filters[ 0 ].EnumPins( out ePins );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var pins = new IPin[ 1 ];
+ while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ try
+ {
+ if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 )
+ continue;
+
+ PinDirection dir;
+ hr = pins[ 0 ].QueryDirection( out dir );
+ DsError.ThrowExceptionForHR( hr );
+ if( dir == PinDirection.Output )
+ b蜃コ蜉帙ヴ繝ウ縺後≠繧 = true;
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] );
+ }
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins );
+ }
+
+ if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 )
+ continue; // 谺。縺ョ繝輔ぅ繝ォ繧ソ縺ク
+
+ //-----------------
+ #endregion
+ #region [ 謗・邯壻クュ縺ョ蜈・蜉帙ヴ繝ウ縺 MEDIATYPE_Video 縺ォ蟇セ蠢懊@縺ヲ縺縺溘i縲√ヵ繧」繝ォ繧ソ蜷阪→繝斐ΦID繧貞叙蠕励☆繧九]
+ //-----------------
+ hr = filters[ 0 ].EnumPins( out ePins );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var pins = new IPin[ 1 ];
+ while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ try
+ {
+ if( !string.IsNullOrEmpty( strVR繝輔ぅ繝ォ繧ソ蜷 ) )
+ continue;
+
+ var mediaType = new AMMediaType();
+
+ #region [ 迴セ蝨ィ謗・邯壻クュ縺ョ MediaType 繧貞叙蠕励ゅ▽縺ェ縺後▲縺ヲ縺ェ縺代l縺ー谺。縺ョ繝斐Φ縺ク縲]
+ //-----------------
+ hr = pins[ 0 ].ConnectionMediaType( mediaType );
+ if( hr == CWin32.VFW_E_NOT_CONNECTED )
+ continue; // 縺、縺ェ縺後▲縺ヲ縺ェ縺
+ DsError.ThrowExceptionForHR( hr );
+ //-----------------
+ #endregion
+
+ try
+ {
+ if( mediaType.majorType.Equals( MediaType.Video ) )
+ {
+ #region [ 繝輔ぅ繝ォ繧ソ蜷榊叙蠕暦シ‐
+ //-----------------
+ FilterInfo filterInfo;
+ hr = filters[ 0 ].QueryFilterInfo( out filterInfo );
+ DsError.ThrowExceptionForHR( hr );
+ strVR繝輔ぅ繝ォ繧ソ蜷 = filterInfo.achName;
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filterInfo.pGraph );
+ //-----------------
+ #endregion
+ #region [ 繝斐ΦID蜿門セ暦シ‐
+ //-----------------
+ hr = pins[ 0 ].QueryId( out strVR繝斐ΦID );
+ DsError.ThrowExceptionForHR( hr );
+ //-----------------
+ #endregion
+ }
+ else if( mediaType.majorType.Equals( MediaType.Audio ) )
+ {
+ FilterInfo filterInfo;
+ hr = filters[0].QueryFilterInfo(out filterInfo);
+ DsError.ThrowExceptionForHR(hr);
+ strAR繝輔ぅ繝ォ繧ソ蜷 = filterInfo.achName;
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref filterInfo.pGraph);
+ hr = pins[0].QueryId(out strAR繝斐ΦID);
+ DsError.ThrowExceptionForHR(hr);
+ }
+ }
+ finally
+ {
+ DsUtils.FreeAMMediaType( mediaType );
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] );
+ }
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins );
+ }
+
+ //-----------------
+ #endregion
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] );
+ }
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters );
+ }
+
+
+ // 謾ケ繧√※繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID縺九i縺薙l繧峨ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧貞叙蠕励@縲∵綾繧雁、縺ィ縺励※霑斐☆縲
+
+ videoRenderer = null;
+ inputVPin = null;
+ audioRenderer = null;
+ inputAPin = null;
+
+ if( !string.IsNullOrEmpty( strVR繝輔ぅ繝ォ繧ソ蜷 ) )
+ {
+ hr = graph.FindFilterByName( strVR繝輔ぅ繝ォ繧ソ蜷, out videoRenderer );
+ DsError.ThrowExceptionForHR( hr );
+
+ hr = videoRenderer.FindPin( strVR繝斐ΦID, out inputVPin );
+ DsError.ThrowExceptionForHR( hr );
+ }
+
+ if( !string.IsNullOrEmpty( strAR繝輔ぅ繝ォ繧ソ蜷 ) )
+ {
+ hr = graph.FindFilterByName(strAR繝輔ぅ繝ォ繧ソ蜷, out audioRenderer);
+ DsError.ThrowExceptionForHR(hr);
+
+ hr = audioRenderer.FindPin(strAR繝斐ΦID, out inputAPin);
+ DsError.ThrowExceptionForHR(hr);
+ }
+ }
+
+ public static void t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺吶k( IGraphBuilder graphBuilder )
+ {
+ int hr = 0;
+
+ IBaseFilter videoRenderer = null;
+ IPin renderInputPin = null;
+ IPin connectedOutputPin = null;
+
+ try
+ {
+ // videoRenderer 繧呈爾縺吶
+
+ CDirectShow.t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ縺昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( graphBuilder, out videoRenderer, out renderInputPin );
+ if( videoRenderer == null || renderInputPin == null )
+ return; // 縺ェ縺九▲縺
+
+ #region [ renderInputPin 縺ク謗・邯壹@縺ヲ縺繧句燕谿オ縺ョ蜃コ蜉帙ヴ繝ウ connectedOutputPin 繧呈爾縺吶 ]
+ //-----------------
+ renderInputPin.ConnectedTo( out connectedOutputPin );
+ //-----------------
+ #endregion
+
+ if( connectedOutputPin == null )
+ return; // 縺ェ縺九▲縺
+
+
+ // 蜑肴ョオ縺ョ蜃コ蜉帙ヴ繝ウ縺ィ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウ繧貞譁ュ縺吶k縲ょ曙譁ケ蜷代°繧牙譁ュ縺励↑縺縺ィ繧ー繝ゥ繝輔°繧牙繧企屬縺輔l縺ェ縺縺ョ縺ァ豕ィ諢上
+
+ renderInputPin.Disconnect();
+ connectedOutputPin.Disconnect();
+
+
+ // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縲
+
+ graphBuilder.RemoveFilter( videoRenderer );
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectedOutputPin );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref renderInputPin );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref videoRenderer );
+ }
+ }
+
+ private static IPin t譛蛻昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( IBaseFilter baseFilter )
+ {
+ int hr = 0;
+
+ IPin firstInputPin = null;
+
+ IEnumPins ePins;
+ hr = baseFilter.EnumPins( out ePins );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var pins = new IPin[ 1 ];
+ while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ PinInfo pinfo = new PinInfo() { filter = null };
+ try
+ {
+ hr = pins[ 0 ].QueryPinInfo( out pinfo );
+ DsError.ThrowExceptionForHR( hr );
+
+ if( pinfo.dir == PinDirection.Input )
+ {
+ firstInputPin = pins[ 0 ];
+ break;
+ }
+ }
+ finally
+ {
+ if( pinfo.filter != null )
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pinfo.filter );
+ DsUtils.FreePinInfo( pinfo );
+
+ if( firstInputPin == null )
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] );
+ }
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins );
+ }
+
+ return firstInputPin;
+ }
+ private static void t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ縺昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( IFilterGraph graph, out IBaseFilter videoRenderer, out IPin inputPin )
+ {
+ int hr = 0;
+ string str繝輔ぅ繝ォ繧ソ蜷 = null;
+ string str繝斐ΦID = null;
+
+
+ // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ蜈・蜉帙ヴ繝ウ繧呈爾縺励√◎縺ョ繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID繧呈而縺医k縲
+
+ IEnumFilters eFilters;
+ hr = graph.EnumFilters( out eFilters );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var filters = new IBaseFilter[ 1 ];
+ while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ try
+ {
+ #region [ 蜃コ蜉帙ヴ繝ウ縺後↑縺シ医Ξ繝ウ繝繝ゥ縺ァ縺ゅkシ峨%縺ィ繧堤「コ隱阪☆繧九]
+ //-----------------
+ IEnumPins ePins;
+ bool b蜃コ蜉帙ヴ繝ウ縺後≠繧 = false;
+
+ hr = filters[ 0 ].EnumPins( out ePins );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var pins = new IPin[ 1 ];
+ while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ try
+ {
+ if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 )
+ continue;
+
+ PinDirection dir;
+ hr = pins[ 0 ].QueryDirection( out dir );
+ DsError.ThrowExceptionForHR( hr );
+ if( dir == PinDirection.Output )
+ b蜃コ蜉帙ヴ繝ウ縺後≠繧 = true;
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] );
+ }
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins );
+ }
+
+ if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 )
+ continue; // 谺。縺ョ繝輔ぅ繝ォ繧ソ縺ク
+
+ //-----------------
+ #endregion
+ #region [ 謗・邯壻クュ縺ョ蜈・蜉帙ヴ繝ウ縺 MEDIATYPE_Video 縺ォ蟇セ蠢懊@縺ヲ縺縺溘i縲√ヵ繧」繝ォ繧ソ蜷阪→繝斐ΦID繧貞叙蠕励☆繧九]
+ //-----------------
+ hr = filters[ 0 ].EnumPins( out ePins );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var pins = new IPin[ 1 ];
+ while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ try
+ {
+ if( !string.IsNullOrEmpty( str繝輔ぅ繝ォ繧ソ蜷 ) )
+ continue;
+
+ var mediaType = new AMMediaType();
+
+ #region [ 迴セ蝨ィ謗・邯壻クュ縺ョ MediaType 繧貞叙蠕励ゅ▽縺ェ縺後▲縺ヲ縺ェ縺代l縺ー谺。縺ョ繝斐Φ縺ク縲]
+ //-----------------
+ hr = pins[ 0 ].ConnectionMediaType( mediaType );
+ if( hr == CWin32.VFW_E_NOT_CONNECTED )
+ continue; // 縺、縺ェ縺後▲縺ヲ縺ェ縺
+ DsError.ThrowExceptionForHR( hr );
+ //-----------------
+ #endregion
+
+ try
+ {
+ if( mediaType.majorType.Equals( MediaType.Video ) )
+ {
+ #region [ 繝輔ぅ繝ォ繧ソ蜷榊叙蠕暦シ‐
+ //-----------------
+ FilterInfo filterInfo;
+ hr = filters[ 0 ].QueryFilterInfo( out filterInfo );
+ DsError.ThrowExceptionForHR( hr );
+ str繝輔ぅ繝ォ繧ソ蜷 = filterInfo.achName;
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filterInfo.pGraph );
+ //-----------------
+ #endregion
+ #region [ 繝斐ΦID蜿門セ暦シ‐
+ //-----------------
+ hr = pins[ 0 ].QueryId( out str繝斐ΦID );
+ DsError.ThrowExceptionForHR( hr );
+ //-----------------
+ #endregion
+
+ continue; // 谺。縺ョ繝斐Φ縺ク縲
+ }
+ }
+ finally
+ {
+ DsUtils.FreeAMMediaType( mediaType );
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] );
+ }
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins );
+ }
+
+ //-----------------
+ #endregion
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] );
+ }
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters );
+ }
+
+
+ // 謾ケ繧√※繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID縺九i縺薙l繧峨ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧貞叙蠕励@縲∵綾繧雁、縺ィ縺励※霑斐☆縲
+
+ videoRenderer = null;
+ inputPin = null;
+
+ if( !string.IsNullOrEmpty( str繝輔ぅ繝ォ繧ソ蜷 ) )
+ {
+ hr = graph.FindFilterByName( str繝輔ぅ繝ォ繧ソ蜷, out videoRenderer );
+ DsError.ThrowExceptionForHR( hr );
+
+ hr = videoRenderer.FindPin( str繝斐ΦID, out inputPin );
+ DsError.ThrowExceptionForHR( hr );
+ }
+ }
+ private static IBaseFilter t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧呈爾縺励※霑斐☆( IFilterGraph graph )
+ {
+ int hr = 0;
+ IBaseFilter audioRenderer = null;
+
+ IEnumFilters eFilters;
+ hr = graph.EnumFilters( out eFilters );
+ DsError.ThrowExceptionForHR( hr );
+ try
+ {
+ var filters = new IBaseFilter[ 1 ];
+ while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK )
+ {
+ if( ( filters[ 0 ] as IAMAudioRendererStats ) != null )
+ {
+ audioRenderer = filters[ 0 ];
+ break;
+ }
+
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] );
+ }
+ }
+ finally
+ {
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters );
+ }
+ return audioRenderer;
+ }
+
+
+ #region [ 髱咏噪繧、繝ウ繧ケ繧ソ繝ウ繧ケ邂。逅 ]
+ //-----------------
+ public const int n繧、繝ウ繧ケ繧ソ繝ウ繧ケID縺ョ譛螟ァ謨ー = 100;
+ protected static Dictionary dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ = new Dictionary(); // <繧、繝ウ繧ケ繧ソ繝ウ繧ケID, 縺昴ョID繧呈戟縺、繧、繝ウ繧ケ繧ソ繝ウ繧ケ>
+
+ protected static void t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤匳骭イ縺吶k( CDirectShow ds )
+ {
+ for( int i = 1; i < CDirectShow.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID縺ョ譛螟ァ謨ー; i++ )
+ {
+ if( !CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.ContainsKey( i ) ) // 遨コ縺縺ヲ縺繧狗分蜿キ繧剃スソ縺縲
+ {
+ ds.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID = i;
+ CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Add( i, ds );
+ break;
+ }
+ }
+ }
+ protected static void t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ァ」謾セ縺吶k( int n繧、繝ウ繧ケ繧ソ繝ウ繧ケID )
+ {
+ if( CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.ContainsKey( n繧、繝ウ繧ケ繧ソ繝ウ繧ケID ) )
+ CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Remove( n繧、繝ウ繧ケ繧ソ繝ウ繧ケID );
+ }
+ //-----------------
+ #endregion
+
+ #region [ Dispose-Finalize 繝代ち繝シ繝ウ螳溯」 ]
+ //-----------------
+ public virtual void Dispose()
+ {
+ this.Dispose( true );
+ GC.SuppressFinalize( this ); // 縺。繧繧薙→ Dispose 縺輔l縺溘ョ縺ァ縲√ヵ繧。繧、繝翫Λ繧、繧コ荳崎ヲ√〒縺ゅk縺薙→繧 CLR 縺ォ莨昴∴繧九
+ }
+ protected virtual void Dispose( bool bManaged繝ェ繧ス繝シ繧ケ繧りァ」謾セ縺吶k )
+ {
+ if( bManaged繝ェ繧ス繝シ繧ケ繧りァ」謾セ縺吶k )
+ {
+ #region [ ROT縺九i隗」謾セ縺吶k縲]
+ //-----------------
+#if DEBUG
+ C蜈ア騾.tDispose縺吶k( ref this.rot );
+#endif
+ //-----------------
+ #endregion
+
+ CDirectShow.t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ァ」謾セ縺吶k( this.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID );
+ }
+
+ #region [ 繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ蜿らァ繧偵↑縺上@縲,OM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k縲 ]
+ //-----------------
+ if( this.ip != IntPtr.Zero )
+ {
+ Marshal.FreeCoTaskMem( this.ip );
+ this.ip = IntPtr.Zero;
+ }
+
+ if( this.MediaCtrl != null )
+ {
+ this.MediaCtrl.Stop();
+ this.MediaCtrl = null;
+ }
+
+ if( this.MediaEventEx != null )
+ {
+ this.MediaEventEx.SetNotifyWindow( IntPtr.Zero, 0, IntPtr.Zero );
+ this.MediaEventEx = null;
+ }
+
+ if( this.MediaSeeking != null )
+ this.MediaSeeking = null;
+
+ if( this.BasicAudio != null )
+ this.BasicAudio = null;
+
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.nullRenderer );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.memoryRenderer );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.memoryRendererObject );
+ C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.graphBuilder );
+ //-----------------
+ #endregion
+
+ C蜈ア騾.t螳悟ィ縺ェ繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ滓命縺吶k();
+ }
+ ~CDirectShow()
+ {
+ // 繝輔ぃ繧、繝翫Λ繧、繧カ縺悟他縺ー繧後◆縺ィ縺縺縺薙→縺ッ縲.ispose() 縺輔l縺ェ縺九▲縺溘→縺縺縺薙→縲
+ // 縺薙ョ蝣エ蜷医`anaged 繝ェ繧ス繝シ繧ケ縺ッ蜈医↓繝輔ぃ繧、繝翫Λ繧、繧コ縺輔l縺ヲ縺繧句庄閭ス諤ァ縺後≠繧九ョ縺ァ縲ゞnmamaed 繝ェ繧ス繝シ繧ケ縺ョ縺ソ繧定ァ」謾セ縺吶k縲
+
+ this.Dispose( false );
+ }
+ //-----------------
+ #endregion
+
+ #region [ protected ]
+ //-----------------
+ protected MemoryRenderer memoryRendererObject = null;
+ protected IMemoryRenderer memoryRenderer = null;
+ protected IBaseFilter nullRenderer = null;
+ protected int n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー = 0;
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ private int _n髻ウ驥 = 100;
+#if DEBUG
+ private DsROTEntry rot = null;
+#endif
+
+ // 蜿ッ閭ス縺ェ謨ー縺ョ繧ケ繝ャ繝繝峨r菴ソ逕ィ縺励※逕サ蜒上r霆「騾√☆繧九ょ、ァ縺阪>逕サ蜒上⊇縺ゥ譛牙柑縲ょ、壹☆縺弱k縺ィ繝励シ繝ォ蜀縺ョ繧ケ繝ャ繝繝峨′遨コ縺上∪縺ァ蠕縺溘&繧後k縺ョ縺ァ豕ィ諢上
+ private static int n荳ヲ蛻怜コヲ = 0; // 0 縺ョ蝣エ蜷医∵怙蛻昴ョ逕滓先凾縺ォ荳ヲ蛻怜コヲ繧呈アコ螳壹☆繧九
+
+ private DG繝ゥ繧、繝ウ謠冗判[] dg繝ゥ繧、繝ウ謠冗判ARGB32;
+ private DG繝ゥ繧、繝ウ謠冗判[] dg繝ゥ繧、繝ウ謠冗判XRGB32;
+ private unsafe delegate void DG繝ゥ繧、繝ウ謠冗判( int n );
+ private unsafe byte* ptrSnap = null;
+ private unsafe UInt32** ptrTexture = null;
+
+ private unsafe void t繝ゥ繧、繝ウ謠冗判XRGB32( int n )
+ {
+ // Snap 縺ッ RGB32縲ゝexture縺ッ X8R8G8B8
+
+ UInt32* ptrTexture = this.ptrTexture[ n ];
+ for( int y = n; y < this.n鬮倥&px; y += CDirectShow.n荳ヲ蛻怜コヲ )
+ {
+ byte* ptrPixel = ptrSnap + ( ( ( this.n鬮倥&px - y ) - 1 ) * this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte );
+
+ // 繧「繝ォ繝輔ぃ辟。隕悶↑縺ョ縺ァ荳諡ャ繧ウ繝斐シ縲CopyMemory() 縺ッ閾ェ蜑阪〒繝ォ繝シ繝怜ア暮幕縺吶k繧医j繧る溘>縲
+ CWin32.CopyMemory( (void*) ptrTexture, (void*) ptrPixel, (uint) ( this.n蟷px * 4 ) );
+
+ ptrTexture += this.n蟷px * CDirectShow.n荳ヲ蛻怜コヲ;
+ }
+ }
+ private unsafe void t繝ゥ繧、繝ウ謠冗判ARGB32( int n )
+ {
+ // Snap 縺ッ RGB32縲ゝexture縺ッ A8R8G8B8
+
+ UInt32* ptrTexture = this.ptrTexture[ n ];
+ for( int y = n; y < this.n鬮倥&px; y += CDirectShow.n荳ヲ蛻怜コヲ )
+ {
+ UInt32* ptrPixel = (UInt32*) ( ptrSnap + ( ( ( this.n鬮倥&px - y ) - 1 ) * this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte ) );
+
+ //for( int x = 0; x < this.n蟷px; x++ )
+ // *( ptrTexture + x ) = 0xFF000000 | *ptrPixel++;
+ // 竊薙Ν繝シ繝怜ア暮幕縺ォ繧医j鬮倬溷喧縲160fps 縺ョ譖イ縺 200fps 縺セ縺ァ荳翫′縺」縺溘
+
+ if( this.n蟷px == 0 ) goto LEXIT;
+ UInt32* pt = ptrTexture;
+ UInt32 nAlpha = 0xFF000000;
+ int d = ( this.n蟷px % 32 );
+
+ switch( d )
+ {
+ case 1: goto L031;
+ case 2: goto L030;
+ case 3: goto L029;
+ case 4: goto L028;
+ case 5: goto L027;
+ case 6: goto L026;
+ case 7: goto L025;
+ case 8: goto L024;
+ case 9: goto L023;
+ case 10: goto L022;
+ case 11: goto L021;
+ case 12: goto L020;
+ case 13: goto L019;
+ case 14: goto L018;
+ case 15: goto L017;
+ case 16: goto L016;
+ case 17: goto L015;
+ case 18: goto L014;
+ case 19: goto L013;
+ case 20: goto L012;
+ case 21: goto L011;
+ case 22: goto L010;
+ case 23: goto L009;
+ case 24: goto L008;
+ case 25: goto L007;
+ case 26: goto L006;
+ case 27: goto L005;
+ case 28: goto L004;
+ case 29: goto L003;
+ case 30: goto L002;
+ case 31: goto L001;
+ }
+
+ L000: *pt++ = nAlpha | *ptrPixel++;
+ L001: *pt++ = nAlpha | *ptrPixel++;
+ L002: *pt++ = nAlpha | *ptrPixel++;
+ L003: *pt++ = nAlpha | *ptrPixel++;
+ L004: *pt++ = nAlpha | *ptrPixel++;
+ L005: *pt++ = nAlpha | *ptrPixel++;
+ L006: *pt++ = nAlpha | *ptrPixel++;
+ L007: *pt++ = nAlpha | *ptrPixel++;
+ L008: *pt++ = nAlpha | *ptrPixel++;
+ L009: *pt++ = nAlpha | *ptrPixel++;
+ L010: *pt++ = nAlpha | *ptrPixel++;
+ L011: *pt++ = nAlpha | *ptrPixel++;
+ L012: *pt++ = nAlpha | *ptrPixel++;
+ L013: *pt++ = nAlpha | *ptrPixel++;
+ L014: *pt++ = nAlpha | *ptrPixel++;
+ L015: *pt++ = nAlpha | *ptrPixel++;
+ L016: *pt++ = nAlpha | *ptrPixel++;
+ L017: *pt++ = nAlpha | *ptrPixel++;
+ L018: *pt++ = nAlpha | *ptrPixel++;
+ L019: *pt++ = nAlpha | *ptrPixel++;
+ L020: *pt++ = nAlpha | *ptrPixel++;
+ L021: *pt++ = nAlpha | *ptrPixel++;
+ L022: *pt++ = nAlpha | *ptrPixel++;
+ L023: *pt++ = nAlpha | *ptrPixel++;
+ L024: *pt++ = nAlpha | *ptrPixel++;
+ L025: *pt++ = nAlpha | *ptrPixel++;
+ L026: *pt++ = nAlpha | *ptrPixel++;
+ L027: *pt++ = nAlpha | *ptrPixel++;
+ L028: *pt++ = nAlpha | *ptrPixel++;
+ L029: *pt++ = nAlpha | *ptrPixel++;
+ L030: *pt++ = nAlpha | *ptrPixel++;
+ L031: *pt++ = nAlpha | *ptrPixel++;
+ if( ( pt - ptrTexture ) < this.n蟷px ) goto L000;
+
+ LEXIT:
+ ptrTexture += this.n蟷px * CDirectShow.n荳ヲ蛻怜コヲ;
+ }
+ }
+ //-----------------
+ #endregion
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/05.DirectShow/MemoryRenderer.cs b/FDK19/繧ウ繝シ繝/05.DirectShow/MemoryRenderer.cs
new file mode 100644
index 00000000..06b4f24d
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/05.DirectShow/MemoryRenderer.cs
@@ -0,0 +1,36 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace FDK
+{
+ using HRESULT = Int32;
+ using BOOL = Int32;
+
+ [ComImport, Guid( "CE3CE3EE-5C4E-4BDC-A467-C068E1FC3DA5" )]
+ public class MemoryRenderer // 菴輔b邯呎価縺励※縺ッ縺ェ繧峨↑縺縲
+ {
+ // 菴輔b險倩ソー縺励※縺ッ縺ェ繧峨↑縺縲
+ // 莉」繧上j縺ォ縲`emoryRenderer 縺ョ逕滓仙セ後√く繝」繧ケ繝医〒竊薙ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧貞叙蠕励☆繧九
+ }
+
+ [ComImport, Guid( "FFAA4A1A-D63D-4688-9C66-D18CA7B99488" ), InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
+ public interface IMemoryRenderer
+ {
+ [PreserveSig]
+ HRESULT GetWidth( out long nWidht );
+
+ [PreserveSig]
+ HRESULT GetHeight( out long nHeight );
+
+ [PreserveSig]
+ HRESULT GetBufferSize( out long nBufferSize );
+
+ [PreserveSig]
+ HRESULT GetCurrentBuffer( IntPtr pBuffer, long nBufferSize );
+
+ [PreserveSig]
+ HRESULT IsBottomUp( out BOOL bBottomUp );
+ }
+}
diff --git a/FDK19/繧ウ繝シ繝/06.Tempo/CBeatDetect.cs b/FDK19/繧ウ繝シ繝/06.Tempo/CBeatDetect.cs
new file mode 100644
index 00000000..4b3b9734
--- /dev/null
+++ b/FDK19/繧ウ繝シ繝/06.Tempo/CBeatDetect.cs
@@ -0,0 +1,209 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using System.Threading;
+using Un4seen.Bass;
+//using Un4seen.BassAsio;
+//using Un4seen.BassWasapi;
+//using Un4seen.Bass.AddOn.Mix;
+using Un4seen.Bass.AddOn.Fx;
+
+namespace FDK
+{
+ public class CBeatDetect : IDisposable
+ {
+ public struct stBeatPos
+ {
+ public float fBeatTime;
+ public int n蟆冗ッ逡ェ蜿キ;
+ public int nGrid;
+ public int n蟆冗ッ蜀Grid;
+ public bool b辟。蜉ケ; //
+ public bool b繝ャ繝シ繝ウ陦ィ遉コ縺吶k; // 譛ェ菴ソ逕ィ
+
+ public stBeatPos( float _fBeatTime, int _n蟆冗ッ逡ェ蜿キ, int _nGrid, int _n蟆冗ッ蜀Grid, bool _b辟。蜉ケ, bool _b繝ャ繝シ繝ウ陦ィ遉コ縺吶k )
+ {
+ fBeatTime = _fBeatTime;
+ n蟆冗ッ逡ェ蜿キ = _n蟆冗ッ逡ェ蜿キ;
+ nGrid = _nGrid;
+ n蟆冗ッ蜀Grid = _n蟆冗ッ蜀Grid;
+ b辟。蜉ケ = _b辟。蜉ケ;
+ b繝ャ繝シ繝ウ陦ィ遉コ縺吶k= _b繝ャ繝シ繝ウ陦ィ遉コ縺吶k;
+ }
+ }
+
+ #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ ]
+ public CBeatDetect()
+ {
+ Initialize();
+ }
+ public CBeatDetect( string _filename )
+ {
+ this.filename = _filename;
+ Initialize();
+ }
+ #endregion
+ #region [ 蛻晄悄蛹(繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺九i蜻シ縺ウ蜃コ縺輔l繧) ]
+ private void Initialize()
+ {
+ if ( this.listBeatPositions == null )
+ {
+ this.listBeatPositions = new List();
+ }
+
+ #region [ BASS registration ]
+ // BASS.NET 繝ヲ繝シ繧カ逋サ骭イシBASS繧ケ繝励Λ繝繧キ繝・縺碁撼陦ィ遉コ縺ォ縺ェ繧具シ峨
+
+ BassNet.Registration( "dtx2013@gmail.com", "2X9181017152222" );
+ #endregion
+ #region [ BASS Version Check ]
+ // BASS 縺ョ繝舌シ繧ク繝ァ繝ウ繝√ぉ繝繧ッ縲
+ int nBASSVersion = Utils.HighWord( Bass.BASS_GetVersion() );
+ if ( nBASSVersion != Bass.BASSVERSION )
+ throw new DllNotFoundException( string.Format( "bass.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSVersion, Bass.BASSVERSION ) );
+
+ int nBASSFXVersion = Utils.HighWord( BassFx.BASS_FX_GetVersion() );
+ if ( nBASSFXVersion != BassFx.BASSFXVERSION )
+ throw new DllNotFoundException( string.Format( "bass_fx.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSFXVersion, BassFx.BASSFXVERSION ) );
+ #endregion
+
+ #region [ BASS 縺ョ險ュ螳壹]
+ //this.bIsBASSFree = true;
+ //Debug.Assert( Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ), // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲(繧オ繧ヲ繝ウ繝牙コ蜉帙@縺ェ縺縺溘a)
+ // string.Format( "BASS_SetConfig() 縺ォ螟ア謨励@縺セ縺励◆縲[{0}", Bass.BASS_ErrorGetCode() ) );
+ #endregion
+ #region [ BASS 縺ョ蛻晄悄蛹悶]
+ int n繝繝舌う繧ケ = 0; // 0:"no sound" 窶ヲ BASS 縺九i縺ッ繝繝舌う繧ケ縺ク繧「繧ッ繧サ繧ケ縺輔○縺ェ縺縲
+ int n蜻ィ豕「謨ー = 44100; // 莉ョ豎コ繧√M繝繝舌う繧ケシ遺旺繝峨Λ繧、繝撰シ峨′繝阪う繝繧」繝悶↓蟇セ蠢懊@縺ヲ縺繧句捉豕「謨ー縺ァ縺ゅl縺ー菴輔〒繧ゅ>縺シ溘h縺縺縲ゅ>縺壹l縺ォ縺励mBASSMX縺ァ閾ェ蜍慕噪縺ォ繝ェ繧オ繝ウ繝励Μ繝ウ繧ー縺輔l繧九
+ if ( !Bass.BASS_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) )
+ throw new Exception( string.Format( "BASS 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) );
+ #endregion
+
+ #region [ 謖螳壹&繧後◆繧オ繧ヲ繝ウ繝峨ヵ繧。繧、繝ォ繧達ASS縺ァ繧ェ繝シ繝励Φ縺励∝ソ隕∵怙蟆城剞縺ョ諠蝣ア繧貞叙蠕励☆繧九]
+ //this.hBassStream = Bass.BASS_StreamCreateFile( this.filename, 0, 0, BASSFlag.BASS_STREAM_PRESCAN | BASSFlag.BASS_STREAM_DECODE );
+ this.hBassStream = Bass.BASS_StreamCreateFile( this.filename, 0, 0, BASSFlag.BASS_STREAM_DECODE );
+ if ( this.hBassStream == 0 )
+ throw new Exception( string.Format( "{0}: 繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_StreamCreateFile)[{1}]", filename, Bass.BASS_ErrorGetCode().ToString() ) );
+
+ this.nTotalBytes = Bass.BASS_ChannelGetLength( this.hBassStream );
+
+ this.nTotalSeconds = Bass.BASS_ChannelBytes2Seconds( this.hBassStream, nTotalBytes );
+ if ( !Bass.BASS_ChannelGetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ref fFreq ) )
+ {
+ string errmes = string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ蜻ィ豕「謨ー蜿門セ励↓螟ア謨励@縺セ縺励◆縲(BASS_ChannelGetAttribute)[{0}]", Bass.BASS_ErrorGetCode().ToString() );
+ Bass.BASS_Free();
+ throw new Exception( errmes );
+ }
+ #endregion
+ }
+ #endregion
+
+ ///
+ /// 譖イ蜈ィ菴薙ョ繝繝ウ繝昴r蜿門セ励☆繧
+ ///
+ /// 繝繝ウ繝晏、
+ /// 繝繝ウ繝晏、縺ョ遽蝗イ縺ッ70-300
+ public float GetTempo()
+ {
+ fTempo = BassFx.BASS_FX_BPM_DecodeGet(
+ this.hBassStream,
+ 0,
+ nTotalSeconds,
+ ( 300 << 16 ) + 70, // MAX BPM=320, MIN BPM=70
+ //0,
+ BASSFXBpm.BASS_FX_BPM_DEFAULT, //BASSFXBpm.BASS_FX_BPM_MULT2,
+ null,
+ IntPtr.Zero );
+ return fTempo;
+ }
+ ///
+ /// 譖イ縺ョ荳驛ィ蛻縺ョ繝繝ウ繝昴r蜿門セ励☆繧
+ ///
+ /// 髢句ァ倶ス咲スョ
+ /// 邨ゆコ菴咲スョ
+ /// 繝繝ウ繝晏、
+ /// 繝繝ウ繝晏、縺ョ遽蝗イ縺ッ70-300
+ public float GetTempo( double startSec, double endSec )
+ {
+ fTempo = BassFx.BASS_FX_BPM_DecodeGet(
+ this.hBassStream,
+ startSec,
+ endSec,
+ ( 300 << 16 ) + 70, // MAX BPM=320, MIN BPM=70
+ //0,
+ BASSFXBpm.BASS_FX_BPM_DEFAULT, //BASSFXBpm.BASS_FX_BPM_MULT2,
+ null,
+ IntPtr.Zero );
+ return fTempo;
+ }
+
+
+ ///
+ /// Beat縺ョ讀懷コ菴咲スョ繧鱈ist縺ァ霑斐☆
+ ///
+ /// Beat讀懷コ菴咲スョ鄒、
+ public List GetBeatPositions()
+ {
+ #region [ BeatPosition譬シ邏阪Μ繧ケ繝医ョ蛻晄悄蛹 ]
+ if ( this.listBeatPositions != null )
+ {
+ this.listBeatPositions.Clear();
+ }
+ else
+ {
+ this.listBeatPositions = new List();
+ }
+ #endregion
+
+ BPMBEATPROC _beatProc = new BPMBEATPROC( GetBeat_ProgressCallback );
+
+ bool ret = BassFx.BASS_FX_BPM_BeatDecodeGet(
+ this.hBassStream,
+ 0,
+ nTotalSeconds,
+ //0,
+ BASSFXBpm.BASS_FX_BPM_DEFAULT, //BASSFXBpm.BASS_FX_BPM_MULT2,
+ _beatProc,
+ IntPtr.Zero );
+
+ return this.listBeatPositions;
+ }
+
+ private void GetBeat_ProgressCallback( int channel, double beatpos, IntPtr user )
+ {
+ stBeatPos sbp = new stBeatPos(
+ (float) beatpos,
+ 0,
+ 0,
+ 0,
+ false,
+ true
+ );
+
+
+ listBeatPositions.Add( sbp );
+// Debug.WriteLine( "Beat at: " + beatpos.ToString() );
+ }
+
+
+
+
+ public void Dispose() // 菴ソ縺邨ゅo縺」縺溘i蠢縺咼ispose()縺吶k縺薙→縲BASS縺ョ繝ェ繧ス繝シ繧ケ繧呈升繧翫▲縺ア縺ェ縺励↓縺吶k縺ィ縲∽サ悶ョ蜀咲函縺ォ荳埼ス蜷医′逕溘§繧九◆繧√
+ {
+ BassFx.BASS_FX_BPM_Free( this.hBassStream );
+ Bass.BASS_StreamFree( this.hBassStream );
+ this.hBassStream = -1;
+ Bass.BASS_Free();
+ }
+
+ // =============
+ private string filename = "";
+ private int hBassStream = -1;
+ private long nTotalBytes = 0;
+ private double nTotalSeconds = 0.0f;
+ private float fFreq = 0.0f;
+ private float fTempo;
+ private List listBeatPositions = null;
+ }
+}
diff --git a/README.old.md b/README.old.md
new file mode 100644
index 00000000..ac769ac7
--- /dev/null
+++ b/README.old.md
@@ -0,0 +1,35 @@
+# TJAPlayer3-Develop-ReWrite
+DTXMania繧偵>縺倥▲縺ヲtja蜀咲函繝励Ο繧ー繝ゥ繝縺ォ縺励■繧縺」縺歇TJAPlayer2fPC](https://github.com/kairera0467/TJAP2fPC)繧巽ork縺励※譛ャ螳カ鬚ィ縺ォ謾ケ騾縺励◆
+[TJAPlayer3](https://github.com/AioiLight/TJAPlayer3)繧定カ譛ャ螳カ鬚ィ縺ォ謾ケ騾縺励◆繧「繝ャ繧呈嶌縺咲峩縺励◆繧ゅョ縲
+
+縺薙ョ繝励Ο繧ー繝ゥ繝繧剃スソ逕ィ縺励◆荳榊キ蜷医サ蝠城。後↓縺、縺縺ヲ縺ッ雋ャ莉サ繧定イ縺縺九ュ縺セ縺吶
+
+## How 2 Build
+- VisualStudio 2017 & C# 7.3
+- VC++ toolset
+- SlimDX逕ィ縺ョ鄂イ蜷
+
+## 繝ゥ繧、繧サ繝ウ繧ケ髢「菫
+Fork蜈繧医j蠑慕畑縲
+
+> 莉・荳九ョ繝ゥ繧、繝悶Λ繝ェ繧剃スソ逕ィ縺励※縺縺セ縺吶
+> * bass
+> * Bass.Net
+> * DirectShowLib
+> * FDK21
+> * SlimDX
+> * SharpDX
+> * ReadJEnc
+> * xadec
+> * IPA繝輔か繝ウ繝
+> * libogg
+> * libvorbis
+> 縲悟ョ溯。梧凾繝輔か繝ォ繝/Licenses縲阪↓蜿朱鹸縺励※縺縺セ縺吶
+>
+> 縺セ縺溘√%縺ョ繝励Ο繧ー繝ゥ繝縺ッFROM豌上ョ縲轡TXMania縲阪r蜈縺ォ陬ス菴懊@縺ヲ縺縺セ縺吶
+
+## 繧ッ繝ャ繧ク繝繝
+> * [TwoPointZero/TJAPlayer3](https://github.com/twopointzero/TJAPlayer3)(@twopointzero)
+> * [KabanFriends/TJAPlayer3](https://github.com/KabanFriends/TJAPlayer3/tree/features)(@KabanFriends)
+> * [Mr-Ojii/TJAPlayer3-f](https://github.com/Mr-Ojii/TJAPlayer3-f)(@Mr-Ojii)
+> * [Akasoko/TJAPlayer3](https://github.com/Akasoko-Master/TJAPlayer3)(@AkasokoR)
diff --git a/Readme.txt b/Readme.txt
new file mode 100644
index 00000000..dd0e3356
--- /dev/null
+++ b/Readme.txt
@@ -0,0 +1,79 @@
+サソ############
+TJAPlayer3 Readme.txt
+############
+蜈ャ髢区律:2018/5/5
+譖エ譁ー譌・:2018/12/21
+
+== 縺ッ縺倥a縺ォ ==
+TJAPlayer3繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲ縺縺溘□縺阪√≠繧翫′縺ィ縺縺斐*縺縺セ縺吶
+縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ッ縲√い繝シ繧ア繝シ繝/螳カ蠎ュ逕ィ繧イ繝シ繝縲悟、ェ鮠薙ョ驕比ココ縲阪す繝ェ繝シ繧コ縺ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ァ縺吶
+縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ッ縲ゝJAPlayer2 forPC縺ィ縺縺繧キ繝溘Η繝ャ繝シ繧ソ繝シ繧呈隼騾縺励◆繧ゅョ縺ァ縺吶
+螟ェ鮠薙&繧捺ャ。驛弱サTJAPlayer遲峨〒菴ソ繧上l縺ヲ縺繧.tja繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ縺ソ縲√励Ξ繧、縺吶k縺薙→縺後〒縺阪∪縺吶
+(縺吶∋縺ヲ縺ョ.tja繝輔ぃ繧、繝ォ縺瑚ェュ縺ソ霎シ繧√k繧上¢縺ァ縺ッ縺ゅj縺セ縺帙s縲ゅ∪縺溘ゝJAPlayer3蛛エ縺ァ霑ス蜉縺励◆蜻ス莉、繧ゅ≠繧翫∪縺吶)
+髢狗匱騾比クュ縺ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ョ縺溘a縲∽ク榊キ蜷医d繝舌げ縺後≠繧句エ蜷医′縺ゅj縺セ縺吶ゅ#莠謇ソ縺上□縺輔>縲
+(繧ゅ@荳榊キ蜷医r隕九▽縺代◆蝣エ蜷医ッ縲;itHub縺ョissue繧Уwitter縺ァ騾」邨。縺励※縺上□縺輔k縺ィ縲∝、ァ螟牙勧縺九j縺セ縺吶)
+
+== 菴ソ逕ィ荳翫ョ豕ィ諢 ==
+繝サTJAPlayer3縺ッ繧ェ繝シ繝励Φ繧ス繝シ繧ケ繧ス繝輔ヨ繧ヲ繧ァ繧「(MIT)縺ァ縺吶
+繝サ縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ繧剃スソ逕ィ縺吶k蝣エ蜷医ッ縲**蜈ィ縺ヲ閾ェ蟾ア雋ャ莉サ**縺ァ縺企。倥>縺励∪縺吶
+繝サ隱ャ譏取嶌繧縲√ラ繧ュ繝・繝。繝ウ繝医r隕九l縺ー隗」豎コ縺ァ縺阪k雉ェ蝠上′繧医¥譚・縺セ縺吶ゆココ縺ォ雉ェ蝠上☆繧句燕縺ォ縲√∪縺壹ッ閾ェ蛻縺ァ隱ソ縺ケ繧九%縺ィ繧偵@縺ヲ縺上□縺輔>縲
+繝サ繝励Ο繧ー繝ゥ繝縺ョ蛻カ菴懆(AioiLight)縺ッ縲ゝJAPlayer3譛ャ菴(AioiLight.space縺九i繝繧ヲ繝ウ繝ュ繝シ繝峨@縺溘b縺ョ)縺ィ繝繝輔か繝ォ繝医ョ繧ケ繧ュ繝ウ縲郡impleStyle縲阪ョ繧オ繝昴シ繝医ョ縺ソ陦後>縺セ縺吶
+縲縺昴ョ莉悶ョ繧ケ繧ュ繝ウ(萓:譛ャ螳カ鬚ィ繧ケ繧ュ繝ウ)繧縲ゝJAPlayer3縺ョ謾ケ騾蜩(豢セ逕溘ン繝ォ繝)縺ョ繧オ繝昴シ繝医ッ蜴溷援陦後>縺セ縺帙s縺ョ縺ァ縺比コ謇ソ縺上□縺輔>縲
+繝サ縺吶∋縺ヲ縺ョ迺ー蠅縺ァ蜍穂ス懃「コ隱阪ッ縺ァ縺阪↑縺(縺ァ縺阪k縺ッ縺壹′縺ェ縺)縺ョ縺ァ縲∝虚縺縺溘i驕九′縺縺縲∫ィ句コヲ縺ァ縺企。倥>縺励∪縺吶
+縲繝峨く繝・繝。繝ウ繝医r隱ュ繧薙〒繧りァ」豎コ縺励↑縺九▲縺溘i縲∬ォヲ繧√∪縺励g縺縲りォヲ繧√b閧晏ソ縺ァ縺吶
+繝サ蟶ク譎60fps繧剃ソ昴※縺ェ縺ПC縺ァ縺ョ蜍穂ス懊ッ譛溷セ縺ァ縺阪∪縺帙s縲
+
+== 謫堺ス懈婿豕輔∵峇縺ョ霑ス蜉譁ケ豕輔∵峩譁ー諠蝣ア縺ェ縺ゥ ==
+https://aioilight.space/taiko/tjap3/
+繝峨く繝・繝。繝ウ繝医↓諠蝣ア縺碁寔繧√i繧後※縺繧九ョ縺ァ縲√◎繧後r縺願ェュ縺ソ縺上□縺輔>縲る囂譎よ峩譁ー縺励※縺縺セ縺吶
+
+== 繝繝輔か繝ォ繝医せ繧ュ繝ウ(SimpleStyle)縺ォ縺、縺縺ヲ ==
+荳驛ィ逕サ蜒上ッTJAPlayer2 forPC縺ョ繝繝輔か繝ォ繝医せ繧ュ繝ウ縺九i豬∫畑縺励※縺縺セ縺吶
+繝ゥ繧、繧サ繝ウ繧ケ縺ッMIT縺ョ繧ゅ→驕狗畑縺励※縺縺セ縺吶MIT繝ゥ繧、繧サ繝ウ繧ケ繧貞宍螳医☆繧句エ蜷医∵隼螟峨驟榊ク遲碓K縺ァ縺吶
+菴懈舌ヤ繝シ繝ォ: Photoshop/After Effects
+
+== 蜍慕判縲驟堺ソ。遲峨〒縺ョ縺泌茜逕ィ縺ォ縺、縺縺ヲ ==
+TJAPlayer3繧貞虚逕サ蜈ア譛峨し繧、繝医d繝ゥ繧、繝夜堺ソ。繧オ繝シ繝薙せ縲√え繧ァ繝悶し繧、繝医d繝悶Ο繧ー遲峨〒縺泌茜逕ィ縺ォ縺ェ繧峨l繧句エ蜷医
+繝舌Φ繝繧、繝翫Β繧ウ繧ィ繝ウ繧ソ繝シ繝繧、繝ウ繝。繝ウ繝亥ャ蠑上ョ繧ゅョ縺ァ縺ェ縺縺薙→縲∽サ悶ョ螟ェ鮠薙ョ驕比ココ繧キ繝溘Η繝ャ繝シ繧ソ繝シ縺ィ豺キ蜷後@縺ェ縺繧医≧驟肴ョ繧偵♀鬘倥>縺縺溘@縺セ縺吶
+縺セ縺溘√ち繧ー讖溯ス縺ョ縺ゅk繧オ繧、繝医ョ蝣エ蜷医√卦JAPlayer3縲阪卦JAP3縲阪→縺縺」縺溘ち繧ー繧剃サ倥¢繧九%縺ィ縺ァ縲
+莉悶す繝溘Η繝ャ繝シ繧ソ縺ィ縺ョ隱、隗」繧帝亟縺舌→縺ィ繧ゅ↓縲髢「騾」蜍慕判縺ィ縺励※蜃コ繧縺吶¥縺ェ繧九Γ繝ェ繝繝医′縺ゅk縺溘a縲∵耳螂ィ縺励∪縺吶
+
+== TJAPlayer3縺ョ謾ケ騾繝サ蜀埼榊ク(莠梧ャ。驟榊ク)繧定。後≧蝣エ蜷医↓縺、縺縺ヲ ==
+TJAPlayer3縲√ョ繝輔か繝ォ繝医せ繧ュ繝ウ縺ッMIT繝ゥ繧、繧サ繝ウ繧ケ縺ァ蛻カ菴懊&繧後※縺縺セ縺吶
+MIT繝ゥ繧、繧サ繝ウ繧ケ縺ョ繝ォ繝シ繝ォ縺ョ繧ゅ→縲∵隼騾繝サ蜀埼榊ク繧定。後≧縺薙→縺ッ閾ェ逕ア縺ァ縺吶′縲**蜈ィ縺ヲ閾ェ蟾ア雋ャ莉サ**縺ァ縺企。倥>縺励∪縺吶
+縺セ縺溘∽スソ逕ィ縺励※縺繧九Λ繧、繝悶Λ繝ェ縺ョ繝ゥ繧、繧サ繝ウ繧ケ荳翫**蠢縺**縲鍬icenses縲阪ヵ繧ゥ繝ォ繝繧貞酔譴ア縺ョ荳翫∵隼騾繝サ蜀埼榊ク繧偵♀鬘倥>縺励∪縺吶
+螟夜Κ繧ケ繧ュ繝ウ繧縲∬ュ憺擇繝代ャ繧ア繝シ繧ク繧貞酔譴ア縺吶k蝣エ蜷医ッ縲√◎繧後◇繧後ョ蛻カ菴懆縺ョ繝ォ繝シ繝ォ繧隕冗エ繧貞ョ医▲縺ヲ縺上□縺輔>縲
+縺薙l繧峨↓TJAPlayer3縺ョ繝ゥ繧、繧サ繝ウ繧ケ縺ッ驕ゥ逕ィ縺輔l縺セ縺帙s縲
+
+== 繧ケ繝壹す繝」繝ォ繧オ繝ウ繧ッ繧ケ ==
+FROM豌/yyagi豌 - DTXMania 髢狗匱閠
+kairera0467豌 - TJAPlayer2 forPC 髢狗匱閠
+繧阪∩繧ス橸シ滓ー - 繝舌げ蝣ア蜻翫∽ク榊キ蜷亥ア蜻
+繧ウ繝シ繧キ繝シ豌 - 繝舌げ蝣ア蜻翫∽ク榊キ蜷亥ア蜻
+twopointzero豌 - 繝励Ο繧ー繝ゥ繝縺ョ譛驕ゥ蛹
+
+
+== 荳榊キ蜷亥ア蜻翫騾」邨。蜈医↑縺ゥ ==
+
+=== 譌「遏・縺ョ蝠城。檎せ ===
+繝サ譌・譛ャ隱樒腸蠅縺ァ繧ゅ励Ο繧ー繝ゥ繝蜀驛ィ縺ァ縺ッ闍ア隱樒腸蠅縺ィ隱崎ュ倥&繧後※繧キ繧ケ繝繝繝。繝繧サ繝シ繧ク縺後⊇縺シ闍ア隱槭〒縺吶 竊歎er.1.5.6縺九i譌・譛ャ隱樒腸蠅縺ョ蝣エ蜷医ッ譌・譛ャ隱槭〒陦ィ遉コ縺輔l繧九h縺縺ォ縺ェ繧翫∪縺励◆縲
+繝サ繝繝ウ繧オ繝シ縲√Δ繝悶√Λ繝ウ繝翫シ逕サ蜒上ョ繧オ繧、繧コ縺悟、ァ縺阪>縺ィ迸ャ髢鍋噪縺ォ繧ォ繧ッ縺、縺上°繧ゅ@繧後∪縺帙s縲ゅ%繧後↓縺、縺縺ヲ縺ッ荳蠎ヲ蜀咲函縺吶k縺ィ逶エ繧翫∪縺吶や巽astRender繧丹N縺ォ縺吶l縺ー螟ァ謚オ縺ョPC縺ァ縺ッ繧ォ繧ッ縺、縺九★縺ォ蜀咲函縺輔l縺セ縺吶
+繝サ蜻ス莉、縺ィ蛟、縺ョ髢薙↓蜊願ァ偵せ繝壹シ繧ケ縺悟・縺」縺ヲ縺ェ縺縺ィ豁」蟶ク縺ォ蜀咲函縺輔l縺セ縺帙s縲(e.g. #SCROLL1.5)
+繝サ荳譖イ蜀咲函蠕後ョ譖イ縺ョ繧ス繝シ繝医′縺ァ縺阪∪縺帙s縲や剃ソョ豁」縺輔l縺セ縺励◆縲
+繝サ繧繧顔峩縺玲凾縺ォ縺オ縺縺帙s縺梧カ医∴縺セ縺吶
+繝サ隴憺擇蛻蟯舌ョ荳榊キ蜷医′縺縺上▽縺区ョ九▲縺溘∪縺セ縺ァ縺吶
+
+=== 雉ェ蝠上r縺吶k蜑阪↓ ===
+雉ェ蝠上r縺吶k蜑阪↓縲
+1.隱ソ縺ケ繧句燕縺ォ閠縺医k
+2.莠コ縺ォ閨槭¥蜑阪↓隱ソ縺ケ繧
+3.驕主悉縺ォ蜷後§繧医≧縺ェ雉ェ蝠上′縺ェ縺九▲縺溘°隱ソ縺ケ繧
+4.菴ソ逕ィ縺励※縺繧九ヱ繧ス繧ウ繝ウ縺ョ迺ー蠅縲√←縺縺縺蜍穂ス懊r縺励◆繧我ク榊キ蜷医r襍キ縺薙@縺溘°縺ョ驕守ィ狗ュ峨r豺サ縺医※騾」邨。縺吶k
+縺薙ョ4縺、縺ョ繝ォ繝シ繝ォ繧貞ョ医▲縺ヲ縺縺溘□縺代l縺ー蟷ク縺縺ァ縺吶ゅ←縺縺九h繧阪@縺上♀縺ュ縺後>縺励∪縺吶
+
+=== 蜷騾」邨。蜈 ===
+荳榊キ蜷亥ア蜻翫∵眠隕乗ゥ溯ス霑ス蜉縺ョ繝ェ繧ッ繧ィ繧ケ繝育ュ峨∝、ァ豁楢ソ弱〒縺吶
+Twitter: @TJAPlayer3
+繝。繝シ繝ォ: info@aioilight.space
+Discord: AioiLight#7839
+GitHub: https://github.com/AioiLight/TJAPlayer3
diff --git a/TJAPlayer3.sln b/TJAPlayer3.sln
new file mode 100644
index 00000000..ca03a716
--- /dev/null
+++ b/TJAPlayer3.sln
@@ -0,0 +1,45 @@
+サソ
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30621.155
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TJAPlayer3", "TJAPlayer3\TJAPlayer3.csproj", "{81BEC512-8074-4BD1-8A3C-AC73BC7BF846}"
+ ProjectSection(ProjectDependencies) = postProject
+ {BCD40908-F3E2-4707-BFAA-1DD99DF6357D} = {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FDK19", "FDK19\FDK19.csproj", "{BCD40908-F3E2-4707-BFAA-1DD99DF6357D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8559AC0D-9443-4CF6-A376-B72664B2DC0B}"
+ ProjectSection(SolutionItems) = preProject
+ Readme.txt = Readme.txt
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Debug|x86.ActiveCfg = Debug|x86
+ {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Debug|x86.Build.0 = Debug|x86
+ {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Release|x86.ActiveCfg = Release|x86
+ {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Release|x86.Build.0 = Release|x86
+ {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Debug|x86.ActiveCfg = Debug|x86
+ {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Debug|x86.Build.0 = Debug|x86
+ {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Release|x86.ActiveCfg = Release|x86
+ {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {20D6B8F0-EEEF-4E88-BC6A-DC1FF10E5AEA}
+ EndGlobalSection
+ GlobalSection(Performance) = preSolution
+ HasPerformanceSessions = true
+ EndGlobalSection
+ GlobalSection(Performance) = preSolution
+ HasPerformanceSessions = true
+ EndGlobalSection
+EndGlobal
diff --git a/TJAPlayer3/Animations/Animator.cs b/TJAPlayer3/Animations/Animator.cs
new file mode 100644
index 00000000..995946e8
--- /dev/null
+++ b/TJAPlayer3/Animations/Animator.cs
@@ -0,0 +1,119 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using TJAPlayer3;
+using FDK;
+
+namespace TJAPlayer3.Animations
+{
+ class Animator : IAnimatable
+ {
+ public Animator(int startValue, int endValue, int tickInterval, bool isLoop)
+ {
+ Type = CounterType.Normal;
+ StartValue = startValue;
+ EndValue = endValue;
+ TickInterval = tickInterval;
+ IsLoop = isLoop;
+ Counter = new CCounter();
+ }
+ public Animator(double startValue, double endValue, double tickInterval, bool isLoop)
+ {
+ Type = CounterType.Double;
+ StartValue = startValue;
+ EndValue = endValue;
+ TickInterval = tickInterval;
+ IsLoop = isLoop;
+ Counter = new CCounter();
+ }
+ public void Start()
+ {
+ if (Counter == null) throw new NullReferenceException();
+ switch (Type)
+ {
+ case CounterType.Normal:
+ Counter.t髢句ァ((int)StartValue, (int)EndValue, (int)TickInterval, TJAPlayer3.Timer);
+ break;
+ case CounterType.Double:
+ Counter.t髢句ァ((double)StartValue, (double)EndValue, (double)TickInterval, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝);
+ break;
+ default:
+ break;
+ }
+ }
+ public void Stop()
+ {
+ if (Counter == null) throw new NullReferenceException();
+ Counter.t蛛懈ュ「();
+ }
+ public void Reset()
+ {
+ if (Counter == null) throw new NullReferenceException();
+ Start();
+ }
+
+ public void Tick()
+ {
+ if (Counter == null) throw new NullReferenceException();
+ switch (Type)
+ {
+ case CounterType.Normal:
+ if (IsLoop) Counter.t騾イ陦鍬oop(); else Counter.t騾イ陦();
+ if (!IsLoop && Counter.b邨ゆコ蛟、縺ォ驕斐@縺) Stop();
+ break;
+ case CounterType.Double:
+ if (IsLoop) Counter.t騾イ陦鍬oopDb(); else Counter.t騾イ陦慧b();
+ if (!IsLoop && Counter.b邨ゆコ蛟、縺ォ驕斐@縺) Stop();
+ break;
+ default:
+ break;
+ }
+ }
+
+ public virtual object GetAnimation()
+ {
+ throw new NotImplementedException();
+ }
+
+
+
+ // 繝励Ο繝代ユ繧」
+ public CCounter Counter
+ {
+ get;
+ private set;
+ }
+ public CounterType Type
+ {
+ get;
+ private set;
+ }
+ public object StartValue
+ {
+ get;
+ private set;
+ }
+ public object EndValue
+ {
+ get;
+ private set;
+ }
+ public object TickInterval
+ {
+ get;
+ private set;
+ }
+ public bool IsLoop
+ {
+ get;
+ private set;
+ }
+ }
+
+ enum CounterType
+ {
+ Normal,
+ Double
+ }
+}
diff --git a/TJAPlayer3/Animations/EaseIn.cs b/TJAPlayer3/Animations/EaseIn.cs
new file mode 100644
index 00000000..a8031c32
--- /dev/null
+++ b/TJAPlayer3/Animations/EaseIn.cs
@@ -0,0 +1,38 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3.Animations
+{
+ ///
+ /// 繧、繝シ繧コ繧、繝ウ繧定。後≧繧ッ繝ゥ繧ケ縲
+ ///
+ class EaseIn : Animator
+ {
+ ///
+ /// 繧、繝シ繧コ繧、繝ウ繧貞晄悄蛹悶@縺セ縺吶
+ ///
+ /// 蟋狗せ縲
+ /// 邨らせ縲
+ /// 繧、繝シ繧ク繝ウ繧ー縺ォ縺九¢繧区凾髢薙
+ public EaseIn(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false)
+ {
+ StartPoint = startPoint;
+ EndPoint = endPoint;
+ Sa = EndPoint - StartPoint;
+ TimeMs = timeMs;
+ }
+
+ public override object GetAnimation()
+ {
+ var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs;
+ return ((double)Sa * persent * persent * persent) + StartPoint;
+ }
+
+ private readonly int StartPoint;
+ private readonly int EndPoint;
+ private readonly int Sa;
+ private readonly int TimeMs;
+ }
+}
diff --git a/TJAPlayer3/Animations/EaseInOut.cs b/TJAPlayer3/Animations/EaseInOut.cs
new file mode 100644
index 00000000..2b077582
--- /dev/null
+++ b/TJAPlayer3/Animations/EaseInOut.cs
@@ -0,0 +1,46 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3.Animations
+{
+ ///
+ /// 繧、繝シ繧コ繧、繝ウ繝サ繧「繧ヲ繝医r陦後≧繧ッ繝ゥ繧ケ縲
+ ///
+ class EaseInOut : Animator
+ {
+ ///
+ /// 繧、繝シ繧コ繧、繝ウ繝サ繧「繧ヲ繝医r蛻晄悄蛹悶@縺セ縺吶
+ ///
+ /// 蟋狗せ縲
+ /// 邨らせ縲
+ /// 繧、繝シ繧ク繝ウ繧ー縺ォ縺九¢繧区凾髢薙
+ public EaseInOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false)
+ {
+ StartPoint = startPoint;
+ EndPoint = endPoint;
+ Sa = EndPoint - StartPoint;
+ TimeMs = timeMs;
+ }
+
+ public override object GetAnimation()
+ {
+ var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs * 2.0;
+ if (persent < 1)
+ {
+ return ((double)Sa / 2.0 * persent * persent * persent) + StartPoint;
+ }
+ else
+ {
+ persent -= 2;
+ return ((double)Sa / 2.0 * ((persent * persent * persent) + 2)) + StartPoint;
+ }
+ }
+
+ private readonly int StartPoint;
+ private readonly int EndPoint;
+ private readonly int Sa;
+ private readonly int TimeMs;
+ }
+}
diff --git a/TJAPlayer3/Animations/EaseOut.cs b/TJAPlayer3/Animations/EaseOut.cs
new file mode 100644
index 00000000..3e6a03f9
--- /dev/null
+++ b/TJAPlayer3/Animations/EaseOut.cs
@@ -0,0 +1,39 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3.Animations
+{
+ ///
+ /// 繧、繝シ繧コ繧「繧ヲ繝医r陦後≧繧ッ繝ゥ繧ケ縲
+ ///
+ class EaseOut : Animator
+ {
+ ///
+ /// 繧、繝シ繧コ繧「繧ヲ繝医r蛻晄悄蛹悶@縺セ縺吶
+ ///
+ /// 蟋狗せ縲
+ /// 邨らせ縲
+ /// 繧、繝シ繧ク繝ウ繧ー縺ォ縺九¢繧区凾髢薙
+ public EaseOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false)
+ {
+ StartPoint = startPoint;
+ EndPoint = endPoint;
+ Sa = EndPoint - StartPoint;
+ TimeMs = timeMs;
+ }
+
+ public override object GetAnimation()
+ {
+ var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs;
+ persent -= 1;
+ return (double)Sa * (persent * persent * persent + 1) + StartPoint;
+ }
+
+ private readonly int StartPoint;
+ private readonly int EndPoint;
+ private readonly int Sa;
+ private readonly int TimeMs;
+ }
+}
diff --git a/TJAPlayer3/Animations/FadeIn.cs b/TJAPlayer3/Animations/FadeIn.cs
new file mode 100644
index 00000000..9e4a3521
--- /dev/null
+++ b/TJAPlayer3/Animations/FadeIn.cs
@@ -0,0 +1,34 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3.Animations
+{
+ ///
+ /// 繝輔ぉ繝シ繝峨う繝ウ繧定。後≧繧ッ繝ゥ繧ケ縲
+ ///
+ internal class FadeIn : Animator
+ {
+ ///
+ /// 繝輔ぉ繝シ繝峨う繝ウ繧貞晄悄蛹悶@縺セ縺吶
+ ///
+ /// 繝輔ぉ繝シ繝峨う繝ウ縺ォ謗帙¢繧狗ァ呈焚(繝溘Μ遘)
+ public FadeIn(int timems) : base(0, timems - 1, 1, false)
+ {
+ TimeMs = timems;
+ }
+
+ ///
+ /// 繝輔ぉ繝シ繝峨う繝ウ縺ョ荳埼乗主コヲ繧255谿オ髫弱〒霑斐@縺セ縺吶
+ ///
+ /// 荳埼乗主コヲ縲
+ public override object GetAnimation()
+ {
+ var opacity = base.Counter.n迴セ蝨ィ縺ョ蛟、 * 255 / TimeMs;
+ return opacity;
+ }
+
+ private readonly int TimeMs;
+ }
+}
diff --git a/TJAPlayer3/Animations/FadeOut.cs b/TJAPlayer3/Animations/FadeOut.cs
new file mode 100644
index 00000000..87989cf5
--- /dev/null
+++ b/TJAPlayer3/Animations/FadeOut.cs
@@ -0,0 +1,34 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3.Animations
+{
+ ///
+ /// 繝輔ぉ繝シ繝峨い繧ヲ繝医r陦後≧繧ッ繝ゥ繧ケ縲
+ ///
+ internal class FadeOut : Animator
+ {
+ ///
+ /// 繝輔ぉ繝シ繝峨い繧ヲ繝医r蛻晄悄蛹悶@縺セ縺吶
+ ///
+ /// 繝輔ぉ繝シ繝峨い繧ヲ繝医↓謗帙¢繧狗ァ呈焚(繝溘Μ遘)
+ public FadeOut(int timems) : base(0, timems - 1, 1, false)
+ {
+ TimeMs = timems;
+ }
+
+ ///
+ /// 繝輔ぉ繝シ繝峨い繧ヲ繝医ョ荳埼乗主コヲ繧255谿オ髫弱〒霑斐@縺セ縺吶
+ ///
+ /// 荳埼乗主コヲ縲
+ public override object GetAnimation()
+ {
+ var opacity = (TimeMs - base.Counter.n迴セ蝨ィ縺ョ蛟、) * 255 / TimeMs;
+ return opacity;
+ }
+
+ private readonly int TimeMs;
+ }
+}
diff --git a/TJAPlayer3/Animations/IAnimatable.cs b/TJAPlayer3/Animations/IAnimatable.cs
new file mode 100644
index 00000000..4e09befa
--- /dev/null
+++ b/TJAPlayer3/Animations/IAnimatable.cs
@@ -0,0 +1,35 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3.Animations
+{
+ ///
+ /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ 繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縲
+ ///
+ interface IAnimatable
+ {
+ ///
+ /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ繧帝幕蟋九@縺セ縺吶
+ ///
+ void Start();
+ ///
+ /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ繧貞●豁「縺励∪縺吶
+ ///
+ void Stop();
+ ///
+ /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ繧偵Μ繧サ繝繝医@縺セ縺吶
+ ///
+ void Reset();
+ ///
+ /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ縺ョ騾イ陦後r陦後>縺セ縺吶
+ ///
+ void Tick();
+ ///
+ /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ縺ョ繝代Λ繝。繝シ繧ソ繧定ソ斐@縺セ縺吶
+ ///
+ /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ縺ョ繝代Λ繝。繝シ繧ソ繧定ソ斐@縺セ縺吶
+ object GetAnimation();
+ }
+}
diff --git a/TJAPlayer3/Animations/Linear.cs b/TJAPlayer3/Animations/Linear.cs
new file mode 100644
index 00000000..c6d0b6f9
--- /dev/null
+++ b/TJAPlayer3/Animations/Linear.cs
@@ -0,0 +1,38 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3.Animations
+{
+ ///
+ /// 繝ェ繝九い遘サ蜍輔r陦後≧繧ッ繝ゥ繧ケ縲
+ ///
+ class Linear : Animator
+ {
+ ///
+ /// 繝ェ繝九い遘サ蜍輔r蛻晄悄蛹悶@縺セ縺吶
+ ///
+ /// 蟋狗せ縲
+ /// 邨らせ縲
+ /// 遘サ蜍輔↓縺九¢繧区凾髢薙
+ public Linear(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false)
+ {
+ StartPoint = startPoint;
+ EndPoint = endPoint;
+ Sa = EndPoint - StartPoint;
+ TimeMs = timeMs;
+ }
+
+ public override object GetAnimation()
+ {
+ var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs;
+ return (Sa * persent) + StartPoint;
+ }
+
+ private readonly int StartPoint;
+ private readonly int EndPoint;
+ private readonly int Sa;
+ private readonly int TimeMs;
+ }
+}
diff --git a/TJAPlayer3/Common/CActFlushGPU.cs b/TJAPlayer3/Common/CActFlushGPU.cs
new file mode 100644
index 00000000..ee28d54b
--- /dev/null
+++ b/TJAPlayer3/Common/CActFlushGPU.cs
@@ -0,0 +1,61 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using SlimDX.Direct3D9;
+using FDK;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 謠冗判繝輔Ξ繝シ繝豈弱↓GPU繧偵ヵ繝ゥ繝繧キ繝・縺励※縲∵緒逕サ驕蟒カ繧帝亟縺舌
+ /// DirectX9縺ョ縲^cclusion Query繧堤畑縺繧九(Flush螻樊ァ莉倥″縺ァGetData縺吶k)
+ /// Device Lost蟇セ遲悶ョ縺溘a縲_ueue繧辰Activitiy縺ョManaged繝ェ繧ス繝シ繧ケ縺ィ縺励※謇ア縺縲
+ /// On騾イ陦梧緒逕サ()繧貞他縺ウ蜃コ縺吶%縺ィ縺ァ縲;PU繧偵ヵ繝ゥ繝繧キ繝・縺吶k縲
+ ///
+ internal class CActFlushGPU : CActivity
+ {
+ // CActivity 螳溯」
+
+ public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()
+ {
+ if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ {
+ try // #xxxxx 2012.12.31 yyagi: to prepare flush, first of all, I create q queue to the GPU.
+ {
+ IDirect3DQuery9 = new Query(TJAPlayer3.app.Device.UnderlyingDevice, QueryType.Occlusion);
+ }
+ catch ( Exception e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (e5c7cd0b-f7bb-4bf1-9ad9-db27b43ff63d)" );
+ }
+ base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ }
+ }
+ public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()
+ {
+ IDirect3DQuery9.Dispose();
+ IDirect3DQuery9 = null;
+ base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ }
+ public override int On騾イ陦梧緒逕サ()
+ {
+ if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ {
+ IDirect3DQuery9.Issue( Issue.End );
+ DWM.Flush();
+ IDirect3DQuery9.GetData( true ); // flush GPU queue
+ }
+ return 0;
+ }
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private Query IDirect3DQuery9;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Common/CConfigIni.cs b/TJAPlayer3/Common/CConfigIni.cs
new file mode 100644
index 00000000..57dfd006
--- /dev/null
+++ b/TJAPlayer3/Common/CConfigIni.cs
@@ -0,0 +1,3066 @@
+サソusing System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.IO;
+using System.Diagnostics;
+using FDK;
+using FDK.ExtensionMethods;
+
+namespace TJAPlayer3
+{
+ internal class CConfigIni : INotifyPropertyChanged
+ {
+ private const int MinimumKeyboardSoundLevelIncrement = 1;
+ private const int MaximumKeyboardSoundLevelIncrement = 20;
+ private const int DefaultKeyboardSoundLevelIncrement = 5;
+
+ // 繧ッ繝ゥ繧ケ
+
+ #region [ CKeyAssign ]
+ public class CKeyAssign
+ {
+ public class CKeyAssignPad
+ {
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] HH
+ {
+ get
+ {
+ return this.padHH_R;
+ }
+ set
+ {
+ this.padHH_R = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] R
+ {
+ get
+ {
+ return this.padHH_R;
+ }
+ set
+ {
+ this.padHH_R = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] SD
+ {
+ get
+ {
+ return this.padSD_G;
+ }
+ set
+ {
+ this.padSD_G = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] G
+ {
+ get
+ {
+ return this.padSD_G;
+ }
+ set
+ {
+ this.padSD_G = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] BD
+ {
+ get
+ {
+ return this.padBD_B;
+ }
+ set
+ {
+ this.padBD_B = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] B
+ {
+ get
+ {
+ return this.padBD_B;
+ }
+ set
+ {
+ this.padBD_B = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] HT
+ {
+ get
+ {
+ return this.padHT_Pick;
+ }
+ set
+ {
+ this.padHT_Pick = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] Pick
+ {
+ get
+ {
+ return this.padHT_Pick;
+ }
+ set
+ {
+ this.padHT_Pick = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LT
+ {
+ get
+ {
+ return this.padLT_Wail;
+ }
+ set
+ {
+ this.padLT_Wail = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] Wail
+ {
+ get
+ {
+ return this.padLT_Wail;
+ }
+ set
+ {
+ this.padLT_Wail = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] FT
+ {
+ get
+ {
+ return this.padFT_Cancel;
+ }
+ set
+ {
+ this.padFT_Cancel = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] Cancel
+ {
+ get
+ {
+ return this.padFT_Cancel;
+ }
+ set
+ {
+ this.padFT_Cancel = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] CY
+ {
+ get
+ {
+ return this.padCY_Decide;
+ }
+ set
+ {
+ this.padCY_Decide = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] Decide
+ {
+ get
+ {
+ return this.padCY_Decide;
+ }
+ set
+ {
+ this.padCY_Decide = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] HHO
+ {
+ get
+ {
+ return this.padHHO;
+ }
+ set
+ {
+ this.padHHO = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] RD
+ {
+ get
+ {
+ return this.padRD;
+ }
+ set
+ {
+ this.padRD = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LC
+ {
+ get
+ {
+ return this.padLC;
+ }
+ set
+ {
+ this.padLC = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LP
+ {
+ get
+ {
+ return this.padLP;
+ }
+ set
+ {
+ this.padLP = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LBD
+ {
+ get
+ {
+ return this.padLBD;
+ }
+ set
+ {
+ this.padLBD = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] Capture
+ {
+ get
+ {
+ return this.padCapture;
+ }
+ set
+ {
+ this.padCapture = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed
+ {
+ get
+ {
+ return this.padLRed;
+ }
+ set
+ {
+ this.padLRed = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed
+ {
+ get
+ {
+ return this.padRRed;
+ }
+ set
+ {
+ this.padRRed = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue
+ {
+ get
+ {
+ return this.padLBlue;
+ }
+ set
+ {
+ this.padLBlue = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue
+ {
+ get
+ {
+ return this.padRBlue;
+ }
+ set
+ {
+ this.padRBlue = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed2P
+ {
+ get
+ {
+ return this.padLRed2P;
+ }
+ set
+ {
+ this.padLRed2P = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed2P
+ {
+ get
+ {
+ return this.padRRed2P;
+ }
+ set
+ {
+ this.padRRed2P = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue2P
+ {
+ get
+ {
+ return this.padLBlue2P;
+ }
+ set
+ {
+ this.padLBlue2P = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue2P
+ {
+ get
+ {
+ return this.padRBlue2P;
+ }
+ set
+ {
+ this.padRBlue2P = value;
+ }
+ }
+ public CConfigIni.CKeyAssign.STKEYASSIGN[] this[ int index ]
+ {
+ get
+ {
+ switch ( index )
+ {
+ case (int) EKeyConfigPad.HH:
+ return this.padHH_R;
+
+ case (int) EKeyConfigPad.SD:
+ return this.padSD_G;
+
+ case (int) EKeyConfigPad.BD:
+ return this.padBD_B;
+
+ case (int) EKeyConfigPad.HT:
+ return this.padHT_Pick;
+
+ case (int) EKeyConfigPad.LT:
+ return this.padLT_Wail;
+
+ case (int) EKeyConfigPad.FT:
+ return this.padFT_Cancel;
+
+ case (int) EKeyConfigPad.CY:
+ return this.padCY_Decide;
+
+ case (int) EKeyConfigPad.HHO:
+ return this.padHHO;
+
+ case (int) EKeyConfigPad.RD:
+ return this.padRD;
+
+ case (int) EKeyConfigPad.LC:
+ return this.padLC;
+
+ case (int) EKeyConfigPad.LP: // #27029 2012.1.4 from
+ return this.padLP; //
+
+ case (int) EKeyConfigPad.LBD: // #27029 2012.1.4 from
+ return this.padLBD; //
+
+ case (int) EKeyConfigPad.LRed:
+ return this.padLRed;
+
+ case (int) EKeyConfigPad.RRed:
+ return this.padRRed;
+
+ case (int) EKeyConfigPad.LBlue:
+ return this.padLBlue;
+
+ case (int) EKeyConfigPad.RBlue:
+ return this.padRBlue;
+
+ case (int) EKeyConfigPad.LRed2P:
+ return this.padLRed2P;
+
+ case (int) EKeyConfigPad.RRed2P:
+ return this.padRRed2P;
+
+ case (int) EKeyConfigPad.LBlue2P:
+ return this.padLBlue2P;
+
+ case (int) EKeyConfigPad.RBlue2P:
+ return this.padRBlue2P;
+
+ case (int) EKeyConfigPad.Capture:
+ return this.padCapture;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch ( index )
+ {
+ case (int) EKeyConfigPad.HH:
+ this.padHH_R = value;
+ return;
+
+ case (int) EKeyConfigPad.SD:
+ this.padSD_G = value;
+ return;
+
+ case (int) EKeyConfigPad.BD:
+ this.padBD_B = value;
+ return;
+
+ case (int) EKeyConfigPad.Pick:
+ this.padHT_Pick = value;
+ return;
+
+ case (int) EKeyConfigPad.LT:
+ this.padLT_Wail = value;
+ return;
+
+ case (int) EKeyConfigPad.FT:
+ this.padFT_Cancel = value;
+ return;
+
+ case (int) EKeyConfigPad.CY:
+ this.padCY_Decide = value;
+ return;
+
+ case (int) EKeyConfigPad.HHO:
+ this.padHHO = value;
+ return;
+
+ case (int) EKeyConfigPad.RD:
+ this.padRD = value;
+ return;
+
+ case (int) EKeyConfigPad.LC:
+ this.padLC = value;
+ return;
+
+ case (int) EKeyConfigPad.LP:
+ this.padLP = value;
+ return;
+
+ case (int) EKeyConfigPad.LBD:
+ this.padLBD = value;
+ return;
+
+ case (int) EKeyConfigPad.LRed:
+ this.padLRed = value;
+ return;
+
+ case (int) EKeyConfigPad.RRed:
+ this.padRRed = value;
+ return;
+
+ case (int) EKeyConfigPad.LBlue:
+ this.padLBlue = value;
+ return;
+
+ case (int) EKeyConfigPad.RBlue:
+ this.padRBlue = value;
+ return;
+
+ case (int) EKeyConfigPad.LRed2P:
+ this.padLRed2P = value;
+ return;
+
+ case (int) EKeyConfigPad.RRed2P:
+ this.padRRed2P = value;
+ return;
+
+ case (int) EKeyConfigPad.LBlue2P:
+ this.padLBlue2P = value;
+ return;
+
+ case (int) EKeyConfigPad.RBlue2P:
+ this.padRBlue2P = value;
+ return;
+
+ case (int) EKeyConfigPad.Capture:
+ this.padCapture = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+
+ #region [ private ]
+ //-----------------
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padBD_B;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padCY_Decide;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padFT_Cancel;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padHH_R;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padHHO;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padHT_Pick;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLC;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLT_Wail;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padRD;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padSD_G;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLP;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBD;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed2P;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue2P;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed2P;
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue2P;
+
+ private CConfigIni.CKeyAssign.STKEYASSIGN[] padCapture;
+ //-----------------
+ #endregion
+ }
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STKEYASSIGN
+ {
+ public E蜈・蜉帙ョ繝舌う繧ケ 蜈・蜉帙ョ繝舌う繧ケ;
+ public int ID;
+ public int 繧ウ繝シ繝;
+ public STKEYASSIGN( E蜈・蜉帙ョ繝舌う繧ケ DeviceType, int nID, int nCode )
+ {
+ this.蜈・蜉帙ョ繝舌う繧ケ = DeviceType;
+ this.ID = nID;
+ this.繧ウ繝シ繝 = nCode;
+ }
+ }
+
+ public CKeyAssignPad Bass = new CKeyAssignPad();
+ public CKeyAssignPad Drums = new CKeyAssignPad();
+ public CKeyAssignPad Guitar = new CKeyAssignPad();
+ public CKeyAssignPad Taiko = new CKeyAssignPad();
+ public CKeyAssignPad System = new CKeyAssignPad();
+ public CKeyAssignPad this[ int index ]
+ {
+ get
+ {
+ switch( index )
+ {
+ case (int) EKeyConfigPart.DRUMS:
+ return this.Drums;
+
+ case (int) EKeyConfigPart.GUITAR:
+ return this.Guitar;
+
+ case (int) EKeyConfigPart.BASS:
+ return this.Bass;
+
+ case (int) EKeyConfigPart.TAIKO:
+ return this.Taiko;
+
+ case (int) EKeyConfigPart.SYSTEM:
+ return this.System;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch( index )
+ {
+ case (int) EKeyConfigPart.DRUMS:
+ this.Drums = value;
+ return;
+
+ case (int) EKeyConfigPart.GUITAR:
+ this.Guitar = value;
+ return;
+
+ case (int) EKeyConfigPart.BASS:
+ this.Bass = value;
+ return;
+
+ case (int) EKeyConfigPart.TAIKO:
+ this.Taiko = value;
+ return;
+
+ case (int) EKeyConfigPart.SYSTEM:
+ this.System = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+ #endregion
+
+ //
+ public enum ESoundDeviceTypeForConfig
+ {
+ ACM = 0,
+ // DirectSound,
+ ASIO,
+ WASAPI,
+ Unknown=99
+ }
+ // 繝励Ο繝代ユ繧」
+
+#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹
+ //----------------------------------------
+ public float[,] fGaugeFactor = new float[5,2];
+ public float[] fDamageLevelFactor = new float[3];
+ //----------------------------------------
+#endif
+ public int nBGAlpha;
+ public bool bAVI譛牙柑;
+ public bool bBGA譛牙柑;
+ public bool bBGM髻ウ繧堤匱螢ー縺吶k;
+ public STDGBVALUE bHidden;
+ public STDGBVALUE bLeft;
+ public STDGBVALUE bLight;
+ public bool bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉;
+ public bool bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉;
+ public bool bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉;
+ public STDGBVALUE bReverse;
+
+ public E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ;
+ public STDGBVALUE e蛻、螳壻ス咲スョ; // #33891 2014.6.26 yyagi
+ public bool bScoreIni繧貞コ蜉帙☆繧;
+ public bool bSTAGEFAILED譛牙柑;
+ public STDGBVALUE bSudden;
+ public bool bTight;
+ public STDGBVALUE bGraph; // #24074 2011.01.23 add ikanick
+ public bool bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑;
+ public bool b繧ケ繝医う繝繧ッ繝「繝シ繝;
+ public bool b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k;
+ public bool b繝ュ繧ー蜃コ蜉;
+ public bool b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k;
+ public bool b蝙ら峩蟶ー邱壼セ縺。繧定。後≧;
+ public bool b蜈ィ逕サ髱「繝「繝シ繝;
+ public int n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX; // #30675 2013.02.04 ikanick add
+ public int n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY;
+ public int n繧ヲ繧、繝ウ繝峨えwidth; // #23510 2010.10.31 yyagi add
+ public int n繧ヲ繧、繝ウ繝峨えheight; // #23510 2010.10.31 yyagi add
+ public Dictionary dicJoystick;
+ public E繝繝シ繧ッ繝「繝シ繝 eDark;
+ public STDGBVALUE eRandom;
+ public E繝繝。繝シ繧ク繝ャ繝吶Ν e繝繝。繝シ繧ク繝ャ繝吶Ν;
+ public CKeyAssign KeyAssign;
+ public int n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s; // #23568 2010.11.04 ikanick add
+ public int n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s; // #xxxxx 2011.11.27 yyagi add
+ public int n貍泌・城溷コヲ;
+ public bool b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺;
+ public int n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms;
+ public int n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms;
+
+ private bool _applyLoudnessMetadata;
+
+ public bool ApplyLoudnessMetadata
+ {
+ get => _applyLoudnessMetadata;
+ set => SetProperty(ref _applyLoudnessMetadata, value, nameof(ApplyLoudnessMetadata));
+ }
+
+ private double _targetLoudness;
+
+ public double TargetLoudness
+ {
+ get => _targetLoudness;
+ set => SetProperty(ref _targetLoudness, value, nameof(TargetLoudness));
+ }
+
+ private bool _applySongVol;
+
+ public bool ApplySongVol
+ {
+ get => _applySongVol;
+ set => SetProperty(ref _applySongVol, value, nameof(ApplySongVol));
+ }
+
+ private int _soundEffectLevel;
+
+ public int SoundEffectLevel
+ {
+ get => _soundEffectLevel;
+ set => SetProperty(ref _soundEffectLevel, value, nameof(SoundEffectLevel));
+ }
+
+ private int _voiceLevel;
+
+ public int VoiceLevel
+ {
+ get => _voiceLevel;
+ set => SetProperty(ref _voiceLevel, value, nameof(VoiceLevel));
+ }
+
+ private int _songPreviewLevel;
+
+ public int SongPreviewLevel
+ {
+ get => _songPreviewLevel;
+ set => SetProperty(ref _songPreviewLevel, value, nameof(SongPlaybackLevel));
+ }
+
+ private int _songPlaybackLevel;
+
+ public int SongPlaybackLevel
+ {
+ get => _songPlaybackLevel;
+ set => SetProperty(ref _songPlaybackLevel, value, nameof(SongPlaybackLevel));
+ }
+
+ private int _keyboardSoundLevelIncrement;
+
+ public int KeyboardSoundLevelIncrement
+ {
+ get => _keyboardSoundLevelIncrement;
+ set => SetProperty(
+ ref _keyboardSoundLevelIncrement,
+ value.Clamp(MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement),
+ nameof(KeyboardSoundLevelIncrement));
+ }
+
+ public STDGBVALUE n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚;
+ public STDGBVALUE n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ;
+ public string strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ;
+ public string str譖イ繝繝シ繧ソ讀懃エ「繝代せ;
+ public string FontName;
+ public string BoxFontName;
+ public bool bBranchGuide;
+ public int nScoreMode;
+ public int nDefaultCourse; //2017.01.30 DD 繝繝輔か繝ォ繝医〒繧ォ繝シ繧ス繝ォ繧偵≠繧上○繧矩屮譏灘コヲ
+
+
+ public int nPlayerCount; //2017.08.18 kairera0467 繝槭Ν繝√励Ξ繧、蟇セ蠢
+ public bool b螟ェ鮠薙ヱ繝シ繝AutoPlay;
+ public bool b螟ェ鮠薙ヱ繝シ繝AutoPlay2P; //2017.08.16 kairera0467 繝槭Ν繝√励Ξ繧、蟇セ蠢
+ public bool bAuto蜈育函縺ョ騾」謇;
+ public bool b螟ァ髻ウ隨ヲ蛻、螳;
+ public int n荳。謇句愛螳壹ョ蠕縺。譎る俣;
+ public int nBranchAnime;
+
+ public bool bJudgeCountDisplay;
+
+ public bool bEnableCountdownTimer;
+
+ // 蜷逕サ蜒上ョ陦ィ遉コ繝サ髱櫁。ィ遉コ險ュ螳
+ public bool ShowChara;
+ public bool ShowDancer;
+ public bool ShowRunner;
+ public bool ShowFooter;
+ public bool ShowMob;
+ public bool ShowPuchiChara; // 繝ェ繧カ繝シ繝
+ //
+
+ public EScrollMode eScrollMode = EScrollMode.Normal;
+ public bool b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 = false;
+
+ public bool bHispeedRandom;
+ public E繧ケ繝繝ォ繧ケ繝「繝シ繝 eSTEALTH;
+ public bool bNoInfo;
+
+ public int nDefaultSongSort;
+
+ public EGame eGameMode;
+ public int TokkunSkipMeasures;
+ public int TokkunMashInterval;
+ public bool bSuperHard = false;
+ public bool bTokkunMode = false;
+ public bool bJust;
+
+ public bool bEndingAnime = false; // 2017.01.27 DD 縲後∪縺滄♀繧薙〒縺ュ縲咲判髱「縺ョ譛牙柑/辟。蜉ケ繧ェ繝励す繝ァ繝ウ霑ス蜉
+
+
+ public STDGBVALUE 蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ;
+// public int n繝上う繝上ャ繝亥繧頑昏縺ヲ荳矩剞Velocity;
+// public int n蛻繧頑昏縺ヲ荳矩剞Velocity; // #23857 2010.12.12 yyagi VelocityMin
+ public int nInputAdjustTimeMs;
+ public STDGBVALUE nJudgeLinePosOffset; // #31602 2013.6.23 yyagi 蛻、螳壹Λ繧、繝ウ陦ィ遉コ菴咲スョ縺ョ繧ェ繝輔そ繝繝
+ public bool bIsAutoResultCapture; // #25399 2011.6.9 yyagi 繝ェ繧カ繝ォ繝育判蜒剰ェ蜍穂ソ晏ュ俶ゥ溯ス縺ョON/OFF蛻カ蠕。
+ public int nPoliphonicSounds; // #28228 2012.5.1 yyagi 繝ャ繝シ繝ウ豈弱ョ譛螟ァ蜷梧凾逋コ髻ウ謨ー
+ public bool b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧;
+ public bool bIsEnabledSystemMenu; // #28200 2012.5.1 yyagi System Menu縺ョ菴ソ逕ィ蜿ッ蜷ヲ蛻譖ソ
+ public string strSystemSkinSubfolderFullName; // #28195 2012.5.2 yyagi Skin蛻譖ソ逕ィ System/莉・荳九ョ繧オ繝悶ヵ繧ゥ繝ォ繝蜷
+ public bool bConfigIni縺後↑縺縺汽TXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧
+ {
+ get
+ {
+ return ( !this.bConfigIni縺悟ュ伜惠縺励※縺繧 || !TJAPlayer3.VERSION.Equals( this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ ) );
+ }
+ }
+ public bool bEnter縺後く繝シ蜑イ繧雁ス薙※縺ョ縺ゥ縺薙↓繧ゆスソ逕ィ縺輔l縺ヲ縺縺ェ縺
+ {
+ get
+ {
+ for( int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++ )
+ {
+ for( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ )
+ {
+ for( int k = 0; k < 0x10; k++ )
+ {
+ if( ( this.KeyAssign[ i ][ j ][ k ].蜈・蜉帙ョ繝舌う繧ケ == E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝 ) && ( this.KeyAssign[ i ][ j ][ k ].繧ウ繝シ繝 == (int)SlimDXKeys.Key.Return ) )
+ {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+ }
+ public bool b繧ヲ繧」繝ウ繝峨え繝「繝シ繝
+ {
+ get
+ {
+ return !this.b蜈ィ逕サ髱「繝「繝シ繝;
+ }
+ set
+ {
+ this.b蜈ィ逕サ髱「繝「繝シ繝 = !value;
+ }
+ }
+ public bool b貍泌・乗ュ蝣ア繧定。ィ遉コ縺励↑縺
+ {
+ get
+ {
+ return !this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k;
+ }
+ set
+ {
+ this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = !value;
+ }
+ }
+ public int n閭梧勹縺ョ騾城℃蠎ヲ
+ {
+ get
+ {
+ return this.nBGAlpha;
+ }
+ set
+ {
+ if( value < 0 )
+ {
+ this.nBGAlpha = 0;
+ }
+ else if( value > 0xff )
+ {
+ this.nBGAlpha = 0xff;
+ }
+ else
+ {
+ this.nBGAlpha = value;
+ }
+ }
+ }
+ public int nRisky; // #23559 2011.6.20 yyagi Risky縺ァ縺ョ谿九Α繧ケ謨ー縲0縺ァ髢牙コ
+ public bool bIsAllowedDoubleClickFullscreen; // #26752 2011.11.27 yyagi 繝繝悶Ν繧ッ繝ェ繝繧ッ縺励※繧ゅヵ繝ォ繧ケ繧ッ繝ェ繝シ繝ウ縺ォ遘サ陦後@縺ェ縺
+ public STAUTOPLAY bAutoPlay;
+ public int nSoundDeviceType; // #24820 2012.12.23 yyagi 蜃コ蜉帙し繧ヲ繝ウ繝峨ョ繝舌う繧ケ(0=ACM(縺ォ縺励◆縺縺瑚ィュ險医′縺阪▽縺昴≧縺ェ繧吋irectShow), 1=ASIO, 2=WASAPI)
+ public int nWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi WASAPI縺ョ繝舌ャ繝輔ぃ繧オ繧、繧コ
+// public int nASIOBufferSizeMs; // #24820 2012.12.28 yyagi ASIO縺ョ繝舌ャ繝輔ぃ繧オ繧、繧コ
+ public int nASIODevice; // #24820 2013.1.17 yyagi ASIO繝繝舌う繧ケ
+ public bool bUseOSTimer; // #33689 2014.6.6 yyagi 貍泌・上ち繧、繝槭シ縺ョ遞ョ鬘
+ public bool bDynamicBassMixerManagement; // #24820
+ public bool bTimeStretch; // #23664 2013.2.24 yyagi 繝斐ャ繝∝、画峩辟。縺励〒蜀咲函騾溷コヲ繧貞、画峩縺吶k縺九←縺縺
+ public STDGBVALUE eInvisible; // #32072 2013.9.20 yyagi 繝√ャ繝励r髱櫁。ィ遉コ縺ォ縺吶k
+ public int nDisplayTimesMs, nFadeoutTimeMs;
+
+ public STDGBVALUE nViewerScrollSpeed;
+ public bool bViewerVSyncWait;
+ public bool bViewerShowDebugStatus;
+ public bool bViewerTimeStretch;
+ public bool bViewerDrums譛牙柑, bViewerGuitar譛牙柑;
+ //public bool bNoMP3Streaming; // 2014.4.14 yyagi; mp3縺ョ繧キ繝シ繧ッ菴咲スョ縺後♀縺九@縺上↑繧句エ蜷医ッ縲√%繧後rtrue縺ォ縺吶k縺薙→縺ァ縲『av縺ォ繝繧ウ繝シ繝峨@縺ヲ縺九i繧ェ繝ウ繝。繝「繝ェ蜀咲函縺吶k
+ public int nMasterVolume;
+ public bool ShinuchiMode; // 逵滓遠繝「繝シ繝
+ public bool FastRender; // 莠句燕逕サ蜒乗緒逕サ繝「繝シ繝
+ public int MusicPreTimeMs; // 髻ウ貅仙咲函蜑阪ョ蠕讖滓凾髢杜s
+ ///
+ /// Discord縺ョRitch Presence縺ォ蜀咲函荳ュ縺ョ.tja繝輔ぃ繧、繝ォ縺ョ諠蝣ア繧帝∽ソ。縺吶k縺九←縺縺九
+ ///
+ public bool SendDiscordPlayingInformation;
+#if false
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STAUTOPLAY // C螳壽焚縺ョE繝ャ繝シ繝ウ縺ィindex繧剃ク閾エ縺輔○繧九%縺ィ
+ {
+ public bool LC; // 0
+ public bool HH; // 1
+ public bool SD; // 2
+ public bool BD; // 3
+ public bool HT; // 4
+ public bool LT; // 5
+ public bool FT; // 6
+ public bool CY; // 7
+ public bool RD; // 8
+ public bool Guitar; // 9 (not used)
+ public bool Bass; // 10 (not used)
+ public bool GtR; // 11
+ public bool GtG; // 12
+ public bool GtB; // 13
+ public bool GtPick; // 14
+ public bool GtW; // 15
+ public bool BsR; // 16
+ public bool BsG; // 17
+ public bool BsB; // 18
+ public bool BsPick; // 19
+ public bool BsW; // 20
+ public bool this[ int index ]
+ {
+ get
+ {
+ switch ( index )
+ {
+ case (int) E繝ャ繝シ繝ウ.LC:
+ return this.LC;
+ case (int) E繝ャ繝シ繝ウ.HH:
+ return this.HH;
+ case (int) E繝ャ繝シ繝ウ.SD:
+ return this.SD;
+ case (int) E繝ャ繝シ繝ウ.BD:
+ return this.BD;
+ case (int) E繝ャ繝シ繝ウ.HT:
+ return this.HT;
+ case (int) E繝ャ繝シ繝ウ.LT:
+ return this.LT;
+ case (int) E繝ャ繝シ繝ウ.FT:
+ return this.FT;
+ case (int) E繝ャ繝シ繝ウ.CY:
+ return this.CY;
+ case (int) E繝ャ繝シ繝ウ.RD:
+ return this.RD;
+ case (int) E繝ャ繝シ繝ウ.Guitar:
+ return this.Guitar;
+ case (int) E繝ャ繝シ繝ウ.Bass:
+ return this.Bass;
+ case (int) E繝ャ繝シ繝ウ.GtR:
+ return this.GtR;
+ case (int) E繝ャ繝シ繝ウ.GtG:
+ return this.GtG;
+ case (int) E繝ャ繝シ繝ウ.GtB:
+ return this.GtB;
+ case (int) E繝ャ繝シ繝ウ.GtPick:
+ return this.GtPick;
+ case (int) E繝ャ繝シ繝ウ.GtW:
+ return this.GtW;
+ case (int) E繝ャ繝シ繝ウ.BsR:
+ return this.BsR;
+ case (int) E繝ャ繝シ繝ウ.BsG:
+ return this.BsG;
+ case (int) E繝ャ繝シ繝ウ.BsB:
+ return this.BsB;
+ case (int) E繝ャ繝シ繝ウ.BsPick:
+ return this.BsPick;
+ case (int) E繝ャ繝シ繝ウ.BsW:
+ return this.BsW;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch ( index )
+ {
+ case (int) E繝ャ繝シ繝ウ.LC:
+ this.LC = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.HH:
+ this.HH = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.SD:
+ this.SD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BD:
+ this.BD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.HT:
+ this.HT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.LT:
+ this.LT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.FT:
+ this.FT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.CY:
+ this.CY = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.RD:
+ this.RD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.Guitar:
+ this.Guitar = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.Bass:
+ this.Bass = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtR:
+ this.GtR = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtG:
+ this.GtG = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtB:
+ this.GtB = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtPick:
+ this.GtPick = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtW:
+ this.GtW = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsR:
+ this.BsR = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsG:
+ this.BsG = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsB:
+ this.BsB = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsPick:
+ this.BsPick = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsW:
+ this.BsW = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+#endif
+ #region [ STRANGE ]
+ public STRANGE n繝偵ャ繝育ッ蝗イms;
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STRANGE
+ {
+ public int Perfect;
+ public int Great;
+ public int Good;
+ public int Poor;
+ public int this[ int index ]
+ {
+ get
+ {
+ switch( index )
+ {
+ case 0:
+ return this.Perfect;
+
+ case 1:
+ return this.Great;
+
+ case 2:
+ return this.Good;
+
+ case 3:
+ return this.Poor;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch( index )
+ {
+ case 0:
+ this.Perfect = value;
+ return;
+
+ case 1:
+ this.Great = value;
+ return;
+
+ case 2:
+ this.Good = value;
+ return;
+
+ case 3:
+ this.Poor = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+ #endregion
+ #region [ STLANEVALUE ]
+ public STLANEVALUE nVelocityMin;
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STLANEVALUE
+ {
+ public int LC;
+ public int HH;
+ public int SD;
+ public int BD;
+ public int HT;
+ public int LT;
+ public int FT;
+ public int CY;
+ public int RD;
+ public int LP;
+ public int LBD;
+ public int Guitar;
+ public int Bass;
+ public int this[ int index ]
+ {
+ get
+ {
+ switch( index )
+ {
+ case 0:
+ return this.LC;
+
+ case 1:
+ return this.HH;
+
+ case 2:
+ return this.SD;
+
+ case 3:
+ return this.BD;
+
+ case 4:
+ return this.HT;
+
+ case 5:
+ return this.LT;
+
+ case 6:
+ return this.FT;
+
+ case 7:
+ return this.CY;
+
+ case 8:
+ return this.RD;
+
+ case 9:
+ return this.LP;
+
+ case 10:
+ return this.LBD;
+
+ case 11:
+ return this.Guitar;
+
+ case 12:
+ return this.Bass;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch( index )
+ {
+ case 0:
+ this.LC = value;
+ return;
+
+ case 1:
+ this.HH = value;
+ return;
+
+ case 2:
+ this.SD = value;
+ return;
+
+ case 3:
+ this.BD = value;
+ return;
+
+ case 4:
+ this.HT = value;
+ return;
+
+ case 5:
+ this.LT = value;
+ return;
+
+ case 6:
+ this.FT = value;
+ return;
+
+ case 7:
+ this.CY = value;
+ return;
+
+ case 8:
+ this.RD = value;
+ return;
+
+ case 9:
+ this.LP = value;
+ return;
+
+ case 10:
+ this.LBD = value;
+ return;
+
+ case 11:
+ this.Guitar = value;
+ return;
+
+ case 12:
+ this.Bass = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+ #endregion
+
+
+ #region[Ver.K霑ス蜉繧ェ繝励す繝ァ繝ウ]
+ //--------------------------
+ //繧イ繝シ繝蜀縺ョ繧ェ繝励す繝ァ繝ウ縺ォ蜉縺医※縲
+ //繧キ繧ケ繝繝蜻ィ繧翫ョ繧ェ繝励す繝ァ繝ウ繧ゅ%縺ョ繝悶Ο繝繧ッ縺ァ險倩ソー縺励※縺繧九
+ #region[Display]
+ //--------------------------
+ public EClipDispType eClipDispType;
+ #endregion
+
+ #region[Position]
+ public E繝ャ繝シ繝ウ繧ソ繧、繝 eLaneType;
+ public E繝溘Λ繝シ eMirror;
+
+ #endregion
+ #region[System]
+ public bool bDirectShowMode;
+ #endregion
+
+ //--------------------------
+ #endregion
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CConfigIni()
+ {
+#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹
+ //----------------------------------------
+ this.fGaugeFactor[0,0] = 0.004f;
+ this.fGaugeFactor[0,1] = 0.006f;
+ this.fGaugeFactor[1,0] = 0.002f;
+ this.fGaugeFactor[1,1] = 0.003f;
+ this.fGaugeFactor[2,0] = 0.000f;
+ this.fGaugeFactor[2,1] = 0.000f;
+ this.fGaugeFactor[3,0] = -0.020f;
+ this.fGaugeFactor[3,1] = -0.030f;
+ this.fGaugeFactor[4,0] = -0.050f;
+ this.fGaugeFactor[4,1] = -0.050f;
+
+ this.fDamageLevelFactor[0] = 0.5f;
+ this.fDamageLevelFactor[1] = 1.0f;
+ this.fDamageLevelFactor[2] = 1.5f;
+ //----------------------------------------
+#endif
+ this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = "Unknown";
+ this.str譖イ繝繝シ繧ソ讀懃エ「繝代せ = @".\";
+ this.b蜈ィ逕サ髱「繝「繝シ繝 = false;
+ this.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = true;
+ this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX = 0; // #30675 2013.02.04 ikanick add
+ this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY = 0;
+ this.n繧ヲ繧、繝ウ繝峨えwidth = SampleFramework.GameWindowSize.Width; // #23510 2010.10.31 yyagi add
+ this.n繧ヲ繧、繝ウ繝峨えheight = SampleFramework.GameWindowSize.Height; //
+ this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s = -1; // #xxxxx 2011.11.27 yyagi add
+ this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s = 1; // #23568 2010.11.04 ikanick add
+ this._bGuitar譛牙柑 = true;
+ this._bDrums譛牙柑 = true;
+ this.nBGAlpha = 100;
+ this.e繝繝。繝シ繧ク繝ャ繝吶Ν = E繝繝。繝シ繧ク繝ャ繝吶Ν.譎ョ騾;
+ this.bSTAGEFAILED譛牙柑 = true;
+ this.bAVI譛牙柑 = false;
+ this.bBGA譛牙柑 = true;
+ this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms = 1000;
+ this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms = 100;
+ //this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 = true;
+ this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 = false;
+ this.bBGM髻ウ繧堤匱螢ー縺吶k = true;
+ this.bScoreIni繧貞コ蜉帙☆繧 = true;
+ this.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k = true;
+ this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚 = new STDGBVALUE();
+ this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums = 10;
+ this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Guitar = 10;
+ this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Bass = 10;
+ this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Taiko = 10;
+ this.FontName = "MS UI Gothic";
+ this.BoxFontName = "MS UI Gothic";
+ this.ApplyLoudnessMetadata = true;
+ this.bEnableCountdownTimer = true;
+
+ // 2018-08-28 twopointzero:
+ // There exists a particular large, well-known, well-curated, and
+ // regularly-updated collection of content for use with Taiko no
+ // Tatsujin simulators. A statistical analysis was performed on the
+ // the integrated loudness and true peak loudness of the thousands
+ // of songs within this collection as of late August 2018.
+ //
+ // The analysis allows us to select a target loudness which
+ // results in the smallest total amount of loudness adjustment
+ // applied to the songs of that collection. The selected target
+ // loudness should result in the least-noticeable average
+ // adjustment for the most users, assuming their collection is
+ // similar to the exemplar.
+ //
+ // The target loudness which achieves this is -7.4 LUFS.
+ this.TargetLoudness = -7.4;
+
+ this.ApplySongVol = false;
+ this.SoundEffectLevel = CSound.DefaultSoundEffectLevel;
+ this.VoiceLevel = CSound.DefaultVoiceLevel;
+ this.SongPreviewLevel = CSound.DefaultSongPlaybackLevel;
+ this.SongPlaybackLevel = CSound.DefaultSongPlaybackLevel;
+ this.KeyboardSoundLevelIncrement = DefaultKeyboardSoundLevelIncrement;
+ this.b繝ュ繧ー蜃コ蜉 = true;
+ this.bSudden = new STDGBVALUE();
+ this.bHidden = new STDGBVALUE();
+ this.bReverse = new STDGBVALUE();
+ this.eRandom = new STDGBVALUE();
+ this.bLight = new STDGBVALUE();
+ this.bLeft = new STDGBVALUE();
+ this.e蛻、螳壻ス咲スョ = new STDGBVALUE(); // #33891 2014.6.26 yyagi
+ this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ = new STDGBVALUE();
+ this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ = new STDGBVALUE();
+ this.nInputAdjustTimeMs = 0;
+ this.nJudgeLinePosOffset = new STDGBVALUE(); // #31602 2013.6.23 yyagi
+ this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ = E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Chip繧医j荳;
+ for ( int i = 0; i < 3; i++ )
+ {
+ this.bSudden[ i ] = false;
+ this.bHidden[ i ] = false;
+ this.bReverse[ i ] = false;
+ this.eRandom[ i ] = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF;
+ this.bLight[ i ] = false;
+ this.bLeft[ i ] = false;
+ this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ[ i ] = E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.繝ャ繝シ繝ウ荳;
+ this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = 9;
+ this.nJudgeLinePosOffset[ i ] = 0;
+ this.eInvisible[ i ] = EInvisible.OFF;
+ this.nViewerScrollSpeed[ i ] = 1;
+ this.e蛻、螳壻ス咲スョ[ i ] = E蛻、螳壻ス咲スョ.讓呎コ;
+ //this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ[ i ] = E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Chip繧医j荳;
+ }
+ this.n貍泌・城溷コヲ = 20;
+ this.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 = false;
+ #region [ AutoPlay ]
+ this.bAutoPlay = new STAUTOPLAY();
+
+ this.b螟ェ鮠薙ヱ繝シ繝AutoPlay = true;
+ this.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P = true;
+ this.bAuto蜈育函縺ョ騾」謇 = true;
+ #endregion
+ this.n繝偵ャ繝育ッ蝗イms = new STRANGE();
+ this.n繝偵ャ繝育ッ蝗イms.Perfect = 30;
+ this.n繝偵ャ繝育ッ蝗イms.Great = -1; //菴ソ逕ィ縺励∪縺帙s縲
+ this.n繝偵ャ繝育ッ蝗イms.Good = 100;
+ this.n繝偵ャ繝育ッ蝗イms.Poor = 130;
+ this.ConfigIni繝輔ぃ繧、繝ォ蜷 = "";
+ this.dicJoystick = new Dictionary( 10 );
+ this.t繝繝輔か繝ォ繝医ョ繧ュ繝シ繧「繧オ繧、繝ウ縺ォ險ュ螳壹☆繧();
+ #region [ velocityMin ]
+ this.nVelocityMin.LC = 0; // #23857 2011.1.31 yyagi VelocityMin
+ this.nVelocityMin.HH = 20;
+ this.nVelocityMin.SD = 0;
+ this.nVelocityMin.BD = 0;
+ this.nVelocityMin.HT = 0;
+ this.nVelocityMin.LT = 0;
+ this.nVelocityMin.FT = 0;
+ this.nVelocityMin.CY = 0;
+ this.nVelocityMin.RD = 0;
+ this.nVelocityMin.LP = 0;
+ this.nVelocityMin.LBD = 0;
+ #endregion
+ this.nRisky = 0; // #23539 2011.7.26 yyagi RISKY繝「繝シ繝
+ this.bIsAutoResultCapture = false; // #25399 2011.6.9 yyagi 繝ェ繧カ繝ォ繝育判蜒剰ェ蜍穂ソ晏ュ俶ゥ溯スON/OFF
+
+ this.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ = true;
+ this.bIsAllowedDoubleClickFullscreen = true; // #26752 2011.11.26 繝繝悶Ν繧ッ繝ェ繝繧ッ縺ァ縺ョ繝輔Ν繧ケ繧ッ繝ェ繝シ繝ウ繝「繝シ繝臥ァサ陦後r險ア蜿ッ
+ this.nPoliphonicSounds = 4; // #28228 2012.5.1 yyagi 繝ャ繝シ繝ウ豈弱ョ譛螟ァ蜷梧凾逋コ髻ウ謨ー
+ // #24820 2013.1.15 yyagi 蛻晄悄蛟、繧4縺九i2縺ォ螟画峩縲BASS.net菴ソ逕ィ譎ゅョ雋闕キ霆ス貂帙ョ縺溘a縲
+ // #24820 2013.1.17 yyagi 蛻晄悄蛟、繧4縺ォ謌サ縺励◆縲ょ虚逧縺ェ繝溘く繧オ繝シ蛻カ蠕。縺後≧縺セ縺丞虚菴懊@縺ヲ縺繧九◆繧√
+ this.bIsEnabledSystemMenu = true; // #28200 2012.5.1 yyagi System Menu縺ョ蛻ゥ逕ィ蜿ッ蜷ヲ蛻譖ソ(菴ソ逕ィ蜿ッ)
+ this.strSystemSkinSubfolderFullName = ""; // #28195 2012.5.2 yyagi 菴ソ逕ィ荳ュ縺ョSkin繧オ繝悶ヵ繧ゥ繝ォ繝蜷
+ this.bTight = false; // #29500 2012.9.11 kairera0467 TIGHT繝「繝シ繝
+ #region [ WASAPI/ASIO ]
+ this.nSoundDeviceType = FDK.COS.bIsVistaOrLater ?
+ (int) ESoundDeviceTypeForConfig.WASAPI : (int) ESoundDeviceTypeForConfig.ACM; // #24820 2012.12.23 yyagi 蛻晄悄蛟、縺ッACM | #31927 2013.8.25 yyagi OS縺ォ繧医j蛻晄悄蛟、螟画峩
+ this.nWASAPIBufferSizeMs = 50; // #24820 2013.1.15 yyagi 蛻晄悄蛟、縺ッ50(0縺ァ閾ェ蜍戊ィュ螳)
+ this.nASIODevice = 0; // #24820 2013.1.17 yyagi
+// this.nASIOBufferSizeMs = 0; // #24820 2012.12.25 yyagi 蛻晄悄蛟、縺ッ0(閾ェ蜍戊ィュ螳)
+ #endregion
+ this.bUseOSTimer = false;; // #33689 2014.6.6 yyagi 蛻晄悄蛟、縺ッfalse (FDK縺ョ繧ソ繧、繝槭シ縲ゑシヲシイシッシュ豌剰譯医ョ迢ャ閾ェ繧ソ繧、繝槭シ)
+ this.bDynamicBassMixerManagement = true; //
+ this.bTimeStretch = false; // #23664 2013.2.24 yyagi 蛻晄悄蛟、縺ッfalse (蜀咲函騾溷コヲ螟画峩繧偵√ヴ繝繝∝、画峩縺ォ縺ヲ陦後≧)
+ this.nDisplayTimesMs = 3000; // #32072 2013.10.24 yyagi Semi-Invisible縺ァ縺ョ縲√メ繝繝怜崎。ィ遉コ譛滄俣
+ this.nFadeoutTimeMs = 2000; // #32072 2013.10.24 yyagi Semi-Invisible縺ァ縺ョ縲√メ繝繝励ヵ繧ァ繝シ繝峨い繧ヲ繝域凾髢
+
+ bViewerVSyncWait = true;
+ bViewerShowDebugStatus = true;
+ bViewerTimeStretch = false;
+ bViewerDrums譛牙柑 = true;
+ bViewerGuitar譛牙柑 = true;
+
+
+
+ this.bBranchGuide = false;
+ this.nScoreMode = 2;
+ this.nDefaultCourse = 3;
+ this.nBranchAnime = 1;
+
+ this.b螟ァ髻ウ隨ヲ蛻、螳 = false;
+ this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 = 50;
+
+ this.bJudgeCountDisplay = false;
+
+ ShowChara = true;
+ ShowDancer = true;
+ ShowRunner = true;
+ ShowFooter = true;
+ ShowMob = true;
+ ShowPuchiChara = true;
+
+ this.eSTEALTH = E繧ケ繝繝ォ繧ケ繝「繝シ繝.OFF;
+ this.bNoInfo = false;
+
+ //this.bNoMP3Streaming = false;
+ this.nMasterVolume = 100; // #33700 2014.4.26 yyagi 繝槭せ繧ソ繝シ繝懊Μ繝・繝シ繝縺ョ險ュ螳(WASAPI/ASIO逕ィ)
+ this.bHispeedRandom = false;
+ this.nDefaultSongSort = 2;
+ this.eGameMode = EGame.OFF;
+ this.TokkunMashInterval = 750;
+ this.bEndingAnime = false;
+ this.nPlayerCount = 1; //2017.08.18 kairera0467 繝槭Ν繝√励Ξ繧、蟇セ蠢
+ ShinuchiMode = false;
+ FastRender = true;
+ MusicPreTimeMs = 1000; // 荳遘
+ SendDiscordPlayingInformation = true;
+ #region[ Ver.K霑ス蜉 ]
+ this.eLaneType = E繝ャ繝シ繝ウ繧ソ繧、繝.TypeA;
+ this.bDirectShowMode = false;
+ #endregion
+ }
+ public CConfigIni( string ini繝輔ぃ繧、繝ォ蜷 )
+ : this()
+ {
+ this.t繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ( ini繝輔ぃ繧、繝ォ蜷 );
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( E蜈・蜉帙ョ繝舌う繧ケ DeviceType, int nID, int nCode )
+ {
+ for( int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++ )
+ {
+ for( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ )
+ {
+ for( int k = 0; k < 0x10; k++ )
+ {
+ if( ( ( this.KeyAssign[ i ][ j ][ k ].蜈・蜉帙ョ繝舌う繧ケ == DeviceType ) && ( this.KeyAssign[ i ][ j ][ k ].ID == nID ) ) && ( this.KeyAssign[ i ][ j ][ k ].繧ウ繝シ繝 == nCode ) )
+ {
+ for( int m = k; m < 15; m++ )
+ {
+ this.KeyAssign[ i ][ j ][ m ] = this.KeyAssign[ i ][ j ][ m + 1 ];
+ }
+ this.KeyAssign[ i ][ j ][ 15 ].蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.荳肴;
+ this.KeyAssign[ i ][ j ][ 15 ].ID = 0;
+ this.KeyAssign[ i ][ j ][ 15 ].繧ウ繝シ繝 = 0;
+ k--;
+ }
+ }
+ }
+ }
+ }
+ public void t譖ク縺榊コ縺( string ini繝輔ぃ繧、繝ォ蜷 )
+ {
+ StreamWriter sw = new StreamWriter( ini繝輔ぃ繧、繝ォ蜷, false, Encoding.GetEncoding( "Shift_JIS" ) );
+ sw.WriteLine( ";-------------------" );
+
+ #region [ System ]
+ sw.WriteLine( "[System]" );
+ sw.WriteLine();
+
+#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹
+ //------------------------------
+ sw.WriteLine("; 繝ゥ繧、繝輔ご繝シ繧ク縺ョ繝代Λ繝。繝シ繧ソ隱ソ謨エ(隱ソ謨エ螳御コ蠕悟炎髯、莠亥ョ)");
+ sw.WriteLine("; GaugeFactorD: 繝峨Λ繝縺ョPerfect, Great,... 縺ョ蝗槫セゥ驥(繝ゥ繧、繝筆AX繧1.0縺ィ縺励◆縺ィ縺阪ョ蛟、繧呈欠螳)");
+ sw.WriteLine("; GaugeFactorG: Gt/Bs縺ョPerfect, Great,... 縺ョ蝗槫セゥ驥(繝ゥ繧、繝筆AX繧1.0縺ィ縺励◆縺ィ縺阪ョ蛟、繧呈欠螳)");
+ sw.WriteLine("; DamageFactorD: DamageLevel縺郡mall, Normal, Large縺ョ譎ゅ↓蟇セ縺吶k繝繝。繝シ繧ク菫よ焚");
+ sw.WriteLine("GaugeFactorD={0}, {1}, {2}, {3}, {4}", this.fGaugeFactor[0, 0], this.fGaugeFactor[1, 0], this.fGaugeFactor[2, 0], this.fGaugeFactor[3, 0], this.fGaugeFactor[4, 0]);
+ sw.WriteLine("GaugeFactorG={0}, {1}, {2}, {3}, {4}", this.fGaugeFactor[0, 1], this.fGaugeFactor[1, 1], this.fGaugeFactor[2, 1], this.fGaugeFactor[3, 1], this.fGaugeFactor[4, 1]);
+ sw.WriteLine("DamageFactor={0}, {1}, {2}", this.fDamageLevelFactor[0], this.fDamageLevelFactor[1], fDamageLevelFactor[2]);
+ sw.WriteLine();
+ //------------------------------
+#endif
+ #region [ Version ]
+ sw.WriteLine( "; 繝ェ繝ェ繝シ繧ケ繝舌シ繧ク繝ァ繝ウ" );
+ sw.WriteLine( "; Release Version." );
+ sw.WriteLine( "Version={0}", TJAPlayer3.VERSION );
+ sw.WriteLine();
+ #endregion
+ #region [ TJAPath ]
+ sw.WriteLine( "; 隴憺擇繝輔ぃ繧、繝ォ縺梧シ邏阪&繧後※縺繧九ヵ繧ゥ繝ォ繝縺ク縺ョ繝代せ縲" );
+ sw.WriteLine( @"; 繧サ繝溘さ繝ュ繝ウ(;)縺ァ蛹コ蛻繧九%縺ィ縺ォ繧医j隍謨ー縺ョ繝代せ繧呈欠螳壹〒縺阪∪縺吶ゑシ井セ: d:\tja\;e:\tja2\シ" );
+ sw.WriteLine( "; Pathes for TJA data." );
+ sw.WriteLine( @"; You can specify many pathes separated with semicolon(;). (e.g. d:\tja\;e:\tja2\)" );
+ sw.WriteLine( "TJAPath={0}", this.str譖イ繝繝シ繧ソ讀懃エ「繝代せ );
+ sw.WriteLine();
+ #endregion
+ #region [ 繧ケ繧ュ繝ウ髢「騾」 ]
+ #region [ Skin繝代せ縺ョ邨カ蟇セ繝代せ竊堤嶌蟇セ繝代せ螟画鋤 ]
+ Uri uriRoot = new Uri( System.IO.Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" + System.IO.Path.DirectorySeparatorChar ) );
+ if ( strSystemSkinSubfolderFullName != null && strSystemSkinSubfolderFullName.Length == 0 )
+ {
+ // Config.ini縺檎ゥコ縺ョ迥カ諷九〒DTXMania繧歎iewer縺ィ縺励※襍キ蜍廟邨ゆコ縺吶k縺ィ縲《trSystemSkinSubfolderFullName 縺檎ゥコ縺ョ迥カ諷九〒縺薙%縺ォ譚・繧九
+ // 竊 蛻晄悄蛟、縺ィ縺励※ Default/ 繧定ィュ螳壹☆繧九
+ strSystemSkinSubfolderFullName = System.IO.Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" + System.IO.Path.DirectorySeparatorChar + "Default" + System.IO.Path.DirectorySeparatorChar );
+ }
+ Uri uriPath = new Uri( System.IO.Path.Combine( this.strSystemSkinSubfolderFullName, "." + System.IO.Path.DirectorySeparatorChar ) );
+ string relPath = uriRoot.MakeRelativeUri( uriPath ).ToString(); // 逶ク蟇セ繝代せ繧貞叙蠕
+ relPath = System.Web.HttpUtility.UrlDecode( relPath ); // 繝繧ウ繝シ繝峨☆繧
+ relPath = relPath.Replace( '/', System.IO.Path.DirectorySeparatorChar ); // 蛹コ蛻繧頑枚蟄励′\縺ァ縺ッ縺ェ縺/縺ェ縺ョ縺ァ鄂ョ謠帙☆繧
+ #endregion
+ sw.WriteLine( "; 菴ソ逕ィ縺吶kSkin縺ョ繝輔か繝ォ繝蜷阪" );
+ sw.WriteLine( "; 萓九∴縺ー System\\Default\\Graphics\\... 縺ェ縺ゥ縺ョ蝣エ蜷医ッ縲ヾkinPath=.\\Default\\ 繧呈欠螳壹@縺セ縺吶" );
+ sw.WriteLine( "; Skin folder path." );
+ sw.WriteLine( "; e.g. System\\Default\\Graphics\\... -> Set SkinPath=.\\Default\\" );
+ sw.WriteLine( "SkinPath={0}", relPath );
+ sw.WriteLine();
+ sw.WriteLine("; 莠句燕逕サ蜒乗緒逕サ讖溯ス繧剃スソ縺縺九←縺縺九(0: OFF, 1: ON)");
+ sw.WriteLine("; Use pre-textures render.");
+ sw.WriteLine("{0}={1}", nameof(FastRender), FastRender ? 1 : 0);
+ sw.WriteLine();
+ #endregion
+ #region [ Window髢「騾」 ]
+ sw.WriteLine( "; 逕サ髱「繝「繝シ繝(0:繧ヲ繧」繝ウ繝峨え, 1:蜈ィ逕サ髱「)" );
+ sw.WriteLine( "; Screen mode. (0:Window, 1:Fullscreen)" );
+ sw.WriteLine( "FullScreen={0}", this.b蜈ィ逕サ髱「繝「繝シ繝 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine("; 繧ヲ繧、繝ウ繝峨え繝「繝シ繝画凾縺ョ逕サ髱「蟷"); // #23510 2010.10.31 yyagi add
+ sw.WriteLine("; A width size in the window mode."); //
+ sw.WriteLine("WindowWidth={0}", this.n繧ヲ繧、繝ウ繝峨えwidth); //
+ sw.WriteLine(); //
+ sw.WriteLine("; 繧ヲ繧、繝ウ繝峨え繝「繝シ繝画凾縺ョ逕サ髱「鬮倥&"); //
+ sw.WriteLine("; A height size in the window mode."); //
+ sw.WriteLine("WindowHeight={0}", this.n繧ヲ繧、繝ウ繝峨えheight); //
+ sw.WriteLine(); //
+ sw.WriteLine( "; 繧ヲ繧」繝ウ繝峨え繝「繝シ繝画凾縺ョ菴咲スョX" ); // #30675 2013.02.04 ikanick add
+ sw.WriteLine( "; X position in the window mode." ); //
+ sw.WriteLine( "WindowX={0}", this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX ); //
+ sw.WriteLine(); //
+ sw.WriteLine( "; 繧ヲ繧」繝ウ繝峨え繝「繝シ繝画凾縺ョ菴咲スョY" ); //
+ sw.WriteLine( "; Y position in the window mode." ); //
+ sw.WriteLine( "WindowY={0}", this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY ); //
+ sw.WriteLine(); //
+
+ sw.WriteLine( "; 繧ヲ繧、繝ウ繝峨え繧偵ム繝悶Ν繧ッ繝ェ繝繧ッ縺励◆譎ゅ↓繝輔Ν繧ケ繧ッ繝ェ繝シ繝ウ縺ォ遘サ陦後☆繧九°(0:遘サ陦後@縺ェ縺,1:遘サ陦後☆繧)" ); // #26752 2011.11.27 yyagi
+ sw.WriteLine( "; Whether double click to go full screen mode or not.(0:No, 1:Yes)" ); //
+ sw.WriteLine( "DoubleClickFullScreen={0}", this.bIsAllowedDoubleClickFullscreen? 1 : 0); //
+ sw.WriteLine(); //
+ sw.WriteLine( "; ALT+SPACE縺ョ繝。繝九Η繝シ陦ィ遉コ繧呈椛蛻カ縺吶k縺九←縺縺(0:謚大宛縺吶k 1:謚大宛縺励↑縺)" ); // #28200 2012.5.1 yyagi
+ sw.WriteLine( "; Whether ALT+SPACE menu would be masked or not.(0=masked 1=not masked)" ); //
+ sw.WriteLine( "EnableSystemMenu={0}", this.bIsEnabledSystemMenu? 1 : 0 ); //
+ sw.WriteLine(); //
+ sw.WriteLine( "; 髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅョsleep蛟、[ms]" ); // #23568 2011.11.04 ikanick add
+ sw.WriteLine( "; A sleep time[ms] while the window is inactive." ); //
+ sw.WriteLine( "BackSleep={0}", this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s ); // 縺昴ョ縺セ縺セ蠑慕畑シ郁協隨托シ
+ sw.WriteLine(); //
+ #endregion
+ #region [ 繝輔か繝ウ繝 ]
+ sw.WriteLine("; 繝輔か繝ウ繝医Ξ繝ウ繝繝ェ繝ウ繧ー縺ォ菴ソ逕ィ縺吶k繝輔か繝ウ繝亥錐");
+ sw.WriteLine("; Font name used for font rendering.");
+ sw.WriteLine("FontName={0}", this.FontName);
+ sw.WriteLine();
+ sw.WriteLine("; Box縺ョ隱ャ譏取枚縺ョ繝輔か繝ウ繝医Ξ繝ウ繝繝ェ繝ウ繧ー縺ォ菴ソ逕ィ縺吶k繝輔か繝ウ繝亥錐");
+ sw.WriteLine("; Font name used for font rendering.");
+ sw.WriteLine("BoxFontName={0}", this.BoxFontName);
+ sw.WriteLine();
+ #endregion
+ #region [ 繝輔Ξ繝シ繝蜃ヲ逅髢「騾」(VSync, 繝輔Ξ繝シ繝豈弱ョsleep) ]
+ sw.WriteLine("; 蝙ら峩蟶ー邱壼酔譛(0:OFF,1:ON)");
+ sw.WriteLine( "VSyncWait={0}", this.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 繝輔Ξ繝シ繝豈弱ョsleep蛟、[ms] (-1縺ァ繧ケ繝ェ繝シ繝礼┌縺, 0莉・荳翫〒豈弱ヵ繝ャ繝シ繝繧ケ繝ェ繝シ繝励ょ虚逕サ繧ュ繝」繝励メ繝」遲峨〒豢サ逕ィ荳九&縺)" ); // #xxxxx 2011.11.27 yyagi add
+ sw.WriteLine( "; A sleep time[ms] per frame." ); //
+ sw.WriteLine( "SleepTimePerFrame={0}", this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s ); //
+ sw.WriteLine(); //
+ #endregion
+
+ #region [ WASAPI/ASIO髢「騾」 ]
+ sw.WriteLine( "; 繧オ繧ヲ繝ウ繝牙コ蜉帶婿蠑(0=ACM(縺」縺ヲ莉翫ッ縺セ縺DirectSound縺ァ縺吶′), 1=ASIO, 2=WASAPI)" );
+ sw.WriteLine( "; WASAPI縺ッVista莉・髯阪ョOS縺ァ菴ソ逕ィ蜿ッ閭ス縲よ耳螂ィ譁ケ蠑上ッWASAPI縲" );
+ sw.WriteLine( "; 縺ェ縺翫仝ASAPI縺御スソ逕ィ荳榊庄縺ェ繧陰SIO繧偵、SIO縺御スソ逕ィ荳榊庄縺ェ繧陰CM繧剃スソ逕ィ縺励∪縺吶" );
+ sw.WriteLine( "; Sound device type(0=ACM, 1=ASIO, 2=WASAPI)" );
+ sw.WriteLine( "; WASAPI can use on Vista or later OSs." );
+ sw.WriteLine( "; If WASAPI is not available, DTXMania try to use ASIO. If ASIO can't be used, ACM is used." );
+ sw.WriteLine( "SoundDeviceType={0}", (int) this.nSoundDeviceType );
+ sw.WriteLine();
+
+ sw.WriteLine( "; WASAPI菴ソ逕ィ譎ゅョ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ" );
+ sw.WriteLine( "; (0=繝繝舌う繧ケ縺ォ險ュ螳壹&繧後※縺繧句、繧剃スソ逕ィ, 1ス9999=繝舌ャ繝輔ぃ繧オ繧、繧コ(蜊倅ス:ms)縺ョ謇句虚謖螳" );
+ sw.WriteLine( "; WASAPI Sound Buffer Size." );
+ sw.WriteLine( "; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself)" );
+ sw.WriteLine( "WASAPIBufferSizeMs={0}", (int) this.nWASAPIBufferSizeMs );
+ sw.WriteLine();
+
+ sw.WriteLine( "; ASIO菴ソ逕ィ譎ゅョ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ" );
+ sw.WriteLine( "; 蟄伜惠縺励↑縺繝繝舌う繧ケ繧呈欠螳壹☆繧九→縲.TXMania縺瑚オキ蜍輔@縺ェ縺縺薙→縺後≠繧翫∪縺吶" );
+ sw.WriteLine( "; Sound device used by ASIO." );
+ sw.WriteLine( "; Don't specify unconnected device, as the DTXMania may not bootup." );
+ string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices();
+ for ( int i = 0; i < asiodev.Length; i++ )
+ {
+ sw.WriteLine( "; {0}: {1}", i, asiodev[ i ] );
+ }
+ sw.WriteLine( "ASIODevice={0}", (int) this.nASIODevice );
+ sw.WriteLine();
+
+ //sw.WriteLine( "; ASIO菴ソ逕ィ譎ゅョ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ" );
+ //sw.WriteLine( "; (0=繝繝舌う繧ケ縺ォ險ュ螳壹&繧後※縺繧句、繧剃スソ逕ィ, 1ス9999=繝舌ャ繝輔ぃ繧オ繧、繧コ(蜊倅ス:ms)縺ョ謇句虚謖螳" );
+ //sw.WriteLine( "; ASIO Sound Buffer Size." );
+ //sw.WriteLine( "; (0=Use the value specified to the device, 1-9999=specify the buffer size(ms) by yourself)" );
+ //sw.WriteLine( "ASIOBufferSizeMs={0}", (int) this.nASIOBufferSizeMs );
+ //sw.WriteLine();
+
+ //sw.WriteLine( "; Bass.Mix縺ョ蛻カ蠕。繧貞虚逧縺ォ陦後≧縺句凄縺九" );
+ //sw.WriteLine( "; ON縺ォ縺吶k縺ィ縲√ぐ繧ソ繝シ譖イ縺ェ縺ゥ繝√ャ繝鈴浹縺ョ螟壹>譖イ繧ょ咲函縺ァ縺阪∪縺吶′縲∫判髱「縺悟ー代@縺後◆縺、縺阪∪縺吶" );
+ //sw.WriteLine( "; (0=陦後o縺ェ縺, 1=陦後≧)" );
+ //sw.WriteLine( "DynamicBassMixerManagement={0}", this.bDynamicBassMixerManagement ? 1 : 0 );
+ //sw.WriteLine();
+
+ sw.WriteLine( "; WASAPI/ASIO譎ゅ↓菴ソ逕ィ縺吶k貍泌・上ち繧、繝槭シ縺ョ遞ョ鬘" );
+ sw.WriteLine( "; Playback timer used for WASAPI/ASIO" );
+ sw.WriteLine( "; (0=FDK Timer, 1=System Timer)" );
+ sw.WriteLine( "SoundTimerType={0}", this.bUseOSTimer ? 1 : 0 );
+ sw.WriteLine();
+
+ //sw.WriteLine( "; 蜈ィ菴薙懊Μ繝・繝シ繝縺ョ險ュ螳" );
+ //sw.WriteLine( "; (0=辟。髻ウ ス 100=譛螟ァ縲8ASAPI/ASIO譎ゅョ縺ソ譛牙柑)" );
+ //sw.WriteLine( "; Master volume settings" );
+ //sw.WriteLine( "; (0=Silent - 100=Max)" );
+ //sw.WriteLine( "MasterVolume={0}", this.nMasterVolume );
+ //sw.WriteLine();
+
+ #endregion
+ sw.WriteLine( "; 閭梧勹逕サ蜒上ョ蜊企乗主牡蜷(0:騾乗趣ス255:荳埼乗)" );
+ sw.WriteLine( "; Transparency for background image in playing screen.(0:tranaparent - 255:no transparent)" );
+ sw.WriteLine( "BGAlpha={0}", this.nBGAlpha );
+ sw.WriteLine();
+ sw.WriteLine( "; 繧イ繝シ繧ク繧シ繝ュ縺ァSTAGE FAILED (0:OFF, 1:ON)" );
+ sw.WriteLine( "StageFailed={0}", this.bSTAGEFAILED譛牙柑 ? 1 : 0 );
+ sw.WriteLine();
+ #region [ AVI/BGA ]
+ sw.WriteLine( "; AVI縺ョ陦ィ遉コ(0:OFF, 1:ON)" );
+ sw.WriteLine( "AVI={0}", this.bAVI譛牙柑 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; BGA縺ョ陦ィ遉コ(0:OFF, 1:ON)" );
+ sw.WriteLine( "BGA={0}", this.bBGA譛牙柑 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 蜍慕判陦ィ遉コ繝「繝シ繝( 0:陦ィ遉コ縺励↑縺, 1:閭梧勹縺ョ縺ソ, 2:遯楢。ィ遉コ縺ョ縺ソ, 3:荳。譁ケ)" );
+ sw.WriteLine( "ClipDispType={0}", (int) this.eClipDispType );
+ sw.WriteLine();
+ #endregion
+ #region [ 繝励Ξ繝薙Η繝シ髻ウ ]
+ sw.WriteLine( "; 譖イ驕ク謚槭°繧峨励Ξ繝薙Η繝シ髻ウ縺ョ蜀咲函縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝[ms]" );
+ sw.WriteLine( "PreviewSoundWait={0}", this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms );
+ sw.WriteLine();
+ sw.WriteLine( "; 譖イ驕ク謚槭°繧峨励Ξ繝薙Η繝シ逕サ蜒剰。ィ遉コ縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝[ms]" );
+ sw.WriteLine( "PreviewImageWait={0}", this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms );
+ sw.WriteLine();
+ #endregion
+ //sw.WriteLine( "; Wave縺ョ蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(0:OFF, 1:ON)" );
+ //sw.WriteLine( "AdjustWaves={0}", this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 ? 1 : 0 );
+ #region [ BGM/繝峨Λ繝繝偵ャ繝磯浹縺ョ蜀咲函 ]
+ sw.WriteLine( "; BGM 縺ョ蜀咲函(0:OFF, 1:ON)" );
+ sw.WriteLine( "BGMSound={0}", this.bBGM髻ウ繧堤匱螢ー縺吶k ? 1 : 0 );
+ sw.WriteLine();
+ #endregion
+ sw.WriteLine( "; 貍泌・剰ィ倬鹸シ茨ス.score.iniシ峨ョ蜃コ蜉 (0:OFF, 1:ON)" );
+ sw.WriteLine( "SaveScoreIni={0}", this.bScoreIni繧貞コ蜉帙☆繧 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine("; 譛蟆剰。ィ遉コ繧ウ繝ウ繝懈焚");
+ sw.WriteLine("MinComboDrums={0}", this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums);
+ sw.WriteLine();
+ sw.WriteLine( "; RANDOM SELECT 縺ァ蟄殖OX繧呈、懃エ「蟇セ雎。縺ォ蜷ォ繧√k (0:OFF, 1:ON)" );
+ sw.WriteLine( "RandomFromSubBox={0}", this.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k (0:OFF, 1:ON)" );
+ sw.WriteLine( "; Showing playing info on the playing screen. (0:OFF, 1:ON)" );
+ sw.WriteLine( "ShowDebugStatus={0}", this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine("; BS1770GAIN 縺ォ繧医k繝ゥ繧ヲ繝峨ロ繧ケ繝。繝シ繧ソ縺ョ貂ャ驥上r驕ゥ逕ィ縺吶k (0:OFF, 1:ON)");
+ sw.WriteLine( "; Apply BS1770GAIN loudness metadata (0:OFF, 1:ON)" );
+ sw.WriteLine( "{0}={1}", nameof(ApplyLoudnessMetadata), this.ApplyLoudnessMetadata ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( $"; BS1770GAIN 縺ォ繧医k繝ゥ繧ヲ繝峨ロ繧ケ繝。繝シ繧ソ縺ョ逶ョ讓吝、 (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})" );
+ sw.WriteLine( $"; Loudness Target in dB (decibels) relative to full scale (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})" );
+ sw.WriteLine( "{0}={1}", nameof(TargetLoudness), TargetLoudness );
+ sw.WriteLine();
+ sw.WriteLine("; .tja繝輔ぃ繧、繝ォ縺ョSONGVOL繝倥ャ繝繧帝浹貅舌ョ髻ウ驥上↓驕ゥ逕ィ縺吶k (0:OFF, 1:ON)");
+ sw.WriteLine( "; Apply SONGVOL (0:OFF, 1:ON)" );
+ sw.WriteLine( "{0}={1}", nameof(ApplySongVol), this.ApplySongVol ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( $"; 蜉ケ譫憺浹縺ョ髻ウ驥 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" );
+ sw.WriteLine( $"; Sound effect level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" );
+ sw.WriteLine( "{0}={1}", nameof(SoundEffectLevel), SoundEffectLevel );
+ sw.WriteLine();
+ sw.WriteLine( $"; 蜷繝懊う繧ケ縲√さ繝ウ繝懊懊う繧ケ縺ョ髻ウ驥 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" );
+ sw.WriteLine( $"; Voice level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" );
+ sw.WriteLine( "{0}={1}", nameof(VoiceLevel), VoiceLevel );
+ sw.WriteLine();
+ sw.WriteLine( $"; 繧イ繝シ繝荳ュ縺ョ髻ウ貅舌ョ髻ウ驥 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" );
+ sw.WriteLine( $"; Song playback level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" );
+ sw.WriteLine( "{0}={1}", nameof(SongPlaybackLevel), SongPlaybackLevel );
+ sw.WriteLine();
+ sw.WriteLine( $"; 繧ュ繝シ繝懊シ繝峨↓繧医k髻ウ驥丞、画峩縺ョ蠅怜刈驥上∵ク帛ー鷹 ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})" );
+ sw.WriteLine( $"; Keyboard sound level increment ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})" );
+ sw.WriteLine( "{0}={1}", nameof(KeyboardSoundLevelIncrement), KeyboardSoundLevelIncrement );
+ sw.WriteLine($"; 髻ウ貅仙咲函蜑阪ョ遨コ逋ス譎る俣 (ms)");
+ sw.WriteLine($"; Blank time before music source to play. (ms)");
+ sw.WriteLine("{0}={1}", nameof(MusicPreTimeMs), MusicPreTimeMs);
+ sw.WriteLine();
+ sw.WriteLine( "; 繧ケ繝医う繝繧ッ繝「繝シ繝(0:OFF, 1:ON)" );
+ sw.WriteLine( "; Stoic mode. (0:OFF, 1:ON)" );
+ sw.WriteLine( "StoicMode={0}", this.b繧ケ繝医う繝繧ッ繝「繝シ繝 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 繝舌ャ繝輔ぃ蜈・蜉帙Δ繝シ繝(0:OFF, 1:ON)" );
+ sw.WriteLine( "; Using Buffered input (0:OFF, 1:ON)" );
+ sw.WriteLine( "BufferedInput={0}", this.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 繝ェ繧カ繝ォ繝育判蜒剰ェ蜍穂ソ晏ュ俶ゥ溯ス(0:OFF, 1:ON)" ); // #25399 2011.6.9 yyagi
+ sw.WriteLine( "; Set \"1\" if you'd like to save result screen image automatically"); //
+ sw.WriteLine( "; when you get hiscore/hiskill."); //
+ sw.WriteLine( "AutoResultCapture={0}", this.bIsAutoResultCapture? 1 : 0 ); //
+ sw.WriteLine();
+ sw.WriteLine("; Discord縺ォ蜀咲函荳ュ縺ョ隴憺擇諠蝣ア繧帝∽ソ。縺吶k(0:OFF, 1:ON)"); // #25399 2011.6.9 yyagi
+ sw.WriteLine("; Share Playing .tja file infomation on Discord."); //
+ sw.WriteLine("{0}={1}", nameof(SendDiscordPlayingInformation), SendDiscordPlayingInformation ? 1 : 0); //
+ sw.WriteLine();
+ sw.WriteLine( "; 蜀咲函騾溷コヲ螟画峩繧偵√ヴ繝繝∝、画峩縺ァ陦後≧縺九←縺縺(0:繝斐ャ繝∝、画峩, 1:繧ソ繧、繝繧ケ繝医Ξ繝繝" ); // #23664 2013.2.24 yyagi
+ sw.WriteLine( "; (WASAPI/ASIO菴ソ逕ィ譎ゅョ縺ソ譛牙柑) " );
+ sw.WriteLine( "; Set \"0\" if you'd like to use pitch shift with PlaySpeed." ); //
+ sw.WriteLine( "; Set \"1\" for time stretch." ); //
+ sw.WriteLine( "; (Only available when you're using using WASAPI or ASIO)" ); //
+ sw.WriteLine( "TimeStretch={0}", this.bTimeStretch ? 1 : 0 ); //
+ sw.WriteLine();
+ //sw.WriteLine( "; WASAPI/ASIO菴ソ逕ィ譎ゅ↓縲`P3繧偵せ繝医Μ繝シ繝蜀咲函縺吶k縺九←縺縺(0:繧ケ繝医Μ繝シ繝蜀咲函縺吶k, 1:縺励↑縺)" ); //
+ //sw.WriteLine( "; (mp3縺ョ繧キ繝シ繧ッ縺後♀縺九@縺上↑繧句エ蜷医ッ縲√%繧後r1縺ォ縺励※縺上□縺輔>) " ); //
+ //sw.WriteLine( "; Set \"0\" if you'd like to use mp3 streaming playback on WASAPI/ASIO." ); //
+ //sw.WriteLine( "; Set \"1\" not to use streaming playback for mp3." ); //
+ //sw.WriteLine( "; (If you feel illegal seek with mp3, please set it to 1.)" ); //
+ //sw.WriteLine( "NoMP3Streaming={0}", this.bNoMP3Streaming ? 1 : 0 ); //
+ //sw.WriteLine();
+ sw.WriteLine( "; 蜍慕判蜀咲函縺ォDirectShow繧剃スソ逕ィ縺吶k(0:OFF, 1:ON)" );
+ sw.WriteLine( "; 蜍慕判蜀咲函縺ォDirectShow繧剃スソ縺縺薙→縺ォ繧医▲縺ヲ縲∝咲函譎ゅョ雋諡繧定サス貂帙〒縺阪∪縺吶");
+ sw.WriteLine( "; 縺溘□縺嶺スソ逕ィ譎ゅ↓縺ッ繧サ繝繝医い繝繝励′蠢隕√↓縺ェ繧九ョ縺ァ縺疲ウィ諢上¥縺縺輔>縲");
+ sw.WriteLine( "DirectShowMode={0}", this.bDirectShowMode ? 1 : 0 );
+ sw.WriteLine();
+
+ #region [ Adjust ]
+ sw.WriteLine( "; 蛻、螳壹ち繧、繝溘Φ繧ー隱ソ謨エ(-99ス99)[ms]" );
+ sw.WriteLine("; Revision value to adjust judgment timing."); //
+ sw.WriteLine("InputAdjustTime={0}", this.nInputAdjustTimeMs); //
+ sw.WriteLine();
+
+ sw.WriteLine( "; 蛻、螳壹Λ繧、繝ウ縺ョ陦ィ遉コ菴咲スョ隱ソ謨エ(繝峨Λ繝, 繧ョ繧ソ繝シ, 繝吶シ繧ケ)(-99ス99)[px]" ); // #31602 2013.6.23 yyagi 蛻、螳壹Λ繧、繝ウ縺ョ陦ィ遉コ菴咲スョ繧ェ繝輔そ繝繝
+ sw.WriteLine( "; Offset value to adjust displaying judgement line for the drums, guitar and bass." ); //
+ sw.WriteLine( "JudgeLinePosOffsetDrums={0}", this.nJudgeLinePosOffset.Drums ); //
+ sw.WriteLine();
+ #endregion
+ sw.WriteLine( "; 縲後∪縺滄♀繧薙〒縺ュ縲咲判髱「(0:OFF, 1:ON)" );
+ sw.WriteLine( "EndingAnime={0}", this.bEndingAnime ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( ";-------------------" );
+ #endregion
+
+ #region [ AutoPlay ]
+ sw.WriteLine("[AutoPlay]");
+ sw.WriteLine();
+ sw.WriteLine("; 閾ェ蜍墓シ泌・(0:OFF, 1:ON)");
+ sw.WriteLine("Taiko={0}", this.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? 1 : 0);
+ sw.WriteLine("Taiko2P={0}", this.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P ? 1 : 0);
+ sw.WriteLine("TaikoAutoRoll={0}", this.bAuto蜈育函縺ョ騾」謇 ? 1 : 0);
+ sw.WriteLine();
+ sw.WriteLine(";-------------------");
+ #endregion
+
+ #region [ HitRange ]
+ sw.WriteLine("[HitRange]");
+ sw.WriteLine();
+ sw.WriteLine("; Perfectス霸oor 縺ィ縺ソ縺ェ縺輔l繧狗ッ蝗イ[ms]");
+ sw.WriteLine("Perfect={0}", this.n繝偵ャ繝育ッ蝗イms.Perfect);
+ sw.WriteLine("Good={0}", this.n繝偵ャ繝育ッ蝗イms.Good);
+ sw.WriteLine("Poor={0}", this.n繝偵ャ繝育ッ蝗イms.Poor);
+ sw.WriteLine();
+ sw.WriteLine(";-------------------");
+ #endregion
+
+ #region [ Log ]
+ sw.WriteLine( "[Log]" );
+ sw.WriteLine();
+ sw.WriteLine( "; Log蜃コ蜉(0:OFF, 1:ON)" );
+ sw.WriteLine( "OutputLog={0}", this.b繝ュ繧ー蜃コ蜉 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 譖イ繝繝シ繧ソ讀懃エ「縺ォ髢「縺吶kLog蜃コ蜉(0:OFF, 1:ON)" );
+ sw.WriteLine( "TraceSongSearch={0}", this.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 逕サ蜒上d繧オ繧ヲ繝ウ繝峨ョ菴懈神隗」謾セ縺ォ髢「縺吶kLog蜃コ蜉(0:OFF, 1:ON)" );
+ sw.WriteLine( "TraceCreatedDisposed={0}", this.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; DTX隱ュ縺ソ霎シ縺ソ隧ウ邏ー縺ォ髢「縺吶kLog蜃コ蜉(0:OFF, 1:ON)" );
+ sw.WriteLine( "TraceDTXDetails={0}", this.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( ";-------------------" );
+ #endregion
+
+ #region [ PlayOption ]
+ sw.WriteLine( "[PlayOption]" );
+ sw.WriteLine();
+ sw.WriteLine("; 蜷逕サ蜒上ョ陦ィ遉コ險ュ螳");
+ sw.WriteLine("; 繧ュ繝」繝ゥ繧ッ繧ソ繝シ逕サ蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)");
+ sw.WriteLine("ShowChara={0}", ShowChara ? 1 : 0);
+ sw.WriteLine("; 繝繝ウ繧オ繝シ逕サ蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)");
+ sw.WriteLine("ShowDancer={0}", ShowDancer ? 1 : 0);
+ sw.WriteLine("; 繝ゥ繝ウ繝翫シ逕サ蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)");
+ sw.WriteLine("ShowRunner={0}", ShowRunner ? 1 : 0);
+ sw.WriteLine("; 繝「繝也判蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)");
+ sw.WriteLine("ShowMob={0}", ShowMob ? 1 : 0);
+ sw.WriteLine("; 繝輔ャ繧ソ繝シ逕サ蜒 (0:OFF, 1:ON)");
+ sw.WriteLine("ShowFooter={0}", ShowFooter ? 1 : 0);
+ sw.WriteLine("; 縺キ縺。繧ュ繝」繝ゥ逕サ蜒 (0:OFF, 1:ON)");
+ sw.WriteLine("ShowPuchiChara={0}", ShowPuchiChara ? 1 : 0);
+ sw.WriteLine();
+ sw.WriteLine( "; DARK繝「繝シ繝(0:OFF, 1:HALF, 2:FULL)" );
+ sw.WriteLine( "Dark={0}", (int) this.eDark );
+ sw.WriteLine();
+ sw.WriteLine();
+ sw.WriteLine("; 驕ク譖イ逕サ髱「縺ァ縺ョ繧ソ繧、繝槭シ繧呈怏蜉ケ縺ォ縺吶k縺九←縺縺(0:辟。蜉ケ,1:譛牙柑)");
+ sw.WriteLine("; Enable countdown in songselect.(0:No, 1:Yes)");
+ sw.WriteLine("EnableCountDownTimer={0}", this.bEnableCountdownTimer ? 1 : 0);
+ sw.WriteLine();
+ #region [ SUDDEN ]
+ sw.WriteLine( "; 繝峨Λ繝SUDDEN繝「繝シ繝(0:OFF, 1:ON)" );
+ sw.WriteLine( "DrumsSudden={0}", this.bSudden.Drums ? 1 : 0 );
+ sw.WriteLine();
+ #endregion
+ #region [ HIDDEN ]
+ sw.WriteLine( "; 繝峨Λ繝HIDDEN繝「繝シ繝(0:OFF, 1:ON)" );
+ sw.WriteLine( "DrumsHidden={0}", this.bHidden.Drums ? 1 : 0 );
+ sw.WriteLine();
+ #endregion
+ #region [ Invisible ]
+ sw.WriteLine( "; 繝峨Λ繝繝√ャ繝鈴撼陦ィ遉コ繝「繝シ繝 (0:OFF, 1=SEMI, 2:FULL)" );
+ sw.WriteLine( "; Drums chip invisible mode" );
+ sw.WriteLine( "DrumsInvisible={0}", (int) this.eInvisible.Drums );
+ sw.WriteLine();
+ //sw.WriteLine( "; Semi-Invisible縺ァMiss縺」縺滓凾縺ョ繝√ャ繝怜崎。ィ遉コ譎る俣(ms)" );
+ //sw.WriteLine( "InvisibleDisplayTimeMs={0}", (int) this.nDisplayTimesMs );
+ //sw.WriteLine();
+ //sw.WriteLine( "; Semi-Invisible縺ァMiss縺」縺ヲ繝√ャ繝怜崎。ィ遉コ譎る俣邨ゆコ蠕後ョ繝輔ぉ繝シ繝峨い繧ヲ繝域凾髢(ms)" );
+ //sw.WriteLine( "InvisibleFadeoutTimeMs={0}", (int) this.nFadeoutTimeMs );
+ //sw.WriteLine();
+ #endregion
+ sw.WriteLine( "; 繝峨Λ繝REVERSE繝「繝シ繝(0:OFF, 1:ON)" );
+ sw.WriteLine( "DrumsReverse={0}", this.bReverse.Drums ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; RISKY繝「繝シ繝(0:OFF, 1-10)" ); // #23559 2011.6.23 yyagi
+ sw.WriteLine( "; RISKY mode. 0=OFF, 1-10 is the times of misses to be Failed." ); //
+ sw.WriteLine( "Risky={0}", this.nRisky ); //
+ sw.WriteLine();
+ sw.WriteLine( "; TIGHT繝「繝シ繝(0:OFF, 1:ON)" ); // #29500 2012.9.11 kairera0467
+ sw.WriteLine( "; TIGHT mode. 0=OFF, 1=ON " );
+ sw.WriteLine( "DrumsTight={0}", this.bTight ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine("; 繝峨Λ繝隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ(0:x0.1, 9:x1.0, 14:x1.5,窶ヲ,1999:x200.0)");
+ sw.WriteLine( "DrumsScrollSpeed={0}", this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums );
+ sw.WriteLine();
+ sw.WriteLine( "; 貍泌・城溷コヲ(5ス40)(竊遅5/20ス栞40/20)" );
+ sw.WriteLine( "PlaySpeed={0}", this.n貍泌・城溷コヲ );
+ sw.WriteLine();
+
+ sw.WriteLine("; 貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺阪ョ縺ソBGM繧貞咲函縺吶k(0:OFF, 1:ON)");
+ sw.WriteLine("PlaySpeedNotEqualOneNoSound={0}", this.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 ? 1 : 0);
+ sw.WriteLine();
+ sw.WriteLine("; 繝繝輔か繝ォ繝医〒驕ク謚槭&繧後k髮」譏灘コヲ");
+ sw.WriteLine("DefaultCourse={0}", this.nDefaultCourse);
+ sw.WriteLine();
+ sw.WriteLine( "; 隴憺擇蛻蟯舌ョ繧ャ繧、繝芽。ィ遉コ(0:OFF, 1:ON)" );
+ sw.WriteLine( "BranchGuide={0}", this.bGraph.Drums ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 繧ケ繧ウ繧「險育ョ玲婿豕(0:譌ァ驟咲せ, 1:譌ァ遲蝉ス馴咲せ, 2:譁ー驟咲せ)" );
+ sw.WriteLine( "ScoreMode={0}", this.nScoreMode );
+ sw.WriteLine();
+ sw.WriteLine("; 逵滓遠繝「繝シ繝 (0:OFF, 1:ON)");
+ sw.WriteLine("; Fixed score mode (0:OFF, 1:ON)");
+ sw.WriteLine("{0}={1}", nameof(ShinuchiMode), ShinuchiMode ? 1 : 0);
+ //sw.WriteLine( "; 1繝弱シ繝縺斐→縺ョ繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧偵Λ繝ウ繝繝縺ァ螟画峩縺励∪縺吶(0:OFF, 1:ON)" );
+ //sw.WriteLine( "HispeedRandom={0}", this.bHispeedRandom ? 1 : 0 );
+ //sw.WriteLine();
+ sw.WriteLine( "; 螟ァ髻ウ隨ヲ縺ョ荳。謇句・蜉帛セ讖滓凾髢(ms)" );
+ sw.WriteLine( "BigNotesWaitTime={0}", this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 );
+ sw.WriteLine();
+ sw.WriteLine( "; 螟ァ髻ウ隨ヲ縺ョ荳。謇句愛螳(0:OFF, 1:ON)" );
+ sw.WriteLine( "BigNotesJudge={0}", this.b螟ァ髻ウ隨ヲ蛻、螳 ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; NoInfo(0:OFF, 1:ON)" );
+ sw.WriteLine( "NoInfo={0}", this.bNoInfo ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 隴憺擇蛻蟯舌ョ繧「繝九Γ繝シ繧キ繝ァ繝ウ(0:7ス14, 1:15)" );
+ sw.WriteLine( "BranchAnime={0}", this.nBranchAnime );
+ sw.WriteLine();
+ sw.WriteLine( "; 繝繝輔か繝ォ繝医ョ譖イ繧ス繝シ繝(0:邨カ蟇セ繝代せ鬆, 1:繧ク繝」繝ウ繝ォ蜷阪た繝シ繝OLD, 2:繧ク繝」繝ウ繝ォ蜷阪た繝シ繝NEW )" );
+ sw.WriteLine( "0:Path, 1:GenreName(AC8ス暸C14), 2GenreName(AC15ス)" );
+ sw.WriteLine( "DefaultSongSort={0}", this.nDefaultSongSort );
+ sw.WriteLine();
+ sw.WriteLine( "; RANDOM繝「繝シ繝(0:OFF, 1:Random, 2:Mirorr 3:SuperRandom, 4:HyperRandom)" );
+ sw.WriteLine( "TaikoRandom={0}", (int) this.eRandom.Taiko );
+ sw.WriteLine();
+ sw.WriteLine( "; STEALTH繝「繝シ繝(0:OFF, 1:繝峨Ο繝ウ, 2:繧ケ繝繝ォ繧ケ)" );
+ sw.WriteLine( "TaikoStealth={0}", (int) this.eSTEALTH );
+ sw.WriteLine();
+ sw.WriteLine( "; 繧イ繝シ繝(0:OFF, 1:螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!, 2:螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!(豼霎) )" );
+ sw.WriteLine( "GameMode={0}", (int) this.eGameMode );
+ sw.WriteLine();
+ sw.WriteLine();
+ sw.WriteLine("; 迚ケ險薙Δ繝シ繝画凾縺ォPgUp/PgDn縺ァ菴募ー冗ッ鬟帙ー縺吶°");
+ sw.WriteLine("TokkunSkipMeasures={0}", this.TokkunSkipMeasures);
+ sw.WriteLine();
+ sw.WriteLine("; 迚ケ險薙Δ繝シ繝画凾縺ォ繧ク繝」繝ウ繝励昴う繝ウ繝医↓鬟帙ー縺吶◆繧√ョ譎る俣(ms)");
+ sw.WriteLine("; 謖螳嗄s莉・蜀縺ォ5蝗樒ク√r蜿ゥ縺阪∪縺励g縺");
+ sw.WriteLine("{1}={0}", this.TokkunMashInterval, nameof(this.TokkunMashInterval));
+ sw.WriteLine();
+ sw.WriteLine( "; JUST(0:OFF, 1:ON)" );
+ sw.WriteLine( "Just={0}", this.bJust ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 蛻、螳壽焚縺ョ陦ィ遉コ(0:OFF, 1:ON)" );
+ sw.WriteLine( "JudgeCountDisplay={0}", this.bJudgeCountDisplay ? 1 : 0 );
+ sw.WriteLine();
+ sw.WriteLine( "; 繝励Ξ繧、莠コ謨ー" );
+ sw.WriteLine( "PlayerCount={0}", this.nPlayerCount );
+ sw.WriteLine();
+ //sw.WriteLine( "; 驕ク譖イ逕サ髱「縺ョ蛻晄悄驕ク謚樣屮譏灘コヲ(繝吶シ繧ソ迚)" );
+ //sw.WriteLine( "DifficultPriority={0}", this.bJudgeCountDisplay ? 1 : 0 );
+ //sw.WriteLine();
+
+ sw.WriteLine( ";-------------------" );
+ #endregion
+ #region [ GUID ]
+ sw.WriteLine( "[GUID]" );
+ sw.WriteLine();
+ foreach( KeyValuePair pair in this.dicJoystick )
+ {
+ sw.WriteLine( "JoystickID={0},{1}", pair.Key, pair.Value );
+ }
+ #endregion
+ #region [ DrumsKeyAssign ]
+ sw.WriteLine();
+ sw.WriteLine( ";-------------------" );
+ sw.WriteLine( "; 繧ュ繝シ繧「繧オ繧、繝ウ" );
+ sw.WriteLine( "; 鬆縲逶ョシ哮eyboard 竊 'K'シ'0'シ九く繝シ繧ウ繝シ繝(10騾イ謨ー)" );
+ sw.WriteLine( "; Mouse 竊 'N'シ'0'シ九懊ち繝ウ逡ェ蜿キ(0ス7)" );
+ sw.WriteLine( "; MIDI In 竊 'M'シ九ョ繝舌う繧ケ逡ェ蜿キ1譯(0ス9,Aス杙)シ九ヮ繝シ繝育分蜿キ(10騾イ謨ー)" );
+ sw.WriteLine( "; Joystick 竊 'J'シ九ョ繝舌う繧ケ逡ェ蜿キ1譯(0ス9,Aス杙)シ 0 ...... シク貂帛ー(蟾ヲ)繝懊ち繝ウ" );
+ sw.WriteLine( "; 1 ...... シク蠅怜刈(蜿ウ)繝懊ち繝ウ" );
+ sw.WriteLine( "; 2 ...... シケ貂帛ー(荳)繝懊ち繝ウ" );
+ sw.WriteLine( "; 3 ...... シケ蠅怜刈(荳)繝懊ち繝ウ" );
+ sw.WriteLine( "; 4 ...... シコ貂帛ー(蜑)繝懊ち繝ウ" );
+ sw.WriteLine( "; 5 ...... シコ蠅怜刈(蠕)繝懊ち繝ウ" );
+ sw.WriteLine( "; 6ス133.. 繝懊ち繝ウ1ス128" );
+ sw.WriteLine( "; 縺薙l繧峨ョ鬆逶ョ繧 16 蛟九∪縺ァ謖螳壼庄閭ス(',' 縺ァ蛹コ蛻縺」縺ヲ險倩ソーシ峨" );
+ sw.WriteLine( ";" );
+ sw.WriteLine( "; 陦ィ險倅セ具シ唏H=K044,M042,J16" );
+ sw.WriteLine( "; 竊 HiHat 繧 Keyboard 縺ョ 44 ('Z'), MidiIn#0 縺ョ 42, JoyPad#1 縺ョ 6(繝懊ち繝ウ1) 縺ォ蜑イ蠖薙※" );
+ sw.WriteLine( ";" );
+ sw.WriteLine( "; 窶サJoystick 縺ョ繝繝舌う繧ケ逡ェ蜿キ縺ィ繝繝舌う繧ケ縺ィ縺ョ髢「菫ゅッ [GUID] 繧サ繧ッ繧キ繝ァ繝ウ縺ォ險倥@縺ヲ縺ゅk繧ゅョ縺梧怏蜉ケ縲" );
+ sw.WriteLine( ";" );
+ sw.WriteLine();
+ sw.WriteLine( "[DrumsKeyAssign]" );
+ sw.WriteLine();
+ sw.Write( "LeftRed=" );
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftRed );
+ sw.WriteLine();
+ sw.Write( "RightRed=" );
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightRed );
+ sw.WriteLine();
+ sw.Write( "LeftBlue=" ); // #27029 2012.1.4 from
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftBlue ); //
+ sw.WriteLine(); //
+ sw.Write( "RightBlue=" ); // #27029 2012.1.4 from
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightBlue ); //
+ sw.WriteLine();
+ sw.Write( "LeftRed2P=" );
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftRed2P );
+ sw.WriteLine();
+ sw.Write( "RightRed2P=" );
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightRed2P );
+ sw.WriteLine();
+ sw.Write( "LeftBlue2P=" ); // #27029 2012.1.4 from
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftBlue2P ); //
+ sw.WriteLine(); //
+ sw.Write( "RightBlue2P=" ); // #27029 2012.1.4 from
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightBlue2P ); //
+ sw.WriteLine();
+ sw.WriteLine();
+ #endregion
+ #region [ SystemkeyAssign ]
+ sw.WriteLine( "[SystemKeyAssign]" );
+ sw.WriteLine();
+ sw.Write( "Capture=" );
+ this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.System.Capture );
+ sw.WriteLine();
+ sw.WriteLine();
+ #endregion
+
+ sw.Close();
+ }
+ public void t繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ( string ini繝輔ぃ繧、繝ォ蜷 )
+ {
+ this.ConfigIni繝輔ぃ繧、繝ォ蜷 = ini繝輔ぃ繧、繝ォ蜷;
+ this.bConfigIni縺悟ュ伜惠縺励※縺繧 = File.Exists( this.ConfigIni繝輔ぃ繧、繝ォ蜷 );
+ if( this.bConfigIni縺悟ュ伜惠縺励※縺繧 )
+ {
+ string str;
+ this.t繧ュ繝シ繧「繧オ繧、繝ウ繧貞ィ驛ィ繧ッ繝ェ繧「縺吶k();
+ using ( StreamReader reader = new StreamReader( this.ConfigIni繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) ) )
+ {
+ str = reader.ReadToEnd();
+ }
+ t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ( str );
+ CDTXVersion version = new CDTXVersion( this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ );
+ //if( version.n謨エ謨ー驛ィ <= 69 )
+ //{
+ // this.t繝繝輔か繝ォ繝医ョ繧ュ繝シ繧「繧オ繧、繝ウ縺ォ險ュ螳壹☆繧();
+ //}
+ }
+ }
+
+ private void t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ( string strAllSettings ) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier.
+ {
+ E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Unknown;
+ string[] delimiter = { "\n" };
+ string[] strSingleLine = strAllSettings.Split( delimiter, StringSplitOptions.RemoveEmptyEntries );
+ foreach ( string s in strSingleLine )
+ {
+ string str = s.Replace( '\t', ' ' ).TrimStart( new char[] { '\t', ' ' } );
+ if ( ( str.Length != 0 ) && ( str[ 0 ] != ';' ) )
+ {
+ try
+ {
+ string str3;
+ string str4;
+ if ( str[ 0 ] == '[' )
+ {
+ #region [ 繧サ繧ッ繧キ繝ァ繝ウ縺ョ螟画峩 ]
+ //-----------------------------
+ StringBuilder builder = new StringBuilder( 0x20 );
+ int num = 1;
+ while ( ( num < str.Length ) && ( str[ num ] != ']' ) )
+ {
+ builder.Append( str[ num++ ] );
+ }
+ string str2 = builder.ToString();
+ if ( str2.Equals( "System" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.System;
+ }
+ else if (str2.Equals("AutoPlay"))
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.AutoPlay;
+ }
+ else if (str2.Equals("HitRange"))
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HitRange;
+ }
+ else if ( str2.Equals( "Log" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Log;
+ }
+ else if ( str2.Equals( "PlayOption" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.PlayOption;
+ }
+ else if ( str2.Equals( "ViewerOption" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.ViewerOption;
+ }
+ else if ( str2.Equals( "GUID" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.GUID;
+ }
+ else if ( str2.Equals( "DrumsKeyAssign" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.DrumsKeyAssign;
+ }
+ else if ( str2.Equals( "SystemKeyAssign" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.SystemKeyAssign;
+ }
+ else if( str2.Equals( "Temp" ) )
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Temp;
+ }
+ else
+ {
+ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Unknown;
+ }
+ //-----------------------------
+ #endregion
+ }
+ else
+ {
+ string[] strArray = str.Split( new char[] { '=' } );
+ if( strArray.Length == 2 )
+ {
+ str3 = strArray[ 0 ].Trim();
+ str4 = strArray[ 1 ].Trim();
+ switch( unknown )
+ {
+ #region [ [System] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.System:
+ {
+#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹
+ //----------------------------------------
+ if (str3.Equals("GaugeFactorD"))
+ {
+ int p = 0;
+ string[] splittedFactor = str4.Split(',');
+ foreach (string s in splittedFactor) {
+ this.fGaugeFactor[p++, 0] = Convert.ToSingle(s);
+ }
+ } else
+ if (str3.Equals("GaugeFactorG"))
+ {
+ int p = 0;
+ string[] splittedFactor = str4.Split(',');
+ foreach (string s in splittedFactor)
+ {
+ this.fGaugeFactor[p++, 1] = Convert.ToSingle(s);
+ }
+ }
+ else
+ if (str3.Equals("DamageFactor"))
+ {
+ int p = 0;
+ string[] splittedFactor = str4.Split(',');
+ foreach (string s in splittedFactor)
+ {
+ this.fDamageLevelFactor[p++] = Convert.ToSingle(s);
+ }
+ }
+ else
+ //----------------------------------------
+#endif
+ #region [ Version ]
+ if ( str3.Equals( "Version" ) )
+ {
+ this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = str4;
+ }
+ #endregion
+ #region [ TJAPath ]
+ else if( str3.Equals( "TJAPath" ) )
+ {
+ this.str譖イ繝繝シ繧ソ讀懃エ「繝代せ = str4;
+ }
+ #endregion
+ #region [ skin髢「菫 ]
+ else if ( str3.Equals( "SkinPath" ) )
+ {
+ string absSkinPath = str4;
+ if ( !System.IO.Path.IsPathRooted( str4 ) )
+ {
+ absSkinPath = System.IO.Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" );
+ absSkinPath = System.IO.Path.Combine( absSkinPath, str4 );
+ Uri u = new Uri( absSkinPath );
+ absSkinPath = u.AbsolutePath.ToString(); // str4蜀縺ォ逶ク蟇セ繝代せ縺後≠繧句エ蜷医↓蛯吶∴繧
+ absSkinPath = System.Web.HttpUtility.UrlDecode( absSkinPath ); // 繝繧ウ繝シ繝峨☆繧
+ absSkinPath = absSkinPath.Replace( '/', System.IO.Path.DirectorySeparatorChar ); // 蛹コ蛻繧頑枚蟄励′\縺ァ縺ッ縺ェ縺/縺ェ縺ョ縺ァ鄂ョ謠帙☆繧
+ }
+ if ( absSkinPath[ absSkinPath.Length - 1 ] != System.IO.Path.DirectorySeparatorChar ) // 繝輔か繝ォ繝蜷肴忰蟆セ縺ォ\繧貞ソ縺壹▽縺代※縲,Skin蛛エ縺ィ陦ィ險倥r邨ア荳縺吶k
+ {
+ absSkinPath += System.IO.Path.DirectorySeparatorChar;
+ }
+ this.strSystemSkinSubfolderFullName = absSkinPath;
+ }
+ else if (str3.Equals(nameof(FastRender)))
+ {
+ FastRender = C螟画鋤.bONorOFF(str4[0]);
+ }
+ #endregion
+ #region [ Window髢「菫 ]
+ else if (str3.Equals("FullScreen"))
+ {
+ this.b蜈ィ逕サ髱「繝「繝シ繝 = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if ( str3.Equals( "WindowX" ) ) // #30675 2013.02.04 ikanick add
+ {
+ this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(
+ str4, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - 1 , this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX );
+ }
+ else if ( str3.Equals( "WindowY" ) ) // #30675 2013.02.04 ikanick add
+ {
+ this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(
+ str4, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - 1 , this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY );
+ }
+ else if ( str3.Equals( "WindowWidth" ) ) // #23510 2010.10.31 yyagi add
+ {
+ this.n繧ヲ繧、繝ウ繝峨えwidth = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 65535, this.n繧ヲ繧、繝ウ繝峨えwidth );
+ if( this.n繧ヲ繧、繝ウ繝峨えwidth <= 0 )
+ {
+ this.n繧ヲ繧、繝ウ繝峨えwidth = SampleFramework.GameWindowSize.Width;
+ }
+ }
+ else if( str3.Equals( "WindowHeight" ) ) // #23510 2010.10.31 yyagi add
+ {
+ this.n繧ヲ繧、繝ウ繝峨えheight = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 65535, this.n繧ヲ繧、繝ウ繝峨えheight );
+ if( this.n繧ヲ繧、繝ウ繝峨えheight <= 0 )
+ {
+ this.n繧ヲ繧、繝ウ繝峨えheight = SampleFramework.GameWindowSize.Height;
+ }
+ }
+ else if ( str3.Equals( "DoubleClickFullScreen" ) ) // #26752 2011.11.27 yyagi
+ {
+ this.bIsAllowedDoubleClickFullscreen = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "EnableSystemMenu" ) ) // #28200 2012.5.1 yyagi
+ {
+ this.bIsEnabledSystemMenu = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "BackSleep" ) ) // #23568 2010.11.04 ikanick add
+ {
+ this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ縺。繧繧薙→荳ク繧√※霑斐☆( str4, 0, 50, this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s );
+ }
+ #endregion
+
+ #region [ WASAPI/ASIO髢「菫 ]
+ else if ( str3.Equals( "SoundDeviceType" ) )
+ {
+ this.nSoundDeviceType = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, this.nSoundDeviceType );
+ }
+ else if ( str3.Equals( "WASAPIBufferSizeMs" ) )
+ {
+ this.nWASAPIBufferSizeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999, this.nWASAPIBufferSizeMs );
+ }
+ else if ( str3.Equals( "ASIODevice" ) )
+ {
+ string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices();
+ this.nASIODevice = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, asiodev.Length - 1, this.nASIODevice );
+ }
+ //else if ( str3.Equals( "ASIOBufferSizeMs" ) )
+ //{
+ // this.nASIOBufferSizeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999, this.nASIOBufferSizeMs );
+ //}
+ //else if ( str3.Equals( "DynamicBassMixerManagement" ) )
+ //{
+ // this.bDynamicBassMixerManagement = C螟画鋤.bONorOFF( str4[ 0 ] );
+ //}
+ else if ( str3.Equals( "SoundTimerType" ) ) // #33689 2014.6.6 yyagi
+ {
+ this.bUseOSTimer = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ //else if ( str3.Equals( "MasterVolume" ) )
+ //{
+ // this.nMasterVolume = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 100, this.nMasterVolume );
+ //}
+ #endregion
+
+ #region [ 繝輔か繝ウ繝 ]
+ else if (str3.Equals("FontName"))
+ {
+ this.FontName = str4;
+ }
+ else if (str3.Equals("BoxFontName"))
+ {
+ this.BoxFontName = str4;
+ }
+ #endregion
+
+ else if ( str3.Equals( "VSyncWait" ) )
+ {
+ this.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "SleepTimePerFrame" ) ) // #23568 2011.11.27 yyagi
+ {
+ this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ縺。繧繧薙→荳ク繧√※霑斐☆( str4, -1, 50, this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s );
+ }
+ else if( str3.Equals( "BGAlpha" ) )
+ {
+ this.n閭梧勹縺ョ騾城℃蠎ヲ = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0xff, this.n閭梧勹縺ョ騾城℃蠎ヲ );
+ }
+ else if( str3.Equals( "DamageLevel" ) )
+ {
+ this.e繝繝。繝シ繧ク繝ャ繝吶Ν = (E繝繝。繝シ繧ク繝ャ繝吶Ν) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.e繝繝。繝シ繧ク繝ャ繝吶Ν );
+ }
+ else if ( str3.Equals( "StageFailed" ) )
+ {
+ this.bSTAGEFAILED譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ #region [ AVI/BGA ]
+ else if( str3.Equals( "AVI" ) )
+ {
+ this.bAVI譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "BGA" ) )
+ {
+ this.bBGA譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "ClipDispType" ) )
+ {
+ this.eClipDispType = (EClipDispType)C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 3, (int) this.eClipDispType );
+ }
+ #endregion
+ #region [ 繝励Ξ繝薙Η繝シ髻ウ ]
+ else if( str3.Equals( "PreviewSoundWait" ) )
+ {
+ this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0x5f5e0ff, this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms );
+ }
+ else if( str3.Equals( "PreviewImageWait" ) )
+ {
+ this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0x5f5e0ff, this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms );
+ }
+ #endregion
+ //else if( str3.Equals( "AdjustWaves" ) )
+ //{
+ // this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ //}
+ #region [ BGM/繝峨Λ繝縺ョ繝偵ャ繝磯浹 ]
+ else if( str3.Equals( "BGMSound" ) )
+ {
+ this.bBGM髻ウ繧堤匱螢ー縺吶k = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ #endregion
+ else if( str3.Equals( "SaveScoreIni" ) )
+ {
+ this.bScoreIni繧貞コ蜉帙☆繧 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "RandomFromSubBox" ) )
+ {
+ this.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ #region [ 繧ウ繝ウ繝懈焚 ]
+ else if( str3.Equals( "MinComboDrums" ) )
+ {
+ this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 0x1869f, this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums );
+ }
+ #endregion
+ else if( str3.Equals( "ShowDebugStatus" ) )
+ {
+ this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( nameof(ApplyLoudnessMetadata) ) )
+ {
+ this.ApplyLoudnessMetadata = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( nameof(TargetLoudness) ) )
+ {
+ this.TargetLoudness = C螟画鋤.db蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumLufs.ToDouble(), CSound.MaximumLufs.ToDouble(), this.TargetLoudness );
+ }
+ else if( str3.Equals( nameof(ApplySongVol) ) )
+ {
+ this.ApplySongVol = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( nameof(SoundEffectLevel) ) )
+ {
+ this.SoundEffectLevel = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SoundEffectLevel );
+ }
+ else if( str3.Equals( nameof(VoiceLevel) ) )
+ {
+ this.VoiceLevel = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.VoiceLevel );
+ }
+ else if( str3.Equals( nameof(SongPreviewLevel) ) )
+ {
+ this.SongPreviewLevel = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SongPreviewLevel );
+ }
+ else if( str3.Equals( nameof(KeyboardSoundLevelIncrement) ) )
+ {
+ this.KeyboardSoundLevelIncrement = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement, this.KeyboardSoundLevelIncrement );
+ }
+ else if( str3.Equals(nameof(MusicPreTimeMs)))
+ {
+ MusicPreTimeMs = int.Parse(str4);
+ }
+ else if( str3.Equals( "StoicMode" ) )
+ {
+ this.b繧ケ繝医う繝繧ッ繝「繝シ繝 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "JudgeDispPriority" ) )
+ {
+ this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ );
+ }
+ else if ( str3.Equals( "AutoResultCapture" ) ) // #25399 2011.6.9 yyagi
+ {
+ this.bIsAutoResultCapture = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if (str3.Equals(nameof(SendDiscordPlayingInformation)))
+ {
+ SendDiscordPlayingInformation = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if ( str3.Equals( "TimeStretch" ) ) // #23664 2013.2.24 yyagi
+ {
+ this.bTimeStretch = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ #region [ AdjustTime ]
+ else if( str3.Equals( "InputAdjustTime" ) )
+ {
+ this.nInputAdjustTimeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nInputAdjustTimeMs );
+ }
+ else if ( str3.Equals( "JudgeLinePosOffsetDrums" ) ) // #31602 2013.6.23 yyagi
+ {
+ this.nJudgeLinePosOffset.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nJudgeLinePosOffset.Drums );
+ }
+ else if ( str3.Equals( "JudgeLinePosOffsetGuitar" ) ) // #31602 2013.6.23 yyagi
+ {
+ this.nJudgeLinePosOffset.Guitar = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nJudgeLinePosOffset.Guitar );
+ }
+ else if ( str3.Equals( "JudgeLinePosOffsetBass" ) ) // #31602 2013.6.23 yyagi
+ {
+ this.nJudgeLinePosOffset.Bass = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nJudgeLinePosOffset.Bass );
+ }
+ else if ( str3.Equals( "JudgeLinePosModeGuitar" ) ) // #33891 2014.6.26 yyagi
+ {
+ this.e蛻、螳壻ス咲スョ.Guitar = (E蛻、螳壻ス咲スョ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.e蛻、螳壻ス咲スョ.Guitar );
+ }
+ else if ( str3.Equals( "JudgeLinePosModeBass" ) ) // #33891 2014.6.26 yyagi
+ {
+ this.e蛻、螳壻ス咲スョ.Bass = (E蛻、螳壻ス咲スョ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.e蛻、螳壻ス咲スョ.Bass );
+ }
+ #endregion
+ else if( str3.Equals( "BufferedInput" ) )
+ {
+ this.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "PolyphonicSounds" ) ) // #28228 2012.5.1 yyagi
+ {
+ this.nPoliphonicSounds = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 8, this.nPoliphonicSounds );
+ }
+ #region [ VelocityMin ]
+ else if ( str3.Equals( "LCVelocityMin" ) ) // #23857 2010.12.12 yyagi
+ {
+ this.nVelocityMin.LC = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.LC );
+ }
+ else if( str3.Equals( "HHVelocityMin" ) )
+ {
+ this.nVelocityMin.HH = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.HH );
+ }
+ else if( str3.Equals( "SDVelocityMin" ) ) // #23857 2011.1.31 yyagi
+ {
+ this.nVelocityMin.SD = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.SD );
+ }
+ else if( str3.Equals( "BDVelocityMin" ) ) // #23857 2011.1.31 yyagi
+ {
+ this.nVelocityMin.BD = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.BD );
+ }
+ else if( str3.Equals( "HTVelocityMin" ) ) // #23857 2011.1.31 yyagi
+ {
+ this.nVelocityMin.HT = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.HT );
+ }
+ else if( str3.Equals( "LTVelocityMin" ) ) // #23857 2011.1.31 yyagi
+ {
+ this.nVelocityMin.LT = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.LT );
+ }
+ else if( str3.Equals( "FTVelocityMin" ) ) // #23857 2011.1.31 yyagi
+ {
+ this.nVelocityMin.FT = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.FT );
+ }
+ else if( str3.Equals( "CYVelocityMin" ) ) // #23857 2011.1.31 yyagi
+ {
+ this.nVelocityMin.CY = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.CY );
+ }
+ else if( str3.Equals( "RDVelocityMin" ) ) // #23857 2011.1.31 yyagi
+ {
+ this.nVelocityMin.RD = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.RD );
+ }
+ #endregion
+ //else if ( str3.Equals( "NoMP3Streaming" ) )
+ //{
+ // this.bNoMP3Streaming = C螟画鋤.bONorOFF( str4[ 0 ] );
+ //}
+ #region[ Ver.K霑ス蜉 ]
+ else if ( str3.Equals( "DirectShowMode" ) ) // #28228 2012.5.1 yyagi
+ {
+ this.bDirectShowMode = C螟画鋤.bONorOFF( str4[ 0 ] ); ;
+ }
+ #endregion
+ else if( str3.Equals( "EndingAnime" ) )
+ {
+ this.bEndingAnime = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+
+ continue;
+ }
+ //-----------------------------
+ #endregion
+
+ #region [ [AutoPlay] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.AutoPlay:
+ if (str3.Equals("Taiko"))
+ {
+ this.b螟ェ鮠薙ヱ繝シ繝AutoPlay = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if (str3.Equals("Taiko2P"))
+ {
+ this.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if (str3.Equals("TaikoAutoRoll"))
+ {
+ this.bAuto蜈育函縺ョ騾」謇 = C螟画鋤.bONorOFF(str4[0]);
+ }
+ continue;
+ //-----------------------------
+ #endregion
+
+ #region [ [HitRange] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HitRange:
+ if (str3.Equals("Perfect"))
+ {
+ this.n繝偵ャ繝育ッ蝗イms.Perfect = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Perfect);
+ }
+ else if (str3.Equals("Great"))
+ {
+ this.n繝偵ャ繝育ッ蝗イms.Great = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Great);
+ }
+ else if (str3.Equals("Good"))
+ {
+ this.n繝偵ャ繝育ッ蝗イms.Good = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Good);
+ }
+ else if (str3.Equals("Poor"))
+ {
+ this.n繝偵ャ繝育ッ蝗イms.Poor = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Poor);
+ }
+ continue;
+ //-----------------------------
+ #endregion
+
+
+
+ #region [ [Log] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Log:
+ {
+ if( str3.Equals( "OutputLog" ) )
+ {
+ this.b繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "TraceCreatedDisposed" ) )
+ {
+ this.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "TraceDTXDetails" ) )
+ {
+ this.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "TraceSongSearch" ) )
+ {
+ this.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ continue;
+ }
+ //-----------------------------
+ #endregion
+
+ #region [ [PlayOption] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.PlayOption:
+ {
+ if (str3.Equals("ShowChara"))
+ {
+ ShowChara = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if( str3.Equals("ShowDancer"))
+ {
+ ShowDancer = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if (str3.Equals("ShowRunner"))
+ {
+ ShowRunner = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if (str3.Equals("ShowMob"))
+ {
+ ShowMob = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if (str3.Equals("ShowFooter"))
+ {
+ ShowFooter = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if (str3.Equals("ShowPuchiChara"))
+ {
+ ShowPuchiChara = C螟画鋤.bONorOFF(str4[0]);
+ }
+ else if( str3.Equals( "Dark" ) )
+ {
+ this.eDark = (E繝繝シ繧ッ繝「繝シ繝) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.eDark );
+ }
+ else if( str3.Equals( "ScrollMode" ) )
+ {
+ this.eScrollMode = ( EScrollMode )C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, 0 );
+ }
+ else if (str3.Equals("EnableCountDownTimer"))
+ {
+ this.bEnableCountdownTimer = C螟画鋤.bONorOFF(str4[0]);
+ }
+ #region [ Sudden ]
+ else if( str3.Equals( "DrumsSudden" ) )
+ {
+ this.bSudden.Drums = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ #endregion
+ #region [ Hidden ]
+ else if( str3.Equals( "DrumsHidden" ) )
+ {
+ this.bHidden.Drums = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ #endregion
+ #region [ Invisible ]
+ else if ( str3.Equals( "DrumsInvisible" ) )
+ {
+ this.eInvisible.Drums = (EInvisible) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.eInvisible.Drums );
+ }
+ //else if ( str3.Equals( "InvisibleDisplayTimeMs" ) )
+ //{
+ // this.nDisplayTimesMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999999, (int) this.nDisplayTimesMs );
+ //}
+ //else if ( str3.Equals( "InvisibleFadeoutTimeMs" ) )
+ //{
+ // this.nFadeoutTimeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999999, (int) this.nFadeoutTimeMs );
+ //}
+ #endregion
+ else if ( str3.Equals( "DrumsReverse" ) )
+ {
+ this.bReverse.Drums = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "DrumsPosition" ) )
+ {
+ this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums = (E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums );
+ }
+ else if( str3.Equals( "DrumsScrollSpeed" ) )
+ {
+ this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0x7cf, this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums );
+ }
+ else if( str3.Equals( "PlaySpeed" ) )
+ {
+ this.n貍泌・城溷コヲ = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 5, 400, this.n貍泌・城溷コヲ );
+ }
+ else if (str3.Equals("PlaySpeedNotEqualOneNoSound"))
+ {
+ this.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 = C螟画鋤.bONorOFF(str4[0]);
+ }
+ //else if ( str3.Equals( "JudgeDispPriorityDrums" ) )
+ //{
+ // this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Drums = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Drums );
+ //}
+ //else if ( str3.Equals( "JudgeDispPriorityGuitar" ) )
+ //{
+ // this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Guitar = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Guitar );
+ //}
+ //else if ( str3.Equals( "JudgeDispPriorityBass" ) )
+ //{
+ // this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Bass = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Bass );
+ //}
+ else if ( str3.Equals( "Risky" ) ) // #23559 2011.6.23 yyagi
+ {
+ this.nRisky = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 10, this.nRisky );
+ }
+ else if ( str3.Equals( "DrumsTight" ) )
+ {
+ this.bTight = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "BranchGuide" ) )
+ {
+ this.bBranchGuide = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "DefaultCourse" ) ) //2017.01.30 DD
+ {
+ this.nDefaultCourse = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 4, this.nDefaultCourse );
+ }
+ else if ( str3.Equals( "ScoreMode" ) )
+ {
+ this.nScoreMode = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 3, this.nScoreMode );
+ }
+ else if ( str3.Equals( "HispeedRandom" ) )
+ {
+ this.bHispeedRandom = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "BigNotesWaitTime" ) )
+ {
+ this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 100, this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 );
+ }
+ else if ( str3.Equals( "BigNotesJudge" ) )
+ {
+ this.b螟ァ髻ウ隨ヲ蛻、螳 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "BranchAnime" ) )
+ {
+ this.nBranchAnime = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, this.nBranchAnime );
+ }
+ else if ( str3.Equals( "NoInfo" ) )
+ {
+ this.bNoInfo = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "DefaultSongSort" ) )
+ {
+ this.nDefaultSongSort = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, this.nDefaultSongSort );
+ }
+ else if( str3.Equals( "TaikoRandom" ) )
+ {
+ this.eRandom.Taiko = (E繝ゥ繝ウ繝繝繝「繝シ繝) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 4, (int) this.eRandom.Taiko );
+ }
+ else if( str3.Equals( "TaikoStealth" ) )
+ {
+ this.eSTEALTH = (E繧ケ繝繝ォ繧ケ繝「繝シ繝) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 3, (int) this.eSTEALTH );
+ }
+ else if( str3.Equals( "GameMode" ) )
+ {
+ this.eGameMode = (EGame) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.eGameMode );
+ }
+ else if (str3.Equals("TokkunSkipMeasures"))
+ {
+ this.TokkunSkipMeasures = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 9999, this.TokkunSkipMeasures);
+ }
+ else if (str3.Equals(nameof(TokkunMashInterval)))
+ {
+ this.TokkunMashInterval = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 9999, this.TokkunMashInterval);
+ }
+ else if( str3.Equals( "JudgeCountDisplay" ) )
+ {
+ this.bJudgeCountDisplay = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "Just" ) )
+ {
+ this.bJust = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if( str3.Equals( "PlayerCount" ) )
+ {
+ this.nPlayerCount = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 2, this.nPlayerCount );
+ }
+ else if(str3.Equals(nameof(ShinuchiMode)))
+ {
+ ShinuchiMode = C螟画鋤.bONorOFF(str4[0]);
+ }
+ continue;
+ }
+ //-----------------------------
+ #endregion
+
+ #region [ [ViewerOption] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.ViewerOption:
+ {
+ if ( str3.Equals( "ViewerDrumsScrollSpeed" ) )
+ {
+ this.nViewerScrollSpeed.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1999, this.nViewerScrollSpeed.Drums );
+ }
+ else if ( str3.Equals( "ViewerGuitarScrollSpeed" ) )
+ {
+ this.nViewerScrollSpeed.Guitar = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1999, this.nViewerScrollSpeed.Guitar );
+ }
+ else if ( str3.Equals( "ViewerBassScrollSpeed" ) )
+ {
+ this.nViewerScrollSpeed.Bass = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1999, this.nViewerScrollSpeed.Bass );
+ }
+ else if ( str3.Equals( "ViewerVSyncWait" ) )
+ {
+ this.bViewerVSyncWait = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "ViewerShowDebugStatus" ) )
+ {
+ this.bViewerShowDebugStatus = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "ViewerTimeStretch" ) )
+ {
+ this.bViewerTimeStretch = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "ViewerGuitar" ) )
+ {
+ this.bViewerGuitar譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ else if ( str3.Equals( "ViewerDrums" ) )
+ {
+ this.bViewerDrums譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] );
+ }
+ continue;
+ }
+ //-----------------------------
+ #endregion
+
+ #region [ [GUID] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.GUID:
+ if( str3.Equals( "JoystickID" ) )
+ {
+ this.tJoystickID縺ョ蜿門セ( str4 );
+ }
+ continue;
+ //-----------------------------
+ #endregion
+
+ #region [ [DrumsKeyAssign] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.DrumsKeyAssign:
+ {
+ if( str3.Equals( "LeftRed" ) )
+ {
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftRed );
+ }
+ else if( str3.Equals( "RightRed" ) )
+ {
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightRed );
+ }
+ else if( str3.Equals( "LeftBlue" ) ) // #27029 2012.1.4 from
+ { //
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftBlue ); //
+ } //
+ else if( str3.Equals( "RightBlue" ) ) // #27029 2012.1.4 from
+ { //
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightBlue ); //
+ }
+
+ else if( str3.Equals( "LeftRed2P" ) )
+ {
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftRed2P );
+ }
+ else if( str3.Equals( "RightRed2P" ) )
+ {
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightRed2P );
+ }
+ else if( str3.Equals( "LeftBlue2P" ) ) // #27029 2012.1.4 from
+ { //
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftBlue2P ); //
+ } //
+ else if( str3.Equals( "RightBlue2P" ) ) // #27029 2012.1.4 from
+ { //
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightBlue2P ); //
+ }
+
+ continue;
+ }
+ //-----------------------------
+ #endregion
+
+ #region [ [SystemKeyAssign] ]
+ //-----------------------------
+ case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.SystemKeyAssign:
+ if( str3.Equals( "Capture" ) )
+ {
+ this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.System.Capture );
+ }
+ continue;
+ //-----------------------------
+ #endregion
+ }
+ }
+ }
+ continue;
+ }
+ catch ( Exception exception )
+ {
+ Trace.TraceError( exception.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (93c4c5cd-4996-4e8c-a82f-a179ff590b44)" );
+ continue;
+ }
+ }
+ }
+ }
+
+ ///
+ /// 繧ョ繧ソ繝シ縺ィ繝吶シ繧ケ縺ョ繧ュ繝シ繧「繧オ繧、繝ウ蜈・繧梧崛縺
+ ///
+ //public void SwapGuitarBassKeyAssign() // #24063 2011.1.16 yyagi
+ //{
+ // for ( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ )
+ // {
+ // CKeyAssign.STKEYASSIGN t; //= new CConfigIni.CKeyAssign.STKEYASSIGN();
+ // for ( int k = 0; k < 16; k++ )
+ // {
+ // t = this.KeyAssign[ (int)EKeyConfigPart.GUITAR ][ j ][ k ];
+ // this.KeyAssign[ (int)EKeyConfigPart.GUITAR ][ j ][ k ] = this.KeyAssign[ (int)EKeyConfigPart.BASS ][ j ][ k ];
+ // this.KeyAssign[ (int)EKeyConfigPart.BASS ][ j ][ k ] = t;
+ // }
+ // }
+ // this.bIsSwappedGuitarBass = !bIsSwappedGuitarBass;
+ //}
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private enum E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・
+ {
+ Unknown,
+ System,
+ Log,
+ PlayOption,
+ ViewerOption,
+ AutoPlay,
+ HitRange,
+ GUID,
+ DrumsKeyAssign,
+ SystemKeyAssign,
+ Temp,
+ }
+
+ private bool _bDrums譛牙柑;
+ private bool _bGuitar譛牙柑;
+ private bool bConfigIni縺悟ュ伜惠縺励※縺繧;
+ private string ConfigIni繝輔ぃ繧、繝ォ蜷;
+
+ private void tJoystickID縺ョ蜿門セ( string str繧ュ繝シ險倩ソー )
+ {
+ string[] strArray = str繧ュ繝シ險倩ソー.Split( new char[] { ',' } );
+ if( strArray.Length >= 2 )
+ {
+ int result = 0;
+ if( ( int.TryParse( strArray[ 0 ], out result ) && ( result >= 0 ) ) && ( result <= 9 ) )
+ {
+ if( this.dicJoystick.ContainsKey( result ) )
+ {
+ this.dicJoystick.Remove( result );
+ }
+ this.dicJoystick.Add( result, strArray[ 1 ] );
+ }
+ }
+ }
+ private void t繧ュ繝シ繧「繧オ繧、繝ウ繧貞ィ驛ィ繧ッ繝ェ繧「縺吶k()
+ {
+ this.KeyAssign = new CKeyAssign();
+ for( int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++ )
+ {
+ for( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ )
+ {
+ this.KeyAssign[ i ][ j ] = new CKeyAssign.STKEYASSIGN[ 16 ];
+ for( int k = 0; k < 16; k++ )
+ {
+ this.KeyAssign[ i ][ j ][ k ] = new CKeyAssign.STKEYASSIGN( E蜈・蜉帙ョ繝舌う繧ケ.荳肴, 0, 0 );
+ }
+ }
+ }
+ }
+ private void t繧ュ繝シ縺ョ譖ク縺榊コ縺( StreamWriter sw, CKeyAssign.STKEYASSIGN[] assign )
+ {
+ bool flag = true;
+ for( int i = 0; i < 0x10; i++ )
+ {
+ if( assign[ i ].蜈・蜉帙ョ繝舌う繧ケ == E蜈・蜉帙ョ繝舌う繧ケ.荳肴 )
+ {
+ continue;
+ }
+ if( !flag )
+ {
+ sw.Write( ',' );
+ }
+ flag = false;
+ switch( assign[ i ].蜈・蜉帙ョ繝舌う繧ケ )
+ {
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝:
+ sw.Write( 'K' );
+ break;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉:
+ sw.Write( 'M' );
+ break;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝:
+ sw.Write( 'J' );
+ break;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ:
+ sw.Write( 'N' );
+ break;
+ }
+ sw.Write( "{0}{1}", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Substring( assign[ i ].ID, 1 ), assign[ i ].繧ウ繝シ繝 ); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23)
+ }
+ }
+ private void t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( string str繧ュ繝シ險倩ソー, CKeyAssign.STKEYASSIGN[] assign )
+ {
+ string[] strArray = str繧ュ繝シ險倩ソー.Split( new char[] { ',' } );
+ for( int i = 0; ( i < strArray.Length ) && ( i < 0x10 ); i++ )
+ {
+ E蜈・蜉帙ョ繝舌う繧ケ e蜈・蜉帙ョ繝舌う繧ケ;
+ int id;
+ int code;
+ string str = strArray[ i ].Trim().ToUpper();
+ if ( str.Length >= 3 )
+ {
+ e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.荳肴;
+ switch ( str[ 0 ] )
+ {
+ case 'J':
+ e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝;
+ break;
+
+ case 'K':
+ e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝;
+ break;
+
+ case 'L':
+ continue;
+
+ case 'M':
+ e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉;
+ break;
+
+ case 'N':
+ e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ;
+ break;
+ }
+ }
+ else
+ {
+ continue;
+ }
+ id = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".IndexOf( str[ 1 ] ); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23)
+ if( ( ( id >= 0 ) && int.TryParse( str.Substring( 2 ), out code ) ) && ( ( code >= 0 ) && ( code <= 0xff ) ) )
+ {
+ this.t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( e蜈・蜉帙ョ繝舌う繧ケ, id, code );
+ assign[ i ].蜈・蜉帙ョ繝舌う繧ケ = e蜈・蜉帙ョ繝舌う繧ケ;
+ assign[ i ].ID = id;
+ assign[ i ].繧ウ繝シ繝 = code;
+ }
+ }
+ }
+ private void t繝繝輔か繝ォ繝医ョ繧ュ繝シ繧「繧オ繧、繝ウ縺ォ險ュ螳壹☆繧()
+ {
+ this.t繧ュ繝シ繧「繧オ繧、繝ウ繧貞ィ驛ィ繧ッ繝ェ繧「縺吶k();
+
+ string strDefaultKeyAssign = @"
+[DrumsKeyAssign]
+LeftRed=K015
+RightRed=K019
+LeftBlue=K013
+RightBlue=K020
+LeftRed2P=K011
+RightRed2P=K023
+LeftBlue2P=K012
+RightBlue2P=K047
+
+[SystemKeyAssign]
+Capture=K065
+";
+ t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ( strDefaultKeyAssign );
+ }
+ //-----------------
+ #endregion
+
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private bool SetProperty(ref T storage, T value, string propertyName = null)
+ {
+ if (Equals(storage, value))
+ {
+ return false;
+ }
+
+ storage = value;
+ OnPropertyChanged(propertyName);
+ return true;
+ }
+
+ private void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/TJAPlayer3/Common/CDTXVersion.cs b/TJAPlayer3/Common/CDTXVersion.cs
new file mode 100644
index 00000000..a83090ce
--- /dev/null
+++ b/TJAPlayer3/Common/CDTXVersion.cs
@@ -0,0 +1,210 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TJAPlayer3
+{
+ ///
+ /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ縲
+ /// 萓1シ"078b" 竊 謨エ謨ー驛ィ=078, 蟆乗焚驛ィ=2000000 ('闍ア蟄'+'yymmdd')
+ /// 萓2シ"078a(100124)" 竊 謨エ謨ー驛ィ=078, 蟆乗焚驛ィ=1100124 ('闍ア蟄'+'yymmdd')
+ ///
+ public class CDTXVersion
+ {
+ // 繝励Ο繝代ユ繧」
+
+ ///
+ /// 繝舌シ繧ク繝ァ繝ウ縺梧悴遏・縺ョ縺ィ縺阪↓ true 縺ォ縺ェ繧九
+ ///
+ public bool Unknown
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ縺ョ謨エ謨ー驛ィ繧定。ィ縺吶
+ /// 萓1シ"078b" 竊 謨エ謨ー驛ィ=078
+ /// 萓2シ"078a(100124)" 竊 謨エ謨ー驛ィ=078
+ ///
+ public int n謨エ謨ー驛ィ;
+
+ ///
+ /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ縺ョ蟆乗焚驛ィ繧定。ィ縺吶
+ /// 蟆乗焚驛ィ縺ッ縲'闍ア蟄(0ス26) * 1000000 + 譌・莉(yymmdd)' 縺ョ蠑上〒陦ィ縺輔l繧区紛謨ー縲
+ /// 萓1シ"078b" 竊 蟆乗焚驛ィ=2000000
+ /// 萓2シ"078a(100124)" 竊 蟆乗焚驛ィ=1100124
+ ///
+ public int n蟆乗焚驛ィ;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CDTXVersion()
+ {
+ this.n謨エ謨ー驛ィ = 0;
+ this.n蟆乗焚驛ィ = 0;
+ this.Unknown = true;
+ }
+ public CDTXVersion( int n謨エ謨ー驛ィ )
+ {
+ this.n謨エ謨ー驛ィ = n謨エ謨ー驛ィ;
+ this.n蟆乗焚驛ィ = 0;
+ this.Unknown = false;
+ }
+ public CDTXVersion( string Version )
+ {
+ this.n謨エ謨ー驛ィ = 0;
+ this.n蟆乗焚驛ィ = 0;
+ this.Unknown = true;
+
+ if( Version.ToLower().Equals( "unknown" ) )
+ {
+ this.Unknown = true;
+ }
+ else
+ {
+ int num = 0;
+ int length = Version.Length;
+ if( ( num < length ) && char.IsDigit( Version[ num ] ) )
+ {
+ // 謨エ謨ー驛ィ縲蜿門セ
+ while( ( num < length ) && char.IsDigit( Version[ num ] ) )
+ {
+ this.n謨エ謨ー驛ィ = ( this.n謨エ謨ー驛ィ * 10 ) + CDTXVersion.DIG10.IndexOf( Version[ num++ ] );
+ }
+
+ // 蟆乗焚驛ィ(1)闍ア蟄鈴Κ蛻縲蜿門セ
+ while( ( num < length ) && ( ( Version[ num ] == ' ' ) || ( Version[ num ] == '(' ) ) )
+ {
+ num++;
+ }
+ if( ( num < length ) && ( CDTXVersion.DIG36.IndexOf( Version[ num ] ) >= 10 ) )
+ {
+ this.n蟆乗焚驛ィ = CDTXVersion.DIG36.IndexOf( Version[ num++ ] ) - 10;
+ if( this.n蟆乗焚驛ィ >= 0x1a )
+ {
+ this.n蟆乗焚驛ィ -= 0x1a;
+ }
+ this.n蟆乗焚驛ィ++;
+ }
+
+ // 蟆乗焚驛ィ(2)譌・莉倬Κ蛻(yymmdd)縲蜿門セ
+ while( ( num < length ) && ( ( Version[ num ] == ' ' ) || ( Version[ num ] == '(' ) ) )
+ {
+ num++;
+ }
+ for( int i = 0; i < 6; i++ )
+ {
+ this.n蟆乗焚驛ィ *= 10;
+ if( ( num < length ) && char.IsDigit( Version[ num ] ) )
+ {
+ this.n蟆乗焚驛ィ += CDTXVersion.DIG10.IndexOf( Version[ num ] );
+ }
+ num++;
+ }
+ this.Unknown = false;
+ }
+ else
+ {
+ this.Unknown = true;
+ }
+ }
+ }
+ public CDTXVersion( int n謨エ謨ー驛ィ, int n蟆乗焚驛ィ )
+ {
+ this.n謨エ謨ー驛ィ = n謨エ謨ー驛ィ;
+ this.n蟆乗焚驛ィ = n蟆乗焚驛ィ;
+ this.Unknown = false;
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public string toString()
+ {
+ var result = new StringBuilder( 32 );
+
+ // 謨エ謨ー驛ィ
+ result.Append( this.n謨エ謨ー驛ィ.ToString( "000" ) );
+
+ // 闍ア蟄鈴Κ蛻シ医≠繧後ーシ
+ if( this.n蟆乗焚驛ィ >= 1000000 )
+ {
+ int n闍ア蟄 = Math.Min( this.n蟆乗焚驛ィ / 1000000, 26 ); // 1ス26
+ result.Append( CDTXVersion.DIG36[ 10 + ( n闍ア蟄 - 1 ) ] );
+ }
+
+ // 譌・莉倬Κ蛻シ医≠繧後ーシ
+ int n譌・莉 = this.n蟆乗焚驛ィ % 1000000;
+ if( n譌・莉 > 0 )
+ {
+ result.Append( '(' );
+ result.Append( n譌・莉.ToString( "000000" ) );
+ result.Append( ')' );
+ }
+
+ return result.ToString();
+ }
+
+ public static bool operator ==( CDTXVersion x, CDTXVersion y )
+ {
+ return ( ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ == y.n蟆乗焚驛ィ ) ) && ( x.Unknown == y.Unknown ) );
+ }
+ public static bool operator >( CDTXVersion x, CDTXVersion y )
+ {
+ return ( ( x.n謨エ謨ー驛ィ > y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ > y.n蟆乗焚驛ィ ) ) );
+ }
+ public static bool operator >=( CDTXVersion x, CDTXVersion y )
+ {
+ return ( ( x.n謨エ謨ー驛ィ > y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ >= y.n蟆乗焚驛ィ ) ) );
+ }
+ public static bool operator !=( CDTXVersion x, CDTXVersion y )
+ {
+ if( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ == y.n蟆乗焚驛ィ ) )
+ {
+ return ( x.Unknown != y.Unknown );
+ }
+ return true;
+ }
+ public static bool operator <( CDTXVersion x, CDTXVersion y )
+ {
+ return ( ( x.n謨エ謨ー驛ィ < y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ < y.n蟆乗焚驛ィ ) ) );
+ }
+ public static bool operator <=( CDTXVersion x, CDTXVersion y )
+ {
+ return ( ( x.n謨エ謨ー驛ィ < y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ <= y.n蟆乗焚驛ィ ) ) );
+ }
+ public override bool Equals(object obj) // 2011.1.3 yyagi: warning繧堤┌縺上☆縺溘a縺ォ霑ス蜉
+ {
+ if (obj == null)
+ {
+ return false;
+ }
+ if (this.GetType() != obj.GetType())
+ {
+ return false;
+ }
+ CDTXVersion objCDTXVersion = (CDTXVersion)obj;
+ if (!int.Equals(this.n謨エ謨ー驛ィ, objCDTXVersion.n謨エ謨ー驛ィ) || !int.Equals(this.n蟆乗焚驛ィ, objCDTXVersion.n蟆乗焚驛ィ))
+ {
+ return false;
+ }
+ return true;
+ }
+ public override int GetHashCode() // 2011.1.3 yyagi: warning繧堤┌縺上☆縺溘a縺ォ霑ス蜉
+ {
+ string v = this.toString();
+ return v.GetHashCode();
+ }
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private const string DIG36 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ private const string DIG10 = "0123456789";
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Common/CPad.cs b/TJAPlayer3/Common/CPad.cs
new file mode 100644
index 00000000..32243313
--- /dev/null
+++ b/TJAPlayer3/Common/CPad.cs
@@ -0,0 +1,225 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using FDK;
+
+namespace TJAPlayer3
+{
+ public class CPad
+ {
+ // 繝励Ο繝代ユ繧」
+
+ internal STHIT st讀懃衍縺励◆繝繝舌う繧ケ;
+ [StructLayout( LayoutKind.Sequential )]
+ internal struct STHIT
+ {
+ public bool Keyboard;
+ public bool MIDIIN;
+ public bool Joypad;
+ public bool Mouse;
+ public void Clear()
+ {
+ this.Keyboard = false;
+ this.MIDIIN = false;
+ this.Joypad = false;
+ this.Mouse = false;
+ }
+ }
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ internal CPad( CConfigIni configIni, CInput邂。逅 mgrInput )
+ {
+ this.rConfigIni = configIni;
+ this.rInput邂。逅 = mgrInput;
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Clear();
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public List GetEvents( E讌ス蝎ィ繝代シ繝 part, E繝代ャ繝 pad )
+ {
+ CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ];
+ List list = new List();
+
+ // 縺吶∋縺ヲ縺ョ蜈・蜉帙ョ繝舌う繧ケ縺ォ縺、縺縺ヲ窶ヲ
+ foreach( IInputDevice device in this.rInput邂。逅.list蜈・蜉帙ョ繝舌う繧ケ )
+ {
+ if( ( device.list蜈・蜉帙う繝吶Φ繝 != null ) && ( device.list蜈・蜉帙う繝吶Φ繝.Count != 0 ) )
+ {
+ foreach( STInputEvent event2 in device.list蜈・蜉帙う繝吶Φ繝 )
+ {
+ for( int i = 0; i < stkeyassignArray.Length; i++ )
+ {
+ switch( stkeyassignArray[ i ].蜈・蜉帙ョ繝舌う繧ケ )
+ {
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝:
+ if( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Keyboard ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ {
+ list.Add( event2 );
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Keyboard = true;
+ }
+ break;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉:
+ if( ( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.MidiIn ) && ( device.ID == stkeyassignArray[ i ].ID ) ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ {
+ list.Add( event2 );
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.MIDIIN = true;
+ }
+ break;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝:
+ if( ( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick ) && ( device.ID == stkeyassignArray[ i ].ID ) ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ {
+ list.Add( event2 );
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Joypad = true;
+ }
+ break;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ:
+ if( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Mouse ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ {
+ list.Add( event2 );
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Mouse = true;
+ }
+ break;
+ }
+ }
+ }
+ continue;
+ }
+ }
+ return list;
+ }
+ public bool b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝 part, E繝代ャ繝 pad )
+ {
+ if( part != E讌ス蝎ィ繝代シ繝.UNKNOWN )
+ {
+
+ CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ];
+ for( int i = 0; i < stkeyassignArray.Length; i++ )
+ {
+ switch( stkeyassignArray[ i ].蜈・蜉帙ョ繝舌う繧ケ )
+ {
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝:
+ if( !this.rInput邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ break;
+
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Keyboard = true;
+ return true;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉:
+ {
+ IInputDevice device2 = this.rInput邂。逅.MidiIn( stkeyassignArray[ i ].ID );
+ if( ( device2 == null ) || !device2.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ break;
+
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.MIDIIN = true;
+ return true;
+ }
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝:
+ {
+ if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) )
+ break;
+
+ IInputDevice device = this.rInput邂。逅.Joystick( stkeyassignArray[ i ].ID );
+ if( ( device == null ) || !device.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ break;
+
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Joypad = true;
+ return true;
+ }
+ case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ:
+ if( !this.rInput邂。逅.Mouse.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ break;
+
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Mouse = true;
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ public bool b謚シ縺輔l縺櫂GB( E繝代ャ繝 pad )
+ {
+ if( !this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, pad ) && !this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.GUITAR, pad ) )
+ {
+ return this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.BASS, pad );
+ }
+ return true;
+ }
+ public bool b謚シ縺輔l縺檬B( E繝代ャ繝 pad )
+ {
+ if( !this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.GUITAR, pad ) )
+ {
+ return this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.BASS, pad );
+ }
+ return true;
+ }
+ public bool b謚シ縺輔l縺ヲ縺繧( E讌ス蝎ィ繝代シ繝 part, E繝代ャ繝 pad )
+ {
+ if( part != E讌ス蝎ィ繝代シ繝.UNKNOWN )
+ {
+ CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ];
+ for( int i = 0; i < stkeyassignArray.Length; i++ )
+ {
+ switch( stkeyassignArray[ i ].蜈・蜉帙ョ繝舌う繧ケ )
+ {
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝:
+ if( !this.rInput邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ {
+ break;
+ }
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Keyboard = true;
+ return true;
+
+ case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝:
+ {
+ if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) )
+ {
+ break;
+ }
+ IInputDevice device = this.rInput邂。逅.Joystick( stkeyassignArray[ i ].ID );
+ if( ( device == null ) || !device.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ {
+ break;
+ }
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Joypad = true;
+ return true;
+ }
+ case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ:
+ if( !this.rInput邂。逅.Mouse.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( stkeyassignArray[ i ].繧ウ繝シ繝 ) )
+ {
+ break;
+ }
+ this.st讀懃衍縺励◆繝繝舌う繧ケ.Mouse = true;
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ public bool b謚シ縺輔l縺ヲ縺繧季B( E繝代ャ繝 pad )
+ {
+ if( !this.b謚シ縺輔l縺ヲ縺繧( E讌ス蝎ィ繝代シ繝.GUITAR, pad ) )
+ {
+ return this.b謚シ縺輔l縺ヲ縺繧( E讌ス蝎ィ繝代シ繝.BASS, pad );
+ }
+ return true;
+ }
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private CConfigIni rConfigIni;
+ private CInput邂。逅 rInput邂。逅;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Common/CPrivateFastFont.cs b/TJAPlayer3/Common/CPrivateFastFont.cs
new file mode 100644
index 00000000..4d8edb67
--- /dev/null
+++ b/TJAPlayer3/Common/CPrivateFastFont.cs
@@ -0,0 +1,427 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Diagnostics;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 鬮倬滓緒逕サ迚医ョCPrivateFont繧ッ繝ゥ繧ケ縲
+ /// 縺ィ縺縺」縺ヲ繧ゅ∽ク蠎ヲ繝ャ繝ウ繝繝ェ繝ウ繧ー縺励◆邨先棡繧偵く繝」繝繧キ繝・縺励※菴ソ縺縺セ繧上@縺ヲ縺繧九□縺代
+ ///
+ public class CPrivateFastFont : CPrivateFont
+ {
+ ///
+ /// 繧ュ繝」繝繧キ繝・螳ケ驥
+ ///
+ private const int MAXCACHESIZE = 128;
+
+ private struct FontCache
+ {
+ // public Font font;
+ public int edgePt;
+ public string drawstr;
+ public DrawMode drawmode;
+ public Color fontColor;
+ public Color edgeColor;
+ public Color gradationTopColor;
+ public Color gradationBottomColor;
+ public Bitmap bmp;
+ public Rectangle rectStrings;
+ public Point ptOrigin;
+ }
+ private List listFontCache;
+
+
+ #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ ]
+ public CPrivateFastFont(FontFamily fontfamily, int pt, FontStyle style)
+ {
+ Initialize(null, fontfamily, pt, style);
+ }
+ public CPrivateFastFont(FontFamily fontfamily, int pt)
+ {
+ Initialize(null, fontfamily, pt, FontStyle.Regular);
+ }
+ public CPrivateFastFont(string fontpath, int pt, FontStyle style)
+ {
+ Initialize(fontpath, null, pt, style);
+ }
+ public CPrivateFastFont(string fontpath, int pt)
+ {
+ Initialize(fontpath, null, pt, FontStyle.Regular);
+ }
+ public CPrivateFastFont()
+ {
+ throw new ArgumentException("CPrivateFastFont: 蠑墓焚縺後≠繧九さ繝ウ繧ケ繝医Λ繧ッ繧ソ繧剃スソ逕ィ縺励※縺上□縺輔>縲");
+ }
+ #endregion
+ #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺九i蜻シ縺ー繧後k蛻晄悄蛹門ヲ逅 ]
+ protected new void Initialize(string fontpath, FontFamily fontfamily, int pt, FontStyle style)
+ {
+ this.bDispose螳御コ貂医∩_CPrivateFastFont = false;
+ this.listFontCache = new List();
+ base.Initialize(fontpath, fontfamily, pt, style);
+ }
+ #endregion
+
+
+ #region [ DrawPrivateFont縺ョ繧ェ繝シ繝舌シ繝ュ繝シ繝臥セ、 ]
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public new Bitmap DrawPrivateFont(string drawstr, Color fontColor)
+ {
+ return DrawPrivateFont(drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White);
+ }
+
+ public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, int edgePt)
+ {
+ return DrawPrivateFont_E(drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White, edgePt);
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor)
+ {
+ return DrawPrivateFont(drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White);
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, DrawMode dMode)
+ {
+ return DrawPrivateFont(drawstr, dMode, fontColor, edgeColor, Color.White, Color.White);
+ }
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ //public new Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor )
+ //{
+ // return DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor );
+ //}
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor)
+ {
+ return DrawPrivateFont(drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor);
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, bool bVertical)
+ {
+ return DrawPrivateFont_V(drawstr, fontColor, edgeColor, bVertical);
+ }
+
+#if 縺薙■繧峨ッ菴ソ繧上↑縺 // (Bitmap縺ァ縺ッ縺ェ縺上,Texture繧定ソ斐☆迚)
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public CTexture DrawPrivateFont( string drawstr, Color fontColor )
+ {
+ Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White );
+ return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor )
+ {
+ Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White );
+ return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ //public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor )
+ //{
+ // Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor );
+ // return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ //}
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor )
+ {
+ Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor );
+ return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ }
+#endif
+ #endregion
+
+ protected new Bitmap DrawPrivateFont_E(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor, int edgePt)
+ {
+ #region [ 莉・蜑阪Ξ繝ウ繝繝ェ繝ウ繧ー縺励◆縺薙→縺ョ縺ゅk譁蟄怜/繝輔か繝ウ繝医°? (繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医☆繧九°?) ]
+ int index = listFontCache.FindIndex(
+ delegate (FontCache fontcache)
+ {
+ return (
+ drawstr == fontcache.drawstr &&
+ drawmode == fontcache.drawmode &&
+ fontColor == fontcache.fontColor &&
+ edgeColor == fontcache.edgeColor &&
+ gradationTopColor == fontcache.gradationTopColor &&
+ gradationBottomColor == fontcache.gradationBottomColor &&
+ edgePt == fontcache.edgePt
+ // _font == fontcache.font
+ );
+ }
+ );
+ #endregion
+ if (index < 0)
+ {
+ // 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医○縺壹
+ #region [ 繝ャ繝ウ繝繝ェ繝ウ繧ー縺励※縲√く繝」繝繧キ繝・縺ォ逋サ骭イ ]
+ FontCache fc = new FontCache();
+ fc.bmp = base.DrawPrivateFont_E(drawstr, drawmode, fontColor, edgeColor, gradationTopColor, gradationBottomColor, edgePt);
+ fc.drawstr = drawstr;
+ fc.drawmode = drawmode;
+ fc.fontColor = fontColor;
+ fc.edgeColor = edgeColor;
+ fc.gradationTopColor = gradationTopColor;
+ fc.gradationBottomColor = gradationBottomColor;
+ fc.edgePt = edgePt;
+ fc.rectStrings = RectStrings;
+ fc.ptOrigin = PtOrigin;
+ listFontCache.Add(fc);
+ Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝医○縺壹(cachesize=" + listFontCache.Count + ")");
+ #endregion
+ #region [ 繧ゅ@繧ュ繝」繝繧キ繝・縺後≠縺オ繧後◆繧峨∵怙繧ょ商縺繧ュ繝」繝繧キ繝・繧堤エ譽縺吶k ]
+ if (listFontCache.Count > MAXCACHESIZE)
+ {
+ Debug.WriteLine("Cache貅「繧後" + listFontCache[0].drawstr + " 繧定ァ」謾セ縺励∪縺吶");
+ if (listFontCache[0].bmp != null)
+ {
+ listFontCache[0].bmp.Dispose();
+ }
+ listFontCache.RemoveAt(0);
+ }
+ #endregion
+
+ // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲
+ return (Bitmap)listFontCache[listFontCache.Count - 1].bmp.Clone();
+ }
+ else
+ {
+ Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝!! index=" + index);
+ #region [ 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医ゅΞ繝ウ繝繝ェ繝ウ繧ー縺ッ陦後o縺壹√く繝」繝繧キ繝・蜀縺ョ繝繝シ繧ソ繧定ソ斐@縺ヲ邨ゆコ縲]
+ RectStrings = listFontCache[index].rectStrings;
+ PtOrigin = listFontCache[index].ptOrigin;
+ // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲
+ return (Bitmap)listFontCache[index].bmp.Clone();
+ #endregion
+ }
+ }
+
+ protected new Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor)
+ {
+ #region [ 莉・蜑阪Ξ繝ウ繝繝ェ繝ウ繧ー縺励◆縺薙→縺ョ縺ゅk譁蟄怜/繝輔か繝ウ繝医°? (繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医☆繧九°?) ]
+ int index = listFontCache.FindIndex(
+ delegate (FontCache fontcache)
+ {
+ return (
+ drawstr == fontcache.drawstr &&
+ drawmode == fontcache.drawmode &&
+ fontColor == fontcache.fontColor &&
+ edgeColor == fontcache.edgeColor &&
+ gradationTopColor == fontcache.gradationTopColor &&
+ gradationBottomColor == fontcache.gradationBottomColor
+ // _font == fontcache.font
+ );
+ }
+ );
+ #endregion
+ if (index < 0)
+ {
+ // 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医○縺壹
+ #region [ 繝ャ繝ウ繝繝ェ繝ウ繧ー縺励※縲√く繝」繝繧キ繝・縺ォ逋サ骭イ ]
+ FontCache fc = new FontCache();
+ fc.bmp = base.DrawPrivateFont(drawstr, drawmode, fontColor, edgeColor, gradationTopColor, gradationBottomColor);
+ fc.drawstr = drawstr;
+ fc.drawmode = drawmode;
+ fc.fontColor = fontColor;
+ fc.edgeColor = edgeColor;
+ fc.gradationTopColor = gradationTopColor;
+ fc.gradationBottomColor = gradationBottomColor;
+ fc.rectStrings = RectStrings;
+ fc.ptOrigin = PtOrigin;
+ listFontCache.Add(fc);
+ Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝医○縺壹(cachesize=" + listFontCache.Count + ")");
+ #endregion
+ #region [ 繧ゅ@繧ュ繝」繝繧キ繝・縺後≠縺オ繧後◆繧峨∵怙繧ょ商縺繧ュ繝」繝繧キ繝・繧堤エ譽縺吶k ]
+ if (listFontCache.Count > MAXCACHESIZE)
+ {
+ Debug.WriteLine("Cache貅「繧後" + listFontCache[0].drawstr + " 繧定ァ」謾セ縺励∪縺吶");
+ if (listFontCache[0].bmp != null)
+ {
+ listFontCache[0].bmp.Dispose();
+ }
+ listFontCache.RemoveAt(0);
+ }
+ #endregion
+
+ // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲
+ return (Bitmap)listFontCache[listFontCache.Count - 1].bmp.Clone();
+ }
+ else
+ {
+ Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝!! index=" + index);
+ #region [ 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医ゅΞ繝ウ繝繝ェ繝ウ繧ー縺ッ陦後o縺壹√く繝」繝繧キ繝・蜀縺ョ繝繝シ繧ソ繧定ソ斐@縺ヲ邨ゆコ縲]
+ RectStrings = listFontCache[index].rectStrings;
+ PtOrigin = listFontCache[index].ptOrigin;
+ // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲
+ return (Bitmap)listFontCache[index].bmp.Clone();
+ #endregion
+ }
+ }
+
+ protected new Bitmap DrawPrivateFont_V(string drawstr, Color fontColor, Color edgeColor, bool bVertical)
+ {
+ #region [ 莉・蜑阪Ξ繝ウ繝繝ェ繝ウ繧ー縺励◆縺薙→縺ョ縺ゅk譁蟄怜/繝輔か繝ウ繝医°? (繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医☆繧九°?) ]
+ int index = listFontCache.FindIndex(
+ delegate (FontCache fontcache)
+ {
+ return (
+ drawstr == fontcache.drawstr &&
+ fontColor == fontcache.fontColor &&
+ edgeColor == fontcache.edgeColor &&
+ bVertical == true
+ // _font == fontcache.font
+ );
+ }
+ );
+ #endregion
+ if (index < 0)
+ {
+ // 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医○縺壹
+ #region [ 繝ャ繝ウ繝繝ェ繝ウ繧ー縺励※縲√く繝」繝繧キ繝・縺ォ逋サ骭イ ]
+ FontCache fc = new FontCache();
+ fc.bmp = base.DrawPrivateFont_V(drawstr, fontColor, edgeColor, true);
+ fc.drawstr = drawstr;
+ fc.fontColor = fontColor;
+ fc.edgeColor = edgeColor;
+ fc.rectStrings = RectStrings;
+ fc.ptOrigin = PtOrigin;
+ listFontCache.Add(fc);
+ Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝医○縺壹(cachesize=" + listFontCache.Count + ")");
+ #endregion
+ #region [ 繧ゅ@繧ュ繝」繝繧キ繝・縺後≠縺オ繧後◆繧峨∵怙繧ょ商縺繧ュ繝」繝繧キ繝・繧堤エ譽縺吶k ]
+ if (listFontCache.Count > MAXCACHESIZE)
+ {
+ Debug.WriteLine("Cache貅「繧後" + listFontCache[0].drawstr + " 繧定ァ」謾セ縺励∪縺吶");
+ if (listFontCache[0].bmp != null)
+ {
+ listFontCache[0].bmp.Dispose();
+ }
+ listFontCache.RemoveAt(0);
+ }
+ #endregion
+
+ // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲
+ return (Bitmap)listFontCache[listFontCache.Count - 1].bmp.Clone();
+ }
+ else
+ {
+ Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝!! index=" + index);
+ #region [ 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医ゅΞ繝ウ繝繝ェ繝ウ繧ー縺ッ陦後o縺壹√く繝」繝繧キ繝・蜀縺ョ繝繝シ繧ソ繧定ソ斐@縺ヲ邨ゆコ縲]
+ RectStrings = listFontCache[index].rectStrings;
+ PtOrigin = listFontCache[index].ptOrigin;
+ // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲
+ return (Bitmap)listFontCache[index].bmp.Clone();
+ #endregion
+ }
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public new void Dispose()
+ {
+ if (!this.bDispose螳御コ貂医∩_CPrivateFastFont)
+ {
+ if (listFontCache != null)
+ {
+ //Debug.WriteLine( "Disposing CPrivateFastFont()" );
+ #region [ 繧ュ繝」繝繧キ繝・縺励※縺繧狗判蜒上r遐エ譽縺吶k ]
+ foreach (FontCache bc in listFontCache)
+
+ {
+ if (bc.bmp != null)
+ {
+ bc.bmp.Dispose();
+ }
+ }
+ #endregion
+ listFontCache.Clear();
+ listFontCache = null;
+ }
+ this.bDispose螳御コ貂医∩_CPrivateFastFont = true;
+ }
+ base.Dispose();
+ }
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ protected bool bDispose螳御コ貂医∩_CPrivateFastFont;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Common/CPrivateFont.cs b/TJAPlayer3/Common/CPrivateFont.cs
new file mode 100644
index 00000000..c154eee3
--- /dev/null
+++ b/TJAPlayer3/Common/CPrivateFont.cs
@@ -0,0 +1,1121 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Diagnostics;
+using SlimDX;
+using FDK;
+using System.Linq;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医〒縺ョ謠冗判繧呈桶縺繧ッ繝ゥ繧ケ縲
+ ///
+ /// 繝輔か繝ウ繝医ヵ繧。繧、繝ォ縺瑚ヲ九▽縺九i縺ェ縺譎ゅ↓萓句、也匱逕
+ /// 繧ケ繧ソ繧、繝ォ謖螳壻ク肴ュ」譎ゅ↓萓句、也匱逕
+ ///
+ /// 邁。蜊倥↑菴ソ縺譁ケ
+ /// CPrivateFont prvFont = new CPrivateFont( CSkin.Path( @"Graphics\fonts\mplus-1p-bold.ttf" ), 36 ); // 繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝
+ /// 縺ィ縺
+ /// CPrivateFont prvFont = new CPrivateFont( new FontFamily("MS UI Gothic"), 36, FontStyle.Bold ); // 繧キ繧ケ繝繝繝輔か繝ウ繝
+ /// 縺ィ縺九@縺滉ク翫〒縲
+ /// Bitmap bmp = prvFont.DrawPrivateFont( "ABCDE", Color.White, Color.Black ); // 繝輔か繝ウ繝郁牡シ晉區縲∫ク√ョ濶イシ晞サ偵ョ萓九らク√ョ濶イ縺ッ逵∫払蜿ッ閭ス
+ /// 縺ィ縺
+ /// Bitmap bmp = prvFont.DrawPrivateFont( "ABCDE", Color.White, Color.Black, Color.Yellow, Color.OrangeRed ); // 荳贋ク九げ繝ゥ繝繝シ繧キ繝ァ繝ウ(Yellow竊丹rangeRed)
+ /// 縺ィ縺九@縺ヲ縲
+ /// CTexture ctBmp = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ /// ctBMP.t2D謠冗判( ス橸ス橸ス );
+ /// 縺ァ陦ィ遉コ縺励※縺上□縺輔>縲
+ ///
+ /// 豕ィ諢冗せ
+ /// 莉サ諢上ョ繝輔か繝ウ繝医〒縺ョ繝ャ繝ウ繝繝ェ繝ウ繧ー縺ッ邨先ァ玖イ闕キ縺悟、ァ縺阪>縺ョ縺ァ縲√↑繧九∋ス九↑繧画緒逕サ繝輔Ξ繝シ繝豈弱↓繝輔か繝ウ繝医r蜀阪Ξ繝ウ繝繝ェ繝ウ繧ー縺吶k繧医≧縺ェ縺薙→縺ッ縺帙★縲
+ /// 荳譌ヲ繝ャ繝ウ繝繝ェ繝ウ繧ー縺励◆繧ゅョ繧呈緒逕サ縺ォ菴ソ縺蝗槭☆繧医≧縺ォ縺励※縺上□縺輔>縲
+ /// 縺セ縺溘髟キ縺譁蟄怜励r荳弱∴繧九→縲∬ソ斐&繧後kBitmap繧よィェ髟キ縺ォ縺ェ繧翫∪縺吶ゅ%縺ョ讓ェ髟キ逕サ蜒上r縺昴ョ縺セ縺セ繝繧ッ繧ケ繝√Ε縺ィ縺励※菴ソ縺縺ィ縲
+ /// 蜿、縺ПC縺ァ蝠城。後r逋コ逕溘&縺帙d縺吶>縺ァ縺吶ゅ%繧後r蝗樣∩縺吶k縺ォ縺ッ縲∽ク譌ヲBitmap縺ィ縺励※蜿門セ励@縺溘ョ縺。縲256pix繧512pix縺ァ蛻蜑イ縺励※
+ /// 繝繧ッ繧ケ繝√Ε縺ォ螳夂セゥ縺吶k繧医≧縺ォ縺励※縺上□縺輔>縲
+ ///
+
+ #region In諡。蠑オ蟄
+ public static class StringExtensions
+ {
+ public static bool In(this string str, params string[] param)
+ {
+ return param.Contains(str);
+ }
+ }
+ #endregion
+
+ public class CPrivateFont : IDisposable
+ {
+ #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ ]
+ public CPrivateFont( FontFamily fontfamily, int pt, FontStyle style )
+ {
+ Initialize( null, fontfamily, pt, style );
+ }
+ public CPrivateFont( FontFamily fontfamily, int pt )
+ {
+ Initialize( null, fontfamily, pt, FontStyle.Regular );
+ }
+ public CPrivateFont( string fontpath, int pt, FontStyle style )
+ {
+ Initialize( fontpath, null, pt, style );
+ }
+ public CPrivateFont( string fontpath, int pt )
+ {
+ Initialize( fontpath, null, pt, FontStyle.Regular );
+ }
+ public CPrivateFont()
+ {
+ //throw new ArgumentException("CPrivateFont: 蠑墓焚縺後≠繧九さ繝ウ繧ケ繝医Λ繧ッ繧ソ繧剃スソ逕ィ縺励※縺上□縺輔>縲");
+ }
+ #endregion
+
+ protected void Initialize( string fontpath, FontFamily fontfamily, int pt, FontStyle style )
+ {
+ this._pfc = null;
+ this._fontfamily = null;
+ this._font = null;
+ this._pt = pt;
+ this._rectStrings = new Rectangle(0, 0, 0, 0);
+ this._ptOrigin = new Point(0, 0);
+ this.bDispose螳御コ貂医∩ = false;
+
+ if (fontfamily != null)
+ {
+ this._fontfamily = fontfamily;
+ }
+ else
+ {
+ try
+ {
+ this._pfc = new System.Drawing.Text.PrivateFontCollection(); //PrivateFontCollection繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧
+ this._pfc.AddFontFile(fontpath); //PrivateFontCollection縺ォ繝輔か繝ウ繝医r霑ス蜉縺吶k
+ _fontfamily = _pfc.Families[0];
+ }
+ catch (System.IO.FileNotFoundException)
+ {
+ Trace.TraceWarning("繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉縺ォ螟ア謨励@縺セ縺励◆({0})縲ゆサ」繧上j縺ォMS UI Gothic縺ョ菴ソ逕ィ繧定ゥヲ縺ソ縺セ縺吶", fontpath);
+ //throw new FileNotFoundException( "繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉縺ォ螟ア謨励@縺セ縺励◆縲({0})", Path.GetFileName( fontpath ) );
+ //return;
+ _fontfamily = null;
+ }
+
+ //foreach ( FontFamily ff in _pfc.Families )
+ //{
+ // Debug.WriteLine( "fontname=" + ff.Name );
+ // if ( ff.Name == Path.GetFileNameWithoutExtension( fontpath ) )
+ // {
+ // _fontfamily = ff;
+ // break;
+ // }
+ //}
+ //if ( _fontfamily == null )
+ //{
+ // Trace.TraceError( "繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉蠕後∵、懃エ「縺ォ螟ア謨励@縺セ縺励◆縲({0})", fontpath );
+ // return;
+ //}
+ }
+
+ // 謖螳壹&繧後◆繝輔か繝ウ繝医せ繧ソ繧、繝ォ縺碁←逕ィ縺ァ縺阪↑縺蝣エ蜷医ッ縲√ヵ繧ゥ繝ウ繝亥縺ァ螳夂セゥ縺輔l縺ヲ縺繧九せ繧ソ繧、繝ォ縺九i蛟呵」懊r驕ク繧薙〒菴ソ逕ィ縺吶k
+ // 菴輔b繧ケ繧ソ繧、繝ォ縺御スソ縺医↑縺繧医≧縺ェ繝輔か繝ウ繝医↑繧峨∽セ句、悶r蜃コ縺吶
+ if (_fontfamily != null)
+ {
+ if (!_fontfamily.IsStyleAvailable(style))
+ {
+ FontStyle[] FS = { FontStyle.Regular, FontStyle.Bold, FontStyle.Italic, FontStyle.Underline, FontStyle.Strikeout };
+ style = FontStyle.Regular | FontStyle.Bold | FontStyle.Italic | FontStyle.Underline | FontStyle.Strikeout; // null髱櫁ィア螳ケ蝙九↑縺ョ縺ァ縲∽サ」繧上j縺ォ蜈ィ逶帙rNG繝ッ繝シ繝峨↓險ュ螳
+ foreach (FontStyle ff in FS)
+ {
+ if (this._fontfamily.IsStyleAvailable(ff))
+ {
+ style = ff;
+ Trace.TraceWarning("繝輔か繝ウ繝{0}縺ク縺ョ繧ケ繧ソ繧、繝ォ謖螳壹r縲+1}縺ォ螟画峩縺励∪縺励◆縲", Path.GetFileName(fontpath), style.ToString());
+ break;
+ }
+ }
+ if (style == (FontStyle.Regular | FontStyle.Bold | FontStyle.Italic | FontStyle.Underline | FontStyle.Strikeout))
+ {
+ Trace.TraceWarning("繝輔か繝ウ繝{0}縺ッ驕ゥ蛻縺ェ繧ケ繧ソ繧、繝ォ{1}繧帝∈謚槭〒縺阪∪縺帙s縺ァ縺励◆縲", Path.GetFileName(fontpath), style.ToString());
+ }
+ }
+ //this._font = new Font(this._fontfamily, pt, style); //PrivateFontCollection縺ョ蜈磯ュ縺ョ繝輔か繝ウ繝医ョFont繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧
+ float emSize = pt * 96.0f / 72.0f;
+ this._font = new Font(this._fontfamily, emSize, style, GraphicsUnit.Pixel); //PrivateFontCollection縺ョ蜈磯ュ縺ョ繝輔か繝ウ繝医ョFont繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧
+ //HighDPI蟇セ蠢懊ョ縺溘a縲}x繧オ繧、繧コ縺ァ謖螳
+ }
+ else
+ // 繝輔か繝ウ繝医ヵ繧。繧、繝ォ縺瑚ヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 (MS PGothic繧剃サ」繧上j縺ォ謖螳壹☆繧)
+ {
+ float emSize = pt * 96.0f / 72.0f;
+ this._font = new Font("MS UI Gothic", emSize, style, GraphicsUnit.Pixel); //MS PGothic縺ョFont繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧
+ FontFamily[] ffs = new System.Drawing.Text.InstalledFontCollection().Families;
+ int lcid = System.Globalization.CultureInfo.GetCultureInfo("en-us").LCID;
+ foreach (FontFamily ff in ffs)
+ {
+ // Trace.WriteLine( lcid ) );
+ if (ff.GetName(lcid) == "MS UI Gothic")
+ {
+ this._fontfamily = ff;
+ Trace.TraceInformation("MS UI Gothic繧剃サ」繧上j縺ォ謖螳壹@縺セ縺励◆縲");
+ return;
+ }
+ }
+ throw new FileNotFoundException("繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉縺ォ螟ア謨励@縲`S UI Gothic縺ァ縺ョ莉」譖ソ蜃ヲ逅縺ォ繧ょ、ア謨励@縺セ縺励◆縲({0})", Path.GetFileName(fontpath));
+ }
+ }
+
+ [Flags]
+ public enum DrawMode
+ {
+ Normal,
+ Edge,
+ Gradation,
+ Vertical
+ }
+
+ #region [ DrawPrivateFont縺ョ繧ェ繝シ繝舌シ繝ュ繝シ繝臥セ、 ]
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public Bitmap DrawPrivateFont( string drawstr, Color fontColor )
+ {
+ return DrawPrivateFont( drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White );
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor )
+ {
+ return DrawPrivateFont( drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White );
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ //public Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor )
+ //{
+ // return DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor );
+ //}
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor )
+ {
+ return DrawPrivateFont( drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor );
+ }
+
+#if 縺薙■繧峨ッ菴ソ繧上↑縺 // (Bitmap縺ァ縺ッ縺ェ縺上,Texture繧定ソ斐☆迚)
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public CTexture DrawPrivateFont( string drawstr, Color fontColor )
+ {
+ Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White );
+ return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor )
+ {
+ Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White );
+ return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ //public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor )
+ //{
+ // Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor );
+ // return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ //}
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆
+ ///
+ /// 謠冗判譁蟄怜
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor )
+ {
+ Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor );
+ return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false );
+ }
+#endif
+ #endregion
+
+ protected Bitmap DrawPrivateFont_E(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor, int edgePt)
+ {
+ if (this._fontfamily == null || drawstr == null || drawstr == "")
+ {
+ // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九
+ // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲
+ // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶
+ if (drawstr != "")
+ {
+ Trace.TraceWarning("DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶");
+ }
+ _rectStrings = new Rectangle(0, 0, 0, 0);
+ _ptOrigin = new Point(0, 0);
+ return new Bitmap(1, 1);
+ }
+ bool bEdge = ((drawmode & DrawMode.Edge) == DrawMode.Edge);
+ bool bGradation = ((drawmode & DrawMode.Gradation) == DrawMode.Gradation);
+
+ // 邵∝叙繧翫ョ邵√ョ繧オ繧、繧コ縺ッ縲√→繧翫≠縺医★繝輔か繝ウ繝医ョ螟ァ縺阪&縺ョ1/4縺ィ縺吶k
+ //int nEdgePt = (bEdge)? _pt / 4 : 0;
+ //int nEdgePt = (bEdge) ? (_pt / 3) : 0; // 邵∝叙繧翫′蟆代↑縺吶℃繧九→縺縺諢剰ヲ九′螟壹°縺」縺溘◆繧∝、画峩縲 (AioiLight)
+ int nEdgePt = (bEdge) ? (10 * _pt / edgePt) : 0; //SkinConfig縺ォ縺ヲ險ュ螳壼庄閭ス縺ォ(rhimm)
+
+ // 謠冗判繧オ繧、繧コ繧呈クャ螳壹☆繧
+ Size stringSize = System.Windows.Forms.TextRenderer.MeasureText(drawstr, this._font, new Size(int.MaxValue, int.MaxValue),
+ System.Windows.Forms.TextFormatFlags.NoPrefix |
+ System.Windows.Forms.TextFormatFlags.NoPadding
+ );
+ stringSize.Width += 10; //2015.04.01 kairera0467 ROTTERDAM NATION縺ョ謠冗判繧オ繧、繧コ縺後≧縺セ縺上>縺九s縺ョ縺ァ縲
+ stringSize.Height += 5;
+
+ //蜿門セ励@縺滓緒逕サ繧オ繧、繧コ繧貞渕縺ォ縲∵緒逕サ蜈医ョbitmap繧剃ス懈舌☆繧
+ Bitmap bmp = new Bitmap(stringSize.Width + nEdgePt * 2, stringSize.Height + nEdgePt * 3);
+ bmp.MakeTransparent();
+ Graphics g = Graphics.FromImage(bmp);
+ g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+
+ StringFormat sf = new StringFormat();
+ sf.LineAlignment = StringAlignment.Far; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ
+ sf.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ
+ sf.FormatFlags = StringFormatFlags.NoWrap; // 縺ゥ繧薙↑縺ォ髟キ縺上※蜊倩ェ槭ョ蛹コ蛻繧翫′濶ッ縺上※繧よ隼陦後@縺ェ縺 (AioiLight)
+ sf.Trimming = StringTrimming.None; // 縺ゥ繧薙↑縺ォ髟キ縺上※繧ゅヨ繝ェ繝溘Φ繧ー縺励↑縺 (AioiLight)
+ // 繝ャ繧、繧「繧ヲ繝域棧
+ Rectangle r = new Rectangle(0, 0, stringSize.Width + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_X * stringSize.Width / 100), stringSize.Height + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_Y * stringSize.Height / 100));
+
+ if (bEdge) // 邵∝叙繧頑怏繧翫ョ謠冗判
+ {
+ // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k
+ // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺)
+ float sizeInPixels = _font.SizeInPoints * g.DpiY / 72; // 1 inch = 72 points
+
+ System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
+ gp.AddString(drawstr, this._fontfamily, (int)this._font.Style, sizeInPixels, r, sf);
+
+ // 邵∝叙繧翫r謠冗判縺吶k
+ Pen p = new Pen(edgeColor, nEdgePt);
+ p.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
+ g.DrawPath(p, gp);
+
+ // 蝪励j縺、縺カ縺
+ Brush br;
+ if (bGradation)
+ {
+ br = new LinearGradientBrush(r, gradationTopColor, gradationBottomColor, LinearGradientMode.Vertical);
+ }
+ else
+ {
+ br = new SolidBrush(fontColor);
+ }
+ g.FillPath(br, gp);
+
+ if (br != null) br.Dispose(); br = null;
+ if (p != null) p.Dispose(); p = null;
+ if (gp != null) gp.Dispose(); gp = null;
+ }
+ else
+ {
+ // 邵∝叙繧翫↑縺励ョ謠冗判
+ System.Windows.Forms.TextRenderer.DrawText(g, drawstr, _font, new Point(0, 0), fontColor);
+ }
+
+ _rectStrings = new Rectangle(0, 0, stringSize.Width, stringSize.Height);
+ _ptOrigin = new Point(nEdgePt * 2, nEdgePt * 2);
+
+
+ #region [ 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k ]
+ if (sf != null) sf.Dispose(); sf = null;
+ if (g != null) g.Dispose(); g = null;
+ #endregion
+
+ return bmp;
+ }
+
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆(繝。繧、繝ウ蜃ヲ逅)
+ ///
+ /// 謠冗判縺輔l縺滄伜沺
+ /// 謠冗判譁蟄怜
+ /// 謠冗判譁蟄怜
+ /// 謠冗判繝「繝シ繝
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ protected Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor)
+ {
+ int Interval = 5;
+
+ if (this._fontfamily == null || drawstr == null || drawstr == "" || drawstr == " " || drawstr == "縲")
+ {
+ // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九
+ // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲
+ // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶
+ if (drawstr != "")
+ {
+ Trace.TraceWarning("DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶");
+ }
+ _rectStrings = new Rectangle(0, 0, 0, 0);
+ _ptOrigin = new Point(0, 0);
+ return new Bitmap(1, 1);
+ }
+ bool bEdge = ((drawmode & DrawMode.Edge) == DrawMode.Edge);
+ bool bGradation = ((drawmode & DrawMode.Gradation) == DrawMode.Gradation);
+
+ // 邵∝叙繧翫ョ邵√ョ繧オ繧、繧コ縺ッ縲√→繧翫≠縺医★繝輔か繝ウ繝医ョ螟ァ縺阪&縺ョ1/4縺ィ縺吶k
+ //int nEdgePt = (bEdge)? _pt / 4 : 0;
+ //int nEdgePt = (bEdge) ? (_pt / 3) : 0; // 邵∝叙繧翫′蟆代↑縺吶℃繧九→縺縺諢剰ヲ九′螟壹°縺」縺溘◆繧∝、画峩縲 (AioiLight)
+ int nEdgePt = (bEdge) ? (10 * _pt / TJAPlayer3.Skin.Font_Edge_Ratio) : 0; //SkinConfig縺ォ縺ヲ險ュ螳壼庄閭ス縺ォ(rhimm)
+
+ // 謠冗判繧オ繧、繧コ繧呈クャ螳壹☆繧
+ Size stringSize = System.Windows.Forms.TextRenderer.MeasureText(drawstr, this._font, new Size(int.MaxValue, int.MaxValue),
+ System.Windows.Forms.TextFormatFlags.NoPrefix |
+ System.Windows.Forms.TextFormatFlags.NoPadding
+ );
+ stringSize.Width += 10; //2015.04.01 kairera0467 ROTTERDAM NATION縺ョ謠冗判繧オ繧、繧コ縺後≧縺セ縺上>縺九s縺ョ縺ァ縲
+ stringSize.Height += 5;
+
+ //蜿門セ励@縺滓緒逕サ繧オ繧、繧コ繧貞渕縺ォ縲∵緒逕サ蜈医ョbitmap繧剃ス懈舌☆繧
+ Bitmap bmp = new Bitmap(stringSize.Width + nEdgePt * 2, stringSize.Height + nEdgePt * 2);
+ bmp.MakeTransparent();
+ Graphics g = Graphics.FromImage(bmp);
+ g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+
+ StringFormat sf = new StringFormat();
+ sf.LineAlignment = StringAlignment.Far; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ
+ sf.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ
+ sf.FormatFlags = StringFormatFlags.NoWrap; // 縺ゥ繧薙↑縺ォ髟キ縺上※蜊倩ェ槭ョ蛹コ蛻繧翫′濶ッ縺上※繧よ隼陦後@縺ェ縺 (AioiLight)
+ sf.Trimming = StringTrimming.None; // 縺ゥ繧薙↑縺ォ髟キ縺上※繧ゅヨ繝ェ繝溘Φ繧ー縺励↑縺 (AioiLight)
+ // 繝ャ繧、繧「繧ヲ繝域棧
+ Rectangle r = new Rectangle(0, 0, stringSize.Width + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_X * stringSize.Width / 100), stringSize.Height + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_Y * stringSize.Height / 100));
+
+ if (bEdge) // 邵∝叙繧頑怏繧翫ョ謠冗判
+ {
+ // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k
+ // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺)
+ float sizeInPixels = _font.SizeInPoints * g.DpiY / 72; // 1 inch = 72 points
+
+ System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
+ gp.AddString(drawstr, this._fontfamily, (int)this._font.Style, sizeInPixels, r, sf);
+
+ // 邵∝叙繧翫r謠冗判縺吶k
+ Pen p = new Pen(edgeColor, nEdgePt);
+ p.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
+ g.DrawPath(p, gp);
+
+ // 蝪励j縺、縺カ縺
+ Brush br;
+ if (bGradation)
+ {
+ br = new LinearGradientBrush(r, gradationTopColor, gradationBottomColor, LinearGradientMode.Vertical);
+ }
+ else
+ {
+ br = new SolidBrush(fontColor);
+ }
+ g.FillPath(br, gp);
+
+ if (br != null) br.Dispose(); br = null;
+ if (p != null) p.Dispose(); p = null;
+ if (gp != null) gp.Dispose(); gp = null;
+ }
+ else
+ {
+ // 邵∝叙繧翫↑縺励ョ謠冗判
+ System.Windows.Forms.TextRenderer.DrawText(g, drawstr, _font, new Point(0, 0), fontColor);
+ }
+
+#if debug陦ィ遉コ
+ g.DrawRectangle( new Pen( Color.White, 1 ), new Rectangle( 1, 1, stringSize.Width-1, stringSize.Height-1 ) );
+ g.DrawRectangle( new Pen( Color.Green, 1 ), new Rectangle( 0, 0, bmp.Width - 1, bmp.Height - 1 ) );
+#endif
+ _rectStrings = new Rectangle(0, 0, stringSize.Width, stringSize.Height);
+ _ptOrigin = new Point(nEdgePt * 2, nEdgePt * 2);
+
+
+ #region [ 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k ]
+ if (sf != null) sf.Dispose(); sf = null;
+ if (g != null) g.Dispose(); g = null;
+ #endregion
+
+ return bmp;
+ }
+
+ ///
+ /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆(繝。繧、繝ウ蜃ヲ逅)
+ ///
+ /// 謠冗判縺輔l縺滄伜沺
+ /// 謠冗判譁蟄怜
+ /// 謠冗判譁蟄怜
+ /// 謠冗判繝「繝シ繝
+ /// 謠冗判濶イ
+ /// 邵∝叙濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ protected Bitmap DrawPrivateFont_V( string drawstr, Color fontColor, Color edgeColor, bool bVertical )
+ {
+ if ( this._fontfamily == null || drawstr == null || drawstr == "" )
+ {
+ // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九
+ // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲
+ // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶
+ if ( drawstr != "" )
+ {
+ Trace.TraceWarning( "DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶" );
+ }
+ _rectStrings = new Rectangle( 0, 0, 0, 0 );
+ _ptOrigin = new Point( 0, 0 );
+ return new Bitmap(1, 1);
+ }
+
+ //StreamWriter stream = stream = new StreamWriter("Test.txt", false);
+
+ //try
+ //{
+ // stream = new StreamWriter("Test.txt", false);
+ //}
+ //catch (Exception ex)
+ //{
+ // stream.Close();
+ // stream = new StreamWriter("Test.txt", false);
+ //}
+
+ string[] strName = new string[ drawstr.Length ];
+ for( int i = 0; i < drawstr.Length; i++ ) strName[i] = drawstr.Substring(i, 1);
+
+ #region[ 繧ュ繝」繝ウ繝舌せ縺ョ螟ァ縺阪&莠域クャ ]
+ //螟ァ縺阪&繧定ィ育ョ励@縺ヲ縺縺上
+ int nHeight = 0;
+ for( int i = 0; i < strName.Length; i++ )
+ {
+ Size strSize = System.Windows.Forms.TextRenderer.MeasureText( strName[ i ], this._font, new Size( int.MaxValue, int.MaxValue ),
+ System.Windows.Forms.TextFormatFlags.NoPrefix |
+ System.Windows.Forms.TextFormatFlags.NoPadding );
+
+ //stringformat縺ッ譛蛻昴↓繧縺」縺ヲ縺縺ヲ繧ゅ>縺縺繧阪≧縲
+ StringFormat sFormat = new StringFormat();
+ sFormat.LineAlignment = StringAlignment.Center; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ
+ sFormat.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ
+
+
+ //縺ァ縺阪k縺縺第ュ」遒コ縺ェ蛟、繧定ィ育ョ励@縺ヲ縺翫″縺溘>...!
+ Bitmap bmpDummy = new Bitmap( 150, 150 ); //縺ィ繧翫≠縺医★150
+ Graphics gCal = Graphics.FromImage( bmpDummy );
+ Rectangle rect豁」遒コ縺ェ繧オ繧、繧コ = this.MeasureStringPrecisely( gCal, strName[ i ], this._font, strSize, sFormat );
+ int n菴咏區繧オ繧、繧コ = strSize.Height - rect豁」遒コ縺ェ繧オ繧、繧コ.Height;
+
+ Rectangle rect = new Rectangle( 0, -n菴咏區繧オ繧、繧コ + 2, 46, ( strSize.Height + 16 ));
+
+ if( strName[ i ] == "繝シ" || strName[ i ] == "-" || strName[ i ] == "ス" || strName[ i ] == "<" || strName[ i ] == ">" || strName[ i ] == "(" || strName[ i ] == ")" || strName[ i ] == "縲" || strName[ i ] == "縲" || strName[ i ] == "[" || strName[ i ] == "]" )
+ {
+ nHeight += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Width ) + 4;
+ }
+ else if( strName[ i ] == "_" ){ nHeight += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height ) + 6; }
+ else if( strName[ i ] == " " )
+ { nHeight += ( 12 ); }
+ else { nHeight += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height ) + 10; }
+
+ //蠢オ縺ョ縺溘a隗」謾セ
+ bmpDummy.Dispose();
+ gCal.Dispose();
+
+ //stream.WriteLine( "譁蟄励ョ螟ァ縺阪&{0},螟ァ縺阪&蜷郁ィ{1}", ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height ) + 6, nHeight );
+
+ }
+ #endregion
+
+ Bitmap bmpCambus = new Bitmap( 46, nHeight );
+ Graphics Gcambus = Graphics.FromImage( bmpCambus );
+
+ //繧ュ繝」繝ウ繝舌せ菴懈絶1譁蟄励★縺、菴懈舌@縺ヲ繧ュ繝」繝ウ繝舌せ縺ォ謠冗判縺ィ縺縺蠖「縺後h縺輔◎縺縺九↑?
+ int nNowPos = 0;
+ int nAdded = 0;
+ int nEdge陬懈ュ」X = 0;
+ int nEdge陬懈ュ」Y = 0;
+ if (this._pt < 18)
+ nAdded = nAdded - 2;
+
+ for (int i = 0; i < strName.Length; i++)
+ {
+ Size strSize = System.Windows.Forms.TextRenderer.MeasureText(strName[i], this._font, new Size(int.MaxValue, int.MaxValue),
+ System.Windows.Forms.TextFormatFlags.NoPrefix |
+ System.Windows.Forms.TextFormatFlags.NoPadding);
+
+ //stringformat縺ッ譛蛻昴↓繧縺」縺ヲ縺縺ヲ繧ゅ>縺縺繧阪≧縲
+ StringFormat sFormat = new StringFormat();
+ sFormat.LineAlignment = StringAlignment.Center; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ
+ sFormat.Alignment = StringAlignment.Near; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ
+
+ //縺ァ縺阪k縺縺第ュ」遒コ縺ェ蛟、繧定ィ育ョ励@縺ヲ縺翫″縺溘>...!
+ Bitmap bmpDummy = new Bitmap(150, 150); //縺ィ繧翫≠縺医★150
+ Graphics gCal = Graphics.FromImage(bmpDummy);
+ Rectangle rect豁」遒コ縺ェ繧オ繧、繧コ = this.MeasureStringPrecisely(gCal, strName[i], this._font, strSize, sFormat);
+ int n菴咏區繧オ繧、繧コ = strSize.Height - rect豁」遒コ縺ェ繧オ繧、繧コ.Height;
+
+ //Bitmap bmpV = new Bitmap( 36, ( strSize.Height + 12 ) - 6 );
+
+ Bitmap bmpV = new Bitmap((rect豁」遒コ縺ェ繧オ繧、繧コ.Width + 12) + nAdded, (rect豁」遒コ縺ェ繧オ繧、繧コ.Height) + 12);
+
+ bmpV.MakeTransparent();
+ Graphics gV = Graphics.FromImage(bmpV);
+ gV.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+
+
+ if (strName[i].In(TJAPlayer3.Skin.SongSelect_CorrectionX_Chara))
+ {
+ nEdge陬懈ュ」X = TJAPlayer3.Skin.SongSelect_CorrectionX_Chara_Value;
+ }
+ else
+ {
+ nEdge陬懈ュ」X = 0;
+ }
+ if (strName[i].In(TJAPlayer3.Skin.SongSelect_CorrectionY_Chara))
+ {
+ nEdge陬懈ュ」Y = TJAPlayer3.Skin.SongSelect_CorrectionY_Chara_Value;
+ }
+ else
+ {
+ nEdge陬懈ュ」Y = 0;
+ }
+ //X蠎ァ讓吶〆蠎ァ讓吶◎繧後◇繧後↓縺、縺縺ヲ縲ヾkinConfig蜀縺ァ繧コ繝ャ繧堤峩縺励◆縺譁蟄励r , 縺ァ蛹コ蛻縺」縺ヲ蛻玲嫌縺励※縲
+ //陬懈ュ」蛟、繧定ィ伜・縺吶k縺薙→縺ァ縲∫音螳壹ョ縺昴l繧峨ョ譁蟄励↓縺、縺縺ヲ荳諡ャ縺ァ蠎ァ讓吶r縺壹i縺吶
+ //迴セ譎らせ縺ァ縺ッ陬懈ュ」蛟、繧湛,Y蜷蠎ァ讓吶↓縺、縺縺ヲ1蛟九★縺、縺励°蜿悶l縺ェ縺シ郁、謨ー蟇セ1シ峨ョ縺ァ縲
+ //譁蟄励r蛻玲嫌縺励※縲∝酔縺俶焚縺縺代◎繧後◇繧後ョ譁蟄励ョ陬懈ュ」蛟、繧定ィ伜・縺ァ縺阪k繧医≧縺ェ譫邨繧偵▽縺上j縺溘>縲ゑシ20181205 rhimmシ
+
+ Rectangle rect = new Rectangle(-3 - nAdded + (nEdge陬懈ュ」X * _pt / 100), -rect豁」遒コ縺ェ繧オ繧、繧コ.Y - 2 + (nEdge陬懈ュ」Y * _pt / 100), (strSize.Width + 12), (strSize.Height + 12));
+ //Rectangle rect = new Rectangle( 0, -rect豁」遒コ縺ェ繧オ繧、繧コ.Y - 2, 36, rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 10);
+
+ // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k
+ // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺)
+ float sizeInPixels = _font.SizeInPoints * gV.DpiY / 72; // 1 inch = 72 points
+
+ System.Drawing.Drawing2D.GraphicsPath gpV = new System.Drawing.Drawing2D.GraphicsPath();
+ gpV.AddString(strName[i], this._fontfamily, (int)this._font.Style, sizeInPixels, rect, sFormat);
+
+ // 邵∝叙繧翫r謠冗判縺吶k
+ //int nEdgePt = (_pt / 3); // 邵∝叙繧翫r繝輔か繝ウ繝医し繧、繧コ蝓コ貅悶↓螟画峩
+ int nEdgePt = (10 * _pt / TJAPlayer3.Skin.Font_Edge_Ratio_Vertical); // SkinConfig縺ォ縺ヲ險ュ螳壼庄閭ス縺ォ(rhimm)
+ Pen pV = new Pen(edgeColor, nEdgePt);
+ pV.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
+ gV.DrawPath(pV, gpV);
+
+ // 蝪励j縺、縺カ縺
+ Brush brV;
+ {
+ brV = new SolidBrush(fontColor);
+ }
+ gV.FillPath(brV, gpV);
+
+ if (brV != null) brV.Dispose(); brV = null;
+ if (pV != null) pV.Dispose(); pV = null;
+ if (gpV != null) gpV.Dispose(); gpV = null;
+ if (gV != null) gV.Dispose(); gV = null;
+
+ int n陬懈ュ」 = 0;
+ int nY陬懈ュ」 = 0;
+
+ if (strName[i] == "繝シ" || strName[i] == "-" || strName[i] == "ス")
+ {
+ bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone);
+ n陬懈ュ」 = 2;
+ if (this._pt < 20)
+ n陬懈ュ」 = 0;
+ //nNowPos = nNowPos - 2;
+ }
+ else if (strName[i] == "<" || strName[i] == ">" || strName[i] == "(" || strName[i] == ")" || strName[i] == "[" || strName[i] == "]" || strName[i] == "縲" || strName[i] == "シ" || strName[i] == "縲")
+ {
+ bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone);
+ n陬懈ュ」 = 2;
+ if (this._pt < 20)
+ {
+ n陬懈ュ」 = 0;
+ //nNowPos = nNowPos - 4;
+ }
+ }
+ else if (strName[i] == "縲" || strName[i] == "シ" || strName[i] == "縲")
+ {
+ bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone);
+ n陬懈ュ」 = 2;
+ if (this._pt < 20)
+ {
+ n陬懈ュ」 = 2;
+ //nNowPos = nNowPos;
+ }
+ }
+ else if (strName[i] == "繝サ")
+ {
+ n陬懈ュ」 = -8;
+ if (this._pt < 20)
+ {
+ n陬懈ュ」 = -8;
+ //nNowPos = nNowPos;
+ }
+ }
+ else if (strName[i] == ".")
+ {
+ n陬懈ュ」 = 8;
+ if (this._pt < 20)
+ {
+ n陬懈ュ」 = 8;
+ //nNowPos = nNowPos;
+ }
+ }
+ else if (strName[i].In(TJAPlayer3.Skin.SongSelect_Rotate_Chara))
+ {
+ bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone);
+ }
+ //蛟句挨縺ョ譁蟄励↓髢「縺励※縲√き繝ウ繝槭〒蛹コ蛻縺」縺ヲSkinConfig縺ォ險伜・縺励◆繧ゅョ繧貞屓霆「縺輔○繧(20181205 rhimm)
+
+
+ //else if( strName[ i ] == "_" )
+ // nNowPos = nNowPos + 20;
+ else if( strName[ i ] == " " )
+ nNowPos = nNowPos + 10;
+
+
+ //bmpV.Save( "String" + i.ToString() + ".png" );
+
+
+ if( i == 0 )
+ {
+ nNowPos = 4;
+ }
+ Gcambus.DrawImage( bmpV, (bmpCambus.Width / 2) - (bmpV.Width / 2) + n陬懈ュ」, nNowPos + nY陬懈ュ」 );
+ nNowPos += bmpV.Size.Height - 6;
+
+ if( bmpV != null ) bmpV.Dispose(); bmpV = null;
+ if( gCal != null ) gCal.Dispose(); gCal = null;
+
+ //bmpCambus.Save( "test.png" );
+ //if( this._pt < 20 )
+ // bmpCambus.Save( "test_S.png" );
+
+ _rectStrings = new Rectangle( 0, 0, strSize.Width, strSize.Height );
+ _ptOrigin = new Point( 6 * 2, 6 * 2 );
+
+
+ //stream.WriteLine( "鮟堤┌縺励し繧、繧コ{0},菴咏區{1},鮟偵≠繧贋コ域クャ繧オ繧、繧コ{2},繝昶代ず竊怒3}",rect豁」遒コ縺ェ繧オ繧、繧コ.Height, n菴咏區繧オ繧、繧コ, rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 8, nNowPos );
+
+ }
+ //stream.Close();
+
+ if( Gcambus != null ) Gcambus.Dispose();
+
+ //return bmp;
+ return bmpCambus;
+ }
+
+ /////
+ ///// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆(繝。繧、繝ウ蜃ヲ逅)
+ /////
+ ///// 謠冗判縺輔l縺滄伜沺
+ ///// 謠冗判譁蟄怜
+ ///// 謠冗判譁蟄怜
+ ///// 謠冗判繝「繝シ繝
+ ///// 謠冗判濶イ
+ ///// 邵∝叙濶イ
+ ///// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ
+ ///// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ
+ ///// 謠冗判貂医ユ繧ッ繧ケ繝√Ε
+ //protected Bitmap DrawPrivateFont_V( string drawstr, Color fontColor, Color edgeColor, bool bVertical )
+ //{
+ // if ( this._fontfamily == null || drawstr == null || drawstr == "" )
+ // {
+ // // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九
+ // // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲
+ // // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶
+ // if ( drawstr != "" )
+ // {
+ // Trace.TraceWarning( "DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶" );
+ // }
+ // _rectStrings = new Rectangle( 0, 0, 0, 0 );
+ // _ptOrigin = new Point( 0, 0 );
+ // return new Bitmap(1, 1);
+ // }
+
+ // //StreamWriter stream = stream = new StreamWriter("Test.txt", false);
+
+ // //try
+ // //{
+ // // stream = new StreamWriter("Test.txt", false);
+ // //}
+ // //catch (Exception ex)
+ // //{
+ // // stream.Close();
+ // // stream = new StreamWriter("Test.txt", false);
+ // //}
+
+ // string[] strName = new string[] { "辟シ","閧","螳","鬟", "X", "G", "t", "e", "s", "t" };
+ // strName = new string[ drawstr.Length ];
+ // for( int i = 0; i < drawstr.Length; i++ ) strName[i] = drawstr.Substring(i, 1);
+
+
+ // Bitmap bmpCambus = new Bitmap( 48, ( drawstr.Length * 31 ) );
+ // Graphics Gcambus = Graphics.FromImage( bmpCambus );
+
+ // //繧ュ繝」繝ウ繝舌せ菴懈絶1譁蟄励★縺、菴懈舌@縺ヲ繧ュ繝」繝ウ繝舌せ縺ォ謠冗判縺ィ縺縺蠖「縺後h縺輔◎縺縺九↑?
+
+ // int nStartPos = 0;
+ // int nNowPos = 0;
+
+ // //for繝ォ繝シ繝励〒1譁蟄励★縺、bitmap菴懈?
+ // for( int i = 0; i < strName.Length; i++ )
+ // {
+ // Size strSize = System.Windows.Forms.TextRenderer.MeasureText( strName[ i ], this._font, new Size( int.MaxValue, int.MaxValue ),
+ // System.Windows.Forms.TextFormatFlags.NoPrefix |
+ // System.Windows.Forms.TextFormatFlags.NoPadding );
+
+ // //Bitmap bmpV = new Bitmap( strSize.Width + 12, ( strSize.Height + 12 ) - 6 );
+ // Bitmap bmpV = new Bitmap( 36, ( strSize.Height + 12 ) - 6 );
+ // bmpV.MakeTransparent();
+ // Graphics gV = Graphics.FromImage( bmpV );
+ // gV.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+
+ // StringFormat sFormat = new StringFormat();
+ // sFormat.LineAlignment = StringAlignment.Center; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ
+ // sFormat.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ
+
+
+ // //Rectangle rect = new Rectangle( 0, 0, strSize.Width + 12, ( strSize.Height + 12 ));
+ // Rectangle rect = new Rectangle( 0, 0, 36, ( strSize.Height + 12 ));
+
+ // // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k
+ // // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺)
+ // float sizeInPixels = _font.SizeInPoints * gV.DpiY / 72; // 1 inch = 72 points
+
+ // System.Drawing.Drawing2D.GraphicsPath gpV = new System.Drawing.Drawing2D.GraphicsPath();
+ // gpV.AddString( strName[ i ], this._fontfamily, (int) this._font.Style, sizeInPixels, rect, sFormat );
+
+
+ // Rectangle rect豁」遒コ縺ェ繧オ繧、繧コ = this.MeasureStringPrecisely( gV, strName[ i ], this._font, strSize, sFormat );
+
+ // // 邵∝叙繧翫r謠冗判縺吶k
+ // Pen pV = new Pen( edgeColor, 6 );
+ // pV.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
+ // gV.DrawPath( pV, gpV );
+
+ // // 蝪励j縺、縺カ縺
+ // Brush brV;
+ // {
+ // brV = new SolidBrush( fontColor );
+ // }
+ // gV.FillPath( brV, gpV );
+
+ // if ( brV != null ) brV.Dispose(); brV = null;
+ // if ( pV != null ) pV.Dispose(); pV = null;
+ // if ( gpV != null ) gpV.Dispose(); gpV = null;
+
+ // int n陬懈ュ」 = 0;
+
+ // //bmpV.Save( "String" + i.ToString() + ".png" );
+ // if( strName[ i ] == "繝シ" || strName[ i ] == "-" || strName[ i ] == "ス")
+ // {
+ // bmpV.RotateFlip( RotateFlipType.Rotate90FlipNone );
+ // nNowPos = nNowPos + 20;
+ // n陬懈ュ」 = 2;
+ // }
+ // else if( strName[ i ] == "<" || strName[ i ] == ">" || strName[ i ] == "(" || strName[ i ] == ")" )
+ // {
+ // bmpV.RotateFlip( RotateFlipType.Rotate90FlipNone );
+ // nNowPos = nNowPos + 8;
+ // n陬懈ュ」 = 2;
+ // }
+ // else if( strName[ i ] == "_" )
+ // nNowPos = nNowPos + 20;
+ // else if( strName[ i ] == " " )
+ // nNowPos = nNowPos + 10;
+
+ // int n菴咏區繧オ繧、繧コ = strSize.Height - rect豁」遒コ縺ェ繧オ繧、繧コ.Height;
+ // if( i == 0 )
+ // {
+ // nStartPos = -n菴咏區繧オ繧、繧コ + 2;
+ // nNowPos = -n菴咏區繧オ繧、繧コ + 2;
+ // Gcambus.DrawImage( bmpV, ( bmpCambus.Size.Width - bmpV.Size.Width ) + n陬懈ュ」, nStartPos );
+ // //nNowPos += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 6 );
+ // }
+ // else
+ // {
+ // nNowPos += ( strSize.Height - n菴咏區繧オ繧、繧コ ) + 4;
+ // Gcambus.DrawImage( bmpV, ( bmpCambus.Size.Width - bmpV.Size.Width ) + n陬懈ュ」, nNowPos );
+ // }
+
+ // if ( bmpV != null ) bmpV.Dispose();
+
+ // //bmpCambus.Save( "test.png" );
+
+ // _rectStrings = new Rectangle( 0, 0, strSize.Width, strSize.Height );
+ // _ptOrigin = new Point( 6 * 2, 6 * 2 );
+
+
+ // //stream.WriteLine( "鮟堤┌縺励し繧、繧コ{0},菴咏區{1},鮟偵≠繧贋コ域クャ繧オ繧、繧コ{2},繝昶代ず竊怒3}",rect豁」遒コ縺ェ繧オ繧、繧コ.Height, n菴咏區繧オ繧、繧コ, rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 6, nNowPos );
+
+ // }
+ // //stream.Close();
+
+ // //return bmp;
+ // return bmpCambus;
+ //}
+
+
+ //------------------------------------------------
+ //菴ソ逕ィ:http://dobon.net/vb/dotnet/graphics/measurestring.html
+
+ ///
+ /// Graphics.DrawString縺ァ譁蟄怜励r謠冗判縺励◆譎ゅョ螟ァ縺阪&縺ィ菴咲スョ繧呈ュ」遒コ縺ォ險域クャ縺吶k
+ ///
+ /// 譁蟄怜励r謠冗判縺吶kGraphics
+ /// 謠冗判縺吶k譁蟄怜
+ /// 謠冗判縺ォ菴ソ逕ィ縺吶k繝輔か繝ウ繝
+ /// 縺薙l莉・荳雁、ァ縺阪>縺薙→縺ッ縺ェ縺縺ィ縺縺繧オ繧、繧コ縲
+ /// 縺ァ縺阪k縺縺大ー上&縺上☆繧九%縺ィ縲
+ /// 謠冗判縺ォ菴ソ逕ィ縺吶kStringFormat
+ /// 譁蟄怜励′謠冗判縺輔l繧狗ッ蝗イ縲
+ /// 隕九▽縺九i縺ェ縺九▲縺滓凾縺ッ縲ヽectangle.Empty縲
+ public Rectangle MeasureStringPrecisely(Graphics g,
+ string text, Font font, Size proposedSize, StringFormat stringFormat)
+ {
+ //隗」蜒丞コヲ繧貞シ輔″邯吶>縺ァ縲。itmap繧剃ス懈舌☆繧
+ Bitmap bmp = new Bitmap(proposedSize.Width, proposedSize.Height, g);
+ //Bitmap縺ョGraphics繧剃ス懈舌☆繧
+ Graphics bmpGraphics = Graphics.FromImage(bmp);
+ //Graphics縺ョ繝励Ο繝代ユ繧」繧貞シ輔″邯吶$
+ bmpGraphics.TextRenderingHint = g.TextRenderingHint;
+ bmpGraphics.TextContrast = g.TextContrast;
+ bmpGraphics.PixelOffsetMode = g.PixelOffsetMode;
+ //譁蟄怜励ョ謠上°繧後※縺縺ェ縺驛ィ蛻縺ョ濶イ繧貞叙蠕励☆繧
+ Color backColor = bmp.GetPixel(0, 0);
+ //螳滄圀縺ォBitmap縺ォ譁蟄怜励r謠冗判縺吶k
+ bmpGraphics.DrawString(text, font, Brushes.Black,
+ new RectangleF(0f, 0f, proposedSize.Width, proposedSize.Height),
+ stringFormat);
+ bmpGraphics.Dispose();
+ //譁蟄怜励′謠冗判縺輔l縺ヲ縺繧狗ッ蝗イ繧定ィ域クャ縺吶k
+ Rectangle resultRect = MeasureForegroundArea(bmp, backColor);
+ bmp.Dispose();
+
+ return resultRect;
+ }
+
+ ///
+ /// 謖螳壹&繧後◆Bitmap縺ァ縲|ackColor莉・螟悶ョ濶イ縺御スソ繧上l縺ヲ縺繧狗ッ蝗イ繧定ィ域クャ縺吶k
+ ///
+ private Rectangle MeasureForegroundArea(Bitmap bmp, Color backColor)
+ {
+ int backColorArgb = backColor.ToArgb();
+ int maxWidth = bmp.Width;
+ int maxHeight = bmp.Height;
+
+ //蟾ヲ蛛エ縺ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k
+ int leftPosition = -1;
+ for (int x = 0; x < maxWidth; x++)
+ {
+ for (int y = 0; y < maxHeight; y++)
+ {
+ //驕輔≧濶イ繧定ヲ九▽縺代◆縺ィ縺阪ッ縲∽ス咲スョ繧呈アコ螳壹☆繧
+ if (bmp.GetPixel(x, y).ToArgb() != backColorArgb)
+ {
+ leftPosition = x;
+ break;
+ }
+ }
+ if (0 <= leftPosition)
+ {
+ break;
+ }
+ }
+ //驕輔≧濶イ縺瑚ヲ九▽縺九i縺ェ縺九▲縺滓凾
+ if (leftPosition < 0)
+ {
+ return Rectangle.Empty;
+ }
+
+ //蜿ウ蛛エ縺ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k
+ int rightPosition = -1;
+ for (int x = maxWidth - 1; leftPosition < x; x--)
+ {
+ for (int y = 0; y < maxHeight; y++)
+ {
+ if (bmp.GetPixel(x, y).ToArgb() != backColorArgb)
+ {
+ rightPosition = x;
+ break;
+ }
+ }
+ if (0 <= rightPosition)
+ {
+ break;
+ }
+ }
+ if (rightPosition < 0)
+ {
+ rightPosition = leftPosition;
+ }
+
+ //荳翫ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k
+ int topPosition = -1;
+ for (int y = 0; y < maxHeight; y++)
+ {
+ for (int x = leftPosition; x <= rightPosition; x++)
+ {
+ if (bmp.GetPixel(x, y).ToArgb() != backColorArgb)
+ {
+ topPosition = y;
+ break;
+ }
+ }
+ if (0 <= topPosition)
+ {
+ break;
+ }
+ }
+ if (topPosition < 0)
+ {
+ return Rectangle.Empty;
+ }
+
+ //荳九ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k
+ int bottomPosition = -1;
+ for (int y = maxHeight - 1; topPosition < y; y--)
+ {
+ for (int x = leftPosition; x <= rightPosition; x++)
+ {
+ if (bmp.GetPixel(x, y).ToArgb() != backColorArgb)
+ {
+ bottomPosition = y;
+ break;
+ }
+ }
+ if (0 <= bottomPosition)
+ {
+ break;
+ }
+ }
+ if (bottomPosition < 0)
+ {
+ bottomPosition = topPosition;
+ }
+
+ //邨先棡繧定ソ斐☆
+ return new Rectangle(leftPosition, topPosition,
+ rightPosition - leftPosition, bottomPosition - topPosition);
+ }
+
+ private Rectangle MeasureForegroundArea(Bitmap bmp)
+ {
+ return MeasureForegroundArea(bmp, bmp.GetPixel(0, 0));
+ }
+
+ //------------------------------------------------
+
+ ///
+ /// 譛蠕後↓DrawPrivateFont()縺励◆譁蟄怜励ョ謠冗判鬆伜沺繧貞叙蠕励@縺セ縺吶
+ ///
+ public Rectangle RectStrings
+ {
+ get
+ {
+ return _rectStrings;
+ }
+ protected set
+ {
+ _rectStrings = value;
+ }
+ }
+ public Point PtOrigin
+ {
+ get
+ {
+ return _ptOrigin;
+ }
+ protected set
+ {
+ _ptOrigin = value;
+ }
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if (!this.bDispose螳御コ貂医∩)
+ {
+ if (this._font != null)
+ {
+ this._font.Dispose();
+ this._font = null;
+ }
+ if (this._pfc != null)
+ {
+ this._pfc.Dispose();
+ this._pfc = null;
+ }
+
+ this.bDispose螳御コ貂医∩ = true;
+ }
+ }
+ //-----------------
+ #endregion
+ #region [ private ]
+ //-----------------
+ protected bool bDispose螳御コ貂医∩;
+ protected Font _font;
+
+ private System.Drawing.Text.PrivateFontCollection _pfc;
+ private FontFamily _fontfamily;
+ private int _pt;
+ private Rectangle _rectStrings;
+ private Point _ptOrigin;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Common/CSkin.cs b/TJAPlayer3/Common/CSkin.cs
new file mode 100644
index 00000000..a3844a9b
--- /dev/null
+++ b/TJAPlayer3/Common/CSkin.cs
@@ -0,0 +1,2921 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Diagnostics;
+using FDK;
+using System.Drawing;
+using System.Linq;
+
+namespace TJAPlayer3
+{
+ // 繧ー繝ュ繝シ繝舌Ν螳壽焚
+
+ public enum E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝
+ {
+ BGM繧ェ繝励す繝ァ繝ウ逕サ髱「 = 0,
+ BGM繧ウ繝ウ繝輔ぅ繧ー逕サ髱「,
+ BGM襍キ蜍慕判髱「,
+ BGM驕ク譖イ逕サ髱「,
+ SOUND繧ケ繝繝シ繧ク螟ア謨鈴浹,
+ SOUND繧ォ繝シ繧ス繝ォ遘サ蜍暮浹,
+ SOUND繧イ繝シ繝髢句ァ矩浹,
+ SOUND繧イ繝シ繝邨ゆコ髻ウ,
+ SOUND繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ,
+ SOUND繧ソ繧、繝医Ν髻ウ,
+ SOUND繝輔Ν繧ウ繝ウ繝憺浹,
+ SOUND豁灘」ー髻ウ,
+ SOUND譖イ隱ュ霎シ髢句ァ矩浹,
+ SOUND豎コ螳夐浹,
+ SOUND蜿匁カ磯浹,
+ SOUND螟画峩髻ウ,
+ //SOUND襍、,
+ //SOUND髱,
+ SOUND鬚ィ闊ケ,
+ SOUND譖イ豎コ螳夐浹,
+ SOUND謌千クセ逋コ陦ィ,
+ SOUND迚ケ險灘咲函,
+ SOUND迚ケ險灘●豁「,
+ sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝,
+ sound迚ケ險薙せ繧ュ繝繝鈴浹,
+ SOUND迚ケ險薙せ繧ッ繝ュ繝シ繝ォ,
+ Count // 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝臥キ乗焚縺ョ險育ョ礼畑
+ }
+
+ internal class CSkin : IDisposable
+ {
+ // 繧ッ繝ゥ繧ケ
+
+ public class C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 : IDisposable
+ {
+ // static 繝輔ぅ繝シ繝ォ繝
+
+ public static CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝;
+
+ private readonly ESoundGroup _soundGroup;
+
+ // 繝輔ぅ繝シ繝ォ繝峨√励Ο繝代ユ繧」
+
+ public bool bPlayed;
+ public bool bCompact蟇セ雎。;
+ public bool b繝ォ繝シ繝;
+ public bool b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦;
+ public bool b隱ュ縺ソ霎シ縺ソ謌仙粥;
+ public bool b謗剃サ;
+ public string str繝輔ぃ繧、繝ォ蜷 = "";
+ public bool b蜀咲函荳ュ
+ {
+ get
+ {
+ if (this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ] == null)
+ return false;
+
+ return this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ].b蜀咲函荳ュ;
+ }
+ }
+ public int n菴咲スョ_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝
+ {
+ get
+ {
+ CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound == null)
+ return 0;
+
+ return sound.n菴咲スョ;
+ }
+ set
+ {
+ CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound != null)
+ sound.n菴咲スョ = value;
+ }
+ }
+ public int n菴咲スョ_谺。縺ォ魑エ繧九し繧ヲ繝ウ繝
+ {
+ get
+ {
+ CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound == null)
+ return 0;
+
+ return sound.n菴咲スョ;
+ }
+ set
+ {
+ CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound != null)
+ sound.n菴咲スョ = value;
+ }
+ }
+ public int nAutomationLevel_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝
+ {
+ get
+ {
+ CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound == null)
+ return 0;
+
+ return sound.AutomationLevel;
+ }
+ set
+ {
+ CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound != null)
+ {
+ sound.AutomationLevel = value;
+ }
+ }
+ }
+ public int n髟キ縺廟迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝
+ {
+ get
+ {
+ CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound == null)
+ {
+ return 0;
+ }
+ return sound.n邱乗シ泌・乗凾髢杜s;
+ }
+ }
+ public int n髟キ縺廟谺。縺ォ魑エ繧九し繧ヲ繝ウ繝
+ {
+ get
+ {
+ CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound == null)
+ {
+ return 0;
+ }
+ return sound.n邱乗シ泌・乗凾髢杜s;
+ }
+ }
+
+
+ ///
+ /// 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+ ///
+ ///
+ ///
+ ///
+ ///
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(string str繝輔ぃ繧、繝ォ蜷, bool b繝ォ繝シ繝, bool b謗剃サ, bool bCompact蟇セ雎。, ESoundGroup soundGroup)
+ {
+ this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷;
+ this.b繝ォ繝シ繝 = b繝ォ繝シ繝;
+ this.b謗剃サ = b謗剃サ;
+ this.bCompact蟇セ雎。 = bCompact蟇セ雎。;
+ _soundGroup = soundGroup;
+ this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦 = true;
+ this.bPlayed = false;
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void t隱ュ縺ソ霎シ縺ソ()
+ {
+ this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦 = false;
+ this.b隱ュ縺ソ霎シ縺ソ謌仙粥 = false;
+ if (string.IsNullOrEmpty(this.str繝輔ぃ繧、繝ォ蜷))
+ throw new InvalidOperationException("繝輔ぃ繧、繝ォ蜷阪′辟。蜉ケ縺ァ縺吶");
+
+ if (!File.Exists(CSkin.Path(this.str繝輔ぃ繧、繝ォ蜷)))
+ {
+ Trace.TraceWarning($"繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲: {this.str繝輔ぃ繧、繝ォ蜷閤");
+ return;
+ }
+ //// for( int i = 0; i < 2; i++ ) // #27790 2012.3.10 yyagi 2蝗櫁ェュ縺ソ蜃コ縺励r縲1蝗櫁ェュ縺ソ縺縺暦シ1蝗槭Γ繝「繝ェ繧ウ繝斐シ縺ォ螟画峩
+ //// {
+ // try
+ // {
+ // this.rSound[ 0 ] = CDTXMania.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( CSkin.Path( this.str繝輔ぃ繧、繝ォ蜷 ) );
+ // }
+ // catch
+ // {
+ // this.rSound[ 0 ] = null;
+ // throw;
+ // }
+ // if ( this.rSound[ 0 ] == null ) // #28243 2012.5.3 yyagi "this.rSound[ 0 ].b繧ケ繝医Μ繝シ繝蜀咲函縺吶k"譎ゅbClone縺吶k繧医≧縺ォ縺励〉Sound[1]縺系ull縺ォ縺ェ繧峨↑縺繧医≧菫ョ豁」竊池Sound[1]縺ョ蜀咲函豁」蟶ク蛹
+ // {
+ // this.rSound[ 1 ] = null;
+ // }
+ // else
+ // {
+ // this.rSound[ 1 ] = ( CSound ) this.rSound[ 0 ].Clone(); // #27790 2012.3.10 yyagi add: to accelerate loading chip sounds
+ // CDTXMania.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逋サ骭イ縺吶k( this.rSound[ 1 ] ); // #28243 2012.5.3 yyagi add (逋サ骭イ貍上l縺ォ繧医j繧ケ繝医Μ繝シ繝蜀咲函蜃ヲ逅縺檎匱逕溘@縺ヲ縺縺ェ縺九▲縺)
+ // }
+
+ //// }
+
+ for (int i = 0; i < 2; i++) // 荳譌ヲClone繧呈ュ「繧√※ASIO蟇セ蠢懊↓蟆ょソオ
+ {
+ try
+ {
+ this.rSound[i] = TJAPlayer3.Sound邂。逅?.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(this.str繝輔ぃ繧、繝ォ蜷), _soundGroup);
+ }
+ catch
+ {
+ this.rSound[i] = null;
+ throw;
+ }
+ }
+ this.b隱ュ縺ソ霎シ縺ソ謌仙粥 = true;
+ }
+ public void t蜀咲函縺吶k()
+ {
+ if (this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦)
+ {
+ try
+ {
+ t隱ュ縺ソ霎シ縺ソ();
+ }
+ catch (Exception e)
+ {
+ Trace.TraceError(e.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (17668977-4686-4aa7-b3f0-e0b9a44975b8)");
+ this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦 = false;
+ }
+ }
+ if (this.b謗剃サ)
+ {
+ if (r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 != null)
+ r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝.t蛛懈ュ「縺吶k();
+
+ r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 = this;
+ }
+ CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ];
+ if (sound != null)
+ sound.t蜀咲函繧帝幕蟋九☆繧(this.b繝ォ繝シ繝);
+
+ this.bPlayed = true;
+ this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ = 1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ;
+ }
+ public void t蛛懈ュ「縺吶k()
+ {
+ this.bPlayed = false;
+ if (this.rSound[0] != null)
+ this.rSound[0].t蜀咲函繧貞●豁「縺吶k();
+
+ if (this.rSound[1] != null)
+ this.rSound[1].t蜀咲函繧貞●豁「縺吶k();
+
+ if (r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 == this)
+ r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 = null;
+ }
+
+ public void tRemoveMixer()
+ {
+ if (TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() != "DirectShow")
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ if (this.rSound[i] != null)
+ {
+ TJAPlayer3.Sound邂。逅.RemoveMixer(this.rSound[i]);
+ }
+ }
+ }
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if (!this.bDisposed貂医∩)
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ if (this.rSound[i] != null)
+ {
+ TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k(this.rSound[i]);
+ this.rSound[i] = null;
+ }
+ }
+ this.b隱ュ縺ソ霎シ縺ソ謌仙粥 = false;
+ this.bDisposed貂医∩ = true;
+ }
+ }
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ private bool bDisposed貂医∩;
+ private int n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ;
+ private CSound[] rSound = new CSound[2];
+ //-----------------
+ #endregion
+ }
+
+
+ // 繝励Ο繝代ユ繧」
+
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ェ繝励す繝ァ繝ウ逕サ髱「 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm襍キ蜍慕判髱「 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSTAGEFAILED髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧イ繝シ繝髢句ァ矩浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧イ繝シ繝邨ゆコ髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繝輔Ν繧ウ繝ウ繝憺浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound豁灘」ー髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound譖イ隱ュ霎シ髢句ァ矩浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound豎コ螳夐浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound蜿匁カ磯浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound螟画峩髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSongSelectChara = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSkip = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundEntry = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundError = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundsanka = null;
+ //add
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound譖イ豎コ螳夐浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝磯浹 = null;
+
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ソ繧、繝医Ν = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ソ繧、繝医Ν繧、繝ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm驕ク譖イ逕サ髱「 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm驕ク譖イ逕サ髱「繧、繝ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝医う繝ウ = null;
+
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 SoundBanapas = null;
+
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險灘咲函髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險灘●豁「髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險薙せ繧ュ繝繝鈴浹 = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundPon = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundGauge = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundScoreDon = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundChallengeVoice = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSelectStart = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSongSelectCheck = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSelectBGM = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSongSelect = null;
+
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundCrownIn = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundRankIn = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDonClear = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDonFailed = null;
+
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSelectAnnounce = null;
+
+ //public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundRed = null;
+ //public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundBlue = null;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundBalloon = null;
+
+
+ public readonly int n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚 = (int)E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.Count;
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 this[E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound]
+ {
+ get
+ {
+ switch (sound)
+ {
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ォ繝シ繧ス繝ォ遘サ蜍暮浹:
+ return this.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND豎コ螳夐浹:
+ return this.sound豎コ螳夐浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND螟画峩髻ウ:
+ return this.sound螟画峩髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND蜿匁カ磯浹:
+ return this.sound蜿匁カ磯浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND豁灘」ー髻ウ:
+ return this.sound豁灘」ー髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ケ繝繝シ繧ク螟ア謨鈴浹:
+ return this.soundSTAGEFAILED髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧イ繝シ繝髢句ァ矩浹:
+ return this.sound繧イ繝シ繝髢句ァ矩浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧イ繝シ繝邨ゆコ髻ウ:
+ return this.sound繧イ繝シ繝邨ゆコ髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ:
+ return this.sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繝輔Ν繧ウ繝ウ繝憺浹:
+ return this.sound繝輔Ν繧ウ繝ウ繝憺浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND譖イ隱ュ霎シ髢句ァ矩浹:
+ return this.sound譖イ隱ュ霎シ髢句ァ矩浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ソ繧、繝医Ν髻ウ:
+ return this.bgm繧ソ繧、繝医Ν;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM襍キ蜍慕判髱「:
+ return this.bgm襍キ蜍慕判髱「;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM繧ェ繝励す繝ァ繝ウ逕サ髱「:
+ return this.bgm繧ェ繝励す繝ァ繝ウ逕サ髱「;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM繧ウ繝ウ繝輔ぅ繧ー逕サ髱「:
+ return this.bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM驕ク譖イ逕サ髱「:
+ return this.bgm驕ク譖イ逕サ髱「;
+
+ //case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND襍、:
+ // return this.soundRed;
+
+ //case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND髱:
+ // return this.soundBlue;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND鬚ィ闊ケ:
+ return this.soundBalloon;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND譖イ豎コ螳夐浹:
+ return this.sound譖イ豎コ螳夐浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND謌千クセ逋コ陦ィ:
+ return this.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND迚ケ險灘咲函:
+ return this.sound迚ケ險灘咲函髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND迚ケ險灘●豁「:
+ return this.sound迚ケ險灘●豁「髻ウ;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝:
+ return this.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.sound迚ケ險薙せ繧ュ繝繝鈴浹:
+ return this.sound迚ケ險薙せ繧ュ繝繝鈴浹;
+
+ case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND迚ケ險薙せ繧ッ繝ュ繝シ繝ォ:
+ return this.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ;
+
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 this[int index]
+ {
+ get
+ {
+ switch (index)
+ {
+ case 0:
+ return this.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹;
+
+ case 1:
+ return this.sound豎コ螳夐浹;
+
+ case 2:
+ return this.sound螟画峩髻ウ;
+
+ case 3:
+ return this.sound蜿匁カ磯浹;
+
+ case 4:
+ return this.sound豁灘」ー髻ウ;
+
+ case 5:
+ return this.soundSTAGEFAILED髻ウ;
+
+ case 6:
+ return this.sound繧イ繝シ繝髢句ァ矩浹;
+
+ case 7:
+ return this.sound繧イ繝シ繝邨ゆコ髻ウ;
+
+ case 8:
+ return this.sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ;
+
+ case 9:
+ return this.sound繝輔Ν繧ウ繝ウ繝憺浹;
+
+ case 10:
+ return this.sound譖イ隱ュ霎シ髢句ァ矩浹;
+
+ case 11:
+ return this.bgm繧ソ繧、繝医Ν;
+
+ case 12:
+ return this.bgm襍キ蜍慕判髱「;
+
+ case 13:
+ return this.bgm繧ェ繝励す繝ァ繝ウ逕サ髱「;
+
+ case 14:
+ return this.bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「;
+
+ case 15:
+ return this.bgm驕ク譖イ逕サ髱「;
+
+ case 16:
+ return this.soundBalloon;
+
+ case 17:
+ return this.sound譖イ豎コ螳夐浹;
+
+ case 18:
+ return this.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ;
+
+ case 19:
+ return this.sound迚ケ險灘咲函髻ウ;
+
+ case 20:
+ return this.sound迚ケ險灘●豁「髻ウ;
+
+ case 21:
+ return this.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ;
+
+ case 22:
+ return this.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝;
+
+ case 23:
+ return this.sound迚ケ險薙せ繧ュ繝繝鈴浹;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+
+
+ // 繧ケ繧ュ繝ウ縺ョ蛻繧頑崛縺医↓縺、縺縺ヲ___
+ //
+ // _繧ケ繧ュ繝ウ縺ョ遞ョ鬘槭ッ螟ァ縺阪¥蛻縺代※2遞ョ鬘槭4ystem繧ケ繧ュ繝ウ縺ィboxdef繧ケ繧ュ繝ウ縲
+ // 縲蜑崎縺ッSystem/繝輔か繝ォ繝縺ォ繝ヲ繝シ繧カ繝シ縺瑚ェ繧峨う繝ウ繧ケ繝医シ繝ォ縺励※縺翫¥繧ケ繧ュ繝ウ縲
+ // 縲蠕瑚縺ッbox.def縺ァ謖螳壹☆繧九∵峇繝繝シ繧ソ蛻カ菴懆縺梧署遉コ縺吶k繧ケ繧ュ繝ウ縲
+ //
+ // _Config逕サ髱「縺ァ縲2遞ョ縺ョ繧ケ繧ュ繝ウ繧貞玄蛻・辟。縺丞クク譎ゆスソ逕ィ縺吶k繧医≧險ュ螳壹☆繧九%縺ィ縺後〒縺阪k縲
+ // _box.def縺ョ#SKINPATH 險ュ螳壹↓繧医j縲|oxdef繧ケ繧ュ繝ウ繧剃ク譎ら噪縺ォ菴ソ逕ィ縺吶k繧医≧險ュ螳壹☆繧九
+ // 縲(box.def縺ョ蜉ケ譫懊ョ蜿翫ー縺ェ縺莉悶ョmuxic box縺ァ縺ッ縲∝ス楢ゥイboxdef繧ケ繧ュ繝ウ縺ョ譛牙柑諤ァ縺檎┌縺上↑繧)
+ //
+ // 縺薙l繧貞ョ溽樟縺吶k縺溘a縺ォ___
+ // _System繧ケ繧ュ繝ウ縺ョ險ュ螳壽ュ蝣ア縺ィ縲|oxdef繧ケ繧ュ繝ウ縺ョ險ュ螳壽ュ蝣ア縺ッ縲∝髮「縺励※謖√▽縲
+ // 縲(strSystemス橸ス 縺ィ縲《trBoxDefス橸ス橸ス)
+ // _Config逕サ髱「縺九i縺ッ蜑崎縺ョ縺ソ譖ク縺肴鋤縺医〒縺阪k繧医≧縺ォ縺励
+ // 縲驕ク譖イ逕サ髱「縺九i縺ッ蠕瑚縺ョ縺ソ譖ク縺肴鋤縺医〒縺阪k繧医≧縺ォ縺吶k縲(SetCurrent...())
+ // _隱ュ縺ソ蜃コ縺励ッ荳。閠縺九i陦後∴繧九h縺縺ォ縺吶k縺ィ蜈ア縺ォ
+ // 縲驕ク譖イ逕サ髱「逕ィ縺ォ莠檎ィョ縺ョ諠蝣ア繧貞玄蛻・縺励↑縺隱ュ縺ソ蜃コ縺玲婿豕輔b謠蝉セ帙☆繧(GetCurrent...)
+
+ private object lockBoxDefSkin;
+ public static bool bUseBoxDefSkin = true; // box.def縺九i縺ョ繧ケ繧ュ繝ウ螟画峩繧定ィア螳ケ縺吶k縺句凄縺
+
+ public string strSystemSkinRoot = null;
+ public string[] strSystemSkinSubfolders = null; // List縺縺ィignoreCase縺ェ讀懃エ「縺碁擇蛟偵↑縺ョ縺ァ縲驟榊励↓騾縺偵k :-)
+ private string[] _strBoxDefSkinSubfolders = null;
+ public string[] strBoxDefSkinSubfolders
+ {
+ get
+ {
+ lock (lockBoxDefSkin)
+ {
+ return _strBoxDefSkinSubfolders;
+ }
+ }
+ set
+ {
+ lock (lockBoxDefSkin)
+ {
+ _strBoxDefSkinSubfolders = value;
+ }
+ }
+ } // 蛻・繧ケ繝ャ繝繝峨°繧峨b譖ク縺崎セシ縺ソ繧「繧ッ繧サ繧ケ縺輔l繧九◆繧√√せ繝ャ繝繝峨そ繝シ繝輔↑繧「繧ッ繧サ繧ケ豕輔r謠蝉セ
+
+ private static string strSystemSkinSubfolderFullName; // Config逕サ髱「縺ァ險ュ螳壹&繧後◆繧ケ繧ュ繝ウ
+ private static string strBoxDefSkinSubfolderFullName = ""; // box.def縺ァ謖螳壹&繧後※縺繧九せ繧ュ繝ウ
+
+ ///
+ /// 繧ケ繧ュ繝ウ繝代せ蜷阪r繝輔Ν繝代せ縺ァ蜿門セ励☆繧
+ ///
+ /// 繝ヲ繝シ繧カ繝シ險ュ螳夂畑縺ェ繧液rue, box.def縺九i縺ョ險ュ螳壹↑繧映alse
+ ///
+ public string GetCurrentSkinSubfolderFullName(bool bFromUserConfig)
+ {
+ if (!bUseBoxDefSkin || bFromUserConfig == true || strBoxDefSkinSubfolderFullName == "")
+ {
+ return strSystemSkinSubfolderFullName;
+ }
+ else
+ {
+ return strBoxDefSkinSubfolderFullName;
+ }
+ }
+ ///
+ /// 繧ケ繧ュ繝ウ繝代せ蜷阪r繝輔Ν繝代せ縺ァ險ュ螳壹☆繧
+ ///
+ /// 繧ケ繧ュ繝ウ繝代せ蜷
+ /// 繝ヲ繝シ繧カ繝シ險ュ螳夂畑縺ェ繧液rue, box.def縺九i縺ョ險ュ螳壹↑繧映alse
+ public void SetCurrentSkinSubfolderFullName(string value, bool bFromUserConfig)
+ {
+ if (bFromUserConfig)
+ {
+ strSystemSkinSubfolderFullName = value;
+ }
+ else
+ {
+ strBoxDefSkinSubfolderFullName = value;
+ }
+ }
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+ public CSkin(string _strSkinSubfolderFullName, bool _bUseBoxDefSkin)
+ {
+ lockBoxDefSkin = new object();
+ strSystemSkinSubfolderFullName = _strSkinSubfolderFullName;
+ bUseBoxDefSkin = _bUseBoxDefSkin;
+ InitializeSkinPathRoot();
+ ReloadSkinPaths();
+ PrepareReloadSkin();
+ }
+ public CSkin()
+ {
+ lockBoxDefSkin = new object();
+ InitializeSkinPathRoot();
+ bUseBoxDefSkin = true;
+ ReloadSkinPaths();
+ PrepareReloadSkin();
+ }
+ private string InitializeSkinPathRoot()
+ {
+ strSystemSkinRoot = System.IO.Path.Combine(TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" + System.IO.Path.DirectorySeparatorChar);
+ return strSystemSkinRoot;
+ }
+
+ ///
+ /// Skin(Sounds)繧貞崎ェュ霎シ縺吶k貅門y繧偵☆繧(蜀咲函蛛懈ュ「,Dispose,繝輔ぃ繧、繝ォ蜷榊崎ィュ螳)縲
+ /// 縺ゅi縺九§繧《trSkinSubfolder繧帝←蛻縺ォ險ュ螳壹@縺ヲ縺翫¥縺薙→縲
+ /// 縺昴ョ蠕後ヽeloadSkinPaths()繧貞ョ溯。後@縲《trSkinSubfolder縺ョ豁」蠖捺ァ繧堤「コ隱阪@縺滉ク翫〒縲∵悽繝。繧ス繝繝峨r蜻シ縺ウ蜃コ縺吶%縺ィ縲
+ /// 譛ャ繝。繧ス繝繝牙他縺ウ蜃コ縺怜セ後↓縲ヽeloadSkin()繧貞ョ溯。後☆繧九%縺ィ縺ァ縲√す繧ケ繝繝繧オ繧ヲ繝ウ繝峨r隱ュ縺ソ霎シ縺ソ逶エ縺吶
+ /// ReloadSkin()縺ョ蜀螳ケ縺ッ譛ャ繝。繧ス繝繝牙縺ォ蜷ォ繧√↑縺縺薙→縲りオキ蜍墓凾縺ッReloadSkin()逶ク蠖薙ョ蜃ヲ逅繧辰EnumSongs縺ァ陦後▲縺ヲ縺繧九◆繧√
+ ///
+ public void PrepareReloadSkin()
+ {
+ Trace.TraceInformation("SkinPath險ュ螳: {0}",
+ (strBoxDefSkinSubfolderFullName == "") ?
+ strSystemSkinSubfolderFullName :
+ strBoxDefSkinSubfolderFullName
+ );
+
+ for (int i = 0; i < n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++)
+ {
+ if (this[i] != null && this[i].b隱ュ縺ソ霎シ縺ソ謌仙粥)
+ {
+ this[i].t蛛懈ュ「縺吶k();
+ this[i].Dispose();
+ }
+ }
+
+ this.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Move.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.sound豎コ螳夐浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Decide.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.sound螟画峩髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Change.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.sound蜿匁カ磯浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Cancel.ogg", false, false, true, ESoundGroup.SoundEffect);
+ this.sound豁灘」ー髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Audience.ogg", false, false, true, ESoundGroup.SoundEffect);
+ this.soundSTAGEFAILED髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Stage failed.ogg", false, true, true, ESoundGroup.Voice);
+ this.sound繧イ繝シ繝髢句ァ矩浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Game start.ogg", false, false, false, ESoundGroup.Voice);
+ this.sound繧イ繝シ繝邨ゆコ髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Game end.ogg", false, true, false, ESoundGroup.Voice);
+ this.sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Stage clear.ogg", false, true, true, ESoundGroup.Voice);
+ this.sound繝輔Ν繧ウ繝ウ繝憺浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Full combo.ogg", false, false, true, ESoundGroup.Voice);
+ this.sound譖イ隱ュ霎シ髢句ァ矩浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Now loading.ogg", false, true, true, ESoundGroup.Unknown);
+ this.bgm襍キ蜍慕判髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Setup BGM.ogg", true, true, false, ESoundGroup.SongPlayback);
+ this.bgm繧ェ繝励す繝ァ繝ウ逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Option BGM.ogg", true, true, false, ESoundGroup.SongPlayback);
+ this.bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Config BGM.ogg", true, true, false, ESoundGroup.SongPlayback);
+ this.bgm驕ク譖イ逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Select BGM.ogg", true, true, false, ESoundGroup.SongPlayback);
+ this.soundSongSelectChara = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\SongSelect Chara.ogg", false, false, false, ESoundGroup.SongPlayback);
+ this.soundSkip = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Skip.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.SoundBanapas = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Banapas.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundEntry = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Entry.ogg", true, false, false, ESoundGroup.Voice);
+ this.soundError = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Error.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundsanka = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\sanka.ogg", false, false, false, ESoundGroup.Voice);
+
+ //this.soundRed = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝( @"Sounds\dong.ogg", false, false, true, ESoundType.SoundEffect );
+ //this.soundBlue = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝( @"Sounds\ka.ogg", false, false, true, ESoundType.SoundEffect );
+ this.soundBalloon = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\balloon.ogg", false, false, true, ESoundGroup.SoundEffect);
+ this.sound譖イ豎コ螳夐浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\SongDecide.ogg", false, false, true, ESoundGroup.Voice);
+
+ this.bgm繧ソ繧、繝医Ν繧、繝ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Title_Start.ogg", false, false, true, ESoundGroup.SongPlayback);
+ this.bgm繧ソ繧、繝医Ν = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Title.ogg", true, false, true, ESoundGroup.SongPlayback);
+ this.bgm驕ク譖イ逕サ髱「繧、繝ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\SongSelect_Start.ogg", false, false, true, ESoundGroup.SongPlayback);
+ this.bgm驕ク譖イ逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\SongSelect.ogg", true, false, true, ESoundGroup.SongPlayback);
+ this.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Result_In.ogg", false, false, true, ESoundGroup.SongPlayback);
+ this.bgm繝ェ繧カ繝ォ繝磯浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Result.ogg", true, false, true, ESoundGroup.SongPlayback);
+
+
+ this.soundCrownIn = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\CrownIn.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundRankIn = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\RankIn.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundDonClear = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\Donchan_Clear.ogg", false, false,true, ESoundGroup.Voice);
+ this.soundDonFailed = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\Donchan_Miss.ogg", false, false, true, ESoundGroup.Voice);
+
+ this.soundSelectAnnounce = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\DiffSelect.ogg", false, false, true, ESoundGroup.Voice);
+ this.sound迚ケ險灘咲函髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Resume.ogg", false, false,false, ESoundGroup.SoundEffect);
+ this.sound迚ケ險灘●豁「髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Pause.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Scroll.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Jump Point.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.sound迚ケ險薙せ繧ュ繝繝鈴浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Traning Skip.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundPon = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Pon.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundGauge = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Gauge.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundScoreDon = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ScoreDon.ogg", false, false, false, ESoundGroup.SoundEffect);
+ this.soundChallengeVoice = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\ChallengeVoice.wav", false, false, false, ESoundGroup.SoundEffect);
+ this.soundDanSelectStart = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSelectStart.wav", false, false, false, ESoundGroup.SoundEffect);
+ this.soundDanSongSelectCheck = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSongSelectCheck.wav", false, false, false, ESoundGroup.SoundEffect);
+ this.soundDanSelectBGM = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSelectBGM.wav", true, false, false, ESoundGroup.SongPlayback);
+ this.soundDanSongSelect = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSongSelect.wav", false, false, false, ESoundGroup.SoundEffect);
+ ReloadSkin();
+ tReadSkinConfig();
+ }
+
+ public void ReloadSkin()
+ {
+ for (int i = 0; i < n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++)
+ {
+ if (!this[i].b謗剃サ) // BGM邉サ莉・螟悶ョ縺ソ隱ュ縺ソ霎シ繧縲(BGM邉サ縺ッ蠢隕√↓縺ェ縺」縺溘→縺阪↓隱ュ縺ソ霎シ繧)
+ {
+ C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = this[i];
+ if (!TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 || c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.bCompact蟇セ雎。)
+ {
+ try
+ {
+ c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.t隱ュ縺ソ霎シ縺ソ();
+ Trace.TraceInformation("繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r隱ュ縺ソ霎シ縺ソ縺セ縺励◆縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷);
+ }
+ catch (FileNotFoundException e)
+ {
+ Trace.TraceWarning(e.ToString());
+ Trace.TraceWarning("繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨′蟄伜惠縺励∪縺帙s縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷);
+ }
+ catch (Exception e)
+ {
+ Trace.TraceWarning(e.ToString());
+ Trace.TraceWarning("繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷);
+ }
+ }
+ }
+ }
+ }
+
+
+ ///
+ /// Skin縺ョ荳隕ァ繧貞榊叙蠕励☆繧九
+ /// System/*****/Graphics (繧Тounds/) 縺ィ縺縺繝輔か繝ォ繝讒区舌r諠ウ螳壹@縺ヲ縺繧九
+ /// 繧ゅ@蜀榊叙蠕励ョ邨先棡縲∫樟蝨ィ菴ソ逕ィ荳ュ縺ョSkin縺ョ繝代せ(strSystemSkinSubfloderFullName)縺梧カ医∴縺ヲ縺縺溷エ蜷医ッ縲
+ /// 莉・荳九ョ蜆ェ蜈磯菴阪〒蟄伜惠遒コ隱阪ョ荳郭trSystemSkinSubfolderFullName繧貞崎ィュ螳壹☆繧九
+ /// 1. System/Default/
+ /// 2. System/*****/ 縺ァ譛蛻昴↓enumerate縺輔l縺溘b縺ョ
+ /// 3. System/ (蠕捺擂莠呈鋤)
+ ///
+ public void ReloadSkinPaths()
+ {
+ #region [ 縺セ縺 System/*** 繧弾numerate縺吶k ]
+ string[] tempSkinSubfolders = System.IO.Directory.GetDirectories(strSystemSkinRoot, "*");
+ strSystemSkinSubfolders = new string[tempSkinSubfolders.Length];
+ int size = 0;
+ for (int i = 0; i < tempSkinSubfolders.Length; i++)
+ {
+ #region [ 讀懷コ縺励◆繝輔か繝ォ繝縺後せ繧ュ繝ウ繝輔か繝ォ繝縺九←縺縺狗「コ隱阪☆繧犠
+ if (!bIsValid(tempSkinSubfolders[i]))
+ continue;
+ #endregion
+ #region [ 繧ケ繧ュ繝ウ繝輔か繝ォ繝縺ィ遒コ隱阪〒縺阪◆繧ゅョ繧偵《trSkinSubfolders縺ォ蜈・繧後k ]
+ // 繝輔か繝ォ繝蜷肴忰蟆セ縺ォ蠢縺喀繧偵▽縺代※縺翫¥縺薙→縲ゅ&繧ゅ↑縺縺ィConfig隱ュ縺ソ蜃コ縺怜エ(蠢縺喀繧偵▽縺代k)縺ィ繝槭ャ繝√〒縺阪↑縺
+ if (tempSkinSubfolders[i][tempSkinSubfolders[i].Length - 1] != System.IO.Path.DirectorySeparatorChar)
+ {
+ tempSkinSubfolders[i] += System.IO.Path.DirectorySeparatorChar;
+ }
+ strSystemSkinSubfolders[size] = tempSkinSubfolders[i];
+ Trace.TraceInformation("SkinPath讀懷コ: {0}", strSystemSkinSubfolders[size]);
+ size++;
+ #endregion
+ }
+ Trace.TraceInformation("SkinPath蜈・蜉: {0}", strSystemSkinSubfolderFullName);
+ Array.Resize(ref strSystemSkinSubfolders, size);
+ Array.Sort(strSystemSkinSubfolders); // BinarySearch螳溯。悟燕縺ォSort縺悟ソ隕
+ #endregion
+
+ #region [ 迴セ蝨ィ縺ョSkin繝代せ縺恵ox.def繧ケ繧ュ繝ウ繧辰ONFIG謖螳壹@縺ヲ縺縺溷エ蜷医ョ縺溘a縺ォ縲∵怙蛻昴↓縺薙l縺梧怏蜉ケ縺九メ繧ァ繝繧ッ縺吶k縲よ怏蜉ケ縺ェ繧峨%繧後r菴ソ縺縲 ]
+ if (bIsValid(strSystemSkinSubfolderFullName) &&
+ Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName,
+ StringComparer.InvariantCultureIgnoreCase) < 0)
+ {
+ strBoxDefSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName };
+ return;
+ }
+ #endregion
+
+ #region [ 谺。縺ォ縲∫樟蝨ィ縺ョSkin繝代せ縺悟ュ伜惠縺吶k縺玖ェソ縺ケ繧九ゅ≠繧後ー邨ゆコ縲]
+ if (Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName,
+ StringComparer.InvariantCultureIgnoreCase) >= 0)
+ return;
+ #endregion
+ #region [ 繧ォ繝ャ繝ウ繝医ョSkin繝代せ縺梧カ域サ縺励※縺繧九ョ縺ァ縲∽サ・荳九〒蜀崎ィュ螳壹☆繧九]
+ /// 莉・荳九ョ蜆ェ蜈磯菴阪〒迴セ蝨ィ菴ソ逕ィ荳ュ縺ョSkin繝代せ繧貞崎ィュ螳壹☆繧九
+ /// 1. System/Default/
+ /// 2. System/*****/ 縺ァ譛蛻昴↓enumerate縺輔l縺溘b縺ョ
+ /// 3. System/ (蠕捺擂莠呈鋤)
+ #region [ System/Default/ 縺後≠繧九↑繧峨√◎縺薙↓繧ォ繝ャ繝ウ繝Skin繝代せ繧定ィュ螳壹☆繧犠
+ string tempSkinPath_default = System.IO.Path.Combine(strSystemSkinRoot, "Default" + System.IO.Path.DirectorySeparatorChar);
+ if (Array.BinarySearch(strSystemSkinSubfolders, tempSkinPath_default,
+ StringComparer.InvariantCultureIgnoreCase) >= 0)
+ {
+ strSystemSkinSubfolderFullName = tempSkinPath_default;
+ return;
+ }
+ #endregion
+ #region [ System/SkinFiles.*****/ 縺ァ譛蛻昴↓enumerate縺輔l縺溘b縺ョ繧偵√き繝ャ繝ウ繝Skin繝代せ縺ォ蜀崎ィュ螳壹☆繧 ]
+ if (strSystemSkinSubfolders.Length > 0)
+ {
+ strSystemSkinSubfolderFullName = strSystemSkinSubfolders[0];
+ return;
+ }
+ #endregion
+ #region [ System/ 縺ォ縲√き繝ャ繝ウ繝Skin繝代せ繧貞崎ィュ螳壹☆繧九]
+ strSystemSkinSubfolderFullName = strSystemSkinRoot;
+ strSystemSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName };
+ #endregion
+ #endregion
+ }
+
+ // 繝。繧ス繝繝
+
+ public static string Path(string str繝輔ぃ繧、繝ォ縺ョ逶ク蟇セ繝代せ)
+ {
+ if (strBoxDefSkinSubfolderFullName == "" || !bUseBoxDefSkin)
+ {
+ return System.IO.Path.Combine(strSystemSkinSubfolderFullName, str繝輔ぃ繧、繝ォ縺ョ逶ク蟇セ繝代せ);
+ }
+ else
+ {
+ return System.IO.Path.Combine(strBoxDefSkinSubfolderFullName, str繝輔ぃ繧、繝ォ縺ョ逶ク蟇セ繝代せ);
+ }
+ }
+
+ ///
+ /// 繝輔Ν繝代せ蜷阪r荳弱∴繧九→縲√せ繧ュ繝ウ蜷阪→縺励※縲√ョ繧」繝ャ繧ッ繝医Μ蜷肴忰蟆セ縺ョ隕∫エ繧定ソ斐☆
+ /// 萓: C:\foo\bar\ 縺ェ繧峨|ar繧定ソ斐☆
+ ///
+ /// 繧ケ繧ュ繝ウ縺梧シ邏阪&繧後◆繝代せ蜷(繝輔Ν繝代せ)
+ /// 繧ケ繧ュ繝ウ蜷
+ public static string GetSkinName(string skinPathFullName)
+ {
+ if (skinPathFullName != null)
+ {
+ if (skinPathFullName == "") // 縲恵ox.def縺ァ譛ェ螳夂セゥ縲咲畑
+ skinPathFullName = strSystemSkinSubfolderFullName;
+ string[] tmp = skinPathFullName.Split(System.IO.Path.DirectorySeparatorChar);
+ return tmp[tmp.Length - 2]; // 繝繧」繝ャ繧ッ繝医Μ蜷阪ョ譛蠕後°繧2逡ェ逶ョ縺ョ隕∫エ縺後せ繧ュ繝ウ蜷(譛蠕後ョ隕∫エ縺ッnull縲ょピtring縺ョ譛ォ蟆セ縺圭縺ェ縺ョ縺ァ縲)
+ }
+ return null;
+ }
+ public static string[] GetSkinName(string[] skinPathFullNames)
+ {
+ string[] ret = new string[skinPathFullNames.Length];
+ for (int i = 0; i < skinPathFullNames.Length; i++)
+ {
+ ret[i] = GetSkinName(skinPathFullNames[i]);
+ }
+ return ret;
+ }
+
+
+ public string GetSkinSubfolderFullNameFromSkinName(string skinName)
+ {
+ foreach (string s in strSystemSkinSubfolders)
+ {
+ if (GetSkinName(s) == skinName)
+ return s;
+ }
+ foreach (string b in strBoxDefSkinSubfolders)
+ {
+ if (GetSkinName(b) == skinName)
+ return b;
+ }
+ return null;
+ }
+
+ ///
+ /// 繧ケ繧ュ繝ウ繝代せ蜷阪′螯・蠖薙°縺ゥ縺縺
+ /// (繧ソ繧、繝医Ν逕サ蜒上↓繧「繧ッ繧サ繧ケ縺ァ縺阪k縺九←縺縺九〒蛻、螳壹☆繧)
+ ///
+ /// 螯・蠖捺ァ繧堤「コ隱阪☆繧九せ繧ュ繝ウ繝代せ(繝輔Ν繝代せ)
+ /// 螯・蠖薙↑繧液rue
+ public bool bIsValid(string skinPathFullName)
+ {
+ string filePathTitle;
+ filePathTitle = System.IO.Path.Combine(skinPathFullName, @"Graphics\1_Title\Background.png");
+ return (File.Exists(filePathTitle));
+ }
+
+
+ public void tRemoveMixerAll()
+ {
+ for (int i = 0; i < n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++)
+ {
+ if (this[i] != null && this[i].b隱ュ縺ソ霎シ縺ソ謌仙粥)
+ {
+ this[i].t蛛懈ュ「縺吶k();
+ this[i].tRemoveMixer();
+ }
+ }
+
+ }
+
+ ///
+ /// 螟画焚縺ョ蛻晄悄蛹
+ ///
+ public void tSkinConfigInit()
+ {
+ this.eDiffDispMode = E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝.mtaiko縺ォ逕サ蜒上〒陦ィ遉コ;
+ this.b迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク謨ー繧定。ィ遉コ縺励↑縺 = false;
+ }
+
+ public void tReadSkinConfig()
+ {
+ var str = "";
+ LoadSkinConfigFromFile(Path(@"SkinConfig.ini"), ref str);
+ this.t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ(str);
+
+ void LoadSkinConfigFromFile(string path, ref string work)
+ {
+ if (!File.Exists(Path(path))) return;
+ using (var streamReader = new StreamReader(Path(path), Encoding.GetEncoding("Shift_JIS")))
+ {
+ while (streamReader.Peek() > -1) // 荳陦後★縺、隱ュ縺ソ霎シ繧縲
+ {
+ var nowLine = streamReader.ReadLine();
+ if (nowLine.StartsWith("#include"))
+ {
+ // #include hogehoge.ini縺ォ縺カ縺。蠖薙◆縺」縺
+ var includePath = nowLine.Substring("#include ".Length).Trim();
+ LoadSkinConfigFromFile(includePath, ref work); // 蜀榊クー逧縺ォ隱ュ縺ソ霎シ繧
+ }
+ else
+ {
+ work += nowLine + Environment.NewLine;
+ }
+ }
+ }
+ }
+ }
+
+ private void t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ(string strAllSettings) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier.
+ {
+ string[] delimiter = { "\n" };
+ string[] strSingleLine = strAllSettings.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
+ foreach (string s in strSingleLine)
+ {
+ string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' });
+ if ((str.Length != 0) && (str[0] != ';'))
+ {
+ try
+ {
+ string strCommand;
+ string strParam;
+ string[] strArray = str.Split(new char[] { '=' });
+ if (strArray.Length == 2)
+ {
+ strCommand = strArray[0].Trim();
+ strParam = strArray[1].Trim();
+
+ #region 繧ケ繧ュ繝ウ險ュ螳
+
+ void ParseInt32(Action setValue)
+ {
+ if (int.TryParse(strParam, out var unparsedValue))
+ {
+ setValue(unparsedValue);
+ }
+ else
+ {
+ Trace.TraceWarning($"SkinConfig縺ョ蛟、 {strCommand} 縺ッ謨エ謨ー蛟、縺ァ縺ゅk蠢隕√′縺ゅj縺セ縺吶ら樟蝨ィ縺ョ蛟、: {strParam}");
+ }
+ }
+
+ if (strCommand == "Name")
+ {
+ this.Skin_Name = strParam;
+ }
+ else if (strCommand == "Version")
+ {
+ this.Skin_Version = strParam;
+ }
+ else if (strCommand == "Creator")
+ {
+ this.Skin_Creator = strParam;
+ }
+ #endregion
+
+ #region 閭梧勹(繧ケ繧ッ繝ュ繝シ繝ォ)
+ else if (strCommand == "Background_Scroll_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Background_Scroll_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ #endregion
+
+ #region[ 貍泌・ ]
+ //-----------------------------
+ else if (strCommand == "ScrollFieldP1Y")
+ {
+ this.nScrollFieldY[0] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 192);
+ }
+ else if (strCommand == "ScrollFieldP2Y")
+ {
+ this.nScrollFieldY[1] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 192);
+ }
+ else if (strCommand == "SENotesP1Y")
+ {
+ this.nSENotesY[0] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nSENotesY[0]);
+ }
+ else if (strCommand == "SENotesP2Y")
+ {
+ this.nSENotesY[1] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nSENotesY[1]);
+ }
+ else if (strCommand == "JudgePointP1Y")
+ {
+ this.nJudgePointY[0] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nJudgePointY[0]);
+ }
+ else if (strCommand == "JudgePointP2Y")
+ {
+ this.nJudgePointY[1] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nJudgePointY[1]);
+ }
+
+ else if (strCommand == "DiffDispMode")
+ {
+ this.eDiffDispMode = (E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝)C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(strParam, 0, 2, (int)this.eDiffDispMode);
+ }
+ else if (strCommand == "NowStageDisp")
+ {
+ this.b迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク謨ー繧定。ィ遉コ縺励↑縺 = C螟画鋤.bONorOFF(strParam[0]);
+ }
+
+ //-----------------------------
+ #endregion
+ #region[ 謌千クセ逋コ陦ィ ]
+ //-----------------------------
+ else if (strCommand == "ResultPanelP1X")
+ {
+ this.nResultPanelP1X = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 515);
+ }
+ else if (strCommand == "ResultPanelP1Y")
+ {
+ this.nResultPanelP1Y = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 75);
+ }
+ else if (strCommand == "ResultPanelP2X")
+ {
+ this.nResultPanelP2X = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 515);
+ }
+ else if (strCommand == "ResultPanelP2Y")
+ {
+ this.nResultPanelP2Y = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 75);
+ }
+ else if (strCommand == "ResultScoreP1X")
+ {
+ this.nResultScoreP1X = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 582);
+ }
+ else if (strCommand == "ResultScoreP1Y")
+ {
+ this.nResultScoreP1Y = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 252);
+ }
+ //-----------------------------
+ #endregion
+ #region[ 縺昴ョ莉 ]
+ #endregion
+
+ #region 譁ー繝サSkinConfig
+ #region Config
+ else if (strCommand == nameof(Config_ItemText_Correction_X))
+ {
+ Config_ItemText_Correction_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Config_ItemText_Correction_Y))
+ {
+ Config_ItemText_Correction_Y = int.Parse(strParam);
+ }
+ #endregion
+ #region SongSelect
+ else if (strCommand == "SongSelect_Overall_Y")
+ {
+ if (int.Parse(strParam) != 0)
+ {
+ SongSelect_Overall_Y = int.Parse(strParam);
+ }
+ }
+ else if (strCommand == "SongSelect_BoxExplanation_X")
+ {
+ SongSelect_BoxExplanation_X = int.Parse(strParam);
+ }
+ else if (strCommand == "SongSelect_BoxExplanation_Y")
+ {
+ SongSelect_BoxExplanation_Y = int.Parse(strParam);
+ }
+ else if (strCommand == "SongSelect_Title_X")
+ {
+ SongSelect_Title_X = int.Parse(strParam);
+ }
+ else if (strCommand == "SongSelect_Title_Y")
+ {
+ SongSelect_Title_Y = int.Parse(strParam);
+ }
+ else if (strCommand == "SongSelect_BoxExplanation_Interval")
+ {
+ SongSelect_BoxExplanation_Interval = int.Parse(strParam);
+ }
+ else if (strCommand == "SongSelect_GenreName")
+ {
+ SongSelect_GenreName = this.strString繧帝榊励↓逶エ縺(strParam);
+ }
+ else if (strCommand == "SongSelect_NamePlate_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ SongSelect_NamePlate_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "SongSelect_NamePlate_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ SongSelect_NamePlate_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "SongSelect_Auto_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ SongSelect_Auto_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "SongSelect_Auto_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ SongSelect_Auto_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "SongSelect_ForeColor_JPOP")
+ {
+ SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_ForeColor_Anime")
+ {
+ SongSelect_ForeColor_Anime = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_ForeColor_VOCALOID")
+ {
+ SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_ForeColor_Children")
+ {
+ SongSelect_ForeColor_Children = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_ForeColor_Variety")
+ {
+ SongSelect_ForeColor_Variety = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_ForeColor_Classic")
+ {
+ SongSelect_ForeColor_Classic = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_ForeColor_GameMusic")
+ {
+ SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(SongSelect_ForeColor_Namco))
+ {
+ SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_BackColor_JPOP")
+ {
+ SongSelect_BackColor_JPOP = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_BackColor_Anime")
+ {
+ SongSelect_BackColor_Anime = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_BackColor_VOCALOID")
+ {
+ SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_BackColor_Children")
+ {
+ SongSelect_BackColor_Children = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_BackColor_Variety")
+ {
+ SongSelect_BackColor_Variety = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_BackColor_Classic")
+ {
+ SongSelect_BackColor_Classic = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == "SongSelect_BackColor_GameMusic")
+ {
+ SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(SongSelect_BackColor_Namco))
+ {
+ SongSelect_BackColor_Namco = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(SongSelect_CorrectionX_Chara))
+ {
+ SongSelect_CorrectionX_Chara = strParam.Split(',').ToArray();
+ }
+ else if (strCommand == nameof(SongSelect_CorrectionY_Chara))
+ {
+ SongSelect_CorrectionY_Chara = strParam.Split(',').ToArray();
+ }
+ else if (strCommand == nameof(SongSelect_CorrectionX_Chara_Value))
+ {
+ SongSelect_CorrectionX_Chara_Value = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongSelect_CorrectionY_Chara_Value))
+ {
+ SongSelect_CorrectionY_Chara_Value = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongSelect_Rotate_Chara))
+ {
+ SongSelect_Rotate_Chara = strParam.Split(',').ToArray();
+ }
+ #endregion
+ #region SongLoading
+ else if (strCommand == nameof(SongLoading_Plate_X))
+ {
+ SongLoading_Plate_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Plate_Y))
+ {
+ SongLoading_Plate_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Title_X))
+ {
+ SongLoading_Title_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Title_Y))
+ {
+ SongLoading_Title_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_SubTitle_X))
+ {
+ SongLoading_SubTitle_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_SubTitle_Y))
+ {
+ SongLoading_SubTitle_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Title_FontSize))
+ {
+ if (int.Parse(strParam) > 0)
+ SongLoading_Title_FontSize = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_SubTitle_FontSize))
+ {
+ if (int.Parse(strParam) > 0)
+ SongLoading_SubTitle_FontSize = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Plate_ReferencePoint))
+ {
+ SongLoading_Plate_ReferencePoint = (ReferencePoint)int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Title_ReferencePoint))
+ {
+ SongLoading_Title_ReferencePoint = (ReferencePoint)int.Parse(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_SubTitle_ReferencePoint))
+ {
+ SongLoading_SubTitle_ReferencePoint = (ReferencePoint)int.Parse(strParam);
+ }
+
+ else if (strCommand == nameof(SongLoading_Title_ForeColor))
+ {
+ SongLoading_Title_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Title_BackColor))
+ {
+ SongLoading_Title_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_SubTitle_ForeColor))
+ {
+ SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_SubTitle_BackColor))
+ {
+ SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(SongLoading_Plate_ScreenBlend))
+ {
+ SongLoading_Plate_ScreenBlend = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ #endregion
+ #region Game
+ else if (strCommand == "Game_Notes_Anime")
+ {
+ Game_Notes_Anime = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == "Game_StageText")
+ {
+ Game_StageText = strParam;
+ }
+ else if (strCommand == nameof(Game_RollColorMode))
+ {
+ Game_RollColorMode = (RollColorMode)int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_JudgeFrame_AddBlend))
+ {
+ Game_JudgeFrame_AddBlend = C螟画鋤.bONorOFF(strParam[0]);
+ }
+
+ #region CourseSymbol
+ else if (strCommand == "Game_CourseSymbol_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_CourseSymbol_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_CourseSymbol_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_CourseSymbol_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ #endregion
+ #region PanelFont
+ else if (strCommand == nameof(Game_MusicName_X))
+ {
+ Game_MusicName_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_MusicName_Y))
+ {
+ Game_MusicName_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_MusicName_FontSize))
+ {
+ if (int.Parse(strParam) > 0)
+ Game_MusicName_FontSize = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_MusicName_ReferencePoint))
+ {
+ Game_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Genre_X))
+ {
+ Game_Genre_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Genre_Y))
+ {
+ Game_Genre_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Lyric_X))
+ {
+ Game_Lyric_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Lyric_Y))
+ {
+ Game_Lyric_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Lyric_FontName))
+ {
+ Game_Lyric_FontName = strParam;
+ }
+ else if (strCommand == nameof(Game_Lyric_FontSize))
+ {
+ if (int.Parse(strParam) > 0)
+ Game_Lyric_FontSize = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Lyric_ReferencePoint))
+ {
+ Game_Lyric_ReferencePoint = (ReferencePoint)int.Parse(strParam);
+ }
+
+ else if (strCommand == nameof(Game_MusicName_ForeColor))
+ {
+ Game_MusicName_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_StageText_ForeColor))
+ {
+ Game_StageText_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_Lyric_ForeColor))
+ {
+ Game_Lyric_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_MusicName_BackColor))
+ {
+ Game_MusicName_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_StageText_BackColor))
+ {
+ Game_StageText_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_Lyric_BackColor))
+ {
+ Game_Lyric_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ #endregion
+ #region Chara
+ else if (strCommand == "Game_Chara_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Chara_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Chara_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Chara_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Chara_Balloon_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Chara_Balloon_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Chara_Balloon_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Chara_Balloon_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == nameof(Game_Chara_Balloon_Timer))
+ {
+ if (int.Parse(strParam) > 0)
+ Game_Chara_Balloon_Timer = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Chara_Balloon_Delay))
+ {
+ if (int.Parse(strParam) > 0)
+ Game_Chara_Balloon_Delay = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Chara_Balloon_FadeOut))
+ {
+ if (int.Parse(strParam) > 0)
+ Game_Chara_Balloon_FadeOut = int.Parse(strParam);
+ }
+ // 繝代ち繝シ繝ウ謨ー縺ョ險ュ螳壹ッTextureLoader.cs縺ァ蜿肴丐縺輔l縺セ縺吶
+ else if (strCommand == "Game_Chara_Motion_Normal")
+ {
+ Game_Chara_Motion_Normal = strParam;
+ }
+ else if (strCommand == "Game_Chara_Motion_Clear")
+ {
+ Game_Chara_Motion_Clear = strParam;
+ }
+ else if (strCommand == "Game_Chara_Motion_GoGo")
+ {
+ Game_Chara_Motion_GoGo = strParam;
+ }
+ else if (strCommand == "Game_Chara_Beat_Normal")
+ {
+ ParseInt32(value => Game_Chara_Beat_Normal = value);
+ }
+ else if (strCommand == "Game_Chara_Beat_Clear")
+ {
+ ParseInt32(value => Game_Chara_Beat_Clear = value);
+ }
+ else if (strCommand == "Game_Chara_Beat_GoGo")
+ {
+ ParseInt32(value => Game_Chara_Beat_GoGo = value);
+ }
+ #endregion
+ #region Dancer
+ else if (strCommand == "Game_Dancer_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 5; i++)
+ {
+ Game_Dancer_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Dancer_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 5; i++)
+ {
+ Game_Dancer_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Dancer_Motion")
+ {
+ Game_Dancer_Motion = strParam;
+ }
+ // Game_Dancer_Ptn縺ッTextrueLoader.cs縺ァ蜿肴丐縺輔l縺セ縺吶
+ else if (strCommand == "Game_Dancer_Beat")
+ {
+ ParseInt32(value => Game_Dancer_Beat = value);
+ }
+ else if (strCommand == "Game_Dancer_Gauge")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 5; i++)
+ {
+ Game_Dancer_Gauge[i] = int.Parse(strSplit[i]);
+ }
+ }
+ #endregion
+ #region Mob
+ else if (strCommand == "Game_Mob_Beat")
+ {
+ ParseInt32(value => Game_Mob_Beat = value);
+ }
+ else if (strCommand == "Game_Mob_Ptn_Beat")
+ {
+ ParseInt32(value => Game_Mob_Ptn_Beat = value);
+ }
+ #endregion
+ #region Score
+ else if (strCommand == "Game_Score_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Score_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Score_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Score_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Score_Add_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Score_Add_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Score_Add_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Score_Add_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Score_AddBonus_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Score_AddBonus_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Score_AddBonus_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Score_AddBonus_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+
+ else if (strCommand == "Game_Score_Padding")
+ {
+ ParseInt32(value => Game_Score_Padding = value);
+ }
+ else if (strCommand == "Game_Score_Size")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Score_Size[i] = int.Parse(strSplit[i]);
+ }
+ }
+ #endregion
+ #region Taiko
+ else if (strCommand == "Game_Taiko_NamePlate_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_NamePlate_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_NamePlate_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_NamePlate_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+
+ else if (strCommand == "Game_Taiko_PlayerNumber_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_PlayerNumber_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+
+ else if (strCommand == "Game_Taiko_PlayerNumber_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_PlayerNumber_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+
+ else if (strCommand == "Game_Taiko_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Ex_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Ex_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Ex_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Ex_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Ex4_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Ex4_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Ex4_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Ex4_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Padding")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 3; i++)
+ {
+ Game_Taiko_Combo_Padding[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Size")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Size[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Size_Ex")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Size_Ex[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Scale")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 3; i++)
+ {
+ Game_Taiko_Combo_Scale[i] = float.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Text_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Text_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Text_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Text_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Taiko_Combo_Text_Size")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Taiko_Combo_Text_Size[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == nameof(Game_Taiko_Combo_Ex_IsJumping))
+ {
+ Game_Taiko_Combo_Ex_IsJumping = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ #endregion
+ #region Gauge
+ else if (strCommand == "Game_Gauge_Rainbow_Timer")
+ {
+ if (int.Parse(strParam) != 0)
+ {
+ Game_Gauge_Rainbow_Timer = int.Parse(strParam);
+ }
+ }
+ #endregion
+ #region Balloon
+ else if (strCommand == "Game_Balloon_Combo_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Number_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Number_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Number_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Number_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Number_Ex_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Number_Ex_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Number_Ex_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Number_Ex_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Text_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Text_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Text_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Text_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Text_Ex_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Text_Ex_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Combo_Text_Ex_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Combo_Text_Ex_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+
+
+ else if (strCommand == "Game_Balloon_Balloon_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Balloon_Balloon_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Balloon_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Balloon_Balloon_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Balloon_Frame_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Balloon_Balloon_Frame_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Balloon_Frame_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Balloon_Balloon_Frame_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Balloon_Number_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Balloon_Balloon_Number_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Balloon_Number_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ this.Game_Balloon_Balloon_Number_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+
+ else if (strCommand == "Game_Balloon_Roll_Frame_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Roll_Frame_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Roll_Frame_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Roll_Frame_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Roll_Number_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Roll_Number_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Roll_Number_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Roll_Number_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Number_Size")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Balloon_Number_Size[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Balloon_Number_Padding")
+ {
+ ParseInt32(value => Game_Balloon_Number_Padding = value);
+ }
+ else if (strCommand == "Game_Balloon_Roll_Number_Scale")
+ {
+ ParseInt32(value => Game_Balloon_Roll_Number_Scale = value);
+ }
+ else if (strCommand == "Game_Balloon_Balloon_Number_Scale")
+ {
+ ParseInt32(value => Game_Balloon_Balloon_Number_Scale = value);
+ }
+
+ #endregion
+ #region Effects
+ else if (strCommand == nameof(Game_Effect_Roll_StartPoint_X))
+ {
+ Game_Effect_Roll_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_StartPoint_Y))
+ {
+ Game_Effect_Roll_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_StartPoint_1P_X))
+ {
+ Game_Effect_Roll_StartPoint_1P_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_StartPoint_1P_Y))
+ {
+ Game_Effect_Roll_StartPoint_1P_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_StartPoint_2P_X))
+ {
+ Game_Effect_Roll_StartPoint_2P_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_StartPoint_2P_Y))
+ {
+ Game_Effect_Roll_StartPoint_2P_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_Speed_X))
+ {
+ Game_Effect_Roll_Speed_X = strParam.Split(',').Select(float.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_Speed_Y))
+ {
+ Game_Effect_Roll_Speed_Y = strParam.Split(',').Select(float.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_Speed_1P_X))
+ {
+ Game_Effect_Roll_Speed_1P_X = strParam.Split(',').Select(float.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_Speed_1P_Y))
+ {
+ Game_Effect_Roll_Speed_1P_Y = strParam.Split(',').Select(float.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_Speed_2P_X))
+ {
+ Game_Effect_Roll_Speed_2P_X = strParam.Split(',').Select(float.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_Roll_Speed_2P_Y))
+ {
+ Game_Effect_Roll_Speed_2P_Y = strParam.Split(',').Select(float.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_NotesFlash))
+ {
+ Game_Effect_NotesFlash = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_NotesFlash_Timer))
+ {
+ Game_Effect_NotesFlash_Timer = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Effect_GoGoSplash))
+ {
+ Game_Effect_GoGoSplash = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_GoGoSplash_X))
+ {
+ Game_Effect_GoGoSplash_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_GoGoSplash_Y))
+ {
+ Game_Effect_GoGoSplash_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_GoGoSplash_Rotate))
+ {
+ Game_Effect_GoGoSplash_Rotate = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == nameof(Game_Effect_GoGoSplash_Timer))
+ {
+ Game_Effect_GoGoSplash_Timer = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Effect_FlyingNotes_StartPoint_X))
+ {
+ Game_Effect_FlyingNotes_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_FlyingNotes_StartPoint_Y))
+ {
+ Game_Effect_FlyingNotes_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_FlyingNotes_EndPoint_X))
+ {
+ Game_Effect_FlyingNotes_EndPoint_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_FlyingNotes_EndPoint_Y))
+ {
+ Game_Effect_FlyingNotes_EndPoint_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_FlyingNotes_Sine))
+ {
+ Game_Effect_FlyingNotes_Sine = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Effect_FlyingNotes_IsUsingEasing))
+ {
+ Game_Effect_FlyingNotes_IsUsingEasing = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == nameof(Game_Effect_FlyingNotes_Timer))
+ {
+ Game_Effect_FlyingNotes_Timer = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Effect_FireWorks))
+ {
+ Game_Effect_FireWorks = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Effect_FireWorks_Timer))
+ {
+ Game_Effect_FireWorks_Timer = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Effect_Rainbow_Timer))
+ {
+ Game_Effect_Rainbow_Timer = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Effect_HitExplosion_AddBlend))
+ {
+ Game_Effect_HitExplosion_AddBlend = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == nameof(Game_Effect_HitExplosionBig_AddBlend))
+ {
+ Game_Effect_HitExplosionBig_AddBlend = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == nameof(Game_Effect_FireWorks_AddBlend))
+ {
+ Game_Effect_FireWorks_AddBlend = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == nameof(Game_Effect_Fire_AddBlend))
+ {
+ Game_Effect_Fire_AddBlend = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == nameof(Game_Effect_GoGoSplash_AddBlend))
+ {
+ Game_Effect_GoGoSplash_AddBlend = C螟画鋤.bONorOFF(strParam[0]);
+ }
+ else if (strCommand == nameof(Game_Effect_FireWorks_Timing))
+ {
+ Game_Effect_FireWorks_Timing = int.Parse(strParam);
+ }
+ #endregion
+ #region Runner
+ else if (strCommand == "Game_Runner_Size")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Runner_Size[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Runner_Ptn")
+ {
+ ParseInt32(value => Game_Runner_Ptn = value);
+ }
+ else if (strCommand == "Game_Runner_Type")
+ {
+ ParseInt32(value => Game_Runner_Type = value);
+ }
+ else if (strCommand == "Game_Runner_StartPoint_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Runner_StartPoint_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Runner_StartPoint_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Game_Runner_StartPoint_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Game_Runner_Timer")
+ {
+ if (int.Parse(strParam) != 0)
+ {
+ Game_Runner_Timer = int.Parse(strParam);
+ }
+ }
+ #endregion
+ #region Dan_C
+ else if (strCommand == nameof(Game_DanC_Title_ForeColor))
+ {
+ Game_DanC_Title_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_DanC_Title_BackColor))
+ {
+ Game_DanC_Title_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_DanC_SubTitle_ForeColor))
+ {
+ Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_DanC_SubTitle_BackColor))
+ {
+ Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Game_DanC_X))
+ {
+ Game_DanC_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_DanC_Y))
+ {
+ Game_DanC_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+
+ else if (strCommand == nameof(Game_DanC_Size))
+ {
+ Game_DanC_Size = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+
+ else if (strCommand == nameof(Game_DanC_Padding))
+ {
+ ParseInt32(value => Game_DanC_Padding = value);
+ }
+
+ else if (strCommand == nameof(Game_DanC_Offset))
+ {
+ Game_DanC_Offset = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+
+ else if (strCommand == nameof(Game_DanC_Number_Size))
+ {
+ Game_DanC_Number_Size = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+
+ else if (strCommand == nameof(Game_DanC_Number_Padding))
+ {
+ ParseInt32(value => Game_DanC_Number_Padding = value);
+ }
+
+ else if (strCommand == nameof(Game_DanC_Number_Small_Scale))
+ {
+ Game_DanC_Number_Small_Scale = float.Parse(strParam);
+ }
+
+ else if (strCommand == nameof(Game_DanC_Number_Small_Padding))
+ {
+ ParseInt32(value => Game_DanC_Number_Small_Padding = value);
+ }
+
+ else if (strCommand == nameof(Game_DanC_Number_XY))
+ {
+ Game_DanC_Number_XY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_DanC_Number_Small_Number_Offset))
+ {
+ Game_DanC_Number_Small_Number_Offset = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_DanC_ExamType_Size))
+ {
+ Game_DanC_ExamType_Size = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_DanC_ExamRange_Size))
+ {
+ Game_DanC_ExamRange_Size = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+
+ else if (strCommand == nameof(Game_DanC_ExamRange_Padding))
+ {
+ ParseInt32(value => Game_DanC_ExamRange_Padding = value);
+ }
+
+ else if (strCommand == nameof(Game_DanC_Percent_Hit_Score_Padding))
+ {
+ Game_DanC_Percent_Hit_Score_Padding = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_DanC_ExamUnit_Size))
+ {
+ Game_DanC_ExamUnit_Size = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_DanC_Exam_Offset))
+ {
+ Game_DanC_Exam_Offset = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_DanC_Dan_Plate))
+ {
+ Game_DanC_Dan_Plate = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+
+ #endregion
+ #region PuchiChara
+ else if (strCommand == nameof(Game_PuchiChara_X))
+ {
+ Game_PuchiChara_X = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_PuchiChara_Y))
+ {
+ Game_PuchiChara_Y = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_PuchiChara_BalloonX))
+ {
+ Game_PuchiChara_BalloonX = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_PuchiChara_BalloonY))
+ {
+ Game_PuchiChara_BalloonY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_PuchiChara_Scale))
+ {
+ Game_PuchiChara_Scale = strParam.Split(',').Select(float.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_PuchiChara))
+ {
+ Game_PuchiChara = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_PuchiChara_Sine))
+ {
+ ParseInt32(value => Game_PuchiChara_Sine = value);
+ }
+ else if (strCommand == nameof(Game_PuchiChara_Timer))
+ {
+ ParseInt32(value => Game_PuchiChara_Timer = value);
+ }
+ else if (strCommand == nameof(Game_PuchiChara_SineTimer))
+ {
+ Game_PuchiChara_SineTimer = double.Parse(strParam);
+ }
+ #endregion
+ #region Training
+ else if (strCommand == nameof(Game_Training_ScrollTime))
+ {
+ Game_Training_ScrollTime = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Training_ProgressBar_XY))
+ {
+ Game_Training_ProgressBar_XY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Training_GoGoPoint_Y))
+ {
+ Game_Training_GoGoPoint_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Training_JumpPoint_Y))
+ {
+ Game_Training_JumpPoint_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Training_MaxMeasureCount_XY))
+ {
+ Game_Training_MaxMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Training_CurrentMeasureCount_XY))
+ {
+ Game_Training_CurrentMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Training_SpeedDisplay_XY))
+ {
+ Game_Training_CurrentMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Game_Training_SmallNumber_Width))
+ {
+ Game_Training_SmallNumber_Width = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Game_Training_BigNumber_Width))
+ {
+ Game_Training_BigNumber_Width = int.Parse(strParam);
+ }
+ #endregion
+
+ #endregion
+ #region Result
+ else if (strCommand == nameof(Result_MusicName_X))
+ {
+ Result_MusicName_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Result_MusicName_Y))
+ {
+ Result_MusicName_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Result_MusicName_FontSize))
+ {
+ if (int.Parse(strParam) > 0)
+ Result_MusicName_FontSize = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Result_MusicName_ReferencePoint))
+ {
+ Result_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Result_StageText_X))
+ {
+ Result_StageText_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Result_StageText_Y))
+ {
+ Result_StageText_Y = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Result_StageText_FontSize))
+ {
+ if (int.Parse(strParam) > 0)
+ Result_StageText_FontSize = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Result_StageText_ReferencePoint))
+ {
+ Result_StageText_ReferencePoint = (ReferencePoint)int.Parse(strParam);
+ }
+
+ else if (strCommand == nameof(Result_MusicName_ForeColor))
+ {
+ Result_MusicName_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Result_StageText_ForeColor))
+ {
+ Result_StageText_ForeColor = ColorTranslator.FromHtml(strParam);
+ }
+ //else if (strCommand == nameof(Result_StageText_ForeColor_Red))
+ //{
+ // Result_StageText_ForeColor_Red = ColorTranslator.FromHtml(strParam);
+ //}
+ else if (strCommand == nameof(Result_MusicName_BackColor))
+ {
+ Result_MusicName_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ else if (strCommand == nameof(Result_StageText_BackColor))
+ {
+ Result_StageText_BackColor = ColorTranslator.FromHtml(strParam);
+ }
+ //else if (strCommand == nameof(Result_StageText_BackColor_Red))
+ //{
+ // Result_StageText_BackColor_Red = ColorTranslator.FromHtml(strParam);
+ //}
+
+ else if (strCommand == "Result_NamePlate_X")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Result_NamePlate_X[i] = int.Parse(strSplit[i]);
+ }
+ }
+ else if (strCommand == "Result_NamePlate_Y")
+ {
+ string[] strSplit = strParam.Split(',');
+ for (int i = 0; i < 2; i++)
+ {
+ Result_NamePlate_Y[i] = int.Parse(strSplit[i]);
+ }
+ }
+
+ else if (strCommand == nameof(Result_Dan))
+ {
+ Result_Dan = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Result_Dan_XY))
+ {
+ Result_Dan_XY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+ else if (strCommand == nameof(Result_Dan_Plate_XY))
+ {
+ Result_Dan_Plate_XY = strParam.Split(',').Select(int.Parse).ToArray();
+ }
+
+ #endregion
+ #region Font
+ else if (strCommand == nameof(Font_Edge_Ratio)) //Config逕サ髱「繧邁。譏薙Γ繝九Η繝シ縺ョ繝輔か繝ウ繝医↓縺、縺縺ヲ(rhimm)
+ {
+ if (int.Parse(strParam) > 0)
+ Font_Edge_Ratio = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Font_Edge_Ratio_Vertical)) //TITLE繧ТUBTITLE縺ェ縺ゥ縲∫クヲ縺ォ譖ク縺九l繧九%縺ィ縺ョ縺ゅk繝輔か繝ウ繝医↓縺、縺縺ヲ(rhimm)
+ {
+ if (int.Parse(strParam) > 0)
+ Font_Edge_Ratio_Vertical = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Text_Correction_X))
+ {
+ Text_Correction_X = int.Parse(strParam);
+ }
+ else if (strCommand == nameof(Text_Correction_Y))
+ {
+ Text_Correction_Y = int.Parse(strParam);
+ }
+ #endregion
+ #endregion
+ }
+ continue;
+ }
+ catch (Exception exception)
+ {
+ Trace.TraceError(exception.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (6a32cc37-1527-412e-968a-512c1f0135cd)");
+ continue;
+ }
+ }
+ }
+ }
+
+ private void t蠎ァ讓吶ョ霑ス蠕楢ィュ螳()
+ {
+ //
+ if (bFieldBgPointOverride == true)
+ {
+
+ }
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if (!this.bDisposed貂医∩)
+ {
+ for (int i = 0; i < this.n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++)
+ this[i].Dispose();
+
+ this.bDisposed貂医∩ = true;
+ }
+ }
+ //-----------------
+ #endregion
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private bool bDisposed貂医∩;
+ //-----------------
+ #endregion
+
+ #region 閭梧勹(繧ケ繧ッ繝ュ繝シ繝ォ)
+ public int[] Background_Scroll_Y = new int[] { 0, 536 };
+ #endregion
+
+
+ #region[ 蠎ァ讓 ]
+ //2017.08.11 kairera0467 DP螳溽畑蛹悶↓蜷代¢縺ヲint驟榊励↓螟画峩
+
+ //繝輔ぅ繝シ繝ォ繝我ス咲スョ縲X縺ッ蛻、螳壽棧驛ィ蛻縺ョ菴咲スョ縲Y縺ッ繝輔ぅ繝シ繝ォ繝峨ョ譛荳企Κ縺ョ蠎ァ讓吶
+ //迴セ譎らせ縺ァ縺ッ繝弱シ繝逕サ蜒上ヾenotes逕サ蜒上∝愛螳壽棧縺碁」蜍輔☆繧九
+ //X縺ッ荳ュ螟ョ蝓コ貅匁緒逕サ縲〆縺ッ蟾ヲ荳雁渕貅匁緒逕サ
+ public int[] nScrollFieldX = new int[] { 414, 414 };
+ public int[] nScrollFieldY = new int[] { 192, 368 };
+
+ //荳ュ蠢蠎ァ讓呎欠螳
+ public int[] nJudgePointX = new int[] { 413, 413, 413, 413 };
+ public int[] nJudgePointY = new int[] { 256, 433, 0, 0 };
+
+ //繝輔ぅ繝シ繝ォ繝芽レ譎ッ逕サ蜒
+ //ScrollField蠎ァ讓吶∈縺ョ霑ス蠕楢ィュ螳壹′蜿ッ閭ス縲
+ //蛻蟯占レ譎ッ縲√ざ繝シ繧エ繝シ閭梧勹縺碁」蜍輔☆繧九(蜈ィ縺ヲ蜷後§螟ァ縺阪&縲∽ス咲スョ縺ァ菴懈舌☆繧九%縺ィ縲)
+ //蟾ヲ荳雁渕貅匁緒逕サ
+ public bool bFieldBgPointOverride = false;
+ public int[] nScrollFieldBGX = new int[] { 333, 333, 333, 333 };
+ public int[] nScrollFieldBGY = new int[] { 192, 368, 0, 0 };
+
+ //SEnotes
+ //髻ウ隨ヲ蠎ァ讓吶↓蜉邂
+ public int[] nSENotesY = new int[] { 131, 131 };
+
+ //蜈峨k螟ェ鮠馴Κ蛻
+ public int nMtaikoBackgroundX = 0;
+ public int nMtaikoBackgroundY = 184;
+ public int nMtaikoFieldX = 0;
+ public int nMtaikoFieldY = 184;
+ public int nMtaikoMainX = 0;
+ public int nMtaikoMainY = 0;
+
+ //繧ウ繝ウ繝
+ public int[] nComboNumberX = new int[] { 0, 0, 0, 0 };
+ public int[] nComboNumberY = new int[] { 212, 388, 0, 0 };
+ public int[] nComboNumberTextY = new int[] { 271, 447, 0, 0 };
+ public int[] nComboNumberTextLargeY = new int[] { 270, 446, 0, 0 };
+ public float fComboNumberSpacing = 0;
+ public float fComboNumberSpacing_l = 0;
+
+ public E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝 eDiffDispMode;
+ public bool b迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク謨ー繧定。ィ遉コ縺励↑縺;
+
+ //繝ェ繧カ繝ォ繝育判髱「
+ //迴セ蝨ィ縺ョ繝繝輔か繝ォ繝亥、縺ッ繝繝溘シ縺ァ縺吶
+ public int nResultPanelP1X = 0;
+ public int nResultPanelP1Y = 0;
+ public int nResultPanelP2X = 515;
+ public int nResultPanelP2Y = 75;
+ public int nResultScoreP1X = 295;
+ public int nResultScoreP1Y = 212;
+ public int nResultJudge1_P1X = 495;
+ public int nResultJudge1_P1Y = 182;
+ public int nResultJudge2_P1X = 968;
+ public int nResultJudge2_P1Y = 174;
+
+ public int nResultNumberP1X = 490;
+ public int nResultNumberP2X = 875;
+
+ public int nResultNumberY = 188;
+ public int nResultNumberYPadding = 42;
+
+ public int nResultGaugeBaseP1X = 56;
+ public int nResultGaugeBaseP1Y = 141;
+ public int nResultGaugeBaseP2X = 555;
+ public int nResultGaugeBaseP2Y = 122;
+ public int nResultGaugeBodyP1X = 559;
+ public int nResultGaugeBodyP1Y = 125;
+ #endregion
+
+ public string[] strString繧帝榊励↓逶エ縺(string str)
+ {
+ string[] strArray = str.Split(',');
+ return strArray;
+ }
+
+ public enum RollColorMode
+ {
+ None, // PS4, Switch縺ェ縺ゥ
+ All, // 譌ァ遲蝉ス(譌ァ菴懷性繧)
+ WithoutStart // 譁ー遲蝉ス
+ }
+ public enum ReferencePoint //繝繧ッ繧ケ繝√Ε謠冗判縺ョ蝓コ貅也せ繧貞、画峩蜿ッ閭ス縺ォ縺吶k縺溘a縺ョ蛟、(rhimm)
+ {
+ Center,
+ Left,
+ Right
+ }
+
+ #region 譁ー繝サSkinConfig
+ #region General
+ public string Skin_Name = "Unknown";
+ public string Skin_Version = "Unknown";
+ public string Skin_Creator = "Unknown";
+ #endregion
+ #region Config
+ public int Config_ItemText_Correction_X = 0;
+ public int Config_ItemText_Correction_Y = 0;
+ #endregion
+ #region SongSelect
+ public int SongSelect_Overall_Y = 123;
+ public int SongSelect_BoxExplanation_X = 0;
+ public int SongSelect_BoxExplanation_Y = 0;
+ public int SongSelect_BoxExplanation_Interval = 30;
+ public int SongSelect_Title_X = 0;
+ public int SongSelect_Title_Y = 0;
+ public string[] SongSelect_GenreName = { "繝昴ャ繝励せ", "繧「繝九Γ", "繧イ繝シ繝繝舌Λ繧ィ繝繧」", "繝翫Β繧ウ繧ェ繝ェ繧ク繝翫Ν", "繧ッ繝ゥ繧キ繝繧ッ", "繝舌Λ繧ィ繝繧」", "繧ュ繝繧コ", "繝懊シ繧ォ繝ュ繧、繝", "譛霑鷹♀繧薙□譖イ"};
+ public int[] SongSelect_NamePlate_X = new int[] { 36, 1020 };
+ public int[] SongSelect_NamePlate_Y = new int[] { 615, 615 };
+ public int[] SongSelect_Auto_X = new int[] { 60, 950 };
+ public int[] SongSelect_Auto_Y = new int[] { 650, 650 };
+ public Color SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_ForeColor_Anime = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_ForeColor_Children = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_ForeColor_Variety = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_ForeColor_Classic = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_ForeColor_Namco = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongSelect_BackColor_JPOP = ColorTranslator.FromHtml("#01455B");
+ public Color SongSelect_BackColor_Anime = ColorTranslator.FromHtml("#99001F");
+ public Color SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml("#5B6278");
+ public Color SongSelect_BackColor_Children = ColorTranslator.FromHtml("#9D3800");
+ public Color SongSelect_BackColor_Variety = ColorTranslator.FromHtml("#366600");
+ public Color SongSelect_BackColor_Classic = ColorTranslator.FromHtml("#875600");
+ public Color SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml("#412080");
+ public Color SongSelect_BackColor_Namco = ColorTranslator.FromHtml("#980E00");
+ public int SongSelect_Bar_Genre_Count,
+ SongSelect_Genre_Background_Count,
+ SongSelect_Box_Chara_Count,
+ SongSelect_Difficulty_Background_Count;
+ public string[] SongSelect_CorrectionX_Chara = { "縺薙%縺ォX蠎ァ讓吶r陬懈ュ」縺励◆縺譁蟄励r繧ォ繝ウ繝槭〒蛹コ蛻縺」縺ヲ險伜・" };
+ public string[] SongSelect_CorrectionY_Chara = { "縺薙%縺ォY蠎ァ讓吶r陬懈ュ」縺励◆縺譁蟄励r繧ォ繝ウ繝槭〒蛹コ蛻縺」縺ヲ險伜・" };
+ public int SongSelect_CorrectionX_Chara_Value = 0;
+ public int SongSelect_CorrectionY_Chara_Value = 0;
+ public string[] SongSelect_Rotate_Chara = { "縺薙%縺ォ90邃蝗櫁サ「縺輔○縺溘>譁蟄励r繧ォ繝ウ繝槭〒蛹コ蛻縺」縺ヲ險伜・" };
+
+ #endregion
+ #region SongLoading
+ public int SongLoading_Plate_X = 640;
+ public int SongLoading_Plate_Y = 360;
+ public int SongLoading_Title_X = 640;
+ public int SongLoading_Title_Y = 280;
+ public int SongLoading_SubTitle_X = 640;
+ public int SongLoading_SubTitle_Y = 325;
+ public int SongLoading_Title_FontSize = 31;
+ public int SongLoading_SubTitle_FontSize = 20;
+ public ReferencePoint SongLoading_Plate_ReferencePoint = ReferencePoint.Center;
+ public ReferencePoint SongLoading_Title_ReferencePoint = ReferencePoint.Center;
+ public ReferencePoint SongLoading_SubTitle_ReferencePoint = ReferencePoint.Center;
+ public Color SongLoading_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ public Color SongLoading_Title_BackColor = ColorTranslator.FromHtml("#000000");
+ public Color SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml("#000000");
+ public Color SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml("#00000000");
+ public bool SongLoading_Plate_ScreenBlend = false;
+
+ #endregion
+ #region Game
+ public bool Game_Notes_Anime = false;
+ public string Game_StageText = "1譖イ逶ョ";
+ public RollColorMode Game_RollColorMode = RollColorMode.All;
+ public bool Game_JudgeFrame_AddBlend = true;
+ #region Chara
+ public int[] Game_Chara_X = new int[] { 0, 0 };
+ public int[] Game_Chara_Y = new int[] { 0, 537 };
+ public int[] Game_Chara_Balloon_X = new int[] { 240, 240, 0, 0 };
+ public int[] Game_Chara_Balloon_Y = new int[] { 0, 297, 0, 0 };
+ public int Game_Chara_Ptn_Normal,
+ Game_Chara_Ptn_GoGo,
+ Game_Chara_Ptn_Clear,
+ Game_Chara_Ptn_10combo,
+ Game_Chara_Ptn_10combo_Max,
+ Game_Chara_Ptn_GoGoStart,
+ Game_Chara_Ptn_GoGoStart_Max,
+ Game_Chara_Ptn_ClearIn,
+ Game_Chara_Ptn_SoulIn,
+ Game_Chara_Ptn_Balloon_Breaking,
+ Game_Chara_Ptn_Balloon_Broke,
+ Game_Chara_Ptn_Balloon_Miss;
+ public string Game_Chara_Motion_Normal,
+ Game_Chara_Motion_Clear,
+ Game_Chara_Motion_GoGo = "0";
+ public int Game_Chara_Beat_Normal = 1;
+ public int Game_Chara_Beat_Clear = 2;
+ public int Game_Chara_Beat_GoGo = 2;
+ public int Game_Chara_Balloon_Timer = 28;
+ public int Game_Chara_Balloon_Delay = 500;
+ public int Game_Chara_Balloon_FadeOut = 84;
+ #endregion
+ #region Dancer
+ public int[] Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 };
+ public int[] Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 };
+ public string Game_Dancer_Motion = "0";
+ public int Game_Dancer_Ptn = 0;
+ public int Game_Dancer_Beat = 8;
+ public int[] Game_Dancer_Gauge = new int[] { 0, 0, 0, 40, 80 };
+ #endregion
+ #region Mob
+ public int Game_Mob_Ptn = 1;
+ public int Game_Mob_Beat,
+ Game_Mob_Ptn_Beat = 1;
+ #endregion
+ #region CourseSymbol
+ public int[] Game_CourseSymbol_X = new int[] { 64, 64 };
+ public int[] Game_CourseSymbol_Y = new int[] { 232, 582 };
+ #endregion
+ #region PanelFont
+ public int Game_MusicName_X = 1160;
+ public int Game_MusicName_Y = 24;
+ public int Game_MusicName_FontSize = 27;
+ public ReferencePoint Game_MusicName_ReferencePoint = ReferencePoint.Center;
+ public int Game_Genre_X = 1015;
+ public int Game_Genre_Y = 70;
+ public int Game_Lyric_X = 640;
+ public int Game_Lyric_Y = 630;
+ public string Game_Lyric_FontName = "MS UI Gothic";
+ public int Game_Lyric_FontSize = 38;
+ public ReferencePoint Game_Lyric_ReferencePoint = ReferencePoint.Center;
+
+ public Color Game_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ public Color Game_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ public Color Game_Lyric_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ public Color Game_MusicName_BackColor = ColorTranslator.FromHtml("#000000");
+ public Color Game_StageText_BackColor = ColorTranslator.FromHtml("#000000");
+ public Color Game_Lyric_BackColor = ColorTranslator.FromHtml("#0000FF");
+
+ #endregion
+ #region Score
+ public int[] Game_Score_X = new int[] { 20, 20, 0, 0 };
+ public int[] Game_Score_Y = new int[] { 226, 530, 0, 0 };
+ public int[] Game_Score_Add_X = new int[] { 20, 20, 0, 0 };
+ public int[] Game_Score_Add_Y = new int[] { 186, 570, 0, 0 };
+ public int[] Game_Score_AddBonus_X = new int[] { 20, 20, 0, 0 };
+ public int[] Game_Score_AddBonus_Y = new int[] { 136, 626, 0, 0 };
+ public int Game_Score_Padding = 20;
+ public int[] Game_Score_Size = new int[] { 24, 40 };
+ #endregion
+ #region Taiko
+ public int[] Game_Taiko_NamePlate_X = new int[] { 0, 0 };
+ public int[] Game_Taiko_NamePlate_Y = new int[] { 300, 380 };
+ public int[] Game_Taiko_PlayerNumber_X = new int[] { 4, 4 };
+ public int[] Game_Taiko_PlayerNumber_Y = new int[] { 233, 435 };
+ public int[] Game_Taiko_X = new int[] { 190, 190 };
+ public int[] Game_Taiko_Y = new int[] { 190, 368 };
+ public int[] Game_Taiko_Combo_X = new int[] { 267, 267 };
+ public int[] Game_Taiko_Combo_Y = new int[] { 272, 447 };
+ public int[] Game_Taiko_Combo_Ex_X = new int[] { 267, 267 };
+ public int[] Game_Taiko_Combo_Ex_Y = new int[] { 274, 451 };
+ public int[] Game_Taiko_Combo_Ex4_X = new int[] { 267, 267 };
+ public int[] Game_Taiko_Combo_Ex4_Y = new int[] { 269, 447 };
+ public int[] Game_Taiko_Combo_Padding = new int[] { 34, 34, 30 };
+ public int[] Game_Taiko_Combo_Size = new int[] { 40, 48 };
+ public int[] Game_Taiko_Combo_Size_Ex = new int[] { 40, 48 };
+ public float[] Game_Taiko_Combo_Scale = new float[] { 1.0f, 1.0f, 0.9f };
+ public int[] Game_Taiko_Combo_Text_X = new int[] { 268, 268 };
+ public int[] Game_Taiko_Combo_Text_Y = new int[] { 298, 475 };
+ public int[] Game_Taiko_Combo_Text_Size = new int[] { 100, 50 };
+ public bool Game_Taiko_Combo_Ex_IsJumping = true;
+ #endregion
+ #region Gauge
+ public int Game_Gauge_Rainbow_Ptn;
+ public int Game_Gauge_Dan_Rainbow_Ptn;
+ public int Game_Gauge_Rainbow_Timer = 50;
+ #endregion
+ #region Balloon
+ public int[] Game_Balloon_Combo_X = new int[] { 253, 253 };
+ public int[] Game_Balloon_Combo_Y = new int[] { -11, 538 };
+ public int[] Game_Balloon_Combo_Number_X = new int[] { 257, 257 };
+ public int[] Game_Balloon_Combo_Number_Y = new int[] { 54, 603 };
+ public int[] Game_Balloon_Combo_Number_Ex_X = new int[] { 297, 297 };
+ public int[] Game_Balloon_Combo_Number_Ex_Y = new int[] { 54, 603 };
+ public int[] Game_Balloon_Combo_Text_X = new int[] { 440, 440 };
+ public int[] Game_Balloon_Combo_Text_Y = new int[] { 85, 634 };
+ public int[] Game_Balloon_Combo_Text_Ex_X = new int[] { 440, 440 };
+ public int[] Game_Balloon_Combo_Text_Ex_Y = new int[] { 85, 594 };
+
+ public int[] Game_Balloon_Balloon_X = new int[] { 382, 382 };
+ public int[] Game_Balloon_Balloon_Y = new int[] { 115, 290 };
+ public int[] Game_Balloon_Balloon_Frame_X = new int[] { 382, 382 };
+ public int[] Game_Balloon_Balloon_Frame_Y = new int[] { 80, 260 };
+ public int[] Game_Balloon_Balloon_Number_X = new int[] { 486, 486 };
+ public int[] Game_Balloon_Balloon_Number_Y = new int[] { 187, 373 };
+ public int[] Game_Balloon_Roll_Frame_X = new int[] { 218, 218 };
+ public int[] Game_Balloon_Roll_Frame_Y = new int[] { -3, 514 };
+ public int[] Game_Balloon_Roll_Number_X = new int[] { 376, 376 };
+ public int[] Game_Balloon_Roll_Number_Y = new int[] { 122, 633 };
+ public int[] Game_Balloon_Number_Size = new int[] { 63, 75 };
+ public int Game_Balloon_Number_Padding = 55;
+ public float Game_Balloon_Roll_Number_Scale = 1.000f;
+ public float Game_Balloon_Balloon_Number_Scale = 0.879f;
+ #endregion
+ #region Effects
+ public int[] Game_Effect_Roll_StartPoint_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 };
+ public int[] Game_Effect_Roll_StartPoint_Y = new int[] { 720 };
+ public int[] Game_Effect_Roll_StartPoint_1P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 };
+ public int[] Game_Effect_Roll_StartPoint_1P_Y = new int[] { 240 };
+ public int[] Game_Effect_Roll_StartPoint_2P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 };
+ public int[] Game_Effect_Roll_StartPoint_2P_Y = new int[] { 360 };
+ public float[] Game_Effect_Roll_Speed_X = new float[] { 0.6f };
+ public float[] Game_Effect_Roll_Speed_Y = new float[] { -0.6f };
+ public float[] Game_Effect_Roll_Speed_1P_X = new float[] { 0.6f };
+ public float[] Game_Effect_Roll_Speed_1P_Y = new float[] { -0.6f };
+ public float[] Game_Effect_Roll_Speed_2P_X = new float[] { 0.6f };
+ public float[] Game_Effect_Roll_Speed_2P_Y = new float[] { 0.6f };
+ public int Game_Effect_Roll_Ptn;
+ public int[] Game_Effect_NotesFlash = new int[] { 180, 180, 16 }; // Width, Height, Ptn
+ public int Game_Effect_NotesFlash_Timer = 20;
+ public int[] Game_Effect_GoGoSplash = new int[] { 300, 400, 30 };
+ public int[] Game_Effect_GoGoSplash_X = new int[] { 120, 300, 520, 760, 980, 1160 };
+ public int[] Game_Effect_GoGoSplash_Y = new int[] { 740, 730, 720, 720, 730, 740 };
+ public bool Game_Effect_GoGoSplash_Rotate = true;
+ public int Game_Effect_GoGoSplash_Timer = 18;
+ // super-flying-notes AioiLight
+ public int[] Game_Effect_FlyingNotes_StartPoint_X = new int[] { 414, 414 };
+ public int[] Game_Effect_FlyingNotes_StartPoint_Y = new int[] { 260, 434 };
+ public int[] Game_Effect_FlyingNotes_EndPoint_X = new int[] { 1222, 1222 }; // 1P, 2P
+ public int[] Game_Effect_FlyingNotes_EndPoint_Y = new int[] { 164, 554 };
+
+ public int Game_Effect_FlyingNotes_Sine = 220;
+ public bool Game_Effect_FlyingNotes_IsUsingEasing = true;
+ public int Game_Effect_FlyingNotes_Timer = 4;
+ public int[] Game_Effect_FireWorks = new int[] { 180, 180, 30 };
+ public int Game_Effect_FireWorks_Timer = 5;
+ public int Game_Effect_Rainbow_Timer = 8;
+
+ public bool Game_Effect_HitExplosion_AddBlend = true;
+ public bool Game_Effect_HitExplosionBig_AddBlend = true;
+ public bool Game_Effect_FireWorks_AddBlend = true;
+ public bool Game_Effect_Fire_AddBlend = true;
+ public bool Game_Effect_GoGoSplash_AddBlend = true;
+ public int Game_Effect_FireWorks_Timing = 8;
+ #endregion
+ #region Runner
+ public int[] Game_Runner_Size = new int[] { 60, 125 };
+ public int Game_Runner_Ptn = 48;
+ public int Game_Runner_Type = 4;
+ public int[] Game_Runner_StartPoint_X = new int[] { 175, 175 };
+ public int[] Game_Runner_StartPoint_Y = new int[] { 40, 560 };
+ public int Game_Runner_Timer = 16;
+ #endregion
+ #region PuchiChara
+ public int[] Game_PuchiChara_X = new int[] { 100, 100 };
+ public int[] Game_PuchiChara_Y = new int[] { 140, 600 };
+ public int[] Game_PuchiChara_BalloonX = new int[] { 300, 300 };
+ public int[] Game_PuchiChara_BalloonY = new int[] { 240, 500 };
+ public float[] Game_PuchiChara_Scale = new float[] { 0.7f, 1.0f }; // 騾壼クク譎ゅ 縺オ縺縺帙s騾」謇捺凾
+ public int[] Game_PuchiChara = new int[] { 180, 180, 2 }; // Width, Height, Ptn
+ public int Game_PuchiChara_Sine = 20;
+ public int Game_PuchiChara_Timer = 4800;
+ public double Game_PuchiChara_SineTimer = 2;
+ #endregion
+ #region Dan-C
+ public Color Game_DanC_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ public Color Game_DanC_Title_BackColor = ColorTranslator.FromHtml("#000000");
+ public Color Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ public Color Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml("#000000");
+
+ public int[] Game_DanC_Size = new int[] { 1006, 92 };
+ public int[] Game_DanC_Number_Size = new int[] { 48, 58 };
+ public int[] Game_DanC_Small_Number_Size = new int[] { 24, 29 };
+ public int[] Game_DanC_MiniNumber_Size = new int[] { 23, 28 };
+ public int[] Game_DanC_ExamType_Size = new int[] { 247, 28 };
+ public int[] Game_DanC_ExamRange_Size = new int[] { 54, 30 };
+ public int[] Game_DanC_ExamUnit_Size = new int[] { 30, 36 };
+
+ public int[] Game_DanC_Offset = new int[] { 259, 27 };
+ public int[] Game_DanC_Number_Small_Number_Offset = new int[] { 285, 38 };
+ public int[] Game_DanC_Exam_Offset = new int[] { 222, 27 };
+
+ public int[] Game_DanC_X = new int[] { 807, 70, 70, 70 }; // 329, 437
+ public int[] Game_DanC_Y = new int[] { 116, 292, 292, 292 }; // { 116, 190, 236, 292 };
+ public int[] Game_DanC_Number_XY = new int[] { 214, 67 };
+ public int[] Game_DanC_Dan_Plate = new int[] { 149, 416 };
+
+ public int Game_DanC_Padding = 9;
+ public int Game_DanC_Number_Padding = 35;
+ public int Game_DanC_Number_Small_Padding = 41;
+ public int Game_DanC_ExamRange_Padding = 49;
+ public int[] Game_DanC_Percent_Hit_Score_Padding = new int[] { 20, 20, 20 };
+
+ public float Game_DanC_Number_Small_Scale = 0.92f;
+ public float Game_DanC_Exam_Number_Scale = 0.47f;
+
+ #endregion
+ #region Training
+ public int Game_Training_ScrollTime = 350;
+ public int[] Game_Training_ProgressBar_XY = { 333, 378 };
+ public int Game_Training_GoGoPoint_Y = 396;
+ public int Game_Training_JumpPoint_Y = 375;
+ public int[] Game_Training_MaxMeasureCount_XY = { 284, 377 };
+ public int[] Game_Training_CurrentMeasureCount_XY = { 254, 370 };
+ public int[] Game_Training_SpeedDisplay_XY = { 110, 370 };
+ public int Game_Training_SmallNumber_Width = 17;
+ public int Game_Training_BigNumber_Width = 20;
+ #endregion
+
+ #endregion
+ #region Result
+ public int Result_MusicName_X = 640;
+ public int Result_MusicName_Y = 30;
+ public int Result_MusicName_FontSize = 25;
+ public ReferencePoint Result_MusicName_ReferencePoint = ReferencePoint.Center;
+ public int Result_StageText_X = 230;
+ public int Result_StageText_Y = 6;
+ public int Result_StageText_FontSize = 30;
+ public ReferencePoint Result_StageText_ReferencePoint = ReferencePoint.Left;
+
+ public Color Result_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ public Color Result_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF");
+ //public Color Result_StageText_ForeColor_Red = ColorTranslator.FromHtml("#FFFFFF");
+ public Color Result_MusicName_BackColor = ColorTranslator.FromHtml("#000000");
+ public Color Result_StageText_BackColor = ColorTranslator.FromHtml("#000000");
+ //public Color Result_StageText_BackColor_Red = ColorTranslator.FromHtml("#FF0000");
+
+ public int[] Result_NamePlate_X = new int[] { 6, 260 };
+ public int[] Result_NamePlate_Y = new int[] { 611, 611 };
+
+ public int[] Result_Dan = new int[] { 500, 500 };
+ public int[] Result_Dan_XY = new int[] { 100, 0 };
+ public int[] Result_Dan_Plate_XY = new int[] { 149, 416 };
+ #endregion
+ #region Font
+ public int Font_Edge_Ratio = 30;
+ public int Font_Edge_Ratio_Vertical = 30;
+ public int Text_Correction_X = 0;
+ public int Text_Correction_Y = 0;
+ #endregion
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/TJAPlayer3/Common/CVeirticalSongNameFont.cs b/TJAPlayer3/Common/CVeirticalSongNameFont.cs
new file mode 100644
index 00000000..ef110efb
--- /dev/null
+++ b/TJAPlayer3/Common/CVeirticalSongNameFont.cs
@@ -0,0 +1,35 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Diagnostics;
+using SlimDX;
+using FDK;
+
+namespace TJAPlayer3
+{
+ public class CVerticalSongNameFont
+ {
+ //蠢隕√↑蛟、
+ //_繧ソ繧、繝医Ν
+ //_繧オ繝悶ち繧、繝医Ν(縺ィ繧翫≠縺医★譛蛻昴ッ辟。縺励〒騾イ繧√k)
+ //_
+ //_
+ //_
+
+
+
+
+
+
+
+ #region [ private ]
+ //-----------------
+ private const string str蝗櫁サ「縺輔○繧区枚蟄 = "縲後搾ス橸シ茨シ峨シ-~シ坂樞()縲翫宮}<>縲弱充]窶ヲ";
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Common/ConfigIniToSongGainControllerBinder.cs b/TJAPlayer3/Common/ConfigIniToSongGainControllerBinder.cs
new file mode 100644
index 00000000..2e2e604f
--- /dev/null
+++ b/TJAPlayer3/Common/ConfigIniToSongGainControllerBinder.cs
@@ -0,0 +1,38 @@
+サソusing FDK;
+
+namespace TJAPlayer3
+{
+ ///
+ /// The ConfigIniToSongGainControllerBinder allows for SONGVOL and/or other
+ /// properties related to the Gain levels applied to song preview and
+ /// playback, to be applied conditionally based on settings flowing from
+ /// ConfigIni. This binder class allows that to take place without either
+ /// ConfigIni or SongGainController having awareness of one another.
+ /// See those classes properties, methods, and events for more details.
+ ///
+ internal static class ConfigIniToSongGainControllerBinder
+ {
+ internal static void Bind(CConfigIni configIni, SongGainController songGainController)
+ {
+ songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata;
+ songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness);
+ songGainController.ApplySongVol = configIni.ApplySongVol;
+
+ configIni.PropertyChanged += (sender, args) =>
+ {
+ switch (args.PropertyName)
+ {
+ case nameof(CConfigIni.ApplyLoudnessMetadata):
+ songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata;
+ break;
+ case nameof(CConfigIni.TargetLoudness):
+ songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness);
+ break;
+ case nameof(CConfigIni.ApplySongVol):
+ songGainController.ApplySongVol = configIni.ApplySongVol;
+ break;
+ }
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/TJAPlayer3/Common/ConfigIniToSoundGroupLevelControllerBinder.cs b/TJAPlayer3/Common/ConfigIniToSoundGroupLevelControllerBinder.cs
new file mode 100644
index 00000000..2ebca6be
--- /dev/null
+++ b/TJAPlayer3/Common/ConfigIniToSoundGroupLevelControllerBinder.cs
@@ -0,0 +1,67 @@
+サソusing System;
+using FDK;
+
+namespace TJAPlayer3
+{
+ ///
+ /// The ConfigIniToSoundGroupLevelControllerBinder allows for updated sound
+ /// group level values, and keyboard sound level adjustment increment
+ /// values, to flow between CConfigIni and the SoundGroupLevelController
+ /// without either of those two classes being aware of one another.
+ /// See those classes properties, methods, and events for more details.
+ ///
+ internal static class ConfigIniToSoundGroupLevelControllerBinder
+ {
+ internal static void Bind(CConfigIni configIni, SoundGroupLevelController soundGroupLevelController)
+ {
+ soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel);
+ soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel);
+ soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPlaybackLevel);
+ soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel);
+ soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement);
+
+ configIni.PropertyChanged += (sender, args) =>
+ {
+ switch (args.PropertyName)
+ {
+ case nameof(CConfigIni.SoundEffectLevel):
+ soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel);
+ break;
+ case nameof(CConfigIni.VoiceLevel):
+ soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel);
+ break;
+ case nameof(CConfigIni.SongPreviewLevel):
+ soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPlaybackLevel);
+ break;
+ case nameof(CConfigIni.SongPlaybackLevel):
+ soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel);
+ break;
+ case nameof(CConfigIni.KeyboardSoundLevelIncrement):
+ soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement);
+ break;
+ }
+ };
+
+ soundGroupLevelController.LevelChanged += (sender, args) =>
+ {
+ switch (args.SoundGroup)
+ {
+ case ESoundGroup.SoundEffect:
+ configIni.SoundEffectLevel = args.Level;
+ break;
+ case ESoundGroup.Voice:
+ configIni.VoiceLevel = args.Level;
+ break;
+ case ESoundGroup.SongPreview:
+ configIni.SongPlaybackLevel = args.Level;
+ break;
+ case ESoundGroup.SongPlayback:
+ configIni.SongPlaybackLevel = args.Level;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ };
+ }
+ }
+}
diff --git a/TJAPlayer3/Common/ConfigManager.cs b/TJAPlayer3/Common/ConfigManager.cs
new file mode 100644
index 00000000..5200e802
--- /dev/null
+++ b/TJAPlayer3/Common/ConfigManager.cs
@@ -0,0 +1,56 @@
+サソusing System.Text;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using Newtonsoft.Json.Serialization;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 險ュ螳壹ヵ繧。繧、繝ォ蜈・蜃コ蜉帙け繝ゥ繧ケ縲
+ ///
+ public static class ConfigManager
+ {
+ private static readonly JsonSerializerSettings Settings =
+ new JsonSerializerSettings()
+ {
+ ObjectCreationHandling = ObjectCreationHandling.Auto,
+ DefaultValueHandling = DefaultValueHandling.Include,
+ ContractResolver = new CamelCasePropertyNamesContractResolver(),
+ Converters = new StringEnumConverter[] { new StringEnumConverter() }
+ };
+
+ ///
+ /// 險ュ螳壹ヵ繧。繧、繝ォ縺ョ隱ュ縺ソ霎シ縺ソ繧定。後>縺セ縺吶ゅヵ繧。繧、繝ォ縺悟ュ伜惠縺励↑縺九▲縺溷エ蜷医√◎縺ョ繧ッ繝ゥ繧ケ縺ョ譁ー隕上う繝ウ繧ケ繧ソ繝ウ繧ケ繧定ソ斐@縺セ縺吶
+ ///
+ /// 繧キ繝ェ繧「繝ゥ繧、繧コ縺励◆繧ッ繝ゥ繧ケ縲
+ /// 繝輔ぃ繧、繝ォ蜷阪
+ /// 繝繧キ繝ェ繧「繝ゥ繧、繧コ邨先棡縲
+ public static T GetConfig(string filePath) where T : new()
+ {
+ var json = "";
+ if (!System.IO.File.Exists(filePath))
+ {
+ // 繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励↑縺縺ョ縺ァ
+ SaveConfig(new T(), filePath);
+ }
+ using (var stream = new System.IO.StreamReader(filePath, Encoding.UTF8))
+ {
+ json = stream.ReadToEnd();
+ }
+ return JsonConvert.DeserializeObject(json, Settings);
+ }
+
+ ///
+ /// 險ュ螳壹ヵ繧。繧、繝ォ縺ョ譖ク縺崎セシ縺ソ繧定。後>縺セ縺吶
+ ///
+ /// 繧キ繝ェ繧「繝ゥ繧、繧コ縺吶k繧、繝ウ繧ケ繧ソ繝ウ繧ケ縲
+ /// 繝輔ぃ繧、繝ォ蜷阪
+ public static void SaveConfig(object obj, string filePath)
+ {
+ using (var stream = new System.IO.StreamWriter(filePath, false, Encoding.UTF8))
+ {
+ stream.Write(JsonConvert.SerializeObject(obj, Formatting.Indented, Settings));
+ }
+ }
+ }
+}
diff --git a/TJAPlayer3/Common/C螳壽焚.cs b/TJAPlayer3/Common/C螳壽焚.cs
new file mode 100644
index 00000000..5b5aa8e5
--- /dev/null
+++ b/TJAPlayer3/Common/C螳壽焚.cs
@@ -0,0 +1,774 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace TJAPlayer3
+{
+
+ ///
+ /// 髮」譏灘コヲ縲
+ ///
+ public enum Difficulty
+ {
+ Easy,
+ Normal,
+ Hard,
+ Oni,
+ Edit,
+ Tower,
+ Dan,
+ Total
+ }
+
+ public enum EScrollMode
+ {
+ Normal,
+ BMSCROLL,
+ HBSCROLL
+ }
+ public enum E繧ク繝」繝ウ繝ォ
+ {
+ None = 0,
+ JPOP = 1,
+ 繧イ繝シ繝 = 2,
+ 繝翫Β繧ウ = 3,
+ 繧ッ繝ゥ繧キ繝繧ッ = 4,
+ 繝舌Λ繧ィ繝繧」 = 5,
+ 縺ゥ縺繧医≧ = 6,
+ 繝懊シ繧ォ繝ュ繧、繝 = 7,
+ 繧「繝九Γ = 8
+ }
+ public enum EGame
+ {
+ OFF = 0,
+ 螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ = 1,
+ 螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ豼霎 = 2
+ }
+ public enum E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝
+ {
+ OFF = 0,
+ n譖イ逶ョ縺ォ陦ィ遉コ = 1,
+ mtaiko縺ォ逕サ蜒上〒陦ィ遉コ = 2,
+ }
+ public enum E繝繝シ繧ッ繝「繝シ繝
+ {
+ OFF,
+ HALF,
+ FULL
+ }
+ public enum EWindowMovieMode
+ {
+ OFF = 0,
+ 蟾ヲ荳 = 1,
+ 荳ュ螟ョ荳 = 2
+ }
+ public enum E繝繝。繝シ繧ク繝ャ繝吶Ν
+ {
+ 蟆代↑縺 = 0,
+ 譎ョ騾 = 1,
+ 螟ァ縺阪> = 2
+ }
+ public enum E繝代ャ繝 // 貍泌・冗畑縺ョenum縲ゅ%縺薙r菫ョ豁」縺吶k縺ィ縺阪ッ縲∵ャ。縺ォ蜃コ縺ヲ縺上k EKeyConfigPad 縺ィ E繝代ャ繝宇lag 繧ゅそ繝繝医〒菫ョ豁」縺吶k縺薙→縲
+ {
+ HH = 0,
+ R = 0,
+ SD = 1,
+ G = 1,
+ BD = 2,
+ B = 2,
+ HT = 3,
+ Pick = 3,
+ LT = 4,
+ Wail = 4,
+ FT = 5,
+ Cancel = 5,
+ CY = 6,
+ Decide = 6,
+ HHO = 7,
+ RD = 8,
+ LC = 9,
+ LP = 10, // #27029 2012.1.4 from
+ LBD = 11,
+ LRed = 12,
+ RRed = 13,
+ LBlue = 14,
+ RBlue = 15,
+ LRed2P = 16,
+ RRed2P = 17,
+ LBlue2P = 18,
+ RBlue2P = 19,
+ MAX, // 髢逡ェ逕ィ縺ィ縺励※螳夂セゥ
+ UNKNOWN = 99
+ }
+ public enum EKeyConfigPad // #24609 繧ュ繝シ繧ウ繝ウ繝輔ぅ繧ー縺ァ菴ソ縺enum縲Dapture隕∫エ縺ゅj縲
+ {
+ HH = E繝代ャ繝.HH,
+ R = E繝代ャ繝.R,
+ SD = E繝代ャ繝.SD,
+ G = E繝代ャ繝.G,
+ BD = E繝代ャ繝.BD,
+ B = E繝代ャ繝.B,
+ HT = E繝代ャ繝.HT,
+ Pick = E繝代ャ繝.Pick,
+ LT = E繝代ャ繝.LT,
+ Wail = E繝代ャ繝.Wail,
+ FT = E繝代ャ繝.FT,
+ Cancel = E繝代ャ繝.Cancel,
+ CY = E繝代ャ繝.CY,
+ Decide = E繝代ャ繝.Decide,
+ HHO = E繝代ャ繝.HHO,
+ RD = E繝代ャ繝.RD,
+ LC = E繝代ャ繝.LC,
+ LP = E繝代ャ繝.LP, // #27029 2012.1.4 from
+ LBD = E繝代ャ繝.LBD,
+ LRed = E繝代ャ繝.LRed,
+ RRed = E繝代ャ繝.RRed,
+ LBlue = E繝代ャ繝.LBlue,
+ RBlue = E繝代ャ繝.RBlue,
+ LRed2P = E繝代ャ繝.LRed2P,
+ RRed2P = E繝代ャ繝.RRed2P,
+ LBlue2P = E繝代ャ繝.LBlue2P,
+ RBlue2P = E繝代ャ繝.RBlue2P,
+ Capture,
+ UNKNOWN = E繝代ャ繝.UNKNOWN
+ }
+ [Flags]
+ public enum E繝代ャ繝宇lag // #24063 2011.1.16 yyagi 繧ウ繝槭Φ繝牙・蜉帷畑 繝代ャ繝牙・蜉帙ョ繝輔Λ繧ー蛹
+ {
+ None = 0,
+ HH = 1,
+ R = 1,
+ SD = 2,
+ G = 2,
+ B = 4,
+ BD = 4,
+ HT = 8,
+ Pick = 8,
+ LT = 16,
+ Wail = 16,
+ FT = 32,
+ Cancel = 32,
+ CY = 64,
+ Decide = 128,
+ HHO = 128,
+ RD = 256,
+ LC = 512,
+ LP = 1024, // #27029
+ LBD = 2048,
+ LRed = 0,
+ RRed = 1,
+ LBlue = 2,
+ RBlue = 4,
+ LRed2P = 8,
+ RRed2P = 16,
+ LBlue2P = 32,
+ RBlue2P = 64,
+ UNKNOWN = 4096
+ }
+ public enum E繝ゥ繝ウ繝繝繝「繝シ繝
+ {
+ OFF,
+ RANDOM,
+ MIRROR,
+ SUPERRANDOM,
+ HYPERRANDOM
+ }
+ public enum E讌ス蝎ィ繝代シ繝 // 縺薙%繧剃ソョ豁」縺吶k縺ィ縺阪ッ縲√そ繝繝医〒谺。縺ョ EKeyConfigPart 繧ゆソョ豁」縺吶k縺薙→縲
+ {
+ DRUMS = 0,
+ GUITAR = 1,
+ BASS = 2,
+ TAIKO = 3,
+ UNKNOWN = 99
+ }
+ public enum EKeyConfigPart // : E讌ス蝎ィ繝代シ繝
+ {
+ DRUMS = E讌ス蝎ィ繝代シ繝.DRUMS,
+ GUITAR = E讌ス蝎ィ繝代シ繝.GUITAR,
+ BASS = E讌ス蝎ィ繝代シ繝.BASS,
+ TAIKO = E讌ス蝎ィ繝代シ繝.TAIKO,
+ SYSTEM,
+ UNKNOWN = E讌ス蝎ィ繝代シ繝.UNKNOWN
+ }
+
+ public enum E謇薙■蛻縺第凾縺ョ蜀咲函縺ョ蜆ェ蜈磯菴
+ {
+ Chip縺訓ad繧医j蜆ェ蜈,
+ Pad縺靴hip繧医j蜆ェ蜈
+ }
+ internal enum E蜈・蜉帙ョ繝舌う繧ケ
+ {
+ 繧ュ繝シ繝懊シ繝 = 0,
+ MIDI蜈・蜉 = 1,
+ 繧ク繝ァ繧、繝代ャ繝 = 2,
+ 繝槭え繧ケ = 3,
+ 荳肴 = -1
+ }
+ public enum E蛻、螳
+ {
+ Perfect = 0,
+ Great = 1,
+ Good = 2,
+ Poor = 3,
+ Miss = 4,
+ Bad = 5,
+ Auto
+ }
+ internal enum E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ
+ {
+ 陦ィ遉コOFF,
+ 繝ャ繝シ繝ウ荳,
+ 蛻、螳壹Λ繧、繝ウ荳,
+ 繧ウ繝ウ繝應ク
+ }
+ internal enum E蛻、螳壻ス咲スョ
+ {
+ 讓呎コ = 0,
+ Lower,
+ MAX
+ }
+ internal enum E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ
+ {
+ Chip繧医j荳,
+ Chip繧医j荳
+ }
+ internal enum EAVI遞ョ蛻・
+ {
+ Unknown,
+ AVI,
+ AVIPAN
+ }
+ internal enum EBGA遞ョ蛻・
+ {
+ Unknown,
+ BMP,
+ BMPTEX,
+ BGA,
+ BGAPAN
+ }
+ internal enum EFIFO繝「繝シ繝
+ {
+ 繝輔ぉ繝シ繝峨う繝ウ,
+ 繝輔ぉ繝シ繝峨い繧ヲ繝
+ }
+ internal enum E繝ャ繝シ繝ウ
+ {
+ LC = 0,
+ HH,
+ SD,
+ BD,
+ HT,
+ LT,
+ FT,
+ CY,
+ LP,
+ RD, // 蟆譚・縺ョ迢ャ遶九Ξ繝シ繝ウ蛹/迢ャ遶帰UTO險ュ螳壹r隕玖カ翫@縺ヲ霑ス蜉
+ LBD = 10,
+ Guitar, // AUTO繝ャ繝シ繝ウ蛻、螳壹r螳ケ譏薙↓縺吶k縺溘a縲∽セソ螳應ク雁ョ夂セゥ縺励※縺翫¥(譛ェ菴ソ逕ィ)
+ Bass, // (譛ェ菴ソ逕ィ)
+ GtR,
+ GtG,
+ GtB,
+ GtPick,
+ GtW,
+ BsR,
+ BsG,
+ BsB,
+ BsPick,
+ BsW,
+ MAX, // 隕∫エ謨ー蜿門セ励ョ縺溘a縺ョ螳夂セゥ ("BGM"縺ッ菴ソ繧上↑縺蜑肴署縺ァ)
+ BGM
+ }
+ internal enum E繝ャ繝シ繝ウ謨ー
+ {
+ 迚ゥ逅 = 8, // LC, HH, SD, BD, HT, LT, FT, CY
+ 隲也炊 = 10, // LC, HO, HC, SD, BD, HT, LT, FT, RC, RD
+ DTXG迚ゥ逅 = 10, // LC, HH, LP, SD, BD, HT, LT, FT, CY, RD
+ DTXG隲也炊 = 12 // LC, HO, HC, LP, LB, SD, BD, HT, LT, FT, CY, RD
+ }
+ internal enum E繝ュ繧ー蜃コ蜉
+ {
+ OFF,
+ ON騾壼クク,
+ ON隧ウ邏ー縺ゅj
+ }
+ internal enum E貍泌・冗判髱「縺ョ謌サ繧雁、
+ {
+ 邯咏カ,
+ 貍泌・丈クュ譁ュ,
+ 繧ケ繝繝シ繧ク螟ア謨,
+ 繧ケ繝繝シ繧ク繧ッ繝ェ繧「,
+ 蜀崎ェュ霎シ_蜀肴シ泌・,
+ 蜀肴シ泌・
+ }
+ internal enum E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、
+ {
+ 邯咏カ = 0,
+ 隱ュ霎シ螳御コ,
+ 隱ュ霎シ荳ュ豁「
+ }
+
+ public enum ENoteState
+ {
+ none,
+ wait,
+ perfect,
+ grade,
+ bad
+ }
+
+ public enum E騾」謇鉄tate
+ {
+ none,
+ roll,
+ rollB,
+ balloon,
+ potato
+ }
+
+ public enum E繧ケ繝繝ォ繧ケ繝「繝シ繝
+ {
+ OFF = 0,
+ DORON = 1,
+ STEALTH = 2
+ }
+
+ ///
+ /// 騾乗弱メ繝繝励ョ遞ョ鬘
+ ///
+ public enum EInvisible
+ {
+ OFF, // 繝√ャ繝励r騾乗主喧縺励↑縺
+ SEMI, // Poor/Miss譎ゅ□縺代∽ク譎ら噪縺ォ騾乗手ァ」髯、縺吶k
+ FULL // 繝√ャ繝励r蟶ク縺ォ騾乗主喧縺吶k
+ }
+
+ ///
+ /// Drum/Guitar/Bass 縺ョ蛟、繧呈桶縺豎守畑縺ョ讒矩菴薙
+ ///
+ /// 蛟、縺ョ蝙九
+ [Serializable]
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STDGBVALUE // index縺ッE讌ス蝎ィ繝代シ繝医→荳閾エ縺輔○繧九%縺ィ
+ {
+ public T Drums;
+ public T Guitar;
+ public T Bass;
+ public T Taiko;
+ public T Unknown;
+ public T this[ int index ]
+ {
+ get
+ {
+ switch( index )
+ {
+ case (int) E讌ス蝎ィ繝代シ繝.DRUMS:
+ return this.Drums;
+
+ case (int) E讌ス蝎ィ繝代シ繝.GUITAR:
+ return this.Guitar;
+
+ case (int) E讌ス蝎ィ繝代シ繝.BASS:
+ return this.Bass;
+
+ case (int) E讌ス蝎ィ繝代シ繝.TAIKO:
+ return this.Taiko;
+
+ case (int) E讌ス蝎ィ繝代シ繝.UNKNOWN:
+ return this.Unknown;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch( index )
+ {
+ case (int) E讌ス蝎ィ繝代シ繝.DRUMS:
+ this.Drums = value;
+ return;
+
+ case (int) E讌ス蝎ィ繝代シ繝.GUITAR:
+ this.Guitar = value;
+ return;
+
+ case (int) E讌ス蝎ィ繝代シ繝.BASS:
+ this.Bass = value;
+ return;
+
+ case (int) E讌ス蝎ィ繝代シ繝.TAIKO:
+ this.Taiko = value;
+ return;
+
+ case (int) E讌ス蝎ィ繝代シ繝.UNKNOWN:
+ this.Unknown = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+
+ ///
+ /// 繝ャ繝シ繝ウ縺ョ蛟、繧呈桶縺豎守畑縺ョ讒矩菴薙ょ玲嫌蝙"E繝峨Λ繝繝ャ繝シ繝ウ"縺ォ貅匁侠縲
+ ///
+ /// 蛟、縺ョ蝙九
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STLANEVALUE
+ {
+ public T LC;
+ public T HH;
+ public T SD;
+ public T LP;
+ public T LBD;
+ public T BD;
+ public T HT;
+ public T LT;
+ public T FT;
+ public T CY;
+ public T RD;
+ public T Guitar;
+ public T Bass;
+ public T GtR;
+ public T GtG;
+ public T GtB;
+ public T GtPick;
+ public T GtW;
+ public T BsR;
+ public T BsG;
+ public T BsB;
+ public T BsPick;
+ public T BsW;
+ public T BGM;
+
+ public T this[ int index ]
+ {
+ get
+ {
+ switch ( index )
+ {
+ case (int) E繝ャ繝シ繝ウ.LC:
+ return this.LC;
+ case (int) E繝ャ繝シ繝ウ.HH:
+ return this.HH;
+ case (int) E繝ャ繝シ繝ウ.SD:
+ return this.SD;
+ case (int) E繝ャ繝シ繝ウ.LP:
+ return this.LP;
+ case (int) E繝ャ繝シ繝ウ.LBD:
+ return this.LBD;
+ case (int) E繝ャ繝シ繝ウ.BD:
+ return this.BD;
+ case (int) E繝ャ繝シ繝ウ.HT:
+ return this.HT;
+ case (int) E繝ャ繝シ繝ウ.LT:
+ return this.LT;
+ case (int) E繝ャ繝シ繝ウ.FT:
+ return this.FT;
+ case (int) E繝ャ繝シ繝ウ.CY:
+ return this.CY;
+ case (int) E繝ャ繝シ繝ウ.RD:
+ return this.RD;
+ case (int) E繝ャ繝シ繝ウ.Guitar:
+ return this.Guitar;
+ case (int) E繝ャ繝シ繝ウ.Bass:
+ return this.Bass;
+ case (int) E繝ャ繝シ繝ウ.GtR:
+ return this.GtR;
+ case (int) E繝ャ繝シ繝ウ.GtG:
+ return this.GtG;
+ case (int) E繝ャ繝シ繝ウ.GtB:
+ return this.GtB;
+ case (int) E繝ャ繝シ繝ウ.GtPick:
+ return this.GtPick;
+ case (int) E繝ャ繝シ繝ウ.GtW:
+ return this.GtW;
+ case (int) E繝ャ繝シ繝ウ.BsR:
+ return this.BsR;
+ case (int) E繝ャ繝シ繝ウ.BsG:
+ return this.BsG;
+ case (int) E繝ャ繝シ繝ウ.BsB:
+ return this.BsB;
+ case (int) E繝ャ繝シ繝ウ.BsPick:
+ return this.BsPick;
+ case (int) E繝ャ繝シ繝ウ.BsW:
+ return this.BsW;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch ( index )
+ {
+ case (int) E繝ャ繝シ繝ウ.LC:
+ this.LC = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.HH:
+ this.HH = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.SD:
+ this.SD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.LP:
+ this.LP = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.LBD:
+ this.LBD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BD:
+ this.BD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.HT:
+ this.HT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.LT:
+ this.LT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.FT:
+ this.FT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.CY:
+ this.CY = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.RD:
+ this.RD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.Guitar:
+ this.Guitar = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.Bass:
+ this.Bass = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtR:
+ this.GtR = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtG:
+ this.GtG = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtB:
+ this.GtB = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtPick:
+ this.GtPick = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtW:
+ this.GtW = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsR:
+ this.BsR = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsG:
+ this.BsG = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsB:
+ this.BsB = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsPick:
+ this.BsPick = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsW:
+ this.BsW = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+
+
+ [StructLayout( LayoutKind.Sequential )]
+ public struct STAUTOPLAY // E繝ャ繝シ繝ウ縺ィindex繧剃ク閾エ縺輔○繧九%縺ィ
+ {
+ public bool LC; // 0
+ public bool HH; // 1
+ public bool SD; // 2
+ public bool BD; // 3
+ public bool HT; // 4
+ public bool LT; // 5
+ public bool FT; // 6
+ public bool CY; // 7
+ public bool LP;
+ public bool RD; // 8
+ public bool LBD;
+ public bool Guitar; // 9 (not used)
+ public bool Bass; // 10 (not used)
+ public bool GtR; // 11
+ public bool GtG; // 12
+ public bool GtB; // 13
+ public bool GtPick; // 14
+ public bool GtW; // 15
+ public bool BsR; // 16
+ public bool BsG; // 17
+ public bool BsB; // 18
+ public bool BsPick; // 19
+ public bool BsW; // 20
+ public bool this[ int index ]
+ {
+ get
+ {
+ switch ( index )
+ {
+ case (int) E繝ャ繝シ繝ウ.LC:
+ return this.LC;
+ case (int) E繝ャ繝シ繝ウ.HH:
+ return this.HH;
+ case (int) E繝ャ繝シ繝ウ.SD:
+ return this.SD;
+ case (int) E繝ャ繝シ繝ウ.BD:
+ return this.BD;
+ case (int) E繝ャ繝シ繝ウ.HT:
+ return this.HT;
+ case (int) E繝ャ繝シ繝ウ.LT:
+ return this.LT;
+ case (int) E繝ャ繝シ繝ウ.FT:
+ return this.FT;
+ case (int) E繝ャ繝シ繝ウ.CY:
+ return this.CY;
+ case (int) E繝ャ繝シ繝ウ.LP:
+ return this.LP;
+ case (int) E繝ャ繝シ繝ウ.RD:
+ return this.RD;
+ case (int) E繝ャ繝シ繝ウ.LBD:
+ return this.LBD;
+ case (int) E繝ャ繝シ繝ウ.Guitar:
+ if ( !this.GtR ) return false;
+ if ( !this.GtG ) return false;
+ if ( !this.GtB ) return false;
+ if ( !this.GtPick ) return false;
+ if ( !this.GtW ) return false;
+ return true;
+ case (int) E繝ャ繝シ繝ウ.Bass:
+ if ( !this.BsR ) return false;
+ if ( !this.BsG ) return false;
+ if ( !this.BsB) return false;
+ if ( !this.BsPick ) return false;
+ if ( !this.BsW ) return false;
+ return true;
+ case (int) E繝ャ繝シ繝ウ.GtR:
+ return this.GtR;
+ case (int) E繝ャ繝シ繝ウ.GtG:
+ return this.GtG;
+ case (int) E繝ャ繝シ繝ウ.GtB:
+ return this.GtB;
+ case (int) E繝ャ繝シ繝ウ.GtPick:
+ return this.GtPick;
+ case (int) E繝ャ繝シ繝ウ.GtW:
+ return this.GtW;
+ case (int) E繝ャ繝シ繝ウ.BsR:
+ return this.BsR;
+ case (int) E繝ャ繝シ繝ウ.BsG:
+ return this.BsG;
+ case (int) E繝ャ繝シ繝ウ.BsB:
+ return this.BsB;
+ case (int) E繝ャ繝シ繝ウ.BsPick:
+ return this.BsPick;
+ case (int) E繝ャ繝シ繝ウ.BsW:
+ return this.BsW;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch ( index )
+ {
+ case (int) E繝ャ繝シ繝ウ.LC:
+ this.LC = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.HH:
+ this.HH = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.SD:
+ this.SD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BD:
+ this.BD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.HT:
+ this.HT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.LT:
+ this.LT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.FT:
+ this.FT = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.CY:
+ this.CY = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.LP:
+ this.LP = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.RD:
+ this.RD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.LBD:
+ this.LBD = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.Guitar:
+ this.GtR = this.GtG = this.GtB = this.GtPick = this.GtW = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.Bass:
+ this.BsR = this.BsG = this.BsB = this.BsPick = this.BsW = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtR:
+ this.GtR = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtG:
+ this.GtG = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtB:
+ this.GtB = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtPick:
+ this.GtPick = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.GtW:
+ this.GtW = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsR:
+ this.BsR = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsG:
+ this.BsG = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsB:
+ this.BsB = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsPick:
+ this.BsPick = value;
+ return;
+ case (int) E繝ャ繝シ繝ウ.BsW:
+ this.BsW = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+
+ #region[Ver.K霑ス蜉]
+ public enum E繝ャ繝シ繝ウ繧ソ繧、繝
+ {
+ TypeA,
+ TypeB,
+ TypeC,
+ TypeD
+ }
+ public enum E繝溘Λ繝シ
+ {
+ TypeA,
+ TypeB
+ }
+ public enum EClipDispType
+ {
+ 閭梧勹縺ョ縺ソ = 1,
+ 繧ヲ繧」繝ウ繝峨え縺ョ縺ソ = 2,
+ 荳。譁ケ = 3,
+ OFF = 0
+ }
+ #endregion
+
+ internal class C螳壽焚
+ {
+ }
+}
diff --git a/TJAPlayer3/Common/C譁蟄励さ繝ウ繧ス繝シ繝ォ.cs b/TJAPlayer3/Common/C譁蟄励さ繝ウ繧ス繝シ繝ォ.cs
new file mode 100644
index 00000000..262ee656
--- /dev/null
+++ b/TJAPlayer3/Common/C譁蟄励さ繝ウ繧ス繝シ繝ォ.cs
@@ -0,0 +1,128 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing;
+using FDK;
+
+namespace TJAPlayer3
+{
+ internal class C譁蟄励さ繝ウ繧ス繝シ繝ォ : CActivity
+ {
+ // 螳壽焚
+
+ public enum E繝輔か繝ウ繝育ィョ蛻・
+ {
+ 逋ス,
+ 襍、,
+ 轣ー,
+ 逋ス邏ー,
+ 襍、邏ー,
+ 轣ー邏ー
+ }
+ public enum E驟咲スョ
+ {
+ 蟾ヲ隧ー,
+ 荳ュ螟ョ,
+ 蜿ウ隧ー
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void tPrint( int x, int y, E繝輔か繝ウ繝育ィョ蛻・ font, string str闍ア謨ー蟄玲枚蟄怜 )
+ {
+ if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 && !string.IsNullOrEmpty( str闍ア謨ー蟄玲枚蟄怜 ) )
+ {
+ int BOL = x;
+ for( int i = 0; i < str闍ア謨ー蟄玲枚蟄怜.Length; i++ )
+ {
+ char ch = str闍ア謨ー蟄玲枚蟄怜夕 i ];
+ if( ch == '\n' )
+ {
+ x = BOL;
+ y += nFontHeight;
+ }
+ else
+ {
+ int index = str陦ィ險伜庄閭ス譁蟄.IndexOf( ch );
+ if( index < 0 )
+ {
+ x += nFontWidth;
+ }
+ else
+ {
+ if( this.tx繝輔か繝ウ繝8x16[ (int) ( (int) font / (int) E繝輔か繝ウ繝育ィョ蛻・.逋ス邏ー ) ] != null )
+ {
+ this.tx繝輔か繝ウ繝8x16[ (int) ( (int) font / (int) E繝輔か繝ウ繝育ィョ蛻・.逋ス邏ー ) ].t2D謠冗判( TJAPlayer3.app.Device, x, y, this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ (int) ( (int) font % (int) E繝輔か繝ウ繝育ィョ蛻・.逋ス邏ー ), index ] );
+ }
+ x += nFontWidth;
+ }
+ }
+ }
+ }
+ }
+
+
+ // CActivity 螳溯」
+
+ public override void On豢サ諤ァ蛹()
+ {
+ this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺 = new Rectangle[3, str陦ィ險伜庄閭ス譁蟄.Length ];
+ for( int i = 0; i < 3; i++ )
+ {
+ for (int j = 0; j < str陦ィ險伜庄閭ス譁蟄.Length; j++)
+ {
+ const int regionX = 128, regionY = 16;
+ this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].X = ( ( i / 2 ) * regionX ) + ( ( j % regionY ) * nFontWidth );
+ this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].Y = ( ( i % 2 ) * regionX ) + ( ( j / regionY ) * nFontHeight );
+ this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].Width = nFontWidth;
+ this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].Height = nFontHeight;
+ }
+ }
+ base.On豢サ諤ァ蛹();
+ }
+ public override void On髱樊エサ諤ァ蛹()
+ {
+ if( this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺 != null )
+ this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺 = null;
+
+ base.On髱樊エサ諤ァ蛹();
+ }
+ public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()
+ {
+ if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ {
+ this.tx繝輔か繝ウ繝8x16[ 0 ] = TJAPlayer3.Tx.TxC(@"Console_Font.png");
+ this.tx繝輔か繝ウ繝8x16[ 1 ] = TJAPlayer3.Tx.TxC(@"Console_Font_Small.png");
+ base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ }
+ }
+ public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()
+ {
+ if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 )
+ {
+ for( int i = 0; i < 2; i++ )
+ {
+ if( this.tx繝輔か繝ウ繝8x16[ i ] != null )
+ {
+ this.tx繝輔か繝ウ繝8x16[ i ].Dispose();
+ this.tx繝輔か繝ウ繝8x16[ i ] = null;
+ }
+ }
+ base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ }
+ }
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private Rectangle[,] rc譁蟄励ョ遏ゥ蠖「鬆伜沺;
+ private const string str陦ィ險伜庄閭ス譁蟄 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ";
+ private const int nFontWidth = 8, nFontHeight = 16;
+ private CTexture[] tx繝輔か繝ウ繝8x16 = new CTexture[ 2 ];
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Common/Discord.cs b/TJAPlayer3/Common/Discord.cs
new file mode 100644
index 00000000..d806ba8c
--- /dev/null
+++ b/TJAPlayer3/Common/Discord.cs
@@ -0,0 +1,180 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace TJAPlayer3
+{
+ public static class DiscordRpc
+ {
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)]
+ public delegate void ReadyCallback();
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)]
+ public delegate void DisconnectedCallback(int errorCode, string message);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)]
+ public delegate void ErrorCallback(int errorCode, string message);
+
+ public struct EventHandlers
+ {
+ public ReadyCallback readyCallback;
+ public DisconnectedCallback disconnectedCallback;
+ public ErrorCallback errorCallback;
+ }
+
+ [Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ public struct RichPresence
+ {
+ public IntPtr state;
+ public IntPtr details;
+ public long startTimestamp;
+ public long endTimestamp;
+ public IntPtr largeImageKey;
+ public IntPtr largeImageText;
+ public IntPtr smallImageKey;
+ public IntPtr smallImageText;
+ public IntPtr partyId;
+ public int partySize;
+ public int partyMax;
+ public IntPtr matchSecret;
+ public IntPtr joinSecret;
+ public IntPtr spectateSecret;
+ public bool instance;
+ }
+
+ [DllImport("discord-rpc", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId);
+
+ [DllImport("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void Shutdown();
+
+ [DllImport("discord-rpc", EntryPoint = "Discord_RunCallbacks", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void RunCallbacks();
+
+ [DllImport("discord-rpc", EntryPoint = "Discord_UpdatePresence", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void UpdatePresence(ref RichPresence presence);
+
+ [DllImport("discord-rpc", EntryPoint = "Discord_ClearPresence", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void ClearPresence();
+
+ [DllImport("discord-rpc", EntryPoint = "Discord_UpdateHandlers", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void UpdateHandlers(ref EventHandlers handlers);
+ }
+
+ public static class Discord
+ {
+
+ private static readonly List _buffers = new List(10);
+
+ ///
+ /// Discord Rich Presence縺ョ蛻晄悄蛹悶r縺励∪縺吶
+ ///
+ /// Discord API縺ョ繧ッ繝ゥ繧、繧「繝ウ繝ID縲
+ public static void Initialize(string clientId)
+ {
+ var handlers = new DiscordRpc.EventHandlers();
+ handlers.readyCallback = ReadyCallback;
+ handlers.disconnectedCallback += DisconnectedCallback;
+ handlers.errorCallback += ErrorCallback;
+
+ DiscordRpc.Initialize(clientId, ref handlers, true, null);
+
+ }
+
+ ///
+ /// Discord Rich Presence縺ョ譖エ譁ー繧偵@縺セ縺吶
+ ///
+ /// 迴セ蝨ィ縺ョ隱ャ譏弱
+ /// 迴セ蝨ィ縺ョ迥カ諷九
+ /// 髢句ァ区凾髢(Unix譎る俣)
+ /// 邨ゆコ譎る俣(Unix譎る俣)
+ /// 蟆上&縺ェ繧「繧、繧ウ繝ウ逕ィ繧ュ繝シ縲
+ /// 蟆上&縺ェ繧「繧、繧ウ繝ウ縺ョ繝繝シ繝ォ繝√ャ繝励↓陦ィ遉コ縺吶k繝繧ュ繧ケ繝医
+ public static void UpdatePresence(string details, string state, long startTimeStamp = 0, long endTimeStamp = 0, string smallImageKey = null, string smallImageText = null)
+ {
+ var presence = new DiscordRpc.RichPresence();
+ presence.details = StrToPtr(details);
+ presence.state = StrToPtr(state);
+
+ if (startTimeStamp != 0) presence.startTimestamp = startTimeStamp;
+ if (endTimeStamp != 0) presence.endTimestamp = endTimeStamp;
+ presence.largeImageKey = StrToPtr("rewrite");
+ presence.largeImageText = StrToPtr("Ver." + TJAPlayer3.VERSION);
+ if (!string.IsNullOrEmpty(smallImageKey)) presence.smallImageKey = StrToPtr(smallImageKey);
+ if (!string.IsNullOrEmpty(smallImageText)) presence.smallImageText = StrToPtr(smallImageText);
+
+ DiscordRpc.UpdatePresence(ref presence);
+ FreeMem();
+ }
+
+ ///
+ /// Discord Rich Presence縺ョ繧キ繝」繝繝医ム繧ヲ繝ウ繧定。後>縺セ縺吶
+ /// 邨ゆコ譎ゅ↓蠢縺壼他縺ウ蜃コ縺吝ソ隕√′縺ゅj縺セ縺吶
+ ///
+ public static void Shutdown()
+ {
+ DiscordRpc.Shutdown();
+ Trace.TraceInformation("[Discord] Shutdowned.");
+ }
+
+ private static void ReadyCallback()
+ {
+ Trace.TraceInformation("[Discord] Ready.");
+ }
+
+ ///
+ /// Discord縺ィ縺ョ謗・邯壹′蛻譁ュ縺輔l縺溷エ蜷亥他縺ウ蜃コ縺輔l縺セ縺吶
+ ///
+ /// 繧ィ繝ゥ繝シ繧ウ繝シ繝峨
+ /// 繧ィ繝ゥ繝シ繝。繝繧サ繝シ繧ク縲
+ private static void DisconnectedCallback(int errorCode, string message)
+ {
+ Trace.TraceInformation("[Discord] Disconnected.");
+ }
+
+ ///
+ /// Discord縺ィ縺ョ謗・邯壹〒繧ィ繝ゥ繝シ縺檎匱逕溘@縺溷エ蜷亥他縺ウ蜃コ縺輔l縺セ縺吶
+ ///
+ /// 繧ィ繝ゥ繝シ繧ウ繝シ繝峨
+ /// 繧ィ繝ゥ繝シ繝。繝繧サ繝シ繧ク縲
+ private static void ErrorCallback(int errorCode, string message)
+ {
+ Trace.TraceInformation("[Discord] Error occured: {0} {1}", errorCode, message);
+ }
+
+ // string蝙九ョ譁蟄怜励r繝昴う繝ウ繧ソ縺ァ蜿らァ縺輔○繧九h縺縺ォ縺吶k縺溘a縺ョ繝。繧ス繝繝峨
+ private static IntPtr StrToPtr(string input)
+ {
+ if (string.IsNullOrEmpty(input)) return IntPtr.Zero;
+ var convbytecnt = Encoding.UTF8.GetByteCount(input);
+ var buffer = Marshal.AllocHGlobal(convbytecnt + 1);
+ for (int i = 0; i < convbytecnt + 1; i++)
+ {
+ Marshal.WriteByte(buffer, i, 0);
+ }
+ _buffers.Add(buffer);
+ Marshal.Copy(Encoding.UTF8.GetBytes(input), 0, buffer, convbytecnt);
+ return buffer;
+ }
+
+ internal static void FreeMem()
+ {
+ for (var i = _buffers.Count - 1; i >= 0; i--)
+ {
+ Marshal.FreeHGlobal(_buffers[i]);
+ _buffers.RemoveAt(i);
+ }
+ }
+
+ ///
+ /// 迴セ蝨ィ縺ョUnix譎る俣繧値ong蝙九〒霑斐@縺セ縺吶
+ ///
+ /// Unix譎る俣縲
+ public static long GetUnixTime()
+ {
+ return (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).Ticks / 10000000;
+ }
+ }
+}
diff --git a/TJAPlayer3/Common/Easing.cs b/TJAPlayer3/Common/Easing.cs
new file mode 100644
index 00000000..dc863fea
--- /dev/null
+++ b/TJAPlayer3/Common/Easing.cs
@@ -0,0 +1,117 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using TJAPlayer3;
+using FDK;
+
+namespace TJAPlayer3
+{
+ class Easing
+ {
+ public int EaseIn(CCounter counter, int startPoint, int endPoint, CalcType type)
+ {
+ StartPoint = startPoint;
+ EndPoint = endPoint;
+ Sa = EndPoint - StartPoint;
+ TimeMs = (int)counter.n邨ゆコ蛟、;
+ Type = type;
+ CounterValue = counter.n迴セ蝨ィ縺ョ蛟、;
+
+ switch (Type)
+ {
+ case CalcType.Quadratic: //Quadratic
+ CounterValue /= TimeMs;
+ Value = Sa * CounterValue * CounterValue + StartPoint;
+ break;
+ case CalcType.Cubic: //Cubic
+ CounterValue /= TimeMs;
+ Value = Sa * CounterValue * CounterValue * CounterValue + StartPoint;
+ break;
+ case CalcType.Quartic: //Quartic
+ CounterValue /= TimeMs;
+ Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint;
+ break;
+ case CalcType.Quintic: //Quintic
+ CounterValue /= TimeMs;
+ Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint;
+ break;
+ case CalcType.Sinusoidal: //Sinusoidal
+ Value = -Sa * Math.Cos(CounterValue / TimeMs * (Math.PI / 2)) + Sa + StartPoint;
+ break;
+ case CalcType.Exponential: //Exponential
+ Value = Sa * Math.Pow(2, 10 * (CounterValue / TimeMs - 1)) + StartPoint;
+ break;
+ case CalcType.Circular: //Circular
+ CounterValue /= TimeMs;
+ Value = -Sa * (Math.Sqrt(1 - CounterValue * CounterValue) - 1) + StartPoint;
+ break;
+ }
+
+ return (int)Value;
+ }
+ public int EaseOut(CCounter counter, int startPoint, int endPoint, CalcType type)
+ {
+ StartPoint = startPoint;
+ EndPoint = endPoint;
+ Sa = EndPoint - StartPoint;
+ TimeMs = (int)counter.n邨ゆコ蛟、;
+ Type = type;
+ CounterValue = counter.n迴セ蝨ィ縺ョ蛟、;
+
+ switch (Type)
+ {
+ case CalcType.Quadratic: //Quadratic
+ CounterValue /= TimeMs;
+ Value = -Sa * CounterValue * (CounterValue - 2) + StartPoint;
+ break;
+ case CalcType.Cubic: //Cubic
+ CounterValue /= TimeMs;
+ CounterValue--;
+ Value = Sa * (CounterValue * CounterValue * CounterValue + 1) + StartPoint;
+ break;
+ case CalcType.Quartic: //Quartic
+ CounterValue /= TimeMs;
+ CounterValue--;
+ Value = -Sa * (CounterValue * CounterValue * CounterValue * CounterValue - 1) + StartPoint;
+ break;
+ case CalcType.Quintic: //Quintic
+ CounterValue /= TimeMs;
+ CounterValue--;
+ Value = Sa * (CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + 1) + StartPoint;
+ break;
+ case CalcType.Sinusoidal: //Sinusoidal
+ Value = Sa * Math.Sin(CounterValue / TimeMs * (Math.PI / 2)) + StartPoint;
+ break;
+ case CalcType.Exponential: //Exponential
+ Value = Sa * (-Math.Pow(2, -10 * CounterValue / TimeMs) + 1) + StartPoint;
+ break;
+ case CalcType.Circular: //Circular
+ CounterValue /= TimeMs;
+ CounterValue--;
+ Value = Sa * Math.Sqrt(1 - CounterValue * CounterValue) + StartPoint;
+ break;
+ }
+
+ return (int)Value;
+ }
+
+ private int StartPoint;
+ private int EndPoint;
+ private int Sa;
+ private int TimeMs;
+ private CalcType Type;
+ private double CounterValue;
+ private double Value;
+ public enum CalcType
+ {
+ Quadratic,
+ Cubic,
+ Quartic,
+ Quintic,
+ Sinusoidal,
+ Exponential,
+ Circular
+ }
+ }
+}
\ No newline at end of file
diff --git a/TJAPlayer3/Common/KeyboardSoundGroupLevelControlHandler.cs b/TJAPlayer3/Common/KeyboardSoundGroupLevelControlHandler.cs
new file mode 100644
index 00000000..10c24063
--- /dev/null
+++ b/TJAPlayer3/Common/KeyboardSoundGroupLevelControlHandler.cs
@@ -0,0 +1,63 @@
+サソusing FDK;
+
+namespace TJAPlayer3
+{
+ ///
+ /// KeyboardSoundGroupLevelControlHandler is called by the song selection
+ /// and song play stages when handling keyboard input. By delegating to
+ /// this class they are able to support a centrally-managed and consistent
+ /// set of keyboard shortcuts for dynamically adjusting four sound group
+ /// levels:
+ /// - sound effect level, via Ctrl and either of the Minus or Equals keys
+ /// - voice level, via Shift and either of the Minus or Equals keys
+ /// - song preview and song playback level, via the Minus or Equals key
+ ///
+ /// When the sound group levels are adjusted in this manner, the
+ /// SoundGroupLevelController (and handlers bound to its events) ensure
+ /// that both the sound object group levels are updated and the application
+ /// configuration is updated. See ConfigIniToSoundGroupLevelControllerBinder
+ /// for more details on the latter.
+ ///
+ internal static class KeyboardSoundGroupLevelControlHandler
+ {
+ internal static void Handle(
+ IInputDevice keyboard,
+ SoundGroupLevelController soundGroupLevelController,
+ CSkin skin,
+ bool isSongPreview)
+ {
+ var isAdjustmentPositive = keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.RightBracket);
+ if (!(isAdjustmentPositive || keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.LeftBracket)))
+ {
+ return;
+ }
+
+ ESoundGroup soundGroup;
+ CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = null;
+
+ if (keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftControl) ||
+ keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightControl))
+ {
+ soundGroup = ESoundGroup.SoundEffect;
+ 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = skin.sound豎コ螳夐浹;
+ }
+ else if (keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftShift) ||
+ keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightShift))
+ {
+ soundGroup = ESoundGroup.Voice;
+ 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = skin.sound繧イ繝シ繝髢句ァ矩浹;
+ }
+ else if (isSongPreview)
+ {
+ soundGroup = ESoundGroup.SongPlayback;
+ }
+ else
+ {
+ soundGroup = ESoundGroup.SongPlayback;
+ }
+
+ soundGroupLevelController.AdjustLevel(soundGroup, isAdjustmentPositive);
+ 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝?.t蜀咲函縺吶k();
+ }
+ }
+}
diff --git a/TJAPlayer3/Common/NamePlateConfig.cs b/TJAPlayer3/Common/NamePlateConfig.cs
new file mode 100644
index 00000000..bd26bf80
--- /dev/null
+++ b/TJAPlayer3/Common/NamePlateConfig.cs
@@ -0,0 +1,35 @@
+サソusing System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace TJAPlayer3
+{
+ class NamePlateConfig
+ {
+ public void tNamePlateConfig()
+ {
+ if (!File.Exists("NamePlate.json"))
+ ConfigManager.SaveConfig(data, "NamePlate.json");
+
+ data = ConfigManager.GetConfig(@"NamePlate.json");
+ }
+
+ public class Data
+ {
+ public string[] Name = { "縺ゥ繧薙■繧繧", "縺九▲縺。繧繧" };
+ public string[] Title = { "縺ゥ繧薙■繧繧薙〒縺吶hシ", "縺九▲縺。繧繧薙〒縺吶hシ" };
+ public string[] Dan = { "驕比ココ", "驕比ココ" };
+
+ public bool[] DanGold = { false, true };
+
+ public int[] DanType = { 1, 2 };
+ public int[] TitleType = { 1, 2 };
+ }
+
+ public Data data = new Data();
+ }
+}
diff --git a/TJAPlayer3/Common/Program.cs b/TJAPlayer3/Common/Program.cs
new file mode 100644
index 00000000..34237244
--- /dev/null
+++ b/TJAPlayer3/Common/Program.cs
@@ -0,0 +1,244 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Threading;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.IO;
+using FDK;
+using System.Reflection;
+
+namespace TJAPlayer3
+{
+ internal class Program
+ {
+ #region [ 莠碁崎オキ蜍輔メ繧ァ繝繧ッ縲.LL蟄伜惠繝√ぉ繝繧ッ ]
+ //-----------------------------
+ private static Mutex mutex莠碁崎オキ蜍暮亟豁「逕ィ;
+
+ private static bool tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( string strDll蜷, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n, bool bLoadDllCheck )
+ {
+ string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜 = ( CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja" ) ?
+ str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p : str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n;
+ if ( bLoadDllCheck )
+ {
+ IntPtr hModule = LoadLibrary( strDll蜷 ); // 螳滄圀縺ォLoadDll()縺励※繝√ぉ繝繧ッ縺吶k
+ if ( hModule == IntPtr.Zero )
+ {
+ MessageBox.Show( str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜, "DTXMania runtime error", MessageBoxButtons.OK, MessageBoxIcon.Hand );
+ return false;
+ }
+ FreeLibrary( hModule );
+ }
+ else
+ { // 蜊倡エ斐↓繝輔ぃ繧、繝ォ縺ョ蟄伜惠譛臥┌繧偵メ繧ァ繝繧ッ縺吶k縺縺 (繝励Ο繧ク繧ァ繧ッ繝医〒縲悟盾辣ァ縲阪@縺ヲ縺縺溘j縲√い繝ウ繝槭ロ繝シ繧ク繝峨↑DLL縺梧囓鮟吶Μ繝ウ繧ッ縺輔l繧九b縺ョ縺ッ縺薙■繧)
+ string path = Path.Combine( System.IO.Directory.GetCurrentDirectory(), strDll蜷 );
+ if ( !File.Exists( path ) )
+ {
+ MessageBox.Show( str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜, "DTXMania runtime error", MessageBoxButtons.OK, MessageBoxIcon.Hand );
+ return false;
+ }
+ }
+ return true;
+ }
+ private static bool tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( string strDll蜷, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n )
+ {
+ return true;
+ //return tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( strDll蜷, str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p, str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n, false );
+ }
+
+ #region [DllImport]
+ [DllImport( "kernel32", CharSet = CharSet.Unicode, SetLastError = true )]
+ internal static extern void FreeLibrary( IntPtr hModule );
+
+ [DllImport( "kernel32", CharSet = CharSet.Unicode, SetLastError = true )]
+ internal static extern IntPtr LoadLibrary( string lpFileName );
+ #endregion
+ //-----------------------------
+ #endregion
+
+ [STAThread]
+ static void Main()
+ {
+ mutex莠碁崎オキ蜍暮亟豁「逕ィ = new Mutex( false, "DTXManiaMutex" );
+
+ if ( mutex莠碁崎オキ蜍暮亟豁「逕ィ.WaitOne( 0, false ) )
+ {
+ string newLine = Environment.NewLine;
+ bool bDLLnotfound = false;
+
+ Trace.WriteLine( "Current Directory: " + Environment.CurrentDirectory );
+ Trace.WriteLine( "EXE縺ョ縺ゅk繝輔か繝ォ繝: " + Path.GetDirectoryName( Application.ExecutablePath ) );
+
+ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
+
+
+ #region [DLL縺ョ蟄伜惠繝√ぉ繝繧ッ]
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\SlimDX" + TJAPlayer3.SLIMDXDLL + ".dll",
+ "SlimDX" + TJAPlayer3.SLIMDXDLL + ".dll 縺セ縺溘ッ縺昴ョ萓晏ュ倥☆繧掬ll縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "SlimDX" + TJAPlayer3.SLIMDXDLL + ".dll, or its depended DLL, is not found." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\FDK.dll",
+ "FDK.dll 縺セ縺溘ッ縺昴ョ萓晏ュ倥☆繧掬ll縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "FDK.dll, or its depended DLL, is not found." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\xadec.dll",
+ "xadec.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "xadec.dll is not found." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\SoundDecoder.dll",
+ "SoundDecoder.dll 縺セ縺溘ッ縺昴ョ萓晏ュ倥☆繧掬ll縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "SoundDecoder.dll, or its depended DLL, is not found." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( TJAPlayer3.D3DXDLL,
+ TJAPlayer3.D3DXDLL + " 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DirectX Redist 繝輔か繝ォ繝縺ョ DXSETUP.exe 繧貞ョ溯。後@縲" + newLine + "蠢隕√↑ DirectX 繝ゥ繝ウ繧ソ繧、繝繧偵う繝ウ繧ケ繝医シ繝ォ縺励※縺上□縺輔>縲",
+ TJAPlayer3.D3DXDLL + " is not found." + newLine + "Please execute DXSETUP.exe in \"DirectX Redist\" folder, to install DirectX runtimes required for DTXMania.",
+ true
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bass.dll",
+ "bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "baas.dll is not found." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\Bass.Net.dll",
+ "Bass.Net.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "Bass.Net.dll is not found." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bassmix.dll",
+ "bassmix.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Cassmix.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "bassmix.dll is not loaded. bassmix.dll or bass.dll must not exist." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bassasio.dll",
+ "bassasio.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Cassasio.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "bassasio.dll is not loaded. bassasio.dll or bass.dll must not exist." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\basswasapi.dll",
+ "basswasapi.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Casswasapi.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "basswasapi.dll is not loaded. basswasapi.dll or bass.dll must not exist." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bass_fx.dll",
+ "bass_fx.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Cass_fx.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "bass_fx.dll is not loaded. bass_fx.dll or bass.dll must not exist." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\DirectShowLib-2005.dll",
+ "DirectShowLib-2005.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲",
+ "DirectShowLib-2005.dll is not found." + newLine + "Please download DTXMania again."
+ ) ) bDLLnotfound = true;
+ #endregion
+ if ( !bDLLnotfound )
+ {
+#if DEBUG && TEST_ENGLISH
+ Thread.CurrentThread.CurrentCulture = new CultureInfo( "en-US" );
+#endif
+
+ DWM.EnableComposition( false ); // Disable AeroGrass temporally
+
+ // BEGIN #23670 2010.11.13 from: 繧ュ繝」繝繝√&繧後↑縺萓句、悶ッ謾セ蜃コ縺帙★縺ォ縲√Ο繧ー縺ォ隧ウ邏ー繧貞コ蜉帙☆繧九
+ // BEGIM #24606 2011.03.08 from: DEBUG 譎ゅッ萓句、也匱逕溽ョ謇繧堤峩謗・繝繝舌ャ繧ー縺ァ縺阪k繧医≧縺ォ縺吶k縺溘a縲∽セ句、悶r繧ュ繝」繝繝√@縺ェ縺繧医≧縺ォ縺吶k縲
+#if !DEBUG
+ try
+#endif
+ {
+ using ( var mania = new TJAPlayer3() )
+ mania.Run();
+
+ Trace.WriteLine( "" );
+ Trace.WriteLine( "驕翫s縺ァ縺上l縺ヲ縺ゅj縺後→縺シ" );
+ }
+#if !DEBUG
+ catch( Exception e )
+ {
+ Trace.WriteLine( "" );
+ Trace.Write( e.ToString() );
+ Trace.WriteLine( "" );
+ Trace.WriteLine( "繧ィ繝ゥ繝シ縺繧エ繝。繝ウシシ域カ" );
+ AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName();
+ MessageBox.Show( "繧ィ繝ゥ繝シ縺檎匱逕溘@縺セ縺励◆縲\n" +
+ e.ToString(), asmApp.Name + " Ver." + asmApp.Version.ToString().Substring(0, asmApp.Version.ToString().Length - 2) + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); // #23670 2011.2.28 yyagi to show error dialog
+ }
+#endif
+ // END #24606 2011.03.08 from
+ // END #23670 2010.11.13 from
+
+ if ( Trace.Listeners.Count > 1 )
+ Trace.Listeners.RemoveAt( 1 );
+ }
+
+ // BEGIN #24615 2011.03.09 from: Mutex.WaitOne() 縺 true 繧定ソ斐@縺溷エ蜷医ッ縲`utex 縺ョ繝ェ繝ェ繝シ繧ケ縺悟ソ隕√〒縺ゅk縲
+
+ mutex莠碁崎オキ蜍暮亟豁「逕ィ.ReleaseMutex();
+ mutex莠碁崎オキ蜍暮亟豁「逕ィ = null;
+
+ // END #24615 2011.03.09 from
+ }
+ else // DTXMania縺梧里縺ォ襍キ蜍穂クュ
+ {
+
+ // 竊 蠑墓焚縺0蛟九ョ譎ゅッ縺昴ョ縺セ縺セ邨ゆコ
+ // 1蛟( 繧ウ繝ウ繝代け繝医Δ繝シ繝 or DTXV -S) 縺2蛟 (DTXV -Nxxx 繝輔ぃ繧、繝ォ蜷)縺ョ縺ィ縺阪ッ縲√◎縺ョ繝励Ο繧サ繧ケ縺ォ繧ウ繝槭Φ繝峨Λ繧、繝ウ繧剃クク縲謚輔£縺ヲ邨ゆコ縺吶k
+
+ for ( int i = 0; i < 5; i++ ) // 讀懃エ「邨先棡縺ョ繝上Φ繝峨Ν縺兄ero縺ォ縺ェ繧九%縺ィ縺後≠繧九ョ縺ァ縲200ms髢馴囈縺ァ5蝗槭Μ繝医Λ繧、縺吶k
+ {
+ #region [ 譌「縺ォ襍キ蜍穂クュ縺ョDTXMania繝励Ο繧サ繧ケ繧呈、懃エ「縺吶k縲]
+ // 縺薙ョ繧繧頑婿縺縺ィ縲ヾhowInTaskbar=false縺ァ繧ソ繧ケ繧ッ繝舌シ縺ォ陦ィ遉コ縺輔l縺ェ縺繝代ち繝シ繝ウ縺ョ譎ゅ↓讀懃エ「縺ォ螟ア謨励☆繧九h縺縺縺
+ // DTXMania縺ァ縺昴ョ繝代ち繝シ繝ウ縺ッ縺ェ縺シ溘ョ縺ァ縺薙ョ縺セ縺セ縺縺上
+ // FindWindow繧剃スソ縺医ー縺薙ョ繝代ち繝シ繝ウ縺ォ繧ょッセ蠢懊〒縺阪k縺後,#縺ァ繝薙Ν繝峨☆繧九い繝励Μ縺ッ繧ヲ繧、繝ウ繝峨え繧ッ繝ゥ繧ケ蜷阪r閾ェ蜑肴欠螳壹〒縺阪↑縺縺ョ縺ァ縲√%繧後ッ菴ソ繧上↑縺縲
+
+ Process current = Process.GetCurrentProcess();
+ Process[] running = Process.GetProcessesByName( current.ProcessName );
+ Process target = null;
+ //IntPtr hWnd = FindWindow( null, "DTXMania .NET style release " + CDTXMania.VERSION );
+
+ foreach ( Process p in running )
+ {
+ if ( p.Id != current.Id ) // 繝励Ο繧サ繧ケ蜷阪ッ蜷後§縺ァ縺九▽縲√励Ο繧サ繧ケID縺瑚ェ蛻閾ェ霄ォ縺ィ縺ッ逡ー縺ェ繧九b縺ョ繧呈爾縺
+ {
+ if ( p.MainModule.FileName == current.MainModule.FileName && p.MainWindowHandle != IntPtr.Zero )
+ {
+ target = p;
+ break;
+ }
+ }
+ }
+ #endregion
+
+ #region [ 襍キ蜍穂クュ縺ョDTXMania縺後>繧後ー縲√◎縺ョ繝励Ο繧サ繧ケ縺ォ繧ウ繝槭Φ繝峨Λ繧、繝ウ繧呈兜縺偵k ]
+ if ( target != null )
+ {
+ string[] commandLineArgs = Environment.GetCommandLineArgs();
+ if ( commandLineArgs != null && commandLineArgs.Length > 1 )
+ {
+ string arg = null;
+ for ( int j = 1; j < commandLineArgs.Length; j++ )
+ {
+ if ( j == 1 )
+ {
+ arg += commandLineArgs[ j ];
+ }
+ else
+ {
+ arg += " " + "\"" + commandLineArgs[ j ] + "\"";
+ }
+ }
+
+//Trace.TraceInformation( "Message=" + arg + ", len(w/o null)=" + arg.Length );
+
+ if ( arg != null )
+ {
+ FDK.CSendMessage.sendmessage( target.MainWindowHandle, current.MainWindowHandle, arg );
+ }
+ }
+ break;
+ }
+ #endregion
+ else
+ {
+ Trace.TraceInformation( "繝。繝繧サ繝シ繧ク騾∽ソ。蜈医ョ繝励Ο繧サ繧ケ縺瑚ヲ九▽縺九i縺壹5蝗槭Μ繝医Λ繧、縺励∪縺吶" );
+ Thread.Sleep( 200 );
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/TJAPlayer3/Common/TJAPlayer3.cs b/TJAPlayer3/Common/TJAPlayer3.cs
new file mode 100644
index 00000000..628cbefd
--- /dev/null
+++ b/TJAPlayer3/Common/TJAPlayer3.cs
@@ -0,0 +1,2990 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+using System.Windows.Forms;
+using System.Drawing;
+using System.Diagnostics;
+using System.IO;
+using System.Threading;
+using System.Net.NetworkInformation;
+using System.Runtime.Serialization.Formatters.Binary;
+using SlimDX;
+using SlimDX.Direct3D9;
+using FDK;
+using SampleFramework;
+using System.Reflection;
+using System.Threading.Tasks;
+using System.Linq;
+
+namespace TJAPlayer3
+{
+ internal class TJAPlayer3 : Game
+ {
+ // 繝励Ο繝代ユ繧」
+ #region [ properties ]
+ public static readonly string VERSION = Assembly.GetExecutingAssembly().GetName().Version.ToString().Substring(0, Assembly.GetExecutingAssembly().GetName().Version.ToString().Length - 2);
+ public static readonly string AppDisplayThreePartVersion = GetAppDisplayThreePartVersion();
+ public static readonly string AppNumericThreePartVersion = GetAppNumericThreePartVersion();
+
+ private static string GetAppDisplayThreePartVersion()
+ {
+ return $"v{GetAppNumericThreePartVersion()}";
+ }
+
+ private static string GetAppNumericThreePartVersion()
+ {
+ var version = Assembly.GetExecutingAssembly().GetName().Version;
+
+ return $"{version.Major}.{version.Minor}.{version.Build}";
+ }
+
+ public static readonly string AppInformationalVersion =
+ Assembly
+ .GetExecutingAssembly()
+ .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false)
+ .Cast()
+ .FirstOrDefault()
+ ?.InformationalVersion
+ ?? $"{GetAppDisplayThreePartVersion()} (unknown informational version)";
+ public static readonly string SLIMDXDLL = "c_net20x86_Jun2010";
+ public static readonly string D3DXDLL = "d3dx9_43.dll"; // June 2010
+ //public static readonly string D3DXDLL = "d3dx9_42.dll"; // February 2010
+ //public static readonly string D3DXDLL = "d3dx9_41.dll"; // March 2009
+
+ public static TJAPlayer3 app
+ {
+ get;
+ private set;
+ }
+ public static C譁蟄励さ繝ウ繧ス繝シ繝ォ act譁蟄励さ繝ウ繧ス繝シ繝ォ
+ {
+ get;
+ private set;
+ }
+ public static bool b繧ウ繝ウ繝代け繝医Δ繝シ繝
+ {
+ get;
+ private set;
+ }
+ public static CConfigIni ConfigIni
+ {
+ get;
+ private set;
+ }
+ public static CDTX DTX
+ {
+ get
+ {
+ return dtx[ 0 ];
+ }
+ set
+ {
+ if( ( dtx[ 0 ] != null ) && ( app != null ) )
+ {
+ dtx[ 0 ].On髱樊エサ諤ァ蛹();
+ app.list繝医ャ繝励Ξ繝吶ΝActivities.Remove( dtx[ 0 ] );
+ }
+ dtx[ 0 ] = value;
+ if( ( dtx[ 0 ] != null ) && ( app != null ) )
+ {
+ app.list繝医ャ繝励Ξ繝吶ΝActivities.Add( dtx[ 0 ] );
+ }
+ }
+ }
+ public static CDTX DTX_2P
+ {
+ get
+ {
+ return dtx[ 1 ];
+ }
+ set
+ {
+ if( ( dtx[ 1 ] != null ) && ( app != null ) )
+ {
+ dtx[ 1 ].On髱樊エサ諤ァ蛹();
+ app.list繝医ャ繝励Ξ繝吶ΝActivities.Remove( dtx[ 1 ] );
+ }
+ dtx[ 1 ] = value;
+ if( ( dtx[ 1 ] != null ) && ( app != null ) )
+ {
+ app.list繝医ャ繝励Ξ繝吶ΝActivities.Add( dtx[ 1 ] );
+ }
+ }
+ }
+
+ public static bool IsPerformingCalibration;
+
+ public static CFPS FPS
+ {
+ get;
+ private set;
+ }
+ public static CInput邂。逅 Input邂。逅
+ {
+ get;
+ private set;
+ }
+ #region [ 蜈・蜉帷ッ蝗イms ]
+ public static int nPerfect遽蝗イms
+ {
+ get
+ {
+ if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null )
+ {
+ C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝;
+ if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPerfect遽蝗イms >= 0 ) )
+ {
+ return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPerfect遽蝗イms;
+ }
+ }
+ return ConfigIni.n繝偵ャ繝育ッ蝗イms.Perfect;
+ }
+ }
+ public static int nGreat遽蝗イms
+ {
+ get
+ {
+ if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null )
+ {
+ C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝;
+ if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGreat遽蝗イms >= 0 ) )
+ {
+ return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGreat遽蝗イms;
+ }
+ }
+ return ConfigIni.n繝偵ャ繝育ッ蝗イms.Great;
+ }
+ }
+ public static int nGood遽蝗イms
+ {
+ get
+ {
+ if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null )
+ {
+ C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝;
+ if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGood遽蝗イms >= 0 ) )
+ {
+ return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGood遽蝗イms;
+ }
+ }
+ return ConfigIni.n繝偵ャ繝育ッ蝗イms.Good;
+ }
+ }
+ public static int nPoor遽蝗イms
+ {
+ get
+ {
+ if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null )
+ {
+ C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝;
+ if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPoor遽蝗イms >= 0 ) )
+ {
+ return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPoor遽蝗イms;
+ }
+ }
+ return ConfigIni.n繝偵ャ繝育ッ蝗イms.Poor;
+ }
+ }
+ #endregion
+ public static CPad Pad
+ {
+ get;
+ private set;
+ }
+ public static Random Random
+ {
+ get;
+ private set;
+ }
+ public static CSkin Skin
+ {
+ get;
+ private set;
+ }
+ public static CSongs邂。逅 Songs邂。逅
+ {
+ get;
+ set; // 2012.1.26 yyagi private隗」髯、 CStage襍キ蜍輔〒縺ョdesirialize隱ュ縺ソ霎シ縺ソ縺ョ縺溘a
+ }
+ public static CEnumSongs EnumSongs
+ {
+ get;
+ private set;
+ }
+ public static CActEnumSongs actEnumSongs
+ {
+ get;
+ private set;
+ }
+ public static CActScanningLoudness actScanningLoudness
+ {
+ get;
+ private set;
+ }
+ public static CActFlushGPU actFlushGPU
+ {
+ get;
+ private set;
+ }
+
+ public static CSound邂。逅 Sound邂。逅
+ {
+ get;
+ private set;
+ }
+
+ public static SongGainController SongGainController
+ {
+ get;
+ private set;
+ }
+
+ public static SoundGroupLevelController SoundGroupLevelController
+ {
+ get;
+ private set;
+ }
+
+ public static CNamePlate NamePlate
+ {
+ get;
+ private set;
+ }
+
+ public static NamePlateConfig NamePlateConfig
+ {
+ get;
+ private set;
+ }
+
+ public static CStage襍キ蜍 stage襍キ蜍
+ {
+ get;
+ private set;
+ }
+ public static CStage繧ソ繧、繝医Ν stage繧ソ繧、繝医Ν
+ {
+ get;
+ private set;
+ }
+// public static CStage繧ェ繝励す繝ァ繝ウ stage繧ェ繝励す繝ァ繝ウ
+// {
+// get;
+// private set;
+// }
+ public static CStage繧ウ繝ウ繝輔ぅ繧ー stage繧ウ繝ウ繝輔ぅ繧ー
+ {
+ get;
+ private set;
+ }
+ public static CStage驕ク譖イ stage驕ク譖イ
+ {
+ get;
+ private set;
+ }
+ public static CStage谿オ菴埼∈謚 stage谿オ菴埼∈謚
+ {
+ get;
+ private set;
+ }
+ public static CStage譖イ隱ュ縺ソ霎シ縺ソ stage譖イ隱ュ縺ソ霎シ縺ソ
+ {
+ get;
+ private set;
+ }
+ public static CStage貍泌・上ラ繝ゥ繝逕サ髱「 stage貍泌・上ラ繝ゥ繝逕サ髱「
+ {
+ get;
+ private set;
+ }
+ public static CStage邨先棡 stage邨先棡
+ {
+ get;
+ private set;
+ }
+ public static CStageChangeSkin stageChangeSkin
+ {
+ get;
+ private set;
+ }
+ public static CStage邨ゆコ stage邨ゆコ
+ {
+ get;
+ private set;
+ }
+ public static CStage r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = null;
+ public static CStage r逶エ蜑阪ョ繧ケ繝繝シ繧ク = null;
+ public static string strEXE縺ョ縺ゅk繝輔か繝ォ繝
+ {
+ get;
+ private set;
+ }
+ public static string str繧ウ繝ウ繝代け繝医Δ繝シ繝峨ヵ繧。繧、繝ォ
+ {
+ get;
+ private set;
+ }
+ public static CTimer Timer
+ {
+ get;
+ private set;
+ }
+ public static Format TextureFormat = Format.A8R8G8B8;
+ internal static IPluginActivity act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ = null;
+ public bool bApplicationActive
+ {
+ get;
+ private set;
+ }
+ public bool b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧
+ {
+ get;
+ set;
+ }
+ public bool b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え蛻繧頑崛縺医r陦後≧
+ {
+ get;
+ set;
+ }
+ public DeviceCache Device
+ {
+ get { return base.GraphicsDeviceManager.Direct3D9.Device; }
+ }
+ public CPluginHost PluginHost
+ {
+ get;
+ private set;
+ }
+ public List list繝励Λ繧ー繧、繝ウ = new List();
+ public struct STPlugin
+ {
+ public IPluginActivity plugin;
+ public string str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝;
+ public string str繧「繧サ繝ウ繝悶Μ邁。譏灘錐;
+ public Version Version;
+ }
+ private static Size currentClientSize // #23510 2010.10.27 add yyagi to keep current window size
+ {
+ get;
+ set;
+ }
+ // public static CTimer ct;
+ public IntPtr WindowHandle // 2012.10.24 yyagi; to add ASIO support
+ {
+ get { return base.Window.Handle; }
+ }
+ public static CDTXVmode DTXVmode // #28821 2014.1.23 yyagi
+ {
+ get;
+ set;
+ }
+
+ #endregion
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public TJAPlayer3()
+ {
+ TJAPlayer3.app = this;
+ this.t襍キ蜍募ヲ逅();
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺()
+ {
+#if WindowedFullscreen
+ if ( ConfigIni != null )
+#else
+ DeviceSettings settings = base.GraphicsDeviceManager.CurrentSettings.Clone();
+ if ( ( ConfigIni != null ) && ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 != settings.Windowed ) )
+#endif
+ {
+#if !WindowedFullscreen
+ settings.Windowed = ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝;
+#endif
+ if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 == false ) // #23510 2010.10.27 yyagi: backup current window size before going fullscreen mode
+ {
+ currentClientSize = this.Window.ClientSize;
+ ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth = this.Window.ClientSize.Width;
+ ConfigIni.n繧ヲ繧、繝ウ繝峨えheight = this.Window.ClientSize.Height;
+// FDK.CTaskBar.ShowTaskBar( false );
+ }
+#if !WindowedFullscreen
+ base.GraphicsDeviceManager.ChangeDevice( settings );
+#endif
+ if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 == true ) // #23510 2010.10.27 yyagi: to resume window size from backuped value
+ {
+#if WindowedFullscreen
+ // #30666 2013.2.2 yyagi Don't use Fullscreen mode becasue NVIDIA GeForce is
+ // tend to delay drawing on Fullscreen mode. So DTXMania uses Maximized window
+ // in spite of using fullscreen mode.
+ app.Window.WindowState = FormWindowState.Normal;
+ app.Window.FormBorderStyle = FormBorderStyle.Sizable;
+ app.Window.WindowState = FormWindowState.Normal;
+#endif
+ base.Window.ClientSize =
+ new Size( currentClientSize.Width, currentClientSize.Height );
+ base.Window.Icon = Properties.Resources.tjap3;
+// FDK.CTaskBar.ShowTaskBar( true );
+ }
+#if WindowedFullscreen
+ else
+ {
+ app.Window.WindowState = FormWindowState.Normal;
+ app.Window.FormBorderStyle = FormBorderStyle.None;
+ app.Window.WindowState = FormWindowState.Maximized;
+ }
+ if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 )
+ {
+ if ( !this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ )
+ {
+ Cursor.Show();
+ this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = true;
+ }
+ }
+ else if ( this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ )
+ {
+ Cursor.Hide();
+ this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = false;
+ }
+#endif
+ }
+ }
+
+ #region [ #24609 繝ェ繧カ繝ォ繝育判蜒上rpng縺ァ菫晏ュ倥☆繧 ] // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill.
+ ///
+ /// 繝ェ繧カ繝ォ繝育判蜒上ョ繧ュ繝」繝励メ繝」縺ィ菫晏ュ倥
+ ///
+ /// 菫晏ュ倥☆繧九ヵ繧。繧、繝ォ蜷(繝輔Ν繝代せ)
+ public bool SaveResultScreen( string strFullPath )
+ {
+ string strSavePath = Path.GetDirectoryName( strFullPath );
+ if ( !Directory.Exists( strSavePath ) )
+ {
+ try
+ {
+ Directory.CreateDirectory( strSavePath );
+ }
+ catch
+ {
+ Trace.TraceError(ToString());
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (0bfe6bff-2a56-4df4-9333-2df26d9b765b)" );
+ return false;
+ }
+ }
+
+ // http://www.gamedev.net/topic/594369-dx9slimdxati-incorrect-saving-surface-to-file/
+ using ( Surface pSurface = TJAPlayer3.app.Device.GetRenderTarget( 0 ) )
+ {
+ Surface.ToFile( pSurface, strFullPath, ImageFileFormat.Png );
+ }
+ return true;
+ }
+ #endregion
+
+ // Game 螳溯」
+
+ protected override void Initialize()
+ {
+// new GCBeep();
+ //sw.Start();
+ //swlist1 = new List( 8192 );
+ //swlist2 = new List( 8192 );
+ //swlist3 = new List( 8192 );
+ //swlist4 = new List( 8192 );
+ //swlist5 = new List( 8192 );
+ if ( this.list繝医ャ繝励Ξ繝吶ΝActivities != null )
+ {
+ foreach( CActivity activity in this.list繝医ャ繝励Ξ繝吶ΝActivities )
+ activity.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ }
+
+ foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ st.plugin.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+#if GPUFlushAfterPresent
+ FrameEnd += dtxmania_FrameEnd;
+#endif
+ }
+#if GPUFlushAfterPresent
+ void dtxmania_FrameEnd( object sender, EventArgs e ) // GraphicsDeviceManager.game_FrameEnd()蠕後↓螳溯。後&繧後k
+ { // 竊 Present()逶エ蠕後↓GPU繧巽lush縺吶k
+ // 竊 逕サ髱「縺ョ繧ォ繧ッ繝繧ュ縺碁サ逋コ縺励◆縺溘a縲√%縺薙〒縺ョFlush縺ッ陦後o縺ェ縺
+ actFlushGPU.On騾イ陦梧緒逕サ(); // Flush GPU
+ }
+#endif
+ protected override void LoadContent()
+ {
+ if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 )
+ {
+ if( !this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ )
+ {
+ Cursor.Show();
+ this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = true;
+ }
+ }
+ else if( this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ )
+ {
+ Cursor.Hide();
+ this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = false;
+ }
+ this.Device.SetTransform(TransformState.View, Matrix.LookAtLH(new Vector3(0f, 0f, (float)(-SampleFramework.GameWindowSize.Height / 2 * Math.Sqrt(3.0))), new Vector3(0f, 0f, 0f), new Vector3(0f, 1f, 0f)));
+ this.Device.SetTransform(TransformState.Projection, Matrix.PerspectiveFovLH(C螟画鋤.DegreeToRadian((float)60f), ((float)this.Device.Viewport.Width) / ((float)this.Device.Viewport.Height), -100f, 100f));
+ this.Device.SetRenderState(RenderState.Lighting, false);
+ this.Device.SetRenderState( RenderState.ZEnable, false );
+ this.Device.SetRenderState( RenderState.AntialiasedLineEnable, false );
+ this.Device.SetRenderState( RenderState.AlphaTestEnable, true );
+ this.Device.SetRenderState( RenderState.AlphaRef, 10 );
+
+ this.Device.SetRenderState( RenderState.MultisampleAntialias, true );
+ this.Device.SetSamplerState( 0, SamplerState.MinFilter, TextureFilter.Linear );
+ this.Device.SetSamplerState( 0, SamplerState.MagFilter, TextureFilter.Linear );
+
+ this.Device.SetRenderState( RenderState.AlphaFunc, Compare.Greater );
+ this.Device.SetRenderState( RenderState.AlphaBlendEnable, true );
+ this.Device.SetRenderState( RenderState.SourceBlend, Blend.SourceAlpha );
+ this.Device.SetRenderState( RenderState.DestinationBlend, Blend.InverseSourceAlpha );
+ this.Device.SetTextureStageState( 0, TextureStage.AlphaOperation, TextureOperation.Modulate );
+ this.Device.SetTextureStageState( 0, TextureStage.AlphaArg1, 2 );
+ this.Device.SetTextureStageState( 0, TextureStage.AlphaArg2, 1 );
+
+ if( this.list繝医ャ繝励Ξ繝吶ΝActivities != null )
+ {
+ foreach( CActivity activity in this.list繝医ャ繝励Ξ繝吶ΝActivities )
+ activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ }
+
+ foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ }
+ protected override void UnloadContent()
+ {
+ if( this.list繝医ャ繝励Ξ繝吶ΝActivities != null )
+ {
+ foreach( CActivity activity in this.list繝医ャ繝励Ξ繝吶ΝActivities )
+ activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ }
+
+ foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ }
+ protected override void OnExiting( EventArgs e )
+ {
+ CPowerManagement.tEnableMonitorSuspend(); // 繧ケ繝ェ繝シ繝玲椛豁「迥カ諷九r隗」髯、
+ this.t邨ゆコ蜃ヲ逅();
+ base.OnExiting( e );
+ }
+ protected override void Update( GameTime gameTime )
+ {
+ }
+ protected override void Draw( GameTime gameTime )
+ {
+ Sound邂。逅?.t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧();
+ Timer?.t譖エ譁ー();
+ CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝?.t譖エ譁ー();
+ Input邂。逅?.t繝昴シ繝ェ繝ウ繧ー( this.bApplicationActive, TJAPlayer3.ConfigIni.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ );
+ FPS?.t繧ォ繧ヲ繝ウ繧ソ譖エ譁ー();
+
+ if( this.Device == null )
+ return;
+
+ if ( this.bApplicationActive ) // DTXMania譛ャ菴楢オキ蜍穂クュ縺ョ譛ャ菴/繝「繝九ち縺ョ逵髮サ蜉帙Δ繝シ繝臥ァサ陦後r謚第ュ「
+ CPowerManagement.tDisableMonitorSuspend();
+
+ // #xxxxx 2013.4.8 yyagi; sleep縺ョ謖ソ蜈・菴咲スョ繧偵・ndScneneス霸resent髢薙°繧峨。eginScene蜑阪↓遘サ蜍輔よ緒逕サ驕蟒カ繧貞ー上&縺上☆繧九◆繧√
+ #region [ 繧ケ繝ェ繝シ繝 ]
+ if ( ConfigIni.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s >= 0 ) // #xxxxx 2011.11.27 yyagi
+ {
+ Thread.Sleep( ConfigIni.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s );
+ }
+ #endregion
+
+ #region [ DTXCreator縺九i縺ョ謖遉コ ]
+ if ( this.Window.IsReceivedMessage ) // 繧ヲ繧、繝ウ繝峨え繝。繝繧サ繝シ繧ク縺ァ縲
+ {
+ string strMes = this.Window.strMessage;
+ this.Window.IsReceivedMessage = false;
+
+ if ( strMes != null )
+ {
+ DTXVmode.ParseArguments( strMes );
+
+ if ( DTXVmode.Enabled )
+ {
+ b繧ウ繝ウ繝代け繝医Δ繝シ繝 = true;
+ str繧ウ繝ウ繝代け繝医Δ繝シ繝峨ヵ繧。繧、繝ォ = DTXVmode.filename;
+ if ( DTXVmode.Command == CDTXVmode.ECommand.Preview )
+ {
+ // preview sound縺ョ蜀咲函
+ string strPreviewFilename = DTXVmode.previewFilename;
+//Trace.TraceInformation( "Preview Filename=" + DTXVmode.previewFilename );
+ try
+ {
+ if ( this.previewSound != null )
+ {
+ this.previewSound.t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k();
+ this.previewSound.Dispose();
+ this.previewSound = null;
+ }
+ this.previewSound = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( strPreviewFilename, ESoundGroup.SongPlayback );
+
+ // 2018-08-23 twopointzero: DTXVmode previewVolume will always set
+ // Gain since in this mode it should override the application of
+ // SONGVOL or any other Gain source regardless of configuration.
+ this.previewSound.SetGain(DTXVmode.previewVolume);
+
+ this.previewSound.n菴咲スョ = DTXVmode.previewPan;
+ this.previewSound.t蜀咲函繧帝幕蟋九☆繧();
+ Trace.TraceInformation( "DTXC縺九i縺ョ謖遉コ縺ァ縲√し繧ヲ繝ウ繝峨r逕滓舌@縺セ縺励◆縲({0})", strPreviewFilename );
+ }
+ catch
+ {
+ Trace.TraceError(ToString());
+ Trace.TraceError( "DTXC縺九i縺ョ謖遉コ縺ァ縺ョ縲√し繧ヲ繝ウ繝峨ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", strPreviewFilename );
+ if ( this.previewSound != null )
+ {
+ this.previewSound.Dispose();
+ }
+ this.previewSound = null;
+ }
+ }
+ }
+ }
+ }
+ #endregion
+
+ this.Device.BeginScene();
+ this.Device.Clear( ClearFlags.ZBuffer | ClearFlags.Target, Color.Black, 1f, 0 );
+
+ if( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null )
+ {
+ this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 = ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null ) ? r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On騾イ陦梧緒逕サ() : 0;
+
+ #region [ 繝励Λ繧ー繧、繝ウ縺ョ騾イ陦梧緒逕サ ]
+ //---------------------
+ foreach( STPlugin sp in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( sp.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+
+ if( TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null || TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == sp.plugin )
+ sp.plugin.On騾イ陦梧緒逕サ(TJAPlayer3.Pad, TJAPlayer3.Input邂。逅.Keyboard );
+ else
+ sp.plugin.On騾イ陦梧緒逕サ( null, null );
+
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ //---------------------
+ #endregion
+
+
+ CScoreIni scoreIni = null;
+
+ if ( Control.IsKeyLocked( Keys.CapsLock ) ) // #30925 2013.3.11 yyagi; capslock=ON譎ゅッ縲・numSongs縺励↑縺繧医≧縺ォ縺励※縲∬オキ蜍戊イ闕キ縺ィASIO縺ョ髻ウ蛻繧後ョ髢「菫ゅr遒コ隱阪☆繧
+ { // 竊 songs.db遲峨ョ譖ク縺崎セシ縺ソ譎ゅ□縺ィ髻ウ蛻繧後☆繧九▲縺ス縺
+ actEnumSongs.On髱樊エサ諤ァ蛹();
+ EnumSongs.SongListEnumCompletelyDone();
+ TJAPlayer3.stage驕ク譖イ.bIsEnumeratingSongs = false;
+ }
+ #region [ 譖イ讀懃エ「繧ケ繝ャ繝繝峨ョ襍キ蜍/邨ゆコ ] // 縺薙%縺ォ"Enumerating Songs..."陦ィ遉コ繧帝寔邏
+ if ( !TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 )
+ {
+ actEnumSongs.On騾イ陦梧緒逕サ(); // "Enumerating Songs..."繧「繧、繧ウ繝ウ縺ョ謠冗判
+ }
+ switch ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID )
+ {
+ case CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν:
+ case CStage.E繧ケ繝繝シ繧ク.繧ウ繝ウ繝輔ぅ繧ー:
+ case CStage.E繧ケ繝繝シ繧ク.驕ク譖イ:
+ case CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ:
+ if ( EnumSongs != null )
+ {
+ #region [ (迚ケ螳壽擅莉カ譎) 譖イ讀懃エ「繧ケ繝ャ繝繝峨ョ襍キ蜍廟髢句ァ ]
+ if ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν &&
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.襍キ蜍 &&
+ this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 == (int) CStage繧ソ繧、繝医Ν.E謌サ繧雁、.邯咏カ &&
+ !EnumSongs.IsSongListEnumStarted )
+ {
+ actEnumSongs.On豢サ諤ァ蛹();
+ TJAPlayer3.stage驕ク譖イ.bIsEnumeratingSongs = true;
+ EnumSongs.Init(); // 蜿門セ励@縺滓峇謨ー繧偵∵眠繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ォ繧ゆク弱∴繧
+ EnumSongs.StartEnumFromDisk(); // 譖イ讀懃エ「繧ケ繝ャ繝繝峨ョ襍キ蜍廟髢句ァ
+ }
+ #endregion
+
+ #region [ 譖イ讀懃エ「縺ョ荳ュ譁ュ縺ィ蜀埼幕 ]
+ if ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.驕ク譖イ && !EnumSongs.IsSongListEnumCompletelyDone )
+ {
+ switch ( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 )
+ {
+ case 0: // 菴輔b縺ェ縺
+ //if ( CDTXMania.stage驕ク譖イ.bIsEnumeratingSongs )
+ if ( !TJAPlayer3.stage驕ク譖イ.bIsPlayingPremovie )
+ {
+ EnumSongs.Resume(); // #27060 2012.2.6 yyagi 荳ュ豁「縺励※縺縺溘ヰ繝繧ッ繧ー繝ゥ繝ウ繝画峇讀懃エ「繧貞埼幕
+ EnumSongs.IsSlowdown = false;
+ }
+ else
+ {
+ // EnumSongs.Suspend(); // #27060 2012.3.2 yyagi #PREMOVIE蜀咲函荳ュ縺ッ譖イ讀懃エ「繧剃ス朱溷喧
+ EnumSongs.IsSlowdown = true;
+ }
+ actEnumSongs.On豢サ諤ァ蛹();
+ break;
+
+ case 2: // 譖イ豎コ螳
+ EnumSongs.Suspend(); // #27060 繝舌ャ繧ッ繧ー繝ゥ繧ヲ繝ウ繝峨ョ譖イ讀懃エ「繧剃ク譎ょ●豁「
+ actEnumSongs.On髱樊エサ諤ァ蛹();
+ break;
+ }
+ }
+ #endregion
+
+ #region [ 譖イ謗「邏「荳ュ譁ュ蠕縺。蠕讖 ]
+ if ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ && !EnumSongs.IsSongListEnumCompletelyDone &&
+ EnumSongs.thDTXFileEnumerate != null ) // #28700 2012.6.12 yyagi; at Compact mode, enumerating thread does not exist.
+ {
+ EnumSongs.WaitUntilSuspended(); // 蠢オ縺ョ縺溘a縲∵峇讀懃エ「縺御ク譎ゆクュ譁ュ縺輔l繧九∪縺ァ蠕讖
+ }
+ #endregion
+
+ #region [ 譖イ讀懃エ「縺悟ョ御コ縺励◆繧峨∝ョ滄圀縺ョ譖イ繝ェ繧ケ繝医↓蜿肴丐縺吶k ]
+ // CStage驕ク譖イ.On豢サ諤ァ蛹() 縺ォ蝗槭@縺滓婿縺後>縺縺九↑シ
+ if ( EnumSongs.IsSongListEnumerated )
+ {
+ actEnumSongs.On髱樊エサ諤ァ蛹();
+ TJAPlayer3.stage驕ク譖イ.bIsEnumeratingSongs = false;
+
+ bool bRemakeSongTitleBar = ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.驕ク譖イ ) ? true : false;
+ TJAPlayer3.stage驕ク譖イ.Refresh( EnumSongs.Songs邂。逅, bRemakeSongTitleBar );
+ EnumSongs.SongListEnumCompletelyDone();
+ }
+ #endregion
+ }
+ break;
+ }
+ #endregion
+
+ switch ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID )
+ {
+ case CStage.E繧ケ繝繝シ繧ク.菴輔b縺励↑縺:
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.襍キ蜍:
+ #region [ *** ]
+ //-----------------------------
+ if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 )
+ {
+ if( !b繧ウ繝ウ繝代け繝医Δ繝シ繝 )
+ {
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧ソ繧、繝医Ν" );
+ stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν;
+ }
+ else
+ {
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 譖イ隱ュ縺ソ霎シ縺ソ" );
+ stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ;
+ }
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ }
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν:
+ #region [ *** ]
+ //-----------------------------
+ switch( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 )
+ {
+ case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.GAMESTART:
+ #region [ 驕ク譖イ蜃ヲ逅縺ク ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 驕ク譖イ" );
+ stage驕ク譖イ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ;
+ //-----------------------------
+ #endregion
+ break;
+
+ case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.DANGAMESTART:
+ #region [ 谿オ菴埼∈謚槫ヲ逅縺ク ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 谿オ菴埼∈謚" );
+ stage谿オ菴埼∈謚.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚;
+ //-----------------------------
+ #endregion
+ break;
+
+ #region [ OPTION: 蟒豁「貂 ]
+// case 2: // #24525 OPTION縺ィCONFIG縺ョ邨ア蜷医↓莨エ縺縲^PTION縺ッ蟒豁「
+// #region [ *** ]
+// //-----------------------------
+// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+// Trace.TraceInformation( "----------------------" );
+// Trace.TraceInformation( "笆 繧ェ繝励す繝ァ繝ウ" );
+// stage繧ェ繝励す繝ァ繝ウ.On豢サ諤ァ蛹();
+// r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ェ繝励す繝ァ繝ウ;
+// //-----------------------------
+// #endregion
+ // break;
+ #endregion
+
+ case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.CONFIG:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧ウ繝ウ繝輔ぅ繧ー" );
+ stage繧ウ繝ウ繝輔ぅ繧ー.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ウ繝ウ繝輔ぅ繧ー;
+ //-----------------------------
+ #endregion
+ break;
+
+ case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.EXIT:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 邨ゆコ" );
+ stage邨ゆコ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage邨ゆコ;
+ //-----------------------------
+ #endregion
+ break;
+ }
+
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ //this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); // #31980 2013.9.3 yyagi 繧ソ繧、繝医Ν逕サ髱「縺ァ縺縺代∵ッ弱ヵ繝ャ繝シ繝GC繧貞ョ溯。後@縺ヲ驥阪¥縺ェ縺」縺ヲ縺縺溷撫鬘後ョ菫ョ豁」
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.繧ウ繝ウ繝輔ぅ繧ー:
+ #region [ *** ]
+ //-----------------------------
+ if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 )
+ {
+ switch( r逶エ蜑阪ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID )
+ {
+ case CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧ソ繧、繝医Ν" );
+ stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν;
+
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+
+ case CStage.E繧ケ繝繝シ繧ク.驕ク譖イ:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 驕ク譖イ" );
+ stage驕ク譖イ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ;
+
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+ }
+ }
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.驕ク譖イ:
+ #region [ *** ]
+ //-----------------------------
+ switch( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 )
+ {
+ case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ソ繧、繝医Ν縺ォ謌サ繧:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧ソ繧、繝医Ν" );
+ stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν;
+
+ Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k();
+ Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k();
+ foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+
+ case (int) CStage驕ク譖イ.E謌サ繧雁、.驕ク譖イ縺励◆:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 譖イ隱ュ縺ソ霎シ縺ソ" );
+ stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ;
+
+ Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k();
+ Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k();
+ foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+
+// case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ェ繝励す繝ァ繝ウ蜻シ縺ウ蜃コ縺:
+ #region [ *** ]
+// //-----------------------------
+// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+// Trace.TraceInformation( "----------------------" );
+// Trace.TraceInformation( "笆 繧ェ繝励す繝ァ繝ウ" );
+// stage繧ェ繝励す繝ァ繝ウ.On豢サ諤ァ蛹();
+// r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ェ繝励す繝ァ繝ウ;
+//
+// foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+// {
+// Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+// pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+// Directory.SetCurrentDirectory( CDTXMania.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+// }
+//
+// this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+// break;
+// //-----------------------------
+ #endregion
+
+ case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ウ繝ウ繝輔ぅ繧ー蜻シ縺ウ蜃コ縺:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧ウ繝ウ繝輔ぅ繧ー" );
+ stage繧ウ繝ウ繝輔ぅ繧ー.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ウ繝ウ繝輔ぅ繧ー;
+
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+
+ case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ケ繧ュ繝ウ螟画峩:
+
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧ケ繧ュ繝ウ蛻繧頑崛縺" );
+ stageChangeSkin.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stageChangeSkin;
+ break;
+ //-----------------------------
+ #endregion
+ }
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.谿オ菴埼∈謚:
+ #region [ *** ]
+ switch (this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、)
+ {
+ case (int)CStage驕ク譖イ.E謌サ繧雁、.繧ソ繧、繝医Ν縺ォ謌サ繧:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 繧ソ繧、繝医Ν");
+ stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν;
+
+ Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k();
+ Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k();
+ foreach (STPlugin pg in this.list繝励Λ繧ー繧、繝ウ)
+ {
+ Directory.SetCurrentDirectory(pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝);
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory(TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝);
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+
+ case (int)CStage驕ク譖イ.E謌サ繧雁、.驕ク譖イ縺励◆:
+ #region [ *** ]
+ //-----------------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 譖イ隱ュ縺ソ霎シ縺ソ");
+ stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ;
+
+ foreach (STPlugin pg in this.list繝励Λ繧ー繧、繝ウ)
+ {
+ Directory.SetCurrentDirectory(pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝);
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory(TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝);
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+ }
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ:
+ #region [ *** ]
+ //-----------------------------
+ DTXVmode.Refreshed = false; // 譖イ縺ョ繝ェ繝ュ繝シ繝我クュ縺ォ逋コ逕溘@縺溷阪Μ繝ュ繝シ繝峨ッ縲∫┌隕悶☆繧九
+ if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 )
+ {
+ TJAPlayer3.Pad.st讀懃衍縺励◆繝繝舌う繧ケ.Clear(); // 蜈・蜉帙ョ繝舌う繧ケ繝輔Λ繧ー繧ッ繝ェ繧「(2010.9.11)
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ #region [ ESC謚シ荳区凾縺ッ縲∵峇縺ョ隱ュ縺ソ霎シ縺ソ繧剃クュ豁「縺励※驕ク譖イ逕サ髱「縺ォ謌サ繧 ]
+ if ( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 == (int) E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、.隱ュ霎シ荳ュ豁「 )
+ {
+ //DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「();
+ if( DTX != null )
+ DTX.On髱樊エサ諤ァ蛹();
+ if (stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan)
+ {
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 谿オ菴埼∈謚");
+ stage谿オ菴埼∈謚.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚;
+ }
+ else
+ {
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 驕ク譖イ");
+ stage驕ク譖イ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ;
+ }
+ foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ break;
+ }
+ #endregion
+
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 貍泌・擾シ医ラ繝ゥ繝逕サ髱「シ" );
+#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹
+for (int i = 0; i < 5; i++)
+{
+ for (int j = 0; j < 2; j++)
+ {
+ stage貍泌・上ラ繝ゥ繝逕サ髱「.fDamageGaugeDelta[i, j] = ConfigIni.fGaugeFactor[i, j];
+ }
+}
+for (int i = 0; i < 3; i++) {
+ stage貍泌・上ラ繝ゥ繝逕サ髱「.fDamageLevelFactor[i] = ConfigIni.fDamageLevelFactor[i];
+}
+#endif
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage貍泌・上ラ繝ゥ繝逕サ髱「;
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ }
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.貍泌・:
+ #region [ *** ]
+ //-----------------------------
+ //long n1 = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+ //long n2 = FDK.CSound邂。逅.SoundDevice.n邨碁℃譎る俣ms;
+ //long n3 = FDK.CSound邂。逅.SoundDevice.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+ //long n4 = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾;
+ //long n5 = FDK.CSound邂。逅.SoundDevice.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms;
+
+ //swlist1.Add( Convert.ToInt32(n1) );
+ //swlist2.Add( Convert.ToInt32(n2) );
+ //swlist3.Add( Convert.ToInt32( n3 ) );
+ //swlist4.Add( Convert.ToInt32( n4 ) );
+ //swlist5.Add( Convert.ToInt32( n5 ) );
+
+ #region [ DTXV繝「繝シ繝我クュ縺ォDTXCreator縺九i謖遉コ繧貞女縺代◆蝣エ蜷医ョ蜃ヲ逅 ]
+ if ( DTXVmode.Enabled && DTXVmode.Refreshed )
+ {
+ DTXVmode.Refreshed = false;
+
+ if ( DTXVmode.Command == CDTXVmode.ECommand.Stop )
+ {
+ TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t蛛懈ュ「();
+ if ( previewSound != null )
+ {
+ this.previewSound.t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k();
+ this.previewSound.Dispose();
+ this.previewSound = null;
+ }
+ //{
+ // int lastd = 0;
+ // int f = 0;
+ // for ( int i = 0; i < swlist1.Count; i++ )
+ // {
+ // int d1 = swlist1[ i ];
+ // int d2 = swlist2[ i ];
+ // int d3 = swlist3[ i ];
+ // int d4 = swlist4[ i ];
+ // int d5 = swlist5[ i ];
+
+ // int dif = d1 - lastd;
+ // string s = "";
+ // if ( 16 <= dif && dif <= 17 )
+ // {
+ // }
+ // else
+ // {
+ // s = "笘";
+ // }
+ // Trace.TraceInformation( "frame {0:D4}: {1:D3} ( {2:D3}, {3:D3} - {7:D3}, {4:D3} ) {5}, n迴セ蝨ィ譎ょ綾={6}", f, dif, d1, d2, d3, s, d4, d5 );
+ // lastd = d1;
+ // f++;
+ // }
+ // swlist1.Clear();
+ // swlist2.Clear();
+ // swlist3.Clear();
+ // swlist4.Clear();
+ // swlist5.Clear();
+
+ //}
+ }
+ else if ( DTXVmode.Command == CDTXVmode.ECommand.Play )
+ {
+ if ( DTXVmode.NeedReload )
+ {
+ TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t蜀崎ェュ霎シ();
+
+ TJAPlayer3.ConfigIni.bTimeStretch = DTXVmode.TimeStretch;
+ CSound邂。逅.bIsTimeStretch = DTXVmode.TimeStretch;
+ if ( TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ != DTXVmode.VSyncWait )
+ {
+ TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = DTXVmode.VSyncWait;
+ TJAPlayer3.app.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ = true;
+ }
+ }
+ else
+ {
+ TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・丈ス咲スョ縺ョ螟画峩( TJAPlayer3.DTXVmode.nStartBar, 0 );
+ }
+ }
+ }
+ #endregion
+
+ switch( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 )
+ {
+ case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.蜀崎ェュ霎シ_蜀肴シ泌・:
+ #region [ DTX繝輔ぃ繧、繝ォ繧貞崎ェュ縺ソ霎シ縺ソ縺励※縲∝肴シ泌・ ]
+ DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「();
+ DTX.On髱樊エサ諤ァ蛹();
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ;
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ #endregion
+
+ //case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.蜀肴シ泌・:
+ #region [ 蜀崎ェュ縺ソ霎シ縺ソ辟。縺励〒縲∝肴シ泌・ ]
+ #endregion
+ // break;
+
+ case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.邯咏カ:
+ break;
+
+ case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.貍泌・丈クュ譁ュ:
+ #region [ 貍泌・上く繝」繝ウ繧サ繝ォ ]
+ //-----------------------------
+ scoreIni = this.tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー( "Play canceled" );
+
+ #region [ 繝励Λ繧ー繧、繝ウ On貍泌・上く繝」繝ウ繧サ繝ォ() 縺ョ蜻シ縺ウ蜃コ縺 ]
+ //---------------------
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On貍泌・上く繝」繝ウ繧サ繝ォ( scoreIni );
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ //---------------------
+ #endregion
+
+ DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「();
+ DTX.On髱樊エサ諤ァ蛹();
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ if( b繧ウ繝ウ繝代け繝医Δ繝シ繝 )
+ {
+ base.Window.Close();
+ }
+ else
+ {
+ if(stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan)
+ {
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 谿オ菴埼∈謚");
+ stage谿オ菴埼∈謚.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚;
+ }
+ else
+ {
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 驕ク譖イ");
+ stage驕ク譖イ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ;
+ }
+
+ #region [ 繝励Λ繧ー繧、繝ウ On繧ケ繝繝シ繧ク螟画峩() 縺ョ蜻シ縺ウ蜃コ縺 ]
+ //---------------------
+ foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ //---------------------
+ #endregion
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ }
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ break;
+ //-----------------------------
+ #endregion
+
+ case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.繧ケ繝繝シ繧ク螟ア謨:
+ #region [ 貍泌・丞、ア謨(StageFailed) ]
+ //-----------------------------
+ scoreIni = this.tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー( "Stage failed" );
+
+ #region [ 繝励Λ繧ー繧、繝ウ On貍泌・丞、ア謨() 縺ョ蜻シ縺ウ蜃コ縺 ]
+ //---------------------
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On貍泌・丞、ア謨( scoreIni );
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ //---------------------
+ #endregion
+
+ DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「();
+ DTX.On髱樊エサ諤ァ蛹();
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ if( b繧ウ繝ウ繝代け繝医Δ繝シ繝 )
+ {
+ base.Window.Close();
+ }
+ else
+ {
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 驕ク譖イ" );
+ stage驕ク譖イ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ;
+
+ #region [ 繝励Λ繧ー繧、繝ウ On繧ケ繝繝シ繧ク螟画峩() 縺ョ蜻シ縺ウ蜃コ縺 ]
+ //---------------------
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ //---------------------
+ #endregion
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ }
+ break;
+ //-----------------------------
+ #endregion
+
+ case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.繧ケ繝繝シ繧ク繧ッ繝ェ繧「:
+ #region [ 貍泌・上け繝ェ繧「 ]
+ //-----------------------------
+ CScoreIni.C貍泌・剰ィ倬鹸 c貍泌・剰ィ倬鹸_Drums;
+ stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・冗オ先棡繧呈シ邏阪☆繧( out c貍泌・剰ィ倬鹸_Drums );
+
+ double ps = 0.0, gs = 0.0;
+ if ( !c貍泌・剰ィ倬鹸_Drums.b蜈ィAUTO縺ァ縺ゅk && c貍泌・剰ィ倬鹸_Drums.n蜈ィ繝√ャ繝玲焚 > 0) {
+ ps = c貍泌・剰ィ倬鹸_Drums.db貍泌・丞梛繧ケ繧ュ繝ォ蛟、;
+ gs = c貍泌・剰ィ倬鹸_Drums.db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、;
+ }
+ string str = "Cleared";
+ switch( CScoreIni.t邱丞粋繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( c貍泌・剰ィ倬鹸_Drums, null, null ) )
+ {
+ case (int)CScoreIni.ERANK.SS:
+ str = string.Format( "Cleared (SS: {0:F2})", ps );
+ break;
+
+ case (int) CScoreIni.ERANK.S:
+ str = string.Format( "Cleared (S: {0:F2})", ps );
+ break;
+
+ case (int) CScoreIni.ERANK.A:
+ str = string.Format( "Cleared (A: {0:F2})", ps );
+ break;
+
+ case (int) CScoreIni.ERANK.B:
+ str = string.Format( "Cleared (B: {0:F2})", ps );
+ break;
+
+ case (int) CScoreIni.ERANK.C:
+ str = string.Format( "Cleared (C: {0:F2})", ps );
+ break;
+
+ case (int) CScoreIni.ERANK.D:
+ str = string.Format( "Cleared (D: {0:F2})", ps );
+ break;
+
+ case (int) CScoreIni.ERANK.E:
+ str = string.Format( "Cleared (E: {0:F2})", ps );
+ break;
+
+ case (int)CScoreIni.ERANK.UNKNOWN: // #23534 2010.10.28 yyagi add: 貍泌・上メ繝繝励′0蛟九ョ縺ィ縺
+ str = "Cleared (No chips)";
+ break;
+ }
+
+ scoreIni = this.tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー( str );
+
+ #region [ 繝励Λ繧ー繧、繝ウ On貍泌・上け繝ェ繧「() 縺ョ蜻シ縺ウ蜃コ縺 ]
+ //---------------------
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On貍泌・上け繝ェ繧「( scoreIni );
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ //---------------------
+ #endregion
+
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 邨先棡" );
+ stage邨先棡.st貍泌・剰ィ倬鹸.Drums = c貍泌・剰ィ倬鹸_Drums;
+ stage邨先棡.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage邨先棡;
+
+ #region [ 繝励Λ繧ー繧、繝ウ On繧ケ繝繝シ繧ク螟画峩() 縺ョ蜻シ縺ウ蜃コ縺 ]
+ //---------------------
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ //---------------------
+ #endregion
+
+ break;
+ //-----------------------------
+ #endregion
+ }
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.邨先棡:
+ #region [ *** ]
+ //-----------------------------
+ if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 )
+ {
+ //DTX.t蜈ィ繝√ャ繝励ョ蜀咲函荳譎ょ●豁「();
+ DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「縺ィ繝溘く繧オ繝シ縺九i縺ョ蜑企勁();
+ DTX.On髱樊エサ諤ァ蛹();
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ if ( !b繧ウ繝ウ繝代け繝医Δ繝シ繝 )
+ {
+ if (stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan)
+ {
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 谿オ菴埼∈謚");
+ stage谿オ菴埼∈謚.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚;
+ }
+ else
+ {
+ Trace.TraceInformation("----------------------");
+ Trace.TraceInformation("笆 驕ク譖イ");
+ stage驕ク譖イ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ;
+ }
+ stage驕ク譖イ.NowSong++;
+
+ foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ pg.plugin.On繧ケ繝繝シ繧ク螟画峩();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ }
+ else
+ {
+ base.Window.Close();
+ }
+ }
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.ChangeSkin:
+ #region [ *** ]
+ //-----------------------------
+ if ( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 )
+ {
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 驕ク譖イ" );
+ stage驕ク譖イ.On豢サ諤ァ蛹();
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク;
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ;
+ this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧();
+ }
+ //-----------------------------
+ #endregion
+ break;
+
+ case CStage.E繧ケ繝繝シ繧ク.邨ゆコ:
+ #region [ *** ]
+ //-----------------------------
+ if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 )
+ {
+ base.Exit();
+ }
+ //-----------------------------
+ #endregion
+ break;
+ }
+
+ actScanningLoudness.On騾イ陦梧緒逕サ();
+
+ if (r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null && r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID != CStage.E繧ケ繝繝シ繧ク.襍キ蜍 && TJAPlayer3.Tx.Network_Connection != null)
+ {
+ if (Math.Abs(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - this.蜑榊屓縺ョ繧キ繧ケ繝繝譎ょ綾ms) > 10000)
+ {
+ this.蜑榊屓縺ョ繧キ繧ケ繝繝譎ょ綾ms = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+ Task.Factory.StartNew(() =>
+ {
+ //IPv4 8.8.8.8縺ォPing繧帝∽ソ。縺吶k(timeout 5000ms)
+ PingReply reply = new Ping().Send("8.8.8.8", 5000);
+ this.b繝阪ャ繝医Ρ繝シ繧ッ縺ォ謗・邯壻クュ = reply.Status == IPStatus.Success;
+ });
+ }
+ TJAPlayer3.Tx.Network_Connection.t2D謠冗判(app.Device, GameWindowSize.Width - (TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), GameWindowSize.Height - TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height, new Rectangle((TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2) * (this.b繝阪ャ繝医Ρ繝シ繧ッ縺ォ謗・邯壻クュ ? 0 : 1), 0, TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height));
+ }
+ // 繧ェ繝シ繝舌Ξ繧、繧呈緒逕サ縺吶k(繝繧ッ繧ケ繝√Ε縺ョ逕滓舌&繧後※縺縺ェ縺襍キ蜍輔せ繝繝シ繧ク縺ッ萓句、
+ if (r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null && r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID != CStage.E繧ケ繝繝シ繧ク.襍キ蜍 && TJAPlayer3.Tx.Overlay != null)
+ {
+ TJAPlayer3.Tx.Overlay.t2D謠冗判(app.Device, 0, 0);
+ }
+ }
+ this.Device.EndScene(); // Present()縺ッ game.cs縺ョOnFrameEnd()縺ォ逋サ骭イ縺輔l縺溘;raphicsDeviceManager.game_FrameEnd() 蜀縺ァ螳溯。後&繧後k縺ョ縺ァ荳崎ヲ
+ // (縺、縺セ繧翫 ̄resent()縺ッ縲.raw()螳御コ蠕後↓螳溯。後&繧後k)
+#if !GPUFlushAfterPresent
+ actFlushGPU?.On騾イ陦梧緒逕サ(); // Flush GPU // EndScene()ス霸resent()髢 (縺、縺セ繧碍Sync蜑) 縺ァFlush螳溯。
+#endif
+ if ( Sound邂。逅?.GetCurrentSoundDeviceType() != "DirectSound" )
+ {
+ Sound邂。逅?.t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧(); // 繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ縺ョ譖エ譁ー; 逕サ髱「謠冗判縺ィ蜷梧悄縺輔○繧九%縺ィ縺ァ縲√せ繧ッ繝ュ繝シ繝ォ繧偵せ繝繝シ繧コ縺ォ縺吶k
+ }
+
+
+ #region [ 蜈ィ逕サ髱「_繧ヲ繧、繝ウ繝峨え蛻繧頑崛縺 ]
+ if ( this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え蛻繧頑崛縺医r陦後≧ )
+ {
+ ConfigIni.b蜈ィ逕サ髱「繝「繝シ繝 = !ConfigIni.b蜈ィ逕サ髱「繝「繝シ繝;
+ app.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺();
+ this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え蛻繧頑崛縺医r陦後≧ = false;
+ }
+ #endregion
+ #region [ 蝙ら峩蝓コ邱壼酔譛溷繧頑崛縺 ]
+ if ( this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ )
+ {
+ bool bIsMaximized = this.Window.IsMaximized; // #23510 2010.11.3 yyagi: to backup current window mode before changing VSyncWait
+ currentClientSize = this.Window.ClientSize; // #23510 2010.11.3 yyagi: to backup current window size before changing VSyncWait
+ DeviceSettings currentSettings = app.GraphicsDeviceManager.CurrentSettings;
+ currentSettings.EnableVSync = ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧;
+ app.GraphicsDeviceManager.ChangeDevice( currentSettings );
+ this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ = false;
+ base.Window.ClientSize = new Size(currentClientSize.Width, currentClientSize.Height); // #23510 2010.11.3 yyagi: to resume window size after changing VSyncWait
+ if (bIsMaximized)
+ {
+ this.Window.WindowState = FormWindowState.Maximized; // #23510 2010.11.3 yyagi: to resume window mode after changing VSyncWait
+ }
+ }
+ #endregion
+ }
+
+ // 縺昴ョ莉
+
+ #region [ 豎守畑繝倥Ν繝代シ ]
+ //-----------------
+ public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( string fileName )
+ {
+ return t繝繧ッ繧ケ繝√Ε縺ョ逕滓( fileName, false );
+ }
+ public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( string fileName, bool b鮟偵r騾城℃縺吶k )
+ {
+ if ( app == null )
+ {
+ return null;
+ }
+ try
+ {
+ return new CTexture( app.Device, fileName, TextureFormat, b鮟偵r騾城℃縺吶k );
+ }
+ catch ( CTextureCreateFailedException e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", fileName );
+ return null;
+ }
+ catch ( FileNotFoundException )
+ {
+ Trace.TraceWarning( "繝繧ッ繧ケ繝√Ε繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName );
+ return null;
+ }
+ }
+ public static void t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref CTexture tx )
+ {
+ TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref tx );
+ }
+ public static void t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref CTextureAf tx )
+ {
+ TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref tx );
+ }
+ public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( byte[] txData )
+ {
+ return t繝繧ッ繧ケ繝√Ε縺ョ逕滓( txData, false );
+ }
+ public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( byte[] txData, bool b鮟偵r騾城℃縺吶k )
+ {
+ if ( app == null )
+ {
+ return null;
+ }
+ try
+ {
+ return new CTexture( app.Device, txData, TextureFormat, b鮟偵r騾城℃縺吶k );
+ }
+ catch ( CTextureCreateFailedException e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(txData)" );
+ return null;
+ }
+ }
+ public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( Bitmap bitmap )
+ {
+ return t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bitmap, false );
+ }
+ public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( Bitmap bitmap, bool b鮟偵r騾城℃縺吶k )
+ {
+ if ( app == null )
+ {
+ return null;
+ }
+ if (bitmap == null)
+ {
+ Trace.TraceError("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(bitmap==null)");
+ return null;
+ }
+ try
+ {
+ return new CTexture( app.Device, bitmap, TextureFormat, b鮟偵r騾城℃縺吶k );
+ }
+ catch ( CTextureCreateFailedException e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(txData)" );
+ return null;
+ }
+ }
+
+ public static CTextureAf t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( string fileName )
+ {
+ return t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( fileName, false );
+ }
+ public static CTextureAf t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( string fileName, bool b鮟偵r騾城℃縺吶k )
+ {
+ if ( app == null )
+ {
+ return null;
+ }
+ try
+ {
+ return new CTextureAf( app.Device, fileName, TextureFormat, b鮟偵r騾城℃縺吶k );
+ }
+ catch ( CTextureCreateFailedException e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", fileName );
+ return null;
+ }
+ catch ( FileNotFoundException e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "繝繧ッ繧ケ繝√Ε繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName );
+ return null;
+ }
+ }
+ public static CDirectShow t螟ア謨励@縺ヲ繧ゅせ繧ュ繝繝怜庄閭ス縺ェDirectShow繧堤函謌舌☆繧(string fileName, IntPtr hWnd, bool b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺)
+ {
+ CDirectShow ds = null;
+ if( File.Exists( fileName ) )
+ {
+ try
+ {
+ ds = new CDirectShow(fileName, hWnd, b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺);
+ }
+ catch (FileNotFoundException e)
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError("蜍慕判繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName);
+ ds = null; // Dispose 縺ッ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ蜀縺ァ螳滓命貂医∩
+ }
+ catch (Exception e)
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError("DirectShow 縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲[{0}]", fileName);
+ ds = null; // Dispose 縺ッ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ蜀縺ァ螳滓命貂医∩
+ }
+ }
+ else
+ {
+ Trace.TraceError("蜍慕判繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName);
+ return null;
+ }
+
+ return ds;
+ }
+
+ /// 繝励Ο繝代ユ繧」縲√う繝ウ繝繧ッ繧オ縺ォ縺ッ ref 縺ッ菴ソ逕ィ縺ァ縺阪↑縺縺ョ縺ァ豕ィ諢上
+ public static void t螳牙ィ縺ォDispose縺吶k(ref T obj)
+ {
+ if (obj == null)
+ return;
+
+ var d = obj as IDisposable;
+
+ if (d != null)
+ d.Dispose();
+
+ obj = default(T);
+ }
+
+ public static void t螳牙ィ縺ォDispose縺吶k(ref T[] array) where T : class, IDisposable //2020.08.01 Mr-Ojii twopointzero豌上ョ繧ス繝シ繧ケ繧ウ繝シ繝峨r繧ゅ→縺ォ霑ス蜉
+ {
+ if (array == null)
+ {
+ return;
+ }
+
+ for (var i = 0; i < array.Length; i++)
+ {
+ array[i]?.Dispose();
+ array[i] = null;
+ }
+ }
+
+ ///
+ /// 縺昴ョ繝輔か繝ォ繝縺ョ騾」逡ェ逕サ蜒上ョ譛螟ァ蛟、繧定ソ斐☆縲
+ ///
+ public static int t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(string 繝繧」繝ャ繧ッ繝医Μ蜷, string 繝励Ξ繝輔ぅ繝繧ッ繧ケ = "", string 諡。蠑オ蟄 = ".png")
+ {
+ int num = 0;
+ while(File.Exists(繝繧」繝ャ繧ッ繝医Μ蜷 + 繝励Ξ繝輔ぅ繝繧ッ繧ケ + num + 諡。蠑オ蟄))
+ {
+ num++;
+ }
+ return num;
+ }
+
+ ///
+ /// 譖イ蜷阪ユ繧ッ繧ケ繝√Ε縺ョ邵ョ蟆丞咲紫繧定ソ斐☆縲
+ ///
+ /// 譖イ蜷阪ユ繧ッ繧ケ繝√Ε縲
+ /// 遲牙阪〒陦ィ遉コ縺吶k繝斐け繧サ繝ォ謨ー縺ョ譛螟ァ蛟、(繝繝輔か繝ォ繝亥、:645)
+ /// 譖イ蜷阪ユ繧ッ繧ケ繝√Ε縺ョ邵ョ蟆丞咲紫縲ゅ◎縺ョ繝繧ッ繧ケ繝√Ε縺系ull縺ェ繧峨ー荳蛟(1f)繧定ソ斐☆縲
+ public static float GetSongNameXScaling(ref CTexture cTexture, int samePixel = 660)
+ {
+ if (cTexture == null) return 1f;
+ float scalingRate = (float)samePixel / (float)cTexture.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width;
+ if (cTexture.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width <= samePixel)
+ scalingRate = 1.0f;
+ return scalingRate;
+ }
+
+ ///
+ /// 髮」譏灘コヲ繧定。ィ縺呎焚蟄励r蛻玲嫌菴薙↓螟画鋤縺励∪縺吶
+ ///
+ /// 髮」譏灘コヲ繧定。ィ縺呎焚蟄励
+ /// Difficulty 蛻玲嫌菴
+ public static Difficulty DifficultyNumberToEnum(int number)
+ {
+ switch (number)
+ {
+ case 0:
+ return Difficulty.Easy;
+ case 1:
+ return Difficulty.Normal;
+ case 2:
+ return Difficulty.Hard;
+ case 3:
+ return Difficulty.Oni;
+ case 4:
+ return Difficulty.Edit;
+ case 5:
+ return Difficulty.Tower;
+ case 6:
+ return Difficulty.Dan;
+ default:
+ throw new IndexOutOfRangeException();
+ }
+ }
+
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ private bool b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = true;
+ private bool b邨ゆコ蜃ヲ逅螳御コ貂医∩;
+ private bool b繝阪ャ繝医Ρ繝シ繧ッ縺ォ謗・邯壻クュ = false;
+ private long 蜑榊屓縺ョ繧キ繧ケ繝繝譎ょ綾ms = long.MinValue;
+ private static CDTX[] dtx = new CDTX[ 4 ];
+
+ public static TextureLoader Tx = new TextureLoader();
+
+ private List list繝医ャ繝励Ξ繝吶ΝActivities;
+ private int n騾イ陦梧緒逕サ縺ョ謌サ繧雁、;
+ private MouseButtons mb = System.Windows.Forms.MouseButtons.Left;
+ private string strWindowTitle
+ {
+ get
+ {
+ if ( DTXVmode.Enabled )
+ {
+ return "DTXViewer release " + VERSION;
+ }
+ else
+ {
+ return "TJAPlayer3 feat.DTXMania";
+ }
+ }
+ }
+ private CSound previewSound;
+ public static long StartupTime
+ {
+ get;
+ private set;
+ }
+
+ private void t襍キ蜍募ヲ逅()
+ {
+ #region [ strEXE縺ョ縺ゅk繝輔か繝ォ繝繧呈アコ螳壹☆繧 ]
+ //-----------------
+// BEGIN #23629 2010.11.13 from: 繝繝舌ャ繧ー譎ゅッ Application.ExecutablePath 縺 ($SolutionDir)/bin/x86/Debug/ 縺ェ縺ゥ縺ォ縺ェ繧 System/ 縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励☆繧九ョ縺ァ縲√き繝ャ繝ウ繝医ョ繧」繝ャ繧ッ繝医Μ繧呈治逕ィ縺吶k縲ゑシ医励Ο繧ク繧ァ繧ッ繝医ョ繝励Ο繝代ユ繧」竊偵ョ繝舌ャ繧ー竊剃ス懈・ュ繝繧」繝ャ繧ッ繝医Μ縺梧怏蜉ケ縺ォ縺ェ繧具シ
+#if DEBUG
+ strEXE縺ョ縺ゅk繝輔か繝ォ繝 = Environment.CurrentDirectory + @"\";
+#else
+ strEXE縺ョ縺ゅk繝輔か繝ォ繝 = Path.GetDirectoryName( Application.ExecutablePath ) + @"\"; // #23629 2010.11.9 yyagi: set correct pathname where DTXManiaGR.exe is.
+#endif
+ // END #23629 2010.11.13 from
+ //-----------------
+ #endregion
+
+ #region [ Config.ini 縺ョ隱ュ霎シ縺ソ ]
+ //---------------------
+ NamePlateConfig = new NamePlateConfig();
+ NamePlateConfig.tNamePlateConfig();
+ ConfigIni = new CConfigIni();
+ string path = strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Config.ini";
+ if( File.Exists( path ) )
+ {
+ try
+ {
+ ConfigIni.t繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ( path );
+ }
+ catch (Exception e)
+ {
+ //ConfigIni = new CConfigIni(); // 蟄伜惠縺励※縺ェ縺代l縺ー譁ー隕冗函謌
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (b8d93255-bbe4-4ca3-8264-7ee5175b19f3)" );
+ }
+ }
+ this.Window.EnableSystemMenu = TJAPlayer3.ConfigIni.bIsEnabledSystemMenu; // #28200 2011.5.1 yyagi
+ // 2012.8.22 Config.ini縺檎┌縺縺ィ縺阪↓蛻晄悄蛟、縺碁←逕ィ縺輔l繧九h縺縲√%縺ョ險ュ螳夊。後rif繝悶Ο繝繧ッ螟悶↓遘サ蜍
+
+ //---------------------
+ #endregion
+ #region [ 繝ュ繧ー蜃コ蜉幃幕蟋 ]
+ //---------------------
+ Trace.AutoFlush = true;
+ if( ConfigIni.b繝ュ繧ー蜃コ蜉 )
+ {
+ try
+ {
+ Trace.Listeners.Add( new CTraceLogListener( new StreamWriter( System.IO.Path.Combine( strEXE縺ョ縺ゅk繝輔か繝ォ繝, "TJAPlayer3.log" ), false, Encoding.GetEncoding( "Shift_JIS" ) ) ) );
+ }
+ catch ( System.UnauthorizedAccessException ) // #24481 2011.2.20 yyagi
+ {
+ int c = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja")? 0 : 1;
+ string[] mes_writeErr = {
+ "DTXManiaLog.txt縺ク縺ョ譖ク縺崎セシ縺ソ縺後〒縺阪∪縺帙s縺ァ縺励◆縲よ嶌縺崎セシ縺ソ縺ァ縺阪k繧医≧縺ォ縺励※縺九i縲∝榊コヲ襍キ蜍輔@縺ヲ縺上□縺輔>縲",
+ "Failed to write DTXManiaLog.txt. Please set it writable and try again."
+ };
+ MessageBox.Show( mes_writeErr[c], "DTXMania boot error", MessageBoxButtons.OK, MessageBoxIcon.Error );
+ Environment.Exit(1);
+ }
+ }
+ Trace.WriteLine("");
+ Trace.WriteLine( "DTXMania powered by YAMAHA Silent Session Drums" );
+ Trace.WriteLine( string.Format( "Release: {0}", VERSION ) );
+ Trace.WriteLine( "" );
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ蛻晄悄蛹" );
+ Trace.TraceInformation( "OS Version: " + Environment.OSVersion );
+ Trace.TraceInformation( "ProcessorCount: " + Environment.ProcessorCount.ToString() );
+ Trace.TraceInformation( "CLR Version: " + Environment.Version.ToString() );
+ //---------------------
+ #endregion
+ #region [ DTXVmode繧ッ繝ゥ繧ケ 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ //Trace.Indent();
+ try
+ {
+ DTXVmode = new CDTXVmode();
+ DTXVmode.Enabled = false;
+ //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ finally
+ {
+ //Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+
+
+ #region [ 繧ヲ繧」繝ウ繝峨え蛻晄悄蛹 ]
+ //---------------------
+ base.Window.StartPosition = FormStartPosition.Manual; // #30675 2013.02.04 ikanick add
+ base.Window.Location = new Point( ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX, ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY ); // #30675 2013.02.04 ikanick add
+
+
+ base.Window.Text = "";
+
+ base.Window.StartPosition = FormStartPosition.Manual; // #30675 2013.02.04 ikanick add
+ base.Window.Location = new Point(ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX, ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY); // #30675 2013.02.04 ikanick add
+
+ base.Window.ClientSize = new Size(ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth, ConfigIni.n繧ヲ繧、繝ウ繝峨えheight); // #34510 yyagi 2010.10.31 to change window size got from Config.ini
+#if !WindowedFullscreen
+ if (!ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝) // #23510 2010.11.02 yyagi: add; to recover window size in case bootup with fullscreen mode
+ { // #30666 2013.02.02 yyagi: currentClientSize should be always made
+#endif
+ currentClientSize = new Size( ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth, ConfigIni.n繧ヲ繧、繝ウ繝峨えheight );
+#if !WindowedFullscreen
+ }
+#endif
+ base.Window.MaximizeBox = true; // #23510 2010.11.04 yyagi: to support maximizing window
+ base.Window.FormBorderStyle = FormBorderStyle.Sizable; // #23510 2010.10.27 yyagi: changed from FixedDialog to Sizable, to support window resize
+ // #30666 2013.02.02 yyagi: moved the code to t蜈ィ逕サ髱「_繧ヲ繧、繝ウ繝峨え繝「繝シ繝牙繧頑崛縺()
+ base.Window.ShowIcon = true;
+ base.Window.Icon = global::TJAPlayer3.Properties.Resources.tjap3;
+ base.Window.KeyDown += new KeyEventHandler( this.Window_KeyDown );
+ base.Window.MouseUp +=new MouseEventHandler( this.Window_MouseUp);
+ base.Window.MouseDoubleClick += new MouseEventHandler(this.Window_MouseDoubleClick); // #23510 2010.11.13 yyagi: to go fullscreen mode
+ base.Window.ResizeEnd += new EventHandler(this.Window_ResizeEnd); // #23510 2010.11.20 yyagi: to set resized window size in Config.ini
+ base.Window.ApplicationActivated += new EventHandler(this.Window_ApplicationActivated);
+ base.Window.ApplicationDeactivated += new EventHandler( this.Window_ApplicationDeactivated );
+ //---------------------
+ #endregion
+ #region [ Direct3D9Ex繧剃スソ縺縺九←縺縺句愛螳 ]
+ #endregion
+ #region [ Direct3D9 繝繝舌う繧ケ縺ョ逕滓 ]
+ //---------------------
+ DeviceSettings settings = new DeviceSettings();
+#if WindowedFullscreen
+ settings.Windowed = true; // #30666 2013.2.2 yyagi: Fullscreenmode is "Maximized window" mode
+#else
+ settings.Windowed = ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝;
+#endif
+ settings.BackBufferWidth = SampleFramework.GameWindowSize.Width;
+ settings.BackBufferHeight = SampleFramework.GameWindowSize.Height;
+// settings.BackBufferCount = 3;
+ settings.EnableVSync = ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧;
+// settings.BackBufferFormat = Format.A8R8G8B8;
+// settings.MultisampleType = MultisampleType.FourSamples;
+// settings.MultisampleQuality = 4;
+// settings.MultisampleType = MultisampleType.None;
+// settings.MultisampleQuality = 0;
+
+ try
+ {
+ base.GraphicsDeviceManager.ChangeDevice(settings);
+ }
+ catch (DeviceCreationException e)
+ {
+ Trace.TraceError(e.ToString());
+ MessageBox.Show(e.ToString(), "DTXMania failed to boot: DirectX9 Initialize Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ Environment.Exit(-1);
+ }
+
+ base.IsFixedTimeStep = false;
+// base.TargetElapsedTime = TimeSpan.FromTicks( 10000000 / 75 );
+ base.Window.ClientSize = new Size(ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth, ConfigIni.n繧ヲ繧、繝ウ繝峨えheight); // #23510 2010.10.31 yyagi: to recover window size. width and height are able to get from Config.ini.
+ base.InactiveSleepTime = TimeSpan.FromMilliseconds((float)(ConfigIni.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s)); // #23568 2010.11.3 yyagi: to support valiable sleep value when !IsActive
+ // #23568 2010.11.4 ikanick changed ( 1 -> ConfigIni )
+#if WindowedFullscreen
+ this.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺(); // #30666 2013.2.2 yyagi: finalize settings for "Maximized window mode"
+#endif
+ actFlushGPU = new CActFlushGPU();
+ //---------------------
+ #endregion
+
+ DTX = null;
+
+ #region [ Skin 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Skin = new CSkin( TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false);
+ TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ); // 譌ァ謖螳壹ョSkin繝輔か繝ォ繝縺梧カ域サ縺励※縺縺溷エ蜷医↓蛯吶∴繧
+ Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ catch (Exception e)
+ {
+ Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" );
+ throw;
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ //-----------
+ #region [ Timer 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "繧ソ繧、繝槭ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia );
+ Trace.TraceInformation( "繧ソ繧、繝槭ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ //-----------
+
+ #region [ FPS 繧ォ繧ヲ繝ウ繧ソ縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "FPS繧ォ繧ヲ繝ウ繧ソ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ FPS = new CFPS();
+ Trace.TraceInformation( "FPS繧ォ繧ヲ繝ウ繧ソ繧堤函謌舌@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ act譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ act譁蟄励さ繝ウ繧ス繝シ繝ォ = new C譁蟄励さ繝ウ繧ス繝シ繝ォ();
+ Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ繧堤函謌舌@縺セ縺励◆縲" );
+ act譁蟄励さ繝ウ繧ス繝シ繝ォ.On豢サ諤ァ蛹();
+ Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ繧呈エサ諤ァ蛹悶@縺セ縺励◆縲" );
+ Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception )
+ {
+ Trace.TraceError( exception.ToString() );
+ Trace.TraceError( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ Input邂。逅 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "DirectInput, MIDI蜈・蜉帙ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ bool bUseMIDIIn = !DTXVmode.Enabled;
+ Input邂。逅 = new CInput邂。逅( base.Window.Handle, bUseMIDIIn );
+ foreach( IInputDevice device in Input邂。逅.list蜈・蜉帙ョ繝舌う繧ケ )
+ {
+ if( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick ) && !ConfigIni.dicJoystick.ContainsValue( device.GUID ) )
+ {
+ int key = 0;
+ while( ConfigIni.dicJoystick.ContainsKey( key ) )
+ {
+ key++;
+ }
+ ConfigIni.dicJoystick.Add( key, device.GUID );
+ }
+ }
+ foreach( IInputDevice device2 in Input邂。逅.list蜈・蜉帙ョ繝舌う繧ケ )
+ {
+ if( device2.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick )
+ {
+ foreach( KeyValuePair pair in ConfigIni.dicJoystick )
+ {
+ if( device2.GUID.Equals( pair.Value ) )
+ {
+ ( (CInputJoystick) device2 ).SetID( pair.Key );
+ break;
+ }
+ }
+ continue;
+ }
+ }
+ Trace.TraceInformation( "DirectInput 縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception2 )
+ {
+ Trace.TraceError( "DirectInput, MIDI蜈・蜉帙ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" );
+ throw;
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ Pad 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "繝代ャ繝峨ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Pad = new CPad( ConfigIni, Input邂。逅 );
+ Trace.TraceInformation( "繝代ャ繝峨ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception3 )
+ {
+ Trace.TraceError( exception3.ToString() );
+ Trace.TraceError( "繝代ャ繝峨ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ Sound邂。逅 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ ESoundDeviceType soundDeviceType;
+ switch ( TJAPlayer3.ConfigIni.nSoundDeviceType )
+ {
+ case 0:
+ soundDeviceType = ESoundDeviceType.DirectSound;
+ break;
+ case 1:
+ soundDeviceType = ESoundDeviceType.ASIO;
+ break;
+ case 2:
+ soundDeviceType = ESoundDeviceType.ExclusiveWASAPI;
+ break;
+ default:
+ soundDeviceType = ESoundDeviceType.Unknown;
+ break;
+ }
+ Sound邂。逅 = new CSound邂。逅(base.Window.Handle,
+ soundDeviceType,
+ TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs,
+ // CDTXMania.ConfigIni.nASIOBufferSizeMs,
+ 0,
+ TJAPlayer3.ConfigIni.nASIODevice,
+ TJAPlayer3.ConfigIni.bUseOSTimer
+ );
+ //Sound邂。逅 = FDK.CSound邂。逅.Instance;
+ //Sound邂。逅.t蛻晄悄蛹( soundDeviceType, 0, 0, CDTXMania.ConfigIni.nASIODevice, base.Window.Handle );
+
+
+ Trace.TraceInformation("Initializing loudness scanning, song gain control, and sound group level control...");
+ Trace.Indent();
+ try
+ {
+ actScanningLoudness = new CActScanningLoudness();
+ actScanningLoudness.On豢サ諤ァ蛹();
+ LoudnessMetadataScanner.ScanningStateChanged +=
+ (_, args) => actScanningLoudness.bIsActivelyScanning = args.IsActivelyScanning;
+ LoudnessMetadataScanner.StartBackgroundScanning();
+
+ SongGainController = new SongGainController();
+ ConfigIniToSongGainControllerBinder.Bind(ConfigIni, SongGainController);
+
+ SoundGroupLevelController = new SoundGroupLevelController(CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ);
+ ConfigIniToSoundGroupLevelControllerBinder.Bind(ConfigIni, SoundGroupLevelController);
+ }
+ finally
+ {
+ Trace.Unindent();
+ Trace.TraceInformation("Initialized loudness scanning, song gain control, and sound group level control.");
+ }
+
+ ShowWindowTitleWithSoundType();
+ FDK.CSound邂。逅.bIsTimeStretch = TJAPlayer3.ConfigIni.bTimeStretch;
+ Sound邂。逅.nMasterVolume = TJAPlayer3.ConfigIni.nMasterVolume;
+ //FDK.CSound邂。逅.bIsMP3DecodeByWindowsCodec = CDTXMania.ConfigIni.bNoMP3Streaming;
+ Trace.TraceInformation( "繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ catch (Exception e)
+ {
+ throw new NullReferenceException("繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺後イ縺ィ縺、繧よ怏蜉ケ縺ォ縺ェ縺」縺ヲ縺縺ェ縺縺溘a縲√し繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶′縺ァ縺阪∪縺帙s縺ァ縺励◆縲", e);
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ Songs邂。逅 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Songs邂。逅 = new CSongs邂。逅();
+// Songs邂。逅_陬剰ェュ = new CSongs邂。逅();
+ EnumSongs = new CEnumSongs();
+ actEnumSongs = new CActEnumSongs();
+ Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "譖イ繝ェ繧ケ繝医ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ CAvi 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ CAvi.t蛻晄悄蛹();
+ //---------------------
+ #endregion
+ #region [ Random 縺ョ蛻晄悄蛹 ]
+ //---------------------
+ Random = new Random( (int) Timer.n繧キ繧ケ繝繝譎ょ綾 );
+ //---------------------
+ #endregion
+ #region [ 繧ケ繝繝シ繧ク縺ョ蛻晄悄蛹 ]
+ //---------------------
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = null;
+ r逶エ蜑阪ョ繧ケ繝繝シ繧ク = null;
+ stage襍キ蜍 = new CStage襍キ蜍();
+ stage繧ソ繧、繝医Ν = new CStage繧ソ繧、繝医Ν();
+// stage繧ェ繝励す繝ァ繝ウ = new CStage繧ェ繝励す繝ァ繝ウ();
+ stage繧ウ繝ウ繝輔ぅ繧ー = new CStage繧ウ繝ウ繝輔ぅ繧ー();
+ stage驕ク譖イ = new CStage驕ク譖イ();
+ stage谿オ菴埼∈謚 = new CStage谿オ菴埼∈謚();
+ stage譖イ隱ュ縺ソ霎シ縺ソ = new CStage譖イ隱ュ縺ソ霎シ縺ソ();
+ stage貍泌・上ラ繝ゥ繝逕サ髱「 = new CStage貍泌・上ラ繝ゥ繝逕サ髱「();
+ stage邨先棡 = new CStage邨先棡();
+ stageChangeSkin = new CStageChangeSkin();
+ stage邨ゆコ = new CStage邨ゆコ();
+ NamePlate = new CNamePlate();
+ this.list繝医ャ繝励Ξ繝吶ΝActivities = new List();
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( actEnumSongs );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( act譁蟄励さ繝ウ繧ス繝シ繝ォ );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage襍キ蜍 );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage繧ソ繧、繝医Ν );
+// this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage繧ェ繝励す繝ァ繝ウ );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage繧ウ繝ウ繝輔ぅ繧ー );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage驕ク譖イ );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage谿オ菴埼∈謚 );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage譖イ隱ュ縺ソ霎シ縺ソ );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage貍泌・上ラ繝ゥ繝逕サ髱「 );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage邨先棡 );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stageChangeSkin );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage邨ゆコ );
+ this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( actFlushGPU );
+ //---------------------
+ #endregion
+ #region [ 繝励Λ繧ー繧、繝ウ縺ョ讀懃エ「縺ィ逕滓 ]
+ //---------------------
+ PluginHost = new CPluginHost();
+
+ Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ縺ョ讀懃エ「縺ィ逕滓舌r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ this.t繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓();
+ Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ縺ョ讀懃エ「縺ィ逕滓舌r螳御コ縺励∪縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ 繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹 ]
+ //---------------------
+ if( this.list繝励Λ繧ー繧、繝ウ != null && this.list繝励Λ繧ー繧、繝ウ.Count > 0 )
+ {
+ Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ st.plugin.On蛻晄悄蛹( this.PluginHost );
+ st.plugin.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ Trace.TraceInformation( "縺吶∋縺ヲ縺ョ繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+ }
+ catch
+ {
+ Trace.TraceError( "繝励Λ繧ー繧、繝ウ縺ョ縺ゥ繧後°縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" );
+ throw;
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+
+ //---------------------
+ #endregion
+
+ #region Discord縺ョ蜃ヲ逅
+ Discord.Initialize("784989629728161813");
+ StartupTime = Discord.GetUnixTime();
+ Discord.UpdatePresence("", Properties.Discord.Stage_StartUp, StartupTime);
+ #endregion
+
+
+ Trace.TraceInformation( "繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" );
+
+
+ #region [ 譛蛻昴ョ繧ケ繝繝シ繧ク縺ョ襍キ蜍 ]
+ //---------------------
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 襍キ蜍" );
+
+ if ( TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 )
+ {
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ;
+ }
+ else
+ {
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage襍キ蜍;
+ }
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On豢サ諤ァ蛹();
+
+ //---------------------
+ #endregion
+ }
+
+ public void ShowWindowTitleWithSoundType()
+ {
+ string delay = "";
+ if ( Sound邂。逅.GetCurrentSoundDeviceType() != "DirectSound" )
+ {
+ delay = "(" + Sound邂。逅.GetSoundDelay() + "ms)";
+ }
+ AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName();
+ base.Window.Text = asmApp.Name + " Ver." + VERSION + " (" + Sound邂。逅.GetCurrentSoundDeviceType() + delay + ")";
+ }
+
+ private void t邨ゆコ蜃ヲ逅()
+ {
+ if( !this.b邨ゆコ蜃ヲ逅螳御コ貂医∩ )
+ {
+ Trace.TraceInformation( "----------------------" );
+ Trace.TraceInformation( "笆 繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ邨ゆコ" );
+ #region [ 譖イ讀懃エ「縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if ( actEnumSongs != null )
+ {
+ Trace.TraceInformation( "譖イ讀懃エ「act縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ actEnumSongs.On髱樊エサ諤ァ蛹();
+ actEnumSongs= null;
+ Trace.TraceInformation( "譖イ讀懃エ「act縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ catch ( Exception e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "譖イ讀懃エ「act縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region [ 迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if( TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null && TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.b豢サ諤ァ蛹悶@縺ヲ繧 ) // #25398 2011.06.07 MODIFY FROM
+ {
+ Trace.TraceInformation( "迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク繧堤オゆコ縺励∪縺吶" );
+ Trace.Indent();
+ try
+ {
+ r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹();
+ Trace.TraceInformation( "迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region [ 繝励Λ繧ー繧、繝ウ縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if (this.list繝励Λ繧ー繧、繝ウ != null && this.list繝励Λ繧ー繧、繝ウ.Count > 0)
+ {
+ Trace.TraceInformation( "縺吶∋縺ヲ縺ョ繝励Λ繧ー繧、繝ウ繧堤オゆコ縺励∪縺吶" );
+ Trace.Indent();
+ try
+ {
+ foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ )
+ {
+ Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 );
+ st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ st.plugin.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+ st.plugin.On邨ゆコ();
+ Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 );
+ }
+ PluginHost = null;
+ Trace.TraceInformation( "縺吶∋縺ヲ縺ョ繝励Λ繧ー繧、繝ウ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region Discord縺ョ蜃ヲ逅
+ Discord.Shutdown();
+ #endregion
+ #region [ 譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if (Songs邂。逅 != null)
+ {
+ Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Songs邂。逅 = null;
+ Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception )
+ {
+ Trace.TraceError( exception.ToString() );
+ Trace.TraceError( "譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ CAvi.t邨ゆコ();
+ //---------------------
+ #endregion
+ #region TextureLoader縺ョ蜃ヲ逅
+ Tx.DisposeTexture();
+ #endregion
+ #region [ 繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if (Skin != null)
+ {
+ Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Skin.Dispose();
+ Skin = null;
+ Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception2 )
+ {
+ Trace.TraceError( exception2.ToString() );
+ Trace.TraceError( "繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region [ DirectSound縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if (Sound邂。逅 != null)
+ {
+ Trace.TraceInformation( "DirectSound 縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Sound邂。逅.Dispose();
+ Sound邂。逅 = null;
+ Trace.TraceInformation( "DirectSound 縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception3 )
+ {
+ Trace.TraceError( exception3.ToString() );
+ Trace.TraceError( "DirectSound 縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region [ 繝代ャ繝峨ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if (Pad != null)
+ {
+ Trace.TraceInformation( "繝代ャ繝峨ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Pad = null;
+ Trace.TraceInformation( "繝代ャ繝峨ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception4 )
+ {
+ Trace.TraceError( exception4.ToString() );
+ Trace.TraceError( "繝代ャ繝峨ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region [ DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if (Input邂。逅 != null)
+ {
+ Trace.TraceInformation( "DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ Input邂。逅.Dispose();
+ Input邂。逅 = null;
+ Trace.TraceInformation( "DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception5 )
+ {
+ Trace.TraceError( exception5.ToString() );
+ Trace.TraceError( "DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region [ 譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ if (act譁蟄励さ繝ウ繧ス繝シ繝ォ != null)
+ {
+ Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ Trace.Indent();
+ try
+ {
+ act譁蟄励さ繝ウ繧ス繝シ繝ォ.On髱樊エサ諤ァ蛹();
+ act譁蟄励さ繝ウ繧ス繝シ繝ォ = null;
+ Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ catch( Exception exception6 )
+ {
+ Trace.TraceError( exception6.ToString() );
+ Trace.TraceError( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ }
+ //---------------------
+ #endregion
+ #region [ FPS繧ォ繧ヲ繝ウ繧ソ縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ Trace.TraceInformation("FPS繧ォ繧ヲ繝ウ繧ソ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶");
+ Trace.Indent();
+ try
+ {
+ if( FPS != null )
+ {
+ FPS = null;
+ }
+ Trace.TraceInformation( "FPS繧ォ繧ヲ繝ウ繧ソ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ 繧ソ繧、繝槭ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ Trace.TraceInformation("繧ソ繧、繝槭ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶");
+ Trace.Indent();
+ try
+ {
+ if( Timer != null )
+ {
+ Timer.Dispose();
+ Timer = null;
+ Trace.TraceInformation( "繧ソ繧、繝槭ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ else
+ {
+ Trace.TraceInformation( "繧ソ繧、繝槭ッ菴ソ逕ィ縺輔l縺ヲ縺縺セ縺帙s縲" );
+ }
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ Config.ini縺ョ蜃コ蜉 ]
+ //---------------------
+ Trace.TraceInformation("Config.ini 繧貞コ蜉帙@縺セ縺吶");
+// if ( ConfigIni.bIsSwappedGuitarBass ) // #24063 2011.1.16 yyagi 繧ョ繧ソ繝シ繝吶シ繧ケ縺後せ繝ッ繝繝励@縺ヲ縺繧九→縺阪ッ蜈縺ォ謌サ縺
+ string str = strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Config.ini";
+ Trace.Indent();
+ try
+ {
+ if ( DTXVmode.Enabled )
+ {
+ DTXVmode.tUpdateConfigIni();
+ Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ險ュ螳壽ュ蝣ア繧偵,onfig.ini縺ォ菫晏ュ倥@縺セ縺励◆縲" );
+ }
+ else
+ {
+ ConfigIni.t譖ク縺榊コ縺( str );
+ Trace.TraceInformation( "菫晏ュ倥@縺セ縺励◆縲({0})", str );
+ }
+ }
+ catch( Exception e )
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "Config.ini 縺ョ蜃コ蜉帙↓螟ア謨励@縺セ縺励◆縲({0})", str );
+ }
+ finally
+ {
+ Trace.Unindent();
+ }
+
+ Trace.TraceInformation("Deinitializing loudness scanning, song gain control, and sound group level control...");
+ Trace.Indent();
+ try
+ {
+ SoundGroupLevelController = null;
+ SongGainController = null;
+ LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: true);
+ actScanningLoudness.On髱樊エサ諤ァ蛹();
+ actScanningLoudness = null;
+ }
+ finally
+ {
+ Trace.Unindent();
+ Trace.TraceInformation("Deinitialized loudness scanning, song gain control, and sound group level control.");
+ }
+
+ ConfigIni = null;
+
+ //---------------------
+ #endregion
+ #region [ DTXVmode縺ョ邨ゆコ蜃ヲ逅 ]
+ //---------------------
+ //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" );
+ //Trace.Indent();
+ try
+ {
+ if ( DTXVmode != null )
+ {
+ DTXVmode = null;
+ //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+ }
+ else
+ {
+ //Trace.TraceInformation( "DTXV繝「繝シ繝峨ッ菴ソ逕ィ縺輔l縺ヲ縺縺セ縺帙s縲" );
+ }
+ }
+ finally
+ {
+ //Trace.Unindent();
+ }
+ //---------------------
+ #endregion
+ #region [ DirectX縺ョ邨ゆコ蜃ヲ逅 ]
+ base.GraphicsDeviceManager.Dispose();
+ #endregion
+ Trace.TraceInformation( "繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" );
+
+
+ this.b邨ゆコ蜃ヲ逅螳御コ貂医∩ = true;
+ }
+ }
+ private CScoreIni tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー(string str譁ー繝偵せ繝医Μ陦)
+ {
+ bool bIsUpdatedDrums, bIsUpdatedGuitar, bIsUpdatedBass;
+ string strFilename = DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ + ".score.ini";
+ CScoreIni ini = new CScoreIni( strFilename );
+ if( !File.Exists( strFilename ) )
+ {
+ ini.st繝輔ぃ繧、繝ォ.Title = DTX.TITLE;
+ ini.st繝輔ぃ繧、繝ォ.Name = DTX.str繝輔ぃ繧、繝ォ蜷;
+ ini.st繝輔ぃ繧、繝ォ.Hash = CScoreIni.t繝輔ぃ繧、繝ォ縺ョMD5繧呈アゅa縺ヲ霑斐☆( DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ );
+ for( int i = 0; i < 6; i++ )
+ {
+ ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPerfect縺ォ縺ェ繧狗ッ蝗イms = nPerfect遽蝗イms;
+ ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGreat縺ォ縺ェ繧狗ッ蝗イms = nGreat遽蝗イms;
+ ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGood縺ォ縺ェ繧狗ッ蝗イms = nGood遽蝗イms;
+ ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPoor縺ォ縺ェ繧狗ッ蝗イms = nPoor遽蝗イms;
+ }
+ }
+ ini.st繝輔ぃ繧、繝ォ.BGMAdjust = DTX.nBGMAdjust;
+ CScoreIni.t譖エ譁ー譚。莉カ繧貞叙蠕励☆繧( out bIsUpdatedDrums, out bIsUpdatedGuitar, out bIsUpdatedBass );
+ if( bIsUpdatedDrums || bIsUpdatedGuitar || bIsUpdatedBass )
+ {
+ if( bIsUpdatedDrums )
+ {
+ ini.st繝輔ぃ繧、繝ォ.PlayCountDrums++;
+ }
+ if( bIsUpdatedGuitar )
+ {
+ ini.st繝輔ぃ繧、繝ォ.PlayCountGuitar++;
+ }
+ if( bIsUpdatedBass )
+ {
+ ini.st繝輔ぃ繧、繝ォ.PlayCountBass++;
+ }
+ ini.t繝偵せ繝医Μ繧定ソス蜉縺吶k( str譁ー繝偵せ繝医Μ陦 );
+ if( !b繧ウ繝ウ繝代け繝医Δ繝シ繝 )
+ {
+ stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Drums = ini.st繝輔ぃ繧、繝ォ.PlayCountDrums;
+ stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Guitar = ini.st繝輔ぃ繧、繝ォ.PlayCountGuitar;
+ stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Bass = ini.st繝輔ぃ繧、繝ォ.PlayCountBass;
+ for( int j = 0; j < ini.st繝輔ぃ繧、繝ォ.History.Length; j++ )
+ {
+ stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ[ j ] = ini.st繝輔ぃ繧、繝ォ.History[ j ];
+ }
+ }
+ }
+ if( ConfigIni.bScoreIni繧貞コ蜉帙☆繧 )
+ {
+ ini.t譖ク縺榊コ縺( strFilename );
+ }
+
+ return ini;
+ }
+ private void t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧()
+ {
+ GC.Collect(GC.MaxGeneration);
+ GC.WaitForPendingFinalizers();
+ GC.Collect(GC.MaxGeneration);
+ }
+ private void t繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓()
+ {
+ this.list繝励Λ繧ー繧、繝ウ = new List();
+
+ string strIPluginActivity縺ョ蜷榊燕 = typeof( IPluginActivity ).FullName;
+ string str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ = strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Plugins\\";
+
+ this.t謖螳壹ヵ繧ゥ繝ォ繝蜀縺ァ縺ョ繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, strIPluginActivity縺ョ蜷榊燕 );
+
+ if( this.list繝励Λ繧ー繧、繝ウ.Count > 0 )
+ Trace.TraceInformation( this.list繝励Λ繧ー繧、繝ウ.Count + " 蛟九ョ繝励Λ繧ー繧、繝ウ繧定ェュ縺ソ霎シ縺ソ縺セ縺励◆縲" );
+ }
+
+ public void RefleshSkin()
+ {
+ Trace.TraceInformation("繧ケ繧ュ繝ウ螟画峩:" + TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false));
+
+ TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.On髱樊エサ諤ァ蛹();
+
+ TJAPlayer3.Skin.Dispose();
+ TJAPlayer3.Skin = null;
+ TJAPlayer3.Skin = new CSkin(TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false);
+
+
+ TJAPlayer3.Tx.DisposeTexture();
+ TJAPlayer3.Tx.LoadTexture();
+
+ TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.On豢サ諤ァ蛹();
+ }
+ #region [ Window繧、繝吶Φ繝亥ヲ逅 ]
+ private void t謖螳壹ヵ繧ゥ繝ォ繝蜀縺ァ縺ョ繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓( string str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, string str繝励Λ繧ー繧、繝ウ蝙句錐 )
+ {
+ // 謖螳壹&繧後◆繝代せ縺悟ュ伜惠縺励↑縺縺ィ繧ィ繝ゥ繝シ
+ if( !Directory.Exists( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ ) )
+ {
+ Trace.TraceWarning( "繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝縺悟ュ伜惠縺励∪縺帙s縲(" + str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ + ")" );
+ return;
+ }
+
+ // (1) 縺吶∋縺ヲ縺ョ *.dll 縺ォ縺、縺縺ヲ窶ヲ
+ string[] strDLLs = System.IO.Directory.GetFiles( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, "*.dll" );
+ foreach( string dllName in strDLLs )
+ {
+ try
+ {
+ // (1-1) dll 繧偵い繧サ繝ウ繝悶Μ縺ィ縺励※隱ュ縺ソ霎シ繧縲
+ System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom( dllName );
+
+ // (1-2) 繧「繧サ繝ウ繝悶Μ蜀縺ョ縺吶∋縺ヲ縺ョ蝙九↓縺、縺縺ヲ縲√励Λ繧ー繧、繝ウ縺ィ縺励※譛牙柑縺玖ェソ縺ケ繧
+ foreach( Type t in asm.GetTypes() )
+ {
+ // (1-3) 竊薙け繝ゥ繧ケ縺ァ縺ゅj竊撤ublic縺ァ縺ゅj竊捺歓雎。繧ッ繝ゥ繧ケ縺ァ縺ェ縺鞘的Plugin蝙九ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺御ス懊l繧九蝙九r謖√▲縺ヲ縺繧後ー譛牙柑
+ if( t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface( str繝励Λ繧ー繧、繝ウ蝙句錐 ) != null )
+ {
+ // (1-4) 繧ッ繝ゥ繧ケ蜷阪°繧峨う繝ウ繧ケ繧ソ繝ウ繧ケ繧剃ス懈舌☆繧
+ var st = new STPlugin() {
+ plugin = (IPluginActivity) asm.CreateInstance( t.FullName ),
+ str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 = Path.GetDirectoryName( dllName ),
+ str繧「繧サ繝ウ繝悶Μ邁。譏灘錐 = asm.GetName().Name,
+ Version = asm.GetName().Version,
+ };
+
+ // (1-5) 繝励Λ繧ー繧、繝ウ繝ェ繧ケ繝医∈逋サ骭イ
+ this.list繝励Λ繧ー繧、繝ウ.Add( st );
+ Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ {0} ({1}, {2}, {3}) 繧定ェュ縺ソ霎シ縺ソ縺セ縺励◆縲", t.FullName, Path.GetFileName( dllName ), st.str繧「繧サ繝ウ繝悶Μ邁。譏灘錐, st.Version.ToString() );
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceInformation( dllName + " 縺九i繝励Λ繧ー繧、繝ウ繧堤函謌舌☆繧九%縺ィ縺ォ螟ア謨励@縺セ縺励◆縲ゅせ繧ュ繝繝励@縺セ縺吶" );
+ }
+ }
+
+ // (2) 繧オ繝悶ヵ繧ゥ繝ォ繝縺後≠繧後ー蜀榊クー縺吶k
+ string[] strDirs = Directory.GetDirectories( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, "*" );
+ foreach( string dir in strDirs )
+ this.t謖螳壹ヵ繧ゥ繝ォ繝蜀縺ァ縺ョ繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓( dir + "\\", str繝励Λ繧ー繧、繝ウ蝙句錐 );
+ }
+ //-----------------
+ private void Window_ApplicationActivated( object sender, EventArgs e )
+ {
+ this.bApplicationActive = true;
+ }
+ private void Window_ApplicationDeactivated( object sender, EventArgs e )
+ {
+ this.bApplicationActive = false;
+ }
+ private void Window_KeyDown( object sender, KeyEventArgs e )
+ {
+ if ( e.KeyCode == Keys.Menu )
+ {
+ e.Handled = true;
+ e.SuppressKeyPress = true;
+ }
+ else if ( ( e.KeyCode == Keys.Return ) && e.Alt )
+ {
+ if ( ConfigIni != null )
+ {
+ ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 = !ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝;
+ this.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺();
+ }
+ e.Handled = true;
+ e.SuppressKeyPress = true;
+ }
+ else
+ {
+ for ( int i = 0; i < 0x10; i++ )
+ {
+ if ( ConfigIni.KeyAssign.System.Capture[ i ].繧ウ繝シ繝 > 0 &&
+ e.KeyCode == DeviceConstantConverter.KeyToKeyCode( (SlimDXKeys.Key) ConfigIni.KeyAssign.System.Capture[ i ].繧ウ繝シ繝 ) )
+ {
+ // Debug.WriteLine( "capture: " + string.Format( "{0:2x}", (int) e.KeyCode ) + " " + (int) e.KeyCode );
+ string strFullPath =
+ Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "Capture_img" );
+ strFullPath = Path.Combine( strFullPath, DateTime.Now.ToString( "yyyyMMddHHmmss" ) + ".png" );
+ SaveResultScreen( strFullPath );
+ }
+ }
+ }
+ }
+ private void Window_MouseUp( object sender, MouseEventArgs e )
+ {
+ mb = e.Button;
+ }
+
+ private void Window_MouseDoubleClick( object sender, MouseEventArgs e) // #23510 2010.11.13 yyagi: to go full screen mode
+ {
+ if ( mb.Equals(MouseButtons.Left) && ConfigIni.bIsAllowedDoubleClickFullscreen ) // #26752 2011.11.27 yyagi
+ {
+ ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 = false;
+ this.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺();
+ }
+ }
+ private void Window_ResizeEnd(object sender, EventArgs e) // #23510 2010.11.20 yyagi: to get resized window size
+ {
+ if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 )
+ {
+ ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX = base.Window.Location.X; // #30675 2013.02.04 ikanick add
+ ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY = base.Window.Location.Y; //
+ }
+
+ ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth = (ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝) ? base.Window.ClientSize.Width : currentClientSize.Width; // #23510 2010.10.31 yyagi add
+ ConfigIni.n繧ヲ繧、繝ウ繝峨えheight = (ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝) ? base.Window.ClientSize.Height : currentClientSize.Height;
+ }
+ #endregion
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/DTXManiaGR.exe.x86.manifest b/TJAPlayer3/DTXManiaGR.exe.x86.manifest
new file mode 100644
index 00000000..0bfcb3b0
--- /dev/null
+++ b/TJAPlayer3/DTXManiaGR.exe.x86.manifest
@@ -0,0 +1,8 @@
+サソ
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TJAPlayer3/GlobalSuppressions.cs b/TJAPlayer3/GlobalSuppressions.cs
new file mode 100644
index 00000000..92c01f87
Binary files /dev/null and b/TJAPlayer3/GlobalSuppressions.cs differ
diff --git a/TJAPlayer3/Items/CItemBase.cs b/TJAPlayer3/Items/CItemBase.cs
new file mode 100644
index 00000000..7a1be928
--- /dev/null
+++ b/TJAPlayer3/Items/CItemBase.cs
@@ -0,0 +1,120 @@
+サソusing System;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 縺吶∋縺ヲ縺ョ繧「繧、繝繝縺ョ蝓コ譛ャ繧ッ繝ゥ繧ケ縲
+ ///
+ internal class CItemBase
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・;
+ public enum E繝代ロ繝ォ遞ョ蛻・
+ {
+ 騾壼クク,
+ 縺昴ョ莉
+ }
+
+ public E遞ョ蛻・ e遞ョ蛻・;
+ public enum E遞ョ蛻・
+ {
+ 蝓コ譛ャ蠖「,
+ ONorOFF繝医げ繝ォ,
+ ONorOFFor荳榊ョ壹せ繝ェ繝シ繧ケ繝繝シ繝,
+ 謨エ謨ー,
+ 繝ェ繧ケ繝,
+ 蛻譖ソ繝ェ繧ケ繝
+ }
+
+ public string str鬆逶ョ蜷;
+ public string str隱ャ譏取枚;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CItemBase()
+ {
+ this.str鬆逶ョ蜷 = "";
+ this.str隱ャ譏取枚 = "";
+ }
+ public CItemBase( string str鬆逶ョ蜷 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷 );
+ }
+ public CItemBase(string str鬆逶ョ蜷, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, str隱ャ譏取枚jp);
+ }
+ public CItemBase(string str鬆逶ョ蜷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+ public CItemBase(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・)
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ );
+ }
+ public CItemBase(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp);
+ }
+ public CItemBase(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+
+ // 繝。繧ス繝繝会シ帛ュ舌け繝ゥ繧ケ縺ァ螳溯」縺吶k
+
+ public virtual void tEnter謚シ荳()
+ {
+ }
+ public virtual void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍()
+ {
+ }
+ public virtual void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍()
+ {
+ }
+ public virtual void t蛻晄悄蛹( string str鬆逶ョ蜷 )
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・.騾壼クク );
+ }
+ public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+ public virtual void t蛻晄悄蛹( string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, "", "");
+ }
+ public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ this.str鬆逶ョ蜷 = str鬆逶ョ蜷;
+ this.e繝代ロ繝ォ遞ョ蛻・ = e繝代ロ繝ォ遞ョ蛻・;
+ this.str隱ャ譏取枚 = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? str隱ャ譏取枚jp : str隱ャ譏取枚en;
+ }
+ public virtual object obj迴セ蝨ィ蛟、()
+ {
+ return null;
+ }
+ public virtual int GetIndex()
+ {
+ return 0;
+ }
+ public virtual void SetIndex( int index )
+ {
+ }
+ }
+}
diff --git a/TJAPlayer3/Items/CItemInteger.cs b/TJAPlayer3/Items/CItemInteger.cs
new file mode 100644
index 00000000..d86f7832
--- /dev/null
+++ b/TJAPlayer3/Items/CItemInteger.cs
@@ -0,0 +1,125 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 縲梧紛謨ー縲阪r陦ィ縺吶い繧、繝繝縲
+ ///
+ internal class CItemInteger : CItemBase
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public int n迴セ蝨ィ縺ョ蛟、;
+ public bool b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CItemInteger()
+ {
+ base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.謨エ謨ー;
+ this.n譛蟆丞、 = 0;
+ this.n譛螟ァ蛟、 = 0;
+ this.n迴セ蝨ィ縺ョ蛟、 = 0;
+ this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧 = false;
+ }
+ public CItemInteger( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、 );
+ }
+ public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, str隱ャ譏取枚jp);
+ }
+ public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+
+ public CItemInteger( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・ );
+ }
+ public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp);
+ }
+ public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+
+ // CItemBase 螳溯」
+
+ public override void tEnter謚シ荳()
+ {
+ this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧 = !this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧;
+ }
+ public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍()
+ {
+ if( ++this.n迴セ蝨ィ縺ョ蛟、 > this.n譛螟ァ蛟、 )
+ {
+ this.n迴セ蝨ィ縺ョ蛟、 = this.n譛螟ァ蛟、;
+ }
+ }
+ public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍()
+ {
+ if( --this.n迴セ蝨ィ縺ョ蛟、 < this.n譛蟆丞、 )
+ {
+ this.n迴セ蝨ィ縺ョ蛟、 = this.n譛蟆丞、;
+ }
+ }
+ public void t蛻晄悄蛹( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、 )
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, "", "" );
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+
+ public void t蛻晄悄蛹( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, "", "" );
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ this.n譛蟆丞、 = n譛蟆丞、;
+ this.n譛螟ァ蛟、 = n譛螟ァ蛟、;
+ this.n迴セ蝨ィ縺ョ蛟、 = n蛻晄悄蛟、;
+ this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧 = false;
+ }
+ public override object obj迴セ蝨ィ蛟、()
+ {
+ return this.n迴セ蝨ィ縺ョ蛟、;
+ }
+ public override int GetIndex()
+ {
+ return this.n迴セ蝨ィ縺ョ蛟、;
+ }
+ public override void SetIndex( int index )
+ {
+ this.n迴セ蝨ィ縺ョ蛟、 = index;
+ }
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private int n譛蟆丞、;
+ private int n譛螟ァ蛟、;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Items/CItemList.cs b/TJAPlayer3/Items/CItemList.cs
new file mode 100644
index 00000000..4035bdb1
--- /dev/null
+++ b/TJAPlayer3/Items/CItemList.cs
@@ -0,0 +1,153 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 縲後Μ繧ケ繝医搾シ郁、謨ー縺ョ蝗コ螳壼、縺九i縺ョシ代▽繧帝∈謚槫庄閭スシ峨r陦ィ縺吶い繧、繝繝縲
+ ///
+ internal class CItemList : CItemBase
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public List list鬆逶ョ蛟、;
+ public int n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CItemList()
+ {
+ base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.繝ェ繧ケ繝;
+ this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0;
+ this.list鬆逶ョ蛟、 = new List();
+ }
+ public CItemList( string str鬆逶ョ蜷 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷 );
+ }
+ public CItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ );
+ }
+ public CItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, params string[] arg鬆逶ョ繝ェ繧ケ繝 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, arg鬆逶ョ繝ェ繧ケ繝 );
+ }
+ public CItemList(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, params string[] arg鬆逶ョ繝ェ繧ケ繝)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, arg鬆逶ョ繝ェ繧ケ繝);
+ }
+ public CItemList(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en, params string[] arg鬆逶ョ繝ェ繧ケ繝)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚en, arg鬆逶ョ繝ェ繧ケ繝);
+ }
+
+
+ // CItemBase 螳溯」
+
+ public override void tEnter謚シ荳()
+ {
+ this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍();
+ }
+ public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍()
+ {
+ if( ++this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ >= this.list鬆逶ョ蛟、.Count )
+ {
+ this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0;
+ }
+ }
+ public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍()
+ {
+ if( --this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ < 0 )
+ {
+ this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = this.list鬆逶ョ蛟、.Count - 1;
+ }
+ }
+ public override void t蛻晄悄蛹( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ {
+ base.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ );
+ this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0;
+ this.list鬆逶ョ蛟、.Clear();
+ }
+ public void t蛻晄悄蛹( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, params string[] arg鬆逶ョ繝ェ繧ケ繝 )
+ {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, "", "",arg鬆逶ョ繝ェ繧ケ繝);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, params string[] arg鬆逶ョ繝ェ繧ケ繝) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚jp, arg鬆逶ョ繝ェ繧ケ繝);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en, params string[] arg鬆逶ョ繝ェ繧ケ繝) {
+ base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、;
+ foreach (string str in arg鬆逶ョ繝ェ繧ケ繝) {
+ this.list鬆逶ョ蛟、.Add(str);
+ }
+ }
+ public override object obj迴セ蝨ィ蛟、()
+ {
+ return this.list鬆逶ョ蛟、[ n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ ];
+ }
+ public override int GetIndex()
+ {
+ return n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ;
+ }
+ public override void SetIndex( int index )
+ {
+ n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = index;
+ }
+ }
+
+
+
+
+ ///
+ /// 邁。譏薙さ繝ウ繝輔ぅ繧ー縺ョ縲悟繧頑崛縺医阪↓菴ソ逕ィ縺吶k縲√後Μ繧ケ繝医搾シ郁、謨ー縺ョ蝗コ螳壼、縺九i縺ョシ代▽繧帝∈謚槫庄閭スシ峨r陦ィ縺吶い繧、繝繝縲
+ /// e遞ョ蛻・縺碁&縺縺ョ縺ィ縲》Enter謚シ荳()縺ァ菴輔b縺励↑縺莉・螟悶ッ縲√後Μ繧ケ繝医阪◎縺ョ縺セ縺セ縲
+ ///
+ internal class CSwitchItemList : CItemList
+ {
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CSwitchItemList()
+ {
+ base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.蛻譖ソ繝ェ繧ケ繝;
+ this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0;
+ this.list鬆逶ョ蛟、 = new List();
+ }
+ public CSwitchItemList( string str鬆逶ョ蜷 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷 );
+ }
+ public CSwitchItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ );
+ }
+ public CSwitchItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, params string[] arg鬆逶ョ繝ェ繧ケ繝 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, arg鬆逶ョ繝ェ繧ケ繝 );
+ }
+ public CSwitchItemList(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, params string[] arg鬆逶ョ繝ェ繧ケ繝)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, arg鬆逶ョ繝ェ繧ケ繝);
+ }
+ public CSwitchItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en, params string[] arg鬆逶ョ繝ェ繧ケ繝 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚en, arg鬆逶ョ繝ェ繧ケ繝 );
+ }
+
+ public override void tEnter謚シ荳()
+ {
+ // this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); // 菴輔b縺励↑縺
+ }
+ }
+
+}
diff --git a/TJAPlayer3/Items/CItemThreeState.cs b/TJAPlayer3/Items/CItemThreeState.cs
new file mode 100644
index 00000000..bc6f5622
--- /dev/null
+++ b/TJAPlayer3/Items/CItemThreeState.cs
@@ -0,0 +1,154 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 縲後せ繝ェ繝シ繧ケ繝繝シ繝医搾シON, OFF, 荳榊ョ 縺ョ3迥カ諷具シ峨r陦ィ縺吶い繧、繝繝縲
+ ///
+ internal class CItemThreeState : CItemBase
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public E迥カ諷 e迴セ蝨ィ縺ョ迥カ諷;
+ public enum E迥カ諷
+ {
+ ON,
+ OFF,
+ 荳榊ョ
+ }
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CItemThreeState()
+ {
+ base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.ONorOFFor荳榊ョ壹せ繝ェ繝シ繧ケ繝繝シ繝;
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.荳榊ョ;
+ }
+ public CItemThreeState( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e蛻晄悄迥カ諷 );
+ }
+ public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+ public CItemThreeState( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・ );
+ }
+ public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+
+ // CItemBase 螳溯」
+
+ public override void tEnter謚シ荳()
+ {
+ this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍();
+ }
+ public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍()
+ {
+ switch( this.e迴セ蝨ィ縺ョ迥カ諷 )
+ {
+ case E迥カ諷.ON:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF;
+ return;
+
+ case E迥カ諷.OFF:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON;
+ return;
+
+ case E迥カ諷.荳榊ョ:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON;
+ return;
+ }
+ }
+ public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍()
+ {
+ switch( this.e迴セ蝨ィ縺ョ迥カ諷 )
+ {
+ case E迥カ諷.ON:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF;
+ return;
+
+ case E迥カ諷.OFF:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON;
+ return;
+
+ case E迥カ諷.荳榊ョ:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF;
+ return;
+ }
+ }
+ public void t蛻晄悄蛹( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷 )
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク );
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+ public void t蛻晄悄蛹( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ )
+ {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, "", "");
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ this.e迴セ蝨ィ縺ョ迥カ諷 = e蛻晄悄迥カ諷;
+ }
+ public override object obj迴セ蝨ィ蛟、()
+ {
+ if ( this.e迴セ蝨ィ縺ョ迥カ諷 == E迥カ諷.荳榊ョ )
+ {
+ return "- -";
+ }
+ else
+ {
+ return this.e迴セ蝨ィ縺ョ迥カ諷.ToString();
+ }
+ }
+ public override int GetIndex()
+ {
+ return (int)this.e迴セ蝨ィ縺ョ迥カ諷;
+ }
+ public override void SetIndex( int index )
+ {
+ switch (index )
+ {
+ case 0:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON;
+ break;
+ case 1:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF;
+ break;
+ case 2:
+ this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.荳榊ョ;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+ }
+}
diff --git a/TJAPlayer3/Items/CItemToggle.cs b/TJAPlayer3/Items/CItemToggle.cs
new file mode 100644
index 00000000..495dd1fe
--- /dev/null
+++ b/TJAPlayer3/Items/CItemToggle.cs
@@ -0,0 +1,111 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TJAPlayer3
+{
+ ///
+ /// 縲後ヨ繧ー繝ォ縲搾シON, OFF 縺ョ2迥カ諷具シ峨r陦ィ縺吶い繧、繝繝縲
+ ///
+ internal class CItemToggle : CItemBase
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public bool bON;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CItemToggle()
+ {
+ base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.ONorOFF繝医げ繝ォ;
+ this.bON = false;
+ }
+ public CItemToggle( string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷 )
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, b蛻晄悄迥カ諷 );
+ }
+ public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, str隱ャ譏取枚jp);
+ }
+ public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+ public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・)
+ : this()
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・ );
+ }
+ public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp);
+ }
+ public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en)
+ : this() {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+
+ // CItemBase 螳溯」
+
+ public override void tEnter謚シ荳()
+ {
+ this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍();
+ }
+ public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍()
+ {
+ this.bON = !this.bON;
+ }
+ public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍()
+ {
+ this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍();
+ }
+ public void t蛻晄悄蛹( string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷 )
+ {
+ this.t蛻晄悄蛹( str鬆逶ョ蜷, b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク );
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ }
+
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・)
+ {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, "", "");
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) {
+ this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp);
+ }
+ public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) {
+ base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en);
+ this.bON = b蛻晄悄迥カ諷;
+ }
+ public override object obj迴セ蝨ィ蛟、()
+ {
+ return ( this.bON ) ? "ON" : "OFF";
+ }
+ public override int GetIndex()
+ {
+ return ( this.bON ) ? 1 : 0;
+ }
+ public override void SetIndex( int index )
+ {
+ switch ( index )
+ {
+ case 0:
+ this.bON = false;
+ break;
+ case 1:
+ this.bON = true;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+ }
+}
diff --git a/TJAPlayer3/Plugins/CPluginHost.cs b/TJAPlayer3/Plugins/CPluginHost.cs
new file mode 100644
index 00000000..80710234
--- /dev/null
+++ b/TJAPlayer3/Plugins/CPluginHost.cs
@@ -0,0 +1,87 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Drawing;
+using SlimDX;
+using SlimDX.Direct3D9;
+using FDK;
+
+namespace TJAPlayer3
+{
+ internal class CPluginHost : IPluginHost
+ {
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CPluginHost()
+ {
+ this._DTXManiaVersion = new CDTXVersion( TJAPlayer3.VERSION );
+ }
+
+
+ // IPluginHost 螳溯」
+
+ public CDTXVersion DTXManiaVersion
+ {
+ get { return this._DTXManiaVersion; }
+ }
+ public Device D3D9Device
+ {
+ get { return (TJAPlayer3.app != null ) ? TJAPlayer3.app.Device.UnderlyingDevice : null; }
+ }
+ public Format TextureFormat
+ {
+ get { return TJAPlayer3.TextureFormat; }
+ }
+ public CTimer Timer
+ {
+ get { return TJAPlayer3.Timer; }
+ }
+ public CSound邂。逅 Sound邂。逅
+ {
+ get { return TJAPlayer3.Sound邂。逅; }
+ }
+ public Size ClientSize
+ {
+ get { return TJAPlayer3.app.Window.ClientSize; }
+ }
+ public CStage.E繧ケ繝繝シ繧ク e迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク
+ {
+ get { return ( TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null ) ? TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID : CStage.E繧ケ繝繝シ繧ク.菴輔b縺励↑縺; }
+ }
+ public CStage.E繝輔ぉ繝シ繧コ e迴セ蝨ィ縺ョ繝輔ぉ繝シ繧コ
+ {
+ get { return ( TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null ) ? TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繝輔ぉ繝シ繧コID : CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; }
+ }
+ public bool t蜈・蜉帙r蜊譛峨☆繧(IPluginActivity act)
+ {
+ if (TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ != null)
+ return false;
+
+ TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ = act;
+ return true;
+ }
+ public bool t蜈・蜉帙ョ蜊譛峨r隗」髯、縺吶k(IPluginActivity act)
+ {
+ if (TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null || TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ != act)
+ return false;
+
+ TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ = null;
+ return true;
+ }
+ public void t繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound )
+ {
+ if( TJAPlayer3.Skin != null )
+ TJAPlayer3.Skin[ sound ].t蜀咲函縺吶k();
+ }
+
+
+ // 縺昴ョ莉
+
+ #region [ private ]
+ //-----------------
+ private CDTXVersion _DTXManiaVersion;
+ //-----------------
+ #endregion
+ }
+}
diff --git a/TJAPlayer3/Plugins/IPluginActivity.cs b/TJAPlayer3/Plugins/IPluginActivity.cs
new file mode 100644
index 00000000..845b3208
--- /dev/null
+++ b/TJAPlayer3/Plugins/IPluginActivity.cs
@@ -0,0 +1,76 @@
+サソnamespace TJAPlayer3
+{
+ ///
+ /// Activity 繝励Λ繧ー繧、繝ウ縺ク縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ縲
+ /// DTXMania 縺ッ縲!PluginActivity 縺ォ蟇セ縺励※縲∽サ・荳九ョ繝ゥ繧、繝輔し繧、繧ッ繝ォ繧貞ョ溯。後@縺セ縺吶
+ /// (1) DTXMania 縺ョ襍キ蜍募ヲ逅縺ョ譛蠕鯉シ医そ繝繝医い繝繝礼判髱「縺瑚。ィ遉コ縺輔l繧狗峩蜑搾シ峨↓荳蠎ヲ縺縺代^n蛻晄悄蛹()_OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()_OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() 繧偵%縺ョ鬆逡ェ縺ァ1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶
+ /// (2) DTXMania 縺ョ邨ゆコ蜃ヲ逅縺ョ譛蛻晢シThank you for playing 縺梧カ医∴縺溽峩蠕鯉シ峨↓荳蠎ヲ縺縺代^nUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()_OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()_On邨ゆコ() 繧偵%縺ョ鬆逡ェ縺ァ1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶
+ /// (3) DTXMania 縺ョ襍キ蜍穂クュ縲√☆縺ェ繧上■(1)ス(2)縺ョ髢薙ッ縲√←繧薙↑繧キ繝シ繝ウ縺ァ縺ゅ▲縺ヲ繧ゅ∝クク縺ォ On騾イ陦梧緒逕サ() 繧1繝輔Ξ繝シ繝縺ォ縺、縺1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶
+ /// (4) Direct3D 繝繝舌う繧ケ縺ョ繝ェ繧サ繝繝域凾縺ォ縺ッ縲√ョ繝舌う繧ケ縺ョ繝ェ繧サ繝繝亥燕縺ォ OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() 繧1蝗槫他縺ウ蜃コ縺励√ョ繝舌う繧ケ繧偵Μ繧サ繝繝医@縺溘ョ縺。縲^nUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() 繧1蝗槫他縺ウ蜃コ縺励∪縺吶
+ /// (5) Direct3D 繝繝舌う繧ケ縺ョ繝ュ繧ケ繝域凾縺ォ縺ッ縲√ョ繝舌う繧ケ縺ョ蜀咲函謌仙燕縺ォ OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()_OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() 繧1蝗槭★縺、蜻シ縺ウ蜃コ縺励√ョ繝舌う繧ケ繧貞咲函謌舌@縺溘ョ縺。縲^nManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()_OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() 繧1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶
+ ///
+ public interface IPluginActivity
+ {
+ ///
+ /// 繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶
+ /// DTXMania 縺ョ襍キ蜍募ヲ逅縺ョ譛蠕鯉シ医そ繝繝医い繝繝礼判髱「縺瑚。ィ遉コ縺輔l繧狗峩蜑搾シ峨↓縲.TXMania 縺九i荳蠎ヲ縺縺大他縺ウ蜃コ縺輔l縺セ縺吶
+ /// 繝励Λ繧ー繧、繝ウ縺後√帙せ繝茨シDTXManiaシ峨ョ諠蝣ア縺ォ繧「繧ッ繧サ繧ケ縺吶k縺溘a縺ョ繧ェ繝悶ず繧ァ繧ッ繝医
+ ///
+ void On蛻晄悄蛹( global::TJAPlayer3.IPluginHost PluginHost );
+
+ ///
+ /// 繝励Λ繧ー繧、繝ウ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶
+ /// DTXMania 縺ョ邨ゆコ蜃ヲ逅縺ョ譛蛻晢シThank you for playing 縺梧カ医∴縺溽峩蠕鯉シ峨↓縲.TXMania 縺九i荳蠎ヲ縺縺大他縺ウ蜃コ縺輔l縺セ縺吶
+ ///
+ void On邨ゆコ();
+
+ ///
+ /// Managed 繝ェ繧ス繝シ繧ケ繧剃ス懈舌@縺セ縺吶
+ ///
+ void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+
+ ///
+ /// Unmanaged 繝ェ繧ス繝シ繧ケ繧剃ス懈舌@縺セ縺吶
+ ///
+ void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈();
+
+ ///
+ /// Unmanaged 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺励∪縺吶
+ ///
+ void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+
+ ///
+ /// Managed 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺励∪縺吶
+ ///
+ void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ();
+
+ ///
+ /// 繝励Λ繧ー繧、繝ウ縺ョ騾イ陦後→謠冗判繧定。後>縺セ縺吶
+ /// 窶サ迴セ蝨ィ縺ョ DTXMania 縺ァ縺ッ縲騾イ陦後→謠冗判縺ッ蛻髮「縺輔l縺ヲ縺縺セ縺帙s縲
+ /// 窶サBeginScene()/EndScene() 縺ッ DTXMania 蛛エ縺ァ陦後≧縺溘a縲√励Λ繧ー繧、繝ウ蛛エ縺ァ縺ッ荳崎ヲ√〒縺吶
+ /// 窶サkeyboard.t繝昴シ繝ェ繝ウ繧ー() 縺ッ DTXMania 蛛エ縺ァ陦後>縺セ縺吶ョ縺ァ繝励Λ繧ー繧、繝ウ蛛エ縺ァ縺ッ陦後o縺ェ縺縺ァ荳九&縺縲
+ /// 繝代ャ繝牙・蜉帙ゆサ悶ョ繝励Λ繧ー繧、繝ウ縺悟・蜉帛頃譛我クュ縺ァ縺ゅk蝣エ蜷医ッ null 縺梧ク。縺輔l縺セ縺吶
+ /// 繧ュ繝シ繝懊シ繝牙・蜉帙ゆサ悶ョ繝励Λ繧ー繧、繝ウ縺悟・蜉帛頃譛我クュ縺ァ縺ゅk蝣エ蜷医ッ null 縺梧ク。縺輔l縺セ縺吶
+ ///
+ void On騾イ陦梧緒逕サ( global::TJAPlayer3.CPad pad, FDK.IInputDevice keyboard );
+
+ ///
+ /// 繧ケ繝繝シ繧ク縺悟、峨o繧句コヲ縺ォ蜻シ縺ウ蜃コ縺輔l縺セ縺吶
+ /// 蜻シ縺ウ蜃コ縺励ち繧、繝溘Φ繧ー縺ッ縲∵眠縺励>繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹也峩蠕後°縺、謠冗判髢句ァ句燕縺ァ縺吶
+ ///
+ void On繧ケ繝繝シ繧ク螟画峩();
+
+ ///
+ /// 驕ク譖イ逕サ髱「縺ァ驕ク謚樊峇縺悟、画峩縺輔l縺溷エ蜷医↓蜻シ縺ウ蜃コ縺輔l縺セ縺吶
+ /// 蜷後§ set.def 縺ォ螻槭☆繧区峇縺ョ髮」譏灘コヲ縺鯉シHHテ2縺ァシ牙、画峩縺輔l縺溷エ蜷医〒繧ょ他縺ウ蜃コ縺輔l縺セ縺吶
+ /// 縺溘□縺励驕ク謚槭′譖イ縺ァ縺ェ縺シBOX, BACK, RANDOM 縺ェ縺ゥシ牙エ蜷医↓縺ッ蜻シ縺ウ蜃コ縺輔l縺セ縺帙s縲
+ ///
+ /// 驕ク謚槭&繧後※縺繧区峇縺ョ繝輔ぃ繧、繝ォ縺ョ蜷榊燕縲らオカ蟇セ繝代せ縲
+ /// 驕ク謚槭&繧後※縺繧区峇縺ョ繝悶Ο繝繧ッ蜀縺ョ譖イ逡ェ蜿キ(0ス4)縲
+ void On驕ク謚樊峇螟画峩( string str驕ク謚樊峇繝輔ぃ繧、繝ォ蜷, int n譖イ逡ェ蜿キin繝悶Ο繝繧ッ );
+
+ void On貍泌・上け繝ェ繧「( global::TJAPlayer3.CScoreIni scoreIni );
+ void On貍泌・丞、ア謨( global::TJAPlayer3.CScoreIni scoreIni );
+ void On貍泌・上く繝」繝ウ繧サ繝ォ( global::TJAPlayer3.CScoreIni scoreIni );
+ }
+}
diff --git a/TJAPlayer3/Plugins/IPluginHost.cs b/TJAPlayer3/Plugins/IPluginHost.cs
new file mode 100644
index 00000000..7e47436a
--- /dev/null
+++ b/TJAPlayer3/Plugins/IPluginHost.cs
@@ -0,0 +1,64 @@
+サソnamespace TJAPlayer3
+{
+ ///
+ /// 繝励Λ繧ー繧、繝ウ繝帙せ繝域ュ蝣ア謠蝉セ帙う繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ縲
+ /// 繝励Λ繧ー繧、繝ウ縺ァ縺ッ縲^n蛻晄悄蛹() 縺ァ貂。縺輔l繧九%縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r騾壹§縺ヲ縲
+ /// DTXMania 縺ョ謖√▽讒倥縺ェ繝ェ繧ス繝シ繧ケ縺ォ繧「繧ッ繧サ繧ケ縺ァ縺阪∪縺吶
+ ///
+ public interface IPluginHost
+ {
+ ///
+ /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ繧定。ィ縺励∪縺吶
+ ///
+ global::TJAPlayer3.CDTXVersion DTXManiaVersion { get; }
+
+ ///
+ /// Direct3D9 繝繝舌う繧ケ繧ェ繝悶ず繧ァ繧ッ繝医
+ /// 繝ュ繧ケ繝医@縺溘j繝ェ繧サ繝繝医@縺溘j縺吶k縺薙→縺後≠繧九ョ縺ァ縲∝クク縺ォ蜷後§蛟、縺ァ縺ゅk縺ィ縺ッ菫晁ィシ縺輔l縺セ縺帙s縲
+ ///
+ SlimDX.Direct3D9.Device D3D9Device { get; }
+
+ ///
+ /// DirectSound 縺ョ邂。逅繧ッ繝ゥ繧ケ縲
+ /// WAV, XA, OGG, MP3 縺ョ繧オ繧ヲ繝ウ繝峨ヵ繧。繧、繝ォ縺九i CSound 繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌〒縺阪∪縺吶
+ ///
+ FDK.CSound邂。逅 Sound邂。逅 { get; }
+
+ ///
+ /// 謠冗判繧ィ繝ェ繧「縺ョ繧オ繧、繧コ繧定ソ斐@縺セ縺呻シ医ヴ繧ッ繧サ繝ォ蜊倅ス搾シ峨
+ ///
+ System.Drawing.Size ClientSize { get; }
+
+ ///
+ /// 迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ョID繧定。ィ縺励∪縺吶
+ ///
+ global::TJAPlayer3.CStage.E繧ケ繝繝シ繧ク e迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク { get; }
+
+ ///
+ /// 迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ォ縺翫¢繧九ヵ繧ァ繝シ繧コ縺ョID繧定。ィ縺励∪縺吶
+ ///
+ global::TJAPlayer3.CStage.E繝輔ぉ繝シ繧コ e迴セ蝨ィ縺ョ繝輔ぉ繝シ繧コ { get; }
+
+ ///
+ /// 閾ェ蛻莉・螟悶ッ蜈・蜉帙ョ繝シ繧ソ繧呈桶縺」縺ヲ縺ッ縺ェ繧峨↑縺縺薙→繧貞ョ」險縺励∪縺吶
+ /// DTXMania 譛ャ菴薙ッ蜈・蜉帙ョ繝シ繧ソ縺ョ繝昴シ繝ェ繝ウ繧ー縺ョ縺ソ繧定。後>縲∽サ悶ョ繝励Λ繧ー繧、繝ウ縺ォ蟇セ縺励※縺ッ縲^n騾イ陦梧緒逕サ() 縺ョ2縺、縺ョ蜈・蜉帙↓ null 繧呈ク。縺励∪縺吶
+ ///
+ /// 螳」險縺吶k繝励Λ繧ー繧、繝ウシ医☆縺ェ繧上■ this 繧呈欠螳壹☆繧具シ
+ /// 蜊譛峨↓謌仙粥縺吶l縺ー true 繧定ソ斐@縲∵里縺ォ隱ー縺九′蜊譛我クュ縺ァ縺ゅk蝣エ蜷医↓縺ッ false 繧定ソ斐@縺セ縺吶
+ bool t蜈・蜉帙r蜊譛峨☆繧( IPluginActivity act );
+
+ ///
+ /// 閾ェ蛻莉・螟悶′蜈・蜉帙ョ繝シ繧ソ繧呈桶縺」縺ヲ濶ッ縺縺薙→繧貞ョ」險縺励∪縺吶
+ /// DTXMania 譛ャ菴薙ッ繝昴シ繝ェ繝ウ繧ー莉・螟悶ョ蜈・蜉帛ヲ逅繧帝幕蟋九@縲∽サ悶ョ繝励Λ繧ー繧、繝ウ縺ォ蟇セ縺励※縺ッ縲^n騾イ陦梧緒逕サ() 縺ョ2縺、縺ョ蠑墓焚縺ォ譛牙柑縺ェ蛟、繧呈ク。縺励∪縺吶
+ ///
+ /// 螳」險縺吶k繝励Λ繧ー繧、繝ウシ医☆縺ェ繧上■ this 繧呈欠螳壹☆繧具シ
+ /// 蜊譛芽ァ」髯、縺ォ謌仙粥縺吶l縺ー true縲∝、ア謨励☆繧後ー flase 繧定ソ斐@縺セ縺吶
+ bool t蜈・蜉帙ョ蜊譛峨r隗」髯、縺吶k( IPluginActivity act );
+
+ ///
+ /// 謖螳壹&繧後◆繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝会シ州GM繧貞咲函縺励∪縺吶
+ ///
+ /// 蜀咲函縺吶k繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ隴伜挨蟄舌
+ void t繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound );
+ }
+}
diff --git a/TJAPlayer3/Properties/AssemblyInfo.cs b/TJAPlayer3/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..26a12c0d
--- /dev/null
+++ b/TJAPlayer3/Properties/AssemblyInfo.cs
@@ -0,0 +1,42 @@
+サソusing System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶
+// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲
+// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲
+[assembly: AssemblyTitle("TJAPlayer3 - A .tja file player.")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("TJAPlayer3")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√◎縺ョ蝙九ッ縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ァ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医°繧
+// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲
+// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲
+[assembly: ComVisible(false)]
+
+// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺
+[assembly: Guid("ee05cb8c-73a8-41c3-8677-a0afbe7401f7")]
+
+// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝薙Ν繝峨♀繧医ウ繝ェ繝薙ず繝ァ繝ウ逡ェ蜿キ繧
+// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.1.0")]
+[assembly: AssemblyFileVersion("1.4.5.3")]
+[assembly: NeutralResourcesLanguage("ja-JP")]
+
+// 縺薙ョ繧「繧サ繝ウ繝悶Μ縺ッ縲後Λ繧、繝悶Λ繝ェ縲阪〒縺ゅkシ磯屮隱ュ蛹悶ヤ繝シ繝ォ縺ク縺ョ謖遉コシ峨
+// 竊 繝繝輔か繝ォ繝医ョ true 縺ョ縺セ縺セ縺縺ィ縲√い繧サ繝ウ繝悶Μ public 縺ェ繝。繝ウ繝舌b縺吶∋縺ヲ髮」隱ュ蛹悶&繧後※縺励∪縺縲
+[assembly: ObfuscateAssembly( false )]
diff --git a/TJAPlayer3/Properties/Discord.Designer.cs b/TJAPlayer3/Properties/Discord.Designer.cs
new file mode 100644
index 00000000..8591c74c
--- /dev/null
+++ b/TJAPlayer3/Properties/Discord.Designer.cs
@@ -0,0 +1,117 @@
+サソ//------------------------------------------------------------------------------
+//
+// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲
+// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:4.0.30319.42000
+//
+// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲
+// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶
+//
+//------------------------------------------------------------------------------
+
+namespace TJAPlayer3.Properties {
+ using System;
+
+
+ ///
+ /// 繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励↑縺ゥ繧呈、懃エ「縺吶k縺溘a縺ョ縲∝宍蟇縺ォ蝙区欠螳壹&繧後◆繝ェ繧ス繝シ繧ケ 繧ッ繝ゥ繧ケ縺ァ縺吶
+ ///
+ // 縺薙ョ繧ッ繝ゥ繧ケ縺ッ StronglyTypedResourceBuilder 繧ッ繝ゥ繧ケ縺 ResGen
+ // 縺セ縺溘ッ Visual Studio 縺ョ繧医≧縺ェ繝繝シ繝ォ繧剃スソ逕ィ縺励※閾ェ蜍慕函謌舌&繧後∪縺励◆縲
+ // 繝。繝ウ繝舌シ繧定ソス蜉縺セ縺溘ッ蜑企勁縺吶k縺ォ縺ッ縲.ResX 繝輔ぃ繧、繝ォ繧堤キィ髮縺励※縲/str 繧ェ繝励す繝ァ繝ウ縺ィ蜈ア縺ォ
+ // ResGen 繧貞ョ溯。後@逶エ縺吶°縲√∪縺溘ッ VS 繝励Ο繧ク繧ァ繧ッ繝医r繝薙Ν繝峨@逶エ縺励∪縺吶
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Discord {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Discord() {
+ }
+
+ ///
+ /// 縺薙ョ繧ッ繝ゥ繧ケ縺ァ菴ソ逕ィ縺輔l縺ヲ縺繧九く繝」繝繧キ繝・縺輔l縺 ResourceManager 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ソ斐@縺セ縺吶
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TJAPlayer3.Properties.Discord", typeof(Discord).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 縺吶∋縺ヲ縺ォ縺、縺縺ヲ縲∫樟蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺
+ /// 迴セ蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺吶
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Auto 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶
+ ///
+ internal static string Info_IsAuto {
+ get {
+ return ResourceManager.GetString("Info_IsAuto", resourceCulture);
+ }
+ }
+
+ ///
+ /// Playing 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶
+ ///
+ internal static string Stage_InGame {
+ get {
+ return ResourceManager.GetString("Stage_InGame", resourceCulture);
+ }
+ }
+
+ ///
+ /// Result 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶
+ ///
+ internal static string Stage_Result {
+ get {
+ return ResourceManager.GetString("Stage_Result", resourceCulture);
+ }
+ }
+
+ ///
+ /// Settings 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶
+ ///
+ internal static string Stage_Settings {
+ get {
+ return ResourceManager.GetString("Stage_Settings", resourceCulture);
+ }
+ }
+
+ ///
+ /// SongSelect 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶
+ ///
+ internal static string Stage_SongSelect {
+ get {
+ return ResourceManager.GetString("Stage_SongSelect", resourceCulture);
+ }
+ }
+
+ ///
+ /// Startup 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶
+ ///
+ internal static string Stage_StartUp {
+ get {
+ return ResourceManager.GetString("Stage_StartUp", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/TJAPlayer3/Properties/Discord.resx b/TJAPlayer3/Properties/Discord.resx
new file mode 100644
index 00000000..1219284d
--- /dev/null
+++ b/TJAPlayer3/Properties/Discord.resx
@@ -0,0 +1,138 @@
+サソ
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Auto
+
+
+ Playing
+
+
+ Result
+
+
+ Settings
+
+
+ SongSelect
+
+
+ Startup
+
+
\ No newline at end of file
diff --git a/TJAPlayer3/Properties/Resources.Designer.cs b/TJAPlayer3/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..be4b21fc
--- /dev/null
+++ b/TJAPlayer3/Properties/Resources.Designer.cs
@@ -0,0 +1,83 @@
+サソ//------------------------------------------------------------------------------
+//
+// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲
+// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:4.0.30319.42000
+//
+// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲
+// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶
+//
+//------------------------------------------------------------------------------
+
+namespace TJAPlayer3.Properties {
+ using System;
+
+
+ ///
+ /// 繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励↑縺ゥ繧呈、懃エ「縺吶k縺溘a縺ョ縲∝宍蟇縺ォ蝙区欠螳壹&繧後◆繝ェ繧ス繝シ繧ケ 繧ッ繝ゥ繧ケ縺ァ縺吶
+ ///
+ // 縺薙ョ繧ッ繝ゥ繧ケ縺ッ StronglyTypedResourceBuilder 繧ッ繝ゥ繧ケ縺 ResGen
+ // 縺セ縺溘ッ Visual Studio 縺ョ繧医≧縺ェ繝繝シ繝ォ繧剃スソ逕ィ縺励※閾ェ蜍慕函謌舌&繧後∪縺励◆縲
+ // 繝。繝ウ繝舌シ繧定ソス蜉縺セ縺溘ッ蜑企勁縺吶k縺ォ縺ッ縲.ResX 繝輔ぃ繧、繝ォ繧堤キィ髮縺励※縲/str 繧ェ繝励す繝ァ繝ウ縺ィ蜈ア縺ォ
+ // ResGen 繧貞ョ溯。後@逶エ縺吶°縲√∪縺溘ッ VS 繝励Ο繧ク繧ァ繧ッ繝医r繝薙Ν繝峨@逶エ縺励∪縺吶
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// 縺薙ョ繧ッ繝ゥ繧ケ縺ァ菴ソ逕ィ縺輔l縺ヲ縺繧九く繝」繝繧キ繝・縺輔l縺 ResourceManager 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ソ斐@縺セ縺吶
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TJAPlayer3.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 縺吶∋縺ヲ縺ォ縺、縺縺ヲ縲∫樟蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺
+ /// 迴セ蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺吶
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// (繧「繧、繧ウ繝ウ) 縺ォ鬘樔シシ縺励◆蝙 System.Drawing.Icon 縺ョ繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺溘Μ繧ス繝シ繧ケ繧呈、懃エ「縺励∪縺吶
+ ///
+ internal static System.Drawing.Icon dtx {
+ get {
+ object obj = ResourceManager.GetObject("dtx", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// (繧「繧、繧ウ繝ウ) 縺ォ鬘樔シシ縺励◆蝙 System.Drawing.Icon 縺ョ繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺溘Μ繧ス繝シ繧ケ繧呈、懃エ「縺励∪縺吶
+ ///
+ internal static System.Drawing.Icon tjap3 {
+ get {
+ object obj = ResourceManager.GetObject("tjap3", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+ }
+}
diff --git a/TJAPlayer3/Properties/Resources.resx b/TJAPlayer3/Properties/Resources.resx
new file mode 100644
index 00000000..ecc4e445
--- /dev/null
+++ b/TJAPlayer3/Properties/Resources.resx
@@ -0,0 +1,127 @@
+サソ
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\dtx.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\TJAPlayer3-Develop-ReWrite.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/TJAPlayer3/Properties/Settings.Designer.cs b/TJAPlayer3/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..6e6c2f25
--- /dev/null
+++ b/TJAPlayer3/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+サソ//------------------------------------------------------------------------------
+//
+// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲
+// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:4.0.30319.42000
+//
+// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲
+// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶
+//
+//------------------------------------------------------------------------------
+
+namespace TJAPlayer3.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/TJAPlayer3/Properties/Settings.settings b/TJAPlayer3/Properties/Settings.settings
new file mode 100644
index 00000000..39645652
--- /dev/null
+++ b/TJAPlayer3/Properties/Settings.settings
@@ -0,0 +1,7 @@
+サソ
+
+
+
+
+
+
diff --git a/TJAPlayer3/Resources/TJAPlayer3-Develop-ReWrite.ico b/TJAPlayer3/Resources/TJAPlayer3-Develop-ReWrite.ico
new file mode 100644
index 00000000..0f583138
Binary files /dev/null and b/TJAPlayer3/Resources/TJAPlayer3-Develop-ReWrite.ico differ
diff --git a/TJAPlayer3/Songs/CBoxDef.cs b/TJAPlayer3/Songs/CBoxDef.cs
new file mode 100644
index 00000000..d693a985
--- /dev/null
+++ b/TJAPlayer3/Songs/CBoxDef.cs
@@ -0,0 +1,113 @@
+サソusing System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Text;
+using System.IO;
+using System.Drawing;
+
+namespace TJAPlayer3
+{
+ internal class CBoxDef
+ {
+ // 繝励Ο繝代ユ繧」
+
+ public Color Color;
+ public string Genre;
+ public string Title;
+ public string[] strBoxText = new string[3];
+ public Color ForeColor;
+ public Color BackColor;
+ public bool IsChangedForeColor;
+ public bool IsChangedBackColor;
+
+
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CBoxDef()
+ {
+ for (int i = 0; i < 3; i++)
+ this.strBoxText[i] = "";
+ this.Title = "";
+ this.Genre = "";
+ ForeColor = Color.White;
+ BackColor = Color.Black;
+
+ }
+ public CBoxDef( string boxdef繝輔ぃ繧、繝ォ蜷 )
+ : this()
+ {
+ this.t隱ュ縺ソ霎シ縺ソ( boxdef繝輔ぃ繧、繝ォ蜷 );
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void t隱ュ縺ソ霎シ縺ソ( string boxdef繝輔ぃ繧、繝ォ蜷 )
+ {
+ StreamReader reader = new StreamReader( boxdef繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) );
+ string str = null;
+ while( ( str = reader.ReadLine() ) != null )
+ {
+ if( str.Length != 0 )
+ {
+ try
+ {
+ char[] ignoreCharsWoColon = new char[] { ' ', '\t' };
+
+ str = str.TrimStart( ignoreCharsWoColon );
+ if( ( str[ 0 ] == '#' ) && ( str[ 0 ] != ';' ) )
+ {
+ if( str.IndexOf( ';' ) != -1 )
+ {
+ str = str.Substring( 0, str.IndexOf( ';' ) );
+ }
+
+ char[] ignoreChars = new char[] { ':', ' ', '\t' };
+
+ if ( str.StartsWith( "#TITLE", StringComparison.OrdinalIgnoreCase ) )
+ {
+ this.Title = str.Substring( 6 ).Trim( ignoreChars );
+ }
+ else if( str.StartsWith( "#GENRE", StringComparison.OrdinalIgnoreCase ) )
+ {
+ this.Genre = str.Substring( 6 ).Trim( ignoreChars );
+ }
+ else if ( str.StartsWith( "#FONTCOLOR", StringComparison.OrdinalIgnoreCase ) )
+ {
+ this.Color = ColorTranslator.FromHtml( str.Substring( 10 ).Trim( ignoreChars ) );
+ }
+ else if (str.StartsWith("#FORECOLOR", StringComparison.OrdinalIgnoreCase))
+ {
+ this.ForeColor = ColorTranslator.FromHtml(str.Substring(10).Trim(ignoreChars));
+ IsChangedForeColor = true;
+ }
+ else if (str.StartsWith("#BACKCOLOR", StringComparison.OrdinalIgnoreCase))
+ {
+ this.BackColor = ColorTranslator.FromHtml(str.Substring(10).Trim(ignoreChars));
+ IsChangedBackColor = true;
+ }
+ else
+ {
+ for(int i = 0; i < 3; i++)
+ {
+ if (str.StartsWith("#BOXEXPLANATION" + (i + 1).ToString(), StringComparison.OrdinalIgnoreCase))
+ {
+ this.strBoxText[i] = str.Substring(16).Trim(ignoreChars);
+ }
+ }
+ }
+ }
+ continue;
+ }
+ catch (Exception e)
+ {
+ Trace.TraceError( e.ToString() );
+ Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (178a9a36-a59e-4264-8e4c-b3c3459db43c)" );
+ continue;
+ }
+ }
+ }
+ reader.Close();
+ }
+ }
+}
diff --git a/TJAPlayer3/Songs/CCourse.cs b/TJAPlayer3/Songs/CCourse.cs
new file mode 100644
index 00000000..bb72afa1
--- /dev/null
+++ b/TJAPlayer3/Songs/CCourse.cs
@@ -0,0 +1,48 @@
+サソusing System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+namespace TJAPlayer3
+{
+ public class CCourse
+ {
+ //2016.11.07 kairera0467
+ //縺ィ繧翫≠縺医★繝。繝「莉」繧上j縺ォ
+ //
+ //
+ //笳九さ繝シ繧ケ繝繝シ繧ソシ.tjcシ
+
+ //隍謨ー縺ョ譖イ繧貞ア騾壹ョ繧イ繝シ繧ク縺ァ騾」邯壹@縺ヲ貍泌・上@縺セ縺吶
+ //騾壼クク繧イ繝シ繧ク縺ッ譟先ョオ菴崎ェ榊ョ壹▲縺ス縺蠅玲ク帙ョ莉墓婿繧偵@縺セ縺呻シ郁」懈ュ」縺ェ縺暦シ峨
+
+ //縺セ縺滓峇縺ッ閾ェ蜍慕噪縺ォ蜀咲函縺輔l繧九◆繧√√ー縺縺昴¥遲峨ョ繧ェ繝励す繝ァ繝ウ縺ョ菴ソ逕ィ縺ッ蜃コ譚・縺セ縺帙s縲
+
+ //.tjc縺ョ繝輔ぃ繧、繝ォ縺ッ莉悶ョ隴憺擇シ.tja遲会シ峨→蜷梧ァ倥↓謇ア繧上l繧九ョ縺ァ隴憺擇繝繝シ繧ソ縺ィ蜷後§繝輔か繝ォ繝縺ォ蜈・繧後※繧よァ九>縺セ縺帙s縲
+ //
+ // 笳上倥ャ繝
+
+ // TITLE: 繧ウ繝シ繧ケ縺ョ蜷榊燕縲
+
+ // COURSE: 縲窪asy縲阪君ormal縲阪粂ard縲阪薫ni縲阪窪dit縲阪b縺励¥縺ッ0-4縺ョ蛟、縲
+ // 隴憺擇縺ョ髮」譏灘コヲ縲ゑシ医さ繝シ繧ケ縺ィ蜻シ縺カ縺ィ繧繧縺薙@縺縺ァ縺吶′縺碑ォ呈価縺上□縺輔>シ
+ // 謖螳壹@縺溯ュ憺擇縺ッ蜈ィ縺ヲ縺薙%縺ァ謖螳壹☆繧矩屮譏灘コヲ縺ョ隴憺擇縺梧オ√l縺セ縺吶
+ // 譖イ縺斐→縺ョ謖螳壹ッシ井サ翫ョ縺ィ縺薙mシ峨〒縺阪∪縺帙s縲
+
+ // LIFE: 繝ゥ繧、繝輔ら怐逡・蜿ッ縲
+ // 縺薙%縺ォ蛟、繧貞・繧後k縺ィ騾壼クク繧イ繝シ繧ク縺ョ莉」繧上j縺ォ繝ゥ繧、繝募宛縺ォ縺ェ繧翫∪縺吶
+
+ // SONG: 譖イ繝繝シ繧ソ縲
+ // 貍泌・上☆繧区峇縺ョ繝輔ぃ繧、繝ォ蜷搾シ.tja/.tjfシ峨rtaikojiro.exe縺ョ縺ゅk繝繧」繝ャ繧ッ繝医Μ縺九i縺ョ逶ク蟇セ繝代せ縺ァ謖螳壹
+ // 謖螳壹&繧後◆繝繝シ繧ソ縺ッ荳翫↓縺ゅk繧ゅョ縺九i鬆縺ォ貍泌・上&繧後∪縺吶
+
+
+ public void t蜈・蜉( string str繝輔ぃ繧、繝ォ蜷 )
+ {
+ StreamReader reader = new StreamReader( str繝輔ぃ繧、繝ォ蜷 );
+ string str = reader.ReadToEnd();
+ reader.Close();
+ }
+ }
+}
diff --git a/TJAPlayer3/Songs/CDTX.cs b/TJAPlayer3/Songs/CDTX.cs
new file mode 100644
index 00000000..2d63b090
--- /dev/null
+++ b/TJAPlayer3/Songs/CDTX.cs
@@ -0,0 +1,8495 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Drawing;
+using System.Diagnostics;
+using System.IO;
+using System.Globalization;
+using System.Threading;
+using System.Text.RegularExpressions;
+using FDK;
+using FDK.ExtensionMethods;
+using TJAPlayer3;
+
+namespace TJAPlayer3
+{
+ internal class CDTX : CActivity
+ {
+ // 螳壽焚
+
+ public enum E遞ョ蛻・ { DTX, GDA, G2D, BMS, BME, SMF }
+
+ // 繧ッ繝ゥ繧ケ
+
+ public class CAVI : IDisposable
+ {
+ public CAvi avi;
+ private bool bDispose貂医∩;
+ public int n逡ェ蜿キ;
+ public string str繧ウ繝。繝ウ繝域枚 = "";
+ public string str繝輔ぃ繧、繝ォ蜷 = "";
+
+ public void OnDeviceCreated()
+ {
+ #region [ strAVI繝輔ぃ繧、繝ォ蜷阪ョ菴懈舌]
+ //-----------------
+ string strAVI繝輔ぃ繧、繝ォ蜷;
+ if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV))
+ strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷;
+ else
+ strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷;
+ //-----------------
+ #endregion
+
+ if (!File.Exists(strAVI繝輔ぃ繧、繝ォ蜷))
+ {
+ Trace.TraceWarning("繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷);
+ this.avi = null;
+ return;
+ }
+
+ // AVI 縺ョ逕滓舌
+
+ try
+ {
+ this.avi = new CAvi(strAVI繝輔ぃ繧、繝ォ蜷);
+ Trace.TraceInformation("蜍慕判繧堤函謌舌@縺セ縺励◆縲({0})({1})({2}frames)", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷, this.avi.GetMaxFrameCount());
+ }
+ catch (Exception e)
+ {
+ Trace.TraceError(e.ToString());
+ Trace.TraceError("蜍慕判縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷);
+ this.avi = null;
+ }
+ }
+ public override string ToString()
+ {
+ return string.Format("CAVI{0}: File:{1}, Comment:{2}", CDTX.tZZ(this.n逡ェ蜿キ), this.str繝輔ぃ繧、繝ォ蜷, this.str繧ウ繝。繝ウ繝域枚);
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if (this.bDispose貂医∩)
+ return;
+
+ if (this.avi != null)
+ {
+ #region [ strAVI繝輔ぃ繧、繝ォ蜷 縺ョ菴懈舌 ]
+ //-----------------
+ string strAVI繝輔ぃ繧、繝ォ蜷;
+ if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV))
+ strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷;
+ else
+ strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷;
+ //-----------------
+ #endregion
+
+ this.avi.Dispose();
+ this.avi = null;
+
+ Trace.TraceInformation("蜍慕判繧定ァ」謾セ縺励∪縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷);
+ }
+
+ this.bDispose貂医∩ = true;
+ }
+ //-----------------
+ #endregion
+ }
+ public class CAVIPAN
+ {
+ public int nAVI逡ェ蜿キ;
+ public int n遘サ蜍墓凾髢田t;
+ public int n逡ェ蜿キ;
+ public Point pt蜍慕判蛛エ髢句ァ倶ス咲スョ = new Point(0, 0);
+ public Point pt蜍慕判蛛エ邨ゆコ菴咲スョ = new Point(0, 0);
+ public Point pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ = new Point(0, 0);
+ public Point pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ = new Point(0, 0);
+ public Size sz髢句ァ九し繧、繧コ = new Size(0, 0);
+ public Size sz邨ゆコ繧オ繧、繧コ = new Size(0, 0);
+
+ public override string ToString()
+ {
+ return string.Format("CAVIPAN{0}: AVI:{14}, 髢句ァ九し繧、繧コ:{1}x{2}, 邨ゆコ繧オ繧、繧コ:{3}x{4}, 蜍慕判蛛エ髢句ァ倶ス咲スョ:{5}x{6}, 蜍慕判蛛エ邨ゆコ菴咲スョ:{7}x{8}, 陦ィ遉コ蛛エ髢句ァ倶ス咲スョ:{9}x{10}, 陦ィ遉コ蛛エ邨ゆコ菴咲スョ:{11}x{12}, 遘サ蜍墓凾髢:{13}ct",
+ CDTX.tZZ(this.n逡ェ蜿キ),
+ this.sz髢句ァ九し繧、繧コ.Width, this.sz髢句ァ九し繧、繧コ.Height,
+ this.sz邨ゆコ繧オ繧、繧コ.Width, this.sz邨ゆコ繧オ繧、繧コ.Height,
+ this.pt蜍慕判蛛エ髢句ァ倶ス咲スョ.X, this.pt蜍慕判蛛エ髢句ァ倶ス咲スョ.Y,
+ this.pt蜍慕判蛛エ邨ゆコ菴咲スョ.X, this.pt蜍慕判蛛エ邨ゆコ菴咲スョ.Y,
+ this.pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ.X, this.pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ.Y,
+ this.pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ.X, this.pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ.Y,
+ this.n遘サ蜍墓凾髢田t,
+ CDTX.tZZ(this.nAVI逡ェ蜿キ));
+ }
+ }
+ public class CDirectShow : IDisposable
+ {
+ public FDK.CDirectShow dshow;
+ private bool bDispose貂医∩;
+ public int n逡ェ蜿キ;
+ public string str繧ウ繝。繝ウ繝域枚 = "";
+ public string str繝輔ぃ繧、繝ォ蜷 = "";
+
+ public void OnDeviceCreated()
+ {
+ #region [ str蜍慕判繝輔ぃ繧、繝ォ蜷阪ョ菴懈舌]
+ //-----------------
+ string str蜍慕判繝輔ぃ繧、繝ォ蜷;
+ if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV))
+ str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷;
+ else
+ str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷;
+ //-----------------
+ #endregion
+
+ if (!File.Exists(str蜍慕判繝輔ぃ繧、繝ォ蜷))
+ {
+ Trace.TraceWarning("繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷);
+ this.dshow = null;
+ }
+
+ // AVI 縺ョ逕滓舌
+
+ try
+ {
+ this.dshow = new FDK.CDirectShow(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + this.str繝輔ぃ繧、繝ォ蜷, TJAPlayer3.app.WindowHandle, true);
+ Trace.TraceInformation("DirectShow繧堤函謌舌@縺セ縺励◆縲({0})({1})({2}byte)", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷, this.dshow.n繝繝シ繧ソ繧オ繧、繧コbyte);
+ }
+ catch (Exception e)
+ {
+ Trace.TraceError(e.ToString());
+ Trace.TraceError("DirectShow縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷);
+ this.dshow = null;
+ }
+ }
+ public override string ToString()
+ {
+ return string.Format("CAVI{0}: File:{1}, Comment:{2}", CDTX.tZZ(this.n逡ェ蜿キ), this.str繝輔ぃ繧、繝ォ蜷, this.str繧ウ繝。繝ウ繝域枚);
+ }
+
+ #region [ IDisposable 螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ if (this.bDispose貂医∩)
+ return;
+
+ if (this.dshow != null)
+ {
+ #region [ strAVI繝輔ぃ繧、繝ォ蜷 縺ョ菴懈舌 ]
+ //-----------------
+ string str蜍慕判繝輔ぃ繧、繝ォ蜷;
+ if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV))
+ str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷;
+ else
+ str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷;
+ //-----------------
+ #endregion
+
+ this.dshow.Dispose();
+ this.dshow = null;
+
+ Trace.TraceInformation("蜍慕判繧定ァ」謾セ縺励∪縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷);
+ }
+
+ this.bDispose貂医∩ = true;
+ }
+ //-----------------
+ #endregion
+ }
+
+ public class CBPM
+ {
+ public double dbBPM蛟、;
+ public double bpm_change_time;
+ public double bpm_change_bmscroll_time;
+ public ECourse bpm_change_course = ECourse.eNormal;
+ public int n蜀驛ィ逡ェ蜿キ;
+ public int n陦ィ險倅ク翫ョ逡ェ蜿キ;
+
+ public override string ToString()
+ {
+ StringBuilder builder = new StringBuilder(0x80);
+ if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ)
+ {
+ builder.Append(string.Format("CBPM{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ));
+ }
+ else
+ {
+ builder.Append(string.Format("CBPM{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ)));
+ }
+ builder.Append(string.Format(", BPM:{0}", this.dbBPM蛟、));
+ return builder.ToString();
+ }
+ }
+ public class CSCROLL
+ {
+ public double dbSCROLL蛟、;
+ public double dbSCROLL蛟、Y;
+ public int n蜀驛ィ逡ェ蜿キ;
+ public int n陦ィ險倅ク翫ョ逡ェ蜿キ;
+
+ public override string ToString()
+ {
+ StringBuilder builder = new StringBuilder(0x80);
+ if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ)
+ {
+ builder.Append(string.Format("CSCROLL{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ));
+ }
+ else
+ {
+ builder.Append(string.Format("CSCROLL{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ)));
+ }
+ builder.Append(string.Format(", SCROLL:{0}", this.dbSCROLL蛟、));
+ return builder.ToString();
+ }
+ }
+ ///
+ /// 蛻、螳壹Λ繧、繝ウ遘サ蜍募多莉、
+ ///
+ public class CJPOSSCROLL
+ {
+ public double db遘サ蜍墓凾髢;
+ public int n遘サ蜍戊キ晞屬px;
+ public int n遘サ蜍墓婿蜷; //遘サ蜍墓婿蜷代ッ0(蟾ヲ)縲1(蜿ウ)縺ョ2縺、縺縺代
+ public int n蜀驛ィ逡ェ蜿キ;
+ public int n陦ィ險倅ク翫ョ逡ェ蜿キ;
+
+ public override string ToString()
+ {
+ StringBuilder builder = new StringBuilder(0x80);
+ if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ)
+ {
+ builder.Append(string.Format("CJPOSSCROLL{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ));
+ }
+ else
+ {
+ builder.Append(string.Format("CJPOSSCROLL{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ)));
+ }
+ builder.Append(string.Format(", JPOSSCROLL:{0}", this.db遘サ蜍墓凾髢));
+ return builder.ToString();
+ }
+ }
+
+ public class CDELAY
+ {
+ public int nDELAY蛟、; //譬シ邏肴凾縺ォ縺ッms縺ォ縺ェ縺」縺ヲ縺繧九◆繧√‥ouble縺ォ縺ッ縺励↑縺縲
+ public int n蜀驛ィ逡ェ蜿キ;
+ public int n陦ィ險倅ク翫ョ逡ェ蜿キ;
+ public double delay_time;
+ public double delay_bmscroll_time;
+ public double delay_bpm;
+ public ECourse delay_course = ECourse.eNormal;
+
+ public override string ToString()
+ {
+ StringBuilder builder = new StringBuilder(0x80);
+ if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ)
+ {
+ builder.Append(string.Format("CDELAY{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ));
+ }
+ else
+ {
+ builder.Append(string.Format("CDELAY{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ)));
+ }
+ builder.Append(string.Format(", DELAY:{0}", this.nDELAY蛟、));
+ return builder.ToString();
+ }
+ }
+ public enum E蛻蟯千ィョ鬘
+ {
+ e邊セ蠎ヲ蛻蟯,
+ e騾」謇灘蟯,
+ e繧ケ繧ウ繧「蛻蟯,
+ e螟ァ髻ウ隨ヲ縺ョ縺ソ邊セ蠎ヲ蛻蟯
+ }
+ public class CBRANCH
+ {
+ public E蛻蟯千ィョ鬘 e蛻蟯舌ョ遞ョ鬘; //0:邊セ蠎ヲ蛻蟯 1:騾」謇灘蟯 2:繧ケ繧ウ繧「蛻蟯 3:螟ァ髻ウ隨ヲ縺ョ縺ソ縺ョ邊セ蠎ヲ蛻蟯
+ public double n譚。莉カ謨ー蛟、A;
+ public double n譚。莉カ謨ー蛟、B;
+ public double db蛻蟯先凾髢;
+ public double db蛻蟯先凾髢杜s;
+ public double db蛻、螳壽凾髢;
+ public double dbBMScrollTime;
+ public double dbBPM;
+ public double dbSCROLL;
+ public int n迴セ蝨ィ縺ョ蟆冗ッ;
+ public int n蜻ス莉、譎ゅョChipList逡ェ蜿キ;
+
+ public int n陦ィ險倅ク翫ョ逡ェ蜿キ;
+ public int n蜀驛ィ逡ェ蜿キ;
+
+ public override string ToString()
+ {
+ StringBuilder builder = new StringBuilder(0x80);
+ if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ)
+ {
+ builder.Append(string.Format("CBRANCH{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ));
+ }
+ else
+ {
+ builder.Append(string.Format("CBRANCH{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ)));
+ }
+ builder.Append(string.Format(", BRANCH:{0}", this.e蛻蟯舌ョ遞ョ鬘));
+ return builder.ToString();
+ }
+ }
+
+
+ public class CChip : IComparable, ICloneable
+ {
+ public bool bHit;
+ public bool b蜿ッ隕 = true;
+ public bool bShow;
+ public bool bShowRoll;
+ public bool bBranch = false;
+ public double db繝√ャ繝励し繧、繧コ蛟咲紫 = 1.0;
+ public double db螳滓焚蛟、;
+ public double dbBPM;
+ public float fNow_Measure_s = 4.0f;//蠑キ蛻カ蛻蟯舌ョ縺溘a縺ォ霑ス蜉.2020.04.21.akasoko26
+ public float fNow_Measure_m = 4.0f;//蠑キ蛻カ蛻蟯舌ョ縺溘a縺ォ霑ス蜉.2020.04.21.akasoko26
+ public bool IsEndedBranching = false;//蛻蟯舌′邨ゅo縺」縺滓凾縺ョ騾」謇楢ュ憺擇縺碁撼蜿ッ隕門喧縺ォ縺ェ縺」縺ヲ縺励∪縺縺溘a繝輔Λ繧ー繧定ソス蜉.2020.04.21.akasoko26
+ public double dbSCROLL;
+ public double dbSCROLL_Y;
+ public ECourse n繧ウ繝シ繧ケ;
+ public int nSenote;
+ public int nState;
+ public int nRollCount;
+ public int nBalloon;
+ public int nProcessTime;
+ public int n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷;
+ public int n謠冗判蜆ェ蜈亥コヲ; //(迚ケ谿)迴セ迥カ騾」謇薙→縺ョ蛻、譁ュ逶ョ逧縺ァ菴ソ逕ィ
+ public ENoteState eNoteState;
+ public EAVI遞ョ蛻・ eAVI遞ョ蛻・;
+ public E讌ス蝎ィ繝代シ繝 e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.UNKNOWN;
+ public int n繝√Ε繝ウ繝阪Ν逡ェ蜿キ;
+ public STDGBVALUE n繝舌シ縺九i縺ョ霍晞屬dot;
+ public int n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot;
+ public int n謨エ謨ー蛟、;
+ public int n譁蟄玲焚 = 16;
+
+ public int n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ;
+ public int n邱冗ァサ蜍墓凾髢;
+ public int n騾乗主コヲ = 0xff;
+ public int n逋コ螢ー菴咲スョ;
+ public double n譚。莉カ謨ー蛟、A;
+ public double n譚。莉カ謨ー蛟、B;
+ public double db蛻蟯先凾髢薙ョ繧コ繝ャ;
+ public E蛻蟯千ィョ鬘 e蛻蟯舌ョ遞ョ鬘;
+
+ public double db逋コ螢ー菴咲スョ; // 逋コ螢ー譎ょ綾繧呈シ邏阪@縺ヲ縺縺溷、画焚縺ョ縺縺。縺ョシ代▽繧断loat蝙九°繧嬰ouble蝙九↓螟画峩縲(kairera0467)
+ public double fBMSCROLLTime;
+ public double fBMSCROLLTime_end;
+ public int n逋コ螢ー譎ょ綾ms;
+ public double n蛻蟯先凾蛻サms;
+
+
+ public double db逋コ螢ー譎ょ綾ms;
+ public int n繝弱シ繝邨ゆコ菴咲スョ;
+ public int n繝弱シ繝邨ゆコ譎ょ綾ms;
+ public int n繝弱シ繝蜃コ迴セ譎ょ綾ms;
+ public int n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms;
+ public int n蛻蟯仙屓謨ー;
+ public int n騾」謇馴浹隨ヲState;
+ public int nLag; // 2011.2.1 yyagi
+ public CDTX.CAVI rAVI;
+ public CDTX.CAVIPAN rAVIPan;
+ public CDTX.CDirectShow rDShow;
+ public double db逋コ螢ー譎ょ綾;
+ public double db蛻、螳夂オゆコ譎ょ綾;//騾」謇鍋ウサ髻ウ隨ヲ縺ァ菴ソ逕ィ
+ public double dbProcess_Time;
+ public int nPlayerSide;
+ public bool bGOGOTIME = false; //2018.03.11 k1airera0467 繧エ繝シ繧エ繝シ繧ソ繧、繝蜀縺ョ繝√ャ繝励〒縺ゅk縺
+ public int nList荳翫ョ菴咲スョ;
+ public bool IsFixedSENote;
+ public bool IsHitted = false;
+ public bool IsMissed = false;
+
+ public bool bBPM繝√ャ繝励〒縺ゅk
+ {
+ get
+ {
+ if (this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 3 || this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 8)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ public bool b閾ェ蜍募咲函髻ウ繝√Ε繝ウ繝阪Ν縺ァ縺ゅk
+ {
+ get
+ {
+ int num = this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ;
+ if ((((num != 1) && ((0x61 > num) || (num > 0x69))) && ((0x70 > num) || (num > 0x79))) && ((0x80 > num) || (num > 0x89)))
+ {
+ return ((0x90 <= num) && (num <= 0x92));
+ }
+ return true;
+ }
+ }
+
+
+
+ public bool b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk; // #32248 2013.10.14 yyagi
+ public CCounter RollDelay; // 18.9.22 AioiLight Add 騾」謇捺凾縺ォ襍、縺上↑繧九d縺、縺ョ繧ソ繧、繝槭シ
+ public CCounter RollInputTime; // 18.9.22 AioiLight Add 騾」謇灘・蜉帛セ後ヽollDelay縺御ス懷虚縺吶k縺セ縺ァ縺ョ繧ソ繧、繝槭シ
+ public int RollEffectLevel; // 18.9.22 AioiLight Add 騾」謇捺凾縺ォ襍、縺上↑繧九d縺、縺ョ蠎ヲ蜷医>
+
+ public CChip()
+ {
+ this.n繝舌シ縺九i縺ョ霍晞屬dot = new STDGBVALUE()
+ {
+ Drums = 0,
+ Guitar = 0,
+ Bass = 0,
+ Taiko = 0
+ };
+ }
+ public void t蛻晄悄蛹()
+ {
+ this.bBranch = false;
+ this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0;
+ this.n謨エ謨ー蛟、 = 0; //謨エ謨ー蛟、繧鱈ist荳翫ョ逡ェ蜿キ縺ィ縺励※逕ィ縺繧九
+ this.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0;
+ this.db螳滓焚蛟、 = 0.0;
+ this.n逋コ螢ー菴咲スョ = 0;
+ this.db逋コ螢ー菴咲スョ = 0.0D;
+ this.n逋コ螢ー譎ょ綾ms = 0;
+ this.db逋コ螢ー譎ょ綾ms = 0.0D;
+ this.fBMSCROLLTime = 0;
+ this.n繝弱シ繝邨ゆコ菴咲スョ = 0;
+ this.n繝弱シ繝邨ゆコ譎ょ綾ms = 0;
+ this.n謠冗判蜆ェ蜈亥コヲ = 0;
+ this.nLag = -999;
+ this.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = false;
+ this.nList荳翫ョ菴咲スョ = 0;
+ this.db繝√ャ繝励し繧、繧コ蛟咲紫 = 1.0;
+ this.bHit = false;
+ this.IsMissed = false;
+ this.b蜿ッ隕 = true;
+ this.e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.UNKNOWN;
+ this.n騾乗主コヲ = 0xff;
+ this.n繝舌シ縺九i縺ョ霍晞屬dot.Drums = 0;
+ this.n繝舌シ縺九i縺ョ霍晞屬dot.Guitar = 0;
+ this.n繝舌シ縺九i縺ョ霍晞屬dot.Bass = 0;
+ this.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko = 0;
+ this.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot = 0;
+ this.n邱冗ァサ蜍墓凾髢 = 0;
+ this.dbBPM = 120.0;
+ this.fNow_Measure_m = 4.0f;
+ this.fNow_Measure_s = 4.0f;
+ this.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = 0;
+ this.dbSCROLL = 1.0;
+ this.dbSCROLL_Y = 0.0f;
+ }
+ public override string ToString()
+ {
+
+ //2016.10.07 kairera0467 霑第律荳ュ縺ォ蜀咲キィ謌蝉コ亥ョ
+ string[] chToStr =
+ {
+ //繧キ繧ケ繝繝
+ "??", "繝舌ャ繧ッ繧ウ繝シ繝ゥ繧ケ", "蟆冗ッ髟キ螟画峩", "BPM螟画峩", "??", "??", "??", "??",
+ "BPM螟画峩(諡。蠑オ)", "??", "??", "??", "??", "??", "??", "??",
+
+ //螟ェ鮠1P(遘サ蜍穂コ亥ョ)
+ "??", "繝峨Φ", "繧ォ繝", "繝峨Φ(螟ァ)", "繧ォ繝(螟ァ)", "騾」謇", "騾」謇(螟ァ)", "縺オ縺縺帙s騾」謇",
+ "騾」謇鍋オらせ", "闃", "繝峨Φ(謇)", "繧ォ繝(謇)", "??", "??", "??", "AD-LIB",
+
+ //螟ェ鮠謎コ亥y
+ "??", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ //螟ェ鮠謎コ亥y
+ "??", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ //螟ェ鮠謎コ亥y
+ "??", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ //繧キ繧ケ繝繝
+ "蟆冗ッ邱", "諡咲キ", "??", "??", "AVI", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ //繧キ繧ケ繝繝(遘サ蜍穂コ亥ョ)
+ "SCROLL", "DELAY", "繧エ繝シ繧エ繝シ繧ソ繧、繝髢句ァ", "繧エ繝シ繧エ繝シ繧ソ繧、繝邨ゆコ", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ "??", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ "??", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ //螟ェ鮠1P縲√す繧ケ繝繝(迴セ陦)
+ "??", "??", "??", "螟ェ鮠点襍、", "螟ェ鮠点髱", "螟ェ鮠点襍、(螟ァ)", "螟ェ鮠点髱(螟ァ)", "螟ェ鮠点鮟",
+ "螟ェ鮠点鮟(螟ァ)", "螟ェ鮠点鬚ィ闊ケ", "螟ェ鮠点騾」謇捺忰遶ッ", "螟ェ鮠点闃", "??", "SCROLL", "繧エ繝シ繧エ繝シ繧ソ繧、繝髢句ァ", "繧エ繝シ繧エ繝シ繧ソ繧、繝邨ゆコ",
+
+ "??", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "螟ェ鮠 AD-LIB",
+
+ "??", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??",
+
+ "??", "??", "??", "??", "0xC4", "0xC5", "0xC6", "??",
+ "??", "??", "0xCA", "??", "??", "??", "??", "0xCF",
+
+ //繧キ繧ケ繝繝(迴セ陦)
+ "0xD0", "??", "??", "??", "??", "??", "??", "??",
+ "??", "??", "繝溘く繧オ繝シ霑ス蜉", "繝溘く繧オ繝シ蜑企勁", "DELAY", "隴憺擇蛻蟯舌Μ繧サ繝繝", "隴憺擇蛻蟯舌い繝九Γ", "隴憺擇蛻蟯仙驛ィ蜃ヲ逅",
+
+ //繧キ繧ケ繝繝(迴セ陦)
+ "蟆冗ッ邱唹N/OFF", "蛻蟯仙崋螳", "蛻、螳壽棧遘サ蜍", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+
+ "0xF0", "豁瑚ゥ", "??", "SUDDEN", "??", "??", "??", "??",
+ "??", "??", "??", "??", "??", "??", "??", "??", "隴憺擇邨ゆコ"
+ };
+ return string.Format("CChip: 菴咲スョ:{0:D4}.{1:D3}, 譎ょ綾{2:D6}, Ch:{3:X2}({4}), Pn:{5}({11})(蜀驛ィ{6}), Pd:{7}, Sz:{8}, BMScroll:{9}, Auto:{10}, 繧ウ繝シ繧ケ:{11}",
+ this.n逋コ螢ー菴咲スョ / 384, this.n逋コ螢ー菴咲スョ % 384,
+ this.n逋コ螢ー譎ょ綾ms,
+ this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, chToStr[this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ],
+ this.n謨エ謨ー蛟、, this.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ,
+ this.db螳滓焚蛟、,
+ this.db繝√ャ繝励し繧、繧コ蛟咲紫,
+ this.fBMSCROLLTime,
+ this.b閾ェ蜍募咲函髻ウ繝√Ε繝ウ繝阪Ν縺ァ縺ゅk,
+ this.n繧ウ繝シ繧ケ,
+ CDTX.tZZ(this.n謨エ謨ー蛟、));
+ }
+ ///
+ /// 繝√ャ繝励ョ蜀咲函髟キ繧貞叙蠕励☆繧九ら樟迥カ縲仝AV繝√ャ繝励→BGA繝√ャ繝励〒縺ョ縺ソ菴ソ逕ィ蜿ッ閭ス縲
+ ///
+ /// 蜀咲函髟キ(ms)
+ public int GetDuration()
+ {
+ int nDuration = 0;
+
+ if (this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) // WAV
+ {
+ CDTX.CWAV wc;
+ TJAPlayer3.DTX.listWAV.TryGetValue(this.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out wc);
+ if (wc == null)
+ {
+ nDuration = 0;
+ }
+ else
+ {
+ nDuration = (wc.rSound[0] == null) ? 0 : wc.rSound[0].n邱乗シ泌・乗凾髢杜s;
+ }
+ }
+ else if (this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x54) // AVI
+ {
+ if (this.rAVI != null && this.rAVI.avi != null)
+ {
+ int dwRate = (int)this.rAVI.avi.dw繝ャ繝シ繝;
+ int dwScale = (int)this.rAVI.avi.dw繧ケ繧ア繝シ繝ォ;
+ nDuration = (int)(1000.0f * dwScale / dwRate * this.rAVI.avi.GetMaxFrameCount());
+ }
+ }
+
+ double _db蜀咲函騾溷コヲ = (TJAPlayer3.DTXVmode.Enabled) ? TJAPlayer3.DTX.dbDTXVPlaySpeed : TJAPlayer3.DTX.db蜀咲函騾溷コヲ;
+ return (int)(nDuration / _db蜀咲函騾溷コヲ);
+ }
+
+ #region [ IComparable 螳溯」 ]
+ //-----------------
+
+ private static readonly byte[] n蜆ェ蜈亥コヲ = new byte[] {
+ 5, 5, 3, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 5, //0x00
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x10
+ 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, //0x20
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x30
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x40
+ 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x50
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x60
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x70
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x80
+ 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, //0x90
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xA0
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xB0
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xC0
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 4, 4, //0xD0
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xE0
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xF0
+ };
+
+ public int CompareTo(CDTX.CChip other)
+ {
+ // 縺セ縺壹ッ菴咲スョ縺ァ豈碑シ縲
+
+ //BGM繝√ャ繝励□縺醍匱螢ー菴咲スョ
+ //if( this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 || this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x02 )
+ //{
+ // if( this.n逋コ螢ー菴咲スョ < other.n逋コ螢ー菴咲スョ )
+ // return -1;
+
+ // if( this.n逋コ螢ー菴咲スョ > other.n逋コ螢ー菴咲スョ )
+ // return 1;
+ //}
+
+ //if( this.n逋コ螢ー菴咲スョ < other.n逋コ螢ー菴咲スョ )
+ // return -1;
+
+ //if( this.n逋コ螢ー菴咲スョ > other.n逋コ螢ー菴咲スョ )
+ // return 1;
+
+ //隴憺擇隗」譫舌Γ繧ス繝繝鰻4縺ァ縺ッ逋コ螢ー譎ょ綾ms縺ァ豈碑シ縺吶k縲
+ var n逋コ螢ー譎ょ綾msCompareToResult = 0;
+ n逋コ螢ー譎ょ綾msCompareToResult = this.n逋コ螢ー譎ょ綾ms.CompareTo(other.n逋コ螢ー譎ょ綾ms);
+ if (n逋コ螢ー譎ょ綾msCompareToResult != 0)
+ {
+ return n逋コ螢ー譎ょ綾msCompareToResult;
+ }
+
+ n逋コ螢ー譎ょ綾msCompareToResult = this.db逋コ螢ー譎ょ綾ms.CompareTo(other.db逋コ螢ー譎ょ綾ms);
+ if (n逋コ螢ー譎ょ綾msCompareToResult != 0)
+ {
+ return n逋コ螢ー譎ょ綾msCompareToResult;
+ }
+
+ // 菴咲スョ縺悟酔縺倥↑繧牙━蜈亥コヲ縺ァ豈碑シ縲
+ return n蜆ェ蜈亥コヲ[this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ].CompareTo(n蜆ェ蜈亥コヲ[other.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ]);
+ }
+ //-----------------
+ #endregion
+ ///
+ /// shallow copy縺ァ縺吶
+ ///
+ ///
+ public object Clone()
+ {
+ return MemberwiseClone();
+ }
+ }
+ public class CWAV : IDisposable
+ {
+ public bool bBGM縺ィ縺励※菴ソ縺;
+ public List list縺薙ョWAV繧剃スソ逕ィ縺吶k繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ョ髮蜷 = new List(16);
+ public int n繝√ャ繝励し繧、繧コ = 100;
+ public int n菴咲スョ;
+ public long[] n荳譎ょ●豁「譎ょ綾 = new long[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4
+ public int SongVol = CSound.DefaultSongVol;
+ public LoudnessMetadata? SongLoudnessMetadata = null;
+ public int n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ;
+ public long[] n蜀咲函髢句ァ区凾蛻サ = new long[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4
+ public int n蜀驛ィ逡ェ蜿キ;
+ public int n陦ィ險倅ク翫ョ逡ェ蜿キ;
+ public CSound[] rSound = new CSound[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4
+ public string str繧ウ繝。繝ウ繝域枚 = "";
+ public string str繝輔ぃ繧、繝ォ蜷 = "";
+ public bool bBGM縺ィ縺励※菴ソ繧上↑縺
+ {
+ get
+ {
+ return !this.bBGM縺ィ縺励※菴ソ縺;
+ }
+ set
+ {
+ this.bBGM縺ィ縺励※菴ソ縺 = !value;
+ }
+ }
+ public bool bIsBassSound = false;
+ public bool bIsGuitarSound = false;
+ public bool bIsDrumsSound = false;
+ public bool bIsSESound = false;
+ public bool bIsBGMSound = false;
+
+ public override string ToString()
+ {
+ var sb = new StringBuilder(128);
+
+ if (this.n陦ィ險倅ク翫ョ逡ェ蜿キ == this.n蜀驛ィ逡ェ蜿キ)
+ {
+ sb.Append(string.Format("CWAV{0}: ", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ)));
+ }
+ else
+ {
+ sb.Append(string.Format("CWAV{0}(蜀驛ィ{1}): ", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ));
+ }
+ sb.Append(
+ $"{nameof(SongVol)}:{this.SongVol}, {nameof(LoudnessMetadata.Integrated)}:{this.SongLoudnessMetadata?.Integrated}, {nameof(LoudnessMetadata.TruePeak)}:{this.SongLoudnessMetadata?.TruePeak}, 菴咲スョ:{this.n菴咲スョ}, 繧オ繧、繧コ:{this.n繝√ャ繝励し繧、繧コ}, BGM:{(this.bBGM縺ィ縺励※菴ソ縺 ? 'Y' : 'N')}, File:{this.str繝輔ぃ繧、繝ォ蜷閤, Comment:{this.str繧ウ繝。繝ウ繝域枚}");
+
+ return sb.ToString();
+ }
+
+ #region [ Dispose-Finalize 繝代ち繝シ繝ウ螳溯」 ]
+ //-----------------
+ public void Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ public void Dispose(bool bManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧り。後≧)
+ {
+ if (this.bDisposed貂医∩)
+ return;
+
+ if (bManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧り。後≧)
+ {
+ for (int i = 0; i < TJAPlayer3.ConfigIni.nPoliphonicSounds; i++) // 4
+ {
+ if (this.rSound[i] != null)
+ TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k(this.rSound[i]);
+ this.rSound[i] = null;
+
+ if ((i == 0) && TJAPlayer3.ConfigIni.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉)
+ Trace.TraceInformation("繧オ繧ヲ繝ウ繝峨r隗」謾セ縺励∪縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, this.str繝輔ぃ繧、繝ォ蜷);
+ }
+ }
+
+ this.bDisposed貂医∩ = true;
+ }
+ ~CWAV()
+ {
+ this.Dispose(false);
+ }
+ //-----------------
+ #endregion
+
+ #region [ private ]
+ //-----------------
+ private bool bDisposed貂医∩;
+ //-----------------
+ #endregion
+ }
+
+ public class DanSongs
+ {
+ public CTexture TitleTex;
+ public CTexture SubTitleTex;
+ public string Title;
+ public string SubTitle;
+ public string FileName;
+ public string Genre;
+ public int ScoreInit;
+ public int ScoreDiff;
+ public int Level;
+ public int Difficulty;
+ public static int Number = 0;
+ public bool bTitleShow;
+ public Dan_C[] Dan_C = new Dan_C[4];
+ public CWAV Wave;
+
+ public DanSongs()
+ {
+ Number++;
+ }
+ }
+
+ public struct STLYRIC
+ {
+ public long Time;
+ public Bitmap TextTex;
+ public string Text;
+ public int index;
+ }
+
+
+ // 讒矩菴
+
+ public struct STLANEINT
+ {
+ public int HH;
+ public int SD;
+ public int BD;
+ public int HT;
+ public int LT;
+ public int CY;
+ public int FT;
+ public int HHO;
+ public int RD;
+ public int LC;
+ public int LP;
+ public int LBD;
+
+ public int Drums
+ {
+ get
+ {
+ return this.HH + this.SD + this.BD + this.HT + this.LT + this.CY + this.FT + this.HHO + this.RD + this.LC + this.LP + this.LBD;
+ }
+ }
+ public int Guitar;
+ public int Bass;
+ public int Taiko_Red;
+ public int Taiko_Blue;
+
+ public int this[int index]
+ {
+ get
+ {
+ switch (index)
+ {
+ case 0:
+ return this.HH;
+
+ case 1:
+ return this.SD;
+
+ case 2:
+ return this.BD;
+
+ case 3:
+ return this.HT;
+
+ case 4:
+ return this.LT;
+
+ case 5:
+ return this.CY;
+
+ case 6:
+ return this.FT;
+
+ case 7:
+ return this.HHO;
+
+ case 8:
+ return this.RD;
+
+ case 9:
+ return this.LC;
+
+ case 10:
+ return this.LP;
+
+ case 11:
+ return this.LBD;
+
+ case 12:
+ return this.Guitar;
+
+ case 13:
+ return this.Bass;
+
+ case 14:
+ return this.Taiko_Red;
+
+ case 15:
+ return this.Taiko_Blue;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ if (value < 0)
+ {
+ throw new ArgumentOutOfRangeException();
+ }
+ switch (index)
+ {
+ case 0:
+ this.HH = value;
+ return;
+
+ case 1:
+ this.SD = value;
+ return;
+
+ case 2:
+ this.BD = value;
+ return;
+
+ case 3:
+ this.HT = value;
+ return;
+
+ case 4:
+ this.LT = value;
+ return;
+
+ case 5:
+ this.CY = value;
+ return;
+
+ case 6:
+ this.FT = value;
+ return;
+
+ case 7:
+ this.HHO = value;
+ return;
+
+ case 8:
+ this.RD = value;
+ return;
+
+ case 9:
+ this.LC = value;
+ return;
+
+ case 10:
+ this.LP = value;
+ return;
+
+ case 11:
+ this.LBD = value;
+ return;
+
+ case 12:
+ this.Guitar = value;
+ return;
+
+ case 13:
+ this.Bass = value;
+ return;
+
+ case 14:
+ this.Taiko_Red = value;
+ return;
+
+ case 15:
+ this.Taiko_Blue = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+ public struct STRESULT
+ {
+ public string SS;
+ public string S;
+ public string A;
+ public string B;
+ public string C;
+ public string D;
+ public string E;
+
+ public string this[int index]
+ {
+ get
+ {
+ switch (index)
+ {
+ case 0:
+ return this.SS;
+
+ case 1:
+ return this.S;
+
+ case 2:
+ return this.A;
+
+ case 3:
+ return this.B;
+
+ case 4:
+ return this.C;
+
+ case 5:
+ return this.D;
+
+ case 6:
+ return this.E;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch (index)
+ {
+ case 0:
+ this.SS = value;
+ return;
+
+ case 1:
+ this.S = value;
+ return;
+
+ case 2:
+ this.A = value;
+ return;
+
+ case 3:
+ this.B = value;
+ return;
+
+ case 4:
+ this.C = value;
+ return;
+
+ case 5:
+ this.D = value;
+ return;
+
+ case 6:
+ this.E = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+ public struct ST繝√ャ繝励′縺ゅk
+ {
+ public bool Drums;
+ public bool Guitar;
+ public bool Bass;
+
+ public bool HHOpen;
+ public bool Ride;
+ public bool LeftCymbal;
+ public bool OpenGuitar;
+ public bool OpenBass;
+
+ public bool Branch;
+
+ public bool this[int index]
+ {
+ get
+ {
+ switch (index)
+ {
+ case 0:
+ return this.Drums;
+
+ case 1:
+ return this.Guitar;
+
+ case 2:
+ return this.Bass;
+
+ case 3:
+ return this.HHOpen;
+
+ case 4:
+ return this.Ride;
+
+ case 5:
+ return this.LeftCymbal;
+
+ case 6:
+ return this.OpenGuitar;
+
+ case 7:
+ return this.OpenBass;
+
+ case 8:
+ return this.Branch;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ set
+ {
+ switch (index)
+ {
+ case 0:
+ this.Drums = value;
+ return;
+
+ case 1:
+ this.Guitar = value;
+ return;
+
+ case 2:
+ this.Bass = value;
+ return;
+
+ case 3:
+ this.HHOpen = value;
+ return;
+
+ case 4:
+ this.Ride = value;
+ return;
+
+ case 5:
+ this.LeftCymbal = value;
+ return;
+
+ case 6:
+ this.OpenGuitar = value;
+ return;
+
+ case 7:
+ this.OpenBass = value;
+ return;
+
+ case 8:
+ this.Branch = value;
+ return;
+ }
+ throw new IndexOutOfRangeException();
+ }
+ }
+ }
+ public enum ECourse
+ {
+ eNormal,
+ eExpert,
+ eMaster
+ }
+ public class CLine
+ {
+ public int n蟆冗ッ逡ェ蜿キ;
+ public int n譁蟄玲焚;
+ public double db逋コ螢ー譎ょ綾;
+ public double dbBMS譎ょ綾;
+ public ECourse n繧ウ繝シ繧ケ = ECourse.eNormal;
+ public int n繧ソ繧、繝;
+ }
+
+ // 繝励Ο繝代ユ繧」
+
+
+ public class CBranchStartInfo
+ {
+ public int nMeasureCount;
+ public double dbTime;
+ public double dbBPM;
+ public double dbSCROLL;
+ public double dbSCROLLY;
+ public double dbBMScollTime;
+ public double db遘サ蜍募セ讖滓凾蛻サ;
+ public double db蜃コ迴セ譎ょ綾;
+ public double db蜀咲函騾溷コヲ;
+ public float fMeasure_s;
+ public float fMeasure_m;
+ }
+
+ ///
+ /// 蛻蟯宣幕蟋区凾縺ョ諠蝣ア繧定ィ倬鹸縺吶k縺溘a縺ョ縺ゅl 2020.04.21
+ ///
+ public CBranchStartInfo cBranchStart = new CBranchStartInfo();
+
+ public int nBGMAdjust
+ {
+ get;
+ private set;
+ }
+ public bool b蛻蟯舌r荳蝗槭〒繧る幕蟋九@縺 = false; //2020.04.22 akasoko26 蛻蟯占ュ憺擇縺ョ縺ソ蛟、繧剃サ」蜈・縺吶k繧医≧縺ォ縲
+
+ public int nPlayerSide; //2017.08.14 kairera0467 蠑墓焚縺ァ謖螳壹☆繧
+ public bool bSession隴憺擇繧定ェュ縺ソ霎シ繧;
+ public string ARTIST;
+ public string BACKGROUND;
+ public string BACKGROUND_GR;
+ public double BASEBPM;
+ public double BPM;
+ public ST繝√ャ繝励′縺ゅk b繝√ャ繝励′縺ゅk;
+ public string COMMENT;
+ public double db蜀咲函騾溷コヲ;
+ public string GENRE;
+ public E繧ク繝」繝ウ繝ォ e繧ク繝」繝ウ繝ォ;
+ public bool HIDDENLEVEL;
+ public STDGBVALUE LEVEL;
+ public bool bLyrics;
+ public int[] LEVELtaiko = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1 };
+ public Dictionary listAVI;
+ public Dictionary listAVIPAN;
+ public Dictionary listDS;
+ public Dictionary listBPM;
+ public List listChip;
+ public List[] listChip_Branch;
+ public Dictionary listWAV;
+ public Dictionary listSCROLL;
+ public Dictionary listSCROLL_Normal;
+ public Dictionary listSCROLL_Expert;
+ public Dictionary listSCROLL_Master;
+ public Dictionary listJPOSSCROLL;
+ public List List_DanSongs;
+
+
+ private double[] dbNowSCROLL_Normal;
+ private double[] dbNowSCROLL_Expert;
+ private double[] dbNowSCROLL_Master;
+
+
+ public Dictionary listDELAY;
+ public Dictionary listBRANCH;
+ public STLANEINT n蜿ッ隕悶メ繝繝玲焚;
+ public const int n譛螟ァ髻ウ謨ー = 4;
+ public const int n蟆冗ッ縺ョ隗」蜒丞コヲ = 384;
+ public string PANEL;
+ public string PATH_WAV;
+ public string PREIMAGE;
+ public string PREVIEW;
+ public string str繝上ャ繧キ繝・ofDTX繝輔ぃ繧、繝ォ;
+ public string str繝輔ぃ繧、繝ォ蜷;
+ public string str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ;
+ public string str繝輔か繝ォ繝蜷;
+ public string SUBTITLE;
+ public string TITLE;
+ public double dbDTXVPlaySpeed;
+ public double dbScrollSpeed;
+ public int n繝繝「BGM繧ェ繝輔そ繝繝;
+
+ private int n迴セ蝨ィ縺ョ蟆冗ッ謨ー = 1;
+
+ private int nNowRoll = 0;
+ private int nNowRollCount = 0;
+
+ private int[] n騾」謇薙メ繝繝誉temp = new int[3];
+ public int nOFFSET = 0;
+ private bool bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = false;
+ private int nMOVIEOFFSET = 0;
+ private bool bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = false;
+ private double dbNowBPM = 120.0;
+ private int nDELAY = 0;
+ public bool[] bHasBranch = new bool[(int)Difficulty.Total] { false, false, false, false, false, false, false };
+
+ //蛻蟯宣未騾」
+ private ECourse n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eNormal;
+
+ private bool b譛蛻昴ョ蛻蟯舌〒縺ゅk;
+ public int[] n繝弱シ繝謨ー = new int[4]; //3:蜈ア騾
+ public int[] nDan_NotesCount = new int[1];
+ public int[] n繝弱シ繝謨ー_Branch = new int[4]; //
+ public CChip[] pDan_LastChip;
+ public int[] n鬚ィ闊ケ謨ー = new int[4]; //0ス2:蜷繧ウ繝シ繧ケ 3:蜈ア騾
+
+ private List listLine;
+ private int nLineCountTemp; //蛻蟯宣幕蟋区凾縺ョ蟆冗ッ謨ー繧定ィ倬鹸縲
+ private ECourse nLineCountCourseTemp = ECourse.eNormal; //迴セ蝨ィ繧ォ繧ヲ繝ウ繝井クュ縺ョ繧ウ繝シ繧ケ繧定ィ倬鹸縲
+
+ public int n蜿らァ荳ュ縺ョ髮」譏灘コヲ = 3;
+ public int nScoreModeTmp = 99; //2017.01.28 DD
+ public int[,] nScoreInit = new int[2, (int)Difficulty.Total]; //[ x, y ] x=騾壼ククor逵滓遠 y=繧ウ繝シ繧ケ
+ public int[] nScoreDiff = new int[(int)Difficulty.Total]; //[y]
+ public bool[,] b驟咲せ縺梧欠螳壹&繧後※縺繧 = new bool[3, (int)Difficulty.Total]; //2017.06.04 kairera0467 [ x, y ] x=騾壼クク(Init)or逵滓遠orDiff y=繧ウ繝シ繧ケ
+
+ private double dbBarLength;
+ public float fNow_Measure_s = 4.0f;
+ public float fNow_Measure_m = 4.0f;
+ public double dbNowTime = 0.0;
+ public double dbNowBMScollTime = 0.0;
+ public double dbNowScroll = 1.0;
+ public double dbNowScrollY = 0.0; //2016.08.13 kairera0467 隍邏謨ー繧ケ繧ッ繝ュ繝シ繝ォ
+ public double dbLastTime = 0.0; //逶エ蜑阪ョ蟆冗ッ縺ョ髢句ァ区凾髢
+ public double dbLastBMScrollTime = 0.0;
+
+ public int[] bBARLINECUE = new int[2]; //蜻ス莉、繧貞・繧後◆谺。縺ョ蟆冗ッ縺ョ謫堺ス懊r螳溽樟縺吶k縺溘a縺ョ繝輔Λ繧ー縲0 = mainflag, 1 = cuetype
+ public bool b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 = false;
+
+ //Normal Regular Master縺ォ縺励◆縺縺代←縺薙%縺ッ謌第「縲
+ private List listBalloon_Normal;
+ private List listBalloon_Expert;
+ private List listBalloon_Master;
+ private List listBalloon; //譌ァ讒区枚逕ィ
+
+ public List listLyric; //豁瑚ゥ槭r譬シ邏阪@縺ヲ縺縺上Μ繧ケ繝医ゅせ繝壹Ν蠢倥l縺(縺峨>
+ public List listLyric2;
+
+ private int listBalloon_Normal_謨ー蛟、邂。逅;
+ private int listBalloon_Expert_謨ー蛟、邂。逅;
+ private int listBalloon_Master_謨ー蛟、邂。逅;
+
+ public bool[] b隴憺擇縺悟ュ伜惠縺吶k = new bool[(int)Difficulty.Total];
+
+ private string[] dlmtSpace = { " " };
+ private string[] dlmtEnter = { "\n" };
+ private string[] dlmtCOURSE = { "COURSE:" };
+
+ private int n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = 0;
+ //2015.09.18 kairera0467
+ //繝舌ち繝輔Λ繧、繧ケ繝ゥ繧、繝峨∩縺溘>縺ェ繧「繝ャ繧偵d繧翫◆縺縺後◆繧√↓螳溯」縲
+ //谺。驛2縺ソ縺溘>縺ェ隍邏謨ー縺ィ縺九ッ諢丞袖荳肴弱↑縺ョ縺ァ縲∵婿蜷代r謖螳壹@縺ヲ繧ケ繧ッ繝ュ繝シ繝ォ縺輔○繧九%縺ィ縺ォ縺励◆縲
+ //0:騾壼クク
+ //1:荳
+ //2:荳
+ //3:蜿ウ荳
+ //4:蜿ウ荳
+ //5:蟾ヲ
+ //6:蟾ヲ荳
+ //7:蟾ヲ荳
+
+ public string strBGIMAGE_PATH;
+ public string strBGVIDEO_PATH;
+
+ public double db蜃コ迴セ譎ょ綾;
+ public double db遘サ蜍募セ讖滓凾蛻サ;
+
+ public string strBGM_PATH;
+ public int SongVol;
+ public LoudnessMetadata? SongLoudnessMetadata;
+
+ public bool bHIDDENBRANCH; //2016.04.01 kairera0467 驕ク譖イ逕サ髱「荳翫∬ュ憺擇蛻蟯宣幕蟋句燕縺セ縺ァ隴憺擇蛻蟯舌ョ陦ィ遉コ繧帝國縺
+ public bool bGOGOTIME; //2018.03.11 kairera0467
+
+ public bool[] IsBranchBarDraw = new bool[4]; // 莉墓ァ伜、画峩縺ォ繧医j縲鮟濶イline縺ョ陦ィ遉コ豕輔r螟画峩.2020.04.21.akasoko26
+ public bool IsEndedBranching; // BRANCHEND縺悟他縺ウ蜃コ縺輔l縺溘°縺ゥ縺縺
+ public Dan_C[] Dan_C;
+
+ public bool IsEnabledFixSENote;
+ public int FixSENote;
+ public GaugeIncreaseMode GaugeIncreaseMode;
+
+
+
+#if TEST_NOTEOFFMODE
+ public STLANEVALUE b貍泌・上〒逶エ蜑阪ョ髻ウ繧呈カ磯浹縺吶k;
+// public bool bHH貍泌・上〒逶エ蜑阪ョHH繧呈カ磯浹縺吶k;
+// public bool bGUITAR貍泌・上〒逶エ蜑阪ョGUITAR繧呈カ磯浹縺吶k;
+// public bool bBASS貍泌・上〒逶エ蜑阪ョBASS繧呈カ磯浹縺吶k;
+#endif
+ // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
+
+ public CDTX()
+ {
+ this.nPlayerSide = 0;
+ this.TITLE = "";
+ this.SUBTITLE = "";
+ this.ARTIST = "";
+ this.COMMENT = "";
+ this.PANEL = "";
+ this.GENRE = "";
+ this.bLyrics = false;
+ this.e繧ク繝」繝ウ繝ォ = E繧ク繝」繝ウ繝ォ.None;
+ this.PREVIEW = "";
+ this.PREIMAGE = "";
+ this.BACKGROUND = "";
+ this.BACKGROUND_GR = "";
+ this.PATH_WAV = "";
+ this.BPM = 120.0;
+ STDGBVALUE stdgbvalue = new STDGBVALUE();
+ stdgbvalue.Drums = 0;
+ stdgbvalue.Guitar = 0;
+ stdgbvalue.Bass = 0;
+ this.LEVEL = stdgbvalue;
+ this.bHIDDENBRANCH = false;
+ this.db蜀咲函騾溷コヲ = 1.0;
+ this.b繝√ャ繝励′縺ゅk = new ST繝√ャ繝励′縺ゅk();
+ this.b繝√ャ繝励′縺ゅk.Drums = false;
+ this.b繝√ャ繝励′縺ゅk.Guitar = false;
+ this.b繝√ャ繝励′縺ゅk.Bass = false;
+ this.b繝√ャ繝励′縺ゅk.HHOpen = false;
+ this.b繝√ャ繝励′縺ゅk.Ride = false;
+ this.b繝√ャ繝励′縺ゅk.LeftCymbal = false;
+ this.b繝√ャ繝励′縺ゅk.OpenGuitar = false;
+ this.b繝√ャ繝励′縺ゅk.OpenBass = false;
+ this.str繝輔ぃ繧、繝ォ蜷 = "";
+ this.str繝輔か繝ォ繝蜷 = "";
+ this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ = "";
+ this.n辟。髯千ョ。逅WAV = new int[36 * 36];
+ this.n辟。髯千ョ。逅BPM = new int[36 * 36];
+ this.n辟。髯千ョ。逅PAN = new int[36 * 36];
+ this.n辟。髯千ョ。逅SIZE = new int[36 * 36];
+ this.listBalloon_Normal_謨ー蛟、邂。逅 = 0;
+ this.listBalloon_Expert_謨ー蛟、邂。逅 = 0;
+ this.listBalloon_Master_謨ー蛟、邂。逅 = 0;
+ this.nRESULTIMAGE逕ィ蜆ェ蜈磯菴 = new int[7];
+ this.nRESULTMOVIE逕ィ蜆ェ蜈磯菴 = new int[7];
+ this.nRESULTSOUND逕ィ蜆ェ蜈磯菴 = new int[7];
+
+ #region [ 2011.1.1 yyagi GDA->DTX螟画鋤繝繝シ繝悶Ν 繝ェ繝輔ぃ繧ッ繧ソ蠕 ]
+ STGDAPARAM[] stgdaparamArray = new STGDAPARAM[] { // GDA->DTX conversion table
+ new STGDAPARAM("TC", 0x03), new STGDAPARAM("BL", 0x02), new STGDAPARAM("GS", 0x29),
+ new STGDAPARAM("DS", 0x30), new STGDAPARAM("FI", 0x53), new STGDAPARAM("HH", 0x11),
+ new STGDAPARAM("SD", 0x12), new STGDAPARAM("BD", 0x13), new STGDAPARAM("HT", 0x14),
+ new STGDAPARAM("LT", 0x15), new STGDAPARAM("CY", 0x16), new STGDAPARAM("G1", 0x21),
+ new STGDAPARAM("G2", 0x22), new STGDAPARAM("G3", 0x23), new STGDAPARAM("G4", 0x24),
+ new STGDAPARAM("G5", 0x25), new STGDAPARAM("G6", 0x26), new STGDAPARAM("G7", 0x27),
+ new STGDAPARAM("GW", 0x28), new STGDAPARAM("01", 0x61), new STGDAPARAM("02", 0x62),
+ new STGDAPARAM("03", 0x63), new STGDAPARAM("04", 0x64), new STGDAPARAM("05", 0x65),
+ new STGDAPARAM("06", 0x66), new STGDAPARAM("07", 0x67), new STGDAPARAM("08", 0x68),
+ new STGDAPARAM("09", 0x69), new STGDAPARAM("0A", 0x70), new STGDAPARAM("0B", 0x71),
+ new STGDAPARAM("0C", 0x72), new STGDAPARAM("0D", 0x73), new STGDAPARAM("0E", 0x74),
+ new STGDAPARAM("0F", 0x75), new STGDAPARAM("10", 0x76), new STGDAPARAM("11", 0x77),
+ new STGDAPARAM("12", 0x78), new STGDAPARAM("13", 0x79), new STGDAPARAM("14", 0x80),
+ new STGDAPARAM("15", 0x81), new STGDAPARAM("16", 0x82), new STGDAPARAM("17", 0x83),
+ new STGDAPARAM("18", 0x84), new STGDAPARAM("19", 0x85), new STGDAPARAM("1A", 0x86),
+ new STGDAPARAM("1B", 0x87), new STGDAPARAM("1C", 0x88), new STGDAPARAM("1D", 0x89),
+ new STGDAPARAM("1E", 0x90), new STGDAPARAM("1F", 0x91), new STGDAPARAM("20", 0x92),
+ new STGDAPARAM("B1", 0xA1), new STGDAPARAM("B2", 0xA2), new STGDAPARAM("B3", 0xA3),
+ new STGDAPARAM("B4", 0xA4), new STGDAPARAM("B5", 0xA5), new STGDAPARAM("B6", 0xA6),
+ new STGDAPARAM("B7", 0xA7), new STGDAPARAM("BW", 0xA8), new STGDAPARAM("G0", 0x20),
+ new STGDAPARAM("B0", 0xA0)
+ };
+ this.stGDAParam = stgdaparamArray;
+ #endregion
+ this.nBGMAdjust = 0;
+ this.nPolyphonicSounds = TJAPlayer3.ConfigIni.nPoliphonicSounds;
+ this.dbDTXVPlaySpeed = 1.0f;
+
+ //this.nScoreModeTmp = 1;
+ for (int y = 0; y < (int)Difficulty.Total; y++)
+ {
+ this.nScoreInit[0, y] = 300;
+ this.nScoreInit[1, y] = 1000;
+ this.nScoreDiff[y] = 120;
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬0, y] = false;
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬1, y] = false;
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, y] = false;
+ }
+
+ this.dbBarLength = 1.0;
+
+ this.b譛蛻昴ョ蛻蟯舌〒縺ゅk = true;
+
+ this.SongVol = CSound.DefaultSongVol;
+ this.SongLoudnessMetadata = null;
+
+ GaugeIncreaseMode = GaugeIncreaseMode.Normal;
+
+#if TEST_NOTEOFFMODE
+ this.bHH貍泌・上〒逶エ蜑阪ョHH繧呈カ磯浹縺吶k = true;
+ this.bGUITAR貍泌・上〒逶エ蜑阪ョGUITAR繧呈カ磯浹縺吶k = true;
+ this.bBASS貍泌・上〒逶エ蜑阪ョBASS繧呈カ磯浹縺吶k = true;
+#endif
+
+ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Change default culture to invariant, fixes (Purota)
+ Dan_C = new Dan_C[4];
+ pDan_LastChip = new CChip[1];
+ DanSongs.Number = 0;
+ }
+ public CDTX(string str蜈ィ蜈・蜉帶枚蟄怜, int difficulty)
+ : this()
+ {
+ this.On豢サ諤ァ蛹();
+ this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str蜈ィ蜈・蜉帶枚蟄怜, difficulty);
+ }
+ public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, int difficulty)
+ : this()
+ {
+ this.On豢サ諤ァ蛹();
+ this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, difficulty);
+ }
+ public CDTX(string str蜈ィ蜈・蜉帶枚蟄怜, double db蜀咲函騾溷コヲ, int nBGMAdjust, int difficulty)
+ : this()
+ {
+ this.On豢サ諤ァ蛹();
+ this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str蜈ィ蜈・蜉帶枚蟄怜, str蜈ィ蜈・蜉帶枚蟄怜, db蜀咲函騾溷コヲ, nBGMAdjust, difficulty);
+ }
+ public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int difficulty)
+ : this()
+ {
+ this.On豢サ諤ァ蛹();
+ this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, db蜀咲函騾溷コヲ, nBGMAdjust, 0, 0, false, difficulty);
+ }
+ public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int nReadVersion, int difficulty)
+ : this()
+ {
+ this.On豢サ諤ァ蛹();
+ this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, db蜀咲函騾溷コヲ, nBGMAdjust, nReadVersion, 0, false, difficulty);
+ }
+ public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int nReadVersion, int nPlayerSide, bool bSession, int difficulty)
+ : this()
+ {
+ this.On豢サ諤ァ蛹();
+ this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, db蜀咲函騾溷コヲ, nBGMAdjust, nReadVersion, nPlayerSide, bSession, difficulty);
+ }
+
+
+ // 繝。繧ス繝繝
+
+ public void tAVI縺ョ隱ュ縺ソ霎シ縺ソ()
+ {
+ if (this.listAVI != null)
+ {
+ foreach (CAVI cavi in this.listAVI.Values)
+ {
+ cavi.OnDeviceCreated();
+ }
+ }
+ if (this.listDS != null)
+ {
+ foreach (CDirectShow cds in this.listDS.Values)
+ {
+ cds.OnDeviceCreated();
+ }
+ }
+ if (!this.b繝倥ャ繝縺ョ縺ソ)//&& this.b蜍慕判隱ュ縺ソ霎シ縺ソ )
+ {
+ foreach (CChip chip in this.listChip)
+ {
+ if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x54 || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x5A)
+ {
+ chip.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.Unknown;
+ chip.rAVI = null;
+ chip.rDShow = null;
+ chip.rAVIPan = null;
+ if (this.listAVIPAN.TryGetValue(chip.n謨エ謨ー蛟、, out CAVIPAN cavipan))
+ {
+ if (this.listAVI.TryGetValue(cavipan.nAVI逡ェ蜿キ, out CAVI cavi) && (cavi.avi != null))
+ {
+ chip.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.AVIPAN;
+ chip.rAVI = cavi;
+ //if( CDTXMania.ConfigIni.bDirectShowMode == true )
+ chip.rDShow = this.listDS[cavipan.nAVI逡ェ蜿キ];
+ chip.rAVIPan = cavipan;
+ continue;
+ }
+ }
+
+ CDirectShow ds = null;
+ if (this.listAVI.TryGetValue(chip.n謨エ謨ー蛟、, out CAVI cavi2) && (cavi2.avi != null) || (this.listDS.TryGetValue(chip.n謨エ謨ー蛟、, out ds) && (ds.dshow != null)))
+ {
+ chip.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.AVI;
+ chip.rAVI = cavi2;
+ //if(CDTXMania.ConfigIni.bDirectShowMode == true)
+ chip.rDShow = ds;
+ }
+ }
+ }
+ }
+ }
+
+ public void tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」()
+ {
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ this.tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(cwav);
+ }
+ }
+ public void tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(CWAV wc)
+ {
+ if (wc.rSound[0] != null && wc.rSound[0].n邱乗シ泌・乗凾髢杜s >= 5000)
+ {
+ for (int i = 0; i < nPolyphonicSounds; i++)
+ {
+ if ((wc.rSound[i] != null) && (wc.rSound[i].b蜀咲函荳ュ))
+ {
+ long nCurrentTime = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+ if (nCurrentTime > wc.n蜀咲函髢句ァ区凾蛻サ[i])
+ {
+ long nAbsTimeFromStartPlaying = nCurrentTime - wc.n蜀咲函髢句ァ区凾蛻サ[i];
+ //Trace.TraceInformation( "蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」: {0}, seek蜈={1}ms, 蜈ィ髻ウ髟キ={2}ms",
+ // Path.GetFileName( wc.rSound[ 0 ].str繝輔ぃ繧、繝ォ蜷 ),
+ // nAbsTimeFromStartPlaying,
+ // wc.rSound[ 0 ].n邱乗シ泌・乗凾髢杜s
+ //);
+ // wc.rSound[ i ].t蜀咲函菴咲スョ繧貞、画峩縺吶k( wc.rSound[ i ].t譎ょ綾縺九i菴咲スョ繧定ソ斐☆( nAbsTimeFromStartPlaying ) );
+ // WASAPI/ASIO逕ィ竊
+ if (!TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bPAUSE)
+ {
+ if (wc.rSound[i].b荳譎ょ●豁「荳ュ) wc.rSound[i].t蜀咲函繧貞埼幕縺吶k(nAbsTimeFromStartPlaying);
+ else wc.rSound[i].t蜀咲函菴咲スョ繧貞、画峩縺吶k(nAbsTimeFromStartPlaying);
+ }
+ else
+ {
+ wc.rSound[i].t蜀咲函繧剃ク譎ょ●豁「縺吶k();
+ }
+ }
+ }
+ }
+ }
+ }
+ public void tWav縺ョ蜀咲函蛛懈ュ「(int nWave縺ョ蜀驛ィ逡ェ蜿キ)
+ {
+ tWav縺ョ蜀咲函蛛懈ュ「(nWave縺ョ蜀驛ィ逡ェ蜿キ, false);
+ }
+ public void tWav縺ョ蜀咲函蛛懈ュ「(int nWave縺ョ蜀驛ィ逡ェ蜿キ, bool b繝溘く繧オ繝シ縺九i繧ょ炎髯、縺吶k)
+ {
+ if (this.listWAV.TryGetValue(nWave縺ョ蜀驛ィ逡ェ蜿キ, out CWAV cwav))
+ {
+ for (int i = 0; i < nPolyphonicSounds; i++)
+ {
+ if (cwav.rSound[i] != null && cwav.rSound[i].b蜀咲函荳ュ)
+ {
+ if (b繝溘く繧オ繝シ縺九i繧ょ炎髯、縺吶k)
+ {
+ cwav.rSound[i].t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺励※Mixer縺九i繧ょ炎髯、縺吶k();
+ }
+ else
+ {
+ cwav.rSound[i].t蜀咲函繧貞●豁「縺吶k();
+ }
+ }
+ }
+ }
+ }
+ public void tWAV縺ョ隱ュ縺ソ霎シ縺ソ(CWAV cwav)
+ {
+ string str = string.IsNullOrEmpty(this.PATH_WAV) ? this.str繝輔か繝ォ繝蜷 : this.PATH_WAV;
+ str = str + cwav.str繝輔ぃ繧、繝ォ蜷;
+
+ try
+ {
+ #region [ 蜷梧凾逋コ髻ウ謨ー繧偵√メ繝」繝ウ繝阪Ν縺ォ繧医▲縺ヲ螟峨∴繧 ]
+
+ int nPoly = nPolyphonicSounds;
+ if (TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() != "DirectSound") // DShow縺ァ縺ョ蜀咲函縺ョ蝣エ蜷医ッ繝溘く繧キ繝ウ繧ー雋闕キ縺碁ォ倥¥縺ェ縺縺溘a縲
+ {
+ // 繝√ャ繝励ョ繝ゥ繧、繝輔ち繧、繝邂。逅繧定。後o縺ェ縺
+ if (cwav.bIsBassSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1;
+ else if (cwav.bIsGuitarSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1;
+ else if (cwav.bIsSESound) nPoly = 1;
+ else if (cwav.bIsBGMSound) nPoly = 1;
+ }
+
+ if (cwav.bIsBGMSound) nPoly = 1;
+
+ #endregion
+
+ for (int i = 0; i < nPoly; i++)
+ {
+ try
+ {
+ cwav.rSound[i] = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(str, ESoundGroup.SongPlayback);
+
+ if (!TJAPlayer3.ConfigIni.bDynamicBassMixerManagement)
+ {
+ cwav.rSound[i].tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k();
+ }
+
+ if (TJAPlayer3.ConfigIni.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉)
+ {
+ Trace.TraceInformation("繧オ繧ヲ繝ウ繝峨r菴懈舌@縺セ縺励◆縲({3})({0})({1})({2}bytes)", cwav.str繧ウ繝。繝ウ繝域枚, str,
+ cwav.rSound[0].n繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ, cwav.rSound[0].b繧ケ繝医Μ繝シ繝蜀咲函縺吶k ? "Stream" : "OnMemory");
+ }
+ }
+ catch (Exception e)
+ {
+ cwav.rSound[i] = null;
+ Trace.TraceError("繧オ繧ヲ繝ウ繝峨ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", cwav.str繧ウ繝。繝ウ繝域枚, str);
+ Trace.TraceError(e.ToString());
+ }
+ }
+ }
+ catch (Exception exception)
+ {
+ Trace.TraceError("繧オ繧ヲ繝ウ繝峨ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", cwav.str繧ウ繝。繝ウ繝域枚, str);
+ Trace.TraceError(exception.ToString());
+
+ for (int j = 0; j < nPolyphonicSounds; j++)
+ {
+ cwav.rSound[j] = null;
+ }
+
+ //continue;
+ }
+ }
+
+ public static string tZZ(int n)
+ {
+ if (n < 0 || n >= 36 * 36)
+ return "!!"; // 繧ェ繝シ繝舌シシ上い繝ウ繝繝シ繝輔Ο繝シ縲
+
+ // n 繧36騾イ謨ー2譯√ョ譁蟄怜励↓縺励※霑斐☆縲
+
+ string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ return new string(new char[] { str[n / 36], str[n % 36] });
+ }
+ public void t繧ョ繧ソ繝シ縺ィ繝吶シ繧ケ縺ョ繝ゥ繝ウ繝繝蛹(E讌ス蝎ィ繝代シ繝 part, E繝ゥ繝ウ繝繝繝「繝シ繝 eRandom)
+ {
+ }
+ public void t螟ェ鮠薙メ繝繝励ョ繝ゥ繝ウ繝繝蛹(E繝ゥ繝ウ繝繝繝「繝シ繝 eRandom)
+ {
+ //2016.02.11 kairera0467
+ //縺ェ繧薙□繧医%縺ョ繧ッ繧ス螳溯」縺ッ(諤)
+ Random rnd = new System.Random();
+
+ switch (eRandom)
+ {
+ case E繝ゥ繝ウ繝繝繝「繝シ繝.MIRROR:
+ foreach (var chip in this.listChip)
+ {
+ switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ case 0x11:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12;
+ break;
+ case 0x12:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11;
+ break;
+ case 0x13:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14;
+ chip.nSenote = 6;
+ break;
+ case 0x14:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13;
+ chip.nSenote = 5;
+ break;
+ }
+ }
+ break;
+ case E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM:
+ foreach (var chip in this.listChip)
+ {
+ int n = rnd.Next(50);
+
+ if (n >= 5 && n <= 10)
+ {
+ switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ case 0x11:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12;
+ break;
+ case 0x12:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11;
+ break;
+ case 0x13:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14;
+ chip.nSenote = 6;
+ break;
+ case 0x14:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13;
+ chip.nSenote = 5;
+ break;
+ }
+ }
+ }
+ break;
+ case E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM:
+ foreach (var chip in this.listChip)
+ {
+ int n = rnd.Next(80);
+
+ if (n >= 3 && n <= 43)
+ {
+ switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ case 0x11:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12;
+ break;
+ case 0x12:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11;
+ break;
+ case 0x13:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14;
+ chip.nSenote = 6;
+ break;
+ case 0x14:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13;
+ chip.nSenote = 5;
+ break;
+ }
+ }
+ }
+ break;
+ case E繝ゥ繝ウ繝繝繝「繝シ繝.HYPERRANDOM:
+ foreach (var chip in this.listChip)
+ {
+ int n = rnd.Next(100);
+
+ if (n >= 20 && n <= 80)
+ {
+ switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ case 0x11:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12;
+ break;
+ case 0x12:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11;
+ break;
+ case 0x13:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14;
+ chip.nSenote = 6;
+ break;
+ case 0x14:
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13;
+ chip.nSenote = 5;
+ break;
+ }
+ }
+ }
+ break;
+ case E繝ゥ繝ウ繝繝繝「繝シ繝.OFF:
+ default:
+ break;
+ }
+ if (eRandom != E繝ゥ繝ウ繝繝繝「繝シ繝.OFF)
+ {
+ #region[ list菴懈 ]
+ //縺イ縺ィ縺セ縺壹メ繝繝励□縺代ョ繝ェ繧ケ繝医r菴懈舌@縺ヲ縺翫¥縲
+ List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List();
+ int nCount = 0;
+ int dkdkCount = 0;
+
+ foreach (CChip chip in this.listChip)
+ {
+ if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x18)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip);
+ }
+ }
+ #endregion
+
+ this.tSenotes_Core_V2(list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝);
+
+ }
+
+
+ }
+
+ #region [ 繝√ャ繝励ョ蜀咲函縺ィ蛛懈ュ「 ]
+ public void t繝√ャ繝励ョ蜀咲函(CChip pChip, long n蜀咲函髢句ァ九す繧ケ繝繝譎ょ綾ms)
+ {
+ if (TJAPlayer3.ConfigIni.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 && TJAPlayer3.ConfigIni.n貍泌・城溷コヲ != 20)
+ return;
+
+ if (pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ >= 0)
+ {
+ if (this.listWAV.TryGetValue(pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CWAV wc))
+ {
+ int index = wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ = (wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ + 1) % nPolyphonicSounds;
+ if ((wc.rSound[0] != null) &&
+ (wc.rSound[0].b繧ケ繝医Μ繝シ繝蜀咲函縺吶k || wc.rSound[index] == null))
+ {
+ index = wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ = 0;
+ }
+ CSound sound = wc.rSound[index];
+ if (sound != null)
+ {
+ sound.db蜀咲函騾溷コヲ = ((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0;
+ // 蜀咲函騾溷コヲ縺ォ繧医▲縺ヲ縲仝ASAPI/ASIO縺ァ菴ソ縺菴ソ逕ィmixer縺梧アコ縺セ繧九◆繧√∽サ倬囂諠蝣ア縺ョ險ュ螳(髻ウ驥/PAN)縺ッ縲∝咲函騾溷コヲ縺ョ險ュ螳壼セ後↓陦後≧
+
+ // 2018-08-27 twopointzero - DON'T attempt to load (or queue scanning) loudness metadata here.
+ // This code is called right after loading the .tja, and that code
+ // will have just made such an attempt.
+ TJAPlayer3.SongGainController.Set(wc.SongVol, wc.SongLoudnessMetadata, sound);
+
+ sound.n菴咲スョ = wc.n菴咲スョ;
+ sound.t蜀咲函繧帝幕蟋九☆繧();
+ }
+ wc.n蜀咲函髢句ァ区凾蛻サ[wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ] = n蜀咲函髢句ァ九す繧ケ繝繝譎ょ綾ms;
+ this.tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(wc);
+ }
+ }
+ }
+ public void t蜷閾ェ蜍募咲函髻ウ繝√ャ繝励ョ蜀咲函譎ょ綾繧貞、画峩縺吶k(int nBGMAdjust縺ョ蠅玲ク帛、)
+ {
+ this.nBGMAdjust += nBGMAdjust縺ョ蠅玲ク帛、;
+ for (int i = 0; i < this.listChip.Count; i++)
+ {
+ int nChannelNumber = this.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ;
+ if (((
+ (nChannelNumber == 1) ||
+ ((0x61 <= nChannelNumber) && (nChannelNumber <= 0x69))
+ ) ||
+ ((0x70 <= nChannelNumber) && (nChannelNumber <= 0x79))
+ ) ||
+ (((0x80 <= nChannelNumber) && (nChannelNumber <= 0x89)) || ((0x90 <= nChannelNumber) && (nChannelNumber <= 0x92)))
+ )
+ {
+ this.listChip[i].n逋コ螢ー譎ょ綾ms += nBGMAdjust縺ョ蠅玲ク帛、;
+ }
+ }
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ for (int j = 0; j < nPolyphonicSounds; j++)
+ {
+ if ((cwav.rSound[j] != null) && cwav.rSound[j].b蜀咲函荳ュ)
+ {
+ cwav.n蜀咲函髢句ァ区凾蛻サ[j] += nBGMAdjust縺ョ蠅玲ク帛、;
+ }
+ }
+ }
+ }
+ public void t蜈ィ繝√ャ繝励ョ蜀咲函荳譎ょ●豁「()
+ {
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ for (int i = 0; i < nPolyphonicSounds; i++)
+ {
+ if ((cwav.rSound[i] != null) && cwav.rSound[i].b蜀咲函荳ュ)
+ {
+ cwav.rSound[i].t蜀咲函繧剃ク譎ょ●豁「縺吶k();
+ cwav.n荳譎ょ●豁「譎ょ綾[i] = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms;
+ }
+ }
+ }
+ }
+ public void t蜈ィ繝√ャ繝励ョ蜀咲函蜀埼幕()
+ {
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ for (int i = 0; i < nPolyphonicSounds; i++)
+ {
+ if ((cwav.rSound[i] != null) && cwav.rSound[i].b荳譎ょ●豁「荳ュ)
+ {
+ //long num1 = cwav.n荳譎ょ●豁「譎ょ綾[ i ];
+ //long num2 = cwav.n蜀咲函髢句ァ区凾蛻サ[ i ];
+ cwav.rSound[i].t蜀咲函繧貞埼幕縺吶k(cwav.n荳譎ょ●豁「譎ょ綾[i] - cwav.n蜀咲函髢句ァ区凾蛻サ[i]);
+ cwav.n蜀咲函髢句ァ区凾蛻サ[i] += CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - cwav.n荳譎ょ●豁「譎ょ綾[i];
+ }
+ }
+ }
+ }
+ public void t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「()
+ {
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ this.tWav縺ョ蜀咲函蛛懈ュ「(cwav.n蜀驛ィ逡ェ蜿キ);
+ }
+ }
+ public void t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「縺ィ繝溘く繧オ繝シ縺九i縺ョ蜑企勁()
+ {
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ this.tWav縺ョ蜀咲函蛛懈ュ「(cwav.n蜀驛ィ逡ェ蜿キ, true);
+ }
+ }
+ #endregion
+
+ public void t蜈・蜉(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, int difficulty)
+ {
+ this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, 1.0, 0, 0, 0, false, difficulty);
+ }
+ public void t蜈・蜉(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int nReadVersion, int nPlayerSide, bool bSession, int difficulty)
+ {
+ this.b繝倥ャ繝縺ョ縺ソ = b繝倥ャ繝縺ョ縺ソ;
+ this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ = Path.GetFullPath(str繝輔ぃ繧、繝ォ蜷);
+ this.str繝輔ぃ繧、繝ォ蜷 = Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ);
+ this.str繝輔か繝ォ繝蜷 = Path.GetDirectoryName(this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ) + @"\";
+ //if ( this.e遞ョ蛻・ != E遞ョ蛻・.SMF )
+ {
+ try
+ {
+ this.nPlayerSide = nPlayerSide;
+ this.bSession隴憺擇繧定ェュ縺ソ霎シ繧 = bSession;
+ if (nReadVersion != 0)
+ {
+ //DTX譁ケ蠑
+
+ //DateTime timeBeginLoad = DateTime.Now;
+ //TimeSpan span;
+ string[] files = Directory.GetFiles(this.str繝輔か繝ォ繝蜷, "*.tja");
+
+ StreamReader reader = new StreamReader(str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding("Shift_JIS"));
+ string str2 = reader.ReadToEnd();
+ reader.Close();
+
+ //StreamReader reader2 = new StreamReader( this.str繝輔か繝ォ繝蜷 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) );
+ StreamReader reader2 = new StreamReader(files[0], Encoding.GetEncoding("Shift_JIS"));
+ string str3 = reader2.ReadToEnd();
+ reader2.Close();
+
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "DTXfileload譎る俣: {0}", span.ToString() );
+
+ this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str2, str3, db蜀咲函騾溷コヲ, nBGMAdjust, difficulty);
+ }
+ else
+ {
+ //谺。驛取婿蠑
+
+ //DateTime timeBeginLoad = DateTime.Now;
+ //TimeSpan span;
+
+ StreamReader reader = new StreamReader(str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding("Shift_JIS"));
+ string str2 = reader.ReadToEnd();
+ reader.Close();
+
+ //StreamReader reader2 = new StreamReader( this.str繝輔か繝ォ繝蜷 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) );
+ //StreamReader reader2 = new StreamReader( str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) );
+ //string str3 = reader2.ReadToEnd();
+ //reader2.Close();
+ string str3 = str2;
+
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "DTXfileload譎る俣: {0}", span.ToString() );
+
+ this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str2, str3, db蜀咲函騾溷コヲ, nBGMAdjust, difficulty);
+ }
+ }
+ catch (Exception ex)
+ {
+ //MessageBox.Show( "縺翫d?繧ィ繝ゥ繝シ縺悟コ縺溘h縺縺ァ縺吶ゅ♀蜈讒倥" );
+ Trace.TraceError("縺翫d?繧ィ繝ゥ繝シ縺悟コ縺溘h縺縺ァ縺吶ゅ♀蜈讒倥");
+ Trace.TraceError(ex.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (79ff8639-9b3c-477f-bc4a-f2eea9784860)");
+ }
+ }
+ }
+ public void t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(string str蜈ィ蜈・蜉帶枚蟄怜, int difficulty)
+ {
+ this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str蜈ィ蜈・蜉帶枚蟄怜, str蜈ィ蜈・蜉帶枚蟄怜, 1.0, 0, difficulty);
+ }
+ public void t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(string str蜈ィ蜈・蜉帶枚蟄怜, string str1, double db蜀咲函騾溷コヲ, int nBGMAdjust, int Difficulty)
+ {
+ //DateTime timeBeginLoad = DateTime.Now;
+ //TimeSpan span;
+
+ if (!string.IsNullOrEmpty(str蜈ィ蜈・蜉帶枚蟄怜))
+ {
+ #region [ 謾ケ陦後き繝繝 ]
+ this.db蜀咲函騾溷コヲ = db蜀咲函騾溷コヲ;
+ str蜈ィ蜈・蜉帶枚蟄怜 = str蜈ィ蜈・蜉帶枚蟄怜.Replace(Environment.NewLine, "\n");
+ str蜈ィ蜈・蜉帶枚蟄怜 = str蜈ィ蜈・蜉帶枚蟄怜.Replace('\t', ' ');
+ str蜈ィ蜈・蜉帶枚蟄怜 = str蜈ィ蜈・蜉帶枚蟄怜 + "\n";
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "謾ケ陦後き繝繝域凾髢: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region [ 蛻晄悄蛹 ]
+ for (int j = 0; j < 36 * 36; j++)
+ {
+ this.n辟。髯千ョ。逅WAV[j] = -j;
+ this.n辟。髯千ョ。逅BPM[j] = -j;
+ this.n辟。髯千ョ。逅PAN[j] = -10000 - j;
+ this.n辟。髯千ョ。逅SIZE[j] = -j;
+ }
+ this.n蜀驛ィ逡ェ蜿キWAV1to = 1;
+ this.n蜀驛ィ逡ェ蜿キBPM1to = 1;
+ this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧 = new Stack();
+ this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Push(false);
+ this.n迴セ蝨ィ縺ョ荵ア謨ー = 0;
+ for (int k = 0; k < 7; k++)
+ {
+ this.nRESULTIMAGE逕ィ蜆ェ蜈磯菴梗k] = 0;
+ this.nRESULTMOVIE逕ィ蜆ェ蜈磯菴梗k] = 0;
+ this.nRESULTSOUND逕ィ蜆ェ蜈磯菴梗k] = 0;
+ }
+ #endregion
+ #region [ 蜈・蜉/陦瑚ァ」譫 ]
+ #region[蛻晄悄蛹望
+ this.dbNowScroll = 1.0;
+ this.dbNowSCROLL_Normal = new double[] { 1.0, 0.0 };
+ this.dbNowSCROLL_Expert = new double[] { 1.0, 0.0 };
+ this.dbNowSCROLL_Master = new double[] { 1.0, 0.0 };
+ this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eNormal;
+ #endregion
+ CharEnumerator ce = str蜈ィ蜈・蜉帶枚蟄怜.GetEnumerator();
+ if (ce.MoveNext())
+ {
+ this.n迴セ蝨ィ縺ョ陦梧焚 = 1;
+ do
+ {
+ if (!this.t蜈・蜉媽遨コ逋ス縺ィ謾ケ陦後r繧ケ繧ュ繝繝励☆繧(ref ce))
+ {
+ break;
+ }
+ if (this.listChip.Count == 0)
+ {
+ //this.t蜈・蜉(str1);
+ //this.t蜈・蜉媽V3( str1, 3 );
+ this.t蜈・蜉媽V4(str1, Difficulty);
+ }
+ if (ce.Current == '#')
+ {
+ if (ce.MoveNext())
+ {
+ StringBuilder builder = new StringBuilder(0x20);
+ if (this.t蜈・蜉媽繧ウ繝槭Φ繝画枚蟄怜励r謚懊″蜃コ縺(ref ce, ref builder))
+ {
+ StringBuilder builder2 = new StringBuilder(0x400);
+ if (this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ譁蟄怜励r謚懊″蜃コ縺(ref ce, ref builder2))
+ {
+ StringBuilder builder3 = new StringBuilder(0x400);
+ if (this.t蜈・蜉媽繧ウ繝。繝ウ繝域枚蟄怜励r謚懊″蜃コ縺(ref ce, ref builder3))
+ {
+ this.t蜈・蜉媽陦瑚ァ」譫(ref builder, ref builder2, ref builder3);
+
+ this.n迴セ蝨ィ縺ョ陦梧焚++;
+ continue;
+ }
+ }
+ }
+ }
+ break;
+ }
+ //this.t蜈・蜉(str1);
+ }
+ while (this.t蜈・蜉媽繧ウ繝。繝ウ繝医r繧ケ繧ュ繝繝励☆繧(ref ce));
+
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "謚懊″蜃コ縺玲凾髢: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ this.n辟。髯千ョ。逅WAV = null;
+ this.n辟。髯千ョ。逅BPM = null;
+ this.n辟。髯千ョ。逅PAN = null;
+ this.n辟。髯千ョ。逅SIZE = null;
+ //this.t蜈・蜉媽陦瑚ァ」譫舌倥ャ繝( str1 );
+ if (!this.b繝倥ャ繝縺ョ縺ソ)
+ {
+ #region [ BPM/BMP蛻晄悄蛹 ]
+ int ch;
+ CBPM cbpm = null;
+ foreach (CBPM cbpm2 in this.listBPM.Values)
+ {
+ if (cbpm2.n陦ィ險倅ク翫ョ逡ェ蜿キ == 0)
+ {
+ cbpm = cbpm2;
+ break;
+ }
+ }
+ if (cbpm == null)
+ {
+ cbpm = new CBPM();
+ cbpm.n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to++;
+ cbpm.n陦ィ險倅ク翫ョ逡ェ蜿キ = 0;
+ cbpm.dbBPM蛟、 = 120.0;
+ this.listBPM.Add(cbpm.n蜀驛ィ逡ェ蜿キ, cbpm);
+ CChip chip = new CChip();
+ chip.n逋コ螢ー菴咲スョ = 0;
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 8; // 諡。蠑オBPM
+ chip.n謨エ謨ー蛟、 = 0;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = cbpm.n蜀驛ィ逡ェ蜿キ;
+ this.listChip.Insert(0, chip);
+ }
+ else
+ {
+ CChip chip = new CChip();
+ chip.n逋コ螢ー菴咲スョ = 0;
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 8; // 諡。蠑オBPM
+ chip.n謨エ謨ー蛟、 = 0;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = cbpm.n蜀驛ィ逡ェ蜿キ;
+ this.listChip.Insert(0, chip);
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "蜑肴コ門y螳御コ譎る俣: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region [ CWAV蛻晄悄蛹 ]
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ if (cwav.n繝√ャ繝励し繧、繧コ < 0)
+ {
+ cwav.n繝√ャ繝励し繧、繧コ = 100;
+ }
+ if (cwav.n菴咲スョ <= -10000)
+ {
+ cwav.n菴咲スョ = 0;
+ }
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "CWAV蜑肴コ門y譎る俣: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region [ 繝√ャ繝怜咲紫險ュ螳 ] // #28145 2012.4.22 yyagi 莠碁阪Ν繝シ繝励r1驥阪Ν繝シ繝励↓螟画峩縺励※鬮倬溷喧)
+ //foreach ( CWAV cwav in this.listWAV.Values )
+ //{
+ // foreach( CChip chip in this.listChip )
+ // {
+ // if( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ == cwav.n蜀驛ィ逡ェ蜿キ )
+ // {
+ // chip.db繝√ャ繝励し繧、繧コ蛟咲紫 = ( (double) cwav.n繝√ャ繝励し繧、繧コ ) / 100.0;
+ // if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 ) // BGM縺縺」縺溘i
+ // {
+ // cwav.bIsOnBGMLane = true;
+ // }
+ // }
+ // }
+ //}
+ foreach (CChip chip in this.listChip)
+ {
+ if (this.listWAV.TryGetValue(chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CWAV cwav))
+ //foreach ( CWAV cwav in this.listWAV.Values )
+ {
+ // if ( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ == cwav.n蜀驛ィ逡ェ蜿キ )
+ // {
+ chip.db繝√ャ繝励し繧、繧コ蛟咲紫 = ((double)cwav.n繝√ャ繝励し繧、繧コ) / 100.0;
+ //if ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 ) // BGM縺縺」縺溘i
+ //{
+ // cwav.bIsOnBGMLane = true;
+ //}
+ // }
+ }
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "CWAV蜈ィ貅門y譎る俣: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region [ 蠢隕√↓蠢懊§縺ヲ遨コ謇薙■髻ウ繧0蟆冗ッ縺ォ螳夂セゥ縺吶k ]
+ //for ( int m = 0xb1; m <= 0xbc; m++ ) // #28146 2012.4.21 yyagi; bb -> bc
+ //{
+ // foreach ( CChip chip in this.listChip )
+ // {
+ // if ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == m )
+ // {
+ // CChip c = new CChip();
+ // c.n逋コ螢ー菴咲スョ = 0;
+ // c.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ;
+ // c.n謨エ謨ー蛟、 = chip.n謨エ謨ー蛟、;
+ // c.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ;
+ // this.listChip.Insert( 0, c );
+ // break;
+ // }
+ // }
+ //}
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "遨コ謇鍋「コ隱肴凾髢: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region [ 諡榊ュ神諡咲キ壹ョ謖ソ蜈・ ]
+ if (this.listChip.Count > 0)
+ {
+ this.listChip.Sort(); // 鬮倬溷喧縺ョ縺溘a縺ォ縺ッ縺薙l繧貞炎繧翫◆縺縺後〕istChip縺ョ譛蠕後′n逋コ螢ー菴咲スョ縺ョ邨らォッ縺ァ縺ゅk蠢隕√′縺ゅk縺ョ縺ァ縲
+ // 菫晏ョ域ァ遒コ菫昴r蜆ェ蜈医@縺ヲ縺薙%縺ァ縺ョ繧ス繝シ繝医ッ谿九@縺ヲ縺翫¥
+ // 縺ェ縺翫093譎らせ縺ァ縺ッ縲√%縺ョ繧ス繝シ繝医r蜑企勁縺励※繧ょ虚菴懊☆繧九h縺縺ォ縺ッ縺励※縺ゅk縲
+ // (縺薙%縺セ縺ァ縺ョ荳驛ィ繝√ャ繝礼匳骭イ繧偵〕istChip.Add(c)縺九i蜷栗nsert(0,c)縺ォ螟画峩縺励※縺ゅk)
+ // 縺薙l縺ォ繧医j縲∵焚ms遞句コヲ縺ェ縺後i縺薙%縺ァ縺ョ繧ス繝シ繝医b鬮倬溷喧縺輔l縺ヲ縺繧九
+
+ //double barlength = 1.0;
+ //int nEndOfSong = ( this.listChip[ this.listChip.Count - 1 ].n逋コ螢ー菴咲スョ + 384 ) - ( this.listChip[ this.listChip.Count - 1 ].n逋コ螢ー菴咲スョ % 384 );
+ //for ( int tick384 = 0; tick384 <= nEndOfSong; tick384 += 384 ) // 蟆冗ッ邱壹ョ謖ソ蜈・縲(蠕後↓蜃コ縺ヲ縺上k諡榊ュ千キ壹→繝ォ繝シ繝励r縺セ縺ィ繧√h縺縺ィ縺吶k縺ェ繧峨’or繝ォ繝シ繝励ョ邨ゆコ譚。莉カ縺ョ蠕ョ螯吶↑驕輔>縺ォ豕ィ諢上′蠢隕)
+ //{
+ // CChip chip = new CChip();
+ // chip.n逋コ螢ー菴咲スョ = tick384;
+ // chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x50; // 蟆冗ッ邱
+ // chip.n謨エ謨ー蛟、 = 36 * 36 - 1;
+ // chip.dbSCROLL = 1.0;
+ // this.listChip.Add( chip );
+ //}
+ ////this.listChip.Sort(); // 縺薙%縺ァ縺ョ繧ス繝シ繝医ッ荳崎ヲ√ゅ◆縺縺玲怙蠕後↓繧ス繝シ繝医☆繧九%縺ィ
+ //int nChipNo_BarLength = 0;
+ //int nChipNo_C1 = 0;
+
+ //this.listChip.Sort();
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "諡榊ュ神諡咲キ壽諺蜈・譎る俣: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region [ C2 [諡咲キ喟蟆冗ッ邱夊。ィ遉コ謖螳咯 縺ョ蜃ヲ逅 ] // #28145 2012.4.21 yyagi; 2驥阪Ν繝シ繝励r縺サ縺シ1驥阪↓縺励※鬮倬溷喧
+ bool bShowBeatBarLine = true;
+ for (int i = 0; i < this.listChip.Count; i++)
+ {
+ bool bChangedBeatBarStatus = false;
+ if ((this.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xc2))
+ {
+ if (this.listChip[i].n謨エ謨ー蛟、 == 1) // BAR/BEAT LINE = ON
+ {
+ bShowBeatBarLine = true;
+ bChangedBeatBarStatus = true;
+ }
+ else if (this.listChip[i].n謨エ謨ー蛟、 == 2) // BAR/BEAT LINE = OFF
+ {
+ bShowBeatBarLine = false;
+ bChangedBeatBarStatus = true;
+ }
+ }
+ int startIndex = i;
+ if (bChangedBeatBarStatus) // C2繝√ャ繝励ョ蜑阪↓50/51繝√ャ繝励′譚・縺ヲ縺繧句庄閭ス諤ァ縺ォ驟肴ョ
+ {
+ while (startIndex > 0 && this.listChip[startIndex].n逋コ螢ー菴咲スョ == this.listChip[i].n逋コ螢ー菴咲スョ)
+ {
+ startIndex--;
+ }
+ startIndex++; // 1縺、蟆上&縺城℃縺弱※縺繧九ョ縺ァ縲∵綾縺
+ }
+ for (int j = startIndex; j <= i; j++)
+ {
+ if (((this.listChip[j].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50) || (this.listChip[j].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x51)) &&
+ (this.listChip[j].n謨エ謨ー蛟、 == (36 * 36 - 1)))
+ {
+ this.listChip[j].b蜿ッ隕 = bShowBeatBarLine;
+ }
+ }
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "C2 [諡咲キ喟蟆冗ッ邱夊。ィ遉コ謖螳咯: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ this.n蜀驛ィ逡ェ蜿キBRANCH1to = 0;
+ this.n蜀驛ィ逡ェ蜿キJSCROLL1to = 0;
+ #region [ 逋コ螢ー譎ょ綾縺ョ險育ョ ]
+ double bpm = 120.0;
+ //double dbBarLength = 1.0;
+ int n逋コ螢ー菴咲スョ = 0;
+ int ms = 0;
+ int nBar = 0;
+ int nCount = 0;
+ this.nNowRollCount = 0;
+
+ List tmplistlyric = new List();
+ int BGM逡ェ蜿キ = 0;
+
+ foreach (CChip chip in this.listChip)
+ {
+ if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x02) { }
+ //else if( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x03 ){}
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x08) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x1F) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x51) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x54) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x08) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xF1) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xF2) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xFF) { }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xDD) { chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xDF) { chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); }
+ else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x93)
+ chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm));
+ else if ((chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ > 0x9F && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0xA0) || (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0xF0 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0xFE))
+ chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm));
+ nBar = chip.n逋コ螢ー菴咲スョ / 384;
+ ch = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ;
+
+ nCount++;
+ this.nNowRollCount++;
+
+ switch (ch)
+ {
+ case 0x01:
+ {
+ n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ;
+
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ ms = chip.n逋コ螢ー譎ょ綾ms;
+
+ #region[listlyric2縺ョ譎る俣蜷医o縺嫋
+ for (int ind = 0; ind < listLyric2.Count; ind++)
+ {
+ if (listLyric2[ind].index == BGM逡ェ蜿キ)
+ {
+ STLYRIC lyrictmp = this.listLyric2[ind];
+
+ lyrictmp.Time += chip.n逋コ螢ー譎ょ綾ms;
+
+ tmplistlyric.Add(lyrictmp);
+ }
+ }
+
+
+ BGM逡ェ蜿キ++;
+ #endregion
+ continue;
+ }
+ case 0x02: // BarLength
+ {
+ n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ;
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ ms = chip.n逋コ螢ー譎ょ綾ms;
+ dbBarLength = chip.db螳滓焚蛟、;
+ continue;
+ }
+ case 0x03: // BPM
+ {
+ n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ;
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ ms = chip.n逋コ螢ー譎ょ綾ms;
+ bpm = this.BASEBPM + chip.n謨エ謨ー蛟、;
+ this.dbNowBPM = bpm;
+ continue;
+ }
+ case 0x04: // BGA (繝ャ繧、繝、BGA1)
+ case 0x07: // 繝ャ繧、繝、BGA2
+ break;
+
+ case 0x15:
+ case 0x16:
+ case 0x17:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ {
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ chip.n繝弱シ繝邨ゆコ譎ょ綾ms += this.nOFFSET;
+ }
+
+ this.nNowRoll = this.nNowRollCount - 1;
+ continue;
+ }
+ case 0x18:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ {
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ }
+ continue;
+ }
+
+ case 0x55:
+ case 0x56:
+ case 0x57:
+ case 0x58:
+ case 0x59:
+ case 0x60:
+ break;
+
+ case 0x50:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ //chip.n逋コ螢ー譎ょ綾ms += this.nDELAY;
+ //chip.dbBPM = this.dbNowBPM;
+ //chip.dbSCROLL = this.dbNowSCROLL;
+
+ if (this.n蜀驛ィ逡ェ蜿キBRANCH1to + 1 > this.listBRANCH.Count)
+ continue;
+
+ if (this.listBRANCH[this.n蜀驛ィ逡ェ蜿キBRANCH1to].n迴セ蝨ィ縺ョ蟆冗ッ == nBar)
+ {
+ chip.bBranch = true;
+ this.n蜀驛ィ逡ェ蜿キBRANCH1to++;
+ }
+
+ //switch (this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ)
+ //{
+ // case 0:
+ // chip.dbSCROLL = this.dbNowSCROLL_Normal;
+ // break;
+ // case 1:
+ // chip.dbSCROLL = this.dbNowSCROLL_Expert;
+ // break;
+ // case 2:
+ // chip.dbSCROLL = this.dbNowSCROLL_Master;
+ // break;
+ //}
+
+ //if( this.bBarLine == true )
+ // chip.b蜿ッ隕 = true;
+ //else
+ // chip.b蜿ッ隕 = false;
+
+ //if( this.b谺。縺ョ蟆冗ッ縺悟蟯舌〒縺ゅk )
+ //{
+ // chip.bBranch = true;
+ // this.b谺。縺ョ蟆冗ッ縺悟蟯舌〒縺ゅk = false;
+ //}
+ continue;
+ }
+
+ case 0x05: // Extended Object (髱槫ッセ蠢)
+ case 0x06: // Miss繧「繝九Γ (髱槫ッセ蠢)
+ case 0x5A: // 譛ェ螳夂セゥ
+ case 0x5b: // 譛ェ螳夂セゥ
+ case 0x5c: // 譛ェ螳夂セゥ
+ case 0x5d: // 譛ェ螳夂セゥ
+ case 0x5e: // 譛ェ螳夂セゥ
+ case 0x5f: // 譛ェ螳夂セゥ
+ {
+ continue;
+ }
+ case 0x08: // 諡。蠑オBPM
+ {
+ n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ;
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ ms = chip.n逋コ螢ー譎ょ綾ms;
+ if (this.listBPM.TryGetValue(chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CBPM cBPM))
+ {
+ bpm = (cBPM.n陦ィ險倅ク翫ョ逡ェ蜿キ == 0 ? 0.0 : this.BASEBPM) + cBPM.dbBPM蛟、;
+ this.dbNowBPM = bpm;
+ }
+ continue;
+ }
+ case 0x54: // 蜍慕判蜀咲函
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ if (this.bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false)
+ chip.n逋コ螢ー譎ょ綾ms += this.nMOVIEOFFSET;
+ else
+ chip.n逋コ螢ー譎ょ綾ms -= this.nMOVIEOFFSET;
+ if (this.listAVIPAN.TryGetValue(chip.n謨エ謨ー蛟、, out CAVIPAN cavipan))
+ {
+ int num21 = ms + ((int)(((0x271 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm));
+ int num22 = ms + ((int)(((0x271 * ((chip.n逋コ螢ー菴咲スョ + cavipan.n遘サ蜍墓凾髢田t) - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm));
+ chip.n邱冗ァサ蜍墓凾髢 = num22 - num21;
+ }
+ continue;
+ }
+ case 0x97:
+ case 0x98:
+ case 0x99:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ {
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ chip.n繝弱シ繝邨ゆコ譎ょ綾ms += this.nOFFSET;
+ }
+
+ //chip.dbBPM = this.dbNowBPM;
+ //chip.dbSCROLL = this.dbNowSCROLL;
+ this.nNowRoll = this.nNowRollCount - 1;
+
+ //chip.n繝弱シ繝邨ゆコ譎ょ綾ms = ms + ( (int) ( ( ( 0x271 * ( chip.n繝弱シ繝邨ゆコ菴咲スョ - n逋コ螢ー菴咲スョ ) ) * dbBarLength ) / bpm ) );
+
+ #region[繝√ャ繝礼分蜿キ繧定ィ倬鹸]
+ //switch(chip.n繧ウ繝シ繧ケ)
+ //{
+ // case 0:
+ // this.n騾」謇薙メ繝繝誉temp[0] = this.nNowRoll;
+ // this.dbSCROLL_temp[0] = this.dbNowSCROLL;
+ // break;
+ // case 1:
+ // this.n騾」謇薙メ繝繝誉temp[1] = this.nNowRoll;
+ // this.dbSCROLL_temp[1] = this.dbNowSCROLL;
+ // break;
+ // case 2:
+ // this.n騾」謇薙メ繝繝誉temp[2] = this.nNowRoll;
+ // this.dbSCROLL_temp[2] = this.dbNowSCROLL;
+ // break;
+ //}
+
+ #endregion
+
+ continue;
+ }
+ case 0x9A:
+ {
+
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ {
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ }
+ //chip.n逋コ螢ー譎ょ綾ms += this.nDELAY;
+ //chip.dbBPM = this.dbNowBPM;
+ //chip.dbSCROLL = this.dbNowSCROLL;
+
+ #region[繝√ャ繝礼分蜿キ繧定ィ倬鹸]
+ //鬚ィ闊ケ縺ッ迴セ譎らせ縺ァ縺ッ譛ェ螳溯」縺ョ縺溘a蜃ヲ逅縺励↑縺縲
+
+
+ //switch (chip.n繧ウ繝シ繧ケ)
+ //{
+ // case 0:
+ // if (this.listChip[this.n騾」謇薙メ繝繝誉temp[0]].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x99) break;
+ // this.listChip[this.n騾」謇薙メ繝繝誉temp[0]].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms;
+ // this.listChip[this.n騾」謇薙メ繝繝誉temp[0]].dbSCROLL = this.dbSCROLL_temp[0];
+ // break;
+ // case 1:
+ // if (this.listChip[this.n騾」謇薙メ繝繝誉temp[1]].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x99) break;
+ // this.listChip[this.n騾」謇薙メ繝繝誉temp[1]].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms;
+ // this.listChip[this.n騾」謇薙メ繝繝誉temp[1]].dbSCROLL = this.dbSCROLL_temp[1];
+ // break;
+ // case 2:
+ // if (this.listChip[this.n騾」謇薙メ繝繝誉temp[2]].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x99) break;
+ // this.listChip[this.n騾」謇薙メ繝繝誉temp[2]].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms;
+ // this.listChip[this.n騾」謇薙メ繝繝誉temp[2]].dbSCROLL = this.dbSCROLL_temp[2];
+ // break;
+ //}
+
+ #endregion
+
+ //this.listChip[this.nNowRoll].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms;
+ //this.listChip[this.nNowRoll].dbSCROLL = this.dbNowSCROLL;
+ //this.listChip[this.nNowRoll].dbBPM = this.dbNowBPM;
+ continue;
+ }
+ case 0x9D:
+ {
+ //if ( this.listSCROLL.ContainsKey( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) )
+ //{
+ //this.dbNowSCROLL = ( ( this.listSCROLL[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].n陦ィ險倅ク翫ョ逡ェ蜿キ == 0 ) ? 0.0 : 1.0 ) + this.listSCROLL[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].dbSCROLL蛟、;
+ //}
+
+ //switch (chip.n繧ウ繝シ繧ケ)
+ //{
+ // case 0:
+ // this.dbNowSCROLL_Normal = this.dbNowSCROLL;
+ // this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = 0;
+ // break;
+ // case 1:
+ // this.dbNowSCROLL_Expert = this.dbNowSCROLL;
+ // this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = 1;
+ // break;
+ // case 2:
+ // this.dbNowSCROLL_Master = this.dbNowSCROLL;
+ // this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = 2;
+ // break;
+ //}
+
+ continue;
+ }
+ case 0xDC:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ //if ( this.listDELAY.ContainsKey( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) )
+ //{
+ // this.nDELAY = ( ( this.listDELAY[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].n陦ィ險倅ク翫ョ逡ェ蜿キ == 0 ) ? 0 : 0 ) + this.listDELAY[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].nDELAY蛟、;
+ //}
+ continue;
+ }
+ case 0xDE:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ {
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ chip.n蛻蟯先凾蛻サms += this.nOFFSET;
+ }
+ this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = chip.n繧ウ繝シ繧ケ;
+ continue;
+ }
+ case 0x52:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ {
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ chip.n蛻蟯先凾蛻サms += this.nOFFSET;
+ }
+ this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = chip.n繧ウ繝シ繧ケ;
+ continue;
+ }
+ case 0xDF:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ //if ( this.listBRANCH.ContainsKey( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) )
+ //{
+ //this.listBRANCH[chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ].db蛻蟯先凾髢杜s = chip.n逋コ螢ー譎ょ綾ms + ( this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk ? this.nOFFSET : 0 );
+ //}
+
+ continue;
+ }
+ case 0xE0:
+ {
+ //if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ // chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+
+ //chip.dbBPM = this.dbNowBPM;
+ //chip.dbSCROLL = this.dbNowSCROLL;
+ //if( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ == 1 )
+ // this.bBarLine = false;
+ //else
+ // this.bBarLine = true;
+ continue;
+ }
+ default:
+ {
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk)
+ chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET;
+ //chip.n逋コ螢ー譎ょ綾ms += this.nDELAY;
+ chip.dbBPM = this.dbNowBPM;
+ //chip.dbSCROLL = this.dbNowSCROLL;
+ continue;
+ }
+ }
+ }
+ if (this.db蜀咲函騾溷コヲ > 0.0)
+ {
+ double _db蜀咲函騾溷コヲ = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : this.db蜀咲函騾溷コヲ;
+ foreach (CChip chip in this.listChip)
+ {
+ chip.n逋コ螢ー譎ょ綾ms = (int)(((double)chip.n逋コ螢ー譎ょ綾ms) / _db蜀咲函騾溷コヲ);
+ chip.db逋コ螢ー譎ょ綾ms = (((double)chip.n逋コ螢ー譎ょ綾ms) / _db蜀咲函騾溷コヲ);
+ chip.n繝弱シ繝邨ゆコ譎ょ綾ms = (int)(((double)chip.n繝弱シ繝邨ゆコ譎ょ綾ms) / _db蜀咲函騾溷コヲ);
+ }
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "逋コ螢ー譎ょ綾險育ョ: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+
+ #region[listlyric繧呈凾髢馴縺ォ荳ヲ縺ウ譖ソ縺医]
+ this.listLyric2 = tmplistlyric;
+ this.listLyric2.Sort((a, b) => a.Time.CompareTo(b.Time));
+ #endregion
+
+ this.nBGMAdjust = 0;
+ this.t蜷閾ェ蜍募咲函髻ウ繝√ャ繝励ョ蜀咲函譎ょ綾繧貞、画峩縺吶k(nBGMAdjust);
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "蜀咲函譎ょ綾螟画峩: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+
+ #region [ 蜿ッ隕悶メ繝繝玲焚繧ォ繧ヲ繝ウ繝 ]
+ for (int n = 0; n < 14; n++)
+ {
+ this.n蜿ッ隕悶メ繝繝玲焚[n] = 0;
+ }
+ foreach (CChip chip in this.listChip)
+ {
+ int c = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ;
+ if ((0x11 <= c) && (c <= 0x14))
+ {
+ if (c == 0x11 || c == 0x13)
+ this.n蜿ッ隕悶メ繝繝玲焚.Taiko_Red++;
+ else if (c == 0x12 || c == 0x14)
+ this.n蜿ッ隕悶メ繝繝玲焚.Taiko_Blue++;
+ }
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "蜿ッ隕悶メ繝繝玲焚繧ォ繧ヲ繝ウ繝 {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region [ 繝√ャ繝励ョ遞ョ鬘槭r蛻鬘槭@縲∝ッセ蠢懊☆繧九ヵ繝ゥ繧ー繧堤ォ九※繧 ]
+ foreach (CChip chip in this.listChip)
+ {
+ if ((chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 && this.listWAV.TryGetValue(chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CWAV cwav)) && !cwav.list縺薙ョWAV繧剃スソ逕ィ縺吶k繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ョ髮蜷.Contains(chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ))
+ {
+ cwav.list縺薙ョWAV繧剃スソ逕ィ縺吶k繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ョ髮蜷.Add(chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ);
+
+ int c = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >> 4;
+ switch (c)
+ {
+ case 0x01:
+ cwav.bIsDrumsSound = true; break;
+ case 0x02:
+ cwav.bIsGuitarSound = true; break;
+ case 0x0A:
+ cwav.bIsBassSound = true; break;
+ case 0x06:
+ case 0x07:
+ case 0x08:
+ case 0x09:
+ cwav.bIsSESound = true; break;
+ case 0x00:
+ if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01)
+ {
+ cwav.bIsBGMSound = true; break;
+ }
+ break;
+ }
+ }
+ }
+ #endregion
+ //span = (TimeSpan) ( DateTime.Now - timeBeginLoad );
+ //Trace.TraceInformation( "ch逡ェ蜿キ髮蜷育「コ隱: {0}", span.ToString() );
+ //timeBeginLoad = DateTime.Now;
+ #region[ seNotes險育ョ ]
+ if (this.listBRANCH.Count != 0)
+ this.tSetSenotes_branch();
+ else
+ this.tSetSenotes();
+
+ #endregion
+ #region [ bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉 ]
+ if (TJAPlayer3.ConfigIni.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉)
+ {
+ foreach (CWAV cwav in this.listWAV.Values)
+ {
+ Trace.TraceInformation(cwav.ToString());
+ }
+ foreach (CAVI cavi in this.listAVI.Values)
+ {
+ Trace.TraceInformation(cavi.ToString());
+ }
+ foreach (CBPM cbpm3 in this.listBPM.Values)
+ {
+ Trace.TraceInformation(cbpm3.ToString());
+ }
+ foreach (CChip chip in this.listChip)
+ {
+ Trace.TraceInformation(chip.ToString());
+ }
+ }
+ #endregion
+
+ //繧ス繝シ繝医▲縺ス縺
+ //this.listChip.Sort(delegate(CChip pchipA, CChip pchipB) { return pchipA.n逋コ螢ー譎ょ綾ms - pchipB.n逋コ螢ー譎ょ綾ms; } );
+ //Random ran1 = new Random();
+ //for (int n = 0; n < this.listChip.Count; n++ )
+ //{
+
+ // if (CDTXMania.ConfigIni.bHispeedRandom)
+ // {
+
+ // int nRan = ran1.Next(5, 40);
+ // this.listChip[n].dbSCROLL = nRan / 10.0;
+ // }
+ //}
+ int n謨エ謨ー蛟、邂。逅 = 0;
+ foreach (CChip chip in this.listChip)
+ {
+ if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x54)
+ chip.n謨エ謨ー蛟、 = n謨エ謨ー蛟、邂。逅;
+ n謨エ謨ー蛟、邂。逅++;
+ }
+
+ }
+ }
+ }
+ }
+
+ private string t繧ウ繝。繝ウ繝医r蜑企勁縺吶k(string input)
+ {
+ string strOutput = Regex.Replace(input, @" *//.*", ""); //2017.01.28 DD 繧ウ繝。繝ウ繝亥燕縺ョ繧ケ繝壹シ繧ケ繧ょ炎髯、縺吶k繧医≧縺ォ菫ョ豁」
+
+ return strOutput;
+ }
+
+ private string[] t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(string[] input)
+ {
+ return this.t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(input, 0);
+ }
+
+ private string[] t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(string[] input, int nMode)
+ {
+ var sb = new StringBuilder();
+
+ // 18/11/11 AioiLight 隴憺擇縺ォSpace縲√せ繝壹シ繧ケ縲ゝab遲峨′蜈・縺」縺ヲ縺繧九→縺翫°縺励¥縺ェ繧九ョ縺ァ菫ョ豁」縲
+ // 螟壼繧ウ繝槭Φ繝峨b繧ケ繝壹シ繧ケ縺梧栢縺九l縺。繧縺」縺ヲ縺繧九′縲√さ繝槭Φ繝芽。後r髯、縺剰ュ憺擇繧定ソ斐☆縺ョ縺ァ螟ァ荳亥、ォ(縺溘カ繧)縲
+ for (int i = 0; i < input.Length; i++)
+ {
+ input[i] = input[i].Trim();
+ }
+
+ for (int n = 0; n < input.Length; n++)
+ {
+ if (nMode == 0)
+ {
+ if (!string.IsNullOrEmpty(input[n]) && this.CharConvertNote(input[n].Substring(0, 1)) != -1)
+ {
+ sb.Append(input[n] + "\n");
+ }
+ }
+ else if (nMode == 1)
+ {
+ if (!string.IsNullOrEmpty(input[n]) && (input[n].Substring(0, 1) == "#" || this.CharConvertNote(input[n].Substring(0, 1)) != -1))
+ {
+ if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM"))
+ {
+ //Aス曦縺ァ蟋九∪繧句多莉、縺悟炎髯、縺輔l縺ェ縺荳榊キ蜷医ョ蟇セ遲
+ }
+ else
+ {
+ sb.Append(input[n] + "\n");
+ }
+ }
+ }
+ else if (nMode == 2)
+ {
+ if (!string.IsNullOrEmpty(input[n]) && this.CharConvertNote(input[n].Substring(0, 1)) != -1)
+ {
+ if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM"))
+ {
+ //Aス曦縺ァ蟋九∪繧句多莉、縺悟炎髯、縺輔l縺ェ縺荳榊キ蜷医ョ蟇セ遲
+ }
+ else
+ {
+ sb.Append(input[n] + "\n");
+ }
+ }
+ else
+ {
+ if (input[n].StartsWith("#BRANCHSTART") || input[n] == "#N" || input[n] == "#E" || input[n] == "#M")
+ {
+ sb.Append(input[n] + "\n");
+ }
+
+ }
+ }
+ }
+
+ string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None);
+
+ return strOutput;
+ }
+
+ private string[] t遨コ縺ョstring驟榊励r隧ー繧√◆string驟榊励r霑斐☆(string[] input)
+ {
+ var sb = new StringBuilder();
+
+ for (int n = 0; n < input.Length; n++)
+ {
+ if (!string.IsNullOrEmpty(input[n]))
+ {
+ sb.Append(input[n] + "\n");
+ }
+ }
+
+ string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None);
+
+ return strOutput;
+ }
+
+ private string StringArrayToString(string[] input)
+ {
+ return this.StringArrayToString(input, "");
+ }
+ private string StringArrayToString(string[] input, string str繝繝ェ繝溘ち譁蟄)
+ {
+ var sb = new StringBuilder();
+
+ for (int n = 0; n < input.Length; n++)
+ {
+ sb.Append(input[n] + str繝繝ェ繝溘ち譁蟄);
+ }
+
+ return sb.ToString();
+ }
+
+ ///
+ ///
+ ///
+ ///
+ /// 1蟆冗ッ蜀縺ョ譁蟄玲焚
+ private int t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医☆繧(string InputText)
+ {
+ return InputText.Length - 1;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ /// 1蟆冗ッ蜀縺ョ譁蟄玲焚
+ private void t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医@縺ヲ繝ェ繧ケ繝医↓霑ス蜉縺吶k(string InputText)
+ {
+ int nCount = 0;
+
+ if (InputText.StartsWith("#BRANCHSTART"))
+ {
+ this.nLineCountTemp = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー;
+ return;
+ }
+ else if (InputText.StartsWith("#N"))
+ {
+ this.nLineCountCourseTemp = ECourse.eNormal;
+ this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = this.nLineCountTemp;
+ return;
+ }
+ else if (InputText.StartsWith("#E"))
+ {
+ this.nLineCountCourseTemp = ECourse.eExpert;
+ this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = this.nLineCountTemp;
+ return;
+ }
+ else if (InputText.StartsWith("#M"))
+ {
+ this.nLineCountCourseTemp = ECourse.eMaster;
+ this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = this.nLineCountTemp;
+ return;
+ }
+
+
+ var line = new CLine();
+ line.n繧ウ繝シ繧ケ = this.nLineCountCourseTemp;
+ line.n譁蟄玲焚 = InputText.Length - 1;
+ line.n蟆冗ッ逡ェ蜿キ = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー;
+
+ this.listLine.Add(line);
+
+ this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー++;
+
+ }
+
+ ///
+ /// 0:謾ケ陦梧枚蟄励r蜑企勁縺励※縲√ョ繝ェ繝溘ち縺ィ縺励※繧ケ繝壹シ繧ケ繧貞・繧後k縲(霑斐j蛟、:string)
+ /// 1:謾ケ陦梧枚蟄励r蜑企勁縲√&繧峨↓Split縺励※霑斐☆(霑斐j蛟、:string[n])
+ ///
+ ///
+ ///
+ ///
+ private object str謾ケ陦梧枚蟄励r蜑企勁縺吶k(string strInput, int nMode)
+ {
+ string str = "";
+ str = strInput.Replace(Environment.NewLine, "\n");
+ str = str.Replace('\t', ' ');
+
+ if (nMode == 0)
+ {
+ str = str.Replace("\n", " ");
+ }
+ else if (nMode == 1)
+ {
+ str = str + "\n";
+
+ string[] strArray;
+ strArray = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries);
+
+ return strArray;
+ }
+
+ return str;
+ }
+
+ ///
+ /// 繧ウ繝シ繧ケ縺斐→縺ォ隴憺擇繧貞蜑イ縺吶k縲
+ ///
+ ///
+ /// 蜷繧ウ繝シ繧ケ縺ョ隴憺擇(string[5])
+ private string[] t繧ウ繝シ繧ケ縺ァ隴憺擇繧貞蜑イ縺吶k(string strTJA)
+ {
+ string[] strCourseTJA = new string[(int)Difficulty.Total];
+
+ if (strTJA.IndexOf("COURSE", 0) != -1)
+ {
+ //tja蜀縺ォ縲靴OURSE縲阪′縺ゅl縺ー縺薙%繧剃スソ縺縲
+ string[] strTemp = strTJA.Split(this.dlmtCOURSE, StringSplitOptions.RemoveEmptyEntries);
+
+ for (int n = 1; n < strTemp.Length; n++)
+ {
+ int nCourse = 0;
+ string nNC = "";
+ while (strTemp[n].Substring(0, 1) != "\n") //2017.01.29 DD COURSE蜊倩ェ櫁。ィ險倥↓蟇セ蠢
+ {
+ nNC += strTemp[n].Substring(0, 1);
+ strTemp[n] = strTemp[n].Remove(0, 1);
+ }
+
+ if (this.strConvertCourse(nNC) != -1)
+ {
+ nCourse = this.strConvertCourse(nNC);
+ strCourseTJA[nCourse] = strTemp[n];
+ }
+ else
+ {
+
+ }
+ //strCourseTJA[ ];
+
+ }
+ }
+ else
+ {
+ strCourseTJA[3] = strTJA;
+ }
+
+ return strCourseTJA;
+ }
+
+ private static readonly Regex regexForPrefixingCommaStartingLinesWithZero = new Regex(@"^,", RegexOptions.Multiline | RegexOptions.Compiled);
+ private static readonly Regex regexForStrippingHeadingLines = new Regex(
+ @"^(?!(TITLE|LEVEL|BPM|WAVE|OFFSET|BALLOON|EXAM1|EXAM2|EXAM3|EXAM4|RENREN22|RENREN23|RENREN32|RENREN33|RENREN42|RENREN43|BALLOONNOR|BALLOONEXP|BALLOONMAS|SONGVOL|SEVOL|SCOREINIT|SCOREDIFF|COURSE|STYLE|GAME|LIFE|DEMOSTART|SIDE|SUBTITLE|SCOREMODE|GENRE|MOVIEOFFSET|BGIMAGE|BGMOVIE|HIDDENBRANCH|GAUGEINCR|LYRICFILE|#HBSCROLL|#BMSCROLL)).+\n",
+ RegexOptions.Multiline | RegexOptions.Compiled);
+
+ ///
+ /// 譁ー蝙九
+ /// 笳区悴螳溯」
+ /// _縲靴OURSE縲榊ョ夂セゥ縺檎┌縺隴憺擇縺ッ譛ェ蟇セ蠢
+ /// 縲竊致er2015082200縺ァ蟇セ蠢懷ョ御コ縲
+ ///
+ ///
+ /// 隴憺擇縺ョ繝繝シ繧ソ
+ private void t蜈・蜉媽V4(string strInput, int difficulty)
+ {
+ if (!String.IsNullOrEmpty(strInput)) //遨コ縺ェ繧蛾壹&縺ェ縺
+ {
+ //StreamWriter stream = null;
+ //bool bLog = true;
+ //try
+ //{
+ // stream = new StreamWriter("noteTest.txt", false);
+ //}
+ //catch (Exception ex)
+ //{
+ // Trace.TraceError( ex.StackTrace );
+ //}
+
+ //2017.01.31 DD 繧ォ繝ウ繝槭ョ縺ソ縺ョ陦後r0,縺ォ鄂ョ縺肴鋤縺
+ strInput = regexForPrefixingCommaStartingLinesWithZero.Replace(strInput, "0,");
+
+ //2017.02.03 DD 繝倥ャ繝蜀縺ォ縺ゅk蜻ス莉、莉・螟悶ョ譁蟄怜励r蜑企勁
+ var startIndex = strInput.IndexOf("#START");
+ if (startIndex < 0)
+ {
+ Trace.TraceWarning($"#START蜻ス莉、縺悟ー代↑縺上→繧1縺、縺ッ蠢隕√〒縺吶 ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})");
+ }
+ string strInputHeader = strInput.Remove(startIndex);
+ strInput = strInput.Remove(0, startIndex);
+ strInputHeader = regexForStrippingHeadingLines.Replace(strInputHeader, "");
+ strInput = strInputHeader + "\n" + strInput;
+
+ //縺ゥ縺縺帑スソ繧上↑縺縺ョ縺ァ蜈医↓Split縺励※繧ウ繝。繝ウ繝医r蜑企勁縲
+ var strSplit縺励◆隴憺擇 = (string[])this.str謾ケ陦梧枚蟄励r蜑企勁縺吶k(strInput, 1);
+ for (int i = 0; strSplit縺励◆隴憺擇.Length > i; i++)
+ {
+ strSplit縺励◆隴憺擇[i] = this.t繧ウ繝。繝ウ繝医r蜑企勁縺吶k(strSplit縺励◆隴憺擇[i]);
+ }
+ //遨コ縺ョstring驟榊励r隧ー繧√k
+ strSplit縺励◆隴憺擇 = this.t遨コ縺ョstring驟榊励r隧ー繧√◆string驟榊励r霑斐☆(strSplit縺励◆隴憺擇);
+
+ #region[繝倥ャ繝]
+
+ //2015.05.21 kairera0467
+ //繝倥ャ繝縺ョ隱ュ縺ソ霎シ縺ソ縺ッ隴憺擇蜈ィ菴薙°繧芽ゥイ蠖薙☆繧句多莉、繧呈爾縺吶
+ //蟆代@蜃ヲ逅縺碁≦縺上↑繧句庄閭ス諤ァ縺ッ縺ゅk縺後√%縺薙ッ豁」遒コ諤ァ繧帝崎ヲ悶☆繧九
+ //轤ケ謨ー縺ェ縺ゥ縺ョ謖螳壹ッ蠕後°繧牙推繧ウ繝シ繧ケ縺ァ陦後≧縺ョ縺ァ蝠城。後ッ辟。縺縺繧阪≧縲
+
+ //Split縺励◆繝倥ャ繝縺ョLength縺ョ蝗樊焚縺縺代’or縺ァ蝗槭@縺ヲ蜷遞ョ諠蝣ア繧定ェュ縺ソ蜿悶▲縺ヲ縺縺上
+ for (int i = 0; strSplit縺励◆隴憺擇.Length > i; i++)
+ {
+ this.t蜈・蜉媽陦瑚ァ」譫舌倥ャ繝(strSplit縺励◆隴憺擇[i]);
+ }
+ #endregion
+
+ #region[隴憺擇]
+
+ int n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = 3;
+ int n隴憺擇謨ー = 0; //2017.07.22 kairera0467 tja縺ォ蜷ォ縺セ繧後k隴憺擇縺ョ謨ー
+
+
+ bool b譁ー蜃ヲ逅 = false;
+
+ //縺セ縺壹ッ繧ウ繝シ繧ケ縺斐→縺ォ隴憺擇繧貞蜑イ縲
+ strSplit縺励◆隴憺擇 = this.t繧ウ繝シ繧ケ縺ァ隴憺擇繧貞蜑イ縺吶k(this.StringArrayToString(strSplit縺励◆隴憺擇, "\n"));
+ string strTest = "";
+ //蟄伜惠縺吶k縺九ョ繝輔Λ繧ー菴懈舌
+ for (int i = 0; i < strSplit縺励◆隴憺擇.Length; i++)
+ {
+ if (!String.IsNullOrEmpty(strSplit縺励◆隴憺擇[i]))
+ {
+ this.b隴憺擇縺悟ュ伜惠縺吶k[i] = true;
+ n隴憺擇謨ー++;
+ }
+ else
+ this.b隴憺擇縺悟ュ伜惠縺吶k[i] = false;
+ }
+ #region[ 隱ュ縺ソ霎シ縺セ縺帙k繧ウ繝シ繧ケ繧呈アコ螳 ]
+ if (this.b隴憺擇縺悟ュ伜惠縺吶k[difficulty] == false)
+ {
+ n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = difficulty;
+ n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ++;
+ for (int n = 1; n < (int)Difficulty.Total; n++)
+ {
+ if (this.b隴憺擇縺悟ュ伜惠縺吶k[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ] == false)
+ {
+ n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ++;
+ if (n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ > (int)Difficulty.Total - 1)
+ n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = 0;
+ }
+ else
+ break;
+ }
+ }
+ else
+ n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = difficulty;
+ #endregion
+
+ //謖螳壹@縺溘さ繝シ繧ケ縺ョ隴憺擇縺ョ蜻ス莉、繧呈カ亥悉縺吶k縲
+ strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ] = CDTXStyleExtractor.t繧サ繝繧キ繝ァ繝ウ隴憺擇縺後≠繧(
+ strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ],
+ TJAPlayer3.ConfigIni.nPlayerCount > 1 ? (this.nPlayerSide + 1) : 0,
+ this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ);
+
+ //蜻ス莉、繧偵☆縺ケ縺ヲ豸亥悉縺励◆隴憺擇
+ var str蜻ス莉、豸亥悉隴憺擇 = strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries);
+ //if( bLog && stream != null )
+ //{
+ // stream.WriteLine( "-------------------------------------------------" );
+ // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇(繧ウ繝槭Φ繝牙炎髯、蜑)" );
+ // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ )
+ // {
+ // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] );
+ // }
+ // stream.WriteLine( "-------------------------------------------------" );
+ //}
+ str蜻ス莉、豸亥悉隴憺擇 = this.t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(str蜻ス莉、豸亥悉隴憺擇, 2);
+
+ //if( bLog && stream != null )
+ //{
+ // stream.WriteLine( "-------------------------------------------------" );
+ // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇" );
+ // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ )
+ // {
+ // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] );
+ // }
+ // stream.WriteLine( "-------------------------------------------------" );
+ //}
+
+
+ //縺薙%縺ァ1陦後ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医る榊励↓縺励※霑斐☆縲
+ var strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries);
+ string str = "";
+ try
+ {
+ if (n隴憺擇謨ー > 0)
+ {
+ //2017.07.22 kairera0467 隴憺擇縺2縺、莉・荳翫≠繧句エ蜷医ッCOURSE莉・荳九ョBALLOON蜻ス莉、繧剃スソ縺
+ this.listBalloon.Clear();
+ this.listBalloon_Normal.Clear();
+ this.listBalloon_Expert.Clear();
+ this.listBalloon_Master.Clear();
+ this.listBalloon_Normal_謨ー蛟、邂。逅 = 0;
+ this.listBalloon_Expert_謨ー蛟、邂。逅 = 0;
+ this.listBalloon_Master_謨ー蛟、邂。逅 = 0;
+ }
+
+ for (int i = 0; i < strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ.Length; i++)
+ {
+ if (!String.IsNullOrEmpty(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i]))
+ {
+ this.t髮」譏灘コヲ蛻・繝倥ャ繝(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i]);
+ }
+ }
+ for (int i = 0; i < str蜻ス莉、豸亥悉隴憺擇.Length; i++)
+ {
+ if (str蜻ス莉、豸亥悉隴憺擇[i].IndexOf(',', 0) == -1 && !String.IsNullOrEmpty(str蜻ス莉、豸亥悉隴憺擇[i]))
+ {
+ if (str蜻ス莉、豸亥悉隴憺擇[i].Substring(0, 1) == "#")
+ {
+ this.t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医@縺ヲ繝ェ繧ケ繝医↓霑ス蜉縺吶k(str + str蜻ス莉、豸亥悉隴憺擇[i]);
+ }
+
+ if (this.CharConvertNote(str蜻ス莉、豸亥悉隴憺擇[i].Substring(0, 1)) != -1)
+ str += str蜻ス莉、豸亥悉隴憺擇[i];
+ }
+ else
+ {
+ this.t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医@縺ヲ繝ェ繧ケ繝医↓霑ス蜉縺吶k(str + str蜻ス莉、豸亥悉隴憺擇[i]);
+ str = "";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Trace.TraceError(ex.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (9e401212-0b78-4073-88d0-f7e791f36a91)");
+ }
+
+ //if( bLog && stream != null )
+ //{
+ // stream.WriteLine( "-------------------------------------------------" );
+ // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇 (蜻ス莉、豸亥悉縺励◆蠕)" );
+ // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ )
+ // {
+ // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] );
+ // }
+ // stream.WriteLine( "-------------------------------------------------" );
+ //}
+
+ //隱ュ縺ソ霎シ縺ソ驛ィ蛻譛ャ菴薙↓貂。縺呵ュ憺擇繧剃ス懈舌
+ //0:繝倥ャ繝繝シ諠蝣ア 1:#START莉・髯 縺ィ縺ェ繧九ょ区焚縺ョ螳夂セゥ縺ッ蠕後°繧峨&繧後k縺溘a縲√%縺薙〒縺ッ逵∫払縲
+ var strSplit縺励◆蠕後ョ隴憺擇 = strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ; //strSplit縺励◆隴憺擇[ n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ ].Split( this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries );
+ strSplit縺励◆蠕後ョ隴憺擇 = this.t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(strSplit縺励◆蠕後ョ隴憺擇, 1);
+ //string str蜻ス莉、豸亥悉隴憺擇temp = this.StringArrayToString( this.str蜻ス莉、豸亥悉隴憺擇 );
+ //string[] strDelimiter = { "," };
+ //this.str蜻ス莉、豸亥悉隴憺擇 = str蜻ス莉、豸亥悉隴憺擇temp.Split( strDelimiter, StringSplitOptions.RemoveEmptyEntries );
+
+ //if( bLog && stream != null )
+ //{
+ // stream.WriteLine( "-------------------------------------------------" );
+ // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇 (Split縺励◆蠕)" );
+ // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ )
+ // {
+ // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] );
+ // }
+ // stream.WriteLine( "-------------------------------------------------" );
+ //}
+
+ this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = 1;
+ try
+ {
+ #region[ 譛蛻昴ョ蜃ヲ逅 ]
+ //1蟆冗ッ縺ョ譎る俣繧呈諺蜈・縺励※髢句ァ区凾髢薙r隱ソ遽縲
+ this.dbNowTime += ((15000.0 / 120.0 * (4.0 / 4.0)) * 16.0);
+ //this.dbNowBMScollTime += (( this.dbBarLength ) * 16.0 );
+ #endregion
+ //string strWrite = "";
+ for (int i = 0; strSplit縺励◆蠕後ョ隴憺擇.Length > i; i++)
+ {
+ str = strSplit縺励◆蠕後ョ隴憺擇[i];
+ //strWrite += str;
+ //if( !str.StartsWith( "#" ) && !string.IsNullOrEmpty( this.strTemp ) )
+ //{
+ // str = this.strTemp + str;
+ //}
+
+ this.t蜈・蜉媽陦瑚ァ」譫占ュ憺擇_V4(str);
+
+ if (!String.IsNullOrEmpty(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i]))
+ this.tDanExamLoad(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i]);
+ }
+ }
+ catch (Exception ex)
+ {
+ Trace.TraceError(ex.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (2da1e880-6b63-4e82-b018-bf18c3568335)");
+ }
+ //if( stream != null )
+ //{
+ // stream.Flush();
+ // stream.Close();
+ //}
+ #endregion
+ }
+ }
+
+ private CChip t逋コ螢ー菴咲スョ縺九i驕主悉譁ケ蜷代〒荳逡ェ霑代¥縺ォ縺ゅk謖螳壹メ繝」繝ウ繝阪Ν縺ョ繝√ャ繝励r霑斐☆(int n逋コ螢ー譎ょ綾, int n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ //驕主悉譁ケ蜷代∈縺ョ讀懃エ「
+ for (int i = this.listChip.Count - 1; i >= 0; i--)
+ {
+ if (this.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ return this.listChip[i];
+ }
+ }
+
+ return null;
+ }
+
+ //迴セ蝨ィ縲∽サ・荳九ョ繧医≧縺ェ陦後↓縺ッ蟇セ蠢懊〒縺阪※縺縺セ縺帙s縲
+ //_繝代Λ繝。繝シ繧ソ繧呈戟縺、蜻ス莉、縺後≠繧
+ //_陦後ョ騾比クュ縺ォ蜻ス莉、縺後≠繧
+ private int t譁蟄玲焚隗」譫(string InputText)
+ {
+ int n譁蟄玲焚 = 0;
+
+ for (int i = 0; i < InputText.Length; i++)
+ {
+ if (this.CharConvertNote(InputText.Substring(i, 1)) != -1)
+ {
+ n譁蟄玲焚++;
+ }
+ }
+
+
+ return n譁蟄玲焚;
+ }
+
+ private static readonly Regex CommandAndArgumentRegex =
+ new Regex(@"^(#[A-Z]+)(?:\s?)(.+?)?$", RegexOptions.Compiled);
+
+ private static readonly Regex BranchStartArgumentRegex =
+ new Regex(@"^([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)$", RegexOptions.Compiled);
+
+ private string[] SplitComma(string input)
+ {
+ var result = new List();
+ var workingIndex = 0;
+ for (int i = 0; i < input.Length; i++)
+ {
+ if (input[i].Equals(',')) // 繧ォ繝ウ繝槭↓縺カ縺。蠖薙◆縺」縺
+ {
+ if (i - 1 >= 0)// &&貍皮ョ怜ュ舌〒繧ゅ∽セ句、悶′襍キ縺阪k縺ョ縺ァ...
+ {
+ if (input[i - 1].Equals('\\')) // 1譁蟄怜燕縺後ヰ繝繧ッ繧ケ繝ゥ繝繧キ繝・
+ {
+ input = input.Remove(i - 1, 1);
+ }
+ else
+ {
+ // workingIndex縺九i莉翫ョ菴咲スョ縺セ縺ァ繧偵Μ繧ケ繝医↓繝悶メ霎シ繧
+ result.Add(input.Substring(workingIndex, i - workingIndex));
+ // workingIndex縺ォ莉翫ョ菴咲スョ+1繧剃サ」蜈・
+ workingIndex = i + 1;
+ }
+ }
+ else
+ {
+ // workingIndex縺九i莉翫ョ菴咲スョ縺セ縺ァ繧偵Μ繧ケ繝医↓繝悶メ霎シ繧
+ result.Add(input.Substring(workingIndex, i - workingIndex));
+ // workingIndex縺ォ莉翫ョ菴咲スョ+1繧剃サ」蜈・
+ workingIndex = i + 1;
+ }
+ }
+ if (i + 1 == input.Length) // 譛蠕後↓
+ {
+ result.Add(input.Substring(workingIndex, input.Length - workingIndex));
+ }
+ }
+ return result.ToArray();
+ }
+
+ ///
+ /// 隴憺擇隱ュ縺ソ霎シ縺ソ繝。繧ス繝繝鰻4縺ァ菴ソ逕ィ縲
+ ///
+ ///
+ private void t蜻ス莉、繧呈諺蜈・縺吶k(string InputText)
+ {
+ string[] SplitComma(string input)
+ {
+ var result = new List();
+ var workingIndex = 0;
+ for (int i = 0; i < input.Length; i++)
+ {
+ if (input[i] == ',') // 繧ォ繝ウ繝槭↓縺カ縺。蠖薙◆縺」縺
+ {
+ if (input[i - 1] == '\\') // 1譁蟄怜燕縺後ヰ繝繧ッ繧ケ繝ゥ繝繧キ繝・
+ {
+ input = input.Remove(i - 1, 1);
+ }
+ else
+ {
+ // workingIndex縺九i莉翫ョ菴咲スョ縺セ縺ァ繧偵Μ繧ケ繝医↓繝悶メ霎シ繧
+ result.Add(input.Substring(workingIndex, i - workingIndex));
+ // workingIndex縺ォ莉翫ョ菴咲スョ+1繧剃サ」蜈・
+ workingIndex = i + 1;
+ }
+ }
+ if (i + 1 == input.Length) // 譛蠕後↓
+ {
+ result.Add(input.Substring(workingIndex, input.Length - workingIndex));
+ }
+ }
+ return result.ToArray();
+ }
+
+
+ var match = CommandAndArgumentRegex.Match(InputText);
+ if (!match.Success)
+ {
+ return;
+ }
+
+ var command = match.Groups[1].Value;
+ var argumentMatchGroup = match.Groups[2];
+ var argument = argumentMatchGroup.Success ? argumentMatchGroup.Value : null;
+
+ while (true)
+ {//蜻ス莉、縺ョ譛蠕後↓,縺梧ョ九▲縺ヲ縺励∪縺」縺ヲ縺繧九→縺阪ョ蟇セ蠢
+ if (argument != null && argument[argument.Length - 1] == ',')
+ argument = argument.Substring(0, argument.Length - 1);
+ else
+ break;
+ }
+
+ char[] chDelimiter = new char[] { ' ' };
+ string[] strArray = null;
+
+ if (command == "#START")
+ {
+ //#START縺ィ蜷梧凾縺ォ魑エ繧峨☆縺ョ縺ッ縺ゥ縺縺九→諤昴≧縺代←縺励c繝シ縺ェ縺励□縺ェ縲
+ AddMusicPreTimeMs(); // 髻ウ貅舌r魑エ繧峨☆蜑阪↓驕蟒カ縲
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x01;
+ chip.n逋コ螢ー菴咲スョ = 384;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.fBMSCROLLTime = this.dbNowBMScollTime;
+ chip.n謨エ謨ー蛟、 = 0x01;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+
+ // 繝√ャ繝励r驟咲スョ縲
+ this.listChip.Add(chip);
+
+ var chip1 = new CChip();
+ chip1.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x54;
+ //chip1.n逋コ螢ー菴咲スョ = 384;
+ //chip1.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ if (this.nMOVIEOFFSET == 0)
+ chip1.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ else
+ chip1.n逋コ螢ー譎ょ綾ms = (int)this.nMOVIEOFFSET;
+ chip1.dbBPM = this.dbNowBPM;
+ chip1.fNow_Measure_m = this.fNow_Measure_m;
+ chip1.fNow_Measure_s = this.fNow_Measure_s;
+ chip1.dbSCROLL = this.dbNowScroll;
+ chip1.n謨エ謨ー蛟、 = 0x01;
+ chip1.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ chip1.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.AVI;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip1);
+ }
+ else if (command == "#END")
+ {
+ //縺溘a縺励↓蜑イ繧願セシ繧縲
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xFF;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー + 2) * 384);
+ //chip.n逋コ螢ー譎ょ綾ms = (int)( this.dbNowTime + ((15000.0 / this.dbNowBPM * ( 4.0 / 4.0 )) * 16.0) * 2 );
+ chip.n逋コ螢ー譎ょ綾ms = (int)(this.dbNowTime + 1000); //2016.07.16 kairera0467 邨ゆコ譎ゅ°繧1遘貞セ後↓險ュ鄂ョ縺吶k繧医≧螟画峩縲
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、 = 0xFF;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ // 繝√ャ繝励r驟咲スョ縲
+
+ if(n蜿らァ荳ュ縺ョ髮」譏灘コヲ == (int)Difficulty.Dan)
+ {
+ for (int i = listChip.Count - 1; i >= 0; i--)
+ {
+ if (listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x18)
+ {
+ if (DanSongs.Number != 0)
+ {
+ Array.Resize(ref this.pDan_LastChip, this.pDan_LastChip.Length + 1);
+ this.pDan_LastChip[DanSongs.Number - 1] = listChip[i];
+ break;
+ }
+ }
+ }
+ }
+
+ this.listChip.Add(chip);
+ }
+
+ else if (command == "#BPMCHANGE")
+ {
+ double dbBPM = Convert.ToDouble(argument);
+ this.dbNowBPM = dbBPM;
+
+ this.listBPM.Add(this.n蜀驛ィ逡ェ蜿キBPM1to - 1, new CBPM() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbBPM蛟、 = dbBPM, bpm_change_time = this.dbNowTime, bpm_change_bmscroll_time = this.dbNowBMScollTime, bpm_change_course = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ });
+
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x08;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.fBMSCROLLTime = (float)this.dbNowBMScollTime;
+ chip.dbBPM = dbBPM;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+
+ var chip1 = new CChip();
+ chip1.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9C;
+ chip1.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ chip1.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip1.fBMSCROLLTime = (float)this.dbNowBMScollTime;
+ chip1.dbBPM = dbBPM;
+ chip1.dbSCROLL = this.dbNowScroll;
+ chip1.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip1);
+
+ this.n蜀驛ィ逡ェ蜿キBPM1to++;
+ }
+ else if (command == "#SCROLL")
+ {
+ //2016.08.13 kairera0467 隍邏謨ー繧ケ繧ッ繝ュ繝シ繝ォ繧ゅ←縺阪ョ繝繧ケ繝
+ if (argument.IndexOf('i') != -1)
+ {
+ //i縺悟・縺」縺ヲ縺縺溷エ蜷医∬、邏謨ー繧ケ繧ッ繝ュ繝シ繝ォ縺ィ縺ソ縺ェ縺吶
+
+ double[] dbComplexNum = new double[2];
+ this.tParsedComplexNumber(argument, ref dbComplexNum);
+
+ this.dbNowScroll = dbComplexNum[0];
+ this.dbNowScrollY = dbComplexNum[1];
+
+ this.listSCROLL.Add(this.n蜀驛ィ逡ェ蜿キSCROLL1to, new CSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbSCROLL蛟、 = dbComplexNum[0], dbSCROLL蛟、Y = dbComplexNum[1] });
+
+ switch (this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ)
+ {
+ case ECourse.eNormal:
+ this.dbNowSCROLL_Normal[0] = dbComplexNum[0];
+ this.dbNowSCROLL_Normal[1] = dbComplexNum[1];
+ break;
+ case ECourse.eExpert:
+ this.dbNowSCROLL_Expert[0] = dbComplexNum[0];
+ this.dbNowSCROLL_Expert[1] = dbComplexNum[1];
+ break;
+ case ECourse.eMaster:
+ this.dbNowSCROLL_Master[0] = dbComplexNum[0];
+ this.dbNowSCROLL_Master[1] = dbComplexNum[1];
+ break;
+ default:
+ this.dbNowSCROLL_Normal[0] = dbComplexNum[0];
+ this.dbNowSCROLL_Normal[1] = dbComplexNum[1];
+ break;
+ }
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9D;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to;
+ chip.dbSCROLL = dbComplexNum[0];
+ chip.dbSCROLL_Y = dbComplexNum[1];
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+ }
+ else
+ {
+ double dbSCROLL = Convert.ToDouble(argument);
+ this.dbNowScroll = dbSCROLL;
+ this.dbNowScrollY = 0.0;
+
+ this.listSCROLL.Add(this.n蜀驛ィ逡ェ蜿キSCROLL1to, new CSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbSCROLL蛟、 = dbSCROLL, dbSCROLL蛟、Y = 0.0 });
+
+ switch (this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ)
+ {
+ case ECourse.eNormal:
+ this.dbNowSCROLL_Normal[0] = dbSCROLL;
+ break;
+ case ECourse.eExpert:
+ this.dbNowSCROLL_Expert[0] = dbSCROLL;
+ break;
+ case ECourse.eMaster:
+ this.dbNowSCROLL_Master[0] = dbSCROLL;
+ break;
+ }
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9D;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to;
+ chip.dbSCROLL = dbSCROLL;
+ chip.dbSCROLL_Y = 0.0;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+ }
+
+
+
+
+ this.n蜀驛ィ逡ェ蜿キSCROLL1to++;
+ }
+ else if (command == "#MEASURE")
+ {
+ strArray = argument.Split(new char[] { '/' });
+ WarnSplitLength("#MEASURE subsplit", strArray, 2);
+
+ double[] dbLength = new double[2];
+ dbLength[0] = Convert.ToDouble(strArray[0]);
+ dbLength[1] = Convert.ToDouble(strArray[1]);
+
+ double db蟆冗ッ髟キ蛟咲紫 = dbLength[0] / dbLength[1];
+ this.dbBarLength = db蟆冗ッ髟キ蛟咲紫;
+ this.fNow_Measure_m = (float)dbLength[1];
+ this.fNow_Measure_s = (float)dbLength[0];
+
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x02;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.dbSCROLL = this.dbNowScroll;
+ chip.db螳滓焚蛟、 = db蟆冗ッ髟キ蛟咲紫;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+
+ //lbMaster.Items.Add( ";諡榊ュ仙、画峩 " + strArray[0] + "/" + strArray[1] );
+ }
+ else if (command == "#DELAY")
+ {
+ double nDELAY = (Convert.ToDouble(argument) * 1000.0);
+
+
+ this.listDELAY.Add(this.n蜀驛ィ逡ェ蜿キDELAY1to, new CDELAY() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キDELAY1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, nDELAY蛟、 = (int)nDELAY, delay_bmscroll_time = this.dbLastBMScrollTime, delay_bpm = this.dbNowBPM, delay_course = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ, delay_time = this.dbLastTime });
+
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDC;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ chip.db逋コ螢ー譎ょ綾ms = this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キDELAY1to;
+ chip.fBMSCROLLTime = this.dbNowBMScollTime;
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.dbNowTime += nDELAY;
+ this.dbNowBMScollTime += nDELAY * this.dbNowBPM / 15000;
+
+ this.listChip.Add(chip);
+ this.n蜀驛ィ逡ェ蜿キDELAY1to++;
+ }
+
+ else if (command == "#GOGOSTART")
+ {
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9E;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ chip.dbBPM = this.dbNowBPM;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ this.bGOGOTIME = true;
+
+ // 繝√ャ繝励r驟咲スョ縲
+ this.listChip.Add(chip);
+ }
+ else if (command == "#GOGOEND")
+ {
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9F;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.dbBPM = this.dbNowBPM;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ this.bGOGOTIME = false;
+
+ // 繝√ャ繝励r驟咲スョ縲
+ this.listChip.Add(chip);
+ }
+ else if (command == "#SECTION")
+ {
+ //蛻蟯:譚。莉カ繝ェ繧サ繝繝
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDD;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー - 1) * 384);
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ chip.db逋コ螢ー譎ょ綾ms = this.dbNowTime;
+ // 繝√ャ繝励r驟咲スョ縲
+ this.listChip.Add(chip);
+ }
+ else if (command == "#BRANCHSTART")
+ {
+ #region [ 隴憺擇蛻蟯舌ョ繝代シ繧ケ譁ケ豕輔r菴懊j逶エ縺 ]
+ this.b繝√ャ繝励′縺ゅk.Branch = true;
+ this.b譛蛻昴ョ蛻蟯舌〒縺ゅk = false;
+ this.b蛻蟯舌r荳蝗槭〒繧る幕蟋九@縺 = true;
+
+ //蛻蟯:蛻蟯舌せ繧ソ繝シ繝
+ E蛻蟯千ィョ鬘 e譚。莉カ;
+
+ //譚。莉カ謨ー蛟、縲
+ double[] nNum = new double[2];
+
+ //蜷榊燕縺ィ譚。莉カA縺ョ髢薙↓,縺檎┌縺縺ィ豁」蟶ク縺ォ蜍穂ス懊@縺ェ縺上↑繧.2020.04.23.akasoko26
+ #region [ 蜷榊燕縺ィ譚。莉カA縺ョ髢薙↓,縺檎┌縺縺ィ豁」蟶ク縺ォ蜍穂ス懊@縺ェ縺上↑繧 ]
+ //遨コ逋ス繧貞炎髯、縺吶k縲
+ argument = Regex.Replace(argument, @"\s", "");
+ //2譁蟄礼岼縺,縺区焚蛟、縺九r繝√ぉ繝繧ッ
+ var IsNumber = bIsNumber(argument[1]);
+ //IsNumber == true 縺ァ縺ゅ▲縺溘i,縺檎┌縺縺ィ縺縺縺薙→縺ェ縺ョ縺ァ,繧2譁蟄礼岼縺ォ縺カ縺。霎シ繧繝サ繝サ繝サ
+ if (IsNumber)
+ argument = argument.Insert(1, ",");
+ #endregion
+
+ var branchStartArgumentMatch = BranchStartArgumentRegex.Match(argument);
+ nNum[0] = Convert.ToDouble(branchStartArgumentMatch.Groups[2].Value);
+ nNum[1] = Convert.ToDouble(branchStartArgumentMatch.Groups[3].Value);
+
+ switch (branchStartArgumentMatch.Groups[1].Value)
+ {
+ case "p":
+ e譚。莉カ = E蛻蟯千ィョ鬘.e邊セ蠎ヲ蛻蟯;
+ break;
+ case "r":
+ e譚。莉カ = E蛻蟯千ィョ鬘.e騾」謇灘蟯;
+ break;
+ case "s":
+ e譚。莉カ = E蛻蟯千ィョ鬘.e繧ケ繧ウ繧「蛻蟯;
+ break;
+ case "d":
+ e譚。莉カ = E蛻蟯千ィョ鬘.e螟ァ髻ウ隨ヲ縺ョ縺ソ邊セ蠎ヲ蛻蟯;
+ break;
+ default:
+ e譚。莉カ = E蛻蟯千ィョ鬘.e邊セ蠎ヲ蛻蟯;
+ break;
+ }
+
+ #region [ 蛻蟯宣幕蟋区凾縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸 ]
+ //迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k蠢隕√′縺ゅk縲
+ this.t迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k(true);
+ #endregion
+
+ #region [ 荳蟆冗ッ蜑阪ョ蛻蟯宣幕蟋気hip ]
+ //16蛻蜑阪↓謌サ縺呵ィ育ョ励↑繧薙°蠖薙※縺ォ縺励■繧縺繧√h縲ゅ(by Akasoko)
+ var c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア = c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆(listChip, e譚。莉カ);
+ CChip c蟆冗ッ蜑阪ョ騾」謇馴幕蟋倶ス咲スョ = null;
+
+ var chip = new CChip();
+
+ if (e譚。莉カ == E蛻蟯千ィョ鬘.e騾」謇灘蟯)
+ {
+ /*
+ c蟆冗ッ蜑阪ョ騾」謇馴幕蟋倶ス咲スョ = c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆(listChip, e譚。莉カ, true);
+ //騾」謇灘蟯舌ョ菴咲スョ繧貞咲樟
+ //縺薙ョ險育ョ怜シ上ッ縺ゅ※縺ォ縺ェ繧峨↑縺縺ィ諤昴≧縺後√∪縺ゅ←縺縺励h縺繧ゅ↑縺繧薙〒縺薙l縺ァ
+ //縺ェ繧九∋縺城」謇薙ョ繧ア繝縺ョ驛ィ蛻縺ォ
+ var f騾」謇薙ョ髟キ縺輔ョ蜊雁 = (c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.n逋コ螢ー譎ょ綾ms - c蟆冗ッ蜑阪ョ騾」謇馴幕蟋倶ス咲スョ.n逋コ螢ー譎ょ綾ms) / 2.0f;
+ */
+
+ chip.n逋コ螢ー譎ょ綾ms = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.n逋コ螢ー譎ょ綾ms;
+ }
+ else chip.n逋コ螢ー譎ょ綾ms = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.n逋コ螢ー譎ょ綾ms;
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDE;
+ chip.fNow_Measure_m = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.fNow_Measure_m;
+ chip.fNow_Measure_s = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.fNow_Measure_s;
+
+ //繝弱シ繝 * 0.5蛻蠕後m縺ォ縺励※縲√ヮ繝シ繝縺梧ョ九i縺ェ縺繧医≧縺ォ縺吶k
+ chip.n蛻蟯先凾蛻サms = this.dbNowTime - ((15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m)) * 0.5);
+ chip.e蛻蟯舌ョ遞ョ鬘 = e譚。莉カ;
+ chip.n譚。莉カ謨ー蛟、A = nNum[0];// list縺ォ霑ス蜉縺励※縺縺溘′莉墓ァ倥r螟画峩縲
+ chip.n譚。莉カ謨ー蛟、B = nNum[1];// ""
+ chip.dbSCROLL = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.dbSCROLL;
+ chip.dbBPM = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.dbBPM;
+ this.listChip.Add(chip);
+ #endregion
+
+ for (int i = 0; i < 3; i++)
+ IsBranchBarDraw[i] = true;//3繧ウ繝シ繧ケ蛻縺ョ鮟濶イ蟆剰ェャ邱夊。ィ遉コ繼ォ繝ゥ繝
+
+ IsEndedBranching = false;
+ #endregion
+ }
+ else if (command == "#N" || command == "#E" || command == "#M")//縺薙lCourse繧貞ィ驛ィ髮繧√※縺ゅ→縺九i蛻蟯舌&縺帙l縺ー縺縺莉カ
+ {
+ //髢句ァ区凾縺ョ諠蝣ア縺ォ繧サ繝繝
+ t迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k(false);
+
+ if (command == "#N")
+ this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eNormal;//蛻蟯:譎ョ騾夊ュ憺擇
+ else if (command == "#E")
+ this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eExpert;//蛻蟯:邇莠コ隴憺擇
+ else if (command == "#M")
+ this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eMaster;//蛻蟯:驕比ココ隴憺擇
+ }
+ else if (command == "#LEVELHOLD")
+ {
+ var chip = new CChip();
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE1;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+
+ this.listChip.Add(chip);
+ }
+ else if (command == "#BRANCHEND")
+ {
+ var GoBranch = new CChip();
+
+ //End逕ィ繝√Ε繝ウ繝阪Ν繧脱mpty縺九i蠑輔▲蠑オ縺」縺ヲ縺阪◆縲
+ GoBranch.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x52;
+ GoBranch.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ GoBranch.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ GoBranch.fNow_Measure_m = this.fNow_Measure_m;
+ GoBranch.fNow_Measure_s = this.fNow_Measure_s;
+ GoBranch.dbSCROLL = this.dbNowScroll;
+ GoBranch.dbBPM = this.dbNowBPM;
+ GoBranch.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+
+ this.listChip.Add(GoBranch);
+
+ //End譎ゅ↓繧るサ濶イ縺蟆冗ッ邱壹≠縺」縺溘∋シ
+ for (int i = 0; i < 3; i++)
+ IsBranchBarDraw[i] = true;//3繧ウ繝シ繧ケ蛻縺ョ鮟濶イ蟆剰ェャ邱夊。ィ遉コ繼ォ繝ゥ繝
+
+ IsEndedBranching = true;
+ }
+ else if (command == "#BARLINEOFF")
+ {
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE0;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime + 1;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+ this.bBARLINECUE[0] = 1;
+
+ this.listChip.Add(chip);
+ }
+ else if (command == "#BARLINEON")
+ {
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE0;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime + 1;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 2;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+ this.bBARLINECUE[0] = 0;
+
+ this.listChip.Add(chip);
+ }
+ else if (command == "#LYRIC")
+ {
+ if (TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ)//襍キ蜍墓凾縺ォ驥阪◆縺上↑縺」縺ヲ縺励∪縺蝠城。後ョ菫ョ豁」逕ィ
+ this.listLyric.Add(this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝.DrawPrivateFont(argument, TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.Skin.Game_Lyric_BackColor));
+
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xF1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+ this.bLyrics = true;
+ }
+ else if (command == "#DIRECTION")
+ {
+ double dbSCROLL = Convert.ToDouble(argument);
+ this.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = (int)dbSCROLL;
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xF2;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0;
+ chip.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = (int)dbSCROLL;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+ }
+ else if (command == "#SUDDEN")
+ {
+ strArray = argument.Split(chDelimiter);
+ WarnSplitLength("#SUDDEN", strArray, 2);
+ double db蜃コ迴セ譎ょ綾 = Convert.ToDouble(strArray[0]);
+ double db遘サ蜍募セ讖滓凾蛻サ = Convert.ToDouble(strArray[1]);
+ this.db蜃コ迴セ譎ょ綾 = db蜃コ迴セ譎ょ綾;
+ this.db遘サ蜍募セ讖滓凾蛻サ = db遘サ蜍募セ讖滓凾蛻サ;
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xF3;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0;
+ chip.n繝弱シ繝蜃コ迴セ譎ょ綾ms = (int)this.db蜃コ迴セ譎ょ綾;
+ chip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms = (int)this.db遘サ蜍募セ讖滓凾蛻サ;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+ }
+ else if (command == "#JPOSSCROLL")
+ {
+ strArray = argument.Split(chDelimiter);
+ WarnSplitLength("#JPOSSCROLL", strArray, 3);
+ double db遘サ蜍墓凾蛻サ = Convert.ToDouble(strArray[0]);
+ int n遘サ蜍頻x = Convert.ToInt32(strArray[1]);
+ int n遘サ蜍墓婿蜷 = Convert.ToInt32(strArray[2]);
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE2;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listJPOSSCROLL.Add(this.n蜀驛ィ逡ェ蜿キJSCROLL1to, new CJPOSSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キJSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, db遘サ蜍墓凾髢 = db遘サ蜍墓凾蛻サ, n遘サ蜍戊キ晞屬px = n遘サ蜍頻x, n遘サ蜍墓婿蜷 = n遘サ蜍墓婿蜷 });
+ this.listChip.Add(chip);
+ this.n蜀驛ィ逡ェ蜿キJSCROLL1to++;
+ }
+ else if (command == "#SENOTECHANGE")
+ {
+ FixSENote = int.Parse(argument);
+ IsEnabledFixSENote = true;
+ }
+ else if (command == "#NEXTSONG")
+ {
+ var delayTime = 6200.0; // 6.2遘偵ョ繧」繝ャ繧、
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9B;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ this.dbNowTime += delayTime;
+ this.dbNowBMScollTime += delayTime * this.dbNowBPM / 15000;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0;
+ chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ // 繝√ャ繝励r驟咲スョ縲
+ this.listChip.Add(chip);
+
+ AddMusicPreTimeMs(); // 谿オ菴阪ョ蟷輔′髢九>縺ヲ縺九i縺ョ驕蟒カ縲
+
+ strArray = SplitComma(argument); // \,繧偵お繧ケ繧ア繝シ繝怜ヲ逅縺吶k繝。繧ス繝繝峨□縺槭▲
+
+ for (int i = listChip.Count - 1; i >= 0; i--)
+ {
+ if (listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x18)
+ {
+ if(DanSongs.Number != 0)
+ {
+ Array.Resize(ref this.pDan_LastChip, this.pDan_LastChip.Length + 1);
+ this.pDan_LastChip[DanSongs.Number - 1] = listChip[i];
+ break;
+ }
+ }
+ }
+
+ WarnSplitLength("#NEXTSONG", strArray, 8);
+ var dansongs = new DanSongs();
+ dansongs.Title = strArray[0];
+ dansongs.SubTitle = strArray[1];
+ dansongs.Genre = strArray[2];
+ dansongs.FileName = strArray[3];
+ dansongs.ScoreInit = int.Parse(strArray[4]);
+ dansongs.ScoreDiff = int.Parse(strArray[5]);
+
+ if (strArray.Length >= 7 && strArray[6] != "" && strArray[6] != null)
+ dansongs.Level = int.Parse(strArray[6]);
+ else if (strArray.Length < 7)
+ dansongs.Level = 10;
+
+ if (strArray.Length >= 8 && strArray[7] != "" && strArray[7] != null)
+ dansongs.Difficulty = strConvertCourse(strArray[7]);
+ else if (strArray.Length < 8)
+ dansongs.Difficulty = 3;
+
+ if (strArray.Length == 9 && strArray[8] != "" && strArray[8] != null)
+ dansongs.bTitleShow = bool.Parse(strArray[8]);
+ else if (strArray.Length < 9)
+ dansongs.bTitleShow = false;
+
+ dansongs.Wave = new CWAV
+ {
+ n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キWAV1to,
+ n陦ィ險倅ク翫ョ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キWAV1to,
+ n繝√ャ繝励し繧、繧コ = this.n辟。髯千ョ。逅SIZE[this.n蜀驛ィ逡ェ蜿キWAV1to],
+ n菴咲スョ = this.n辟。髯千ョ。逅PAN[this.n蜀驛ィ逡ェ蜿キWAV1to],
+ SongVol = this.SongVol,
+ SongLoudnessMetadata = this.SongLoudnessMetadata,
+ str繝輔ぃ繧、繝ォ蜷 = CDTXCompanionFileFinder.FindFileName(this.str繝輔か繝ォ繝蜷, str繝輔ぃ繧、繝ォ蜷, dansongs.FileName),
+ str繧ウ繝。繝ウ繝域枚 = "TJA BGM"
+ };
+ dansongs.Wave.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(dansongs.Wave.str繝輔ぃ繧、繝ォ蜷);
+ List_DanSongs.Add(dansongs);
+ this.listWAV.Add(this.n蜀驛ィ逡ェ蜿キWAV1to, dansongs.Wave);
+ this.n蜀驛ィ逡ェ蜿キWAV1to++;
+
+ var nextSongnextSongChip = new CChip();
+
+ nextSongnextSongChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x01;
+ nextSongnextSongChip.n逋コ螢ー菴咲スョ = 384;
+ nextSongnextSongChip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ nextSongnextSongChip.fNow_Measure_m = this.fNow_Measure_m;
+ nextSongnextSongChip.fNow_Measure_s = this.fNow_Measure_s;
+ nextSongnextSongChip.n謨エ謨ー蛟、 = 0x01;
+ nextSongnextSongChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1 + List_DanSongs.Count;
+
+ this.listWAV[1].str繝輔ぃ繧、繝ォ蜷 = "";
+
+ // 繝√ャ繝励r驟咲スョ縲
+ this.listChip.Add(nextSongnextSongChip);
+
+ }
+ }
+ void t迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k(bool bInPut)
+ {
+ //2020.04.21 縺薙≧縺ェ縺」縺ヲ縺励∪縺」縺溘ョ縺ッ莉墓婿縺後↑縺縺ェ縲ゅ
+ if (bInPut)
+ {
+ #region [ 險倬鹸縺吶k ]
+ cBranchStart.dbTime = this.dbNowTime;
+ cBranchStart.dbSCROLL = this.dbNowScroll;
+ cBranchStart.dbSCROLLY = this.dbNowScrollY;
+ cBranchStart.dbBMScollTime = this.dbNowBMScollTime;
+ cBranchStart.dbBPM = this.dbNowBPM;
+ cBranchStart.fMeasure_s = this.fNow_Measure_s;
+ cBranchStart.fMeasure_m = this.fNow_Measure_m;
+ cBranchStart.nMeasureCount = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー;
+ cBranchStart.db遘サ蜍募セ讖滓凾蛻サ = this.db遘サ蜍募セ讖滓凾蛻サ;
+ cBranchStart.db蜀咲函騾溷コヲ = this.db蜀咲函騾溷コヲ;
+ cBranchStart.db蜃コ迴セ譎ょ綾 = this.db蜃コ迴セ譎ょ綾;
+ #endregion
+ }
+ else
+ {
+ #region [ 險倬鹸縺励◆諠蝣ア繧誰ow~縺ォ驕ゥ蠢 ]
+ this.dbNowTime = cBranchStart.dbTime;
+ this.dbNowScroll = cBranchStart.dbSCROLL;
+ this.dbNowScrollY = cBranchStart.dbSCROLLY;
+ this.dbNowBMScollTime = cBranchStart.dbBMScollTime;
+ this.dbNowBPM = cBranchStart.dbBPM;
+ this.fNow_Measure_s = cBranchStart.fMeasure_s;
+ this.fNow_Measure_m = cBranchStart.fMeasure_m;
+ this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = cBranchStart.nMeasureCount;
+ this.db遘サ蜍募セ讖滓凾蛻サ = cBranchStart.db遘サ蜍募セ讖滓凾蛻サ;
+ this.db蜀咲函騾溷コヲ = cBranchStart.db蜀咲函騾溷コヲ;
+ this.db蜃コ迴セ譎ょ綾 = cBranchStart.db蜃コ迴セ譎ょ綾;
+ #endregion
+ }
+ }
+
+ ///
+ /// 荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆Method 2020.04.21.akasoko26
+ ///
+ ///
+ ///
+ private CChip c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆(List listChips, E蛻蟯千ィョ鬘 e蛻蟯千ィョ鬘, bool b蛻蟯仙燕縺ョ騾」謇馴幕蟋 = false)
+ {
+ //2020.04.20 c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆Method繧定ソス蜉
+ //騾」謇灘蟯先凾縺ッ迴セ蝨ィ縺ョ蟆冗ッ莉・髯阪ョ騾」謇薙ョ邨ゅo繧企Κ蛻縺ョ譎ょ綾繧貞叙蠕励☆繧
+
+ int? nReturnChip = null;
+
+ //--縺励※蜿門セ励@縺ェ縺縺ィ縺繧√hス槭ム繝。繝繝。汳
+ for (int i = listChips.Count - 1; i >= 0; i--)
+ {
+ if (b蛻蟯仙燕縺ョ騾」謇馴幕蟋)
+ {
+ if (listChips[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || listChips[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16)
+ {
+ if (nReturnChip == null)
+ nReturnChip = i;
+
+ //ReturnChip縺系ull縺ァ縺ゅ▲縺溘i驕ゥ蠢
+ }
+ }
+ else
+ {
+ var Flag = e蛻蟯千ィョ鬘 == E蛻蟯千ィョ鬘.e騾」謇灘蟯 ? 0x18 : 0x50;
+
+ if (listChips[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == Flag)
+ {
+ if (nReturnChip == null)
+ nReturnChip = i;
+ //ReturnChip縺系ull縺ァ縺ゅ▲縺溘i驕ゥ蠢
+ }
+ }
+ }
+
+ //繧ゅ@縲]ReturnChip縺系ull縺縺」縺溘ilistChip縺ョCount - 1縺ォ繧サ繝繝医☆繧九
+ return listChips[nReturnChip == null ? listChips.Count - 1 : (int)nReturnChip];
+ }
+
+ private void WarnSplitLength(string name, string[] strArray, int minimumLength)
+ {
+ if (strArray.Length < minimumLength)
+ {
+ Trace.TraceWarning(
+ $"蜻ス莉、 {name} 縺ョ繝代Λ繝。繝シ繧ソ縺瑚カウ繧翫∪縺帙s縲ょー代↑縺上→繧 {minimumLength} 縺、縺ョ繝代Λ繝。繝シ繧ソ縺悟ソ隕√〒縺吶 (迴セ蝨ィ縺ョ繝代Λ繝。繝シ繧ソ謨ー: {strArray.Length}). ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})");
+ }
+ }
+
+ private void t蜈・蜉媽陦瑚ァ」譫占ュ憺擇_V4(string InputText)
+ {
+ if (!String.IsNullOrEmpty(InputText))
+ {
+ int n譁蟄玲焚 = 16;
+
+ //迴セ蝨ィ縺ョ繧ウ繝シ繧ケ縲∝ー冗ッ縺ォ蠖薙※縺ッ縺セ繧九b縺ョ繧偵Μ繧ケ繝医°繧画爾縺励※譁蟄玲焚繧定ソ斐☆縲
+ for (int i = 0; i < this.listLine.Count; i++)
+ {
+ if (this.listLine[i].n蟆冗ッ逡ェ蜿キ == this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー && this.listLine[i].n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ)
+ {
+ n譁蟄玲焚 = this.listLine[i].n譁蟄玲焚;
+ }
+
+ }
+
+ if (InputText.StartsWith("#"))
+ {
+ this.t蜻ス莉、繧呈諺蜈・縺吶k(InputText);
+ return;
+ }
+ else
+ {
+ if (this.b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 == false)
+ {
+ // 蟆冗ッ邱壹↓繧ゅd縺」縺ヲ縺ゅ£縺ェ縺縺ィ
+ // IsEndedBranching縺掲alse縺ァ1蝗
+ // true縺ァ3蝗槭□繧3蝗
+ for (int i = 0; i < (IsEndedBranching == true ? 3 : 1); i++)
+ {
+ CChip chip = new CChip();
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x50;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ chip.n謨エ謨ー蛟、 = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー;
+ chip.n譁蟄玲焚 = n譁蟄玲焚;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー;
+ chip.dbBPM = this.dbNowBPM;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.IsEndedBranching = IsEndedBranching;
+ chip.dbSCROLL = this.dbNowScroll;
+ chip.dbSCROLL_Y = this.dbNowScrollY;
+ chip.fBMSCROLLTime = (float)this.dbNowBMScollTime;
+
+ if (IsEndedBranching)
+ chip.n繧ウ繝シ繧ケ = (ECourse)i;
+ else
+ chip.n繧ウ繝シ繧ケ = n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ if (this.bBARLINECUE[0] == 1)
+ {
+ chip.b蜿ッ隕 = false;
+ }
+ #region [ 菴懊j逶エ縺 ]
+ if (IsEndedBranching)
+ {
+ if (this.IsBranchBarDraw[i])
+ chip.bBranch = true;
+ }
+ else
+ {
+ if (this.IsBranchBarDraw[(int)n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ])
+ chip.bBranch = true;
+ }
+ #endregion
+
+ this.listChip.Add(chip);
+
+ #region [ 菴懊j逶エ縺 ]
+ if (IsEndedBranching)
+ this.IsBranchBarDraw[i] = false;
+ else this.IsBranchBarDraw[(int)n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ] = false;
+ #endregion
+ }
+
+
+ this.dbLastTime = this.dbNowTime;
+ this.b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 = true;
+
+ #region[ 諡咲キ壹メ繝繝励ユ繧ケ繝 ]
+ //1諡阪ョ譎る俣繧定ィ育ョ
+ double db1諡 = (60.0 / this.dbNowBPM) / 4.0;
+ //for繝ォ繝シ繝(諡肴焚)
+ for (int measure = 1; measure < this.fNow_Measure_s; measure++)
+ {
+ CChip hakusen = new CChip();
+ hakusen.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384);
+ hakusen.n逋コ螢ー譎ょ綾ms = (int)(this.dbNowTime + (((db1諡 * 4.0)) * measure) * 1000.0);
+ hakusen.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x51;
+ //hakusen.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ hakusen.fBMSCROLLTime = this.dbNowBMScollTime;
+ hakusen.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー;
+ hakusen.n謨エ謨ー蛟、 = 0;
+ hakusen.dbBPM = this.dbNowBPM;
+ hakusen.dbSCROLL = this.dbNowScroll;
+ hakusen.fNow_Measure_m = this.fNow_Measure_m;
+ hakusen.fNow_Measure_s = this.fNow_Measure_s;
+ hakusen.dbSCROLL_Y = this.dbNowScrollY;
+ hakusen.n繧ウ繝シ繧ケ = n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ this.listChip.Add(hakusen);
+ //--蜈ィ縺ヲ縺ョ諡咲キ壹ョ譎る俣繧貞コ蜉帙☆繧--
+ //Trace.WriteLine( string.Format( "|| {0,3:##0} Time:{1} Beat:{2}", this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー, hakusen.n逋コ螢ー譎ょ綾ms, measure ) );
+ //--------------------------------
+ }
+
+ #endregion
+
+ }
+
+ for (int n = 0; n < InputText.Length; n++)
+ {
+ if (InputText.Substring(n, 1) == ",")
+ {
+ this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー++;
+ this.b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 = false;
+ return;
+ }
+
+ if (InputText.Substring(0, 1) == "F")
+ {
+ bool bTest = true;
+ }
+
+
+ int nObjectNum = this.CharConvertNote(InputText.Substring(n, 1));
+
+ if (nObjectNum != 0)
+ {
+ if ((nObjectNum >= 5 && nObjectNum <= 7) || nObjectNum == 9)
+ {
+ if (nNowRoll != 0)
+ {
+ this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n譁蟄玲焚));
+ this.dbNowBMScollTime += (double)((this.dbBarLength) * (16.0 / n譁蟄玲焚));
+ continue;
+ }
+ else
+ {
+ this.nNowRollCount = listChip.Count;
+ nNowRoll = nObjectNum;
+ }
+ }
+
+ // IsEndedBranching縺掲alse縺ァ1蝗
+ // true縺ァ3蝗槭□繧3蝗
+ for (int i = 0; i < (IsEndedBranching == true ? 3 : 1); i++)
+ {
+ var chip = new CChip();
+ chip.IsMissed = false;
+ chip.bHit = false;
+ chip.b蜿ッ隕 = true;
+ chip.bShow = true;
+ chip.bShowRoll = true;
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x10 + nObjectNum;
+ //chip.n逋コ螢ー菴咲スョ = (this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384) + ((384 * n) / n譁蟄玲焚);
+ chip.n逋コ螢ー菴咲スョ = (int)((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384.0) + ((384.0 * n) / n譁蟄玲焚));
+ chip.db逋コ螢ー菴咲スョ = this.dbNowTime;
+ chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime;
+ //chip.fBMSCROLLTime = (float)(( this.dbBarLength ) * (16.0f / this.n蜷蟆冗ッ縺ョ譁蟄玲焚[this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー]));
+ chip.fBMSCROLLTime = (float)this.dbNowBMScollTime;
+ chip.n謨エ謨ー蛟、 = nObjectNum;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+ chip.IsEndedBranching = IsEndedBranching;
+ chip.fNow_Measure_m = this.fNow_Measure_m;
+ chip.fNow_Measure_s = this.fNow_Measure_s;
+ chip.dbBPM = this.dbNowBPM;
+ chip.dbSCROLL = this.dbNowScroll;
+ chip.dbSCROLL_Y = this.dbNowScrollY;
+ chip.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = this.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷;
+
+ if (IsEndedBranching)
+ chip.n繧ウ繝シ繧ケ = (ECourse)i;
+ else
+ chip.n繧ウ繝シ繧ケ = n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ;
+
+ chip.n蛻蟯仙屓謨ー = this.n蜀驛ィ逡ェ蜿キBRANCH1to;
+ chip.e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.TAIKO;
+ chip.n繝弱シ繝蜃コ迴セ譎ょ綾ms = (int)(this.db蜃コ迴セ譎ょ綾 * 1000.0);
+ chip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms = (int)(this.db遘サ蜍募セ讖滓凾蛻サ * 1000.0);
+ chip.nPlayerSide = this.nPlayerSide;
+ chip.bGOGOTIME = this.bGOGOTIME;
+
+ if (nObjectNum == 7 || nObjectNum == 9)
+ {
+ //this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ繧痴witch縺ァ蛻蟯舌@縺ヲ縺縺溘◆繧鬚ィ闊ケ縺ョ蛟、縺後≧縺セ縺丞牡繧雁ス薙※繧峨l縺ヲ縺縺ェ縺 2020.04.21 akasoko26
+
+ switch (chip.n繧ウ繝シ繧ケ)
+ {
+ case ECourse.eNormal:
+ if (this.listBalloon_Normal.Count == 0)
+ {
+ chip.nBalloon = 5;
+ break;
+ }
+
+ if (this.listBalloon_Normal.Count > this.listBalloon_Normal_謨ー蛟、邂。逅)
+ {
+ chip.nBalloon = this.listBalloon_Normal[this.listBalloon_Normal_謨ー蛟、邂。逅];
+ this.listBalloon_Normal_謨ー蛟、邂。逅++;
+ break;
+ }
+ //else if( this.listBalloon.Count != 0 )
+ //{
+ // chip.nBalloon = this.listBalloon[ this.listBalloon_Normal_謨ー蛟、邂。逅 ];
+ // this.listBalloon_Normal_謨ー蛟、邂。逅++;
+ // break;
+ //}
+ break;
+ case ECourse.eExpert:
+ if (this.listBalloon_Expert.Count == 0)
+ {
+ chip.nBalloon = 5;
+ break;
+ }
+
+ if (this.listBalloon_Expert.Count > this.listBalloon_Expert_謨ー蛟、邂。逅)
+ {
+ chip.nBalloon = this.listBalloon_Expert[this.listBalloon_Expert_謨ー蛟、邂。逅];
+ this.listBalloon_Expert_謨ー蛟、邂。逅++;
+ break;
+ }
+ //else if( this.listBalloon.Count != 0 )
+ //{
+ // chip.nBalloon = this.listBalloon[ this.listBalloon_Normal_謨ー蛟、邂。逅 ];
+ // this.listBalloon_Normal_謨ー蛟、邂。逅++;
+ // break;
+ //}
+ break;
+ case ECourse.eMaster:
+ if (this.listBalloon_Master.Count == 0)
+ {
+ chip.nBalloon = 5;
+ break;
+ }
+
+ if (this.listBalloon_Master.Count > this.listBalloon_Master_謨ー蛟、邂。逅)
+ {
+ chip.nBalloon = this.listBalloon_Master[this.listBalloon_Master_謨ー蛟、邂。逅];
+ this.listBalloon_Master_謨ー蛟、邂。逅++;
+ break;
+ }
+ //else if( this.listBalloon.Count != 0 )
+ //{
+ // chip.nBalloon = this.listBalloon[ this.listBalloon_Normal_謨ー蛟、邂。逅 ];
+ // this.listBalloon_Normal_謨ー蛟、邂。逅++;
+ // break;
+ //}
+ break;
+ }
+ }
+ if (nObjectNum == 8)
+ {
+ chip.n繝弱シ繝邨ゆコ菴咲スョ = (this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384) + ((384 * n) / n譁蟄玲焚);
+ chip.n繝弱シ繝邨ゆコ譎ょ綾ms = (int)this.dbNowTime;
+ chip.fBMSCROLLTime_end = (float)this.dbNowBMScollTime;
+
+ chip.n繝弱シ繝蜃コ迴セ譎ょ綾ms = listChip[nNowRollCount].n繝弱シ繝蜃コ迴セ譎ょ綾ms;
+ chip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms = listChip[nNowRollCount].n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms;
+
+ chip.n騾」謇馴浹隨ヲState = nNowRoll;
+ listChip[nNowRollCount].n繝弱シ繝邨ゆコ菴咲スョ = (this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384) + ((384 * n) / n譁蟄玲焚);
+ listChip[nNowRollCount].n繝弱シ繝邨ゆコ譎ょ綾ms = (int)this.dbNowTime;
+ listChip[nNowRollCount].fBMSCROLLTime_end = (int)this.dbNowBMScollTime;
+ //listChip[ nNowRollCount ].dbBPM = this.dbNowBPM;
+ //listChip[ nNowRollCount ].dbSCROLL = this.dbNowSCROLL;
+ nNowRoll = 0;
+ //continue;
+ }
+
+ if (IsEnabledFixSENote)
+ {
+ chip.IsFixedSENote = true;
+ chip.nSenote = FixSENote - 1;
+ }
+
+ #region[ 蝗コ螳壹&繧後k遞ョ鬘槭ョsenotes縺ッ縺薙%縺ァ險ュ螳壹@縺ヲ縺翫¥縲 ]
+ switch (nObjectNum)
+ {
+ case 3:
+ chip.nSenote = 5;
+ break;
+ case 4:
+ chip.nSenote = 6;
+ break;
+ case 5:
+ chip.nSenote = 7;
+ break;
+ case 6:
+ chip.nSenote = 0xA;
+ break;
+ case 7:
+ chip.nSenote = 0xB;
+ break;
+ case 8:
+ chip.nSenote = 0xC;
+ break;
+ case 9:
+ chip.nSenote = 0xD;
+ break;
+ case 10:
+ chip.nSenote = 0xE;
+ break;
+ case 11:
+ chip.nSenote = 0xF;
+ break;
+ }
+ #endregion
+
+ if (nObjectNum < 5)
+ {
+ #region [ 菴懊j逶エ縺 ]
+ //隴憺擇蛻蟯舌′縺ェ縺隴憺擇縺ァ繧ょ、縺ッ蜉邂励&繧後※縺励∪縺縺後@繧縺ゅ↑縺
+ //蛻蟯舌r髢句ァ九@縺ェ縺髢薙ッ蜈ア騾夊ュ憺擇縺ィ縺励※縺ソ縺ェ縺吶
+ if (IsEndedBranching)
+ this.n繝弱シ繝謨ー_Branch[i]++;
+ else this.n繝弱シ繝謨ー_Branch[(int)chip.n繧ウ繝シ繧ケ]++;
+
+ if (!IsEndedBranching && !this.b蛻蟯舌r荳蝗槭〒繧る幕蟋九@縺)
+ {
+ //IsEndedBranching==false = forloop縺瑚。後o繧後※縺縺ェ縺縺ィ縺阪ョ縺ソ
+ for (int l = 0; l < 3; l++)
+ this.n繝弱シ繝謨ー_Branch[l]++;
+ }
+
+
+ if(this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ == (int)Difficulty.Dan)
+ this.nDan_NotesCount[DanSongs.Number - 1]++;
+
+ this.n繝弱シ繝謨ー[3]++;
+ #endregion
+ }
+ else if (nObjectNum == 7)
+ {
+ //鬚ィ闊ケ縺ッ縺薙ョ縺セ縺セ縺ァ繧よゥ溯ス縺励※縺繧九ョ縺ァ菴輔b縺励↑縺.
+
+ if (this.b譛蛻昴ョ蛻蟯舌〒縺ゅk == false)
+ this.n鬚ィ闊ケ謨ー[(int)this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ]++;
+ else
+ this.n鬚ィ闊ケ謨ー[3]++;
+ }
+
+ Array.Resize(ref nDan_NotesCount, nDan_NotesCount.Length + 1);
+ this.listChip.Add(chip);
+
+ if(IsEndedBranching)
+ this.listChip_Branch[i].Add(chip);
+ else
+ this.listChip_Branch[(int)chip.n繧ウ繝シ繧ケ].Add(chip);
+ }
+ }
+
+ if (IsEnabledFixSENote) IsEnabledFixSENote = false;
+
+ this.dbLastTime = this.dbNowTime;
+ this.dbLastBMScrollTime = this.dbNowBMScollTime;
+ this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n譁蟄玲焚));
+ this.dbNowBMScollTime += (((this.fNow_Measure_s / this.fNow_Measure_m)) * (16.0 / (double)n譁蟄玲焚));
+ }
+ }
+ }
+ }
+
+ ///
+ /// 髮」譏灘コヲ縺斐→縺ォ繧医▲縺ヲ螟峨o繧九倥ャ繝蛟、繧定ェュ縺ソ霎シ繧縲
+ /// (BALLOON縺ェ縺ゥ縲)
+ ///
+ ///
+ private void t髮」譏灘コヲ蛻・繝倥ャ繝(string InputText)
+ {
+ if (TJAPlayer3.actEnumSongs.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺)
+ {
+ if (InputText.Equals("#HBSCROLL") && TJAPlayer3.ConfigIni.b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 == false)
+ {
+ TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.HBSCROLL;
+ }
+ if (InputText.Equals("#BMSCROLL") && TJAPlayer3.ConfigIni.b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 == false)
+ {
+ TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.BMSCROLL;
+ }
+ }
+
+ string[] strArray = InputText.Split(new char[] { ':' });
+ string strCommandName = "";
+ string strCommandParam = "";
+
+ if (strArray.Length == 2)
+ {
+ strCommandName = strArray[0].Trim();
+ strCommandParam = strArray[1].Trim();
+ }
+
+ void ParseOptionalInt16(Action setValue)
+ {
+ this.ParseOptionalInt16(strCommandName, strCommandParam, setValue);
+ }
+
+ if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR"))
+ {
+ ParseBalloon(strCommandParam, this.listBalloon_Normal);
+ }
+ else if (strCommandName.Equals("BALLOONEXP"))
+ {
+ ParseBalloon(strCommandParam, this.listBalloon_Expert);
+ //tbBALLOON.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("BALLOONMAS"))
+ {
+ ParseBalloon(strCommandParam, this.listBalloon_Master);
+ //tbBALLOON.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("SCOREMODE"))
+ {
+ ParseOptionalInt16(value => this.nScoreModeTmp = value);
+ }
+ else if (strCommandName.Equals("SCOREINIT"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ string[] scoreinit = strCommandParam.Split(',');
+
+ this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value =>
+ {
+ this.nScoreInit[0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value;
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true;
+ });
+
+ if (scoreinit.Length == 2)
+ {
+ this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value =>
+ {
+ this.nScoreInit[1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value;
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true;
+ });
+ }
+ }
+ }
+ else if (strCommandName.Equals("SCOREDIFF"))
+ {
+ ParseOptionalInt16(value =>
+ {
+ this.nScoreDiff[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value;
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true;
+ });
+ }
+
+ //if( this.nScoreModeTmp == 99 ) //2017.01.28 DD SCOREMODE繧貞・蜉帙@縺ヲ縺縺ェ縺蝣エ蜷医ョ縺ソConfig縺ァ險ュ螳壹@縺溘Δ繝シ繝峨↓縺吶k
+ //{
+ // this.nScoreModeTmp = CDTXMania.ConfigIni.nScoreMode;
+ //}
+ //if( CDTXMania.ConfigIni.nScoreMode == 3 && !this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬 2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ ] ){ //2017.06.04 kairera0467
+ // this.nScoreModeTmp = 3;
+ //}
+
+
+
+ else if (strCommandName.Equals("SCOREMODE"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ this.nScoreModeTmp = Convert.ToInt16(strCommandParam);
+ }
+ }
+ else if (strCommandName.Equals("SCOREINIT"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ string[] scoreinit = strCommandParam.Split(',');
+
+ this.nScoreInit[0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = Convert.ToInt16(scoreinit[0]);
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true;
+ if (scoreinit.Length == 2)
+ {
+ this.nScoreInit[1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = Convert.ToInt16(scoreinit[1]);
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true;
+ }
+ }
+ }
+ else if (strCommandName.Equals("SCOREDIFF"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ this.nScoreDiff[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = Convert.ToInt16(strCommandParam);
+ this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true;
+ }
+ }
+ if (this.nScoreModeTmp == 99) //2017.01.28 DD SCOREMODE繧貞・蜉帙@縺ヲ縺縺ェ縺蝣エ蜷医ョ縺ソConfig縺ァ險ュ螳壹@縺溘Δ繝シ繝峨↓縺吶k
+ {
+ this.nScoreModeTmp = TJAPlayer3.ConfigIni.nScoreMode;
+ }
+ if (TJAPlayer3.ConfigIni.nScoreMode == 3 && !this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ])
+ { //2017.06.04 kairera0467
+ this.nScoreModeTmp = 3;
+ }
+ }
+
+ private void tDanExamLoad(string input)
+ {
+ string[] strArray = input.Split(new char[] { ':' });
+ string strCommandName = "";
+ string strCommandParam = "";
+
+ if (strArray.Length == 2)
+ {
+ strCommandName = strArray[0].Trim();
+ strCommandParam = strArray[1].Trim();
+ }
+
+ if (strCommandName.Equals("EXAM1") || strCommandName.Equals("EXAM2") || strCommandName.Equals("EXAM3") || strCommandName.Equals("EXAM4"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ Exam.Type examType;
+ int[] examValue;
+ Exam.Range examRange;
+ var splitExam = strCommandParam.Split(',');
+ switch (splitExam[0])
+ {
+ case "g":
+ examType = Exam.Type.Gauge;
+ break;
+ case "jp":
+ examType = Exam.Type.JudgePerfect;
+ break;
+ case "jg":
+ examType = Exam.Type.JudgeGood;
+ break;
+ case "jb":
+ examType = Exam.Type.JudgeBad;
+ break;
+ case "s":
+ examType = Exam.Type.Score;
+ break;
+ case "r":
+ examType = Exam.Type.Roll;
+ break;
+ case "h":
+ examType = Exam.Type.Hit;
+ break;
+ case "c":
+ examType = Exam.Type.Combo;
+ break;
+ default:
+ examType = Exam.Type.Gauge;
+ break;
+ }
+ try
+ {
+ examValue = new int[] { int.Parse(splitExam[1]), int.Parse(splitExam[2]) };
+ }
+ catch (Exception)
+ {
+ examValue = new int[] { 100, 100 };
+ }
+ switch (splitExam[3])
+ {
+ case "m":
+ examRange = Exam.Range.More;
+ break;
+ case "l":
+ examRange = Exam.Range.Less;
+ break;
+ default:
+ examRange = Exam.Range.More;
+ break;
+ }
+
+ if(Dan_C[int.Parse(strCommandName.Substring(4)) - 1] == null)
+ Dan_C[int.Parse(strCommandName.Substring(4)) - 1] = new Dan_C(examType, examValue, examRange);
+
+ List_DanSongs[DanSongs.Number - 1].Dan_C[int.Parse(strCommandName.Substring(4)) - 1] = new Dan_C(examType, examValue, examRange);
+ }
+ }
+ }
+
+ private void ParseOptionalInt16(string name, string unparsedValue, Action setValue)
+ {
+ if (string.IsNullOrEmpty(unparsedValue))
+ {
+ return;
+ }
+
+ if (short.TryParse(unparsedValue, out var value))
+ {
+ setValue(value);
+ }
+ else
+ {
+ Trace.TraceWarning($"蜻ス莉、蜷: {name} 縺ョ繝代Λ繝。繝シ繧ソ縺ョ蛟、縺梧ュ」縺励¥縺ェ縺縺薙→繧呈、懃衍縺励∪縺励◆縲ょ、: {unparsedValue} ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})");
+ }
+ }
+
+
+ private void ParseBalloon(string strCommandParam, List listBalloon)
+ {
+ string[] strParam = strCommandParam.Split(',');
+ for (int n = 0; n < strParam.Length; n++)
+ {
+ int n謇捺焚;
+ try
+ {
+ if (strParam[n] == null || strParam[n] == "")
+ break;
+
+ n謇捺焚 = Convert.ToInt32(strParam[n]);
+ }
+ catch (Exception ex)
+ {
+ Trace.TraceError($"縺翫d?繧ィ繝ゥ繝シ縺悟コ縺溘h縺縺ァ縺吶ゅ♀蜈讒倥 ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})");
+ Trace.TraceError(ex.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (95327158-4e83-4fa9-b5e9-ad3c3d4c2a22)");
+ break;
+ }
+
+ listBalloon.Add(n謇捺焚);
+ }
+ }
+ private void t蜈・蜉媽陦瑚ァ」譫舌倥ャ繝(string InputText)
+ {
+ //繧縺ケ繝シ縲ょ磯ュ縺ォ繧ウ繝。繝ウ繝郁。後≠縺」縺溘i繧縺ー縺繧繧薙
+ string[] strArray = InputText.Split(new char[] { ':' });
+ string strCommandName = "";
+ string strCommandParam = "";
+
+ if (InputText.StartsWith("#BRANCHSTART"))
+ {
+ //2015.08.18 kairera0467
+ //譛ャ譚・縺ッ繝倥ャ繝蜻ス莉、縺ァ縺ッ縺ゅj縺セ縺帙s縺後髮」譏灘コヲ縺斐→縺ォ驕輔≧鬆逶ョ縺ェ縺ョ縺ァ縺薙%縺ァ隱ュ縺ソ霎シ縺セ縺帙∪縺吶
+ //Length縺ョ繝√ぉ繝繧ッ繧偵&繧後k蜑阪↓縺ォif譁繧貞・繧後※縺縺セ縺吶
+ this.bHasBranch[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true;
+ }
+
+ //縺セ縺壹ッ縲:縲阪〒Split縺励※蜑イ繧雁ス薙※繧九
+ if (strArray.Length == 2)
+ {
+ strCommandName = strArray[0].Trim();
+ strCommandParam = strArray[1].Trim();
+ }
+ else if (strArray.Length > 2)
+ {
+ //strArray縺2縺倥c縺ェ縺蝣エ蜷医√倥ャ繝縺ョSplit繧帝壹@縺ヲ縺縺ェ縺蜿ッ閭ス諤ァ縺後≠繧九
+ //縺薙ョ蜃ヲ逅閾ェ菴薙ッ縲荊蜈・蜉帙阪r謾ケ騾縺励◆繧ゅョ縲4TART縺ァSplit縺励※縺縺ェ縺遲峨∽ク驛ィ縺ョ蜃ヲ逅縺檎焚縺ェ繧九
+
+ #region[繝倥ャ繝]
+ InputText = InputText.Replace(Environment.NewLine, "\n"); //謾ケ陦梧枚蟄励r蛻・縺ョ譁蟄怜励↓蟾ョ縺玲崛縺医
+ InputText = InputText.Replace('\t', ' '); //菴輔ョ譁蟄励°遏・繧峨↑縺縺代←繧ケ繝壹シ繧ケ縺ォ蟾ョ縺玲崛縺医
+ InputText = InputText + "\n";
+
+ string[] strDelimiter2 = { "\n" };
+ strArray = InputText.Split(strDelimiter2, StringSplitOptions.RemoveEmptyEntries);
+
+
+ strArray = strArray[0].Split(new char[] { ':' });
+ WarnSplitLength("Header Name & Value", strArray, 2);
+
+ strCommandName = strArray[0].Trim();
+ strCommandParam = strArray[1].Trim();
+
+ #endregion
+ //lblMessage.Text = "縺翫d?strArray縺ョLength縺2縺倥c縺ェ縺繧医≧縺ァ縺吶ュ縲ゅ♀蜈讒倥";
+ }
+
+ void ParseOptionalInt16(Action setValue)
+ {
+ this.ParseOptionalInt16(strCommandName, strCommandParam, setValue);
+ }
+
+ //繝代Λ繝。繝シ繧ソ繧貞蛻・縲√◎縺薙°繧牙牡繧雁ス薙※縺ヲ縺縺阪∪縺吶
+ if (strCommandName.Equals("TITLE"))
+ {
+ //this.TITLE = strCommandParam;
+ var subTitle = "";
+ for (int i = 0; i < strArray.Length; i++)
+ {
+ subTitle += strArray[i];
+ }
+ this.TITLE = subTitle.Substring(5);
+ //tbTitle.Text = strCommandParam;
+ }
+ if (strCommandName.Equals("SUBTITLE"))
+ {
+ if (strCommandParam.StartsWith("--"))
+ {
+ //this.SUBTITLE = strCommandParam.Remove( 0, 2 );
+ var subTitle = "";
+ for (int i = 0; i < strArray.Length; i++)
+ {
+ subTitle += strArray[i];
+ }
+ this.SUBTITLE = subTitle.Substring(10);
+ }
+ else if (strCommandParam.StartsWith("++"))
+ {
+ // //this.TITLE += strCommandParam.Remove( 0, 2 ); //縺薙ョ縺セ縺セ縺縺ィ驕ク譖イ逕サ髱「縺ョ陦ィ遉コ縺後≧縺セ縺上>縺九↑縺縲
+ //this.SUBTITLE = strCommandParam.Remove( 0, 2 );
+ var subTitle = "";
+ for (int i = 0; i < strArray.Length; i++)
+ {
+ subTitle += strArray[i];
+ }
+ this.SUBTITLE = subTitle.Substring(10);
+ }
+ }
+ else if (strCommandName.Equals("LEVEL"))
+ {
+ var level = (int)Convert.ToDouble(strCommandParam);
+ this.LEVEL.Drums = level;
+ this.LEVEL.Taiko = level;
+ this.LEVELtaiko[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = level;
+ }
+ else if (strCommandName.Equals("BPM"))
+ {
+ if (strCommandParam.IndexOf(",") != -1)
+ strCommandParam = strCommandParam.Replace(',', '.');
+
+ double dbBPM = Convert.ToDouble(strCommandParam);
+ this.BPM = dbBPM;
+ this.BASEBPM = dbBPM;
+ this.dbNowBPM = dbBPM;
+
+ this.listBPM.Add(this.n蜀驛ィ逡ェ蜿キBPM1to - 1, new CBPM() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1, n陦ィ險倅ク翫ョ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1, dbBPM蛟、 = dbBPM, });
+ this.n蜀驛ィ逡ェ蜿キBPM1to++;
+
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x03;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー - 1) * 384);
+ chip.n謨エ謨ー蛟、 = 0x00;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1;
+
+ this.listChip.Add(chip);
+ //tbBPM.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("WAVE"))
+ {
+ if (strBGM_PATH != null)
+ {
+ Trace.TraceWarning($"{nameof(CDTX)} is ignoring an extra WAVE header in {this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ}");
+ }
+ else
+ {
+ this.strBGM_PATH = CDTXCompanionFileFinder.FindFileName(this.str繝輔か繝ォ繝蜷, str繝輔ぃ繧、繝ォ蜷, strCommandParam);
+ //tbWave.Text = strCommandParam;
+ if (this.listWAV != null)
+ {
+ // 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here.
+ // TJAP3 is either launching, enumerating songs, or is about to
+ // begin playing a song. If metadata is available, we want it now.
+ // If is not yet available then we wish to queue scanning.
+ var absoluteBgmPath = Path.Combine(this.str繝輔か繝ォ繝蜷, this.strBGM_PATH);
+ this.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(absoluteBgmPath);
+
+ var wav = new CWAV()
+ {
+ n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キWAV1to,
+ n陦ィ險倅ク翫ョ逡ェ蜿キ = 1,
+ n繝√ャ繝励し繧、繧コ = this.n辟。髯千ョ。逅SIZE[this.n蜀驛ィ逡ェ蜿キWAV1to],
+ n菴咲スョ = this.n辟。髯千ョ。逅PAN[this.n蜀驛ィ逡ェ蜿キWAV1to],
+ SongVol = this.SongVol,
+ SongLoudnessMetadata = this.SongLoudnessMetadata,
+ str繝輔ぃ繧、繝ォ蜷 = this.strBGM_PATH,
+ str繧ウ繝。繝ウ繝域枚 = "TJA BGM",
+ };
+
+ this.listWAV.Add(this.n蜀驛ィ逡ェ蜿キWAV1to, wav);
+ this.n蜀驛ィ逡ェ蜿キWAV1to++;
+ }
+ }
+ }
+ else if (strCommandName.Equals("OFFSET") && !string.IsNullOrEmpty(strCommandParam))
+ {
+ this.nOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000);
+ this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = this.nOFFSET < 0 ? true : false;
+
+ this.listBPM[0].bpm_change_bmscroll_time = -2000 * this.dbNowBPM / 15000;
+ if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == true)
+ this.nOFFSET = this.nOFFSET * -1; //OFFSET縺ッ遘偵r蜉邂励☆繧九ョ縺ァ縲∝ソ縺壽ュ」縺ョ謨ー縺ォ縺吶k縺薙→縲
+ //tbOFFSET.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("MOVIEOFFSET"))
+ {
+ this.nMOVIEOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000);
+ this.bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = this.nMOVIEOFFSET < 0 ? true : false;
+
+ if (this.bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == true)
+ this.nMOVIEOFFSET = this.nMOVIEOFFSET * -1; //OFFSET縺ッ遘偵r蜉邂励☆繧九ョ縺ァ縲∝ソ縺壽ュ」縺ョ謨ー縺ォ縺吶k縺薙→縲
+ //tbOFFSET.Text = strCommandParam;
+ }
+ #region[遘サ蜍補剃ク榊キ蜷医′襍キ縺薙k縺ョ縺ァ縺薙%繧ゆク蠢懷セゥ豢サ縺輔○縺ヲ縺翫¥]
+ else if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR"))
+ {
+ ParseBalloon(strCommandParam, this.listBalloon_Normal);
+ }
+ else if (strCommandName.Equals("BALLOONEXP"))
+ {
+ ParseBalloon(strCommandParam, this.listBalloon_Expert);
+ //tbBALLOON.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("BALLOONMAS"))
+ {
+ ParseBalloon(strCommandParam, this.listBalloon_Master);
+ //tbBALLOON.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("SCOREMODE"))
+ {
+ ParseOptionalInt16(value => this.nScoreModeTmp = value);
+ }
+ else if (strCommandName.Equals("SCOREINIT"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ string[] scoreinit = strCommandParam.Split(',');
+
+ this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value =>
+ {
+ this.nScoreInit[0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value;
+ });
+
+ if (scoreinit.Length == 2)
+ {
+ this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value =>
+ {
+ this.nScoreInit[1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value;
+ });
+ }
+ }
+ }
+ else if (strCommandName.Equals("GAUGEINCR"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ switch (strCommandParam.ToLower())
+ {
+ case "normal":
+ GaugeIncreaseMode = GaugeIncreaseMode.Normal;
+ break;
+ case "floor":
+ GaugeIncreaseMode = GaugeIncreaseMode.Floor;
+ break;
+ case "round":
+ GaugeIncreaseMode = GaugeIncreaseMode.Round;
+ break;
+ case "ceiling":
+ GaugeIncreaseMode = GaugeIncreaseMode.Ceiling;
+ break;
+ case "notfix":
+ GaugeIncreaseMode = GaugeIncreaseMode.NotFix;
+ break;
+ default:
+ GaugeIncreaseMode = GaugeIncreaseMode.Normal;
+ break;
+ }
+ }
+ }
+ else if (strCommandName.Equals("SCOREDIFF"))
+ {
+ ParseOptionalInt16(value => this.nScoreDiff[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value);
+ }
+ #endregion
+ else if (strCommandName.Equals("SONGVOL") && !string.IsNullOrEmpty(strCommandParam))
+ {
+ this.SongVol = Convert.ToInt32(strCommandParam).Clamp(CSound.MinimumSongVol, CSound.MaximumSongVol);
+
+ foreach (var kvp in this.listWAV)
+ {
+ kvp.Value.SongVol = this.SongVol;
+ }
+ }
+ else if (strCommandName.Equals("SEVOL"))
+ {
+ //tbSeVol.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("COURSE"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ //this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ = Convert.ToInt16( strCommandParam );
+ this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ = this.strConvertCourse(strCommandParam);
+ }
+ }
+
+ else if (strCommandName.Equals("HEADSCROLL"))
+ {
+ //譁ー螳夂セゥ:蛻晄悄繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ險ュ螳(縺ィ縺縺繧医j縺薙ョ繧キ繧ケ繝繝縺ォ蜷医o縺帙k縺ォ縺ッ蠢鬆医)
+ //縺ゥ縺縺励※繧ゆク逡ェ譛蛻昴↓1蟆冗ッ謖ソ蜈・縺輔l繧九°繧峨√%縺縺吶k縺励°縺ェ縺九▲縺溘s縺___
+
+ this.dbScrollSpeed = Convert.ToDouble(strCommandParam);
+
+ this.listSCROLL.Add(this.n蜀驛ィ逡ェ蜿キSCROLL1to, new CSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbSCROLL蛟、 = this.dbScrollSpeed, });
+
+
+ //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九
+ var chip = new CChip();
+
+ chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9D;
+ chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー - 2) * 384);
+ chip.n謨エ謨ー蛟、 = 0x00;
+ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to;
+ chip.dbSCROLL = this.dbScrollSpeed;
+
+ // 繝√ャ繝励r驟咲スョ縲
+
+ this.listChip.Add(chip);
+ this.n蜀驛ィ逡ェ蜿キSCROLL1to++;
+
+ //this.nScoreDiff = Convert.ToInt16( strCommandParam );
+ //tbScoreDiff.Text = strCommandParam;
+ }
+ else if (strCommandName.Equals("GENRE"))
+ {
+ //2015.03.28 kairera0467
+ //繧ク繝」繝ウ繝ォ縺ョ螳夂セゥ縲DTX縺九i蜈・蜉帙b縺ァ縺阪k縺後》ja縺九i繧ょ・蜉帙〒縺阪k繧医≧縺ォ縺吶k縲
+ //譌・譛ャ隱槫錐縺縺ィ驕ク譖イ逕サ髱「縺ァ繝舌げ縺悟コ繧九ョ縺ァ縲√◎縺薙b縺ゥ縺縺ォ縺九@縺ヲ縺縺丈コ亥ョ壹
+
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ this.GENRE = strCommandParam;
+ }
+ }
+ else if (strCommandName.Equals("DEMOSTART"))
+ {
+ //2015.04.10 kairera0467
+
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ int nOFFSETms;
+ try
+ {
+ nOFFSETms = (int)(Convert.ToDouble(strCommandParam) * 1000.0);
+ }
+ catch
+ {
+ nOFFSETms = 0;
+ }
+
+
+ this.n繝繝「BGM繧ェ繝輔そ繝繝 = nOFFSETms;
+ }
+ }
+ else if (strCommandName.Equals("BGMOVIE"))
+ {
+ //2016.02.02 kairera0467
+ //閭梧勹蜍慕判縺ョ螳夂セゥ縲DTX縺九i蜈・蜉帙b縺ァ縺阪k縺後》ja縺九i繧ょ・蜉帙〒縺阪k繧医≧縺ォ縺吶k縲
+
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ this.strBGVIDEO_PATH =
+ CDTXCompanionFileFinder.FindFileName(this.str繝輔か繝ォ繝蜷, str繝輔ぃ繧、繝ォ蜷, strCommandParam);
+ }
+
+ var avi = new CAVI()
+ {
+ n逡ェ蜿キ = 1,
+ str繝輔ぃ繧、繝ォ蜷 = this.strBGVIDEO_PATH,
+ str繧ウ繝。繝ウ繝域枚 = "BGMOVIE蜻ス莉、",
+ };
+
+ if (this.listAVI.ContainsKey(1)) // 譌「縺ォ繝ェ繧ケ繝井クュ縺ォ蟄伜惠縺励※縺繧九↑繧牙炎髯、縲ょセ後ョ繧ゅョ縺梧怏蜉ケ縲
+ this.listAVI.Remove(1);
+
+ this.listAVI.Add(1, avi);
+
+ var ds = new CDirectShow()
+ {
+ n逡ェ蜿キ = 1,
+ str繝輔ぃ繧、繝ォ蜷 = this.strBGVIDEO_PATH,
+ str繧ウ繝。繝ウ繝域枚 = "BGMOVIE蜻ス莉、",
+ };
+
+ if (this.listDS.ContainsKey(1)) // 譌「縺ォ繝ェ繧ケ繝井クュ縺ォ蟄伜惠縺励※縺繧九↑繧牙炎髯、縲ょセ後ョ繧ゅョ縺梧怏蜉ケ縲
+ this.listDS.Remove(1);
+
+ this.listDS.Add(1, ds);
+ }
+ else if (strCommandName.Equals("BGIMAGE"))
+ {
+ //2016.02.02 kairera0467
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ this.strBGIMAGE_PATH = strCommandParam;
+ }
+ }
+ else if (strCommandName.Equals("HIDDENBRANCH"))
+ {
+ //2016.04.01 kairera0467 繝代Λ繝。繝シ繧ソ繝シ縺ッ
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ this.bHIDDENBRANCH = true;
+ }
+ }
+ else if (strCommandName.Equals("LYRICFILE"))
+ {
+ if (!string.IsNullOrEmpty(strCommandParam))
+ {
+ string[] strFiles = SplitComma(strCommandParam);
+ string[] strFilePath = new string[strFiles.Length];
+ for (int index = 0; index < strFiles.Length; index++)
+ {
+ strFilePath[index] = this.str繝輔か繝ォ繝蜷 + strFiles[index];
+ if (File.Exists(strFilePath[index]))
+ {
+ try
+ {
+ if (TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ)//襍キ蜍墓凾縺ォ驥阪◆縺上↑縺」縺ヲ縺励∪縺蝠城。後ョ菫ョ豁」逕ィ
+ this.LyricFileParser(strFilePath[index], index);
+ this.bLyrics = true;
+ }
+ catch
+ {
+ Console.WriteLine("lrc繝輔ぃ繧、繝ォNo.{0}縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縺後", index);
+ Console.WriteLine("蜃ヲ逅繧堤カ夊。後@縺セ縺吶");
+ }
+ }
+ }
+ }
+ }
+ if (this.nScoreModeTmp == 99)
+ {
+ //2017.01.28 DD
+ this.nScoreModeTmp = TJAPlayer3.ConfigIni.nScoreMode;
+ }
+ }
+ ///
+ /// 謖螳壹@縺滓枚蟄励′謨ー蛟、縺九r霑斐☆繝。繧ス繝繝
+ ///
+ ///
+ ///
+ public bool bIsNumber(char Char)
+ {
+ if ((Char >= '0') && (Char <= '9'))
+ return true;
+ else
+ return false;
+ }
+
+ ///
+ /// string蝙九°繧永nt蝙九↓螟画鋤縺吶k縲
+ /// TJAP2縺九i謖√▲縺ヲ縺阪◆縲
+ ///
+ private int CharConvertNote(string str)
+ {
+ switch (str)
+ {
+ case "0":
+ return 0;
+ case "1":
+ return 1;
+ case "2":
+ return 2;
+ case "3":
+ return 3;
+ case "4":
+ return 4;
+ case "5":
+ return 5;
+ case "6":
+ return 6;
+ case "7":
+ return 7;
+ case "8":
+ return 8;
+ case "9":
+ return 7; //2017.01.30 DD 闃矩」謇薙r鬚ィ闊ケ騾」謇捺桶縺縺ォ
+ case "A": //2017.08.22 kairera0467 謇九▽縺ェ縺
+ return 10;
+ case "B":
+ return 11;
+ case "F":
+ return 15;
+ default:
+ return -1;
+ }
+ }
+
+ private int strConvertCourse(string str)
+ {
+ //2016.08.24 kairera0467
+ //豁」隕剰。ィ迴セ繧剃スソ縺」縺ヲ縺繧九◆繧√‘asy縺ァ繧EASY縺ァ繧0K縲
+
+ // 蟆乗枚蟄怜、ァ譁蟄怜玄蛻・縺励↑縺豁」隕剰。ィ迴セ縺ァ莉ョ蟇セ蠢懊 (AioiLight)
+ // 逶ク螟峨o繧峨★蜴溷ァ狗噪縺ェ繧繧頑婿縺縺後∵ュ」蟶ク縺ォ蜍穂ス懊@縺溘
+ string[] Matchptn = new string[7] { "easy", "normal", "hard", "oni", "edit", "tower", "dan" };
+ for (int i = 0; i < Matchptn.Length; i++)
+ {
+ if (Regex.IsMatch(str, Matchptn[i], RegexOptions.IgnoreCase))
+ {
+ return i;
+ }
+ }
+
+ switch (str)
+ {
+ case "0":
+ return 0;
+ case "1":
+ return 1;
+ case "2":
+ return 2;
+ case "3":
+ return 3;
+ case "4":
+ return 4;
+ case "5":
+ return 5;
+ case "6":
+ return 6;
+ default:
+ return 3;
+ }
+ }
+
+ ///
+ /// Lyric繝輔ぃ繧、繝ォ縺ョ繝代シ繧ケ繧ゅ←縺
+ /// 閾ェ蜉帙〒菴懊▲縺溘ョ縺ァ縲√≧縺セ縺上ヱ繝シ繧ケ縺励※縺上l縺ェ縺縺九b
+ ///
+ /// lrc繝輔ぃ繧、繝ォ縺ョ繝代せ
+ private void LyricFileParser(string strFilePath, int ordnumber)//lrc繝輔ぃ繧、繝ォ縺ョ繝代シ繧ケ逕ィ
+ {
+ string str = CJudgeTextEncoding.ReadTextFile(strFilePath);
+ var strSplit蠕 = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries);
+ Regex timeRegex = new Regex(@"^(\[)(\d{2})(:)(\d{2})([:.])(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled);
+ Regex timeRegexO = new Regex(@"^(\[)(\d{2})(:)(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled);
+ List list;
+ for (int i = 0; i < strSplit蠕.Length; i++)
+ {
+ list = new List();
+ if (!String.IsNullOrEmpty(strSplit蠕啓i]))
+ {
+ if (strSplit蠕啓i].StartsWith("["))
+ {
+ Match timestring = timeRegex.Match(strSplit蠕啓i]), timestringO = timeRegexO.Match(strSplit蠕啓i]);
+ while (timestringO.Success || timestring.Success)
+ {
+ long time;
+ if (timestring.Success)
+ {
+ time = Int32.Parse(timestring.Groups[2].Value) * 60000 + Int32.Parse(timestring.Groups[4].Value) * 1000 + Int32.Parse(timestring.Groups[6].Value) * 10;
+ strSplit蠕啓i] = strSplit蠕啓i].Remove(0, 10);
+ }
+ else if (timestringO.Success)
+ {
+ time = Int32.Parse(timestringO.Groups[2].Value) * 60000 + Int32.Parse(timestringO.Groups[4].Value) * 1000;
+ strSplit蠕啓i] = strSplit蠕啓i].Remove(0, 7);
+ }
+ else
+ break;
+ list.Add(time);
+ timestring = timeRegex.Match(strSplit蠕啓i]);
+ timestringO = timeRegexO.Match(strSplit蠕啓i]);
+ }
+ strSplit蠕啓i] = strSplit蠕啓i].Replace("\r", "").Replace("\n", "");
+
+ for (int listindex = 0; listindex < list.Count; listindex++)
+ {
+ STLYRIC stlrc;
+ stlrc.Text = strSplit蠕啓i];
+ stlrc.TextTex = this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝.DrawPrivateFont(strSplit蠕啓i], TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.Skin.Game_Lyric_BackColor);
+ stlrc.Time = list[listindex];
+ stlrc.index = ordnumber;
+ this.listLyric2.Add(stlrc);
+ }
+ }
+ }
+ }
+ }
+
+
+ ///
+ /// 隍邏謨ー縺ョ繝代シ繧ケ繧ゅ←縺
+ ///
+ private void tParsedComplexNumber(string strScroll, ref double[] dbScroll)
+ {
+ bool bFirst = true; //譛蛻昴ョ謨ー蛟、縺
+ bool bUse = false; //謨ー蛟、謇ア縺荳ュ
+ string[] arScroll = new string[2];
+ char[] c = strScroll.ToCharArray();
+ //1.0-1.0i
+ for (int i = 0; i < strScroll.Length; i++)
+ {
+ if (bFirst)
+ arScroll[0] += c[i];
+ else
+ arScroll[1] += c[i];
+
+ //谺。縺ョ譁蟄励′'i'縺ェ繧芽┳蜃コ縲
+ if (c[i + 1] == 'i')
+ break;
+ else if (c[i + 1] == '-' || c[i + 1] == '+')
+ bFirst = false;
+
+ }
+
+ dbScroll[0] = Convert.ToDouble(arScroll[0]);
+ dbScroll[1] = Convert.ToDouble(arScroll[1]);
+ return;
+ }
+
+ private void tSetSenotes()
+ {
+ #region[ list菴懈 ]
+ //縺イ縺ィ縺セ縺壹メ繝繝励□縺代ョ繝ェ繧ケ繝医r菴懈舌@縺ヲ縺翫¥縲
+ List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List();
+ int nCount = 0;
+ int dkdkCount = 0;
+
+ foreach (CChip chip in this.listChip)
+ {
+ if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x18)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip);
+ }
+ }
+ #endregion
+
+ //譎る俣蛻、螳壹ッ縲√梧ャ。縺ョ繝√ャ繝励ョ逋コ螢ー譎ょ綾縲阪°繧峨檎樟蝨ィ(驕主悉)縺ョ繝√ャ繝励ョ逋コ螢ー譎ょ綾縲阪〒蠑輔¥蠢隕√′縺ゅk縲
+ //騾縺ォ縺励※縺励∪縺縺ィ險育ョ励′縺ィ縺ヲ縺、繧ゅ↑縺縺薙→縺ォ縺ェ繧九ョ縺ァ豕ィ諢上
+
+ try
+ {
+ //this.tSenotes_Core( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 );
+ this.tSenotes_Core_V2(list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝, true);
+ }
+ catch (Exception ex)
+ {
+ Trace.TraceError(ex.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (b67473e4-1930-44f1-b320-4ead5786e74c)");
+ }
+
+
+ #region[邨ア蜷亥燕]
+ //foreach( CChip pChip in list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 )
+ //{
+ // int dbUnitTime = ( int )( ( ( 60.0 / this.dbNowBPM ) / 4.0 ) * 1000.0 );
+ // int nUnit4 = dbUnitTime * 4;
+ // int nUnit8 = dbUnitTime * 2;
+ // int nUnit16 = dbUnitTime;
+
+ // if( nCount == 0 )
+ // {
+ // nCount++;
+ // continue;
+ // }
+
+ // double db1蛟句燕縺ョ逋コ逕滓凾蛻サms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms * 1;
+
+ // if( nCount == 1 )
+ // {
+ // //nCount - 1縺ッ荳逡ェ譛蛻昴ョ繝弱シ繝縺ォ縺ェ繧九
+
+ // if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit4 )
+ // {
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3;
+
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4 )
+ // {
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8 )
+ // {
+ // //16蛻縺ェ繧峨後ラ縲
+ // pChip.nSenote = 1;
+ // }
+ // else
+ // {
+ // if( dkdkCount == 0 )
+ // {
+ // pChip.nSenote = 1;
+ // dkdkCount++;
+ // }
+ // else if( dkdkCount == 1 )
+ // {
+ // pChip.nSenote = 2;
+ // dkdkCount = 0;
+ // }
+
+ // }
+ // }
+ // else
+ // {
+ // //谺。繧4蛻縺ェ繧峨後ラ繝ウ縲阪°縲後き繝縲
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 0;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 3;
+ // }
+ // }
+ // }
+ // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms <= nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit8 )
+ // {
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1;
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4;
+
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 1;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 4;
+ // }
+ // }
+ // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 )
+ // {
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1;
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4;
+
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 1;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 4;
+ // }
+ // }
+
+ // nCount++;
+ // continue;
+ // }
+
+ // double db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n逋コ螢ー譎ょ綾ms * 1;
+
+ // #region[譁ー縺励>繧縺、]
+ // if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count )
+ // break;
+
+ // if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit4 )
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 0;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 3;
+ // }
+
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit4 )
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // pChip.nSenote = 1;
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // pChip.nSenote = 4;
+ // }
+ // }
+ // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms < nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit8 )
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 1;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 4;
+ // }
+
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit4 )
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // pChip.nSenote = 0;
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // pChip.nSenote = 3;
+
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms >= nUnit8 )
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // pChip.nSenote = 1;
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // pChip.nSenote = 4;
+ // }
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 )
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // pChip.nSenote = 1;
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // pChip.nSenote = 4;
+ // }
+
+ // }
+ // else
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // pChip.nSenote = 0;
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // pChip.nSenote = 3;
+ // }
+ // }
+ // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 ) //8蛻莉・荳
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 1;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 4;
+ // }
+
+ // //蠕後m縺4蛻
+ // try
+ // {
+ // if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count )
+ // break;
+
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit8 ) //蛻蟯舌′縺ゅk縺ィ縺薙%縺後ヰ繧ー繧九▲縺ス縺?(Index繧ィ繝ゥ繝シ)
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 0;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 3;
+ // }
+ // }
+ // }
+ // catch( Exception ex )
+ // {
+
+ // }
+
+
+ // }
+ // #endregion
+
+ // #region[蜿、縺繧縺、]
+ // ////2縺、蜑阪→1縺、蜑阪ョ繝√ャ繝励ョSenote繧呈アコ繧√※縺縺上
+ // ////騾」謇薙∝、ァ髻ウ隨ヲ縺ェ縺ゥ縺ッ繝√ャ繝鈴咲スョ縺ョ髫帙↓豎コ繧√∪縺吶
+ // //if (( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit4)
+ // //{
+ // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧2縺、蜑阪ョSenote縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹
+ // // //蜷梧凾縺ォdkdk繧偵Μ繧サ繝繝
+ // // dkdkCount = false;
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 0;
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 3;
+
+ // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit4 )
+ // // {
+ // // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫°縺、縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 0;
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 3;
+ // // }
+ // // else if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) <= nUnit4 )
+ // // {
+ // // //4蛻
+ // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 )
+ // // {
+ // // dkdkCount = false;
+ // // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・蜀縺ァ16蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺瑚オ、縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ縲阪〒遒コ螳壹
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 2;
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4;
+ // // }
+ // // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 )
+ // // {
+ // // dkdkCount = false;
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // {
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+
+ // // //繝峨さ繝峨Φ
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // {
+ // // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // pChip.nSenote = dkdkCount ? 2 : 1;
+ // // if( dkdkCount == false )
+ // // dkdkCount = true;
+ // // else
+ // // dkdkCount = false;
+ // // }
+ // // }
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+ // // }
+
+ // // }
+ // //}
+ // //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit4 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8)
+ // //{
+ // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀
+
+ // // if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) > nUnit16 )
+ // // {
+ // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀縺ェ繧峨後ラ縲
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // {
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+ // // }
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // {
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+ // // }
+ // // }
+ // // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) < nUnit8 )
+ // // {
+ // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・蜀縺ェ繧峨後ラ縲阪〒遒コ螳
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // {
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+ // // }
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+ // // }
+
+ // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit16 )
+ // // {
+ // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 )
+ // // {
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // {
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ // // }
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3;
+ // // }
+ // // }
+ // //}
+ // //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit16 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 )
+ // //{
+ // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・荳
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // {
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+ // // }
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+
+ // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 )
+ // // {
+ // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // // {
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ // // }
+ // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3;
+ // // }
+
+
+ // //}
+ // #endregion
+
+ // nCount++;
+ //}
+ #endregion
+
+
+ }
+
+ ///
+ /// 隴憺擇蛻蟯舌′縺ゅk蝣エ蜷医ッ縺薙■繧峨r菴ソ縺
+ ///
+ private void tSetSenotes_branch()
+ {
+ #region[ list菴懈 ]
+ //縺イ縺ィ縺セ縺壹メ繝繝励□縺代ョ繝ェ繧ケ繝医r菴懈舌@縺ヲ縺翫¥縲
+ List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ List list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ List list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ List list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List();
+ list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List();
+ list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List();
+ list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List();
+ int nCount = 0;
+ int dkdkCount = 0;
+
+ foreach (CChip chip in this.listChip)
+ {
+ if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x18)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip);
+
+ switch (chip.n繧ウ繝シ繧ケ)
+ {
+ case ECourse.eNormal:
+ list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip);
+ break;
+ case ECourse.eExpert:
+ list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip);
+ break;
+ case ECourse.eMaster:
+ list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip);
+ break;
+ }
+ }
+ }
+ #endregion
+
+ //for縺ァ蜃ヲ逅縲
+ for (int n = 0; n < 3; n++)
+ {
+ switch (n)
+ {
+ case 0:
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ break;
+ case 1:
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ break;
+ case 2:
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝;
+ break;
+ }
+
+ //this.tSenotes_Core( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 );
+ this.tSenotes_Core_V2(list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝, true);
+ }
+
+ }
+
+ ///
+ /// 繧ウ繧「驛ィ蛻縲りュ憺擇蛻蟯先凾縺ョ蜃ヲ逅螳溯」縺ォ縺ゅ◆縺」縺ヲ蛻髮「縲
+ ///
+ private void tSenotes_Core(List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝)
+ {
+ int nCount = 0;
+ int dkdkCount = 0;
+
+ foreach (CChip pChip in list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝)
+ {
+ int dbUnitTime = (int)(((60.0 / pChip.dbBPM) / 4.0) * 1000.0);
+ int nUnit4 = dbUnitTime * 4;
+ int nUnit6 = dbUnitTime * 3;
+ int nUnit8 = dbUnitTime * 2;
+ int nUnit16 = dbUnitTime;
+
+ float fUnitTime = (((60.0f / (float)pChip.dbBPM) / 4.0f) * 1000.0f);
+ //float fUnitTime = (float)Math.Round( ( ( ( 60.0f / (float)pChip.dbBPM ) / 4.0f ) * 1000.0f ), 0 );
+ float fUnit4 = fUnitTime * 4.0f;
+ float fUnit8 = fUnitTime * 2.0f;
+ float fUnit16 = fUnitTime;
+
+ if (pChip.dbBPM < 120)
+ {
+ nUnit4 = (dbUnitTime * 4) / 2;
+ nUnit8 = (dbUnitTime * 2) / 2;
+ nUnit16 = dbUnitTime / 2;
+
+ fUnit4 = fUnitTime * 4.0f;
+ fUnit8 = fUnitTime * 2.0f;
+ fUnit16 = fUnitTime;
+ }
+
+ if (nCount == 0)
+ {
+ nCount++;
+ continue;
+ }
+
+ double db1蛟句燕縺ョ逋コ逕滓凾蛻サms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms * 1;
+
+ #region[ float ]
+ /*
+ if( nCount == 1 )
+ {
+ //nCount - 1縺ッ荳逡ェ譛蛻昴ョ繝弱シ繝縺ォ縺ェ繧九
+
+ if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms >= fUnit4 )
+ {
+ //2逡ェ逶ョ縺ョ繝弱シ繝縺ィ1逡ェ逶ョ縺ョ繝弱シ繝縺ョ髢馴囈縺4蛻縺九◎繧御サ・荳
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3;
+
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit4 )
+ {
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit8 )
+ {
+ //16蛻縺ェ繧峨後ラ縲
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ pChip.nSenote = 1;
+ }
+ else
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x93)
+ break;
+
+ if( dkdkCount == 0 )
+ {
+ pChip.nSenote = 1;
+ dkdkCount++;
+ }
+ else if( dkdkCount == 1 )
+ {
+ pChip.nSenote = 2;
+ dkdkCount = 0;
+ }
+
+ }
+ }
+ else
+ {
+ //谺。繧4蛻縺ェ繧峨後ラ繝ウ縲阪°縲後き繝縲
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 0;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ }
+ else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms < fUnit4 && pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms > fUnit16 )
+ {
+ //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九〒縺九▽16蛻莉・荳
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1;
+ else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4;
+
+
+
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 1;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 4;
+ }
+ //
+ //if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 0;
+ //else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 3;
+
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms >= fUnit4)
+ {
+ //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 0;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ }
+ else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms <= fUnit16 )
+ {
+ //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻縺九◎繧御サ・荳
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1;
+ else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4;
+
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 1;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 4;
+ }
+
+ //1逡ェ逶ョ縺ョ繝√ャ繝励′0x93
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms == fUnit16 )
+ {
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 2;
+ }
+ }
+ }
+
+
+ }
+
+ nCount++;
+ continue;
+ }
+
+ double db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n逋コ螢ー譎ょ綾ms * 1;
+
+ #region[譁ー縺励>繧縺、]
+ if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms >= fUnit4 )
+ {
+ //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ dkdkCount = 0;
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 0;
+ //break;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 3;
+ }
+
+ if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count )
+ break;
+
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢薙′4蛻莉・荳
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit4 )
+ {
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ pChip.nSenote = 1;
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ pChip.nSenote = 4;
+ }
+ }
+ else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms < fUnit4 && pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms > fUnit16 )
+ {
+ //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九°縺、16蛻莉・荳
+ dkdkCount = 0;
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 1;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 4;
+ }
+
+ if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count )
+ break;
+
+
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms >= fUnit4 )
+ {
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ pChip.nSenote = 0;
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ pChip.nSenote = 3;
+ }
+ else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit4 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms > fUnit16 )
+ {
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ pChip.nSenote = 1;
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ pChip.nSenote = 4;
+
+ if( nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count )
+ break;
+
+ //谺。縺ョ繝√ャ繝励′0x93
+ //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ //{
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].nSenote = 2;
+ // }
+ //}
+ }
+ else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms <= fUnit16 )
+ {
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻莉・荳
+ //縺昴≧縺ェ繧九→1縺、蜑阪ョ繝√ャ繝励ッ縲後ラ繝ウ縲阪°縲後き繝縲阪↓縺ェ繧
+ //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ //else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ }
+ }
+ else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms <= fUnit16 )
+ {
+ //迴セ蝨ィ縺ョ繝弱シ繝縺ィ1縺、蜑阪ョ繝弱シ繝縺ョ髢馴囈縺16蛻縺九◎繧御サ・荳
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 1;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 4;
+ }
+
+
+ try
+ {
+ if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) //荳逡ェ譛蠕後ョ繝弱シ繝縺縺」縺滓凾縺ョ繧ィ繝ゥ繝シ蟇セ遲悶
+ break;
+
+ //蠕後m縺4蛻
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms >= fUnit4 )
+ {
+ dkdkCount = 0;
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 0;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms <= fUnit8 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms > fUnit16 )
+ {
+ //谺。縺ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺8蛻縺九◎繧御サ・荳九〒縺九▽16蛻莉・荳
+ dkdkCount = 0;
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 0;
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms <= fUnit16 )
+ {
+ if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ pChip.nSenote = 1;
+
+ if( nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count )
+ break;
+
+ if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms == fUnit16 )
+ {
+ //1縺、蜑阪ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺16蛻
+ if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ {
+ //繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺0x93
+ if( dkdkCount == 0 )
+ {
+ pChip.nSenote = 2;
+ dkdkCount = 1;
+ }
+ else
+ {
+ pChip.nSenote = 1;
+ dkdkCount = 0;
+ }
+ }
+
+ }
+ else
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 1;
+ else
+ pChip.nSenote = 4;
+ }
+ }
+ else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ {
+ pChip.nSenote = 4;
+ }
+ }
+ }
+ catch( Exception ex )
+ {
+
+ }
+
+
+ }
+ #endregion
+ */
+ #endregion
+
+ #region[ 繝溘Μ遘 ]
+
+ if (nCount == 1)
+ {
+ #region[ 荳逡ェ譛蛻 ]
+ //nCount - 1縺ッ荳逡ェ譛蛻昴ョ繝弱シ繝縺ォ縺ェ繧九
+
+ if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n逋コ螢ー譎ょ綾ms >= nUnit4)
+ {
+ //2逡ェ逶ョ縺ョ繝弱シ繝縺ィ1逡ェ逶ョ縺ョ繝弱シ繝縺ョ髢馴囈縺4蛻縺九◎繧御サ・荳
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 0;
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 3;
+
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4)
+ {
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8)
+ {
+
+
+
+ //16蛻縺ェ繧峨後ラ縲
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 1;
+ }
+ else
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 0;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ }
+ else
+ {
+ //谺。繧4蛻縺ェ繧峨後ラ繝ウ縲阪°縲後き繝縲
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 0;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ }
+ else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms < nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms > nUnit16)
+ {
+ //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九〒縺九▽16蛻莉・荳
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 1;
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 4;
+
+
+
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 1;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 4;
+ }
+
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit4)
+ {
+ //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 0;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4)
+ {
+ //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit8)
+ {
+
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8)
+ {
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 0;
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 3;
+ }
+
+
+
+
+ //16蛻縺ェ繧峨後ラ縲
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 1;
+ }
+ else
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 1;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 4;
+ }
+ }
+ }
+ }
+ else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms <= nUnit16)
+ {
+ //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻縺九◎繧御サ・荳
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 1;
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 4;
+
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 1;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 4;
+ }
+
+ //1逡ェ逶ョ縺ョ繝√ャ繝励′0x93
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms == nUnit16)
+ {
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 2;
+ }
+ }
+ }
+
+
+ }
+
+ nCount++;
+ continue;
+
+ #endregion
+ }
+
+ double db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n逋コ螢ー譎ょ綾ms * 1;
+
+ #region[譁ー縺励>繧縺、]
+ if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms >= nUnit4)
+ {
+ //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ dkdkCount = 0;
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 0;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 3;
+ }
+
+ if (nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count)
+ break;
+
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢薙′4蛻莉・荳
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit6)
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 1;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 4;
+
+ //12縲16蛻縺後≠繧九↑繧峨後ラ繝ウ縲阪°縲後き繝縲阪↓螟峨∴繧
+
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 2].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms <= nUnit16)
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 1;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 4;
+ }
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 2].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms < nUnit8)
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 0;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 3;
+ }
+ }
+ //else
+ //{
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // pChip.nSenote = 0;
+ // }
+ // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // pChip.nSenote = 3;
+ // }
+ //}
+ }
+ else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms < nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms > nUnit16)
+ {
+ //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九°縺、16蛻莉・荳
+ dkdkCount = 0;
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 1;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 4;
+ }
+
+ if (nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count)
+ break;
+
+
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit4)
+ {
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 0;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 3;
+ }
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms > nUnit16)
+ {
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 1;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 4;
+
+ if (nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count)
+ break;
+
+ //谺。縺ョ繝√ャ繝励′0x93
+ //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ //{
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].nSenote = 2;
+ // }
+ //}
+
+ //12縲16蛻縺後≠繧九↑繧峨後ラ繝ウ縲阪°縲後き繝縲阪↓螟峨∴繧
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 2].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms < nUnit8)
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 0;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 3;
+
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n逋コ螢ー譎ょ綾ms >= nUnit8)
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 1;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 4;
+ }
+
+
+ }
+ }
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit16)
+ {
+ //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻莉・荳
+ //縺昴≧縺ェ繧九→1縺、蜑阪ョ繝√ャ繝励ッ縲後ラ繝ウ縲阪°縲後き繝縲阪↓縺ェ繧
+ //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ //else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3;
+ }
+ else
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ pChip.nSenote = 0;
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ pChip.nSenote = 3;
+ }
+ }
+ else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms <= nUnit16)
+ {
+ //迴セ蝨ィ縺ョ繝弱シ繝縺ィ1縺、蜑阪ョ繝弱シ繝縺ョ髢馴囈縺16蛻縺九◎繧御サ・荳
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 1;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 4;
+ }
+
+
+ try
+ {
+ if (nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count) //荳逡ェ譛蠕後ョ繝弱シ繝縺縺」縺滓凾縺ョ繧ィ繝ゥ繝シ蟇セ遲悶
+ break;
+
+ //蠕後m縺4蛻
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit4)
+ {
+ dkdkCount = 0;
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 0;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit4 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit8)
+ {
+ //谺。縺ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺8蛻縺九◎繧御サ・荳九〒縺九▽16蛻莉・荳
+ dkdkCount = 0;
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 0;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8)
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 1;
+
+ if (nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count)
+ break;
+
+
+ //2015.03.31 kairera0467縲縲後さ縲阪r隱ソ遽縺吶k驛ィ蛻縲ゅ◆縺縺怜虚菴懊′縺ゅd縺励☆縺弱k縺溘a縲√>縺」縺溘s蟆∝魂縲
+ if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms <= nUnit16)
+ {
+ //1縺、蜑阪ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺16蛻
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ //繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺0x93
+ //if( dkdkCount == 0 )
+ //{
+ // pChip.nSenote = 2;
+ // dkdkCount = 1;
+ //}
+ //else
+ //{
+ // pChip.nSenote = 1;
+ // dkdkCount = 0;
+ //}
+ }
+
+ }
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 4;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Trace.TraceError(ex.ToString());
+ Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (1503896a-0dfb-4643-87f1-bd821a125137)");
+ }
+ }
+ else
+ {
+ if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93)
+ {
+ pChip.nSenote = 0;
+ }
+ else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94)
+ {
+ pChip.nSenote = 3;
+ }
+ }
+ #endregion
+
+ #endregion
+
+ #region[蜿、縺繧縺、]
+ ////2縺、蜑阪→1縺、蜑阪ョ繝√ャ繝励ョSenote繧呈アコ繧√※縺縺上
+ ////騾」謇薙∝、ァ髻ウ隨ヲ縺ェ縺ゥ縺ッ繝√ャ繝鈴咲スョ縺ョ髫帙↓豎コ繧√∪縺吶
+ //if (( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit4)
+ //{
+ // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧2縺、蜑阪ョSenote縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹
+ // //蜷梧凾縺ォdkdk繧偵Μ繧サ繝繝
+ // dkdkCount = false;
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 0;
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 3;
+
+ // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit4 )
+ // {
+ // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫°縺、縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 0;
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 3;
+ // }
+ // else if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) <= nUnit4 )
+ // {
+ // //4蛻
+ // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 )
+ // {
+ // dkdkCount = false;
+ // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・蜀縺ァ16蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺瑚オ、縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ縲阪〒遒コ螳壹
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 2;
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4;
+ // }
+ // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 )
+ // {
+ // dkdkCount = false;
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+
+ // //繝峨さ繝峨Φ
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // pChip.nSenote = dkdkCount ? 2 : 1;
+ // if( dkdkCount == false )
+ // dkdkCount = true;
+ // else
+ // dkdkCount = false;
+ // }
+ // }
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+ // }
+
+ // }
+ //}
+ //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit4 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8)
+ //{
+ // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀
+
+ // if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) > nUnit16 )
+ // {
+ // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀縺ェ繧峨後ラ縲
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+ // }
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+ // }
+ // }
+ // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) < nUnit8 )
+ // {
+ // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・蜀縺ェ繧峨後ラ縲阪〒遒コ螳
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+ // }
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+ // }
+
+ // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit16 )
+ // {
+ // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 )
+ // {
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ // }
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3;
+ // }
+ // }
+ //}
+ //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit16 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 )
+ //{
+ // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・荳
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1;
+ // }
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4;
+
+ // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 )
+ // {
+ // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 )
+ // {
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0;
+ // }
+ // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 )
+ // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3;
+ // }
+
+
+ //}
+ #endregion
+
+ nCount++;
+ }
+ }
+
+ ///
+ /// 繧ウ繧「驛ィ蛻Ver2縲5JAP2縺九i遘サ讀阪@縺溘□縺代
+ ///
+ ///
+ private void tSenotes_Core_V2(List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝, bool ignoreSENote = false)
+ {
+ const int DATA = 3;
+ int doco_count = 0;
+ int[] sort = new int[7];
+ double[] time = new double[7];
+ double[] scroll = new double[7];
+ double time_tmp;
+
+ for (int i = 0; i < list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count; i++)
+ {
+ for (int j = 0; j < 7; j++)
+ {
+ if (i + (j - 3) < 0)
+ {
+ sort[j] = -1;
+ time[j] = -1000000000;
+ scroll[j] = 1.0;
+ }
+ else if (i + (j - 3) >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count)
+ {
+ sort[j] = -1;
+ time[j] = 1000000000;
+ scroll[j] = 1.0;
+ }
+ else
+ {
+ sort[j] = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + (j - 3)].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ;
+ time[j] = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + (j - 3)].fBMSCROLLTime;
+ scroll[j] = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + (j - 3)].dbSCROLL;
+ }
+ }
+ time_tmp = time[DATA];
+ for (int j = 0; j < 7; j++)
+ {
+ time[j] = (time[j] - time_tmp) * scroll[j];
+ if (time[j] < 0) time[j] *= -1;
+ }
+
+ if (ignoreSENote && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].IsFixedSENote) continue;
+
+ switch (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ case 0x11:
+
+ //シ亥キヲ2繧医j髮「繧後※縺繧具ス懶シ雲蜿ウ2_蜿ウ繝峨Φ_蜿ウ蜿ウ4_蜿ウ蜿ウ繝峨Φ窶ヲ
+ if ((time[DATA - 1] > 2/* || (sort[DATA-1] != 1 && time[DATA-1] >= 2 && time[DATA-2] >= 4 && time[DATA-3] <= 5)*/) && time[DATA + 1] == 2 && sort[DATA + 1] == 1 && time[DATA + 2] == 4 && sort[DATA + 2] == 0x11 && time[DATA + 3] == 6 && sort[DATA + 3] == 0x11)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 1;
+ doco_count = 1;
+ break;
+ }
+ //繝峨さ繝峨さ荳ュ_蟾ヲ2_蜿ウ2_蜿ウ繝峨Φ
+ else if (doco_count != 0 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && (sort[DATA + 1] == 0x11 || sort[DATA + 1] == 0x11))
+ {
+ if (doco_count % 2 == 0)
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 1;
+ else
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 2;
+ doco_count++;
+ break;
+ }
+ else
+ {
+ doco_count = 0;
+ }
+
+ //8蛻繝峨さ繝峨Φ
+ if ((time[DATA - 2] >= 4.1 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && time[DATA + 2] >= 4.1) && (sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11))
+ {
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM >= 120.0)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].nSenote = 1;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 2;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].nSenote = 0;
+ break;
+ }
+ else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM < 120.0)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].nSenote = 0;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].nSenote = 0;
+ break;
+ }
+ }
+
+ //BPM120莉・荳九ョ縺ソ
+ //8蛻髢馴囈縺ョ縲後ラ繝峨ラ縲坂偵後ラ繝ウ繝峨Φ繝峨Φ縲
+
+ if (time[DATA - 1] >= 2 && time[DATA + 1] >= 2)
+ {
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM < 120.0)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0;
+ break;
+ }
+ }
+
+ //繝峨さ繝峨さ繝峨Φ
+ if (time[DATA - 3] >= 3.4 && time[DATA - 2] == 2 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] == 2 && time[DATA + 3] >= 3.4 && sort[DATA - 2] == 0x93 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11 && sort[DATA + 2] == 0x11)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 2].nSenote = 1;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].nSenote = 2;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 0].nSenote = 1;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].nSenote = 2;
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 2].nSenote = 0;
+ i += 2;
+ //break;
+ }
+ //繝峨さ繝峨Φ
+ else if (time[DATA - 2] >= 2.4 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] >= 2.4 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 2;
+ }
+ //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳企屬繧後※縺繧
+ else if (time[DATA + 1] > 2)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0;
+ }
+ //蜿ウ縺ョ髻ウ隨ヲ縺1.4莉・荳垣蟾ヲ縺ョ髻ウ隨ヲ縺1.4莉・蜀
+ else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0;
+ }
+ //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣蜿ウ蜿ウ縺ョ髻ウ隨ヲ縺3莉・蜀
+ else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0;
+ }
+ //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣螟ァ髻ウ隨ヲ
+ else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14))
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0;
+ }
+ else
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 1;
+ }
+ break;
+ case 0x12:
+ doco_count = 0;
+
+ //BPM120莉・荳九ョ縺ソ
+ //8蛻髢馴囈縺ョ縲後ラ繝峨ラ縲坂偵後ラ繝ウ繝峨Φ繝峨Φ縲
+ if (time[DATA - 1] == 2 && time[DATA + 1] == 2)
+ {
+ if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].dbBPM < 120.0 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM < 120.0 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].dbBPM < 120.0)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3;
+ break;
+ }
+ }
+
+ //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳企屬繧後※縺繧
+ if (time[DATA + 1] > 2)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3;
+ }
+ //蜿ウ縺ョ髻ウ隨ヲ縺1.4莉・荳垣蟾ヲ縺ョ髻ウ隨ヲ縺1.4莉・蜀
+ else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3;
+ }
+ //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣蜿ウ蜿ウ縺ョ髻ウ隨ヲ縺3莉・蜀
+ else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3)
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3;
+ }
+ //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣螟ァ髻ウ隨ヲ
+ else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14))
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3;
+ }
+ else
+ {
+ list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 4;
+ }
+ break;
+ default:
+ doco_count = 0;
+ break;
+ }
+ }
+ }
+
+ ///
+ /// 繧オ繧ヲ繝ウ繝峨Α繧ュ繧オ繝シ縺ォ繧オ繧ヲ繝ウ繝峨r逋サ骭イ_蜑企勁縺吶k譎ょ綾繧剃コ句燕縺ォ邂怜コ縺吶k
+ ///
+ public void PlanToAddMixerChannel()
+ {
+ if (TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() == "DirectSound") // DShow縺ァ縺ョ蜀咲函縺ョ蝣エ蜷医ッ繝溘く繧キ繝ウ繧ー雋闕キ縺碁ォ倥¥縺ェ縺縺溘a縲
+ { // 繝√ャ繝励ョ繝ゥ繧、繝輔ち繧、繝邂。逅繧定。後o縺ェ縺
+ return;
+ }
+
+ List listAddMixerChannel = new List(128); ;
+ List listRemoveMixerChannel = new List(128);
+ List listRemoveTiming = new List(128);
+
+ foreach (CChip pChip in listChip)
+ {
+ switch (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)
+ {
+ // BGM, 貍泌・上メ繝」繝阪Ν, 荳榊庄隕悶し繧ヲ繝ウ繝, 繝輔ぅ繝ォ繧、繝ウ繧オ繧ヲ繝ウ繝, 遨コ謇薙■髻ウ縺ッ繝溘く繧オ繝シ邂。逅縺ョ蟇セ雎。
+ // BGM:
+ case 0x01:
+ // Dr貍泌・上メ繝」繝阪Ν
+ //case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C:
+ // Gt貍泌・上メ繝」繝阪Ν
+ //case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28:
+ // Bs貍泌・上メ繝」繝阪Ν
+ //case 0xA0: case 0xA1: case 0xA2: case 0xA3: case 0xA4: case 0xA5: case 0xA6: case 0xA7: case 0xA8:
+ // Dr荳榊庄隕悶メ繝繝
+ //case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
+ //case 0x38: case 0x39: case 0x3A:
+ // Dr/Gt/Bs遨コ謇薙■
+ //case 0xB1: case 0xB2: case 0xB3: case 0xB4: case 0xB5: case 0xB6: case 0xB7: case 0xB8:
+ //case 0xB9: case 0xBA: case 0xBB: case 0xBC:
+ // 繝輔ぅ繝ォ繧、繝ウ繧オ繧ヲ繝ウ繝
+ //case 0x1F: case 0x2F: case 0xAF:
+ // 閾ェ蜍墓シ泌・上メ繝繝
+ //case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69:
+ //case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79:
+ //case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89:
+ //case 0x90: case 0x91: case 0x92:
+
+ #region [ 逋コ髻ウ1遘貞燕縺ョ繧ソ繧、繝溘Φ繧ー繧堤ョ怜コ ]
+ int n逋コ髻ウ蜑堺ス呵」瀕s = 1000, n逋コ髻ウ蠕御ス呵」瀕s = 800;
+ {
+ int ch = pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >> 4;
+ if (ch == 0x02 || ch == 0x0A)
+ {
+ n逋コ髻ウ蜑堺ス呵」瀕s = 800;
+ n逋コ髻ウ蜑堺ス呵」瀕s = 500;
+ }
+ if (ch == 0x06 || ch == 0x07 || ch == 0x08 || ch == 0x09)
+ {
+ n逋コ髻ウ蜑堺ス呵」瀕s = 200;
+ n逋コ髻ウ蜑堺ス呵」瀕s = 500;
+ }
+ }
+ #endregion
+ #region [ BGM繝√ャ繝励↑繧峨ー蜊ウ繝溘く繧オ繝シ縺ォ霑ス蜉 ]
+ //if ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 ) // BGM繝√ャ繝励ッ蜊ウ繝溘く繧オ繝シ縺ォ霑ス蜉
+ //{
+ // if ( listWAV.ContainsKey( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) )
+ // {
+ // CDTX.CWAV wc = CDTXMania.DTX.listWAV[ pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ];
+ // if ( wc.rSound[ 0 ] != null )
+ // {
+ // CDTXMania.Sound邂。逅.AddMixer( wc.rSound[ 0 ] ); // BGM縺ッ螟夐榊咲函縺励↑縺莉墓ァ倥→縺励※縺繧九ョ縺ァ縲1蛟狗岼縺縺代Α繧ュ繧オ繝シ縺ォ逋サ骭イ縺吶l縺ー繧医>
+ // }
+ // }
+ //}
+ #endregion
+ #region [ 逋コ髻ウ1遘貞燕縺ョ繧ソ繧、繝溘Φ繧ー繧堤ョ怜コ ]
+ int nAddMixer譎ょ綾ms, nAddMixer菴咲スョ = 0;
+ //Debug.WriteLine("==================================================================");
+ //Debug.WriteLine( "Start: ch=" + pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString("x2") + ", nWAV逡ェ蜿キ=" + pChip.n謨エ謨ー蛟、 + ", time=" + pChip.n逋コ螢ー譎ょ綾ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms );
+ t逋コ螢ー譎ょ綾ms縺ィ逋コ螢ー菴咲スョ繧貞叙蠕励☆繧(pChip.n逋コ螢ー譎ょ綾ms - n逋コ髻ウ蜑堺ス呵」瀕s, out nAddMixer譎ょ綾ms, out nAddMixer菴咲スョ);
+ //Debug.WriteLine( "nAddMixer譎ょ綾ms=" + nAddMixer譎ょ綾ms + ",nAddMixer菴咲スョ=" + nAddMixer菴咲スョ );
+
+ CChip c_AddMixer = new CChip()
+ {
+ n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDA,
+ n謨エ謨ー蛟、 = pChip.n謨エ謨ー蛟、,
+ n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ,
+ n逋コ螢ー譎ょ綾ms = nAddMixer譎ょ綾ms,
+ n逋コ螢ー菴咲スョ = nAddMixer菴咲スョ,
+ b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = false
+ };
+ listAddMixerChannel.Add(c_AddMixer);
+ //Debug.WriteLine("listAddMixerChannel:" );
+ //DebugOut_CChipList( listAddMixerChannel );
+ #endregion
+
+ int duration = 0;
+ if (listWAV.TryGetValue(pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CDTX.CWAV wc))
+ {
+ double _db蜀咲函騾溷コヲ = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : this.db蜀咲函騾溷コヲ;
+ duration = (wc.rSound[0] == null) ? 0 : (int)(wc.rSound[0].n邱乗シ泌・乗凾髢杜s / _db蜀咲函騾溷コヲ); // #23664 duration縺ォ蜀咲函騾溷コヲ縺悟刈蜻ウ縺輔l縺ヲ縺翫i縺壹∽ス朱溷咲函縺ァBGM縺碁泌繧後k蝠城。後r菫ョ豁」 (逋コ螢ー譎ょ綾ms縺ッ縲.TX隱ュ縺ソ霎シ縺ソ譎ゅ↓蜀咲函騾溷コヲ蜉蜻ウ貂)
+ }
+ //Debug.WriteLine("duration=" + duration );
+ int n譁ーRemoveMixer譎ょ綾ms, n譁ーRemoveMixer菴咲スョ;
+ t逋コ螢ー譎ょ綾ms縺ィ逋コ螢ー菴咲スョ繧貞叙蠕励☆繧(pChip.n逋コ螢ー譎ょ綾ms + duration + n逋コ髻ウ蠕御ス呵」瀕s, out n譁ーRemoveMixer譎ょ綾ms, out n譁ーRemoveMixer菴咲スョ);
+ //Debug.WriteLine( "n譁ーRemoveMixer譎ょ綾ms=" + n譁ーRemoveMixer譎ょ綾ms + ",n譁ーRemoveMixer菴咲スョ=" + n譁ーRemoveMixer菴咲スョ );
+ if (n譁ーRemoveMixer譎ょ綾ms < pChip.n逋コ螢ー譎ょ綾ms + duration) // 譖イ縺ョ譛蠕後〒繧オ繧ヲ繝ウ繝峨′蛻繧後k繧医≧縺ェ蝣エ蜷医ッ
+ {
+ CChip c_AddMixer_noremove = c_AddMixer;
+ c_AddMixer_noremove.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = true;
+ listAddMixerChannel[listAddMixerChannel.Count - 1] = c_AddMixer_noremove;
+ //continue; // 逋コ螢ー菴咲スョ縺ョ險育ョ励′縺ァ縺阪↑縺縺ョ縺ァ縲`ixer蜑企勁繧偵≠縺阪i繧√k___縺ョ縺ァ縺ッ縺ェ縺
+ // #32248 2013.10.15 yyagi 貍泌・冗オゆコ蠕後b蜀咲函繧堤カ壹¢繧九メ繝繝励〒縺ゅk縺ィ縺縺繝輔Λ繧ー繧恥Chip蜀縺ォ遶九※繧
+ break;
+ }
+ #region [ 譛ェ菴ソ逕ィ繧ウ繝シ繝 ]
+ //if ( n譁ーRemoveMixer譎ょ綾ms < pChip.n逋コ螢ー譎ょ綾ms + duration ) // 譖イ縺ョ譛蠕後〒繧オ繧ヲ繝ウ繝峨′蛻繧後k繧医≧縺ェ蝣エ蜷
+ //{
+ // n譁ーRemoveMixer譎ょ綾ms = pChip.n逋コ螢ー譎ょ綾ms + duration;
+ // // 縲御ス咲スョ縲阪ッ豈比セ玖ィ育ョ励〒豎ゅa縺ヲ縺願幻繧呈ソ√☆...縺薙ョ繧繧頑婿縺縺ィ隱、蜍穂ス懊@縺溘◆繧∝ッセ蠢應クュ豁「
+ // n譁ーRemoveMixer菴咲スョ = listChip[ listChip.Count - 1 ].n逋コ螢ー菴咲スョ * n譁ーRemoveMixer譎ょ綾ms / listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms;
+ //}
+ #endregion
+
+ #region [ 逋コ髻ウ邨ゆコ2遘貞セ後↓mixer縺九i蜑企勁縺吶k縺後√◎縺ョ蜑阪↓蜀咲匱髻ウ縺吶k縺薙→縺ォ縺ェ繧九ョ縺九r遒コ隱(蜀咲匱髻ウ縺ェ繧盈ixer蜑企勁繧ソ繧、繝溘Φ繧ー繧貞サカ譛) ]
+ int n謨エ謨ー蛟、 = pChip.n謨エ謨ー蛟、;
+ int index = listRemoveTiming.FindIndex(
+ delegate (CChip cchip) { return cchip.n謨エ謨ー蛟、 == n謨エ謨ー蛟、; }
+ );
+ //Debug.WriteLine( "index=" + index );
+ if (index >= 0) // 驕主悉縺ォ蜷後§繝√ャ繝励〒逋コ髻ウ荳ュ縺ョ繧ゅョ縺瑚ヲ九▽縺九▲縺溷エ蜷
+ { // 驕主悉縺ョ逋コ髻ウ縺ョmixer蜑企勁繧堤「コ螳壹&縺帙k縺九∝サカ譛溘☆繧九°縺ョ2謚槭
+ int n譌ァRemoveMixer譎ょ綾ms = listRemoveTiming[index].n逋コ螢ー譎ょ綾ms;
+ int n譌ァRemoveMixer菴咲スョ = listRemoveTiming[index].n逋コ螢ー菴咲スョ;
+
+ //Debug.WriteLine( "n譌ァRemoveMixer譎ょ綾ms=" + n譌ァRemoveMixer譎ょ綾ms + ",n譌ァRemoveMixer菴咲スョ=" + n譌ァRemoveMixer菴咲スョ );
+ if (pChip.n逋コ螢ー譎ょ綾ms - n逋コ髻ウ蜑堺ス呵」瀕s <= n譌ァRemoveMixer譎ょ綾ms) // mixer蜑企勁蜑阪↓縲∝酔縺倬浹縺ョ蜀咲匱髻ウ縺後≠繧句エ蜷医ッ縲
+ { // mixer蜑企勁譎ょ綾繧帝≦蟒カ縺輔○繧(if-else蠕後↓陦後≧)
+ //Debug.WriteLine( "remove TAIL of listAddMixerChannel. TAIL INDEX=" + listAddMixerChannel.Count );
+ //DebugOut_CChipList( listAddMixerChannel );
+ listAddMixerChannel.RemoveAt(listAddMixerChannel.Count - 1); // 縺セ縺溘∝酔縺倥メ繝繝鈴浹縺ョ縲稽ixer縺ク縺ョ蜀崎ソス蜉縲阪ッ蜑企勁縺吶k
+ //Debug.WriteLine( "removed result:" );
+ //DebugOut_CChipList( listAddMixerChannel );
+ }
+ else // 騾縺ォ縲∵凾髢楢サク荳翫[ixer蜑企勁蠕後↓蜀咲匱髻ウ縺吶k繧医≧縺ェ豬√l縺ョ蝣エ蜷医ッ
+ {
+ //Debug.WriteLine( "Publish the value(listRemoveTiming[index] to listRemoveMixerChannel." );
+ listRemoveMixerChannel.Add(listRemoveTiming[index]); // mixer蜑企勁繧堤「コ螳壹&縺帙k
+ //Debug.WriteLine( "listRemoveMixerChannel:" );
+ //DebugOut_CChipList( listRemoveMixerChannel );
+ //listRemoveTiming.RemoveAt( index );
+ }
+ CChip c = new CChip() // mixer蜑企勁譎ょ綾繧呈峩譁ー(驕蟒カ)縺吶k
+ {
+ n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDB,
+ n謨エ謨ー蛟、 = listRemoveTiming[index].n謨エ謨ー蛟、,
+ n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = listRemoveTiming[index].n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ,
+ n逋コ螢ー譎ょ綾ms = n譁ーRemoveMixer譎ょ綾ms,
+ n逋コ螢ー菴咲スョ = n譁ーRemoveMixer菴咲スョ
+ };
+ listRemoveTiming[index] = c;
+ //listRemoveTiming[ index ].n逋コ螢ー譎ょ綾ms = n譁ーRemoveMixer譎ょ綾ms; // mixer蜑企勁譎ょ綾繧呈峩譁ー(驕蟒カ)縺吶k
+ //listRemoveTiming[ index ].n逋コ螢ー菴咲スョ = n譁ーRemoveMixer菴咲スョ;
+ //Debug.WriteLine( "listRemoveTiming: modified" );
+ //DebugOut_CChipList( listRemoveTiming );
+ }
+ else // 驕主悉縺ォ蜷後§繝√ャ繝励r逋コ髻ウ縺励※縺縺ェ縺or
+ { // 逋コ髻ウ縺励※縺縺溘′譌「縺ォmixer蜑企勁遒コ螳壹@縺ヲ縺縺溘↑繧
+ CChip c = new CChip() // 譁ー縺励¥mixer蜑企勁蛟呵」懊→縺励※霑ス蜉縺吶k
+ {
+ n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDB,
+ n謨エ謨ー蛟、 = pChip.n謨エ謨ー蛟、,
+ n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ,
+ n逋コ螢ー譎ょ綾ms = n譁ーRemoveMixer譎ょ綾ms,
+ n逋コ螢ー菴咲スョ = n譁ーRemoveMixer菴咲スョ
+ };
+ //Debug.WriteLine( "Add new chip to listRemoveMixerTiming: " );
+ //Debug.WriteLine( "ch=" + c.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString( "x2" ) + ", nWAV逡ェ蜿キ=" + c.n謨エ謨ー蛟、 + ", time=" + c.n逋コ螢ー譎ょ綾ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms );
+ listRemoveTiming.Add(c);
+ //Debug.WriteLine( "listRemoveTiming:" );
+ //DebugOut_CChipList( listRemoveTiming );
+ }
+ #endregion
+ break;
+ }
+ }
+ //Debug.WriteLine("==================================================================");
+ //Debug.WriteLine( "Result:" );
+ //Debug.WriteLine( "listAddMixerChannel:" );
+ //DebugOut_CChipList( listAddMixerChannel );
+ //Debug.WriteLine( "listRemoveMixerChannel:" );
+ //DebugOut_CChipList( listRemoveMixerChannel );
+ //Debug.WriteLine( "listRemoveTiming:" );
+ //DebugOut_CChipList( listRemoveTiming );
+ //Debug.WriteLine( "==================================================================" );
+
+ listChip.AddRange(listAddMixerChannel);
+ listChip.AddRange(listRemoveMixerChannel);
+ listChip.AddRange(listRemoveTiming);
+ listChip.Sort();
+ }
+ private void DebugOut_CChipList(List c)
+ {
+ //Debug.WriteLine( "Count=" + c.Count );
+ for (int i = 0; i < c.Count; i++)
+ {
+ Debug.WriteLine(i + ": ch=" + c[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString("x2") + ", WAV逡ェ蜿キ=" + c[i].n謨エ謨ー蛟、 + ", time=" + c[i].n逋コ螢ー譎ょ綾ms);
+ }
+ }
+ private bool t逋コ螢ー譎ょ綾ms縺ィ逋コ螢ー菴咲スョ繧貞叙蠕励☆繧(int n蟶梧悍逋コ螢ー譎ょ綾ms, out int n譁ー逋コ螢ー譎ょ綾ms, out int n譁ー逋コ螢ー菴咲スョ)
+ {
+ // 逋コ螢ー譎ょ綾ms縺九i逋コ螢ー菴咲スョ繧帝邂励☆繧九%縺ィ縺ッ縺ァ縺阪↑縺縺溘a縲∬ソ台シシ險育ョ励☆繧九
+ // 蜈キ菴鍋噪縺ォ縺ッ縲∝ク梧悍逋コ螢ー菴咲スョ蜑榊セ後ョ2縺、縺ョ繝√ャ繝励ョ逋コ螢ー菴咲スョ縺ョ荳ュ髢薙r蜿悶k縲
+
+ if (n蟶梧悍逋コ螢ー譎ょ綾ms < 0)
+ {
+ n蟶梧悍逋コ螢ー譎ょ綾ms = 0;
+ }
+ //else if ( n蟶梧悍逋コ螢ー譎ょ綾ms > listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms ) // BGM縺ョ譛蠕後ョ菴咎渊繧呈ョコ縺励※縺励∪縺縺ョ縺ァ縲√%縺ョ譚。莉カ縺ッ螟悶☆
+ //{
+ // n蟶梧悍逋コ螢ー譎ょ綾ms = listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms;
+ //}
+
+ int index_min = -1, index_max = -1;
+ for (int i = 0; i < listChip.Count; i++) // 蟶梧悍逋コ螢ー菴咲スョ蜑榊セ後ョ縲悟燕縲阪ョ譁ケ縺ョ繝√ャ繝励r讀懃エ「
+ {
+ if (listChip[i].n逋コ螢ー譎ょ綾ms >= n蟶梧悍逋コ螢ー譎ょ綾ms)
+ {
+ index_min = i;
+ break;
+ }
+ }
+ if (index_min < 0) // 蟶梧悍逋コ螢ー譎ょ綾縺ォ閾ウ繧峨★縺ォ譖イ縺檎オゆコ縺励※縺励∪縺蝣エ蜷
+ {
+ // list縺ョ譛邨る逶ョ縺ョ譎ょ綾繧偵◎縺ョ縺セ縺セ菴ソ逕ィ縺吶k
+ //___縺ョ縺ァ縺ッ繝繝。縲BGM縺悟ーサ蛻繧後↓縺ェ繧九
+ // 縺昴%縺ァ縲〕ist縺ョ譛邨る逶ョ縺ョ逋コ螢ー譎ょ綾ms縺ィ逋コ逕滉ス咲スョ縺九i縲∝ク梧悍逋コ螢ー譎ょ綾縺ォ逶ク蠖薙☆繧句ク梧悍逋コ螢ー菴咲スョ繧呈ッ比セ玖ィ育ョ励@縺ヲ豎ゅa繧九
+ //n譁ー逋コ螢ー譎ょ綾ms = n蟶梧悍逋コ螢ー譎ょ綾ms;
+ //n譁ー逋コ螢ー菴咲スョ = listChip[ listChip.Count - 1 ].n逋コ螢ー菴咲スョ * n蟶梧悍逋コ螢ー譎ょ綾ms / listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms;
+ n譁ー逋コ螢ー譎ょ綾ms = listChip[listChip.Count - 1].n逋コ螢ー譎ょ綾ms;
+ n譁ー逋コ螢ー菴咲スョ = listChip[listChip.Count - 1].n逋コ螢ー菴咲スョ;
+ return false;
+ }
+ index_max = index_min + 1;
+ if (index_max >= listChip.Count)
+ {
+ index_max = index_min;
+ }
+ n譁ー逋コ螢ー譎ょ綾ms = (listChip[index_max].n逋コ螢ー譎ょ綾ms + listChip[index_min].n逋コ螢ー譎ょ綾ms) / 2;
+ n譁ー逋コ螢ー菴咲スョ = (listChip[index_max].n逋コ螢ー菴咲スョ + listChip[index_min].n逋コ螢ー菴咲スョ) / 2;
+
+ return true;
+ }
+
+ public void SwapGuitarBassInfos()
+ {
+ }
+
+ // SwapGuitarBassInfos_AutoFlags()縺ッ縲,DTX縺九iCConfigIni縺ォ遘サ蜍輔
+
+ // CActivity 螳溯」
+ private CPrivateFastFont pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝;
+ public override void On豢サ諤ァ蛹()
+ {
+ if (!string.IsNullOrEmpty(TJAPlayer3.Skin.Game_Lyric_FontName))
+ {
+ this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝 = new CPrivateFastFont(new FontFamily(TJAPlayer3.Skin.Game_Lyric_FontName), TJAPlayer3.Skin.Game_Lyric_FontSize);
+ }
+ else
+ {
+ this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝 = new CPrivateFastFont(new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.Game_Lyric_FontSize);
+ }
+ this.listWAV = new Dictionary();
+ this.listBPM = new Dictionary();
+ this.listSCROLL = new Dictionary();
+ this.listSCROLL_Normal = new Dictionary();
+ this.listSCROLL_Expert = new Dictionary();
+ this.listSCROLL_Master = new Dictionary();
+ this.listJPOSSCROLL = new Dictionary();
+ this.listDELAY = new Dictionary();
+ this.listBRANCH = new Dictionary();
+ this.listAVI = new Dictionary();
+ this.listAVIPAN = new Dictionary();
+ this.listDS = new Dictionary();
+ this.listChip = new List();
+ this.listChip_Branch = new List[3];
+ this.listChip_Branch[0] = new List();
+ this.listChip_Branch[1] = new List();
+ this.listChip_Branch[2] = new List();
+ this.listBalloon = new List();
+ this.listBalloon_Normal = new List();
+ this.listBalloon_Expert = new List();
+ this.listBalloon_Master = new List();
+ this.listLine = new List