What's new

Yet another dx problem

Doomulation

?????????????????????????
Another problem has appears and i'm clueless without any demonstrations...
All do we know that tempo might change during playback of a segment (the output of a file loaded into directmusic). Therefore, to obtain the length of the file, which is returned in music time, which changes with tempo, i need to get the tempo to convert the music time to time of which we can understand.

From what i get, the way to do this would be this:

PHP:
_DMUS_TEMPO_PARAM tpTime;
hr = g_pPerformance->GetParam( GUID_TempoParam , 0xFFFFFFFF,
	                          DMUS_SEG_ALLTRACKS, 0, NULL, (void*)tpTime );

However, the last paramenter, the argument of where to send the variable to get the data returned, is void*.
Sending a int or long or any other data-type like that will not work here. It must be a data-type of the type _DMUS_TEMPO_PARAM. But the problem is...i cannot convert this paramenter to void*.

So how the hell do i get the tempo? That's what i wonder.
 

Cyberman

Moderator
Moderator
How about using the & operator, it returns a pointer to whatever you prepend it to then you type cast it as you need.
Code:
hr=g_pPerformance->GetParam(_GUID_TempoParam, 
      0xFFFFFFFF, DMUS_SEG_ALLTRACKS, 0,
      NULL, (void*) &tpTime);
should work.. I've done similiar horrible things before ;)

Cyb
 
Last edited:

Cyberman

Moderator
Moderator
Doomulation said:
Hmm, logically it would work. :)
I'll test this, thx.
Should work.. have to try it first though right?
One thing I hate about those posts with PHP coding in then, quoting them is a disaster! ;)

Cyb
 

Top