From: Mihael <mih...@gm...> - 2008-07-25 10:59:48
|
Hey cool people! I am trying to export quicktime movies in a command line program. The objective-c code would look like this QTMovie *movie = [QTMovie movieWithFile:@"/tmp/mymovie.mov" error:nil]; NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], QTMovieExport, [NSNumber numberWithLong:kQTFileType3GPP], QTMovieExportType, nil]; [movie writeToFile:@"/tmp/mymovie.3gp" withAttributes:dictionary]; So I tried doing it like this: movie.writeToFile_withAttributes( myMovieFile3GPP, { 'QTMovieExport'=>true, 'QTMovieExportType'=> kQTFileType3GPP }.to_ns ) And failed. After investigating alot, so it seems, there is no "kQTFileType3GPP" or "KQTFileType3GPP" defined after requiring the QTKit. I tried this in irb (with require osx/cocoa and qtkit): >> dict = NSDictionary .dictionaryWithObjectsAndKeys( NSNumber.numberWithBool(true), QTMovieExport, NSNumber.numberWithLong(kQTFileType3GPP), QTMovieExportType, nil) NameError: undefined local variable or method `kQTFileType3GPP' for #<Object:0x389a0> from (irb):38 from /Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/ oc_types.rb:61 >> dict = NSDictionary .dictionaryWithObjectsAndKeys( NSNumber.numberWithBool(true), QTMovieExport, NSNumber.numberWithLong(KQTFileType3GPP) NameError: uninitialized constant KQTFileType3GPP from /Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/ oc_import.rb:169:in `const_missing' from (irb):39 from /Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/ oc_types.rb:61 How can I get these constants or why are they missing? (actually all from QTKitDefines.h) Thanks for any answers :) Mihael |