Android: Fix some race conditions and crashes on startup.
[maemo-rb.git] / apps / recorder / recording.h
blob406986e8e0385980a6ca52d0b49b0acea00690b8
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 Linus Nielsen Feltzing
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 RECORDING_H
22 #define RECORDING_H
24 #include "config.h"
25 #include "audio.h"
27 bool in_recording_screen(void);
28 bool recording_screen(bool no_source);
29 char *rec_create_filename(char *buf);
30 int rec_create_directory(void);
31 void settings_apply_trigger(void);
33 /* If true, start recording automatically when recording_sreen() is entered */
34 extern bool recording_start_automatic;
36 #if CONFIG_CODEC == SWCODEC
37 /* handles device powerup, sets audio source and peakmeter mode */
38 void rec_set_source(int source, unsigned flags);
39 #endif /* CONFIG_CODEC == SW_CODEC */
41 /* Initializes a recording_options structure with global settings.
42 pass returned data to audio_set_recording_options or
43 rec_set_recording_options */
44 void rec_init_recording_options(struct audio_recording_options *options);
45 /* steals mp3 buffer, sets source and then options */
46 /* SRCF_RECORDING is implied for SWCODEC */
47 void rec_set_recording_options(struct audio_recording_options *options);
49 enum recording_command
51 RECORDING_CMD_STOP,
52 RECORDING_CMD_START, /* steal mp3 buffer, create unique filename and
53 start recording */
54 RECORDING_CMD_START_NEWFILE, /* create unique filename and start recording*/
55 RECORDING_CMD_PAUSE,
56 RECORDING_CMD_RESUME,
57 RECORDING_CMD_STOP_SHUTDOWN /* stop recording and shutdown */
60 /* centralized way to start/stop/... recording */
61 void rec_command(enum recording_command rec_cmd);
63 #endif /* RECORDING_H */