UI_PSF_hisi.c File Reference


Detailed Description

This module provides parent hisi state handle.

REVISION

Definition in file UI_PSF_hisi.c.

#include "../SYSTEM/sys_main.h"
#include "../SYSTEM/sys_hardware.h"
#include "../SYSTEM/sys_clock.h"
#include "../AUDIO/audio.h"
#include "../encoder/encoder.h"
#include "../coder/coder.h"
#include "../BATTERY/battery.h"
#include "ui.h"

Include dependency graph for UI_PSF_hisi.c:

Include dependency graph

Go to the source code of this file.

Functions

PARENT_STATE UI_PSF_hisi (st_MSG *msgIN)
 Function serves as the parent hisi state handle.


Function Documentation

PARENT_STATE UI_PSF_hisi st_MSG msgIN  ) 
 

Function serves as the parent hisi state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 68 of file UI_PSF_hisi.c.

References AF_MP3, AI_START, Audio, AUDIO_initInterface(), AUDIO_MODE, AUDIO_setInterface(), BTN_YES, CLOCK_MP3RECORD, ENCODER_getAudioMode(), ENCODER_setSource(), ES_SOURCE, FAT_freeSpace(), st_UI::fname, st_AUDIO::freeSpace, MENU_buf, st_AUDIO::mode, st_UI::path, SAUDIOTIME_UPDT, SMSGBOX_EXIT, SSTATE_END, SSTATE_START, SYS_clockSetup(), TMR_create(), TMR_HISI, and UI_msgbxCreate().

00069 {   
00070     MSG_ID          id = msgIN->id;     
00071     MSG_DATA        d1 = msgIN->d1; 
00072     MSG_DATA        d2 = msgIN->d2;
00073 //DeepB
00074 /*
00075     ULONG           hisiIconList[12] = {    
00076                         (ULONG)graf_icon_hisi1,
00077                         (ULONG)graf_icon_hisi2,
00078                         (ULONG)graf_icon_hisi3,
00079                         (ULONG)graf_icon_hisi4,
00080                         (ULONG)graf_icon_hisi5,
00081                         (ULONG)graf_icon_hisi6,
00082                         (ULONG)graf_icon_hisi7,
00083                         (ULONG)graf_icon_hisi8,
00084                         (ULONG)graf_icon_hisi9,
00085                         (ULONG)graf_icon_hisi10,
00086                         (ULONG)graf_icon_hisi11,
00087                         (ULONG)graf_icon_hisi12};   
00088 */
00089     switch(id)
00090     {
00091     case SYS_MSG_ID:
00092         
00093         switch(d1)
00094         {
00095             case SSTATE_START:
00096             {
00097                 SYS_clockSetup(CLOCK_MP3RECORD);
00098                 BAT_setLowThreshold(0x3A66); //3.65V*4096.
00099                 
00100                 ENCODER_setSource((ES_SOURCE)d2);
00101                 
00102                 Audio.freeSpace = FAT_freeSpace(SYS_isHDDpresent()?DISK_C:DISK_D);
00103                 if(Audio.freeSpace < DISK_RESERVED_SPACE)
00104                 {
00105                     UI_msgbxCreate(MSGBX_DISKFULL);
00106                     return P_HISI;
00107                 }
00108                 
00109                 if(HFC_SUCCESS != _createHisiFile(Ui.path, (ES_SOURCE)d2))
00110                 {
00111                     return P_NULL;
00112                 }
00113                 
00114                 AUDIO_initInterface((AUDIO_MODE)ENCODER_getAudioMode((USHORT)d2), 
00115                                     AF_MP3, 0, 0);
00116                 AUDIO_setInterface(AI_START);
00117                 
00118                 _loadHisiTmplt(Ui.fname, (int)d2);
00119                 menu = mMENU_create((void *)&MENU_buf[0]);
00120                 _updateHisiTime(30);
00121                 TMR_create(TMR_HISI, 10, THISIANIMATION, 0, AUTO_RELOAD);
00122 //DeepB
00123 //              iconCount = 0;
00124 
00125                 return P_HISI;
00126             }
00127             case SSTATE_END:
00128             {
00129                 _cancelHisi();
00130                 return P_NULL;
00131             }
00132             case SAUDIOTIME_UPDT:
00133             {
00134                 if(30 < SYS_getCurRecordDuration())
00135                 {
00136                     _stopHisi();
00137                     return P_HISIDONE;
00138                 }
00139                 _updateHisiTime(30-SYS_getCurRecordDuration());
00140                 return P_HISI;
00141             }
00142             case SMSGBOX_EXIT:
00143             {
00144                 if(MENU_curMsgbx() == MSGBX_CANCELHISI)
00145                 {
00146                     if(BTN_YES == d2)
00147                     {
00148                         _cancelHisi();
00149                         return P_NULL;
00150                     }
00151                 }
00152                 else if(MENU_curMsgbx() == MSGBX_DISKFULL) 
00153                 {
00154                     SYS_usbEnabled();
00155                     SYS_recordNotActive();
00156                     return (Audio.mode == AM_RECFM) ? P_RADIO: P_NULL;
00157                 }
00158                 
00159                 break;
00160             }
00161         }   
00162         break;
00163     
00164     case TMR_MSG_ID:
00165         switch(d1)
00166         {
00167             case THISIANIMATION:
00168             {
00169                 ULONG   dptr;
00170                 // Update recorder icon display if not paused.
00171 //DeepB
00172 //              if(++iconCount >= 12) iconCount = 0;
00173 //              dptr = hisiIconList[iconCount];
00174 //              mMENU_update(menu, 3, dptr, FALSE);
00175                 mMENU_refresh(menu);                    
00176                 break;
00177             }
00178         }
00179         break;
00180         
00181     case KBD_MSG_ID:
00182         switch(d1)
00183         {
00184             case KEY_BACK:
00185             case KEY_HBACK:
00186             case KEY_HISI:
00187                 UI_msgbxCreate(MSGBX_CANCELHISI);
00188                 return P_HISI;
00189 
00190         }
00191         break;
00192     }
00193     
00194     return P_HISI;
00195 }

Here is the call graph for this function:


Generated on Wed Jan 19 01:13:32 2005 for neuros-firmware by  doxygen 1.3.9.1