QTTime

I’m working on an ASOC app with QTKit. I can’t for the life of me figure out how to get “current time”. Looking at one of Apple’s samples (MyMediaPlayer) I see that it should be fairly simple, but I’m thinking maybe it needs to be done in ObjC??? Seems I get errors on everything I’ve tried…

I’m not sure how to do this in ASOC or what I would need to put in a .h/.m file.
In the sample I just made a couple of changes to their duration example and got what I want, but how can I put this in my ASOC app?

QTTime cTime = [movie currentTme];
[durationTextField setStringValue:QTStringFromTime(cTime)];

FYI: I’m just trying to get the time when the player is closed so that I can let the player resume where it left off at a later time. Doesn’t need to be continually updated, although that should be possible too? No? (i.e. if I wanted to build a custom controller?)

I’m guessing I’m missing something simple, but I’ve tried everything I can think of and have searched high and low and nobody talks about using QTKit in ASOC.

QTStringFromTime() is a C-style function, so you’re probably out of luck with that. But I’m not sure why you need a string – if it’s to store the QTTime, you should look at valueWithQTTime:.

Thanks for that! That solves the immediate issue.

I’d LIKE to be able to present the info (i.e. “time remaining”) but the main concern was getting the time saved on closing so it could restart at the same time it stopped.