]> gitweb.factorcode.org Git - factor.git/blob - extra/qtkit/qtkit.factor
calendar.format: make duration>human-readable more human readable
[factor.git] / extra / qtkit / qtkit.factor
1 USING: alien.c-types classes.struct cocoa cocoa.application
2 cocoa.classes core-foundation core-foundation.strings kernel ;
3 IN: qtkit
4
5 STRUCT: QTTime
6     { timeValue longlong }
7     { timeScale long }
8     { flags     long } ;
9
10 STRUCT: QTTimeRange
11     { time      QTTime }
12     { duration  QTTime } ;
13
14 STRUCT: SMPTETime
15     { mSubframes       SInt16 }
16     { mSubframeDivisor SInt16 }
17     { mCounter         UInt32 }
18     { mType            UInt32 }
19     { mFlags           UInt32 }
20     { mHours           SInt16 }
21     { mMinutes         SInt16 }
22     { mSeconds         SInt16 }
23     { mFrames          SInt16 } ;
24
25 CFSTRING: QTKitErrorDomain "QTKitErrorDomain"
26 CFSTRING: QTErrorCaptureInputKey "QTErrorCaptureInputKey"
27 CFSTRING: QTErrorCaptureOutputKey "QTErrorCaptureOutputKey"
28 CFSTRING: QTErrorDeviceKey "QTErrorDeviceKey"
29 CFSTRING: QTErrorExcludingDeviceKey "QTErrorExcludingDeviceKey"
30 CFSTRING: QTErrorTimeKey "QTErrorTimeKey"
31 CFSTRING: QTErrorFileSizeKey "QTErrorFileSizeKey"
32 CFSTRING: QTErrorRecordingSuccesfullyFinishedKey "QTErrorRecordingSuccesfullyFinishedKey"
33
34 CONSTANT: QTErrorUnknown                                      -1
35 CONSTANT: QTErrorIncompatibleInput                          1002
36 CONSTANT: QTErrorIncompatibleOutput                         1003
37 CONSTANT: QTErrorInvalidInputsOrOutputs                     1100
38 CONSTANT: QTErrorDeviceAlreadyUsedbyAnotherSession          1101
39 CONSTANT: QTErrorNoDataCaptured                             1200
40 CONSTANT: QTErrorSessionConfigurationChanged                1201
41 CONSTANT: QTErrorDiskFull                                   1202
42 CONSTANT: QTErrorDeviceWasDisconnected                      1203
43 CONSTANT: QTErrorMediaChanged                               1204
44 CONSTANT: QTErrorMaximumDurationReached                     1205
45 CONSTANT: QTErrorMaximumFileSizeReached                     1206
46 CONSTANT: QTErrorMediaDiscontinuity                         1207
47 CONSTANT: QTErrorMaximumNumberOfSamplesForFileFormatReached 1208
48 CONSTANT: QTErrorDeviceNotConnected                         1300
49 CONSTANT: QTErrorDeviceInUseByAnotherApplication            1301
50 CONSTANT: QTErrorDeviceExcludedByAnotherDevice              1302
51
52 FRAMEWORK: /System/Library/Frameworks/QTKit.framework
53
54 IMPORT: QTCaptureAudioPreviewOutput
55 IMPORT: QTCaptureConnection
56 IMPORT: QTCaptureDecompressedAudioOutput
57 IMPORT: QTCaptureDecompressedVideoOutput
58 IMPORT: QTCaptureDevice
59 IMPORT: QTCaptureDeviceInput
60 IMPORT: QTCaptureFileOutput
61 IMPORT: QTCaptureInput
62 IMPORT: QTCaptureLayer
63 IMPORT: QTCaptureMovieFileOutput
64 IMPORT: QTCaptureOutput
65 IMPORT: QTCaptureSession
66 IMPORT: QTCaptureVideoPreviewOutput
67 IMPORT: QTCaptureView
68 IMPORT: QTCompressionOptions
69 IMPORT: QTDataReference
70 IMPORT: QTFormatDescription
71 IMPORT: QTMedia
72 IMPORT: QTMovie
73 IMPORT: QTMovieLayer
74 IMPORT: QTMovieView
75 IMPORT: QTSampleBuffer
76 IMPORT: QTTrack
77
78 : <movie> ( filename -- movie )
79     QTMovie swap <NSString> f -> movieWithFile:error: -> retain ;
80
81 ! XXX: comment these out to workaround build machine issue
82 ! : movie-attributes ( movie -- attributes )
83 !     -> movieAttributes plist> ;
84 ! : play ( movie -- )
85 !     -> play ;
86 ! : stop ( movie -- )
87 !     -> stop ;
88 ! : movie-tracks ( movie -- tracks )
89 !     -> tracks NSFastEnumeration>vector ;
90 ! : track-attributes ( track -- attributes )
91 !     -> trackAttributes plist> ;