BeRTOS
leveledit.h
Go to the documentation of this file.
00001 
00037 #ifndef GUI_LEVELEDIT_H
00038 #define GUI_LEVELEDIT_H
00039 
00040 //#include <gui/levelbar.h>
00041 
00042 /* Type for level_init */
00043 #define LEVELEDIT_NOBAR  0  
00044 #define LEVELEDIT_SINGLE 1  
00045 #define LEVELEDIT_DOUBLE 2  
00049 /* Fwd decl */
00050 struct Bitmap;
00051 struct LevelEdit;
00052 
00054 typedef void level_set_callback(void);
00055 
00057 typedef void display_callback(struct LevelEdit *);
00058 
00062 typedef struct LevelEdit {
00063     int type;           /*<! Type of level edititing mode (see prev defines) */
00064     const char *title;  /*<! Title on top of screen */
00065     const char *unit;   /*<! Unit of quantity changed by this LevelEdit */
00066     int min;            /*<! Minimum level */
00067     int max;            /*<! Maximum level */
00068     int step;           /*<! Value of a single increment/decrement */
00069 
00070     level_set_callback *set_hook;     /*<! Callback called when a value is changed  */
00071     display_callback   *display_hook; /*<! Callback for complex unit display */
00072     int *ch1_val;                     /*<! (left) Value edited by this leveledit */
00073     int *ch2_val;                     /*<! Right channel edited */
00074 
00075     struct Bitmap   *bitmap;  /*<! Bitmap where the whole thing is rendered */
00076 } LevelEdit;
00077 
00078 
00079 void level_init(struct LevelEdit *lev,
00080         int type,
00081         struct Bitmap *bmp, const char *title, const char *unit,
00082         int min, int max, int step,
00083         int *ch1_val, int *ch2_val,
00084         level_set_callback *change_hook, display_callback *display_hook);
00085 void level_edit(struct LevelEdit *lev);
00086 
00087 #endif /* GUI_LEVELEDIT_H */