02.04.2013 Views

QuickTime Kit Programming Guide - filibeto.org

QuickTime Kit Programming Guide - filibeto.org

QuickTime Kit Programming Guide - filibeto.org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C H A P T E R 4<br />

Adding New Capabilities to the<br />

QT<strong>Kit</strong>Player Application<br />

In this chapter, you’ll extend the QT<strong>Kit</strong>Player application beyond what you have constructed in the<br />

previous chapter. You’ll add an NSDrawer object to the QTMovieView window, which toggles open<br />

and close with the click of a mouse. The drawer will also have new, enhanced functionality, including<br />

the capability of displaying a movie’s current time and duration, its normal and current size, and its<br />

source.<br />

Notably, as you work through the steps outlined in this chapter and add new chunks of code to your<br />

Xcode project, you’ll implement a callback mechanism from the <strong>QuickTime</strong> C API.<br />

When you’ve completed your Xcode project, you’ll be able to choose File > New in your extended<br />

QT<strong>Kit</strong>Player and an untitled <strong>QuickTime</strong> movie with a black screen will open for you. If you click the<br />

button in the middle of the frame to the right, as shown in Figure 4-1, a Cocoa drawer pops open.<br />

Figure 4-1 An untitled <strong>QuickTime</strong> movie with an open Cocoa drawer<br />

The button in the movie frame lets you toggle the drawer open and closed, with fields of useful<br />

information about the movie being displayed. The information displayed, however, is not static.<br />

By implementing a callback mechanism from the <strong>QuickTime</strong> C API, your QT<strong>Kit</strong>Player will be able<br />

to synchronize the current time to the playback of the movie itself.<br />

When a <strong>QuickTime</strong> movie plays, for example, the current time field is updated synchronously with<br />

the movie, as illustrated in Figure 4-2.<br />

2005-11-09 | © 2004, 2005 Apple Computer, Inc. All Rights Reserved.<br />

61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!