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