Difference between revisions of "Linuxlib"
From Felixl.com
Jump to navigationJump to search (→API functions) |
(→API functions) |
||
Line 8: | Line 8: | ||
unsigned int videobuf_callback(unsigned char * buf); | unsigned int videobuf_callback(unsigned char * buf); | ||
− | this is callback, that freedo will call every video frame update (60 times a second). the parameter is 640x480, 32 bit, little endian, ARGB frame. | + | this is callback, that freedo will call every video frame update (60 times a second). the parameter is 640x480, 32 bit, little endian, ARGB frame. Returns 1 if everything went ok, returns 0 if there's no buffer or other problems. |
+ | |||
+ | unsigned int keypad_callback(); | ||
+ | |||
+ | this is callback, that freedo will cal every even frame (30 times a second) to get the info about pressed keys on the keypad. up to 6 keypads are supported. the return value is a bitmask: | ||
+ | |||
+ | #define KEYPAD_UP 0x00000001 | ||
+ | #define KEYPAD_DOWN 0x00000002 | ||
+ | #define KEYPAD_LEFT 0x00000004 | ||
+ | #define KEYPAD_RIGHT 0x00000008 | ||
+ | #define KEYPAD_LS 0x00000010 | ||
+ | #define KEYPAD_RS 0x00000020 | ||
+ | #define KEYPAD_A 0x00000040 | ||
+ | #define KEYPAD_B 0x00000080 | ||
+ | #define KEYPAD_C 0x00000100 | ||
+ | #define KEYPAD_X 0x00000200 | ||
+ | #define KEYPAD_P 0x00000400 | ||
== API Structures == | == API Structures == |
Revision as of 19:14, 5 February 2007
API functions
unsigned int audiodac_callback(unsigned short left, unsigned short right);
this is callback, that freedo will call 44100 times a second to put next sample into DAC buffer. this should be blocking function -- it should wait if buffer is full. Returns 1 if everything went ok, returns 0 if there's no buffer or other problems.
unsigned int videobuf_callback(unsigned char * buf);
this is callback, that freedo will call every video frame update (60 times a second). the parameter is 640x480, 32 bit, little endian, ARGB frame. Returns 1 if everything went ok, returns 0 if there's no buffer or other problems.
unsigned int keypad_callback();
this is callback, that freedo will cal every even frame (30 times a second) to get the info about pressed keys on the keypad. up to 6 keypads are supported. the return value is a bitmask:
#define KEYPAD_UP 0x00000001 #define KEYPAD_DOWN 0x00000002 #define KEYPAD_LEFT 0x00000004 #define KEYPAD_RIGHT 0x00000008 #define KEYPAD_LS 0x00000010 #define KEYPAD_RS 0x00000020 #define KEYPAD_A 0x00000040 #define KEYPAD_B 0x00000080 #define KEYPAD_C 0x00000100 #define KEYPAD_X 0x00000200 #define KEYPAD_P 0x00000400
API Structures
typedef struct{ void * audiodac_callback; void * videobuf_callback; void * keypad_callback[5]; }freedo_struct;
where all are pointers to call back functions. see function API for details