1/*
2 * SeqGrabber.h --
3 *
4 * Copyright (c) 2000-2005  Mats Bengtsson
5 *
6 * $Id: SeqGrabber.h,v 1.8 2005/04/16 13:23:26 matben Exp $
7 */
8
9#ifndef INCLUDED_SEQGRABBER_H
10#define INCLUDED_SEQGRABBER_H
11
12#ifdef _WIN32
13#   include "QuickTimeTclWin.h"
14#endif
15
16#include "QuickTimeTcl.h"
17
18
19/*
20 * A data structure of the following type is kept for each
21 * sequence grabber that currently exists for this process:
22 */
23
24typedef struct SeqGrabber {
25	Tk_Window 		tkwin; 				/* Window for Sequence Grabber. */
26	Display 		*display;		 	/* Display containing widget. */
27	Tcl_Interp 		*interp;			/* Interpreter for widget. */
28	Tcl_Command 	widgetCmd;			/* Sequence grabber instance command. */
29	Tk_OptionTable 	optionTable;
30
31	/*
32	 * Sequence Grabber specific attributes.
33	 */
34
35	SeqGrabComponent	seqGrab;		/* Sequence grabber component. */
36	SGChannel		sgChanVideo;		/* Video and audio sequence grabber channels. */
37	SGChannel		sgChanAudio;
38	char 			*filename;			/* File name to save movie to. */
39	Boolean		    willRecord;			/* Recording things we grab? */
40	int 			sgWidth;			/* Sequence Grabber width and height without padding. */
41	int 			sgHeight;
42	short 			srcWidth;			/* The video source width and height which */
43	short 			srcHeight;			/* is identical to the max size. */
44	int 			videoWidth;			/* The video width and height describes the zoomed */
45	int 			videoHeight;		/* in rectangle of the source rectangle above. */
46	int 			width;				/* Width of widget; only if option set. */
47	int 			height;				/* Height of widget; only if option set. */
48	double			zoom;				/* Zoom factor, >= 1.0 */
49	int				indSize;			/* Index to either "full", "half", or "quarter". */
50	int				indQuality;			/* Playback quality. */
51	int             audio;          	/* Boolean; shall we have audio. */
52	int             audioOnly;          /* Boolean; wants audio only. */
53	int             playDuringRecord;   /* Boolean; preview while recording. */
54	int             frameCount;
55	int             showFPS;
56	UInt32          startTick;
57	UInt32          latestTick;
58	int 			padx;				/* X padding */
59	int		 		pady;				/* Y padding */
60	XColor 			*background;		/* background color */
61	int				videoBottle;		/* Do we use a videobottleneck? */
62	CGrafPtr		videoBottlePortPtr; /* Temporary port for overlaying graphics in video. */
63	char			*overlayimage;		/* Name of tk image photo to overlay the video. */
64	PicHandle		overlayPictHand;	/* The overlay tk image as a Picture. */
65	PicHandle       updatePictHand;     /* When stopped or paused, have this Pict for update events. */
66    Tcl_Obj			*imageAsyncProcObj; /* These are all used for taking images async. */
67    Tcl_Obj			*imageNameObj;
68    void 			*asyncImageHandlerPtr;
69	int 			flags;				/* Various status flags; fields defined below. */
70    char			*videoCompressor;   /* Video compressor quality. */
71    double          volume;             /* Channel volume: -1.0 - +1.0. */
72    double			frameRate;
73#ifdef _WIN32
74	LONG	    	winEventProc;       /* Original event procedure (Windows). */
75#endif
76} SeqGrabber;
77
78
79/*
80 * Flag bits for grabber used in 'flags' in SeqGrabber struct:
81 *
82 * REDRAW_PENDING:		Non-zero means a DoWhenIdle handler
83 *						has already been queued to redraw
84 *						this window.
85 * NEWGWORLD:			Non-zero means this widget has a new GWorld, and that we need
86 *						to associate the sequence grabber with this GWorld. Need to
87 *						know when displaying.
88 * UPDATEGRABBER:		This flag bit is set when received an Expose (update) event in the
89 *						tcl event procedure.
90 * ISRUNNING:			Set if the grabber is not paused or stopped.
91 */
92
93#define REDRAW_PENDING 			(1L << 0)
94#define NEWGWORLD 				(1L << 1)
95#define UPDATEGRABBER 			(1L << 2)
96#define ISRUNNING	 			(1L << 3)
97
98
99#endif	// INCLUDED_SEQGRABBER_H
100