Show user QT’s Export Video Dialog
I want to write down how I’m presenting the QuickTime compression dialog. This post will be followed by another post describing how to figure out some of the information of what the user selected from the presented dialog. First things first, displaying the dialog:
ComponentInstance component = OpenDefaultComponent(MovieExportType, kQTFileTypeMovie);
Boolean canceled;
MovieExportDoUserDialog(component, NULL, NULL, 0, 0, &canceled);
QTAtomContainer settings = nil;
MovieExportGetSettingsAsAtomContainer(component, &settings);
That wasn’t so bad. If we wanted to use something other than the defaults, it gets a lot messier quickly, but that’s not me. With this, the user is presented with the default ‘export settings’ dialog. At the end of those five lines, we’re left with a QTAtomContainer that describes what the user selected. What’s a QTAtomContainer? Good question. While researching this I found a very fitting quote on a cocoa mailing list:
“Hang in there, QT Programming can be frustrating in the beginning but soon you go AHA!”
I’m still waiting for my AHA. I’m certainly getting closer daily, but I think I’m still a ways out. Oh, right, QTAtomContainer. Here’s my understanding:
A QTAtomContainer is a chunk(s) of memory[1] that describes some QT settings. A QTAtom points inside that region of memory. The container contains many QTAtoms. You use funky functions to navigate, add, remove, get and set QTAtoms. See http://developer.apple.com/documentation/QuickTime/APIREF/WorkingWithQTAtoms.htm.
[1] it’s unclear to me if the memory is one contiguous chunk or a linked list of chunks
