Linus Nielsen Feltzing | 1325c9d | 2002-11-10 16:42:31 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2002 Linus Nielsen Feltzing |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame] | 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. |
Linus Nielsen Feltzing | 1325c9d | 2002-11-10 16:42:31 +0000 | [diff] [blame] | 16 | * |
| 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 Gordon | 4718a1e | 2007-02-08 04:33:41 +0000 | [diff] [blame] | 23 | #include "audio.h" |
Linus Nielsen Feltzing | 1325c9d | 2002-11-10 16:42:31 +0000 | [diff] [blame] | 24 | |
Michael Sevakis | 0f17532 | 2007-02-08 10:36:49 +0000 | [diff] [blame] | 25 | bool in_recording_screen(void); |
Michael Sevakis | 4fc717a | 2006-08-28 22:38:41 +0000 | [diff] [blame] | 26 | bool recording_screen(bool no_source); |
Linus Nielsen Feltzing | ef7293f | 2004-01-21 14:58:40 +0000 | [diff] [blame] | 27 | char *rec_create_filename(char *buf); |
Linus Nielsen Feltzing | 3405d13 | 2004-06-04 12:34:29 +0000 | [diff] [blame] | 28 | int rec_create_directory(void); |
Jonathan Gordon | a5278fa | 2007-07-11 05:41:23 +0000 | [diff] [blame] | 29 | void settings_apply_trigger(void); |
Linus Nielsen Feltzing | 1325c9d | 2002-11-10 16:42:31 +0000 | [diff] [blame] | 30 | |
Jonathan Gordon | e900a90 | 2007-03-07 01:59:29 +0000 | [diff] [blame] | 31 | /* If true, start recording automatically when recording_sreen() is entered */ |
| 32 | extern bool recording_start_automatic; |
| 33 | |
Michael Sevakis | 4fc717a | 2006-08-28 22:38:41 +0000 | [diff] [blame] | 34 | #if CONFIG_CODEC == SWCODEC |
Michael Sevakis | 2d48d0f | 2007-06-08 23:42:04 +0000 | [diff] [blame] | 35 | /* handles device powerup, sets audio source and peakmeter mode */ |
Michael Sevakis | 0f5cb94 | 2006-11-06 18:07:30 +0000 | [diff] [blame] | 36 | void rec_set_source(int source, unsigned flags); |
Michael Sevakis | 4fc717a | 2006-08-28 22:38:41 +0000 | [diff] [blame] | 37 | #endif /* CONFIG_CODEC == SW_CODEC */ |
| 38 | |
Michael Sevakis | 0f5cb94 | 2006-11-06 18:07:30 +0000 | [diff] [blame] | 39 | /* Initializes a recording_options structure with global settings. |
| 40 | pass returned data to audio_set_recording_options or |
| 41 | rec_set_recording_options */ |
| 42 | void rec_init_recording_options(struct audio_recording_options *options); |
Michael Sevakis | 4fc717a | 2006-08-28 22:38:41 +0000 | [diff] [blame] | 43 | /* steals mp3 buffer, sets source and then options */ |
Michael Sevakis | 0f5cb94 | 2006-11-06 18:07:30 +0000 | [diff] [blame] | 44 | /* SRCF_RECORDING is implied for SWCODEC */ |
| 45 | void rec_set_recording_options(struct audio_recording_options *options); |
Michael Sevakis | 4fc717a | 2006-08-28 22:38:41 +0000 | [diff] [blame] | 46 | |
Peter D'Hoye | 583f186 | 2007-08-25 15:53:54 +0000 | [diff] [blame] | 47 | enum 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'Hoye | a352402 | 2008-05-15 22:47:07 +0000 | [diff] [blame] | 54 | RECORDING_CMD_RESUME, |
| 55 | RECORDING_CMD_STOP_SHUTDOWN /* stop recording and shutdown */ |
Peter D'Hoye | 583f186 | 2007-08-25 15:53:54 +0000 | [diff] [blame] | 56 | }; |
Michael Sevakis | 4fc717a | 2006-08-28 22:38:41 +0000 | [diff] [blame] | 57 | |
Peter D'Hoye | 583f186 | 2007-08-25 15:53:54 +0000 | [diff] [blame] | 58 | /* centralized way to start/stop/... recording */ |
| 59 | void rec_command(enum recording_command rec_cmd); |
Michael Sevakis | 4fc717a | 2006-08-28 22:38:41 +0000 | [diff] [blame] | 60 | |
Michael Sevakis | 2d48d0f | 2007-06-08 23:42:04 +0000 | [diff] [blame] | 61 | #endif /* RECORDING_H */ |