Rockbox Utility: make the window icon also include a larger one.
[maemo-rb.git] / apps / recorder / peakmeter.h
blob6be43a5f3a8e0afdf0f27c9aedbd9989145868bd
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Philipp Pertermann
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef __PEAKMETER_H__
22 #define __PEAKMETER_H__
24 #define PEAK_METER_FPS 20
25 #define MAX_PEAK 0x8000
27 /*#define PM_DEBUG */
28 #ifdef PM_DEBUG
29 extern bool peak_meter_histogram(void);
30 #endif
32 extern int pm_get_clipcount(void);
33 extern void pm_reset_clipcount(void);
34 extern void pm_activate_clipcount(bool active);
36 extern void peak_meter_enable(bool enable);
37 /* sets *left and *right to the current *unscaled* values */
38 extern void peak_meter_current_vals(int *left, int *right);
40 extern void peak_meter_playback(bool playback);
41 extern int peak_meter_draw_get_btn(int action_context, int x[], int y[],
42 int height[], int nb_screens,
43 struct viewport vps[]);
44 extern void peak_meter_set_clip_hold(int time);
45 extern void peak_meter_peek(void);
46 extern void peak_meter_init_range( bool dbfs, int range_min, int range_max);
47 extern void peak_meter_init_times(int release, int hold, int clip_hold);
48 #ifdef HAVE_AGC
49 extern void peak_meter_get_peakhold(int *peak_left, int *peak_right);
50 #endif
51 extern int peak_meter_get_min(void);
52 extern int peak_meter_get_max(void);
53 extern void peak_meter_set_use_dbfs(bool use);
54 extern bool peak_meter_get_use_dbfs(void);
55 extern int calc_db (int isample);
56 extern int peak_meter_db2sample(int db);
57 extern unsigned short peak_meter_scale_value(unsigned short val, int meterwidth);
59 #ifdef HAVE_HISTOGRAM
60 extern void histogram_init(void);
61 extern void histogram_draw(int x1, int x2, int y1, int y2, int width, int height);
62 #endif
64 /* valid values for trigger_status */
65 #define TRIG_OFF 0x00
66 #define TRIG_READY 0x01
67 #define TRIG_STEADY 0x02
68 #define TRIG_GO 0x03
69 #define TRIG_POSTREC 0x04
70 #define TRIG_RETRIG 0x05
71 #define TRIG_CONTINUE 0x06
73 extern void peak_meter_define_trigger(
74 int start_threshold,
75 long start_duration,
76 long start_dropout,
77 int stop_threshold,
78 long stop_hold_time,
79 long restart_gap
82 extern void peak_meter_trigger(bool on);
83 extern int peak_meter_trigger_status(void);
84 extern void peak_meter_set_trigger_listener(void (*listener)(int status));
86 #define TRIG_HEIGHT 8
88 extern void peak_meter_draw_trig(int x[], int y[], int trig_width[],
89 int nb_screens);
91 #define DB_SCALE_SRC_VALUES_SIZE 12
92 struct meter_scales{
93 /* buffered peak values */
94 int pm_peak_left;
95 int pm_peak_right;
96 /* if db_scale_valid is false the content of
97 db_scale_lcd_coord needs recalculation */
98 bool db_scale_valid;
99 /* contains the lcd x coordinates of the magical
100 scale values in db_scale_src_values */
101 int db_scale_lcd_coord[DB_SCALE_SRC_VALUES_SIZE];
102 int last_left;
103 int last_right;
104 /* peak hold timeouts */
105 long pm_peak_timeout_l;
106 long pm_peak_timeout_r;
109 extern void peak_meter_screen(struct screen *display, int x, int y, int height);
110 #endif /* __PEAKMETER_H__ */