ExampleVideoPanelPrivate.h

/*
    File:       ExampleVideoPanelPrivate.h
 
    Contains:   Private header file for example video panel component routines.
 
    Written by: Gary Woodcock
 
    Copyright:  © 1992 by Apple Computer, Inc., all rights reserved.
 
    Change History (most recent first):
 
*/
 
//-----------------------------------------------------------------------
// Includes
 
#ifndef _EXAMPLEVIDEOPANELPRIVATE_
#define _EXAMPLEVIDEOPANELPRIVATE_
 
#include <QuickTimeComponents.h>
#include "DebugFlags.h"
 
//-----------------------------------------------------------------------
// Private constants
 
// Base resource ID
enum
{
    kBaseResID = 500
};
 
// Maximum number of instances that can be opened
enum
{
    kMaxExampleVideoPanelInstances = 1
};
 
// Component and interface revision levels
enum
{
    exampleVideoPanelInterfaceRevision = 0x00010001 
};
 
enum
{
    kGenericError = -1L // Handy return code
};
 
// DITL ID
enum
{
    kExampleVideoPanelDITLID = kBaseResID
};
 
// DITL items
enum
{
    kZeroBlackButton = 1,
    kResetButton,
    kSeparator,
    kTextBlurb
};
 
enum
{
    kDKey = 0x02,
    kRKey = 0x0F
};
 
//-----------------------------------------------------------------------
// Private types
 
typedef struct  PanelGlobals
{
    Component           self;
    SeqGrabComponent    seqGrabber;
    SGChannel           videoChannel;
    short               resRefNum;
    Pattern             grayPat;
    unsigned short      savedBlackLevel;
}
PanelGlobals, *PanelGlobalsPtr, **PanelGlobalsHdl;
 
//-----------------------------------------------------------------------
// Private prototypes
 
#ifdef DEBUG_IT
 
// Only need this prototype if we're running linked (for debugging)
pascal ComponentResult
ExampleVideoPanelDispatcher (ComponentParameters *params, Handle storage);
                                         
#endif DEBUG_IT
                                             
pascal ComponentResult
_ExampleVideoPanelOpen (Handle storage, ComponentInstance self);
    
pascal ComponentResult
_ExampleVideoPanelClose (Handle storage, ComponentInstance self);
 
pascal ComponentResult
_ExampleVideoPanelCanDo (short selector);
 
pascal ComponentResult
_ExampleVideoPanelVersion (void);
 
pascal ComponentResult
_ExampleVideoPanelGetDitl (Handle storage, Handle *ditl);
                                                         
pascal ComponentResult
_ExampleVideoPanelGetTitle (Handle storage, Str255 title);
                                                         
pascal ComponentResult
_ExampleVideoPanelCanRun (Handle storage, SGChannel c);
                                                         
pascal ComponentResult
_ExampleVideoPanelInstall (Handle storage, SGChannel c, DialogPtr d, short itemOffset);
                                                         
pascal ComponentResult
_ExampleVideoPanelEvent (Handle storage, SGChannel c, DialogPtr d, short itemOffset,
    EventRecord *theEvent, short *itemHit, Boolean *handled);
                                                         
pascal ComponentResult
_ExampleVideoPanelItem (Handle storage, SGChannel c, DialogPtr d, short itemOffset, short itemNum);
                                                         
pascal ComponentResult
_ExampleVideoPanelRemove (Handle storage, SGChannel c, DialogPtr d, short itemOffset);
                                                         
pascal ComponentResult
_ExampleVideoPanelSetGrabber (Handle storage, SeqGrabComponent sg);
                                                         
pascal ComponentResult
_ExampleVideoPanelSetResFile (Handle storage, short resRef);
                                                         
pascal ComponentResult
_ExampleVideoPanelGetSettings (Handle storage, SGChannel c, UserData *ud, long flags);
                                                        
pascal ComponentResult
_ExampleVideoPanelSetSettings (Handle storage, SGChannel c, UserData ud, long flags);
                                                         
pascal ComponentResult
_ExampleVideoPanelValidateInput (Handle storage, Boolean *ok);
                                                         
static OSErr
FakeButtonHit (ControlHandle theButton);
 
static OSErr
FakeDialogButtonHit (DialogPtr theDialog, short theButtonItem);
 
static void
SetUserItem (DialogPtr theDialog, short theItem, Handle userProc);
 
static Handle
GetItemHandle (DialogPtr theDialog, short theItem);
 
static void
GetItemBox (DialogPtr theDialog, short theItem, Rect *theRect);
 
//-----------------------------------------------------------------------
 
#endif  _EXAMPLEVIDEOPANELPRIVATE_
 
//-----------------------------------------------------------------------