summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/audio.h30
-rw-r--r--firmware/mpeg.c6
2 files changed, 9 insertions, 27 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index c39fca428c..49ff4c168a 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -77,49 +77,31 @@ struct audio_debug
77}; 77};
78 78
79void audio_init(void); 79void audio_init(void);
80void audio_wait_for_init(void); 80void audio_play(const long offset);
81void audio_play(long offset);
82void audio_stop(void); 81void audio_stop(void);
83void audio_pause(void); 82void audio_pause(void);
84void audio_resume(void); 83void audio_resume(void);
85void audio_next(void); 84void audio_next(void);
86void audio_prev(void); 85void audio_prev(void);
87int audio_status(void); 86int audio_status(void);
88#if CONFIG_CODEC == SWCODEC 87void audio_ff_rewind(const long newtime);
89int audio_track_count(void); /* SWCODEC only */
90long audio_filebufused(void); /* SWCODEC only */
91void audio_pre_ff_rewind(void); /* SWCODEC only */
92#endif /* CONFIG_CODEC == SWCODEC */
93void audio_ff_rewind(long newtime);
94void audio_flush_and_reload_tracks(void); 88void audio_flush_and_reload_tracks(void);
95#ifdef HAVE_ALBUMART
96int audio_current_aa_hid(void);
97#endif
98struct mp3entry* audio_current_track(void); 89struct mp3entry* audio_current_track(void);
99struct mp3entry* audio_next_track(void); 90struct mp3entry* audio_next_track(void);
100bool audio_has_changed_track(void); 91bool audio_has_changed_track(void);
101void audio_get_debugdata(struct audio_debug *dbgdata); 92void audio_get_debugdata(struct audio_debug *dbgdata);
102void audio_set_crossfade(int type);
103#ifndef HAVE_FLASH_STORAGE 93#ifndef HAVE_FLASH_STORAGE
104void audio_set_buffer_margin(int seconds); 94void audio_set_buffer_margin(const int seconds);
105#endif 95#endif
106unsigned int audio_error(void); 96unsigned int audio_error(void);
107void audio_error_clear(void); 97void audio_error_clear(void);
108int audio_get_file_pos(void); 98int audio_get_file_pos(void);
109void audio_beep(int duration); 99void audio_beep(int duration);
110void audio_init_playback(void); 100void audio_init_playback(void);
111/* Required call when audio buffer is require for some other purpose */
112unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size);
113/* Stops audio from serving playback */
114void audio_hard_stop(void);
115/* Retores the audio buffer to handle the requested playback */
116enum
117{
118 AUDIO_WANT_PLAYBACK = 0,
119 AUDIO_WANT_VOICE,
120};
121 101
122bool audio_restore_playback(int type); 102/* Required call when audio buffer is required for some other purpose */
103unsigned char *audio_get_buffer(const bool talk_buf, size_t *buffer_size);
104/* only implemented in playback.c, but called from firmware */
123 105
124/* channel modes */ 106/* channel modes */
125enum rec_channel_modes 107enum rec_channel_modes
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 11cbcdcb68..78824cfe36 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -533,7 +533,7 @@ static void recalculate_watermark(int bitrate)
533} 533}
534 534
535#ifndef HAVE_FLASH_STORAGE 535#ifndef HAVE_FLASH_STORAGE
536void audio_set_buffer_margin(int seconds) 536void audio_set_buffer_margin(const int seconds)
537{ 537{
538 low_watermark_margin = seconds; 538 low_watermark_margin = seconds;
539} 539}
@@ -2627,7 +2627,7 @@ void audio_set_recording_options(struct audio_recording_options *options)
2627#endif /* SIMULATOR */ 2627#endif /* SIMULATOR */
2628#endif /* CONFIG_CODEC == MAS3587F */ 2628#endif /* CONFIG_CODEC == MAS3587F */
2629 2629
2630void audio_play(long offset) 2630void audio_play(const long offset)
2631{ 2631{
2632#ifdef SIMULATOR 2632#ifdef SIMULATOR
2633 char* trackname; 2633 char* trackname;
@@ -2768,7 +2768,7 @@ void audio_prev(void)
2768#endif /* SIMULATOR */ 2768#endif /* SIMULATOR */
2769} 2769}
2770 2770
2771void audio_ff_rewind(long newtime) 2771void audio_ff_rewind(const long newtime)
2772{ 2772{
2773#ifndef SIMULATOR 2773#ifndef SIMULATOR
2774 queue_post(&mpeg_queue, MPEG_FF_REWIND, newtime); 2774 queue_post(&mpeg_queue, MPEG_FF_REWIND, newtime);