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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Adding New Capabilities to the QT<strong>Kit</strong>Player Application<br />

Figure 4-2 An mp4 <strong>QuickTime</strong> movie playing with the current time, duration, movie size, and movie displayed<br />

in the open Cocoa drawer<br />

Design Strategy<br />

Building on the existing functionality of your QT<strong>Kit</strong>Player application, you’ll add new text fields to<br />

your NSDrawer object that provide information about the size of the movie playing, its source path<br />

on the user’s computer, as well as the time and duration of play. These new fields may serve to<br />

enhance the user’s ability, for example, to edit a <strong>QuickTime</strong> movie with a specific timeline, or to resize<br />

a movie to a particular pixel ratio. The location of the source movie may also be useful.<br />

Because you are adding to the existing QT<strong>Kit</strong>Player application, all the functionality of the player is<br />

still intact. All the controls for movie playback are available for starting and stopping, showing and<br />

hiding the controller, stepping forward and backward frame by frame, and so on.<br />

This chapter depends on your having worked through the construction of the QT<strong>Kit</strong>Player application<br />

in the previous chapter. If you haven’t studied the steps described in that chapter, or simply skimmed<br />

over them, it might be a good idea to go back there first and refresh your memory before proceeding.<br />

In this, as well as in the following chapters, you’ll break down the tasks you need to accomplish into<br />

a series of discrete steps. The goal is to work as efficiently as possible by first laying the foundation<br />

for your enhanced player application in Interface Builder, and then adding the code you need to make<br />

it work.<br />

Tasks to Accomplish<br />

The tasks you want to accomplish in adding new functionality to your QT<strong>Kit</strong>Player application are<br />

straightforward enough if you have already developed projects with Cocoa and Xcode. You’ll do this:<br />

1. Add a new Cocoa NSDrawer object to your project, using the tools available to you in Interface<br />

Builder and Xcode 2.0. The goal is for the user to be able to toggle the drawer open and closed,<br />

and for the drawer object to have the necessary logic to display and synchronously update the<br />

movie content as it plays.<br />

2. Add a small chunk of code to the MovieDocument.h class interface to specify the movie attributes<br />

of the drawer.<br />

62 Design Strategy<br />

2005-11-09 | © 2004, 2005 Apple Computer, Inc. All Rights Reserved.

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

Saved successfully!

Ooh no, something went wrong!