230 | | |
---|
| 235 | |
---|
| 236 | // test the general status info block |
---|
| 237 | debugPrint (DEBUG_LEVEL_INFO, " Trying to create an AvGeneralMusicStatusInfoBlock...\n"); |
---|
| 238 | AvGeneralMusicInfoBlock *testblock3=new AvGeneralMusicInfoBlock(testdesc_mid2,0); |
---|
| 239 | |
---|
| 240 | // PP: the next tests could fail because of the difference in hardware. |
---|
| 241 | // these classes are intended to be used in the parser. I use hardcoded addresses in the test code, |
---|
| 242 | // instead of derived addresses based on the parent descriptors. |
---|
| 243 | // this is only intended to debug the base classes before using them in the parser. |
---|
| 244 | |
---|
| 245 | |
---|
| 246 | // this one should be valid (on my config) |
---|
| 247 | debugPrint (DEBUG_LEVEL_INFO, " isValid? %s\n",(testblock3->isValid()?"yes":"no")); |
---|
| 248 | debugPrint (DEBUG_LEVEL_INFO, " canTransmitBlocking? %s\n",(testblock3->canTransmitBlocking()?"yes":"no")); |
---|
| 249 | debugPrint (DEBUG_LEVEL_INFO, " canTransmitNonblocking? %s\n",(testblock3->canTransmitNonblocking()?"yes":"no")); |
---|
| 250 | debugPrint (DEBUG_LEVEL_INFO, " canReceiveBlocking? %s\n",(testblock3->canReceiveBlocking()?"yes":"no")); |
---|
| 251 | debugPrint (DEBUG_LEVEL_INFO, " canReceiveNonblocking? %s\n",(testblock3->canReceiveNonblocking()?"yes":"no")); |
---|
| 252 | |
---|
| 253 | delete testblock3; |
---|
| 254 | // this one shouldn't be valid |
---|
| 255 | testblock3=new AvGeneralMusicInfoBlock(testdesc_mid2,2+testblock1->getLength()); |
---|
| 256 | debugPrint (DEBUG_LEVEL_INFO, " isValid? %s\n",(testblock3->isValid()?"yes":"no")); |
---|
| 257 | debugPrint (DEBUG_LEVEL_INFO, " canTransmitBlocking? %s\n",(testblock3->canTransmitBlocking()?"yes":"no")); |
---|
| 258 | debugPrint (DEBUG_LEVEL_INFO, " canTransmitNonblocking? %s\n",(testblock3->canTransmitNonblocking()?"yes":"no")); |
---|
| 259 | debugPrint (DEBUG_LEVEL_INFO, " canReceiveBlocking? %s\n",(testblock3->canReceiveBlocking()?"yes":"no")); |
---|
| 260 | debugPrint (DEBUG_LEVEL_INFO, " canReceiveNonblocking? %s\n",(testblock3->canReceiveNonblocking()?"yes":"no")); |
---|
| 261 | |
---|
| 262 | debugPrint (DEBUG_LEVEL_INFO, " Trying to create an AvAudioInfoBlock...\n"); |
---|
| 263 | |
---|
| 264 | AvAudioInfoBlock *testblock4=new AvAudioInfoBlock(testdesc_mid2,0x01A); |
---|
| 265 | debugPrint (DEBUG_LEVEL_INFO, " isValid? %s\n",(testblock4->isValid()?"yes":"no")); |
---|
| 266 | debugPrint (DEBUG_LEVEL_INFO, " Length? 0x%04X (%d)\n",testblock4->getLength(),testblock4->getLength()); |
---|
| 267 | debugPrint (DEBUG_LEVEL_INFO, " streams: %d\n",testblock4->getNbStreams()); |
---|
| 268 | debugPrint (DEBUG_LEVEL_INFO, " Name: %s\n",testblock4->getName()); |
---|
| 269 | |
---|
| 270 | debugPrint (DEBUG_LEVEL_INFO, " Trying to create an AvMidiInfoBlock...\n"); |
---|
| 271 | |
---|
| 272 | AvMidiInfoBlock *testblock5=new AvMidiInfoBlock(testdesc_mid2,0x097); |
---|
| 273 | debugPrint (DEBUG_LEVEL_INFO, " isValid? %s\n",(testblock5->isValid()?"yes":"no")); |
---|
| 274 | debugPrint (DEBUG_LEVEL_INFO, " Length? 0x%04X (%d)\n",testblock5->getLength(),testblock5->getLength()); |
---|
| 275 | unsigned int nb_midi_streams=testblock5->getNbStreams(); |
---|
| 276 | debugPrint (DEBUG_LEVEL_INFO, " streams: %d\n",nb_midi_streams); |
---|
| 277 | for (unsigned int i=0;i<nb_midi_streams;i++) { |
---|
| 278 | debugPrint (DEBUG_LEVEL_INFO, " stream %d name: %s\n",i,testblock5->getName(i)); |
---|
| 279 | } |
---|
| 280 | |
---|
| 281 | debugPrint (DEBUG_LEVEL_INFO, " Trying to create an AvAudioSyncInfoBlock...\n"); |
---|
| 282 | AvAudioSyncInfoBlock *testblock6=new AvAudioSyncInfoBlock(testdesc_mid2,0x0260); |
---|
| 283 | debugPrint (DEBUG_LEVEL_INFO, " isValid? %s\n",(testblock6->isValid()?"yes":"no")); |
---|
| 284 | debugPrint (DEBUG_LEVEL_INFO, " canSyncBus? %s\n",(testblock6->canSyncBus()?"yes":"no")); |
---|
| 285 | debugPrint (DEBUG_LEVEL_INFO, " canSyncExternal? %s\n",(testblock6->canSyncExternal()?"yes":"no")); |
---|
| 286 | |
---|
| 287 | |
---|