• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

test


Commit MetaInfo

Revision888ed3a5f22df4f08329396cc167ec579af956e5 (tree)
Time2012-05-08 01:07:08
Authortyiki badwell <miria@user...>
Commitertyiki badwell

Log Message

tickはIDataではなく、もっとシーケンサ寄りのインタフェースに移動

Change Summary

Incremental Difference

--- a/Core/Momiji.Core.DeviceInfo.cpp
+++ b/Core/Momiji.Core.DeviceInfo.cpp
@@ -234,8 +234,8 @@ namespace DeviceInfo {
234234 )
235235 )
236236 {
237- auto error = InteropServices::Marshal::GetHRForLastWin32Error();
238237 #ifdef _DEBUG
238+ auto error = InteropServices::Marshal::GetHRForLastWin32Error();
239239 System::Console::WriteLine("[{0}] error [{1}]",__FUNCTION__, InteropServices::Marshal::GetExceptionForHR(error)->ToString());
240240 #endif
241241 return nullptr;
@@ -329,8 +329,8 @@ namespace DeviceInfo {
329329 );
330330 if (regKey->IsInvalid)
331331 {
332- auto error = InteropServices::Marshal::GetHRForLastWin32Error();
333332 #ifdef _DEBUG
333+ auto error = InteropServices::Marshal::GetHRForLastWin32Error();
334334 System::Console::WriteLine("[{0}] error {1:X}",__FUNCTION__, InteropServices::Marshal::GetExceptionForHR(error)->ToString());
335335 #endif
336336 return nullptr;
--- a/Core/Momiji.Core.Interface.h
+++ b/Core/Momiji.Core.Interface.h
@@ -35,6 +35,7 @@ namespace Core {
3535
3636 public interface class IPacket
3737 {
38+ property IData^ data{ IData^ get(); };
3839 property System::UInt64 tick{ System::UInt64 get(); };
3940 };
4041
@@ -43,7 +44,6 @@ namespace Core {
4344 {
4445 property IStreamPacket^ next{ IStreamPacket^ get(); };
4546 property System::Boolean hasNext{ System::Boolean get(); };
46- property IData^ data{ IData^ get(); };
4747 };
4848
4949 public interface class ITrack
--- a/Core/Momiji.Core.Midi.Data.h
+++ b/Core/Momiji.Core.Midi.Data.h
@@ -36,14 +36,12 @@ namespace Midi {
3636 : public Core::IData
3737 {
3838 private:
39- initonly System::UInt64 _tick;
4039 initonly System::UInt16 _port;
4140
4241 protected:
4342 MidiData(
44- System::UInt64 tick,
4543 System::UInt16 port
46- ): _tick(tick), _port(port){}
44+ ): _port(port){}
4745
4846 public:
4947 enum class TYPE: System::Byte
@@ -61,7 +59,6 @@ namespace Midi {
6159 META = 0xFF,
6260 };
6361
64- property System::UInt64 tick { virtual System::UInt64 get() {return this->_tick;} }
6562 property System::UInt16 port { System::UInt16 get() {return this->_port;} }
6663 };
6764
@@ -75,12 +72,11 @@ namespace Midi {
7572
7673 public:
7774 ShortData(
78- System::UInt64 tick,
7975 System::UInt16 port,
8076 System::Byte status,
8177 System::Byte param1,
8278 System::Byte param2
83- ): MidiData(tick, port), _status(status), _param1(param1), _param2(param2) {}
79+ ): MidiData(port), _status(status), _param1(param1), _param2(param2) {}
8480
8581 property System::Byte status { System::Byte get() {return this->_status;} }
8682 property System::Byte param1 { System::Byte get() {return this->_param1;} }
@@ -107,11 +103,10 @@ namespace Midi {
107103
108104 public:
109105 LongData(
110- System::UInt64 tick,
111106 System::UInt16 port,
112107 array<System::Byte>^ longData,
113108 System::UInt32 useSize
114- ): MidiData(tick, port), _longData(longData), _useSize(useSize) {}
109+ ): MidiData(port), _longData(longData), _useSize(useSize) {}
115110
116111 property array<System::Byte>^ longData { array<System::Byte>^ get() {return this->_longData;} }
117112 property System::UInt32 useSize { System::UInt32 get() { return this->_useSize; } }
--- a/Core/Momiji.Interop.Vst.h
+++ b/Core/Momiji.Interop.Vst.h
@@ -716,8 +716,6 @@ namespace Vst {
716716 );
717717
718718 VST_DLL_DELEGATE(Ansi) delegate System::IntPtr VSTPluginMain(
719- //[InteropServices::In][InteropServices::MarshalAs(InteropServices::UnmanagedType::FunctionPtr)]
720- // AudioMasterProc^ audioMaster
721719 [InteropServices::In][InteropServices::MarshalAs(InteropServices::UnmanagedType::FunctionPtr)]
722720 AudioMasterCallBack::Delegate^ audioMaster
723721 );
--- a/Core/Momiji.Sequencer.Midi.Smf.cpp
+++ b/Core/Momiji.Sequencer.Midi.Smf.cpp
@@ -234,10 +234,10 @@ namespace Smf {
234234
235235 this->_nowTick = .0;
236236
237- this->_metaData[MetaData::META_TYPE::SET_TEMPO] = gcnew MetaSetTempo(0, 600000);
238- this->_metaData[MetaData::META_TYPE::PORT] = gcnew MetaPort(0, 0);
239- this->_metaData[MetaData::META_TYPE::TIME_SIGNATURE] = gcnew MetaTimeSignature(0, 4, 4, 24, 8);
240- this->_metaData[MetaData::META_TYPE::KEY_SIGNATURE] = gcnew MetaKeySignature(0, 0, false);
237+ this->_metaData[MetaData::META_TYPE::SET_TEMPO] = gcnew MetaSetTempo(600000);
238+ this->_metaData[MetaData::META_TYPE::PORT] = gcnew MetaPort(0);
239+ this->_metaData[MetaData::META_TYPE::TIME_SIGNATURE] = gcnew MetaTimeSignature(4, 4, 24, 8);
240+ this->_metaData[MetaData::META_TYPE::KEY_SIGNATURE] = gcnew MetaKeySignature(0, false);
241241
242242 this->_headPacket =
243243 gcnew SmfPacket(
@@ -328,7 +328,6 @@ namespace Smf {
328328 {
329329 data =
330330 gcnew Core::Midi::ShortData(
331- this->_tick,
332331 metaPort->number,
333332 this->_status,
334333 param1,
@@ -341,7 +340,6 @@ namespace Smf {
341340 {
342341 data =
343342 gcnew Core::Midi::ShortData(
344- this->_tick,
345343 metaPort->number,
346344 this->_status,
347345 param1,
@@ -362,7 +360,6 @@ namespace Smf {
362360
363361 data =
364362 gcnew Core::Midi::LongData(
365- this->_tick,
366363 metaPort->number,
367364 longData,
368365 longData->Length
@@ -393,7 +390,6 @@ namespace Smf {
393390 {
394391 data =
395392 gcnew MetaSequenceNumber(
396- this->_tick,
397393 Util::ToHostOrder(System::BitConverter::ToUInt16(bytes,0))
398394 );
399395 break;
@@ -402,7 +398,6 @@ namespace Smf {
402398 {
403399 data =
404400 gcnew MetaText(
405- this->_tick,
406401 ""
407402 );
408403 break;
@@ -411,7 +406,6 @@ namespace Smf {
411406 {
412407 data =
413408 gcnew MetaCopyrightNotice(
414- this->_tick,
415409 ""
416410 );
417411 break;
@@ -420,7 +414,6 @@ namespace Smf {
420414 {
421415 data =
422416 gcnew MetaTrackName(
423- this->_tick,
424417 ""
425418 );
426419 break;
@@ -429,7 +422,6 @@ namespace Smf {
429422 {
430423 data =
431424 gcnew MetaInstrumentName(
432- this->_tick,
433425 ""
434426 );
435427 break;
@@ -438,7 +430,6 @@ namespace Smf {
438430 {
439431 data =
440432 gcnew MetaLyric(
441- this->_tick,
442433 ""
443434 );
444435 break;
@@ -447,7 +438,6 @@ namespace Smf {
447438 {
448439 data =
449440 gcnew MetaMarker(
450- this->_tick,
451441 ""
452442 );
453443 break;
@@ -456,7 +446,6 @@ namespace Smf {
456446 {
457447 data =
458448 gcnew MetaCuePoint(
459- this->_tick,
460449 ""
461450 );
462451 break;
@@ -465,7 +454,6 @@ namespace Smf {
465454 {
466455 data =
467456 gcnew MetaProgramName(
468- this->_tick,
469457 ""
470458 );
471459 break;
@@ -474,7 +462,6 @@ namespace Smf {
474462 {
475463 data =
476464 gcnew MetaDeviceName(
477- this->_tick,
478465 ""
479466 );
480467 break;
@@ -485,7 +472,6 @@ namespace Smf {
485472
486473 data =
487474 gcnew MetaPort(
488- this->_tick,
489475 port //ToHostOrder(System::BitConverter::ToUInt16(bytes,0))
490476 );
491477 break;
@@ -493,9 +479,7 @@ namespace Smf {
493479 case MetaData::META_TYPE::END_OF_TRACK: // {FF: '2F' 00}
494480 {
495481 data =
496- gcnew MetaEndOfTrack(
497- this->_tick
498- );
482+ gcnew MetaEndOfTrack();
499483
500484 this->_isTerminate = true;
501485 break;
@@ -510,7 +494,6 @@ namespace Smf {
510494
511495 data =
512496 gcnew MetaSetTempo(
513- this->_tick,
514497 Util::ToHostOrder(System::BitConverter::ToUInt32(tempo, 0))
515498 );
516499
@@ -520,7 +503,6 @@ namespace Smf {
520503 {
521504 data =
522505 gcnew MetaSMPTEOffset(
523- this->_tick,
524506 bytes[0],
525507 bytes[1],
526508 bytes[2],
@@ -533,7 +515,6 @@ namespace Smf {
533515 {
534516 data =
535517 gcnew MetaTimeSignature(
536- this->_tick,
537518 bytes[0],
538519 2 ^ bytes[1],
539520 bytes[2],
@@ -545,7 +526,6 @@ namespace Smf {
545526 {
546527 data =
547528 gcnew MetaKeySignature(
548- this->_tick,
549529 bytes[0],
550530 System::BitConverter::ToBoolean(bytes,1)
551531 );
--- a/Core/Momiji.Sequencer.Midi.Smf.h
+++ b/Core/Momiji.Sequencer.Midi.Smf.h
@@ -77,17 +77,14 @@ namespace Smf {
7777 SEQ_SP_METAEVENT = 0x7F, // {FF: '7F' length data ユーザ定義メタ}
7878 };
7979 private:
80- System::UInt64 _tick;
8180 META_TYPE _type;
8281 System::Boolean _conductor;
8382 public:
8483 MetaData(
85- System::UInt64 tick,
8684 META_TYPE type,
8785 System::Boolean conductor
88- ) : _tick(tick), _type(type), _conductor(conductor) {}
86+ ) : _type(type), _conductor(conductor) {}
8987
90- property System::UInt64 tick { virtual System::UInt64 get() {return this->_tick;} }
9188 property META_TYPE type { META_TYPE get() {return this->_type;} }
9289 property System::Boolean conductor { System::Boolean get() {return this->_conductor;} }
9390 };
@@ -100,9 +97,8 @@ namespace Smf {
10097
10198 public:
10299 MetaSequenceNumber(
103- System::UInt64 tick,
104100 System::UInt16 number
105- ): MetaData(tick, META_TYPE::SEQUENCE_NUMBER, false), _number(number) {}
101+ ): MetaData(META_TYPE::SEQUENCE_NUMBER, false), _number(number) {}
106102
107103 property System::UInt16 number { System::UInt16 get() {return this->_number;} }
108104 };
@@ -114,9 +110,8 @@ namespace Smf {
114110 System::String^ _text;
115111 public:
116112 MetaText(
117- System::UInt64 tick,
118113 System::String^ text
119- ): MetaData(tick, META_TYPE::TEXT_EVENT, false), _text(text) {}
114+ ): MetaData(META_TYPE::TEXT_EVENT, false), _text(text) {}
120115
121116 property System::String^ text { System::String^ get() {return this->_text;} }
122117 };
@@ -128,9 +123,8 @@ namespace Smf {
128123 System::String^ _text;
129124 public:
130125 MetaCopyrightNotice(
131- System::UInt64 tick,
132126 System::String^ text
133- ): MetaData(tick, META_TYPE::COPYRIGHT_NOTICE, false), _text(text) {}
127+ ): MetaData(META_TYPE::COPYRIGHT_NOTICE, false), _text(text) {}
134128
135129 property System::String^ text { System::String^ get() {return this->_text;} }
136130 };
@@ -142,9 +136,8 @@ namespace Smf {
142136 System::String^ _text;
143137 public:
144138 MetaTrackName(
145- System::UInt64 tick,
146139 System::String^ text
147- ): MetaData(tick, META_TYPE::TRACK_NAME, false), _text(text) {}
140+ ): MetaData(META_TYPE::TRACK_NAME, false), _text(text) {}
148141
149142 property System::String^ text { System::String^ get() {return this->_text;} }
150143 };
@@ -155,9 +148,8 @@ namespace Smf {
155148 System::String^ _text;
156149 public:
157150 MetaInstrumentName(
158- System::UInt64 tick,
159151 System::String^ text
160- ): MetaData(tick, META_TYPE::INSTRUMENT_NAME, false), _text(text) {}
152+ ): MetaData(META_TYPE::INSTRUMENT_NAME, false), _text(text) {}
161153
162154 property System::String^ text { System::String^ get() {return this->_text;} }
163155 };
@@ -168,9 +160,8 @@ namespace Smf {
168160 System::String^ _text;
169161 public:
170162 MetaLyric(
171- System::UInt64 tick,
172163 System::String^ text
173- ): MetaData(tick, META_TYPE::LYRIC, false), _text(text) {}
164+ ): MetaData(META_TYPE::LYRIC, false), _text(text) {}
174165
175166 property System::String^ text { System::String^ get() {return this->_text;} }
176167 };
@@ -181,9 +172,8 @@ namespace Smf {
181172 System::String^ _text;
182173 public:
183174 MetaMarker(
184- System::UInt64 tick,
185175 System::String^ text
186- ): MetaData(tick, META_TYPE::MARKER, false), _text(text) {}
176+ ): MetaData(META_TYPE::MARKER, false), _text(text) {}
187177
188178 property System::String^ text { System::String^ get() {return this->_text;} }
189179 };
@@ -194,9 +184,8 @@ namespace Smf {
194184 System::String^ _text;
195185 public:
196186 MetaCuePoint(
197- System::UInt64 tick,
198187 System::String^ text
199- ): MetaData(tick, META_TYPE::CUE_POINT, false), _text(text) {}
188+ ): MetaData(META_TYPE::CUE_POINT, false), _text(text) {}
200189
201190 property System::String^ text { System::String^ get() {return this->_text;} }
202191 };
@@ -207,9 +196,8 @@ namespace Smf {
207196 System::String^ _text;
208197 public:
209198 MetaProgramName(
210- System::UInt64 tick,
211199 System::String^ text
212- ): MetaData(tick, META_TYPE::PROGRAM_NAME, false), _text(text) {}
200+ ): MetaData(META_TYPE::PROGRAM_NAME, false), _text(text) {}
213201
214202 property System::String^ text { System::String^ get() {return this->_text;} }
215203 };
@@ -220,9 +208,8 @@ namespace Smf {
220208 System::String^ _text;
221209 public:
222210 MetaDeviceName(
223- System::UInt64 tick,
224211 System::String^ text
225- ): MetaData(tick, META_TYPE::DEVICE_NAME, false), _text(text) {}
212+ ): MetaData(META_TYPE::DEVICE_NAME, false), _text(text) {}
226213
227214 property System::String^ text { System::String^ get() {return this->_text;} }
228215 };
@@ -235,9 +222,8 @@ namespace Smf {
235222
236223 public:
237224 MetaPort(
238- System::UInt64 tick,
239225 System::UInt16 number
240- ): MetaData(tick, META_TYPE::PORT, false), _number(number) {}
226+ ): MetaData(META_TYPE::PORT, false), _number(number) {}
241227
242228 property System::UInt16 number { System::UInt16 get() {return this->_number;} }
243229 };
@@ -247,8 +233,7 @@ namespace Smf {
247233 {
248234 public:
249235 MetaEndOfTrack(
250- System::UInt64 tick
251- ): MetaData(tick, META_TYPE::END_OF_TRACK, false) {}
236+ ): MetaData(META_TYPE::END_OF_TRACK, false) {}
252237 };
253238
254239 public ref class MetaSetTempo sealed
@@ -258,9 +243,8 @@ namespace Smf {
258243 System::UInt32 _usecPerQNote;
259244 public:
260245 MetaSetTempo(
261- System::UInt64 tick,
262246 System::UInt32 usecPerQNote
263- ): MetaData(tick, META_TYPE::SET_TEMPO, true), _usecPerQNote(usecPerQNote) {}
247+ ): MetaData(META_TYPE::SET_TEMPO, true), _usecPerQNote(usecPerQNote) {}
264248
265249 property System::UInt32 usecPerQNote { System::UInt32 get() {return this->_usecPerQNote;} }
266250 };
@@ -276,13 +260,12 @@ namespace Smf {
276260 System::Byte _subFrame;
277261 public:
278262 MetaSMPTEOffset(
279- System::UInt64 tick,
280263 System::Byte hour,
281264 System::Byte minute,
282265 System::Byte second,
283266 System::Byte frame,
284267 System::Byte subFrame
285- ): MetaData(tick, META_TYPE::SMPTE_OFFSET, true), _hour(hour), _minute(minute), _second(second), _frame(frame), _subFrame(subFrame) {}
268+ ): MetaData(META_TYPE::SMPTE_OFFSET, true), _hour(hour), _minute(minute), _second(second), _frame(frame), _subFrame(subFrame) {}
286269
287270 property System::Byte hour { System::Byte get() {return this->_hour;} }
288271 property System::Byte minute { System::Byte get() {return this->_minute;} }
@@ -301,12 +284,11 @@ namespace Smf {
301284 System::Byte _notes;
302285 public:
303286 MetaTimeSignature(
304- System::UInt64 tick,
305287 System::Byte bar,
306288 System::Byte beat,
307289 System::Byte metronome,
308290 System::Byte notes
309- ): MetaData(tick, META_TYPE::TIME_SIGNATURE, true), _bar(bar), _beat(beat), _metronome(metronome), _notes(notes) {}
291+ ): MetaData(META_TYPE::TIME_SIGNATURE, true), _bar(bar), _beat(beat), _metronome(metronome), _notes(notes) {}
310292
311293 property System::Byte bar { System::Byte get() {return this->_bar;} }
312294 property System::Byte beat { System::Byte get() {return this->_beat;} }
@@ -322,10 +304,9 @@ namespace Smf {
322304 System::Boolean _minor;
323305 public:
324306 MetaKeySignature(
325- System::UInt64 tick,
326307 System::SByte key,
327308 System::Boolean minor
328- ): MetaData(tick, META_TYPE::TIME_SIGNATURE, true), _key(key), _minor(minor) {}
309+ ): MetaData(META_TYPE::TIME_SIGNATURE, true), _key(key), _minor(minor) {}
329310
330311 property System::SByte key { System::SByte get() {return this->_key;} }
331312 property System::Boolean minor { System::Boolean get() {return this->_minor;} }
@@ -339,10 +320,9 @@ namespace Smf {
339320 array<System::Byte>^ _data;
340321 public:
341322 MetaDefault(
342- System::UInt64 tick,
343323 System::Byte defaultType,
344324 array<System::Byte>^ data
345- ): MetaData(tick, META_TYPE::SEQ_SP_METAEVENT, false), _defaultType(defaultType), _data(data) {}
325+ ): MetaData(META_TYPE::SEQ_SP_METAEVENT, false), _defaultType(defaultType), _data(data) {}
346326
347327 property System::Byte defaultType { System::Byte get() {return this->_defaultType;} }
348328 property array<System::Byte>^ data { array<System::Byte>^ get() {return this->_data;} }
--- a/Test/Momiji.Test.MM.MidiIn/Momiji.Test.MM.MidiIn.cpp
+++ b/Test/Momiji.Test.MM.MidiIn/Momiji.Test.MM.MidiIn.cpp
@@ -89,7 +89,7 @@ private:
8989 void OnInLongData(array<System::Byte>^ data, System::UInt32 time)
9090 {
9191 Console::WriteLine("[{0,4:X}][{1,4:X}]", data, time);
92- out->SendLong(data);
92+ out->SendLong(data, data->Length);
9393 }
9494
9595 public:
--- a/Test/Momiji.Test.MM.MidiOut/Momiji.Test.MM.MidiOut.cpp
+++ b/Test/Momiji.Test.MM.MidiOut/Momiji.Test.MM.MidiOut.cpp
@@ -76,9 +76,9 @@ void test2()
7676 out->SendShort(0x00005890l);
7777
7878 array<System::Byte>^ data = {0xF0,0x41,0x10,0x42,0x12,0x40,0x00,0x7F,0x00,0x41,0xF7};
79- out->SendLong(data);
80- out->SendLong(data);
81- out->SendLong(data);
79+ out->SendLong(data, data->Length);
80+ out->SendLong(data, data->Length);
81+ out->SendLong(data, data->Length);
8282
8383 // out->close();
8484 }
--- a/Test/Momiji.Test.MM.WaveOut/Momiji.Test.MM.WaveOut.cpp
+++ b/Test/Momiji.Test.MM.WaveOut/Momiji.Test.MM.WaveOut.cpp
@@ -18,19 +18,19 @@ void test1()
1818 auto cap = Momiji::Core::Wave::Out::Device<System::Byte>::GetCapabilities(idx);
1919
2020 Console::Write("[{0}]", idx);
21- Console::Write("[{0}]", cap->manufacturerID);
22- Console::Write("[{0}]", cap->productID);
23- Console::Write("[{0}]", cap->driverVersion);
24- Console::Write("[{0}]", cap->productName);
25- Console::Write("[{0:f}]", cap->formats);
26- Console::Write("[{0}]", cap->channels);
27- Console::Write("[{0}]", cap->reserved1);
28- Console::Write("[{0}]", cap->support);
21+ Console::Write("[{0}]", cap.manufacturerID);
22+ Console::Write("[{0}]", cap.productID);
23+ Console::Write("[{0}]", cap.driverVersion);
24+ Console::Write("[{0}]", cap.productName);
25+ Console::Write("[{0:f}]", cap.formats);
26+ Console::Write("[{0}]", cap.channels);
27+ Console::Write("[{0}]", cap.reserved1);
28+ Console::Write("[{0}]", cap.support);
2929 Console::WriteLine();
3030
31- Console::WriteLine("[{0}]", cap->manufacturerGuid);
32- Console::WriteLine("[{0}]", cap->productGuid);
33- Console::WriteLine("[{0}]", cap->nameGuid);
31+ Console::WriteLine("[{0}]", cap.manufacturerGuid);
32+ Console::WriteLine("[{0}]", cap.productGuid);
33+ Console::WriteLine("[{0}]", cap.nameGuid);
3434 }
3535 catch(Exception^ e)
3636 {
@@ -65,7 +65,8 @@ void test2_1(
6565 Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_LEFT
6666 | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_RIGHT
6767 ),
68- Momiji::Interop::Ks::StaticKs::SUBTYPE_IEEE_FLOAT
68+ Momiji::Interop::Ks::StaticKs::SUBTYPE_IEEE_FLOAT,
69+ s
6970 );
7071
7172 try
@@ -88,13 +89,14 @@ void test2_1(
8889 System::GC::Collect();
8990 */
9091
91- auto data = gcnew array<System::Single>(s*2);
92+ auto count = s*2;
93+ auto data = gcnew array<System::Single>(count);
9294
93- for(System::UInt32 idx = 0; idx < s * 2; idx++)
95+ for(System::UInt32 idx = 0; idx < count; idx++)
9496 {
9597 System::Single d = .0;
9698
97- System::Single ll = static_cast<System::Single>(s / (440.0 + ((440.0 / (s * 2)) * idx)));
99+ System::Single ll = static_cast<System::Single>(s / (440.0 + ((440.0 / (count)) * idx)));
98100
99101 if(Modulus(static_cast<System::Single>(idx), ll) < (ll / 2))
100102 {
@@ -111,9 +113,9 @@ void test2_1(
111113 data[idx] = d;
112114 }
113115
114- out->Send(gcnew Momiji::Core::Wave::WaveData<System::Single>(0, data));
116+ out->Send(gcnew Momiji::Core::Wave::WaveData<System::Single>(0, data, count));
115117 System::Console::ReadLine();
116- out->Send(gcnew Momiji::Core::Wave::WaveData<System::Single>(0, data));
118+ out->Send(gcnew Momiji::Core::Wave::WaveData<System::Single>(0, data, count));
117119 System::Console::ReadLine();
118120 }
119121 finally
@@ -152,7 +154,8 @@ void test3()
152154 Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_LEFT
153155 | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_RIGHT
154156 ),
155- Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM
157+ Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM,
158+ 48000
156159 );
157160 }
158161 catch(Exception^ e)
@@ -176,7 +179,8 @@ void test4()
176179 Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_LEFT
177180 | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_RIGHT
178181 ),
179- Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM
182+ Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM,
183+ 48000
180184 );
181185
182186 {
--- /dev/null
+++ b/Test/Momiji.Test.Sequencer.Midi/Form1.h
@@ -0,0 +1,194 @@
1+#pragma once
2+#using <Momiji.Core.dll>
3+namespace MomijiTestSequencerMidi {
4+
5+ using namespace System;
6+ using namespace System::ComponentModel;
7+ using namespace System::Collections;
8+ using namespace System::Windows::Forms;
9+ using namespace System::Data;
10+ using namespace System::Drawing;
11+
12+ /// <summary>
13+ /// Form1 の概要
14+ /// </summary>
15+ public ref class Form1 : public System::Windows::Forms::Form
16+ {
17+ public:
18+ Form1(void)
19+ {
20+ InitializeComponent();
21+ //
22+ //TODO: ここにコンストラクター コードを追加します
23+ //
24+ }
25+
26+ protected:
27+ /// <summary>
28+ /// 使用中のリソースをすべてクリーンアップします。
29+ /// </summary>
30+ ~Form1()
31+ {
32+ if (components)
33+ {
34+ delete components;
35+ }
36+ }
37+ private: System::Windows::Forms::ComboBox^ comboBox1;
38+ private: System::Windows::Forms::Button^ button1;
39+ private: Momiji::Core::ITimer^ t;
40+ private: Momiji::Core::IStream^ s;
41+ private: Momiji::Core::Midi::Out::Devices^ o;
42+ private: Momiji::Controler::Player^ p;
43+ private: System::Windows::Forms::Button^ button2;
44+ protected:
45+
46+ private:
47+ /// <summary>
48+ /// 必要なデザイナー変数です。
49+ /// </summary>
50+ System::ComponentModel::Container ^components;
51+
52+#pragma region Windows Form Designer generated code
53+ /// <summary>
54+ /// デザイナー サポートに必要なメソッドです。このメソッドの内容を
55+ /// コード エディターで変更しないでください。
56+ /// </summary>
57+ void InitializeComponent(void)
58+ {
59+ this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
60+ this->button1 = (gcnew System::Windows::Forms::Button());
61+ this->button2 = (gcnew System::Windows::Forms::Button());
62+ this->SuspendLayout();
63+ //
64+ // comboBox1
65+ //
66+ this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
67+ this->comboBox1->FormattingEnabled = true;
68+ this->comboBox1->Location = System::Drawing::Point(12, 12);
69+ this->comboBox1->Name = L"comboBox1";
70+ this->comboBox1->Size = System::Drawing::Size(513, 20);
71+ this->comboBox1->TabIndex = 0;
72+ //
73+ // button1
74+ //
75+ this->button1->Location = System::Drawing::Point(13, 39);
76+ this->button1->Name = L"button1";
77+ this->button1->Size = System::Drawing::Size(75, 23);
78+ this->button1->TabIndex = 1;
79+ this->button1->Text = L"START";
80+ this->button1->UseVisualStyleBackColor = true;
81+ this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
82+ //
83+ // button2
84+ //
85+ this->button2->Location = System::Drawing::Point(95, 39);
86+ this->button2->Name = L"button2";
87+ this->button2->Size = System::Drawing::Size(75, 23);
88+ this->button2->TabIndex = 2;
89+ this->button2->Text = L"STOP";
90+ this->button2->UseVisualStyleBackColor = true;
91+ this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
92+ //
93+ // Form1
94+ //
95+ this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
96+ this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
97+ this->ClientSize = System::Drawing::Size(537, 73);
98+ this->Controls->Add(this->button2);
99+ this->Controls->Add(this->button1);
100+ this->Controls->Add(this->comboBox1);
101+ this->Name = L"Form1";
102+ this->Text = L"Form1";
103+ this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
104+ this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
105+ this->ResumeLayout(false);
106+
107+ }
108+#pragma endregion
109+ private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
110+
111+ auto list =
112+ gcnew System::Collections::Generic::List<System::Collections::Generic::KeyValuePair<System::String^, Momiji::Interop::Winmm::MidiOutCapabilities>>();
113+ System::UInt32 nums = Momiji::Core::Midi::Out::Device::GetNumDevices();
114+
115+ for (System::UInt32 idx = 0; idx < nums; idx++) {
116+
117+ try
118+ {
119+ auto cap = Momiji::Core::Midi::Out::Device::GetCapabilities(idx);
120+ auto pair = System::Collections::Generic::KeyValuePair<System::String^, Momiji::Interop::Winmm::MidiOutCapabilities>(cap.productName, cap);
121+ list->Add(pair);
122+ }
123+ catch(Exception^ e)
124+ {
125+ Console::WriteLine(e->ToString());
126+ }
127+ }
128+
129+ this->comboBox1->DisplayMember = "Key";
130+ this->comboBox1->DataSource = list;
131+
132+ }
133+
134+ private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
135+ System::String^ fileName;
136+ System::Windows::Forms::OpenFileDialog^ dialog = gcnew System::Windows::Forms::OpenFileDialog();
137+ try
138+ {
139+ dialog->InitialDirectory = System::IO::Directory::GetCurrentDirectory();
140+ dialog->Filter = "midi|*.mid";
141+ if (dialog->ShowDialog() == System::Windows::Forms::DialogResult::Cancel)
142+ {
143+ Console::WriteLine("============ 取り消し");
144+ return;
145+ }
146+
147+ fileName = dialog->FileName;
148+ }
149+ finally
150+ {
151+ delete dialog;
152+ }
153+
154+ this->button2_Click(this, e);
155+
156+ t = gcnew Momiji::Core::Timer::MMTimer();
157+ s = gcnew Momiji::Sequencer::Midi::Smf::SmfStream(fileName);
158+ o = gcnew Momiji::Core::Midi::Out::Devices();
159+ o->AddPort(this->comboBox1->SelectedIndex);
160+
161+ p = gcnew Momiji::Controler::Player();
162+ p->Assign(t);
163+ p->Assign(s);
164+ p->Assign(o);
165+
166+ p->Start();
167+ }
168+ private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
169+ if (p != nullptr) {
170+ delete p;
171+ p = nullptr;
172+ }
173+
174+ if (t != nullptr) {
175+ delete t;
176+ t = nullptr;
177+ }
178+
179+ if (s != nullptr) {
180+ delete s;
181+ s = nullptr;
182+ }
183+
184+ if (o != nullptr) {
185+ delete o;
186+ o = nullptr;
187+ }
188+ }
189+private: System::Void Form1_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {
190+ this->button2_Click(this, e);
191+ }
192+};
193+}
194+
--- /dev/null
+++ b/Test/Momiji.Test.Sequencer.Midi/Form1.resx
@@ -0,0 +1,120 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<root>
3+ <!--
4+ Microsoft ResX Schema
5+
6+ Version 2.0
7+
8+ The primary goals of this format is to allow a simple XML format
9+ that is mostly human readable. The generation and parsing of the
10+ various data types are done through the TypeConverter classes
11+ associated with the data types.
12+
13+ Example:
14+
15+ ... ado.net/XML headers & schema ...
16+ <resheader name="resmimetype">text/microsoft-resx</resheader>
17+ <resheader name="version">2.0</resheader>
18+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+ <value>[base64 mime encoded serialized .NET Framework object]</value>
24+ </data>
25+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+ <comment>This is a comment</comment>
28+ </data>
29+
30+ There are any number of "resheader" rows that contain simple
31+ name/value pairs.
32+
33+ Each data row contains a name, and value. The row also contains a
34+ type or mimetype. Type corresponds to a .NET class that support
35+ text/value conversion through the TypeConverter architecture.
36+ Classes that don't support this are serialized and stored with the
37+ mimetype set.
38+
39+ The mimetype is used for serialized objects, and tells the
40+ ResXResourceReader how to depersist the object. This is currently not
41+ extensible. For a given mimetype the value must be set accordingly:
42+
43+ Note - application/x-microsoft.net.object.binary.base64 is the format
44+ that the ResXResourceWriter will generate, however the reader can
45+ read any of the formats listed below.
46+
47+ mimetype: application/x-microsoft.net.object.binary.base64
48+ value : The object must be serialized with
49+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+ : and then encoded with base64 encoding.
51+
52+ mimetype: application/x-microsoft.net.object.soap.base64
53+ value : The object must be serialized with
54+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+ : and then encoded with base64 encoding.
56+
57+ mimetype: application/x-microsoft.net.object.bytearray.base64
58+ value : The object must be serialized into a byte array
59+ : using a System.ComponentModel.TypeConverter
60+ : and then encoded with base64 encoding.
61+ -->
62+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+ <xsd:element name="root" msdata:IsDataSet="true">
65+ <xsd:complexType>
66+ <xsd:choice maxOccurs="unbounded">
67+ <xsd:element name="metadata">
68+ <xsd:complexType>
69+ <xsd:sequence>
70+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
71+ </xsd:sequence>
72+ <xsd:attribute name="name" use="required" type="xsd:string" />
73+ <xsd:attribute name="type" type="xsd:string" />
74+ <xsd:attribute name="mimetype" type="xsd:string" />
75+ <xsd:attribute ref="xml:space" />
76+ </xsd:complexType>
77+ </xsd:element>
78+ <xsd:element name="assembly">
79+ <xsd:complexType>
80+ <xsd:attribute name="alias" type="xsd:string" />
81+ <xsd:attribute name="name" type="xsd:string" />
82+ </xsd:complexType>
83+ </xsd:element>
84+ <xsd:element name="data">
85+ <xsd:complexType>
86+ <xsd:sequence>
87+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+ </xsd:sequence>
90+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+ <xsd:attribute ref="xml:space" />
94+ </xsd:complexType>
95+ </xsd:element>
96+ <xsd:element name="resheader">
97+ <xsd:complexType>
98+ <xsd:sequence>
99+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+ </xsd:sequence>
101+ <xsd:attribute name="name" type="xsd:string" use="required" />
102+ </xsd:complexType>
103+ </xsd:element>
104+ </xsd:choice>
105+ </xsd:complexType>
106+ </xsd:element>
107+ </xsd:schema>
108+ <resheader name="resmimetype">
109+ <value>text/microsoft-resx</value>
110+ </resheader>
111+ <resheader name="version">
112+ <value>2.0</value>
113+ </resheader>
114+ <resheader name="reader">
115+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+ </resheader>
117+ <resheader name="writer">
118+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+ </resheader>
120+</root>
\ No newline at end of file
--- a/Test/Momiji.Test.Sequencer.Midi/Momiji.Test.Sequencer.Midi.cpp
+++ b/Test/Momiji.Test.Sequencer.Midi/Momiji.Test.Sequencer.Midi.cpp
@@ -1,105 +1,18 @@
11 // Momiji.Test.Sequencer.Midi.cpp : メイン プロジェクト ファイルです。
22
33 #include "stdafx.h"
4+#include "Form1.h"
45
5-#using <Momiji.Core.dll>
6-#using <System.Windows.Forms.dll>
6+using namespace MomijiTestSequencerMidi;
77
8-using namespace System;
9-
10-void test9()
11-{
12- System::String^ fileName;
13- System::Windows::Forms::OpenFileDialog^ dialog = gcnew System::Windows::Forms::OpenFileDialog();
14- try
15- {
16- dialog->InitialDirectory = System::IO::Directory::GetCurrentDirectory();
17- dialog->Filter = "midi|*.mid";
18- if (dialog->ShowDialog() == System::Windows::Forms::DialogResult::Cancel)
19- {
20- Console::WriteLine("============ 取り消し");
21- return;
22- }
23-
24- fileName = dialog->FileName;
25- }
26- finally
27- {
28- delete dialog;
29- }
30-
31- Momiji::Core::ITimer^ t;
32- Momiji::Core::IStream^ s;
33- Momiji::Core::Midi::Out::Devices^ o;
34- Momiji::Controler::Player^ p;
35- try
36- {
37- t = gcnew Momiji::Core::Timer::MMTimer();
38- s = gcnew Momiji::Sequencer::Midi::Smf::SmfStream(fileName);
39- o = gcnew Momiji::Core::Midi::Out::Devices();
40- o->AddPort(0);
41- o->AddPort(11);
42-
43- p = gcnew Momiji::Controler::Player();
44- p->Assign(t);
45- p->Assign(s);
46- p->Assign(o);
47-
48- p->Start();
49- Console::WriteLine("============ enter でstop");
50- System::Console::ReadLine();
51- p->Stop();
52-
53- Console::WriteLine("============ enter でstart");
54- System::Console::ReadLine();
55- p->Start();
56-
57- Console::WriteLine("============ enter でstop - rewind - start");
58- System::Console::ReadLine();
59- p->Stop();
60- s->Rewind();
61-
62- p->Start();
63- Console::WriteLine("============ enter でstop");
64- System::Console::ReadLine();
65- p->Stop();
66- }
67- catch(Exception^ e)
68- {
69- Console::WriteLine(e->ToString());
70- }
71- finally
72- {
73- if (p != nullptr)
74- {
75- delete p;
76- }
77-
78- if (s != nullptr)
79- {
80- delete s;
81- }
82- if (t != nullptr)
83- {
84- delete t;
85- }
86- if (o != nullptr)
87- {
88- delete o;
89- }
90- }
91-}
92-
93-[System::STAThread]
8+[STAThreadAttribute]
949 int main(array<System::String ^> ^args)
9510 {
96- Console::WriteLine("====================================================test8");
97- test9();
98- System::GC::Collect();
99- System::GC::WaitForPendingFinalizers();
100- System::GC::Collect();
11+ // コントロールが作成される前に、Windows XP ビジュアル効果を有効にします
12+ Application::EnableVisualStyles();
13+ Application::SetCompatibleTextRenderingDefault(false);
10114
102- Console::WriteLine("====================================================");
103- System::Console::ReadLine();
104- return 0;
15+ // メイン ウィンドウを作成して、実行します
16+ Application::Run(gcnew Form1());
17+ return 0;
10518 }
--- a/Test/Momiji.Test.Sequencer.Midi/Momiji.Test.Sequencer.Midi.vcxproj
+++ b/Test/Momiji.Test.Sequencer.Midi/Momiji.Test.Sequencer.Midi.vcxproj
@@ -75,6 +75,8 @@
7575 <ItemGroup>
7676 <Reference Include="System" />
7777 <Reference Include="System.Data" />
78+ <Reference Include="System.Drawing" />
79+ <Reference Include="System.Windows.Forms" />
7880 <Reference Include="System.Xml" />
7981 </ItemGroup>
8082 <ItemGroup>
@@ -82,6 +84,9 @@
8284 <None Include="ReadMe.txt" />
8385 </ItemGroup>
8486 <ItemGroup>
87+ <ClInclude Include="Form1.h">
88+ <FileType>CppForm</FileType>
89+ </ClInclude>
8590 <ClInclude Include="resource.h" />
8691 <ClInclude Include="stdafx.h" />
8792 </ItemGroup>
@@ -96,6 +101,12 @@
96101 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
97102 </ClCompile>
98103 </ItemGroup>
104+ <ItemGroup>
105+ <EmbeddedResource Include="Form1.resx">
106+ <DependentUpon>Form1.h</DependentUpon>
107+ <SubType>Designer</SubType>
108+ </EmbeddedResource>
109+ </ItemGroup>
99110 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
100111 <ImportGroup Label="ExtensionTargets">
101112 </ImportGroup>
--- a/Test/Momiji.Test.Sequencer.Midi/Momiji.Test.Sequencer.Midi.vcxproj.filters
+++ b/Test/Momiji.Test.Sequencer.Midi/Momiji.Test.Sequencer.Midi.vcxproj.filters
@@ -27,6 +27,9 @@
2727 <ClInclude Include="resource.h">
2828 <Filter>ヘッダー ファイル</Filter>
2929 </ClInclude>
30+ <ClInclude Include="Form1.h">
31+ <Filter>ヘッダー ファイル</Filter>
32+ </ClInclude>
3033 </ItemGroup>
3134 <ItemGroup>
3235 <ResourceCompile Include="app.rc">
@@ -44,4 +47,9 @@
4447 <Filter>ソース ファイル</Filter>
4548 </ClCompile>
4649 </ItemGroup>
50+ <ItemGroup>
51+ <EmbeddedResource Include="Form1.resx">
52+ <Filter>リソース ファイル</Filter>
53+ </EmbeddedResource>
54+ </ItemGroup>
4755 </Project>
\ No newline at end of file
--- a/Test/Momiji.Test.Vst.Controller/Momiji.Test.Vst.Controller.cpp
+++ b/Test/Momiji.Test.Vst.Controller/Momiji.Test.Vst.Controller.cpp
@@ -137,8 +137,8 @@ private:
137137 continue;
138138 }
139139
140- if (startTick == 0) {startTick = midi->tick;}
141- auto delta = (midi->tick - startTick);
140+ if (startTick == 0) {startTick = packet->tick;}
141+ auto delta = (packet->tick - startTick);
142142
143143 auto e = Momiji::Interop::Vst::VstEvent();
144144 e.type = Momiji::Interop::Vst::VstEvent::VstEventTypes::kVstMidiType;