test
| Revision | 888ed3a5f22df4f08329396cc167ec579af956e5 (tree) |
|---|---|
| Time | 2012-05-08 01:07:08 |
| Author | tyiki badwell <miria@user...> |
| Commiter | tyiki badwell |
tickはIDataではなく、もっとシーケンサ寄りのインタフェースに移動
| @@ -234,8 +234,8 @@ namespace DeviceInfo { | ||
| 234 | 234 | ) |
| 235 | 235 | ) |
| 236 | 236 | { |
| 237 | - auto error = InteropServices::Marshal::GetHRForLastWin32Error(); | |
| 238 | 237 | #ifdef _DEBUG |
| 238 | + auto error = InteropServices::Marshal::GetHRForLastWin32Error(); | |
| 239 | 239 | System::Console::WriteLine("[{0}] error [{1}]",__FUNCTION__, InteropServices::Marshal::GetExceptionForHR(error)->ToString()); |
| 240 | 240 | #endif |
| 241 | 241 | return nullptr; |
| @@ -329,8 +329,8 @@ namespace DeviceInfo { | ||
| 329 | 329 | ); |
| 330 | 330 | if (regKey->IsInvalid) |
| 331 | 331 | { |
| 332 | - auto error = InteropServices::Marshal::GetHRForLastWin32Error(); | |
| 333 | 332 | #ifdef _DEBUG |
| 333 | + auto error = InteropServices::Marshal::GetHRForLastWin32Error(); | |
| 334 | 334 | System::Console::WriteLine("[{0}] error {1:X}",__FUNCTION__, InteropServices::Marshal::GetExceptionForHR(error)->ToString()); |
| 335 | 335 | #endif |
| 336 | 336 | return nullptr; |
| @@ -35,6 +35,7 @@ namespace Core { | ||
| 35 | 35 | |
| 36 | 36 | public interface class IPacket |
| 37 | 37 | { |
| 38 | + property IData^ data{ IData^ get(); }; | |
| 38 | 39 | property System::UInt64 tick{ System::UInt64 get(); }; |
| 39 | 40 | }; |
| 40 | 41 |
| @@ -43,7 +44,6 @@ namespace Core { | ||
| 43 | 44 | { |
| 44 | 45 | property IStreamPacket^ next{ IStreamPacket^ get(); }; |
| 45 | 46 | property System::Boolean hasNext{ System::Boolean get(); }; |
| 46 | - property IData^ data{ IData^ get(); }; | |
| 47 | 47 | }; |
| 48 | 48 | |
| 49 | 49 | public interface class ITrack |
| @@ -36,14 +36,12 @@ namespace Midi { | ||
| 36 | 36 | : public Core::IData |
| 37 | 37 | { |
| 38 | 38 | private: |
| 39 | - initonly System::UInt64 _tick; | |
| 40 | 39 | initonly System::UInt16 _port; |
| 41 | 40 | |
| 42 | 41 | protected: |
| 43 | 42 | MidiData( |
| 44 | - System::UInt64 tick, | |
| 45 | 43 | System::UInt16 port |
| 46 | - ): _tick(tick), _port(port){} | |
| 44 | + ): _port(port){} | |
| 47 | 45 | |
| 48 | 46 | public: |
| 49 | 47 | enum class TYPE: System::Byte |
| @@ -61,7 +59,6 @@ namespace Midi { | ||
| 61 | 59 | META = 0xFF, |
| 62 | 60 | }; |
| 63 | 61 | |
| 64 | - property System::UInt64 tick { virtual System::UInt64 get() {return this->_tick;} } | |
| 65 | 62 | property System::UInt16 port { System::UInt16 get() {return this->_port;} } |
| 66 | 63 | }; |
| 67 | 64 |
| @@ -75,12 +72,11 @@ namespace Midi { | ||
| 75 | 72 | |
| 76 | 73 | public: |
| 77 | 74 | ShortData( |
| 78 | - System::UInt64 tick, | |
| 79 | 75 | System::UInt16 port, |
| 80 | 76 | System::Byte status, |
| 81 | 77 | System::Byte param1, |
| 82 | 78 | System::Byte param2 |
| 83 | - ): MidiData(tick, port), _status(status), _param1(param1), _param2(param2) {} | |
| 79 | + ): MidiData(port), _status(status), _param1(param1), _param2(param2) {} | |
| 84 | 80 | |
| 85 | 81 | property System::Byte status { System::Byte get() {return this->_status;} } |
| 86 | 82 | property System::Byte param1 { System::Byte get() {return this->_param1;} } |
| @@ -107,11 +103,10 @@ namespace Midi { | ||
| 107 | 103 | |
| 108 | 104 | public: |
| 109 | 105 | LongData( |
| 110 | - System::UInt64 tick, | |
| 111 | 106 | System::UInt16 port, |
| 112 | 107 | array<System::Byte>^ longData, |
| 113 | 108 | System::UInt32 useSize |
| 114 | - ): MidiData(tick, port), _longData(longData), _useSize(useSize) {} | |
| 109 | + ): MidiData(port), _longData(longData), _useSize(useSize) {} | |
| 115 | 110 | |
| 116 | 111 | property array<System::Byte>^ longData { array<System::Byte>^ get() {return this->_longData;} } |
| 117 | 112 | property System::UInt32 useSize { System::UInt32 get() { return this->_useSize; } } |
| @@ -716,8 +716,6 @@ namespace Vst { | ||
| 716 | 716 | ); |
| 717 | 717 | |
| 718 | 718 | VST_DLL_DELEGATE(Ansi) delegate System::IntPtr VSTPluginMain( |
| 719 | - //[InteropServices::In][InteropServices::MarshalAs(InteropServices::UnmanagedType::FunctionPtr)] | |
| 720 | - // AudioMasterProc^ audioMaster | |
| 721 | 719 | [InteropServices::In][InteropServices::MarshalAs(InteropServices::UnmanagedType::FunctionPtr)] |
| 722 | 720 | AudioMasterCallBack::Delegate^ audioMaster |
| 723 | 721 | ); |
| @@ -234,10 +234,10 @@ namespace Smf { | ||
| 234 | 234 | |
| 235 | 235 | this->_nowTick = .0; |
| 236 | 236 | |
| 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); | |
| 241 | 241 | |
| 242 | 242 | this->_headPacket = |
| 243 | 243 | gcnew SmfPacket( |
| @@ -328,7 +328,6 @@ namespace Smf { | ||
| 328 | 328 | { |
| 329 | 329 | data = |
| 330 | 330 | gcnew Core::Midi::ShortData( |
| 331 | - this->_tick, | |
| 332 | 331 | metaPort->number, |
| 333 | 332 | this->_status, |
| 334 | 333 | param1, |
| @@ -341,7 +340,6 @@ namespace Smf { | ||
| 341 | 340 | { |
| 342 | 341 | data = |
| 343 | 342 | gcnew Core::Midi::ShortData( |
| 344 | - this->_tick, | |
| 345 | 343 | metaPort->number, |
| 346 | 344 | this->_status, |
| 347 | 345 | param1, |
| @@ -362,7 +360,6 @@ namespace Smf { | ||
| 362 | 360 | |
| 363 | 361 | data = |
| 364 | 362 | gcnew Core::Midi::LongData( |
| 365 | - this->_tick, | |
| 366 | 363 | metaPort->number, |
| 367 | 364 | longData, |
| 368 | 365 | longData->Length |
| @@ -393,7 +390,6 @@ namespace Smf { | ||
| 393 | 390 | { |
| 394 | 391 | data = |
| 395 | 392 | gcnew MetaSequenceNumber( |
| 396 | - this->_tick, | |
| 397 | 393 | Util::ToHostOrder(System::BitConverter::ToUInt16(bytes,0)) |
| 398 | 394 | ); |
| 399 | 395 | break; |
| @@ -402,7 +398,6 @@ namespace Smf { | ||
| 402 | 398 | { |
| 403 | 399 | data = |
| 404 | 400 | gcnew MetaText( |
| 405 | - this->_tick, | |
| 406 | 401 | "" |
| 407 | 402 | ); |
| 408 | 403 | break; |
| @@ -411,7 +406,6 @@ namespace Smf { | ||
| 411 | 406 | { |
| 412 | 407 | data = |
| 413 | 408 | gcnew MetaCopyrightNotice( |
| 414 | - this->_tick, | |
| 415 | 409 | "" |
| 416 | 410 | ); |
| 417 | 411 | break; |
| @@ -420,7 +414,6 @@ namespace Smf { | ||
| 420 | 414 | { |
| 421 | 415 | data = |
| 422 | 416 | gcnew MetaTrackName( |
| 423 | - this->_tick, | |
| 424 | 417 | "" |
| 425 | 418 | ); |
| 426 | 419 | break; |
| @@ -429,7 +422,6 @@ namespace Smf { | ||
| 429 | 422 | { |
| 430 | 423 | data = |
| 431 | 424 | gcnew MetaInstrumentName( |
| 432 | - this->_tick, | |
| 433 | 425 | "" |
| 434 | 426 | ); |
| 435 | 427 | break; |
| @@ -438,7 +430,6 @@ namespace Smf { | ||
| 438 | 430 | { |
| 439 | 431 | data = |
| 440 | 432 | gcnew MetaLyric( |
| 441 | - this->_tick, | |
| 442 | 433 | "" |
| 443 | 434 | ); |
| 444 | 435 | break; |
| @@ -447,7 +438,6 @@ namespace Smf { | ||
| 447 | 438 | { |
| 448 | 439 | data = |
| 449 | 440 | gcnew MetaMarker( |
| 450 | - this->_tick, | |
| 451 | 441 | "" |
| 452 | 442 | ); |
| 453 | 443 | break; |
| @@ -456,7 +446,6 @@ namespace Smf { | ||
| 456 | 446 | { |
| 457 | 447 | data = |
| 458 | 448 | gcnew MetaCuePoint( |
| 459 | - this->_tick, | |
| 460 | 449 | "" |
| 461 | 450 | ); |
| 462 | 451 | break; |
| @@ -465,7 +454,6 @@ namespace Smf { | ||
| 465 | 454 | { |
| 466 | 455 | data = |
| 467 | 456 | gcnew MetaProgramName( |
| 468 | - this->_tick, | |
| 469 | 457 | "" |
| 470 | 458 | ); |
| 471 | 459 | break; |
| @@ -474,7 +462,6 @@ namespace Smf { | ||
| 474 | 462 | { |
| 475 | 463 | data = |
| 476 | 464 | gcnew MetaDeviceName( |
| 477 | - this->_tick, | |
| 478 | 465 | "" |
| 479 | 466 | ); |
| 480 | 467 | break; |
| @@ -485,7 +472,6 @@ namespace Smf { | ||
| 485 | 472 | |
| 486 | 473 | data = |
| 487 | 474 | gcnew MetaPort( |
| 488 | - this->_tick, | |
| 489 | 475 | port //ToHostOrder(System::BitConverter::ToUInt16(bytes,0)) |
| 490 | 476 | ); |
| 491 | 477 | break; |
| @@ -493,9 +479,7 @@ namespace Smf { | ||
| 493 | 479 | case MetaData::META_TYPE::END_OF_TRACK: // {FF: '2F' 00} |
| 494 | 480 | { |
| 495 | 481 | data = |
| 496 | - gcnew MetaEndOfTrack( | |
| 497 | - this->_tick | |
| 498 | - ); | |
| 482 | + gcnew MetaEndOfTrack(); | |
| 499 | 483 | |
| 500 | 484 | this->_isTerminate = true; |
| 501 | 485 | break; |
| @@ -510,7 +494,6 @@ namespace Smf { | ||
| 510 | 494 | |
| 511 | 495 | data = |
| 512 | 496 | gcnew MetaSetTempo( |
| 513 | - this->_tick, | |
| 514 | 497 | Util::ToHostOrder(System::BitConverter::ToUInt32(tempo, 0)) |
| 515 | 498 | ); |
| 516 | 499 |
| @@ -520,7 +503,6 @@ namespace Smf { | ||
| 520 | 503 | { |
| 521 | 504 | data = |
| 522 | 505 | gcnew MetaSMPTEOffset( |
| 523 | - this->_tick, | |
| 524 | 506 | bytes[0], |
| 525 | 507 | bytes[1], |
| 526 | 508 | bytes[2], |
| @@ -533,7 +515,6 @@ namespace Smf { | ||
| 533 | 515 | { |
| 534 | 516 | data = |
| 535 | 517 | gcnew MetaTimeSignature( |
| 536 | - this->_tick, | |
| 537 | 518 | bytes[0], |
| 538 | 519 | 2 ^ bytes[1], |
| 539 | 520 | bytes[2], |
| @@ -545,7 +526,6 @@ namespace Smf { | ||
| 545 | 526 | { |
| 546 | 527 | data = |
| 547 | 528 | gcnew MetaKeySignature( |
| 548 | - this->_tick, | |
| 549 | 529 | bytes[0], |
| 550 | 530 | System::BitConverter::ToBoolean(bytes,1) |
| 551 | 531 | ); |
| @@ -77,17 +77,14 @@ namespace Smf { | ||
| 77 | 77 | SEQ_SP_METAEVENT = 0x7F, // {FF: '7F' length data ユーザ定義メタ} |
| 78 | 78 | }; |
| 79 | 79 | private: |
| 80 | - System::UInt64 _tick; | |
| 81 | 80 | META_TYPE _type; |
| 82 | 81 | System::Boolean _conductor; |
| 83 | 82 | public: |
| 84 | 83 | MetaData( |
| 85 | - System::UInt64 tick, | |
| 86 | 84 | META_TYPE type, |
| 87 | 85 | System::Boolean conductor |
| 88 | - ) : _tick(tick), _type(type), _conductor(conductor) {} | |
| 86 | + ) : _type(type), _conductor(conductor) {} | |
| 89 | 87 | |
| 90 | - property System::UInt64 tick { virtual System::UInt64 get() {return this->_tick;} } | |
| 91 | 88 | property META_TYPE type { META_TYPE get() {return this->_type;} } |
| 92 | 89 | property System::Boolean conductor { System::Boolean get() {return this->_conductor;} } |
| 93 | 90 | }; |
| @@ -100,9 +97,8 @@ namespace Smf { | ||
| 100 | 97 | |
| 101 | 98 | public: |
| 102 | 99 | MetaSequenceNumber( |
| 103 | - System::UInt64 tick, | |
| 104 | 100 | System::UInt16 number |
| 105 | - ): MetaData(tick, META_TYPE::SEQUENCE_NUMBER, false), _number(number) {} | |
| 101 | + ): MetaData(META_TYPE::SEQUENCE_NUMBER, false), _number(number) {} | |
| 106 | 102 | |
| 107 | 103 | property System::UInt16 number { System::UInt16 get() {return this->_number;} } |
| 108 | 104 | }; |
| @@ -114,9 +110,8 @@ namespace Smf { | ||
| 114 | 110 | System::String^ _text; |
| 115 | 111 | public: |
| 116 | 112 | MetaText( |
| 117 | - System::UInt64 tick, | |
| 118 | 113 | System::String^ text |
| 119 | - ): MetaData(tick, META_TYPE::TEXT_EVENT, false), _text(text) {} | |
| 114 | + ): MetaData(META_TYPE::TEXT_EVENT, false), _text(text) {} | |
| 120 | 115 | |
| 121 | 116 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 122 | 117 | }; |
| @@ -128,9 +123,8 @@ namespace Smf { | ||
| 128 | 123 | System::String^ _text; |
| 129 | 124 | public: |
| 130 | 125 | MetaCopyrightNotice( |
| 131 | - System::UInt64 tick, | |
| 132 | 126 | System::String^ text |
| 133 | - ): MetaData(tick, META_TYPE::COPYRIGHT_NOTICE, false), _text(text) {} | |
| 127 | + ): MetaData(META_TYPE::COPYRIGHT_NOTICE, false), _text(text) {} | |
| 134 | 128 | |
| 135 | 129 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 136 | 130 | }; |
| @@ -142,9 +136,8 @@ namespace Smf { | ||
| 142 | 136 | System::String^ _text; |
| 143 | 137 | public: |
| 144 | 138 | MetaTrackName( |
| 145 | - System::UInt64 tick, | |
| 146 | 139 | System::String^ text |
| 147 | - ): MetaData(tick, META_TYPE::TRACK_NAME, false), _text(text) {} | |
| 140 | + ): MetaData(META_TYPE::TRACK_NAME, false), _text(text) {} | |
| 148 | 141 | |
| 149 | 142 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 150 | 143 | }; |
| @@ -155,9 +148,8 @@ namespace Smf { | ||
| 155 | 148 | System::String^ _text; |
| 156 | 149 | public: |
| 157 | 150 | MetaInstrumentName( |
| 158 | - System::UInt64 tick, | |
| 159 | 151 | System::String^ text |
| 160 | - ): MetaData(tick, META_TYPE::INSTRUMENT_NAME, false), _text(text) {} | |
| 152 | + ): MetaData(META_TYPE::INSTRUMENT_NAME, false), _text(text) {} | |
| 161 | 153 | |
| 162 | 154 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 163 | 155 | }; |
| @@ -168,9 +160,8 @@ namespace Smf { | ||
| 168 | 160 | System::String^ _text; |
| 169 | 161 | public: |
| 170 | 162 | MetaLyric( |
| 171 | - System::UInt64 tick, | |
| 172 | 163 | System::String^ text |
| 173 | - ): MetaData(tick, META_TYPE::LYRIC, false), _text(text) {} | |
| 164 | + ): MetaData(META_TYPE::LYRIC, false), _text(text) {} | |
| 174 | 165 | |
| 175 | 166 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 176 | 167 | }; |
| @@ -181,9 +172,8 @@ namespace Smf { | ||
| 181 | 172 | System::String^ _text; |
| 182 | 173 | public: |
| 183 | 174 | MetaMarker( |
| 184 | - System::UInt64 tick, | |
| 185 | 175 | System::String^ text |
| 186 | - ): MetaData(tick, META_TYPE::MARKER, false), _text(text) {} | |
| 176 | + ): MetaData(META_TYPE::MARKER, false), _text(text) {} | |
| 187 | 177 | |
| 188 | 178 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 189 | 179 | }; |
| @@ -194,9 +184,8 @@ namespace Smf { | ||
| 194 | 184 | System::String^ _text; |
| 195 | 185 | public: |
| 196 | 186 | MetaCuePoint( |
| 197 | - System::UInt64 tick, | |
| 198 | 187 | System::String^ text |
| 199 | - ): MetaData(tick, META_TYPE::CUE_POINT, false), _text(text) {} | |
| 188 | + ): MetaData(META_TYPE::CUE_POINT, false), _text(text) {} | |
| 200 | 189 | |
| 201 | 190 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 202 | 191 | }; |
| @@ -207,9 +196,8 @@ namespace Smf { | ||
| 207 | 196 | System::String^ _text; |
| 208 | 197 | public: |
| 209 | 198 | MetaProgramName( |
| 210 | - System::UInt64 tick, | |
| 211 | 199 | System::String^ text |
| 212 | - ): MetaData(tick, META_TYPE::PROGRAM_NAME, false), _text(text) {} | |
| 200 | + ): MetaData(META_TYPE::PROGRAM_NAME, false), _text(text) {} | |
| 213 | 201 | |
| 214 | 202 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 215 | 203 | }; |
| @@ -220,9 +208,8 @@ namespace Smf { | ||
| 220 | 208 | System::String^ _text; |
| 221 | 209 | public: |
| 222 | 210 | MetaDeviceName( |
| 223 | - System::UInt64 tick, | |
| 224 | 211 | System::String^ text |
| 225 | - ): MetaData(tick, META_TYPE::DEVICE_NAME, false), _text(text) {} | |
| 212 | + ): MetaData(META_TYPE::DEVICE_NAME, false), _text(text) {} | |
| 226 | 213 | |
| 227 | 214 | property System::String^ text { System::String^ get() {return this->_text;} } |
| 228 | 215 | }; |
| @@ -235,9 +222,8 @@ namespace Smf { | ||
| 235 | 222 | |
| 236 | 223 | public: |
| 237 | 224 | MetaPort( |
| 238 | - System::UInt64 tick, | |
| 239 | 225 | System::UInt16 number |
| 240 | - ): MetaData(tick, META_TYPE::PORT, false), _number(number) {} | |
| 226 | + ): MetaData(META_TYPE::PORT, false), _number(number) {} | |
| 241 | 227 | |
| 242 | 228 | property System::UInt16 number { System::UInt16 get() {return this->_number;} } |
| 243 | 229 | }; |
| @@ -247,8 +233,7 @@ namespace Smf { | ||
| 247 | 233 | { |
| 248 | 234 | public: |
| 249 | 235 | MetaEndOfTrack( |
| 250 | - System::UInt64 tick | |
| 251 | - ): MetaData(tick, META_TYPE::END_OF_TRACK, false) {} | |
| 236 | + ): MetaData(META_TYPE::END_OF_TRACK, false) {} | |
| 252 | 237 | }; |
| 253 | 238 | |
| 254 | 239 | public ref class MetaSetTempo sealed |
| @@ -258,9 +243,8 @@ namespace Smf { | ||
| 258 | 243 | System::UInt32 _usecPerQNote; |
| 259 | 244 | public: |
| 260 | 245 | MetaSetTempo( |
| 261 | - System::UInt64 tick, | |
| 262 | 246 | System::UInt32 usecPerQNote |
| 263 | - ): MetaData(tick, META_TYPE::SET_TEMPO, true), _usecPerQNote(usecPerQNote) {} | |
| 247 | + ): MetaData(META_TYPE::SET_TEMPO, true), _usecPerQNote(usecPerQNote) {} | |
| 264 | 248 | |
| 265 | 249 | property System::UInt32 usecPerQNote { System::UInt32 get() {return this->_usecPerQNote;} } |
| 266 | 250 | }; |
| @@ -276,13 +260,12 @@ namespace Smf { | ||
| 276 | 260 | System::Byte _subFrame; |
| 277 | 261 | public: |
| 278 | 262 | MetaSMPTEOffset( |
| 279 | - System::UInt64 tick, | |
| 280 | 263 | System::Byte hour, |
| 281 | 264 | System::Byte minute, |
| 282 | 265 | System::Byte second, |
| 283 | 266 | System::Byte frame, |
| 284 | 267 | 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) {} | |
| 286 | 269 | |
| 287 | 270 | property System::Byte hour { System::Byte get() {return this->_hour;} } |
| 288 | 271 | property System::Byte minute { System::Byte get() {return this->_minute;} } |
| @@ -301,12 +284,11 @@ namespace Smf { | ||
| 301 | 284 | System::Byte _notes; |
| 302 | 285 | public: |
| 303 | 286 | MetaTimeSignature( |
| 304 | - System::UInt64 tick, | |
| 305 | 287 | System::Byte bar, |
| 306 | 288 | System::Byte beat, |
| 307 | 289 | System::Byte metronome, |
| 308 | 290 | 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) {} | |
| 310 | 292 | |
| 311 | 293 | property System::Byte bar { System::Byte get() {return this->_bar;} } |
| 312 | 294 | property System::Byte beat { System::Byte get() {return this->_beat;} } |
| @@ -322,10 +304,9 @@ namespace Smf { | ||
| 322 | 304 | System::Boolean _minor; |
| 323 | 305 | public: |
| 324 | 306 | MetaKeySignature( |
| 325 | - System::UInt64 tick, | |
| 326 | 307 | System::SByte key, |
| 327 | 308 | 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) {} | |
| 329 | 310 | |
| 330 | 311 | property System::SByte key { System::SByte get() {return this->_key;} } |
| 331 | 312 | property System::Boolean minor { System::Boolean get() {return this->_minor;} } |
| @@ -339,10 +320,9 @@ namespace Smf { | ||
| 339 | 320 | array<System::Byte>^ _data; |
| 340 | 321 | public: |
| 341 | 322 | MetaDefault( |
| 342 | - System::UInt64 tick, | |
| 343 | 323 | System::Byte defaultType, |
| 344 | 324 | 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) {} | |
| 346 | 326 | |
| 347 | 327 | property System::Byte defaultType { System::Byte get() {return this->_defaultType;} } |
| 348 | 328 | property array<System::Byte>^ data { array<System::Byte>^ get() {return this->_data;} } |
| @@ -89,7 +89,7 @@ private: | ||
| 89 | 89 | void OnInLongData(array<System::Byte>^ data, System::UInt32 time) |
| 90 | 90 | { |
| 91 | 91 | Console::WriteLine("[{0,4:X}][{1,4:X}]", data, time); |
| 92 | - out->SendLong(data); | |
| 92 | + out->SendLong(data, data->Length); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | public: |
| @@ -76,9 +76,9 @@ void test2() | ||
| 76 | 76 | out->SendShort(0x00005890l); |
| 77 | 77 | |
| 78 | 78 | 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); | |
| 82 | 82 | |
| 83 | 83 | // out->close(); |
| 84 | 84 | } |
| @@ -18,19 +18,19 @@ void test1() | ||
| 18 | 18 | auto cap = Momiji::Core::Wave::Out::Device<System::Byte>::GetCapabilities(idx); |
| 19 | 19 | |
| 20 | 20 | 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); | |
| 29 | 29 | Console::WriteLine(); |
| 30 | 30 | |
| 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); | |
| 34 | 34 | } |
| 35 | 35 | catch(Exception^ e) |
| 36 | 36 | { |
| @@ -65,7 +65,8 @@ void test2_1( | ||
| 65 | 65 | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_LEFT |
| 66 | 66 | | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_RIGHT |
| 67 | 67 | ), |
| 68 | - Momiji::Interop::Ks::StaticKs::SUBTYPE_IEEE_FLOAT | |
| 68 | + Momiji::Interop::Ks::StaticKs::SUBTYPE_IEEE_FLOAT, | |
| 69 | + s | |
| 69 | 70 | ); |
| 70 | 71 | |
| 71 | 72 | try |
| @@ -88,13 +89,14 @@ void test2_1( | ||
| 88 | 89 | System::GC::Collect(); |
| 89 | 90 | */ |
| 90 | 91 | |
| 91 | - auto data = gcnew array<System::Single>(s*2); | |
| 92 | + auto count = s*2; | |
| 93 | + auto data = gcnew array<System::Single>(count); | |
| 92 | 94 | |
| 93 | - for(System::UInt32 idx = 0; idx < s * 2; idx++) | |
| 95 | + for(System::UInt32 idx = 0; idx < count; idx++) | |
| 94 | 96 | { |
| 95 | 97 | System::Single d = .0; |
| 96 | 98 | |
| 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))); | |
| 98 | 100 | |
| 99 | 101 | if(Modulus(static_cast<System::Single>(idx), ll) < (ll / 2)) |
| 100 | 102 | { |
| @@ -111,9 +113,9 @@ void test2_1( | ||
| 111 | 113 | data[idx] = d; |
| 112 | 114 | } |
| 113 | 115 | |
| 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)); | |
| 115 | 117 | 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)); | |
| 117 | 119 | System::Console::ReadLine(); |
| 118 | 120 | } |
| 119 | 121 | finally |
| @@ -152,7 +154,8 @@ void test3() | ||
| 152 | 154 | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_LEFT |
| 153 | 155 | | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_RIGHT |
| 154 | 156 | ), |
| 155 | - Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM | |
| 157 | + Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM, | |
| 158 | + 48000 | |
| 156 | 159 | ); |
| 157 | 160 | } |
| 158 | 161 | catch(Exception^ e) |
| @@ -176,7 +179,8 @@ void test4() | ||
| 176 | 179 | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_LEFT |
| 177 | 180 | | Momiji::Interop::Winmm::WaveFormatExtensiblePart::SPEAKER::FRONT_RIGHT |
| 178 | 181 | ), |
| 179 | - Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM | |
| 182 | + Momiji::Interop::Ks::StaticKs::SUBTYPE_PCM, | |
| 183 | + 48000 | |
| 180 | 184 | ); |
| 181 | 185 | |
| 182 | 186 | { |
| @@ -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 | + |
| @@ -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 |
| @@ -1,105 +1,18 @@ | ||
| 1 | 1 | // Momiji.Test.Sequencer.Midi.cpp : メイン プロジェクト ファイルです。 |
| 2 | 2 | |
| 3 | 3 | #include "stdafx.h" |
| 4 | +#include "Form1.h" | |
| 4 | 5 | |
| 5 | -#using <Momiji.Core.dll> | |
| 6 | -#using <System.Windows.Forms.dll> | |
| 6 | +using namespace MomijiTestSequencerMidi; | |
| 7 | 7 | |
| 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] | |
| 94 | 9 | int main(array<System::String ^> ^args) |
| 95 | 10 | { |
| 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); | |
| 101 | 14 | |
| 102 | - Console::WriteLine("===================================================="); | |
| 103 | - System::Console::ReadLine(); | |
| 104 | - return 0; | |
| 15 | + // メイン ウィンドウを作成して、実行します | |
| 16 | + Application::Run(gcnew Form1()); | |
| 17 | + return 0; | |
| 105 | 18 | } |
| @@ -75,6 +75,8 @@ | ||
| 75 | 75 | <ItemGroup> |
| 76 | 76 | <Reference Include="System" /> |
| 77 | 77 | <Reference Include="System.Data" /> |
| 78 | + <Reference Include="System.Drawing" /> | |
| 79 | + <Reference Include="System.Windows.Forms" /> | |
| 78 | 80 | <Reference Include="System.Xml" /> |
| 79 | 81 | </ItemGroup> |
| 80 | 82 | <ItemGroup> |
| @@ -82,6 +84,9 @@ | ||
| 82 | 84 | <None Include="ReadMe.txt" /> |
| 83 | 85 | </ItemGroup> |
| 84 | 86 | <ItemGroup> |
| 87 | + <ClInclude Include="Form1.h"> | |
| 88 | + <FileType>CppForm</FileType> | |
| 89 | + </ClInclude> | |
| 85 | 90 | <ClInclude Include="resource.h" /> |
| 86 | 91 | <ClInclude Include="stdafx.h" /> |
| 87 | 92 | </ItemGroup> |
| @@ -96,6 +101,12 @@ | ||
| 96 | 101 | <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> |
| 97 | 102 | </ClCompile> |
| 98 | 103 | </ItemGroup> |
| 104 | + <ItemGroup> | |
| 105 | + <EmbeddedResource Include="Form1.resx"> | |
| 106 | + <DependentUpon>Form1.h</DependentUpon> | |
| 107 | + <SubType>Designer</SubType> | |
| 108 | + </EmbeddedResource> | |
| 109 | + </ItemGroup> | |
| 99 | 110 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
| 100 | 111 | <ImportGroup Label="ExtensionTargets"> |
| 101 | 112 | </ImportGroup> |
| @@ -27,6 +27,9 @@ | ||
| 27 | 27 | <ClInclude Include="resource.h"> |
| 28 | 28 | <Filter>ヘッダー ファイル</Filter> |
| 29 | 29 | </ClInclude> |
| 30 | + <ClInclude Include="Form1.h"> | |
| 31 | + <Filter>ヘッダー ファイル</Filter> | |
| 32 | + </ClInclude> | |
| 30 | 33 | </ItemGroup> |
| 31 | 34 | <ItemGroup> |
| 32 | 35 | <ResourceCompile Include="app.rc"> |
| @@ -44,4 +47,9 @@ | ||
| 44 | 47 | <Filter>ソース ファイル</Filter> |
| 45 | 48 | </ClCompile> |
| 46 | 49 | </ItemGroup> |
| 50 | + <ItemGroup> | |
| 51 | + <EmbeddedResource Include="Form1.resx"> | |
| 52 | + <Filter>リソース ファイル</Filter> | |
| 53 | + </EmbeddedResource> | |
| 54 | + </ItemGroup> | |
| 47 | 55 | </Project> |
| \ No newline at end of file |
| @@ -137,8 +137,8 @@ private: | ||
| 137 | 137 | continue; |
| 138 | 138 | } |
| 139 | 139 | |
| 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); | |
| 142 | 142 | |
| 143 | 143 | auto e = Momiji::Interop::Vst::VstEvent(); |
| 144 | 144 | e.type = Momiji::Interop::Vst::VstEvent::VstEventTypes::kVstMidiType; |