make sure closing the application aborts the remaining HttpGet objects. Should fix...
[Rockbox.git] / apps / recorder / peakmeter.h
blobbe121b1aaf964c517628d25f1fec4c1e700a2098
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Philipp Pertermann
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #ifndef __PEAKMETER_H__
20 #define __PEAKMETER_H__
22 #define PEAK_METER_FPS 20
24 /*#define PM_DEBUG */
25 #ifdef PM_DEBUG
26 extern bool peak_meter_histogram(void);
27 #endif
29 extern int pm_get_clipcount(void);
30 extern void pm_reset_clipcount(void);
31 extern void pm_activate_clipcount(bool active);
33 extern bool peak_meter_enabled;
35 extern void peak_meter_playback(bool playback);
36 extern int peak_meter_draw_get_btn(int x, int y[], int height, int nb_screens);
37 extern void peak_meter_set_clip_hold(int time);
38 extern void peak_meter_peek(void);
39 extern void peak_meter_init_range( bool dbfs, int range_min, int range_max);
40 extern void peak_meter_init_times(int release, int hold, int clip_hold);
41 #ifdef HAVE_AGC
42 extern void peak_meter_get_peakhold(int *peak_left, int *peak_right);
43 #endif
44 extern void peak_meter_set_min(int newmin);
45 extern int peak_meter_get_min(void);
46 extern void peak_meter_set_max(int newmax);
47 extern int peak_meter_get_max(void);
48 extern void peak_meter_set_use_dbfs(bool use);
49 extern bool peak_meter_get_use_dbfs(void);
50 extern int calc_db (int isample);
51 extern int peak_meter_db2sample(int db);
52 extern unsigned short peak_meter_scale_value(unsigned short val, int meterwidth);
54 /* valid values for trigger_status */
55 #define TRIG_OFF 0x00
56 #define TRIG_READY 0x01
57 #define TRIG_STEADY 0x02
58 #define TRIG_GO 0x03
59 #define TRIG_POSTREC 0x04
60 #define TRIG_RETRIG 0x05
61 #define TRIG_CONTINUE 0x06
63 extern void peak_meter_define_trigger(
64 int start_threshold,
65 long start_duration,
66 long start_dropout,
67 int stop_threshold,
68 long stop_hold_time,
69 long restart_gap
72 extern void peak_meter_trigger(bool on);
73 extern int peak_meter_trigger_status(void);
74 extern void peak_meter_set_trigger_listener(void (*listener)(int status));
76 #define TRIG_HEIGHT 8
78 extern void peak_meter_draw_trig(int x[], int y[], int trig_width[],
79 int nb_screens);
81 extern unsigned short peak_meter_range_min;
82 extern unsigned short peak_meter_range_max;
84 #define DB_SCALE_SRC_VALUES_SIZE 12
85 struct meter_scales{
86 /* buffered peak values */
87 int pm_peak_left;
88 int pm_peak_right;
89 /* if db_scale_valid is false the content of
90 db_scale_lcd_coord needs recalculation */
91 bool db_scale_valid;
92 /* contains the lcd x coordinates of the magical
93 scale values in db_scale_src_values */
94 int db_scale_lcd_coord[DB_SCALE_SRC_VALUES_SIZE];
95 int last_left;
96 int last_right;
97 /* peak hold timeouts */
98 long pm_peak_timeout_l;
99 long pm_peak_timeout_r;
101 extern void peak_meter_draw(struct screen *display, struct meter_scales *meter_scales,
102 int x, int y, int width, int height);
103 extern void peak_meter_screen(struct screen *display, int x, int y, int height);
104 #endif /* __PEAKMETER_H__ */