Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
MakeQTVRObject.h
#include <QuickTimeComponents.h> |
#include <Movies.h> |
#include <PLStringFuncs.h> |
#include "QTVRObjectAuthoring.h" |
enum { |
iOpen = 1, |
iClose, |
iDrop = 4, |
iSetPrefs = 6, |
iQuit = 8 |
}; |
enum { |
iUndo = 1, |
iCut = 3, |
iCopy, |
iPaste, |
iClear, |
iMakeObject = 8, |
iDeleteObject, |
iSetPoster, |
iShowPoster |
}; |
enum { |
iAbout = 1 |
}; |
enum { |
appleID = 128, |
fileID, |
editID |
}; |
enum { |
kGenericMessageDLOG = 128, |
kAboutDLOG, |
kObjectDLOG, |
kGenericQuestionDLOG, |
kSplashDLOG |
}; |
enum { |
iOK = 1, |
iCancel, |
iVersionNumber, |
iNumberOfRows, |
iNumberOfColumns, |
iLoopSize, |
iLoopTicks, |
iStartHPan, |
iEndHPan, |
iStartVPan, |
iEndVPan, |
iFieldOfView, |
iScene, |
iObject, |
iObjectInScene, |
iUseObject, |
iDummyLastEnum |
}; |
enum { |
kNotAQTVRMovie = -8765 |
}; |
enum { |
kQTVRPano = 'pano', |
kQTVRNavigable = 'navg', |
kNotAQTVRType = 0 // Must be zero |
}; |
#define kDefaultCancel 3 |
#define kDefaultOK 2 |
#define kMessageID 1 |
#define kPrefsFileName "\pMake QTVR Object Prefs" |
#define kAppCreator 'obod' |
#define Fix2Float(x) ((float)x)/65536.0 |
#define Float2Fix(x) (Fixed)(x*65536.0) |
typedef struct |
{ |
Movie movie; /* The movie to play */ |
CWindowPtr window; /* Window the movie is played in */ |
MovieController movieController; /* The controls for the movie */ |
FSSpec spec; /* The file spec fo rthe movie */ |
short movieResFile; |
short movieResID; |
Boolean isObjectMovie; |
} MovieInstance; |
#pragma options align=mac68k |
typedef struct |
{ |
short dropMode; |
QTVRObjectFileFormat1x0Record objectInfo; |
} PrefInfo; |
#pragma options align=reset |
// Apple Events |
void AEInit(); |
Boolean SupportsAEVT(void); |
void RegisterMyEvents(void); |
pascal OSErr DoOpenApp(AppleEvent *theAppleEvent,AppleEvent *reply,long RefCon); |
pascal OSErr DoQuitApp(AppleEvent *theAppleEvent,AppleEvent *reply,long RefCon); |
pascal OSErr DoOpenDoc(AppleEvent *theAppleEvent,AppleEvent *reply,long RefCon); |
pascal OSErr DoPrintDoc(AppleEvent *theAppleEvent,AppleEvent *reply,long RefCon); |
// Event Loop |
void MainLoop(); |
void DoUpdate(EventRecord *theEvent); |
void DoMouseDown(EventRecord *theEvent); |
void KeyDown(char theChar,char theChar2); |
void DoNull(); |
// Menus |
void DoMenuChoice(long menuResult); |
void EnDisItem (MenuHandle mh, short item, Boolean enable); |
void SetupMenus(); |
void About(); |
void MenuBarInit(); |
void ToolBoxInit(); |
void Cleanup(); |
float StringToFloat(StringPtr theString); |
void FloatToString(float num,Str255 *theString,short digits); |
void UserMessage(Str255 theMessage); |
Boolean UserQuestion(Str255 theMessage); |
Boolean GetAMovie(FSSpec *theSpec); |
OSErr OpenMovie(FSSpec *theFSSpec); |
void CloseMovie(); |
OSErr ReopenMovie(MovieInstance *theInstance); |
void MyMoviesTask(WindowPtr theWindow); |
MovieInstance *GetMovieInstanceFromWindow(WindowPtr theWindow); |
OSErr AttachMovieToWindow(WindowPtr theWindow,MovieInstance *theMovie); |
Boolean CheckMovieControllers(EventRecord *theEvent); |
Boolean ValidMovieType(MovieInstance *theInstance); |
Boolean MakeItLinear(); |
OSErr OpenPrefs(); |
OSErr SavePrefs(); |
OSErr RetrievePrefs(); |
void Splash(); |
OSErr HandleMovieFormatDialog (MovieInstance *theInstance,Boolean applyValues); |
OSErr DeleteNavMovieData (MovieInstance *theInstance); |
OSErr DoSetStartUpView (MovieInstance *theInstance); |
void InitDialogBox(DialogPtr askBox,QTVRObjectFileFormat1x0Record *fileFormat); |
pascal Boolean ModalFilter(DialogPtr theDlg,EventRecord *theEvent,short *itmeHit); |
pascal void OutlineOK(WindowPtr theDlg,short theItem ); |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14