views:

75

answers:

0

Below is my code for a doc based QTKit app that exports to the fixed Apple device formats by way of a popUp that displays the three device options. The [NSNumberWithLong:mpg4'] option works fine as well, but it lacks custom output settings. I want to integrate the familiar QT MPEG-4 export component dialog so that the user can customize the mpeg-4 output options.

Can someone explain how to do this?

thanks.

-paul.

- (void)exportPanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
int which = [mExportTypePopUpButton indexOfSelectedItem];
int                 selectedItem;
NSMutableDictionary *settings = nil;
static NSArray      *exportTypes = nil;

// init
if (exportTypes == nil)
{
    exportTypes = [[NSArray arrayWithObjects:

                    //[NSNumber numberWithLong:'mpg4'],   ///MPEG-4

                    [NSNumber numberWithLong:'M4VH'],   ///Apple Tv
                    [NSNumber numberWithLong:'M4VP'],   ///iPhone
                    [NSNumber numberWithLong:'M4V '],   ///iPod

                    nil] retain];
}





if (returnCode == NSOKButton)
{
    // init
    selectedItem = [mExportTypePopUpButton indexOfSelectedItem];
    settings = [NSMutableDictionary dictionaryWithCapacity:2];
    [settings setObject:[NSNumber numberWithBool:YES] forKey:QTMovieExport];



    if ((selectedItem >= 0) && (selectedItem < [exportTypes count]))
        [settings setObject:[exportTypes objectAtIndex:selectedItem] forKey:QTMovieExportType];

    if (which==0)

        [mReceiver setStringValue:@"Apple Tv"];


    if (which==1)

        [mReceiver setStringValue:@"iPhone"];


    if (which==2)

        [mReceiver setStringValue:@"iPod"];





    /
    if (![mMovie writeToFile:[sheet filename] withAttributes:settings])
        NSRunAlertPanel(@"Cancel", @"Export terminated.", nil, nil, nil);



}

}