QuickTime Kit Programming Guide - filibeto.org
QuickTime Kit Programming Guide - filibeto.org
QuickTime Kit Programming Guide - filibeto.org
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 3<br />
Extending the QT<strong>Kit</strong>Player Application<br />
if ((selectedItem >= 0) && (selectedItem < [exportTypes count]))<br />
[settings setObject:[exportTypes objectAtIndex:selectedItem]<br />
forKey:QTMovieExportType];<br />
}<br />
}<br />
// export<br />
if (![mMovie writeToFile:[sheet filename] withAttributes:settings])<br />
NSRunAlertPanel(@"Error", @"Error exporting movie.", nil, nil, nil);<br />
20. Add the following actions to your file:<br />
- (IBAction)doExport:(id)sender<br />
{<br />
NSSavePanel *savePanel;<br />
// init<br />
savePanel = [NSSavePanel savePanel];<br />
// run the export sheet<br />
[savePanel setAccessoryView:mExportAccessoryView];<br />
[savePanel beginSheetForDirectory:nil file:[[self fileName] lastPathComponent]<br />
modalForWindow:mMovieWindow modalDelegate:self<br />
didEndSelector:@selector(exportPanelDidEnd: returnCode: contextInfo:)<br />
contextInfo:nil];<br />
}<br />
- (IBAction)doSetFillColorPanel:(id)sender<br />
{<br />
NSColorPanel *colorPanel;<br />
}<br />
// init<br />
colorPanel = [NSColorPanel sharedColorPanel];<br />
[colorPanel setAction:@selector(doSetFillColor:)];<br />
[colorPanel setTarget:self];<br />
[colorPanel setColor:[mMovieView fillColor]];<br />
// run the panel<br />
[colorPanel makeKeyAndOrderFront:nil];<br />
- (IBAction)doSetFillColor:(id)sender<br />
{<br />
// update the fill color<br />
[mMovieView setFillColor:[sender color]];<br />
}<br />
- (IBAction)doShowController:(id)sender<br />
{<br />
// toggle the controller visibility<br />
[mMovieView setControllerVisible:([sender state] == NSOffState)];<br />
}<br />
- (IBAction)doPreserveAspectRatio:(id)sender<br />
{<br />
// toggle the aspect ratio preservation<br />
[mMovieView setPreservesAspectRatio:([sender state] == NSOffState)];<br />
Adding Code to MovieDocument.m 55<br />
2005-11-09 | © 2004, 2005 Apple Computer, Inc. All Rights Reserved.