Hi,
I have just finished learning DirextX Audio and have a question concerning loading a file with DirectMusic. The following both load a MIDI file ready to play it. Is there really any difference between the two?
DMUS_OBJECTDESC uMusicDesc;
ZeroMemory(&uMusicDesc, sizeof(DMUS_OBJECTDESC));
uMusicDesc.dwSize = sizeof(DMUS_OBJECTDESC);
uMusicDesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH;
uMusicDesc.guidClass = CLSID_DirectMusicSegment;
mbstowcs(uMusicDesc.wszFileName, &".\\resource\\chrono.mid", MAX_PATH);
dmLoader_->GetObject(&uMusicDesc, IID_IDirectMusicSegment8, (LPVOID*)&dmSegment_);
dmSegment_->SetParam(GUID_StandardMIDIFile, 0xFFFFFFFF, 0, 0, NULL);
-----
WCHAR wcFile[MAX_PATH] = L".\\resource\\chrono.mid";
dmLoader_->LoadObjectFromFile(CLSID_DirectMusicSegment, IID_IDirectMusicSegment8, wcFile, (LPVOID*)&dmSegment_);
[edited by - Krakken on August 7, 2003 3:42:26 AM]
DSound plays the file like it''s loaded, you can only do a few things like setting the volume. DMusic gives you the ability to change the instruments and much much more.
Check out the SDK: DirectMusic-> Introduction to DirectMusic-> "The Power of DirectMusic"
Uhm... they are both DirectMusic.... They can both use the same functions also; just one is longer than the other. I am asking if there is a difference between the two? Or is LoadObjectFromFile() just a built in wrapper of the first method? Thanks.
[edited by - Krakken on August 7, 2003 4:32:23 AM]
It must be something you can specify in the desc. You know, sometimes a function has a brother called Ex. The latter should be a wrapper that uses the standard desc.