Section 18.5. Modifying iDVD Itself


18.5. Modifying iDVD Itself

As you've probably discovered , the iDVD program icon isn't really an application icon at allit's a Mac OS X package (page 112). Because Mac OS X programs are often built as packages in this way, they give you a great opportunity to hack the program itselfto change its look, reassign its keystrokes, and so on.

POWER USERS' CLINIC
Developer Tools the Download Way

If you can't seem to find the Developer Tools disc, you can download it from the Web for free, although doing so requires you to sign up for Apple's developer programalso free. A high-speed Internet connection and lots of patience is recommended, since the files are over 300 MB.

In your Web browser, visit http://connect.apple.com and click Join Now. Follow the instructions to create an account. Next , log in at http://connect.apple.com, click Downloads, and click Mac OS X. You should wind up on a screen containing recent XCode Tools releases.

Find the latest version, click Download, and then wait.

Once you've downloaded them, you install the XCode Tools the same way as many other Mac OS X programs. Just expand the archive, double-click the package installer, and then provide your administrative password when requested . Once the installation is done, you end up with a Developer folder on your hard drive containing all the goodies .


This is a rush, an illicit -feeling power trip, but it doesn't actually hurt anything. As long as you've got your original iLife DVD on hand, so that you can install a fresh, unmodified copy of iDVD if necessary, you can do whatever you want to a copy and still sleep peacefully at night.

18.5.1. Download the Developer Tools

The following instructions assume that you have a copy of Apple's XCode Developer Tools.

The Developer Tools are essential for anyone who writes software for Mac OS X. The programs that come with them help you create, debug, and compile programs. But the Developer Tools can be useful even if you're not a programmer. They include some useful utilities, including PropertyList Editor (which makes it easy to edit a program's preference files).

If you bought Mac OS X in the store, in a box, these programs are on a special CD called Developer. If Mac OS X came with your Mac, the Developer CD may be a disk image on one of your Software Restore discs. (Use Disk Utility to burn this image onto a real CD.)

If a Developer CD or disk image didn't come with your Mac or your copy of Mac OS X, or if you can't find it, you can also download it; see the box on the facing page.

18.5.2. Dive into iDVD

Follow these steps to open your copy of iDVD and begin your joyful hacking.

  1. Open the iDVD application package.

    By now, you probably know the drill: Control-click the iDVD application icon; from the shortcut menu, choose Show Package Contents.

  2. Open the Contents Resources folder. Open your language folder.

    iDVD contains separate folders for each language. For this example, open the English.lproj folder.

  3. Double-click the icon called DVDDocument.nib.

    This document opens in the program called Interface Builder, which is one of the developer tools programs.

    Interface Builder lets you both create and modify the interfaces of your programs. You can change window titles, move buttons around the screen, add or remove menu commands, and more.

    What you're now seeing is the behind-the-scenes layout of the iDVD program itself (see Figure 18-6).

    In this example, you'll create a custom button that turns off the sound in iDVD without stopping the videos that play on your buttons, drop zones, and backgrounds. (Ordinarily, clicking the Motion button in iDVD simultaneously silences the music and stops all video playback.)


    Tip: Remember to turn both sound and motion back on again before you burn a DVDif, that is, you want these features to appear in the finished product.

    Of course, your first worry is where you're going to put this button. The only space for buttons is the row of icons at the bottom edge of the iDVD window, and it's already pretty full.

    Ah, but what about that Apple logo at the center of the bottom edge? (It appears here as a lowly broken-picture icon, but you can confirm that it's really the Apple logo by clicking it and then choosing Tools Show Info.) Its using up prime real estate that might be better used by the button you're going to design.

  4. Move or remove the broken-picture Apple icon.

    Either drag the Apple icon's placeholder to the left, or click it and then press the Delete key to remove it entirely.

    In the next step, you're going to need the Cocoa palette (Figure 18-6, top right). If it isn't already open (usually at the upper-right corner of your screen), choose Tools Palettes Show Palettes ( -/).

    Figure 18-6. Interface Builder shows you a map of the various buttons, checkboxes, and other elements that compose its screen. It doesn't look exactly like iDVD, because this is just its skeleton, but it's enough for the little experiment you're about to try.


  5. In the Cocoa palette, click the Buttons button (shown at top in Figure 18-6).

    The palette changes to show you a variety of button designs.

  6. Drag the round, clear button on the Buttons palette (the second button in the top row of buttons) into the space you created by moving the Apple icon.

    You've just installed a new button in iDVD. Unfortunately, when you click it, it won't do anything at allyet.

  7. Choose Tools Show Info (Shift- -I).

    The Show Info dialog box appears. Make sure that the pop-up menu at the top says Attributes.

  8. Click in the third line (Icon). Type MiniAudio1N.

    Type the phrase exactly as you see here, including spelling and capitalization. (The second to last character is a 1, not an L.) You're directing Interface Builder's attention to a certain graphic that's already in the Contents Resources folder of your iDVD Application. In short, youre giving your new button a facean icon of its own.

  9. Close the Info panel.

    A broken-picture icon now appears over your button. That's normaland temporary.

    In the next step, you're going to need the DVDDocument.nib window, which should also be somewhere on your screen (Figure 18-7). Move the window until you see both your new button and the iDVDThemeController cube at the same time. (You can probably see only part of the cube's name : iDVDThemeC. )

    Figure 18-7. The DVDDocument window has five tabs: Instances, Classes, Images, Sounds, and Nibs. Make sure that the Instances tab is selected. Set your windows so you can see both your new button and the iDVDThemeC cube at the same time.


  10. While pressing the Control key, drag from your button to the iDVDThemeC cube. Wait until a box appears around the cube before releasing the mouse.

    A strange little line connects your new button with the cube. When you let go, the Info panel reappears, with the Connections panel in view (Figure 18-8). You've just taught iDVD to make a connection between your newly placed button and some action, which you'll specify in the next step.

    Figure 18-8. The Connections panel lists all the different functions that your new button can perform. Many of them use cryptic names , but you can generally figure out what they do.


  11. At the very bottom of the scrolling list on the right side, double-click toggleBackgroundAudio: (or whatever portion of this term you can see in the list).

    An indented dot appears to the right of toggleBackgroundAudio:, as shown in Figure 18-7. You've just given your new button a purpose in lifesomething that will happen whenever somebody clicks it.

  12. Choose File Save ( -S). Quit Interface Builder.

    If you open your modified copy of iDVD, you'll see that your new button appears at the bottom of the window (as shown in Figure 18-9). To test your new button, choose a theme that contains video and audio menu screens. Make sure that they're playingand then click your new button. Marvel as the sound cuts out, but the video continues.

    Figure 18-9. After editing iDVD, your new button (the small speaker button) appears at the bottom of the window, ready to control sound playback for motion menus .
    There's a lot more you can do with Interface Builder and iDVD; this was only one example. In step 11, for instance, you assigned your new button to the toggleBackgroundAudio function, but you probably noticed that there were dozens of other functions in that list that you could have assigned to. Explore other little cubes to find even more program features.


    One small step for iDVD, perhaps, but a giant leap for your understanding of how Mac software is made.



iMovie HD & iDVD 5. The Missing Manual
iMovie HD & iDVD 5: The Missing Manual
ISBN: 0596100337
EAN: 2147483647
Year: 2005
Pages: 209
Authors: David Pogue

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net