This is the global definitions file. It includes some compiling options, some convenience macros and some common enumerations / names for things. I include this file in EVERY HEADER FILE. This has the downside of having to recompile everything when something is changed here, but it's for sure that the options are available everywhere.
*/
#ifndef _GLOBALDEFS_
#define _GLOBALDEFS_
typedef enum WhiteBalanceMode {
WhiteBalanceLinear = 1,
WhiteBalanceIndoor = 2,
WhiteBalanceOutdoor = 3,
WhiteBalanceAutomatic = 4
} WhiteBalanceMode;
typedef enum CameraResolution {
ResolutionInvalid = 0, //Indicates a wrong or not applicable resolution
ResolutionSQSIF = 1, //sqsif = 128 x 96
ResolutionQSIF = 2, //qsif = 160 x 120
ResolutionQCIF = 3, //qcif = 176 x 144
ResolutionSIF = 4, //sif = 320 x 240
ResolutionCIF = 5, //cif = 352 x 288
ResolutionVGA = 6, //vga = 640 x 480
ResolutionSVGA = 7 //svga = 800 x 600
} CameraResolution;
typedef enum CameraError {
CameraErrorOK = 0, //Everything's fine
CameraErrorBusy = 1, //Access to device denied - probably already in use somewhere else
CameraErrorNoPower = 2, //Not enough usb power to use device (there's also an independent system alert)
//Global build settings. Comment unwanted stuff out
#define VERBOSE 1
//#define REALLY_VERBOSE 1
/*
malloc/free tracking: Since I sometimes have to do "remote debugging" (send the code to someone else and ask what happens), I cannot use elaborate tools there. So I use macros for malloc and free so we can switch on memory logging to the console. The testers then can send the console log back. To switch on or off, uncomment or comment the next #define statement.
*/
//#define LOG_MEM_CALLS 1
/*
QuickTime call tracking. It's sometimes interesting to see what kinds of calls the clients of the QuickTime Component actually do and in which order. So this opens the opportunity to log all calls to the console. To switch on or off, uncomment or comment the next #define statement.
*/
//#define LOG_QT_CALLS 1
/*
USB control tracking. Another sometimes interesting thing is to track the sequence of USB commands passed to the device. To switch on or off, uncomment or comment the next #define statement. Please note that this is still being incorporated into the code so not all USB commands may be logged yet.