Recognizes if input is ogg or not.
[xiph.git] / xiph-qt / Theora / src / TheoraEncoder.r
blobbd088a26e22b2af1d0fb19e453570ff012a876fa
1 /*
2 * TheoraEncoder.r
4 * Information bit definitions for the 'thng' and other TheoraEncoder
5 * resources.
8 * Copyright (c) 2006 Arek Korbik
10 * This file is part of XiphQT, the Xiph QuickTime Components.
12 * XiphQT is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
17 * XiphQT is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with XiphQT; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 * Last modified: $Id$
32 #define thng_RezTemplateVersion 1
34 #define cfrg_RezTemplateVersion 1
36 #ifdef TARGET_REZ_MAC_PPC
37 #include <CoreServices/CoreServices.r>
38 #include <QuickTime/QuickTime.r>
39 #include <QuickTime/QuickTimeComponents.r>
40 #else
41 #include "ConditionalMacros.r"
42 #include "CoreServices.r"
43 #include "QuickTimeComponents.r"
44 #include "ImageCodec.r"
45 #endif /* TARGET_REZ_MAC_PPC */
47 #include "TheoraEncoder.h"
50 /* How do I do this properly... anybody? */
51 #if defined(BUILD_UNIVERSAL)
52 #define TARGET_CPU_PPC 1
53 #define TARGET_CPU_X86 1
54 #endif
57 #if TARGET_OS_MAC
58 #if TARGET_CPU_PPC && TARGET_CPU_X86
59 #define TARGET_REZ_FAT_COMPONENTS 1
60 #define Target_PlatformType platformPowerPCNativeEntryPoint
61 #define Target_SecondPlatformType platformIA32NativeEntryPoint
62 #elif TARGET_CPU_X86
63 #define Target_PlatformType platformIA32NativeEntryPoint
64 #else
65 #define Target_PlatformType platformPowerPCNativeEntryPoint
66 #endif
67 #define theoraThreadSafe cmpThreadSafe
68 #elif TARGET_OS_WIN32
69 #define Target_PlatformType platformWin32
70 #define theoraThreadSafe 0
71 #else
72 #error get a real platform type
73 #endif /* TARGET_OS_MAC */
75 #if !defined(TARGET_REZ_FAT_COMPONENTS)
76 #define TARGET_REZ_FAT_COMPONENTS 0
77 #endif
80 #define kTheoraEncoderFlags (codecInfoDoes32 | codecInfoDoesTemporal | codecInfoDoesRateConstrain | theoraThreadSafe)
82 #define kTheoraFormatFlags (codecInfoDepth24)
84 resource 'cdci' (kTheoraEncoderResID) {
85 kTheoraEncoderFormatName, // Type
86 1, // Version
87 kTheora_imco_Version,
88 kXiphComponentsManufacturer, // Manufacturer
89 0, // Decompression Flags
90 kTheoraEncoderFlags, // Compression Flags
91 kTheoraFormatFlags, // Format Flags
92 128, // Compression Accuracy
93 0, //128, // Decomression Accuracy
94 128, // Compression Speed
95 0, //128, // Decompression Speed
96 128, // Compression Level
97 0, // Reserved
98 16, // Minimum Height
99 16, // Minimum Width
100 0, // Decompression Pipeline Latency
101 0, // Compression Pipeline Latency
102 0 // Private Data
105 resource 'thng' (kTheoraEncoderResID) {
106 compressorComponentType, kVideoFormatXiphTheora,
107 kXiphComponentsManufacturer, // Manufacturer(??)
108 0, 0, 0, 0,
109 'STR ', kTheoraEncoderNameStringResID,
110 'STR ', kTheoraEncoderInfoStringResID,
111 0, 0, // no icon
112 kTheora_imco_Version,
113 componentDoAutoVersion | componentHasMultiplePlatforms, 0,
115 // component platform information
116 kTheoraEncoderFlags,
117 'dlle',
118 kTheoraEncoderResID,
119 Target_PlatformType,
120 #if TARGET_REZ_FAT_COMPONENTS
121 kTheoraEncoderFlags,
122 'dlle',
123 kTheoraEncoderResID,
124 Target_SecondPlatformType,
125 #endif
129 // Component Name
130 resource 'STR ' (kTheoraEncoderNameStringResID) {
131 "Xiph Theora Encoder"
134 // Component Information
135 resource 'STR ' (kTheoraEncoderInfoStringResID) {
136 "Compresses into the Xiph Theora format."
139 resource 'dlle' (kTheoraEncoderResID) {
140 "Theora_ImageEncoderComponentDispatch"
144 /* ========= Settings dialog resources ========= */
146 resource 'DITL' (kTheoraEncoderDITLResID, "Compressor Options", purgeable) {
148 //{0, 0, TEXT_HEIGHT, 100}, CheckBox { enabled, "Checkbox" },
149 //{TEXT_HEIGHT + INTER_CONTROL_SPACING, 0, TEXT_HEIGHT + INTER_CONTROL_SPACING + POPUP_CONTROL_HEIGHT, 165}, Control { enabled, kTheoraEncoderPopupCNTLResID },
150 //{0, 0, TEXT_HEIGHT, 100}, Control { enabled, kTheoraEncoderPopupCNTLResID },
151 //{TEXT_HEIGHT + INTER_CONTROL_SPACING, 0, TEXT_HEIGHT + INTER_CONTROL_SPACING + POPUP_CONTROL_HEIGHT, 165}, CheckBox { enabled, "Checkbox" },
152 {0, 0, POPUP_CONTROL_HEIGHT, 205}, Control { enabled, kTheoraEncoderPopupCNTLResID },
153 {POPUP_CONTROL_HEIGHT + INTER_CONTROL_SPACING, 100, TEXT_HEIGHT + INTER_CONTROL_SPACING + POPUP_CONTROL_HEIGHT, 200}, CheckBox { enabled, "Optimize" },
157 resource 'CNTL' (kTheoraEncoderPopupCNTLResID, "Compressor Popup") {
158 {0, 0, 20, 205},
159 popupTitleRightJust,
160 //1,
161 visible,
162 100, /* title width */
163 kTheoraEncoderPopupMENUResID,
164 //popupMenuCDEFProc + popupFixedWidth,
165 popupMenuCDEFProc + popupFixedWidth,
167 "Sharpness:"
170 resource 'MENU' (kTheoraEncoderPopupMENUResID, "Compressor Popup") {
171 kTheoraEncoderPopupMENUResID,
172 textMenuProc,
173 allEnabled, /* Enable flags */
174 enabled,
175 "Sharpness",
176 { /* array: 8 elements */
177 /* [1] */
178 "Low", noIcon, noKey, noMark, plain,
179 /* [2] */
180 "Medium", noIcon, noKey, noMark, plain,
181 /* [3] */
182 "High", noIcon, noKey, noMark, plain,