-
Notifications
You must be signed in to change notification settings - Fork 3
/
listing10.html
executable file
·429 lines (368 loc) · 15.1 KB
/
listing10.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<!-- BEGIN META TAG INFO -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="home" href="http://developer.apple.com/">
<link rel="find" href="http://developer.apple.com/search/">
<link rel="stylesheet" type="text/css" href="../../documentation/css/adcstyle.css" title="fonts">
<script language="JavaScript" src="../../documentation/js/adc.js" type="text/javascript"></script>
<!-- END META TAG INFO -->
<!-- BEGIN TITLE -->
<title>vrmovies - /Common Files/QTUtilities.h</title>
<!-- END TITLE -->
<script language="JavaScript">
function JumpToNewPage() {
window.location=document.scpopupmenu.gotop.value;
return true;
}
</script>
</head>
<!-- BEGIN BODY OPEN -->
<body>
<!--END BODY OPEN -->
<!-- START CENTER OPEN -->
<center>
<!-- END CENTER OPEN -->
<!-- BEGIN LOGO AND SEARCH -->
<!--#include virtual="/includes/adcnavbar"-->
<!-- END LOGO AND SEARCH -->
<!-- START BREADCRUMB -->
<div id="breadcrumb">
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr>
<td scope="row"><img width="340" height="10" src="images/1dot.gif" alt=""></td>
<td><img width="340" height="10" src="images/1dot.gif" alt=""></td>
</tr>
<tr valign="middle">
<td align="left" colspan="2">
<a href="http://developer.apple.com/">ADC Home</a> > <a href="../../referencelibrary/index.html">Reference Library</a> > <a href="../../samplecode/index.html">Sample Code</a> > <a href="../../samplecode/QuickTime/index.html">QuickTime</a> > <a href="../../samplecode/QuickTime/idxVirtualReality-date.html">Virtual Reality</a> > <A HREF="javascript:location.replace('index.html');">vrmovies</A> >
</td>
</tr>
<tr>
<td colspan="2" scope="row"><img width="680" height="35" src="images/1dot.gif" alt=""></td>
</tr>
</table>
</div>
<!-- END BREADCRUMB -->
<!-- START MAIN CONTENT -->
<!-- START TITLE GRAPHIC AND INTRO-->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td><h1><div id="pagehead">vrmovies</div></h1></td>
</tr>
</table>
<!-- END TITLE GRAPHIC AND INTRO -->
<!-- START WIDE COLUMN -->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td id="scdetails">
<h2>/Common Files/QTUtilities.h</h2>
<form name="scpopupmenu" onSubmit="return false;" method=post>
<p><strong>View Source Code:</strong>
<select name="gotop" onChange="JumpToNewPage();" style="width:340px"><option selected value="ingnore">Select File</option>
<option value="listing1.html">/Application Files/ComApplication.c</option>
<option value="listing2.html">/Application Files/ComApplication.h</option>
<option value="listing3.html">/Application Files/ComResource.h</option>
<option value="listing4.html">/Common Files/ComFramework.c</option>
<option value="listing5.html">/Common Files/ComFramework.h</option>
<option value="listing6.html">/Common Files/MacFramework.c</option>
<option value="listing7.html">/Common Files/MacFramework.h</option>
<option value="listing8.html">/Common Files/MacPrefix.h</option>
<option value="listing9.html">/Common Files/QTUtilities.c</option>
<option value="listing10.html">/Common Files/QTUtilities.h</option>
<option value="listing11.html">/Common Files/QTVRUtilities.c</option>
<option value="listing12.html">/Common Files/QTVRUtilities.h</option>
<option value="listing13.html">/Common Files/WinFramework.c</option>
<option value="listing14.html">/Common Files/WinFramework.h</option>
<option value="listing15.html">/Common Files/WinPrefix.h</option>
<option value="listing16.html">/README.txt</option>
<option value="listing17.html">/VRMovies.c</option>
<option value="listing18.html">/VRMovies.h</option></select>
</p>
</form>
<p><strong><a href="vrmovies.zip">Download Sample</a></strong> (“vrmovies.zip”, 1.00M)<BR>
<strong><a href="vrmovies.dmg">Download Sample</a></strong> (“vrmovies.dmg”, 1.46M)</p>
<!--
<p><strong><a href="#">Download Sample</a></strong> (“filename.sit”, 500K)</p>
-->
</td>
</tr>
<tr>
<td scope="row"><img width="680" height="10" src="images/1dot.gif" alt=""><br>
<img height="1" width="680" src="images/1dot_919699.gif" alt=""><br>
<img width="680" height="20" src="images/1dot.gif" alt=""></td>
</tr>
<tr>
<td scope="row">
<!--googleon: index -->
<pre class="sourcecodebox">////////////// File: QTUtilities.h//// Contains: Some utilities for working with QuickTime movies.// All utilities start with the prefix "QTUtils_".//// Written by: Tim Monroe// Based on the DTSQTUtilities package by Apple DTS.// This is essentially a subset of that package, revised for cross-platform use.//// Copyright: © 1996-1999 by Apple Computer, Inc., all rights reserved.//// Change History (most recent first)://// <3> 10/21/02 era building Mach-O// <2> 02/03/99 rtm moved non-QTVR-specific utilities from QTVRUtilities to here// <1> 09/10/97 rtm first file// //////////#pragma once////////////// header files////////////#ifndef __QTUtilities__#define __QTUtilities__#ifdef __MACH__ #include <Carbon/Carbon.h> #include <QuickTime/QuickTime.h>#else #ifndef __MOVIES__ #include <Movies.h> #endif #ifndef __MOVIESFORMAT__ #include <MoviesFormat.h> #endif #ifndef __MEDIAHANDLERS__ #include <MediaHandlers.h> #endif #ifndef __NUMBERFORMATTING__ #include <NumberFormatting.h> #endif #ifndef __QUICKTIMECOMPONENTS__ #include <QuickTimeComponents.h> #endif #ifndef __QUICKTIMEVR__ #include <QuickTimeVR.h> #endif #ifndef __QTSMOVIE__ #include <QTSMovie.h> #endif #ifndef __ENDIAN__ #include <Endian.h> #endif #ifndef __GESTALT__ #include <Gestalt.h> #endif #ifndef __FIXMATH__ #include <FixMath.h> #endif #ifndef __MACWINDOWS__ #include <MacWindows.h> #endif #ifndef __PRINTING__ #include <Printing.h> #endif #ifndef __SCRIPT__ #include <Script.h> #endif #ifndef __SOUND__ #include <Sound.h> #endif #ifndef _STRING_H #include <string.h> #endif #ifndef _STDLIB_H #include <stdlib.h> #endif #ifndef __TEXTUTILS__ #include <TextUtils.h> #endif #ifndef __TRAPS__ #include <Traps.h> #endif#endif////////////// compiler macros////////////#ifndef min#define min(a, b) ((a)<(b)?(a):(b))#endif////////////// compiler flags////////////#define CONTENT_RATING_AVAIL 0 // is movie content-rating capability implemented?////////////// constants////////////// constants used for QTUtils_SaveMovie#define kSavePrompt "Save Movie as:"#define kSaveMovieFileName "untitled.mov"#define kSaveResName "Movie Resource"// constants used for QTUtils_PrintMoviePICTenum eQTUPICTPrinting { kPrintFrame = 1, kPrintPoster = 2};// constants used for QTUtils_GetMovieFileLoopingInfoenum { kNormalLooping = 0, kPalindromeLooping = 1, kNoLooping = 2};#define kQTVideoEffectsMinVers 0x0300 // version of QT that first supports QT video effects#define kQTFullScreenMinVers 0x0209 // version of QT that first supports full-screen calls#define kQTWiredSpritesMinVers 0x0300 // version of QT that first supports wired sprites// constants for GetQuickTimePreference/SetQuickTimePreference settings#define kConnectionSpeedPrefsType FOUR_CHAR_CODE('cspd')#define kContentRatingPrefsType FOUR_CHAR_CODE('crat')enum { kQTUtilsSpeakerButton = mcFlagSuppressSpeakerButton, kQTUtilsStepButtons = mcFlagSuppressStepButtons, kQTUtilsBackButton = mcFlagQTVRSuppressBackBtn, kQTUtilsZoomButtons = mcFlagQTVRSuppressZoomBtns, kQTUtilsHotSpotButton = mcFlagQTVRSuppressHotSpotBtn, kQTUtilsTranslateButton = mcFlagQTVRSuppressTranslateBtn, kQTUtilsHelpText = mcFlagQTVRSuppressHelpText, kQTUtilsHotSpotNames = mcFlagQTVRSuppressHotSpotNames, kQTUtilsCustomButton = mcFlagsUseCustomButton, // these are to support existing code that uses our older names kQTVRSpeakerButton = mcFlagSuppressSpeakerButton, kQTVRBackButton = mcFlagQTVRSuppressBackBtn, kQTVRZoomButtons = mcFlagQTVRSuppressZoomBtns, kQTVRHotSpotButton = mcFlagQTVRSuppressHotSpotBtn, kQTVRTranslateButton = mcFlagQTVRSuppressTranslateBtn, kQTVRHelpText = mcFlagQTVRSuppressHelpText, kQTVRHotSpotNames = mcFlagQTVRSuppressHotSpotNames, kQTVRCustomButton = mcFlagsUseCustomButton};// default window position#ifndef kDefaultWindowX#define kDefaultWindowX 50#endif#ifndef kDefaultWindowY#define kDefaultWindowY 50#endif////////////// data types////////////#if CONTENT_RATING_AVAIL// structure of content rating data for GetQuickTimePreferencestruct ContentRatingPrefsRecord { UInt16 fContentRating; UInt16 fContentTypes;};typedef struct ContentRatingPrefsRecord ContentRatingPrefsRecord;#endif////////////// function prototypes////////////Boolean QTUtils_TrapAvailable (short theTrapWord);Boolean QTUtils_IsQuickTimeInstalled (void); Boolean QTUtils_IsQuickTimeCFMInstalled (void);long QTUtils_GetQTVersion (void);Boolean QTUtils_HasQuickTimeVideoEffects (void);Boolean QTUtils_HasFullScreenSupport (void);Boolean QTUtils_HasWiredSprites (void);Boolean QTUtils_IsQTVRMovie (Movie theMovie);Boolean QTUtils_IsStreamedMovie (Movie theMovie);Boolean QTUtils_IsAutoPlayMovie (Movie theMovie);Boolean QTUtils_IsControllerBarVisible (MovieController theMC); short QTUtils_GetControllerBarHeight (MovieController theMC);void QTUtils_HideControllerBar (MovieController theMC);void QTUtils_ShowControllerBar (MovieController theMC);void QTUtils_ToggleControllerBar (MovieController theMC);void QTUtils_PutControllerBarOnTop (MovieController theMC);void QTUtils_HideControllerButton (MovieController theMC, long theButton); void QTUtils_ShowControllerButton (MovieController theMC, long theButton); void QTUtils_ToggleControllerButton (MovieController theMC, long theButton);void QTUtils_ResetControllerButton (MovieController theMC, long theButton);void QTUtils_ShowCustomButton (MovieController theMC);Boolean QTUtils_IsControllerButtonVisible (MovieController theMC, long theButton);Boolean QTUtils_IsMediaTypeInMovie (Movie theMovie, OSType theMediaType);Boolean QTUtils_MovieHasTimeCodeTrack (Movie theMovie);Boolean QTUtils_MovieHasSoundTrack (Movie theMovie);MediaHandler QTUtils_GetSoundMediaHandler (Movie theMovie);OSErr QTUtils_UpdateMovieVolumeSetting (Movie theMovie);OSErr QTUtils_SelectAllMovie (MovieController theMC);OSErr QTUtils_SelectNoneMovie (MovieController theMC);ImageDescriptionHandle QTUtils_MakeSampleDescription (long theEffectType, short theWidth, short theHeight);OSErr QTUtils_GetContentRatingFromMovie (Movie theMovie, UInt16 *theRating, UInt32 *theReasons);OSErr QTUtils_AddContentRatingToMovie (Movie theMovie, UInt16 theRating, UInt32 theReasons);OSErr QTUtils_AddUserDataTextToMovie (Movie theMovie, char *theText, OSType theType);OSErr QTUtils_AddCopyrightToMovie (Movie theMovie, char *theText);OSErr QTUtils_AddMovieNameToMovie (Movie theMovie, char *theText);OSErr QTUtils_AddMovieInfoToMovie (Movie theMovie, char *theText);OSErr QTUtils_GetMovieFileLoopingInfo (Movie theMovie, long *theLoopInfo);OSErr QTUtils_SetMovieFileLoopingInfo (Movie theMovie, long theLoopInfo);OSErr QTUtils_SetLoopingStateFromFile (Movie theMovie, MovieController theMC);OSErr QTUtils_MakeMovieLoop (Movie theMovie, Boolean isPalindrome);OSErr QTUtils_GetWindowPositionFromFile (Movie theMovie, Point *thePoint);char * QTUtils_GetTrackName (Track theTrack);OSErr QTUtils_SetTrackName (Track theTrack, char *theText);char * QTUtils_MakeTrackNameByType (Track theTrack);Boolean QTUtils_IsImageFile (FSSpec *theFSSpec);Boolean QTUtils_IsMovieFile (FSSpec *theFSSpec);void QTUtils_ConvertFloatToBigEndian (float *theFloat);StringPtr QTUtils_ConvertCToPascalString (char *theString);char * QTUtils_ConvertPascalToCString (StringPtr theString);OSErr QTUtils_DeleteAllReferencesToTrack (Track theTrack);TimeValue QTUtils_GetFrameDuration (Track theTrack);long QTUtils_GetFrameCount (Track theTrack);void QTUtils_GetMaxWindowDepth (CWindowPtr theWindow, short *thePixelType, short *thePixelSize);void QTUtils_GetMaxScreenDepth (Rect *theGlobalRect, short *thePixelType, short *thePixelSize);long QTUtils_GetUsersConnectionSpeed (void);OSErr QTUtils_SetUsersConnectionSpeed (long theSpeed);OSErr QTUtils_GetUsersContentRating (UInt32 *theType, UInt16 *theRating);OSType QTUtils_GetControllerType (Movie theMovie);OSErr QTUtils_SetControllerType (Movie theMovie, OSType theType);MovieController QTUtils_ChangeControllerType (MovieController theMC, OSType theType, long theFlags);#endif // __QTUtilities__</pre>
<!--googleoff: index -->
</td>
</tr>
</table>
<!-- END WIDE COLUMN -->
<!-- END MAIN CONTENT -->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div style="width: 100%; height: 1px; background-color: #919699; margin-top: 5px; margin-bottom: 15px"></div></td>
</tr>
<tr>
<td align="center"><br/>
<table border="0" cellpadding="0" cellspacing="0" class="graybox">
<tr>
<th>Did this document help you?</th>
</tr>
<tr>
<td>
<div style="margin-bottom: 8px"><a href="http://developer.apple.com/feedback/?v=1&url=/samplecode/vrmovies/listing10.html%3Fid%3DDTS10001030-1.0&media=dvd" target=_new>Yes</a>: Tell us what works for you.</div>
<div style="margin-bottom: 8px"><a href="http://developer.apple.com/feedback/?v=2&url=/samplecode/vrmovies/listing10.html%3Fid%3DDTS10001030-1.0&media=dvd" target=_new>It’s good, but:</a> Report typos, inaccuracies, and so forth.</div>
<div><a href="http://developer.apple.com/feedback/?v=3&url=/samplecode/vrmovies/listing10.html%3Fid%3DDTS10001030-1.0&media=dvd" target=_new>It wasn’t helpful</a>: Tell us what would have helped.</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- START BOTTOM APPLE NAVIGATION -->
<!--#include virtual="/includes/footer"-->
<!-- END BOTTOM APPLE NAVIGATION -->
<!-- START CENTER CLOSE -->
</center>
<!-- END CENTER CLOSE -->
</body>
</html>