Re: List of QuickTime File Types
Re: List of QuickTime File Types
- Subject: Re: List of QuickTime File Types
- From: Tim Monroe <email@hidden>
- Date: Thu, 26 May 2005 09:28:56 -0700
On May 26, 2005, at 7:13 AM, Todd Yandell wrote:
On May 25, 2005, at 7:41 PM, Mike O'Connor wrote:
But is there something I can call that will get me a list of file
types or extensions that QuickTime can handle?
Yes. See QTMovie's movieFileTypes: class method. It should do exactly
what you want. The QTMovie class is part of QTKit, of course, so
you'll have to include that in your app if it's not already. Then,
you just pass it's output in to NSSavePanel's setAllowedFileTypes:
method.
This will work fine, and it allows you to selectively include still image types, translatable types, and types that require "aggressive" importers (like text and html files) by tweaking the set of flags passed to movieFileTypes:. There is however an even easier way, using the canInitWithFile method:
<x-tad-bigger>- (</x-tad-bigger><x-tad-bigger>id</x-tad-bigger><x-tad-bigger>)sender shouldShowFilename:(NSString *)filename
{
</x-tad-bigger><x-tad-bigger>BOOL</x-tad-bigger><x-tad-bigger> isDir = </x-tad-bigger><x-tad-bigger>NO</x-tad-bigger><x-tad-bigger>;
[[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir];
</x-tad-bigger><x-tad-bigger>return</x-tad-bigger><x-tad-bigger> isDir ? </x-tad-bigger><x-tad-bigger>YES</x-tad-bigger><x-tad-bigger> : [QTMovie canInitWithFile:filename];
}
</x-tad-bigger>
This would be pretty much equivalent to passing in the array of file types returned by movieFileTypes: with the
<x-tad-bigger>QTIncludeAllTypes </x-tad-bigger>flag.
Tim Monroe
QuickTime Engineering
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden