Graphics Reference
In-Depth Information
QTZeroTime
is a
QTTime
structure that represents the beginning time of a movie. Next,
change the
-updateSlider
selector that is called by the timer, as shown in Listing 7-9.
LISTING 7-9
Calling Time Stamp Update
- (
void
)updateSlider:(
NSTimer
*)theTimer;
{
QTTime current = [movie currentTime];
double
value = (
double
)current.timeValue /
(
double
)movieDuration.timeValue;
[slider setDoubleValue:value];
[slider
setNeedsDisplay
];
[
self
updateTimeStamp];
}
With these changes in place, the time code overlay is updated in real time when the
movie is running. In Xcode, load the Movie Player with the Overlay sample project, and
click Build and Go to see the overlay in action. Figure 7-5 shows the time code overlay
running. As you'll notice, the time is updated on a regular basis.
FIGURE 7-5
Displaying a Time Code Overlay