diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-11-06 18:07:30 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-11-06 18:07:30 +0000 |
commit | 0f5cb94aa4a334366a746fcbb22f3335ca413265 (patch) | |
tree | 8f89a96628c1810d51ee9816daf78edb8c76fcd4 /apps/misc.h | |
parent | 0b22795e26ee09de14f6ac23219adeda12f2fd5b (diff) | |
download | rockbox-0f5cb94aa4a334366a746fcbb22f3335ca413265.tar.gz rockbox-0f5cb94aa4a334366a746fcbb22f3335ca413265.zip |
Big Patch adds primarily: Samplerate and format selection to recording for SWCODEC. Supprort for samplerates changing in playback (just goes with the recording part inseparably). Samplerates to all encoders. Encoders can be configured individually on a menu specific to the encoder in the recording menu. File creation is delayed until flush time to reduce spinups when splitting. Misc: statusbar icons for numbers are individual digits to display any number. Audio buffer was rearranged to maximize memory available to recording and properly reinitialized when trashed. ColdFire PCM stuff moved to target tree to avoid a complicated mess when adding samplerate switching. Some needed API changes and to neaten up growing gap between hardware and software codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11452 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/misc.h')
-rw-r--r-- | apps/misc.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/apps/misc.h b/apps/misc.h index 1bc9a23447..6c660e0a5e 100644 --- a/apps/misc.h +++ b/apps/misc.h | |||
@@ -19,21 +19,46 @@ | |||
19 | #ifndef MISC_H | 19 | #ifndef MISC_H |
20 | #define MISC_H | 20 | #define MISC_H |
21 | 21 | ||
22 | #include <stdbool.h> | ||
23 | |||
22 | /* Format a large-range value for output, using the appropriate unit so that | 24 | /* Format a large-range value for output, using the appropriate unit so that |
23 | * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" | 25 | * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" |
24 | * units) if possible, and 3 significant digits are shown. If a buffer is | 26 | * units) if possible, and 3 significant digits are shown. If a buffer is |
25 | * given, the result is snprintf()'d into that buffer, otherwise the result is | 27 | * given, the result is snprintf()'d into that buffer, otherwise the result is |
26 | * voiced.*/ | 28 | * voiced.*/ |
27 | void output_dyn_value(char *buf, int buf_size, int value, | 29 | char *output_dyn_value(char *buf, int buf_size, int value, |
28 | const unsigned char **units, bool bin_scale); | 30 | const unsigned char **units, bool bin_scale); |
29 | 31 | ||
32 | /* Create a filename with a number part in a way that the number is 1 | ||
33 | * higher than the highest numbered file matching the same pattern. | ||
34 | * It is allowed that buffer and path point to the same memory location, | ||
35 | * saving a strcpy(). Path must always be given without trailing slash. | ||
36 | * | ||
37 | * "num" can point to an int specifying the number to use or NULL or a value | ||
38 | * less than zero to number automatically. The final number used will also | ||
39 | * be returned in *num. If *num is >= 0 then *num will be incremented by | ||
40 | * one. */ | ||
41 | #if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) && !defined(CONFIG_RTC) | ||
42 | /* this feature is needed by SWCODEC recording without a RTC to prevent | ||
43 | disk access when changing files */ | ||
44 | #define IF_CNFN_NUM_(...) __VA_ARGS__ | ||
45 | #define IF_CNFN_NUM | ||
46 | #else | ||
47 | #define IF_CNFN_NUM_(...) | ||
48 | #endif | ||
30 | char *create_numbered_filename(char *buffer, const char *path, | 49 | char *create_numbered_filename(char *buffer, const char *path, |
31 | const char *prefix, const char *suffix, | 50 | const char *prefix, const char *suffix, |
32 | int numberlen); | 51 | int numberlen IF_CNFN_NUM_(, int *num)); |
33 | #ifdef CONFIG_RTC | 52 | #ifdef CONFIG_RTC |
53 | /* Create a filename with a date+time part. | ||
54 | It is allowed that buffer and path point to the same memory location, | ||
55 | saving a strcpy(). Path must always be given without trailing slash. | ||
56 | unique_time as true makes the function wait until the current time has | ||
57 | changed. */ | ||
34 | char *create_datetime_filename(char *buffer, const char *path, | 58 | char *create_datetime_filename(char *buffer, const char *path, |
35 | const char *prefix, const char *suffix); | 59 | const char *prefix, const char *suffix, |
36 | #endif | 60 | bool unique_time); |
61 | #endif /* CONFIG_RTC */ | ||
37 | 62 | ||
38 | /* Read (up to) a line of text from fd into buffer and return number of bytes | 63 | /* Read (up to) a line of text from fd into buffer and return number of bytes |
39 | * read (which may be larger than the number of bytes stored in buffer). If | 64 | * read (which may be larger than the number of bytes stored in buffer). If |
@@ -57,4 +82,4 @@ long default_event_handler(long event); | |||
57 | void car_adapter_mode_init(void); | 82 | void car_adapter_mode_init(void); |
58 | extern int show_logo(void); | 83 | extern int show_logo(void); |
59 | 84 | ||
60 | #endif | 85 | #endif /* MISC_H */ |