blob: eb766e162d3cd2794093277d7e82021168aa5891 [file] [log] [blame]
Linus Nielsen Feltzing1325c9d2002-11-10 16:42:31 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Linus Nielsen Feltzing
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Linus Nielsen Feltzing1325c9d2002-11-10 16:42:31 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef RECORDING_H
22#define RECORDING_H
Jonathan Gordon4718a1e2007-02-08 04:33:41 +000023#include "audio.h"
Linus Nielsen Feltzing1325c9d2002-11-10 16:42:31 +000024
Michael Sevakis0f175322007-02-08 10:36:49 +000025bool in_recording_screen(void);
Michael Sevakis4fc717a2006-08-28 22:38:41 +000026bool recording_screen(bool no_source);
Linus Nielsen Feltzingef7293f2004-01-21 14:58:40 +000027char *rec_create_filename(char *buf);
Linus Nielsen Feltzing3405d132004-06-04 12:34:29 +000028int rec_create_directory(void);
Jonathan Gordona5278fa2007-07-11 05:41:23 +000029void settings_apply_trigger(void);
Linus Nielsen Feltzing1325c9d2002-11-10 16:42:31 +000030
Jonathan Gordone900a902007-03-07 01:59:29 +000031/* If true, start recording automatically when recording_sreen() is entered */
32extern bool recording_start_automatic;
33
Michael Sevakis4fc717a2006-08-28 22:38:41 +000034#if CONFIG_CODEC == SWCODEC
Michael Sevakis2d48d0f2007-06-08 23:42:04 +000035/* handles device powerup, sets audio source and peakmeter mode */
Michael Sevakis0f5cb942006-11-06 18:07:30 +000036void rec_set_source(int source, unsigned flags);
Michael Sevakis4fc717a2006-08-28 22:38:41 +000037#endif /* CONFIG_CODEC == SW_CODEC */
38
Michael Sevakis0f5cb942006-11-06 18:07:30 +000039/* Initializes a recording_options structure with global settings.
40 pass returned data to audio_set_recording_options or
41 rec_set_recording_options */
42void rec_init_recording_options(struct audio_recording_options *options);
Michael Sevakis4fc717a2006-08-28 22:38:41 +000043/* steals mp3 buffer, sets source and then options */
Michael Sevakis0f5cb942006-11-06 18:07:30 +000044/* SRCF_RECORDING is implied for SWCODEC */
45void rec_set_recording_options(struct audio_recording_options *options);
Michael Sevakis4fc717a2006-08-28 22:38:41 +000046
Peter D'Hoye583f1862007-08-25 15:53:54 +000047enum recording_command
48{
49 RECORDING_CMD_STOP,
50 RECORDING_CMD_START, /* steal mp3 buffer, create unique filename and
51 start recording */
52 RECORDING_CMD_START_NEWFILE, /* create unique filename and start recording*/
53 RECORDING_CMD_PAUSE,
Peter D'Hoyea3524022008-05-15 22:47:07 +000054 RECORDING_CMD_RESUME,
55 RECORDING_CMD_STOP_SHUTDOWN /* stop recording and shutdown */
Peter D'Hoye583f1862007-08-25 15:53:54 +000056};
Michael Sevakis4fc717a2006-08-28 22:38:41 +000057
Peter D'Hoye583f1862007-08-25 15:53:54 +000058/* centralized way to start/stop/... recording */
59void rec_command(enum recording_command rec_cmd);
Michael Sevakis4fc717a2006-08-28 22:38:41 +000060
Michael Sevakis2d48d0f2007-06-08 23:42:04 +000061#endif /* RECORDING_H */