4 * Copyright 2004, 2006 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See README.devlib for information.
8 * \brief Generic editor for (volume/gain/contrast/...) setting.
12 * \author Stefano Fedrigo <aleph@develer.com>
14 #ifndef GUI_LEVELEDIT_H
15 #define GUI_LEVELEDIT_H
17 //#include <gui/levelbar.h>
19 /* Type for level_init */
20 #define LEVELEDIT_NOBAR 0 /**< Edit numeber only, without bar nor units */
21 #define LEVELEDIT_SINGLE 1 /**< Single channel editing */
22 #define LEVELEDIT_DOUBLE 2 /**< Double channel editing */
30 /** Type for callback used to set meter levels */
31 typedef void level_set_callback(void);
33 /** Type for callback used to customize display of units */
34 typedef void display_callback(struct LevelEdit *);
37 * State of a level meter
39 typedef struct LevelEdit {
40 int type; /*<! Type of level edititing mode (see prev defines) */
41 const char *title; /*<! Title on top of screen */
42 const char *unit; /*<! Unit of quantity changed by this LevelEdit */
43 int min; /*<! Minimum level */
44 int max; /*<! Maximum level */
45 int step; /*<! Value of a single increment/decrement */
47 level_set_callback *set_hook; /*<! Callback called when a value is changed */
48 display_callback *display_hook; /*<! Callback for complex unit display */
49 int *ch1_val; /*<! (left) Value edited by this leveledit */
50 int *ch2_val; /*<! Right channel edited */
52 struct Bitmap *bitmap; /*<! Bitmap where the whole thing is rendered */
56 void level_init(struct LevelEdit *lev,
58 struct Bitmap *bmp, const char *title, const char *unit,
59 int min, int max, int step,
60 int *ch1_val, int *ch2_val,
61 level_set_callback *change_hook, display_callback *display_hook);
62 void level_edit(struct LevelEdit *lev);
64 #endif /* GUI_LEVELEDIT_H */