forked from len0rd/rockbox
different kind of recording beep: more faint, but not disturbing prerecording, can beep while we already record (no latency due to beep)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5511 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
35c69283d4
commit
dfa95c334b
3 changed files with 13 additions and 13 deletions
|
|
@ -322,25 +322,25 @@ bool recording_screen(void)
|
||||||
/* Only act if the mpeg is stopped */
|
/* Only act if the mpeg is stopped */
|
||||||
if(!(mpeg_status() & MPEG_STATUS_RECORD))
|
if(!(mpeg_status() & MPEG_STATUS_RECORD))
|
||||||
{
|
{
|
||||||
if (global_settings.talk_menu)
|
|
||||||
{ /* no voice possible here, but a beep */
|
|
||||||
mpeg_beep(0,HZ/4); /* longer beep on start */
|
|
||||||
}
|
|
||||||
have_recorded = true;
|
have_recorded = true;
|
||||||
talk_buffer_steal(); /* we use the mp3 buffer */
|
talk_buffer_steal(); /* we use the mp3 buffer */
|
||||||
mpeg_record(rec_create_filename(path_buffer));
|
mpeg_record(rec_create_filename(path_buffer));
|
||||||
update_countdown = 1; /* Update immediately */
|
update_countdown = 1; /* Update immediately */
|
||||||
last_seconds = 0;
|
last_seconds = 0;
|
||||||
|
if (global_settings.talk_menu)
|
||||||
|
{ /* no voice possible here, but a beep */
|
||||||
|
mpeg_beep(HZ/2); /* longer beep on start */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(mpeg_status() & MPEG_STATUS_PAUSE)
|
if(mpeg_status() & MPEG_STATUS_PAUSE)
|
||||||
{
|
{
|
||||||
|
mpeg_resume_recording();
|
||||||
if (global_settings.talk_menu)
|
if (global_settings.talk_menu)
|
||||||
{ /* no voice possible here, but a beep */
|
{ /* no voice possible here, but a beep */
|
||||||
mpeg_beep(0,HZ/8); /* short beep on resume */
|
mpeg_beep(HZ/4); /* short beep on resume */
|
||||||
}
|
}
|
||||||
mpeg_resume_recording();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ unsigned int mpeg_error(void);
|
||||||
void mpeg_error_clear(void);
|
void mpeg_error_clear(void);
|
||||||
int mpeg_get_file_pos(void);
|
int mpeg_get_file_pos(void);
|
||||||
unsigned long mpeg_get_last_header(void);
|
unsigned long mpeg_get_last_header(void);
|
||||||
void mpeg_beep(int freq, int duration);
|
void mpeg_beep(int duration);
|
||||||
|
|
||||||
/* in order to keep the recording here, I have to expose this */
|
/* in order to keep the recording here, I have to expose this */
|
||||||
void rec_tick(void);
|
void rec_tick(void);
|
||||||
|
|
|
||||||
|
|
@ -2377,17 +2377,17 @@ void mpeg_set_recording_gain(int left, int right, bool use_mic)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try to make some kind of beep, also in recording mode */
|
/* try to make some kind of beep, also in recording mode */
|
||||||
void mpeg_beep(int freq, int duration)
|
void mpeg_beep(int duration)
|
||||||
{
|
{
|
||||||
(void)freq; /* not used yet */
|
|
||||||
long starttick = current_tick;
|
long starttick = current_tick;
|
||||||
do
|
do
|
||||||
{
|
{ /* toggle bit 0 of codec register 0, toggling the DAC off & on.
|
||||||
mas_codec_writereg(0, 0); /* some little-understood sequence, */
|
* While this is still audible even without an external signal,
|
||||||
mas_codec_writereg(0, 1); /* there may be better ways */
|
* it doesn't affect the (pre-)recording. */
|
||||||
|
mas_codec_writereg(0, shadow_codec_reg0 ^ 1);
|
||||||
|
mas_codec_writereg(0, shadow_codec_reg0);
|
||||||
}
|
}
|
||||||
while (current_tick - starttick < duration);
|
while (current_tick - starttick < duration);
|
||||||
mas_codec_writereg(0, shadow_codec_reg0); /* restore it */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mpeg_new_file(const char *filename)
|
void mpeg_new_file(const char *filename)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue