OSDN Git Service

#30333 rev951のコミット漏れ。
authoryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Thu, 24 Mar 2016 15:45:00 +0000 (15:45 +0000)
committeryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Thu, 24 Mar 2016 15:45:00 +0000 (15:45 +0000)
git-svn-id: http://svn.osdn.jp/svnroot/dtxmania/branches/160321(DTXCreator%20with%20MIDI%20Import)@952 16f42ceb-6dc6-49c8-ba94-f2d53467949d

DTXCreatorプロジェクト/コード/07.MIDIインポート/CMIDIイベント.cs [new file with mode: 0644]
DTXCreatorプロジェクト/コード/07.MIDIインポート/CMIDIチップ.cs [deleted file]

diff --git a/DTXCreatorプロジェクト/コード/07.MIDIインポート/CMIDIイベント.cs b/DTXCreatorプロジェクト/コード/07.MIDIインポート/CMIDIイベント.cs
new file mode 100644 (file)
index 0000000..eddfc59
--- /dev/null
@@ -0,0 +1,128 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+using System.Windows.Forms;\r
+using System.Diagnostics;\r
+\r
+namespace DTXCreator.MIDIインポート\r
+{\r
+       /// <summary>\r
+       /// MIDIイベントのbaseクラス\r
+       /// 手抜きのため、オリジナルのCMIDIチップクラスをほぼそのまま流用。\r
+       /// </summary>\r
+       abstract class CMIDIイベント\r
+    {\r
+               public enum Eイベントタイプ : int\r
+               {\r
+                       NoteOnOff,\r
+                       BPM,\r
+                       BarLen,\r
+                       Unknown\r
+               }\r
+\r
+               public Eイベントタイプ eイベントタイプ;\r
+               public int nレーン番号;\r
+        public UInt32 n時間;\r
+        public int nWAV;\r
+        public int nキー;\r
+        public bool b入力;\r
+        public string strコメント;\r
+               public int nベロシティ;\r
+               public int nベロシティ_DTX変換後;\r
+\r
+               public string strWAV重複チェック\r
+               {\r
+                       get\r
+                       {\r
+                               return "" + nキー.ToString() + " : " + nベロシティ_DTX変換後.ToString();\r
+                       }\r
+               }\r
+\r
+\r
+               public CMIDIイベント()\r
+               {\r
+                       this.eイベントタイプ = Eイベントタイプ.Unknown;\r
+               }\r
+\r
+               abstract public void 挿入( Cメインフォーム mf, int n四分音符の分解能 );\r
+    }\r
+\r
+\r
+       /// <summary>\r
+       /// NoteOn/OffのMIDIイベント\r
+       /// </summary>\r
+       class CMIDINote: CMIDIイベント\r
+       {\r
+               public CMIDINote( UInt32 _n時間, int _nキー, int _nベロシティ )\r
+                       : base()\r
+        {\r
+            this.nレーン番号 = 2;\r
+            this.n時間 = _n時間;\r
+            this.nWAV = 1;\r
+            this.nキー = _nキー;\r
+                       \r
+            this.nベロシティ = _nベロシティ;\r
+            this.nベロシティ_DTX変換後 = _nベロシティ;\r
+\r
+                       this.eイベントタイプ = Eイベントタイプ.NoteOnOff;\r
+               }\r
+\r
+               public override void 挿入( Cメインフォーム mf, int n四分音符の分解能 )\r
+               {\r
+                       //Debug.WriteLine( "NoteOn: " +  (n時間 * ( 192 / 4 ) / n四分音符の分解能).ToString() + "key=" + nキー.ToString("d2") );\r
+\r
+                       mf.mgr譜面管理者.tチップを配置または置換する\r
+                               ( nレーン番号, (int) n時間 * ( 192 / 4 ) / n四分音符の分解能, nWAV, 0f, false ); \r
+\r
+                       // ★★時間について、要変拍子対応\r
+\r
+                       //Debug.WriteLine( " Done." );\r
+               }\r
+       }\r
+\r
+       /// <summary>\r
+       /// テンポ変更のメタイベント\r
+       /// </summary>\r
+       class CMIDIBPM : CMIDIイベント\r
+       {\r
+               float fBPM;\r
+               public CMIDIBPM( UInt32 _n時間, float _fBPM )\r
+                       : base()\r
+               {\r
+                       this.nレーン番号 = 2;\r
+                       this.n時間 = _n時間;\r
+                       this.nWAV = 1;\r
+                       this.fBPM = _fBPM;\r
+\r
+                       this.eイベントタイプ = Eイベントタイプ.BPM;\r
+               }\r
+\r
+               public override void 挿入( Cメインフォーム mf, int n四分音符の分解能 )\r
+               {\r
+                       //Debug.Write( "BPM   : " + ( n時間 * ( 192 / 4 ) / n四分音符の分解能 ).ToString() + ": " + fBPM );\r
+                       \r
+                       int nGrid = (int) n時間 * ( 192 / 4 ) / n四分音符の分解能;                            // 全音符192tick相当で、曲先頭からのtick数(変拍子がない場合)\r
+                       mf.mgr編集モード管理者.tBPMチップを配置する( nGrid, fBPM );\r
+\r
+                       //Debug.WriteLine( " Done." );\r
+               }\r
+       }\r
+\r
+\r
+       /// <summary>\r
+       /// 拍子変更のメタイベント\r
+       /// </summary>\r
+       class CMIDIBARLen : CMIDIイベント\r
+       {\r
+               public CMIDIBARLen( UInt32 _n時間, int _分子, int _分母 )\r
+               {\r
+               }\r
+               public override void 挿入( Cメインフォーム mf, int n四分音符の分解能 )\r
+               {\r
+                       //      mf.mgr譜面管理者.  public C小節 p譜面先頭からの位置gridを含む小節を返す( int n譜面先頭からの位置grid )\r
+                       throw new NotImplementedException();\r
+               }\r
+       }\r
+}\r
diff --git a/DTXCreatorプロジェクト/コード/07.MIDIインポート/CMIDIチップ.cs b/DTXCreatorプロジェクト/コード/07.MIDIインポート/CMIDIチップ.cs
deleted file mode 100644 (file)
index 7db91b7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Windows.Forms;\r
-\r
-namespace DTXCreator.MIDIインポート\r
-{\r
-       class CMIDIチップ\r
-    {\r
-        public int nレーン番号;\r
-        public int n時間;\r
-        public int nWAV;\r
-        public int nキー;\r
-        public int nベロシティ;\r
-        public int nベロシティ_DTX変換後;\r
-        public bool b入力;\r
-        public string strコメント;\r
-        public CMIDI cMIDI;\r
-\r
-        public string strWAV重複チェック\r
-               {\r
-                       get\r
-                       {\r
-                               return "" + nキー.ToString() + " : " + nベロシティ_DTX変換後.ToString();\r
-                       }\r
-               }\r
-\r
-        public CMIDIチップ( CMIDI _cMIDI, int _n時間, int _nキー, int _nベロシティ )\r
-        {\r
-            this.nレーン番号 = 2;\r
-            this.n時間 = _n時間;\r
-            this.nWAV = 1;\r
-            this.nキー = _nキー;\r
-            this.cMIDI = _cMIDI;\r
-                       \r
-            this.nベロシティ = _nベロシティ;\r
-            this.nベロシティ_DTX変換後 = _nベロシティ;\r
-        }\r
-               \r
-    }\r
-}\r