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:
Jörg Hohensohn 2004-12-24 08:42:45 +00:00
parent 35c69283d4
commit dfa95c334b
3 changed files with 13 additions and 13 deletions

View file

@ -322,25 +322,25 @@ bool recording_screen(void)
/* Only act if the mpeg is stopped */
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;
talk_buffer_steal(); /* we use the mp3 buffer */
mpeg_record(rec_create_filename(path_buffer));
update_countdown = 1; /* Update immediately */
last_seconds = 0;
if (global_settings.talk_menu)
{ /* no voice possible here, but a beep */
mpeg_beep(HZ/2); /* longer beep on start */
}
}
else
{
if(mpeg_status() & MPEG_STATUS_PAUSE)
{
mpeg_resume_recording();
if (global_settings.talk_menu)
{ /* 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
{

View file

@ -99,7 +99,7 @@ unsigned int mpeg_error(void);
void mpeg_error_clear(void);
int mpeg_get_file_pos(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 */
void rec_tick(void);

View file

@ -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 */
void mpeg_beep(int freq, int duration)
void mpeg_beep(int duration)
{
(void)freq; /* not used yet */
long starttick = current_tick;
do
{
mas_codec_writereg(0, 0); /* some little-understood sequence, */
mas_codec_writereg(0, 1); /* there may be better ways */
{ /* toggle bit 0 of codec register 0, toggling the DAC off & on.
* While this is still audible even without an external signal,
* 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);
mas_codec_writereg(0, shadow_codec_reg0); /* restore it */
}
void mpeg_new_file(const char *filename)