📄 rec_main.c
字号:
/******************
* mp3_main.c
*****************/
#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "ap_common.h"
#include "display.h"
#include "rec_utile.h"
#include "rec_display.h"
#include "rec_sub_menu.h"
#include "prefer.h"
#include "ui_main.h"
#include "res.h"
#include "res_show.h"
#include "ui_message.h"
UINT8 qtime_ticks;
UINT8 play_long_flag=0;
BOOLEAN fm_lock, music_on, lyric_on, scroll_on;
UINT16 rec_srate;
void screen_rec_init(void)
{
api_bStop();
switch(tUserPreference.rectype)
{
case 0:
rec_srate = 32000;
case 1:
rec_srate = 8000;
}
api_bSetRecordFreq(rec_srate);
if(!api_bRecordInit("RECORD",32768))
return;
ui_draw();
//gfx_image(8,5,&image_table[10]);
bResShowPic(STOPPIC1,0,38);
screen_level = SCREEN_LEVEL_REC_STOP;
}
void screen_rec(UINT8 key)
{
switch(key) {
case KEY_MENU:
if(screen_level == SCREEN_LEVEL_REC_STOP) //show stop menu
rec_sub_menu();
break;
case KEY_PLAY:
close_volume();// marco add for no voice output
if(screen_level == SCREEN_LEVEL_REC_STOP)
{
api_bSetADC10SignalSrc(ADC10_SOURCE_FROM_MICROPHONE);
if(api_bRecordStart())
{
gfx_songname();
screen_level = SCREEN_LEVEL_REC_START;
//gfx_image(8,5,&image_table[9]);
bResShowPic(PLAYPIC,0,38);
}
return;
}
else if(screen_level == SCREEN_LEVEL_REC_START)
{
if(api_bPause())
{
fg_color = COLOR_BLACK;
bg_color = COLOR_WHITE;
/* Pause status */
//gfx_image(8,5,&image_table[11]);
bResShowPic(PAUSEPIC,0,38);
screen_level = SCREEN_LEVEL_REC_PAUSE;
}
}
else if(screen_level == SCREEN_LEVEL_REC_PAUSE)
{
if(api_bPlay())
{
fg_color = COLOR_WHITE;
bg_color = COLOR_BLACK;
/* Play status */
//gfx_image(8,5,&image_table[9]);
bResShowPic(PLAYPIC,0,38);
screen_level = SCREEN_LEVEL_REC_START;
}
}
break;
case KEY_LONG_PLAY:
api_bRecordStop();
api_bStop();
if(screen_level == SCREEN_LEVEL_REC_STOP)
{
if(!play_long_flag)
vShutDown();
}
else
{
ui_show_message(RSAVING);
screen_map(SCREEN_REC);
play_long_flag = 1;
bResShowPic(STOPPIC1,0,38);
screen_level = SCREEN_LEVEL_REC_STOP;
break;
}
case KEY_RELEASE:
//api_bFwRwdEpilog();
//screen_level = SCREEN_LEVEL_MUSIC_PLAY;
break;
default:
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -