Based on the information in the two .h
files you are going to have to pay attention to the version of iTunes in order to figure out how to interpret the data coming back. In particular, you'll want to check the build number in the info.plist
in the iTunes bundle and based on that use one of the two class interfaces that you have built with sdp
. I would suggest that you take the old file and pull out the class and rename it to something with an appended version number, because you're going to need to cast the object pointer before calling the method based on which version of iTunes you are working with.
So, assuming you have ITunesObjectProxy
and ITunesObjectProxy_old
, you would use:
double progress;
if (newer)
progress = [iTunes playerPosition ];
else
progress = (double)[(ITunesProxyObject_old *)iTunes playerPosition ];
That way, you will make sure to get the double and int handled correctly. Obviously, the specific names of your objects and classes may differ and I'm leaving the case of determining the version of iTunes.app to you, but that's a trivial check of the Info.plist
.