PDA

View Full Version : Interpreting QTAtomContainer




Chirone
Jul 27, 2009, 07:38 PM
i found this code here:
http://roobasoft.com/blog/2005/12/05/qt-export-dialog-so-what-did-they-choose/
which claims to read what the export settings are and store them so they can be displayed.
however, upon trying this code out and doing a print statement instead of setting values i get nothing printed out

how does one print out as a string what the atoms are?



kainjow
Jul 27, 2009, 08:13 PM
That post is from 2005, about 2 years before Leopard was released. Since the C QuickTime API is basically obsolete (for 64-bit), there's a good chance that specific code is not working in Leopard, or the data you're working with is in a different format.

Anyways, what are you trying to do?

Chirone
Jul 27, 2009, 08:23 PM
hah, yeah, it seems like a lot of the stuff out there is old and uses deprecated things including the ol' quickdraw... heck, i'm not even sure if the atoms a yet deprecated or still in use, nothing in the docs has pointed out to me that it is so i assume it's still in use..

anyway, to be more specific about what i'm trying to do...
i want a button that will make an object, this object will have all the export settings for a qtmovie
i want to get the settings in two possible ways,
1, use the dialog to create the settings
2, create the settings with code

also, i want to reflect a few of those settings in the interface. so if the encoded mov is going to be 320x480 at 24 fps with a particular video codec and audio codec then it will be displayed on the interface

what i was originally thinking (and feel free to suggest alternatives) was to open the export dialog obtain the settings from that (via the atoms) then i could determine what atoms i need to set for 2

i've been opening the dialog with the MovieExportDoUserDialog method

kainjow
Jul 28, 2009, 10:46 AM
I'm not sure if what you're doing is possible with QTKit, but I'd suggest looking into QTMovie's writeToFile:withAttributes: method and the QTMovieExportSettings key (if you want to be future proof, otherwise stick with the C APIs and 32-bit :)).

Chirone
Jul 28, 2009, 04:34 PM
i will look again at those attributes then :)

it's quite annoying that not all the old functions are up in the new stuff :p

Chirone
Jul 28, 2009, 05:48 PM
hmmm, ok so it looks like the Attributes thing is the new way of QTAtoms... not sure why i didn't realise this sooner...

is there an automated dialog that pops up when you choose the export settings still?
i tried the old way and it didn't change the QTMovie.. or it didn't appear to, i went to see if i could change the size
and I can't see how you determine the frame rate either, or a way to change it.
i thought maybe i'd have to change the QTTrack, and change that frame rate, but all there is a timescale that doesn't even print.
long timeScale = [[track attributeForKey: QTTrackTimeScaleAttribute] longValue];
printf("track time scale: %l\n", timeScale); prints no value... it prints the "tack time scale:" part, but not the value of it
i set a break point and timeScale had the value 2997 when i mouse overed it.