ui.h File Reference


Detailed Description

UI module C header file.

REVISION

Definition in file ui.h.

#include "../feature.h"
#include "../MESSAGE/message.h"
#include "../KEYBOARD/keyboard.h"
#include "../LCD/lcd.h"
#include "../fat/fat.h"
#include "../MENU/menu.h"
#include "../TIMER/timer.h"
#include "../DB/db.h"
#include "../ear/ear.h"

Include dependency graph for ui.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  st_DATETIME
 UI date/time structure definitions. More...
struct  st_UI
 User interface global data structure definition. More...

Defines

#define WAV_RECQUALITY_INDEX   5
 Indicate the first available WAV record format in VDIM_RECORDQUALITY.

Enumerations

enum  PARENT_STATE
 Parent state enumeration definition. More...
enum  STATE { , S_MENU_STAY = 999 }
 State enumeration definition. More...
enum  CHILD_STATE
 Child state enumeration definition. More...
enum  MENU_STATE
 menu state enumeration definition. More...
enum  PLAY_SRC
 Player source enumeration definition.

Functions

void UI_child (void)
 Function serves as user interface child task handle.
void UI_main (void)
 Function serves as user interface task handle.
void UI_parent (void)
 Function serves as user interface parent task handle.
void UI_setupTextMenu (ULONG, UINT *, UINT *, ITEMICONCTL)
 Function loads text menu controls into global menu buffer and ready the menu creation function.
CHILD_STATE UI_CSF_msgbox (st_MSG *)
 Function serves as the child message box state handle.
CHILD_STATE UI_CSF_null (st_MSG *)
 Function serves as the child NULL state handle.
CHILD_STATE UI_CSF_xim (st_MSG *)
 Function serves as the child XIM state handle.
CHILD_STATE UI_CSF_volume (st_MSG *)
 Function serves as the child volume window state handle.
CHILD_STATE UI_CSF_myfiChannel (st_MSG *)
 Function serves as the child myfi channel window state handle.
PARENT_STATE UI_PSF_autosync (st_MSG *)
 Function serves as the autosync state handle.
PARENT_STATE UI_PSF_null (st_MSG *)
 Function serves as the parent null state handle.
PARENT_STATE UI_PSF_play (st_MSG *)
 Function serves as the parent play state handle.
PARENT_STATE UI_PSF_sleep (st_MSG *)
 Function serves as the parent sleep state handle.
PARENT_STATE UI_PSF_radio (st_MSG *)
 Function serves as the parent FM radio state handle.
PARENT_STATE UI_PSF_record (st_MSG *)
 Function serves as the parent record state handle.
PARENT_STATE UI_PSF_recorddone (st_MSG *)
 Function serves as the parent record complete state handle.
PARENT_STATE UI_PSF_hisi (st_MSG *)
 Function serves as the parent hisi state handle.
PARENT_STATE UI_PSF_hisidone (st_MSG *)
 Function serves as the parent HiSi complete state handle.
STATE UI_SF_autoscan (st_MSG *)
 Function serves as the autoscan state handle.
STATE UI_SF_dbmenu (st_MSG *)
 Function serves as the DB menu state handle.
STATE UI_SF_menu (st_MSG *)
 Function serves as the menu state handle.
STATE UI_SF_null (st_MSG *)
 Function serves as the NULL state handle.
STATE UI_SF_powerup (st_MSG *)
 Function serves as the powerup state handle.
STATE UI_MSF_goup (st_MSG *)
 Function serves as the special go-up menu handle, returns the menu by one level up.
STATE UI_MSF_stay (st_MSG *)
 Function serves as the special stay menu handle, stays in current menu.
STATE UI_MSF_autoff (st_MSG *)
 Function serves as the auto off menu state handle.
STATE UI_MSF_myfi (st_MSG *)
 Function serves as the myfi setup menu handle.
STATE UI_MSF_shuffle (st_MSG *)
 Function serves as the shuffle menu state handle.
STATE UI_MSF_repeat (st_MSG *)
 Function serves as the repeat menu state handle.
STATE UI_MSF_backlight (st_MSG *)
 Function serves as the backlight menu state handle.
STATE UI_MSF_myfiMode (st_MSG *)
 Function serves as the myfi mode setup menu handle.
STATE UI_MSF_myfiQuality (st_MSG *)
 Function serves as the myfi quality setup menu handle.
STATE UI_MSF_hisi (st_MSG *)
 Function serves as the hisi setup menu handle.
STATE UI_MSF_settings (st_MSG *)
 Function serves as the settings menu state handle.
STATE UI_MSF_bkpkSwap (st_MSG *)
 Function serves as the backpack swap menu handle.
STATE UI_MSF_eq (st_MSG *)
 Function serves as the EQ selection menu state handle.
STATE UI_MSF_main (st_MSG *)
 Function serves as the main menu state handle.
STATE UI_MSF_dj (st_MSG *)
 Function serves as the DJ selection menu state handle.
STATE UI_MSF_playQueue (st_MSG *)
 Function serves as the play queue selection menu state handle.
STATE UI_MSF_audio (st_MSG *)
 Function serves as the audio db menu state handle.
STATE UI_MSF_xtra (st_MSG *)
 Function serves as the xtra menu state handle.
STATE UI_MSF_diagnosis (st_MSG *)
 Function serves as the diagnosis menu state handle.
STATE UI_MSF_diag_nand (st_MSG *)
 Function serves as the NAND diagnosis menu handle.
STATE UI_MSF_diag_hdd (st_MSG *)
 Function serves as the hard drive diagnosis menu handle.
void UI_MENU_autoff (void)
 Funciton sets up the auto off setup menu display.
void UI_MENU_myfi (void)
 Funciton sets up the myfi setup menu display.
void UI_MENU_shuffle (void)
 Funciton sets up the shuffle setup menu display.
void UI_MENU_repeat (void)
 Funciton sets up the repeat setup menu display.
void UI_MENU_backlight (void)
 Funciton sets up the backlight setup menu display.
void UI_MENU_recordQuality (void)
 Funciton sets up the record quality setup menu display.
void UI_MENU_myfiGain (void)
 Funciton sets up the myfi gain setup menu display.
void UI_MENU_myfiMode (void)
 Funciton sets up the myfi mode setup menu display.
void UI_MENU_myfiQuality (void)
 Funciton sets up the myfi quality setup menu display.
void UI_MENU_hisi (void)
 Funciton sets up the hisi setup menu display.
void UI_MENU_settings (void)
 Funciton sets up the SETUP menu display.
void UI_MENU_bkpkSwap (void)
 Funciton sets up the backpack swap menu display.
void UI_MENU_bkpkSwapCtls (void)
 Funciton sets up the backpack swap controls menu display.
void UI_MENU_contrast (void)
 Funciton sets up the LCD contrast setup menu display.
void UI_MENU_eq (void)
 Funciton sets up the EQ selection menu display.
void UI_MENU_seteq (void)
 Funciton sets up the EQ value setup menu display.
void UI_MENU_synclog (void)
 Funciton sets up the synclog view menu display.
void UI_MENU_presets (void)
 Funciton sets up the presets view menu display.
void UI_MENU_dateTime (void)
 Funciton sets up the date time setup menu display.
void UI_MENU_dbRecordInfo (void)
 Funciton sets up the DB record info menu display.
void UI_MENU_properties (void)
 Funciton sets up the properties setup menu display.
void UI_MENU_main (void)
 Funciton sets up the main menu display.
void UI_MENU_dj (void)
 Funciton sets up the DJ selection menu display.
void UI_MENU_playQueue (void)
 Funciton sets up the play queue selection menu display.
void UI_MENU_audio (void)
 Funciton sets up the audio db menu display.
void UI_MENU_xtra (void)
 Function sets up the XTRA menu display.
void UI_MENU_xtra_mute (void)
 Function sets up the XTRA mute-on-scan menu display.
void UI_MENU_xtra_hisi (void)
 Function sets up the XTRA HiSi setup menu display.
void UI_MENU_xtra_backlight (void)
 Function sets up the XTRA backlight setup menu display.
void UI_MENU_xtra_layout (void)
 Function sets up the XTRA play menu layout display.
void UI_MENU_xtra_granularity (void)
 Function sets up the XTRA Granularity setup menu display.
void UI_MENU_xtra_carmode (void)
 Function sets up the car mode options menu display.
void UI_MENU_xtra_scrollwrap (void)
 Function sets up the scrollwrap options menu display.
void UI_MENU_diagnosis (void)
 Funciton sets up the diagnosis menu display.
void UI_MENU_diag_nand (void)
 Funciton sets up the NAND diagnosis menu display.
void UI_MENU_diag_hdd (void)
 Funciton sets up the hard drive diagnosis menu display.
void UI_menuBrowse (MSG_DATA, MSG_DATA, MENU_STATE)
 Function kicks off the generic menu browsing.
void UI_dbBrowse (MSG_DATA, MSG_DATA, DB_ID, DB_ENTRY, DB_ENTRY, DB_FIELDIDX)
 Function kicks off the generic DB browsing.
void UI_msgbxCreate (MSGBX_ID)
 Function sends out system message to create a message box menu.
BOOL UI_interpretAudioRecord (st_DBINFO *, USHORT *, char *, char *, char *, char *, char *, char *, char *, ULONG *, ULONG *)
 Funciton interprets audio DB record and sets up player display controls.
BOOL UI_interpretIdentifiedHisiRecord (st_DBINFO *, USHORT *, char *, char *, char *, char *, char *, char *, char *, ULONG *, ULONG *)
 Funciton interprets identified HiSi record and sets up player display controls.
BOOL UI_interpretUnidentifiedHisiRecord (st_DBINFO *, USHORT *, char *, char *, char *, char *, char *, char *, char *, ULONG *, ULONG *)
 Funciton interprets unidentified HiSi record and sets up player display controls.
BOOL UI_interpretFailedHisiRecord (st_DBINFO *, USHORT *, char *, char *, char *, char *, char *, char *, char *, ULONG *, ULONG *)
 Funciton interprets failed HiSi record and sets up player display controls.
BOOL UI_insertAudioRecord (const char *, const char *, const char *, const char *, const char *, const char *, ULONG, ULONG, const char *)
 Function inserts an audio record from the root of audio DB.
BOOL UI_insertHisiRecord (const char *, const char *, const char *)
 Function inserts a HiSi clip to unidentified HiSi database.
void UI_readRTC (st_DATETIME *)
 Function reads back the RTC time in UI format.
UINT UI_currentTimeString (char *)
 Function creates a string for current RTC date time and returns the string length in words.
BOOL UI_isPresetValid (int)
 Function checks to see if there is a valid preset corresponding to specific preset index.
int UI_isPresetStation (USHORT)
 Function checks if specified FM radio station is a preset station or not.
void UI_presetRadio (int, USHORT)
 Function presets the specified radio station.
void UI_presetMyFi (int, USHORT)
 Function presets the specified MyFi station.
void UI_presetAudio (int, DB_ID, DB_ENTRY, DB_ENTRY, DB_FIELDIDX, ULONG)
 Function presets the specified audio playback controls.
void UI_addXIM (int *, long, int)
 Function adds specified XIM tem to XIM buffer.
void UI_removeXIM (int *, int)
 Function removes specified XIM item from XIM buffer.
BOOL UI_earPut (const char *, D2PEAR_ID, PEAR_DATA, USHORT, long)
 Function adds an EAR entry to the EAR file and refresh membar if needed.
long UI_pendingEarDiskSpace (void)
 Function returns pending device-to-PC EAR disk space in kilobytes.
void UI_updateMembar (void)
 Functoin sets up to update the memory bar display.
void UI_rdSynclog (void)
 Function reads back the synclog file and sets up globals.
void UI_audioPresetUpdate (int)
 Function checks to update the audio preset per to DB changes made.

Variables

PLAY_SRC playSource
 Global to hold playback source definition.


Enumeration Type Documentation

enum CHILD_STATE
 

Child state enumeration definition.

NOTE: State has to be enumed in alphabetically order to comply with the way the child state function handle gets defined.

Definition at line 94 of file ui.h.

Referenced by UI_child().

00095 {
00096     C_NULL          = 0,
00097     C_MSGBOX        = 1,
00098     C_XIM           = 2,
00099     C_VOLUME        = 3,
00100     C_MYFICHANNEL   = 4
00101 } CHILD_STATE;

enum MENU_STATE
 

menu state enumeration definition.

NOTE: definition has to be complied with the way the menu state function handle gets defined.

Definition at line 108 of file ui.h.

Referenced by UI_SF_null().

00109 {   
00110     MENU_AUTOFF         = 0,
00111     MENU_BACKLIGHT      = 1,
00112     MENU_BKPKSWAP       = 2,
00113     MENU_BKPKSWAPCTLS   = 3,
00114     MENU_CONTRAST       = 4,
00115     MENU_DATETIME       = 5,
00116     MENU_DBRECORDINFO   = 6,
00117     MENU_EQ             = 7,
00118     MENU_HISI           = 8,
00119     MENU_MAIN           = 9,
00120     MENU_MYFI           = 10,
00121     MENU_MYFI_GAIN      = 11,
00122     MENU_MYFI_MODE      = 12,
00123     MENU_MYFI_QUALITY   = 13,
00124     MENU_PRESETREVIEW   = 14,
00125     MENU_PROPERTIES     = 15,
00126     MENU_RECORDQUALITY  = 16,
00127     MENU_REPEAT         = 17,
00128     MENU_SETEQ          = 18,
00129     MENU_SETTINGS       = 19,
00130 //DeepB 
00131     MENU_XTRA           = 20,
00132     MENU_XTRA_MUTE      = 21,
00133     MENU_XTRA_HISI      = 22,
00134     MENU_XTRA_BACKLIGHT = 23,
00135     MENU_XTRA_LAYOUT    = 24,
00136     MENU_XTRA_GRANULARITY   = 25,
00137     MENU_XTRA_CARMODE   = 26,
00138     MENU_XTRA_SCROLLWRAP    = 27,
00139     MENU_SHUFFLE        = 28,
00140     MENU_SYNCLOG        = 29,
00141     #ifdef DJ_SUPPORT
00142     MENU_DJ,
00143     #endif
00144     
00145     #ifdef M3U_SUPPORT
00146     MENU_PLAYQ,
00147     #endif
00148 
00149     #ifdef SP_SUPPORT
00150     MENU_AUDIO, 
00151     #endif
00152     
00153     MENU_DIAGNOSIS,
00154     MENU_DIAG_HDD,
00155     MENU_DIAG_NAND,
00156     MENU_NULL           = 0x7FFF
00157 
00158 } MENU_STATE;

enum PARENT_STATE
 

Parent state enumeration definition.

NOTE: State has to be enumed in alphabetically order to comply with the way the parent state function handle gets defined.

Definition at line 57 of file ui.h.

Referenced by UI_parent().

00058 {
00059     P_NULL          = 0,
00060     P_SLEEP         = 1,
00061     P_AUTOSYNC      = 2,
00062     P_PLAY          = 3,
00063     P_RADIO         = 4,
00064     P_RECORD        = 5,
00065     P_RECORDDONE    = 6,
00066     P_HISI          = 7,
00067     P_HISIDONE      = 8
00068 } PARENT_STATE;

enum STATE
 

State enumeration definition.

NOTE: State has to be enumed in alphabetically order to comply with the way the state function handle gets defined.

Enumeration values:
S_MENU_STAY  stay in current menu state, do not close window.

Definition at line 77 of file ui.h.

Referenced by UI_main(), UI_SF_menu(), and UI_SF_null().

00078 {   
00079     S_NULL          = 0,
00080     S_MENU          = 1,
00081     S_AUTOSCAN      = 2,
00082     S_DBMENU        = 3,
00083     S_POWERUP       = 4,
00084     
00085     S_MENU_STAY     = 999   
00086 } STATE;


Function Documentation

void UI_addXIM int *  pXIMbuf,
long  pXIM_DEF,
int  position
 

Function adds specified XIM tem to XIM buffer.

It is the caller's responsibility to make sure XIM buffer is big enough.

Parameters:
pXIMbuf XIM data buffer.
pXIM_DEF XIM definition data pointer.
position position specifier, if == -1, add it one item before EXIT.

Definition at line 266 of file UI_CSF_xim.c.

00267 {
00268     int *   pData;
00269     int *   pStart;
00270     int     len, tmp, itemNum;
00271     ULONG   dptr;
00272     
00273     len = *pXIMbuf;
00274     
00275     if(len == 0) pStart = pXIMbuf;
00276     else
00277     {   
00278         /* Get itemNum. */
00279         itemNum = pXIMbuf[1] & 0x007F;
00280     
00281         /* Increase item number. */
00282         pXIMbuf[1] = itemNum + 1;
00283         
00284         if(position == -1)
00285         {       
00286             position = itemNum - 1;
00287         }
00288             
00289         /* Adjustify pDspData and pActionData for all items */
00290         
00291         /* Points to first XIM item data pointer. */
00292         pData = pXIMbuf + 4;
00293         
00294         for( tmp = 0; tmp < itemNum; tmp++ )
00295         {   
00296             dptr = ((unsigned long)(*pData)<<16)|((unsigned short)*(pData+1));
00297             
00298             /* If NULL, no data associated. */
00299             if(dptr)
00300             {           
00301                 dptr += XIM_ITEM_HEADER_LEN;
00302         
00303                 *pData++ = dptr >> 16;
00304             
00305                 *pData++ = dptr & 0xFFFF;
00306             }
00307             else pData += 2;
00308             
00309     
00310             dptr = ((unsigned long)(*pData)<<16)|((unsigned short)*(pData+1));
00311             
00312             /* If NULL, no data associated. */
00313             if(dptr)
00314             {           
00315                 dptr += XIM_ITEM_HEADER_LEN;
00316         
00317                 *pData++ = dptr >> 16;
00318             
00319                 *pData++ = dptr & 0xFFFF;
00320             }
00321             else pData += 2;
00322         
00323             /* Points to next XIM item. */
00324             pData += 2;
00325         }
00326         
00327         
00328         /* Make room for new item header. */
00329         pStart =
00330         pData = pXIMbuf + 2 + (position*XIM_ITEM_HEADER_LEN);
00331         
00332         memmove(    pData + XIM_ITEM_HEADER_LEN, 
00333                     pData, 
00334                     len - (position*XIM_ITEM_HEADER_LEN) - 2 );
00335     }
00336     
00337     /* Set up pointer to where dspData starts. */
00338     pData = pXIMbuf + len + XIM_ITEM_HEADER_LEN;
00339     
00340     
00341     /* Insert new header. */
00342     GEN_readXdata(pXIM_DEF, (USHORT *)pStart, XIM_ITEM_HEADER_LEN);
00343     
00344     /* Preserve pDspData, then modify it. */
00345     dptr = (((unsigned long)pStart[2])<<16)|(unsigned short)pStart[3];
00346     
00347     pStart[2] = 0;
00348     //pStart[3] = (int)pData;
00349     pStart[3] = (int)(pData - pXIMbuf);
00350     
00351     /* Load dspData. */
00352     GEN_readXdata(dptr, (USHORT *)&tmp, 1);
00353     
00354     GEN_readXdata(dptr, (USHORT *)pData, tmp + 1);
00355     
00356     /* Set up pointer to where actionData starts. */
00357     pData += (tmp + 1);
00358     
00359     len += (tmp + 1);
00360     
00361     /* Preserve pActionData, then modify it. */
00362     dptr = ((unsigned long)pStart[4]<<16)|(unsigned short)pStart[5];
00363     
00364     if(dptr)
00365     {   
00366         pStart[4] = 0;
00367         //pStart[5] = (int)pData;
00368         pStart[5] = (int)(pData - pXIMbuf);
00369         
00370         /* Load actionData. */
00371         GEN_readXdata(dptr, (USHORT *)&tmp, 1);
00372         
00373         GEN_readXdata(dptr, (USHORT *)pData, tmp + 1);
00374         
00375         len += (tmp + 1);
00376     }
00377     
00378     /* Update XIM data len. */
00379     pXIMbuf[0] = len + XIM_ITEM_HEADER_LEN;
00380 }

void UI_audioPresetUpdate int  dbChange  ) 
 

Function checks to update the audio preset per to DB changes made.

Parameters:
dbChange DB change mode, 1, record insertion, -1, record deletion.

Definition at line 218 of file UI_presetMgmt.c.

References st_PRESET::audio, st_NDSYSPARAM::audioPresetChksum, st_PRESET::chksum, DB_queryClose(), DB_queryFirst(), GEN_checksum(), st_NDSYSPARAM::preset, st_PRESET::share, and st_PRESET::type.

Referenced by UI_insertAudioRecord(), and UI_PSF_play().

00219 {
00220     int ii;
00221     st_PRESET *         pPreset = &nandSysParam.preset[1];
00222     st_AUDIOPRESET *    pAP;
00223     USHORT              buf[DB_MAXRECLEN];
00224     DB_HDL              hdl;
00225     unsigned int        check;
00226     unsigned int        fldEntry;
00227     unsigned int        dbEntry;
00228     for(ii = 1; ii < 6; ii++ )
00229     {
00230         if( (pPreset->type >= PRESET_AUDIO)&&(pPreset->type <= PRESET_RECORDINGS) )
00231         {
00232             pAP = &pPreset->share.audio;
00233             fldEntry = pAP->fldEntry;
00234             dbEntry  = pAP->dbEntry;
00235             
00236             check = 0;
00237             while(check < 3)
00238             {
00239                 //if(pPreset->type == PRESET_SONGS)
00240                     hdl = DB_queryFirst(pAP->dbId, pAP->fldIdx, fldEntry, dbEntry, buf);
00241                 //else 
00242                 //  hdl = DB_queryFirst(DB_childID(pAP->dbId, pAP->fldIdx), 0, 0, fldEntry, buf);
00243             
00244                 if(hdl != DB_INVALID_HDL)
00245                 {
00246                     DB_queryClose(hdl);
00247                     if(nandSysParam.audioPresetChksum[ii] == GEN_checksum(buf+3, strlen((const char*)buf+3)))
00248                     {
00249                         //pPreset->type = PRESET_AUDIO;
00250                         pAP->dbEntry  = dbEntry;
00251                         pAP->fldEntry = fldEntry;
00252                         pPreset->chksum = GEN_checksum((USHORT*)pPreset, 7);
00253                         break;
00254                     }
00255                 }
00256                 
00257                 switch(check)
00258                 {
00259                     case 0: 
00260                         dbEntry += dbChange;
00261                         check++;
00262                         break;
00263                         
00264                     case 1:
00265                         dbEntry = pAP->dbEntry;
00266                         fldEntry++;
00267                         check++;
00268                         break;
00269                         
00270                     case 2:
00271                         pPreset->type = PRESET_Invalid;
00272                         check++;
00273                         break; 
00274                 }
00275             }
00276         }
00277         
00278         pPreset++;  
00279     }   
00280 }

Here is the call graph for this function:

void UI_child void   ) 
 

Function serves as user interface child task handle.

This task handle all pop-up windows.

Definition at line 43 of file UI_child.c.

References CHILD_STATE, st_MSG::d1, st_MSG::d2, st_MSG::id, SBATLEVEL_UPDT, SINITSTATUSBAR, SMEMBAR_UPDT, SRTC_UPDT, SSTATE_END, SSTATE_END_ACK, SYS_autoffReset(), and UI_CSF_myfiChannel().

Referenced by SYS_createResidentTask().

00044 {   
00045     st_MSG      msgIN;
00046     st_MSG      msgOUT;
00047     CHILD_STATE c_curstate = C_NULL;
00048     CHILD_STATE c_oldstate = C_NULL;
00049     MSG_ID      id;
00050     MSG_DATA    d1;
00051     MSG_DATA    d2;
00052     CSFHDL      CSFHDL_TABLE[] = 
00053                     {           
00054                         UI_CSF_null,
00055                         UI_CSF_msgbox,
00056                         UI_CSF_xim,
00057                         UI_CSF_volume,
00058                         UI_CSF_myfiChannel
00059                     };
00060 
00061     _init();
00062     
00063     while(1)
00064     {
00065         BOOL processed = FALSE;
00066         
00067         mMSG_get(uiChildMsgQ, &msgIN, SYS_FOREVER);
00068 
00069         id = msgIN.id;     
00070         d1 = msgIN.d1; 
00071         d2 = msgIN.d2;
00072         
00073         if(KBD_MSG_ID == id)
00074         {
00075             SYS_autoffReset();
00076             SYS_autoResumePlayReset();
00077         }
00078 
00079         if( TMR_MSG_ID == id )
00080         {
00081             if(THDDPOWEROFF == d1)
00082             {
00083                 HDD_shutdown();
00084                 continue;               
00085             }
00086             else if(TSYSBUSY == d1)
00087             {
00088                 mMENU_statusBar(STBAR_SYSBUSY, NULL);
00089                 processed = TRUE;
00090             }
00091             else if(TSYSNOTBUSY == d1)
00092             {
00093                 mMENU_statusBar(STBAR_SYSIDLE, NULL);
00094                 processed = TRUE;
00095             }
00096         }
00097         else if( SYS_MSG_ID == id )
00098         {
00099             if(SMEMBAR_UPDT == d1)
00100             {
00101                 mMENU_statusBar(STBAR_MEMORY, d2);
00102                 processed = TRUE;
00103             }
00104             else if(SBATLEVEL_UPDT == d1)
00105             {
00106                 mMENU_statusBar(STBAR_BATTERY, d2);
00107                 processed = TRUE;
00108             }
00109             else if(SRTC_UPDT == d1)
00110             {
00111                 mMENU_statusBar(STBAR_TIME, d2);
00112                 processed = TRUE;
00113             }
00114             else if(SINITSTATUSBAR == d1)
00115             {
00116                 mMENU_statusBar(STBAR_CREATE, 0);
00117                 // Display full battery bar.
00118                 mMENU_statusBar(STBAR_BATTERY, 3);
00119                 // Display current time.
00120                 mMENU_statusBar(STBAR_TIME, 0);
00121                 processed = TRUE;
00122             }
00123         }
00124         
00125         if(FALSE == processed)
00126         {   
00127             c_curstate = UI_getChildSFhdl(c_oldstate)(&msgIN);
00128             while(c_curstate != c_oldstate) 
00129             {
00130                 c_oldstate = c_curstate;
00131                 _loadCurStateCode(c_curstate);
00132                 
00133                 msgOUT.id = SYS_MSG_ID;
00134                 msgOUT.d1 = SSTATE_START;               
00135                 // msgIN.d2 is carried over here.
00136                 msgOUT.d2 = msgIN.d2;
00137                 
00138                 c_curstate = UI_getChildSFhdl(c_oldstate)(&msgOUT);
00139             }   
00140         }       
00141         
00142         // Report to system the following message status.
00143         if( (SYS_MSG_ID == id)&&(SSTATE_END == d1) )
00144         {
00145             mMSG_send(sysMsgQ, SYS_MSG_ID, SSTATE_END_ACK, DONTCARE, SYS_FOREVER);
00146         }
00147         
00148         UI_stackassert(UI_CHILD);
00149     }
00150 }

Here is the call graph for this function:

CHILD_STATE UI_CSF_msgbox st_MSG msgIN  ) 
 

Function serves as the child message box state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 48 of file UI_CSF_msgbox.c.

References BTN_CANCEL, BTN_NO, BTN_PCDELETE, st_MSGBOX::button, MENU_2NEXT, MENU_2PREV, MENU_buf, MENU_CLOSE, MSG_send(), SAUDIOTIME_UPDT, SBROWSE, SDISKDBREADY, SENDOFMUSIC, SMSGBOX_EXIT, SSTATE_END, SSTATE_START, TMR_delete(), TMR_MSGBOXCANCEL, and st_MSGBOX::value.

00049 {   
00050     MSG_ID          id = msgIN->id;     
00051     MSG_DATA        d1 = msgIN->d1; 
00052     MSG_DATA        d2 = msgIN->d2;
00053     st_MSGBOX *     pMbx;
00054     
00055     if(SYS_MSG_ID == id)
00056     {
00057         switch(d1)
00058         {
00059             case SSTATE_START:
00060             {
00061                 g_curMSGBX = d2;
00062                 MENU_buf[0] = DP_MSGBOX;
00063                 MENU_buf[1] = d2;
00064                 menu = mMENU_create((void*)&MENU_buf[0]);
00065                 return C_MSGBOX;
00066             }
00067             case SBROWSE:
00068             case SAUDIOTIME_UPDT: return C_MSGBOX;
00069             case SSTATE_END:
00070             case SDISKDBREADY:
00071             {
00072                 _msgboxCancel();
00073                 return C_NULL;
00074             }
00075             case SENDOFMUSIC:
00076             {
00077                 _msgboxCancel();
00078                 MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00079                 return C_NULL;
00080             }
00081         }
00082     }
00083     else if(KBD_MSG_ID == id)
00084     {
00085         switch(d1)
00086         {
00087 //DeepB
00088             case KEY_PLAY:
00089             case KEY_SELECT:
00090             {
00091                 TMR_delete(TMR_MSGBOXCANCEL);
00092                 pMbx = (st_MSGBOX *)mMENU_getObj(menu);
00093                 //UI_assert((UINT)pMbx, UI_CSF_MSGBOX2);
00094                 if(!pMbx) d2 = BTN_CANCEL;
00095                 else
00096                 {
00097                     switch(pMbx->button)
00098                     {               
00099                         case MBX_BTN_NULL:      d2 = BTN_NULL;                          break;
00100                         case MBX_BTN_OK:        d2 = BTN_OK;                            break;  
00101                         case MBX_BTN_OKCANCEL:  d2 = (pMbx->value)? BTN_CANCEL:BTN_OK;  break;
00102                         case MBX_BTN_YESNO:     d2 = (pMbx->value)? BTN_NO:BTN_YES;     break;
00103                         case MBX_BTN_PCCANCEL:  d2 = (pMbx->value)? BTN_PCDELETE:BTN_NO;break;
00104                         case MBX_BTN_NEUROSCANCELPC:    
00105                             if(pMbx->value == 0)        d2 = BTN_NEUROS;
00106                             else if(pMbx->value == 1)   d2 = BTN_CANCEL;
00107                             else                        d2 = BTN_PCDELETE;
00108                             break;
00109                     }
00110                 }
00111                 
00112                 mMENU_action(menu, MENU_CLOSE);
00113                 mMSG_send(uiMsgQ, SYS_MSG_ID, SMSGBOX_EXIT, d2, SYS_FOREVER);   
00114                 return C_NULL;
00115             }
00116             case KEY_UP:
00117             case KEY_HUP:
00118             case KEY_RUP:
00119             {
00120                 mMENU_action(menu, MENU_2PREV);
00121                 return C_MSGBOX;
00122             }   
00123             case KEY_DOWN:  
00124             case KEY_HDOWN:
00125             case KEY_RDOWN:
00126             {
00127                 mMENU_action(menu, MENU_2NEXT);
00128                 return C_MSGBOX;
00129             }
00130             case KEY_BACK:
00131             case KEY_REWIND:
00132             case KEY_FORWARD:
00133             {
00134                 _msgboxCancel();
00135                 return C_NULL;
00136             }
00137         }
00138     }
00139     else if(TMR_MSG_ID == id)
00140     {
00141         switch(d1)
00142         {
00143             case THISIANIMATION:
00144             case TRECANIMATION:
00145             case TRECVUMETER:
00146             case TTXTSCROLL:    return C_MSGBOX;
00147             case TMSGBOX_CANCEL:
00148             case TRESUMEPLAY:
00149             {
00150                 _msgboxCancel();
00151                 return C_NULL;
00152             }
00153         }
00154     }
00155     
00156     // Pass the rest of the message to UI_main.
00157     MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00158     
00159     return C_MSGBOX;
00160 }

Here is the call graph for this function:

CHILD_STATE UI_CSF_myfiChannel st_MSG msgIN  ) 
 

Function serves as the child myfi channel window state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 50 of file UI_CSF_myfiChannel.c.

References AI_PAUSE, AUDIO_setInterface(), MENU_2BOTTOM, MENU_2NEXT, MENU_2PREV, MENU_2TOP, MENU_buf, MENU_RECALL, MENU_STORE, MSG_send(), st_SYSPARAM::myfiChannel, SAUDIOTIME_UPDT, SBROWSE, SENDOFMUSIC, SMYFICHANNELCHANGED, SSTATE_END, SSTATE_START, TMR_create(), TMR_MYFICHANNELWINDOW, TMR_reset(), UI_msgbxCreate(), and UI_presetMyFi().

Referenced by UI_child().

00051 {   
00052     MSG_ID          id = msgIN->id;     
00053     MSG_DATA        d1 = msgIN->d1; 
00054     MSG_DATA        d2 = msgIN->d2;
00055     
00056     if( SYS_MSG_ID == id)
00057     {
00058         switch(d1)
00059         {
00060             case SSTATE_START:
00061             {
00062                 MENU_buf[0] = DP_MYFICHANNEL;
00063                 MENU_buf[1] = (UINT)&sysParam.myfiChannel;// current fm out channel.
00064                 MENU_buf[2] = MAX_CHANNEL;          // max fm out channel.          
00065                 MENU_buf[3] = MIN_CHANNEL;          // min fm out channel.          
00066                 menu = mMENU_create((void *)&MENU_buf[0]);
00067             
00068                 TMR_create(TMR_MYFICHANNELWINDOW, 600, TMYFICHANNELWINDOW, 0, NO_RELOAD);
00069                 return C_MYFICHANNEL;
00070             }
00071             case SBROWSE:
00072             case SAUDIOTIME_UPDT: return C_MYFICHANNEL;
00073             case SSTATE_END:
00074             {
00075                 _exit();
00076                 return C_NULL;
00077             }
00078             case SENDOFMUSIC:
00079             {
00080                 _exit();
00081                 MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00082                 return C_NULL;
00083             }
00084         }
00085     }
00086     else if(KBD_MSG_ID == id)
00087     {
00088         switch(d1)
00089         {
00090             case KEY_SELECT:
00091             case KEY_BACK:
00092             case KEY_REWIND:
00093             case KEY_FORWARD:
00094             {
00095                 _exit();
00096                 return C_NULL;
00097             }       
00098             case KEY_UP:
00099             case KEY_HUP:
00100             case KEY_RUP:
00101             {
00102                 AUDIO_setInterface(AI_PAUSE);
00103                 TMR_reset(TMR_MYFICHANNELWINDOW);
00104                 mMENU_action(menu, MENU_2PREV);
00105                 XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00106                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMYFICHANNELCHANGED,DONTCARE, SYS_FOREVER);
00107                 return C_MYFICHANNEL;
00108             }
00109             case KEY_DOWN:
00110             case KEY_HDOWN:
00111             case KEY_RDOWN: 
00112             {
00113                 AUDIO_setInterface(AI_PAUSE);
00114                 TMR_reset(TMR_MYFICHANNELWINDOW);
00115                 mMENU_action(menu, MENU_2NEXT);
00116                 XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00117                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMYFICHANNELCHANGED,DONTCARE, SYS_FOREVER);
00118                 return C_MYFICHANNEL;
00119             }
00120 //DeepB
00121 // Handle MyFi Presets
00122 // Store them
00123             case KEY_HPRESET1:
00124             case KEY_HPRESET2:
00125             case KEY_HPRESET3:
00126             case KEY_HPRESET4:
00127             case KEY_HPRESET5:
00128             {
00129                 int ii = d1-KEY_PRESET0;
00130 // Store preset Here
00131                 AUDIO_setInterface(AI_PAUSE);
00132                 TMR_reset(TMR_MYFICHANNELWINDOW);
00133                 mMENU_action(menu, MENU_STORE);
00134                 UI_presetMyFi(ii, sysParam.myfiChannel);
00135                 XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00136                 UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00137                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMYFICHANNELCHANGED,DONTCARE, SYS_FOREVER);
00138                 return C_MYFICHANNEL;
00139             }
00140 // Recall preset
00141             case KEY_PRESET1:
00142             case KEY_PRESET2:
00143             case KEY_PRESET3:
00144             case KEY_PRESET4:
00145             case KEY_PRESET5:
00146             {
00147                 int ii = d1-KEY_PRESET0;
00148 // Recall preset Here
00149                 AUDIO_setInterface(AI_PAUSE);
00150                 TMR_reset(TMR_MYFICHANNELWINDOW);
00151                 mMENU_action(menu, MENU_RECALL);
00152 //              sysParam.myfiChannel = nandSysParam.myfi[ii];
00153                 XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00154                 UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);   
00155                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMYFICHANNELCHANGED,DONTCARE, SYS_FOREVER);
00156                 return C_MYFICHANNEL;
00157             }
00158 //To top of the freq
00159             case KEY_HSELECT:
00160             {
00161                 AUDIO_setInterface(AI_PAUSE);
00162                 TMR_reset(TMR_MYFICHANNELWINDOW);
00163                 mMENU_action(menu, MENU_2TOP);
00164                 XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00165                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMYFICHANNELCHANGED,DONTCARE, SYS_FOREVER);
00166                 return C_MYFICHANNEL;
00167             }
00168 //To bottom of the freq
00169             case KEY_HBACK:
00170             {
00171                 AUDIO_setInterface(AI_PAUSE);
00172                 TMR_reset(TMR_MYFICHANNELWINDOW);
00173                 mMENU_action(menu, MENU_2BOTTOM);
00174                 XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00175                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMYFICHANNELCHANGED,DONTCARE, SYS_FOREVER);
00176                 return C_MYFICHANNEL;
00177             }
00178         }
00179     }
00180     else if(TMR_MSG_ID == id)
00181     {
00182         switch(d1)
00183         {
00184             case TTXTSCROLL: return C_MYFICHANNEL;
00185             case TMYFICHANNELWINDOW:
00186             {
00187                 _exit();
00188                 return C_NULL;          
00189             }
00190         }
00191     }
00192 
00193     // Pass the rest of the message to UI_main.
00194     MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00195     
00196     return C_MYFICHANNEL;
00197 }

Here is the call graph for this function:

CHILD_STATE UI_CSF_null st_MSG msgIN  ) 
 

Function serves as the child NULL state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 42 of file UI_CSF_null.c.

References MSG_send(), SBATLOW_SHUTDOWN, SCSF_NULL, SMSGBOX_CREATE, SMYFICHANNELWIN_CREATE, SSTATE_END, SSTATE_START, SVOLWIN_CREATE, SXIM_CREATE, TMR_create(), and TMR_LOWBAT_AUTOFF.

00043 {   
00044     MSG_ID          id = msgIN->id;     
00045     MSG_DATA        d1 = msgIN->d1; 
00046     MSG_DATA        d2 = msgIN->d2;
00047     switch(id)
00048     {
00049     case SYS_MSG_ID:
00050         switch(d1)
00051         {
00052             case SSTATE_START:              return C_NULL;
00053             case SMSGBOX_CREATE:            return C_MSGBOX;
00054             case SXIM_CREATE:               return C_XIM;
00055             case SVOLWIN_CREATE:            return C_VOLUME;
00056             case SMYFICHANNELWIN_CREATE:    return C_MYFICHANNEL;
00057             case SBATLOW_SHUTDOWN:
00058             {
00059                 msgIN->d2 = MSGBX_BATTERYLOW;
00060                 TMR_create(TMR_LOWBAT_AUTOFF, 250, TSHUTDOWN, 0, NO_RELOAD);
00061                 return C_MSGBOX;
00062             }
00063             case SSTATE_END:
00064             {
00065                 mMSG_send(sysMsgQ, SYS_MSG_ID, SCSF_NULL, DONTCARE, SYS_FOREVER);
00066                 return C_NULL;
00067             }
00068         }
00069         break;
00070     
00071     case TMR_MSG_ID:
00072         break;
00073     }
00074     
00075     // Route the rest of the messages to parent UI.
00076     MSG_send(uiMsgQ, msgIN, SYS_FOREVER);
00077     return C_NULL;
00078 }

Here is the call graph for this function:

CHILD_STATE UI_CSF_volume st_MSG msgIN  ) 
 

Function serves as the child volume window state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 45 of file UI_CSF_volume.c.

References CODEC_hpVolume(), MENU_2NEXT, MENU_2PREV, MENU_buf, MENU_CLOSE, MSG_send(), SAUDIOTIME_UPDT, SBROWSE, SENDOFMUSIC, SSTATE_END, SSTATE_START, TMR_create(), TMR_delete(), TMR_reset(), TMR_VOLUMEWINDOW, and st_SYSPARAM::volume.

00046 {   
00047     MSG_ID          id = msgIN->id;     
00048     MSG_DATA        d1 = msgIN->d1; 
00049     MSG_DATA        d2 = msgIN->d2;
00050     
00051     if(SYS_MSG_ID == id)
00052     {
00053         switch(d1)
00054         {
00055             case SSTATE_START:
00056             {
00057                 MENU_buf[0] = DP_VOLUME;
00058                 MENU_buf[1] = (UINT)&sysParam.volume;
00059                 MENU_buf[2] = MAX_VOLUME;
00060                 menu = mMENU_create((void*)&MENU_buf[0]);
00061                 TMR_create(TMR_VOLUMEWINDOW, 200, TVOLUMEWINDOW, 0, NO_RELOAD);
00062                 return C_VOLUME;
00063             }
00064             case SBROWSE:
00065             case SAUDIOTIME_UPDT: return C_VOLUME;
00066             case SSTATE_END:
00067             {
00068                 TMR_delete(TMR_VOLUMEWINDOW);
00069                 mMENU_action(menu, MENU_CLOSE);
00070                 return C_NULL;
00071             }
00072             case SENDOFMUSIC:
00073             {
00074                 TMR_delete(TMR_VOLUMEWINDOW);
00075                 mMENU_action(menu, MENU_CLOSE);
00076                 MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00077                 return C_NULL;
00078             }
00079         }
00080     }
00081     else if(KBD_MSG_ID == id)
00082     {
00083         switch(d1)
00084         {
00085             case KEY_BACK:
00086             case KEY_FORWARD:
00087             case KEY_REWIND:
00088             case KEY_SELECT:
00089             {
00090                 TMR_delete(TMR_VOLUMEWINDOW);
00091                 mMENU_action(menu, MENU_CLOSE);
00092                 return C_NULL;
00093             }
00094             case KEY_UP:
00095             case KEY_HUP:
00096             case KEY_RUP:
00097             {
00098                 TMR_reset(TMR_VOLUMEWINDOW);
00099                 mMENU_action(menu, MENU_2PREV);
00100                 CODEC_hpVolume(sysParam.volume);
00101                 return C_VOLUME;
00102             }
00103             case KEY_DOWN:
00104             case KEY_HDOWN:
00105             case KEY_RDOWN: 
00106             {
00107                 TMR_reset(TMR_VOLUMEWINDOW);
00108                 mMENU_action(menu, MENU_2NEXT);
00109                 CODEC_hpVolume(sysParam.volume);
00110                 return C_VOLUME;
00111             }
00112         }
00113     }
00114     else if(TMR_MSG_ID == id)
00115     {
00116         switch(d1)
00117         {
00118             case TTXTSCROLL: return C_VOLUME;
00119             case TVOLUMEWINDOW:
00120             {
00121                 TMR_delete(TMR_VOLUMEWINDOW);
00122                 mMENU_action(menu, MENU_CLOSE);
00123                 return C_NULL;
00124             }
00125         }
00126     }
00127     
00128     // Pass the rest of the message to UI_main.
00129     MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00130     
00131     return C_VOLUME;
00132 }

Here is the call graph for this function:

CHILD_STATE UI_CSF_xim st_MSG msgIN  ) 
 

Function serves as the child XIM state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 57 of file UI_CSF_xim.c.

References MENU_2NEXT, MENU_2PREV, MENU_buf, MENU_CLOSE, MENU_SELECT, MSG_send(), SAUDIOTIME_UPDT, SBROWSE, SENDOFMUSIC, SSTATE_END, SSTATE_START, and SXIM_EXIT.

00058 {   
00059     ULONG           dptr = 0L;
00060     MSG_ID          id = msgIN->id;     
00061     MSG_DATA        d1 = msgIN->d1; 
00062     MSG_DATA        d2 = msgIN->d2;
00063     st_XIMENU *     pXim;
00064     
00065     if(SYS_MSG_ID == id)
00066     {
00067         switch(d1)
00068         {
00069             case SSTATE_START:
00070             {
00071                 switch(d2&0xff00)
00072                 {
00073                 case XIMWIN_DB:             dptr = DB_SRAM_BUF;             break;
00074                 case XIMWIN_HISIDONE:       dptr = (ULONG)XIM_HISI_DONE;    break;
00075                 case XIMWIN_RADIO:          dptr = (ULONG)XIM_RADIO;        break;
00076                 case XIMWIN_PLAYER:         dptr = (ULONG)XIM_PLAYER;       break;
00077                 case XIMWIN_PLAYERQ:        dptr = (ULONG)XIM_PLAYERQ;      break;
00078                 case XIMWIN_PLAYER_ADD2MYMIX:       dptr = (ULONG)XIM_PLAYER_ADD2MYMIX;         break;
00079                 case XIMWIN_PLAYER_MYFI_ADD2MYMIX:  dptr = (ULONG)XIM_PLAYER_MYFI_ADD2MYMIX;    break;
00080                 case XIMWIN_PLAYER_MYFI:    dptr = (ULONG)XIM_PLAYER_MYFI;  break;
00081                 case XIMWIN_PLAYER_MYFIQ:   dptr = (ULONG)XIM_PLAYER_MYFIQ; break;
00082                 case XIMWIN_RECORDDONE:     dptr = (ULONG)XIM_RECORD_DONE;  break;
00083                 #ifdef M3U_SUPPORT
00084                 case XIMWIN_PLAYQ:          dptr = (ULONG)XIM_PLAYQ;        break;
00085                 #endif
00086                 }
00087                 
00088                 if(dptr == 0L)
00089                 {
00090                     mMSG_send(uiMsgQ, SYS_MSG_ID, SXIM_EXIT, 0xffff, SYS_FOREVER);
00091                     return C_NULL;
00092                 }
00093                 
00094                 if( (d2&0xff00) != prevXIM )
00095                 {
00096                     prevXIM = (d2&0xff00);
00097                     actvItem = 0;
00098                 }
00099                 _loadXIMmenu(dptr);
00100                 menu = mMENU_create((void*)&MENU_buf[0]);
00101                 return C_XIM;           
00102             }
00103             case SBROWSE:
00104             case SAUDIOTIME_UPDT: return C_XIM;
00105             case SSTATE_END:
00106             {
00107                 mMENU_action(menu, MENU_CLOSE);
00108                 mMSG_send(uiMsgQ, SYS_MSG_ID, SXIM_EXIT, 0xffff, SYS_FOREVER);
00109                 return C_NULL;
00110             }
00111             case SENDOFMUSIC:
00112             {
00113                 mMENU_action(menu, MENU_CLOSE);
00114                 mMSG_send(uiMsgQ, SYS_MSG_ID, SXIM_EXIT, 0xffff, SYS_FOREVER);
00115                 MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00116                 return C_NULL;
00117             }
00118         }
00119     }
00120     else if(KBD_MSG_ID == id)
00121     {
00122         switch(d1)
00123         {
00124         case KEY_SELECT:
00125             mMENU_action(menu, MENU_SELECT);
00126             pXim = (st_XIMENU*)mMENU_getObj(menu);
00127             if(pXim) _ximAction(actvItem, pXim);
00128             mMENU_action(menu, MENU_CLOSE);
00129             return C_NULL;
00130         
00131 // Catch also holding buttons, to avoid a lockup
00132 // Patch by Bernard Cafarelli
00133         case KEY_UP:
00134         case KEY_HUP:
00135         case KEY_RUP:
00136             mMENU_action(menu, MENU_2PREV);
00137             return C_XIM;
00138             
00139 // Catch also holding buttons, to avoid a lockup
00140 // Patch by Bernard Cafarelli
00141         case KEY_DOWN:
00142         case KEY_HDOWN:
00143         case KEY_RDOWN:
00144             mMENU_action(menu, MENU_2NEXT);
00145             return C_XIM;
00146         
00147         case KEY_FORWARD:   
00148         case KEY_REWIND:
00149         case KEY_BACK:
00150             mMENU_action(menu, MENU_CLOSE);
00151             mMSG_send(uiMsgQ, SYS_MSG_ID, SXIM_EXIT, 0xffff, SYS_FOREVER);
00152             return C_NULL;
00153         }
00154     }
00155     else if (TMR_MSG_ID == id)
00156     {
00157         switch(d1)
00158         {
00159             case TTXTSCROLL: return C_XIM;
00160         }
00161     }
00162     
00163     // Pass the rest of the message to UI_main.
00164     MSG_send(uiMsgQ, msgIN, SYS_FOREVER);    
00165      
00166     return C_XIM;
00167 }

Here is the call graph for this function:

UINT UI_currentTimeString char *  str  ) 
 

Function creates a string for current RTC date time and returns the string length in words.

String takes the following format, MO-DY-YR HR-MI-SE AM/PM

It is the caller's responsibility to make sure string buffer is big enough to hold the entire time string.

Parameters:
str Time string buffer.
Returns:
Time string length in words.

Definition at line 90 of file UI_rtc.c.

References RTC_readTime().

00091 {
00092     st_TIME     t;
00093     int length = 0;
00094     
00095     RTC_readTime(&t);
00096     
00097     t.Month &= 0x1F;    
00098     *str++ = (t.Month >> 4) + 0x30;
00099     *str++ = (t.Month & 0x0F) + 0x30;
00100     *str++ = '-';
00101     length += 3;
00102     
00103     t.Day &= 0x3F;
00104     *str++ = (t.Day >> 4) + 0x30;
00105     *str++ = (t.Day & 0x0F) + 0x30;
00106     *str++ = '-';
00107     length += 3;
00108     
00109     *str++ = (t.Year >> 4) + 0x30;
00110     *str++ = (t.Year & 0x0F) + 0x30;
00111     *str++ = ' ';
00112     length += 3;
00113 
00114     t.Hour &= 0x3F;
00115     *str++ = (t.Hour >> 4) + 0x30;
00116     *str++ = (t.Hour & 0x0F) + 0x30;
00117     *str++ = '-';
00118     length += 3;
00119 
00120     t.Minute &= 0x7F;
00121     *str++ = (t.Minute >> 4) + 0x30;
00122     *str++ = (t.Minute & 0x0F) + 0x30;
00123     *str++ = '-';
00124     length += 3;
00125     
00126     t.Second &= 0x7F;
00127     *str++ = (t.Second >> 4) + 0x30;
00128     *str = (t.Second & 0x0F) + 0x30;
00129     length += 2;
00130     
00131     return length;
00132 }

Here is the call graph for this function:

void UI_dbBrowse MSG_DATA  msgD1,
MSG_DATA  msgD2,
DB_ID  db,
DB_ENTRY  dbEntry,
DB_ENTRY  fldEntry,
DB_FIELDIDX  fldIdx
 

Function kicks off the generic DB browsing.

DB menu system maintains its own history and returns the specified system message when browsing back to what it was started.

NOTE: 1) It is the caller's responsibility to make sure request is NOT cascaded, in other words, do not send another browse request before current request reaches its root. 2) This API can NOT be called from UI task, it can be called from parent UI, child UI, system etc.

Parameters:
msgD1 Returning system message data1.
msgD2 Returning system message data2
db Browsing DB ID.
dbEntry DB record entry.
fldEntry DB field entry.
fldIdx DB field index.

Definition at line 84 of file UI_browse.c.

References SDBBROWSE.

00090 {
00091     static UINT dbREQUEST[6];
00092     UINT *      pD = &dbREQUEST[0];
00093     *pD++ = (UINT)msgD2;
00094     *pD++ = (UINT)msgD1;
00095     *pD++ = (UINT)dbEntry;
00096     *pD++ = (UINT)fldEntry;
00097     *pD++ = (UINT)fldIdx;
00098     *pD++ = (UINT)db;
00099     mMSG_send(uiMsgQ, SYS_MSG_ID, SDBBROWSE, (int)&dbREQUEST[0], SYS_FOREVER);
00100 }

BOOL UI_earPut const char *  drive,
D2PEAR_ID  id,
PEAR_DATA  pData,
USHORT  dataLen,
long  diskSpace
 

Function adds an EAR entry to the EAR file and refresh membar if needed.

Parameters:
drive Drive letter string.
id device to PC EAR id.
pData EAR request support data pointer.
dataLen EAR support data length in words.
diskSpace EAR disk space usage in kilo bytes. (1024).
Returns:
TRUE if request successfully added, otherwise FALSE.

Definition at line 144 of file UI_ear.c.

References D2PEAR_ID, EAR_put(), FAT_freeSpace(), PEAR_DATA, and UI_updateMembar().

Referenced by UI_PSF_play().

00149 {
00150     if(diskSpace < 0)
00151     {
00152         if(-diskSpace > FAT_freeSpace((drive == strDISKD)?DISK_D:DISK_C) )
00153         {
00154             // Disk full.
00155             return FALSE;
00156         }       
00157     }
00158     
00159     EAR_put(drive,id,pData,dataLen,diskSpace);
00160     //if(diskSpace)
00161     {
00162         UI_updateMembar();
00163     }
00164     
00165     if( (SYS_isHDDpresent())&&(!SYS_isPlayActive())) 
00166     {
00167         HDD_setPowerMode( HDD_POWEROFF, 0 );
00168     }
00169     
00170     return TRUE;
00171 }

Here is the call graph for this function:

BOOL UI_insertAudioRecord const char *  pTitle,
const char *  pPlaylist,
const char *  pArtist,
const char *  pAlbum,
const char *  pGenre,
const char *  pRecordings,
ULONG  timeLen,
ULONG  size,
const char *  pPath
 

Function inserts an audio record from the root of audio DB.

Note that in case the audio DB is updated future, this funciton needs to be rewritten. NOTE: pTitle and pPath are mandatory and must NOT be null pointers.

Parameters:
pTitle Audio record time.
pPlaylist Audio record playlist string.
pArtist Audio record artist string.
pAlbum Audio record album string.
pGenre Audio record genre string.
pRecordings Audio record recording source string.
timeLen Audio record duration.
size Audio file size in kilo-bytes.
pPath Audio record full path.
Returns:
TRUE if successfully inserted, otherwise FALSE.

Definition at line 129 of file UI_insertRecord.c.

References st_DBNAV::audio, DB_insertRecord(), GEN_strPack(), SYS_die(), and UI_audioPresetUpdate().

00137                                                {
00138     
00139     char *      title;
00140     char *      playlist;
00141     char *      artist;
00142     char *      album;
00143     char *      genre;
00144     char *      recordings;
00145     char *      pC;
00146     char        emptyRecord[] = {0x8000, DB_RECDLMT};
00147     //char *    record[6] = { title, playlist, artist, album, genre, recordings };
00148     char *      record[6];
00149     
00150     int         ii;
00151     int         len1, len2;
00152     BOOL        ret;
00153     BOOL        bPlaylistAllocated = TRUE;
00154     BOOL        bArtistAllocated = TRUE;
00155     BOOL        bAlbumAllocated = TRUE;
00156     BOOL        bGenreAllocated = TRUE;
00157     BOOL        bRecordingsAllocated = TRUE;
00158     
00159     UI_assert (pTitle      != NULL      , UI_INSERTAUDIORECORD);
00160     UI_assert (pPath       != NULL      , UI_INSERTAUDIORECORD2);
00161     
00162     /* Construct the primary data entry. */
00163     len1 = strlen(pTitle);
00164     len2 = strlen(pPath);
00165     
00166     ii = ( (len1 + len2)/2 ) + 30;  // 2 extra NULL holder + 15 child DB entry holder.
00167                                     // + 1 record flag + 4 timeLen + 4 size 
00168                                     // + 4 reserved for safe.
00169                                                 
00170     title = (char *)calloc(ii, sizeof(char));
00171     if(NULL == title) SYS_die(UI_INSERTAUDIORECORD3);
00172 
00173     pC = title;
00174     *pC++= 0x8000;      // Record flag.
00175     
00176     pC += GEN_strPack(pC, pTitle, len1);
00177     *pC++ = DB_FLDDLMT; // end of title field.
00178     
00179     *pC++ = 0;
00180     *pC++ = 0;
00181     *pC++ = DB_FLDDLMT; // playlist entry holder.
00182     
00183     *pC++ = 0;
00184     *pC++ = 0;
00185     *pC++ = DB_FLDDLMT; // artist entry holder.
00186 
00187     *pC++ = 0;
00188     *pC++ = 0;
00189     *pC++ = DB_FLDDLMT; // album entry holder.
00190 
00191     *pC++ = 0;
00192     *pC++ = 0;
00193     *pC++ = DB_FLDDLMT; // genre entry holder.
00194 
00195     *pC++ = 0;
00196     *pC++ = 0;
00197     *pC++ = DB_FLDDLMT; // recordings entry holder.
00198     
00199     // Let's handle the special characters.
00200     pC += _processDBchar(timeLen, pC);
00201     pC += _processDBchar(size, pC);
00202 
00203     pC += GEN_strPack(pC, pPath, len2);
00204     
00205     *pC = DB_RECDLMT;
00206     
00207     // Contruct playlist record entry. 
00208     if( (playlist = _constructRecord(pPlaylist)) == NULL ) 
00209     {
00210         playlist = emptyRecord;
00211         bPlaylistAllocated = FALSE;
00212     }
00213 
00214     // Contruct playlist record entry.
00215     if( (artist = _constructRecord(pArtist)) == NULL ) {
00216         
00217         artist = emptyRecord;
00218         bArtistAllocated = FALSE;
00219     }
00220     
00221     // Contruct Album record entry. 
00222     if( (album = _constructRecord(pAlbum)) == NULL ) 
00223     {       
00224         album = emptyRecord;
00225         bAlbumAllocated = FALSE;
00226     }
00227 
00228     // Contruct Genre record entry.
00229     if( (genre = _constructRecord(pGenre)) == NULL ) 
00230     {       
00231         genre = emptyRecord;        
00232         bGenreAllocated = FALSE;
00233     }
00234     
00235     // Contruct recordings record entry. 
00236     if( (recordings = _constructRecord(pRecordings)) == NULL ) 
00237     {       
00238         recordings = emptyRecord;       
00239         bRecordingsAllocated = FALSE;
00240     }
00241     
00242     // Initialize record.
00243     record[0] = title;
00244     record[1] = playlist;
00245     record[2] = artist;
00246     record[3] = album;
00247     record[4] = genre;
00248     record[5] = recordings;
00249 
00250     // Insert to audio DB.
00251     ret = DB_insertRecord(DBnav.audio, (DB_DATA *)record);  
00252     
00253     free(title);
00254     if(bPlaylistAllocated == TRUE) free(playlist);
00255     if(bArtistAllocated == TRUE) free(artist);
00256     if(bAlbumAllocated == TRUE) free(album);
00257     if(bGenreAllocated == TRUE) free(genre);
00258     if(bRecordingsAllocated == TRUE) free(recordings);
00259     
00260     UI_audioPresetUpdate(1);
00261     
00262     return ret;
00263 }

Here is the call graph for this function:

BOOL UI_insertHisiRecord const char *  pTitle,
const char *  pSrc,
const char *  pPath
 

Function inserts a HiSi clip to unidentified HiSi database.

Parameters:
pTitle Title string.
pSrc HiSi source string embedded with hisi source identifier.
pPath HiSi clip full path.
Returns:
TRUE if record successfully inserted, otherwise FALSE.

3 delimiter + 2 reserved for safe.

Definition at line 51 of file UI_insertRecord.c.

References DB_insertRecord(), GEN_strPack(), SYS_die(), and st_DBNAV::unidedhisi.

00054 {   
00055     char *      record;
00056     char *      pC;
00057     int         len1;
00058     int         len2;
00059     int         len3;
00060     int         ii;
00061     BOOL        ret;
00062     
00063     /* Construct the primary data entry. */
00064     len1 = strlen(pTitle);
00065     len2 = strlen(pSrc);
00066     len3 = strlen(pPath);
00067     
00068     // 3 extra NULL holder + 1 record flag + 
00070     ii = ( (len1 + len2 + len3)/2 ) + 9;    
00071 
00072     record = (char *)calloc(ii, sizeof(char));
00073     if(NULL == record) SYS_die(UI_INSERTRECORD);
00074     
00075     pC = record;
00076     
00077     *pC++= 0x8000;      // Record flag.
00078     
00079     pC += GEN_strPack(pC, pTitle, len1);
00080     
00081     *pC++ = DB_FLDDLMT; 
00082     
00083     pC += GEN_strPack(pC, pSrc, len2);
00084 
00085     *pC++ = DB_FLDDLMT; 
00086 
00087     pC += GEN_strPack(pC, pPath, len3);
00088     
00089     *pC = DB_RECDLMT;
00090     
00091     
00092     /* Insert to unidentified HiSi DB. */
00093     ret = DB_insertRecord(DBnav.unidedhisi, (DB_DATA *)&record);    
00094 
00095     free(record);   
00096     
00097     return ret;
00098 }

Here is the call graph for this function:

BOOL UI_interpretAudioRecord st_DBINFO pInfo,
USHORT *  buf,
char *  fname,
char *  artist,
char *  title,
char *  album,
char *  genre,
char *  playlist,
char *  recordings,
ULONG *  pDuration,
ULONG *  pSize
 

Funciton interprets audio DB record and sets up player display controls.

Parameters:
pInfo Audio database info.
buf DB record data buffer.
fname File path name.
artist Artist name.
title Title name.
album Album name
genre Genre name
playlist Playlist name.
recordings Recordings category name.
pDuration Duration in seconds of current audio record.
pSize Size in bytes of current audio track file.
Returns:
TRUE if successfully interpreted, otherwise FALSE.
NOTE: 1) DB field are currently all hard-coded. 2) NULL pointer is checked to support buffer allocation one at a time.

Definition at line 66 of file UI_interpretRecord.c.

References DB_getField(), and GEN_strUnpack().

Referenced by MENU__createDbRecordInfoMenu().

00078 {
00079     
00080     int len;
00081     
00082     // Fetch title.
00083     if(title)
00084     {
00085         if(0 == DB_getField((DB_DATA *)buf, 0, (DB_DATA*)title, pInfo))
00086         {
00087             *title = 0;
00088         }
00089     }
00090     
00091     // Fetch playlist.
00092     if(playlist)
00093     {
00094         if(0 == DB_getField((DB_DATA *)buf, 1, (DB_DATA*)playlist, pInfo))
00095         {
00096             *playlist = 0;
00097         }
00098     }
00099     
00100     // Fetch artist.
00101     if(artist)
00102     {
00103         if(0 == DB_getField((DB_DATA *)buf, 2, (DB_DATA*)artist, pInfo))
00104         {
00105             //*artist = 0;
00106             GEN_readXstr((ULONG)text_unknownArtist, (USHORT*)artist, 16);
00107         }
00108     }
00109         
00110     // Fetch album.
00111     if(album)
00112     {
00113         if(0 == DB_getField((DB_DATA *)buf, 3, (DB_DATA*)album, pInfo))
00114         {
00115             *album = 0;
00116         }
00117     }
00118     
00119     // Fetch genre.
00120     if(genre)
00121     {
00122         if(0 == DB_getField((DB_DATA *)buf, 4, (DB_DATA*)genre, pInfo))
00123         {
00124             *genre = 0;
00125         }
00126     }
00127     
00128     // Fetch recording category.
00129     if(recordings)
00130     {
00131         if(0 == DB_getField((DB_DATA *)buf, 5, (DB_DATA*)recordings, pInfo))
00132         {
00133             *recordings = 0;
00134         }
00135     }
00136 
00137     // Extract time length.
00138     if(pDuration)
00139     {
00140         DB_getField((DB_DATA *)buf, 6, (DB_DATA *)pDuration, pInfo);
00141     }
00142     
00143     // Extract size.
00144     if(pSize)
00145     {
00146         DB_getField((DB_DATA *)buf, 7, (DB_DATA *)pSize, pInfo);
00147     }
00148     
00149     // Extract path info.
00150     if(fname)
00151     {
00152         len = DB_getField((DB_DATA *)buf, AUDIO_PATH_DBFLDIDX, (DB_DATA *)fname, pInfo);
00153         GEN_strUnpack((UINT16*)fname, len);
00154     }
00155     
00156     return TRUE;
00157 }

Here is the call graph for this function:

BOOL UI_interpretFailedHisiRecord st_DBINFO pInfo,
USHORT *  buf,
char *  fname,
char *  artist,
char *  title,
char *  album,
char *  genre,
char *  playlist,
char *  recordings,
ULONG *  pDuration,
ULONG *  pSize
 

Funciton interprets failed HiSi record and sets up player display controls.

Parameters:
pInfo Failed HiSi database info.
buf DB record data buffer.
fname File path name.
artist Artist name.
title Title name.
album Album name
genre Genre name
playlist Playlist name.
recordings Recordings category name.
pDuration Duration in seconds of current audio record.
pSize Size in bytes of current audio track file.
Returns:
TRUE if successfully interpreted, otherwise FALSE.
NOTE: 1) DB field are currently all hard-coded. 2) NULL pointer is checked to support buffer allocation one at a time.

Definition at line 391 of file UI_interpretRecord.c.

References DB_getField(), and GEN_strUnpack().

00402 {
00403     
00404     int             len;
00405 
00406     // Fetch title.
00407     if(title)
00408     {
00409         if(0 == DB_getField((DB_DATA *)buf, 0, (DB_DATA*)title, pInfo))
00410         {
00411             *title = 0;
00412         }
00413     }
00414     
00415     // Fetch artist.
00416     //if(artist)    *artist = 0;
00417     if(artist)  GEN_readXstr((ULONG)text_unIdedArtist, (USHORT*)artist, 16);
00418     // Fetch album.
00419     if(album)   *album = 0;
00420     // Fetch playlist.
00421     if(playlist) *playlist = 0;
00422     // Fetch genre.
00423     if(genre)   *genre = 0;
00424     // Fetch recording category.
00425     if(recordings) *recordings = 0;
00426     
00427     // Extract time length.
00428     if(pDuration)
00429     {
00430         DB_getField((DB_DATA *)buf, 6, (DB_DATA *)pDuration, pInfo);
00431     }
00432     
00433     // Extract size.
00434     if(pSize)
00435     {
00436         DB_getField((DB_DATA *)buf, 7, (DB_DATA *)pSize, pInfo);
00437     }
00438     
00439     // Extract path info.
00440     if(fname)
00441     {
00442         len = DB_getField((DB_DATA *)buf, HISI_PATH_DBFLDIDX, (DB_DATA *)fname, pInfo);
00443         GEN_strUnpack((UINT16*)fname, len);
00444     }
00445     
00446     return TRUE;
00447 }

Here is the call graph for this function:

BOOL UI_interpretIdentifiedHisiRecord st_DBINFO pInfo,
USHORT *  buf,
char *  fname,
char *  artist,
char *  title,
char *  album,
char *  genre,
char *  playlist,
char *  recordings,
ULONG *  pDuration,
ULONG *  pSize
 

Funciton interprets identified HiSi record and sets up player display controls.

Parameters:
pInfo Identified HiSi database info.
buf DB record data buffer.
fname File path name.
artist Artist name.
title Title name.
album Album name
genre Genre name
playlist Playlist name.
recordings Recordings category name.
pDuration Duration in seconds of current audio record.
pSize Size in bytes of current audio track file.
Returns:
TRUE if successfully interpreted, otherwise FALSE.
NOTE: 1) DB field are currently all hard-coded. 2) NULL pointer is checked to support buffer allocation one at a time.

Definition at line 193 of file UI_interpretRecord.c.

References DB_getField(), and GEN_strUnpack().

Referenced by MENU__createDbRecordInfoMenu().

00204 {
00205     
00206     int             len;
00207 
00208     // Fetch title.  0, points to clip name, 5, identified track name.
00209     if(title)
00210     {
00211         if(0 == DB_getField((DB_DATA *)buf, 5, (DB_DATA*)title, pInfo))
00212         {
00213             *title = 0;
00214         }
00215     }
00216     
00217     // Fetch artist.
00218     if(artist)
00219     {
00220         if(0 == DB_getField((DB_DATA *)buf, 2, (DB_DATA*)artist, pInfo))
00221         {
00222             //*artist = 0;
00223             GEN_readXstr((ULONG)text_unknownArtist, (USHORT*)artist, 16);
00224         }
00225     }
00226     
00227     // Fetch album.
00228     if(album)
00229     {
00230         if(0 == DB_getField((DB_DATA *)buf, 3, (DB_DATA*)album, pInfo))
00231         {
00232             *album = 0;
00233         }
00234     }
00235 
00236     // Fetch playlist.
00237     if(playlist) *playlist = 0;
00238     // Fetch genre.
00239     if(genre)   *genre = 0;
00240     // Fetch recording category.
00241     if(recordings) *recordings = 0;
00242     
00243     // Extract time length.
00244     if(pDuration)
00245     {
00246         DB_getField((DB_DATA *)buf, 6, (DB_DATA *)pDuration, pInfo);
00247     }
00248     
00249     // Extract size.
00250     if(pSize)
00251     {
00252         DB_getField((DB_DATA *)buf, 7, (DB_DATA *)pSize, pInfo);
00253     }
00254     
00255     // Extract path info.
00256     if(fname)
00257     {
00258         len = DB_getField((DB_DATA *)buf, AUDIO_PATH_DBFLDIDX, (DB_DATA *)fname, pInfo);
00259         GEN_strUnpack((UINT16*)fname, len);
00260     }
00261     
00262     return TRUE;
00263 }

Here is the call graph for this function:

BOOL UI_interpretUnidentifiedHisiRecord st_DBINFO pInfo,
USHORT *  buf,
char *  fname,
char *  artist,
char *  title,
char *  album,
char *  genre,
char *  playlist,
char *  recordings,
ULONG *  pDuration,
ULONG *  pSize
 

Funciton interprets unidentified HiSi record and sets up player display controls.

Parameters:
pInfo Unidentified HiSi database info.
buf DB record data buffer.
fname File path name.
artist Artist name.
title Title name.
album Album name
genre Genre name
playlist Playlist name.
recordings Recordings category name.
pDuration Duration in seconds of current audio record.
pSize Size in bytes of current audio track file.
Returns:
TRUE if successfully interpreted, otherwise FALSE.
NOTE: 1) DB field are currently all hard-coded. 2) NULL pointer is checked to support buffer allocation one at a time.

Definition at line 299 of file UI_interpretRecord.c.

References DB_getField(), and GEN_strUnpack().

00310 {
00311     
00312     int             len;
00313 
00314     // Fetch title.
00315     if(title)
00316     {
00317         if(0 == DB_getField((DB_DATA *)buf, 0, (DB_DATA*)title, pInfo))
00318         {
00319             *title = 0;
00320         }
00321     }
00322     
00323     // Fetch artist.
00324     //if(artist)    *artist = 0;
00325     if(artist)  GEN_readXstr((ULONG)text_toBeIdedArtist, (USHORT*)artist, 16);
00326     // Fetch album.
00327     if(album)   *album = 0;
00328     // Fetch playlist.
00329     if(playlist) *playlist = 0;
00330     // Fetch genre.
00331     if(genre)   *genre = 0;
00332     // Fetch recording category.
00333     if(recordings) *recordings = 0;
00334     
00335     // Extract time length.
00336     if(pDuration)
00337     {
00338         DB_getField((DB_DATA *)buf, 6, (DB_DATA *)pDuration, pInfo);
00339     }
00340     
00341     // Extract size.
00342     if(pSize)
00343     {
00344         DB_getField((DB_DATA *)buf, 7, (DB_DATA *)pSize, pInfo);
00345     }
00346     
00347     // Extract path info.
00348     if(fname)
00349     {
00350         len = DB_getField((DB_DATA *)buf, HISI_PATH_DBFLDIDX, (DB_DATA *)fname, pInfo);
00351         GEN_strUnpack((UINT16*)fname, len);
00352     }
00353     
00354     return TRUE;
00355 }

Here is the call graph for this function:

int UI_isPresetStation USHORT  station  ) 
 

Function checks if specified FM radio station is a preset station or not.

If true, funciton returns the preset index.

Parameters:
station FM channel in 100KHz.
Returns:
preset index starting from 1. -1 indicates station is not a valid preset one.

Definition at line 80 of file UI_presetMgmt.c.

References st_NDSYSPARAM::preset, st_PRESET::radio, st_PRESET::share, and st_PRESET::type.

00081 {
00082     int             ii;
00083     st_PRESET *     pPreset;
00084     
00085     pPreset = &nandSysParam.preset[1];
00086     
00087     for( ii = 1; ii <= MAX_PRESET; ii++)
00088     {       
00089         if(pPreset->type == PRESET_RADIO)
00090         {       
00091             if(pPreset->share.radio.station == station) return ii;              
00092         }
00093         pPreset++;      
00094     }
00095     return -1;
00096 }

BOOL UI_isPresetValid int  presetIdx  ) 
 

Function checks to see if there is a valid preset corresponding to specific preset index.

Function also marks corresponding preset to be invalid if it detects a corrupted one.

Parameters:
presetIdx preset index starting from 1.
Returns:
TRUE if a valid preset is detected.

Definition at line 53 of file UI_presetMgmt.c.

References st_PRESET::chksum, GEN_checksum(), st_NDSYSPARAM::preset, and st_PRESET::type.

Referenced by MENU__createPresetMenu(), SYS_SF_idle(), UI_SF_dbmenu(), and UI_SF_menu().

00054 {
00055     st_PRESET * pPreset = &nandSysParam.preset[presetIdx];
00056     
00057     if(pPreset->type < PRESET_Invalid) 
00058     {
00059         if(pPreset->chksum == GEN_checksum((USHORT*)pPreset, 7))
00060         {
00061             return TRUE;
00062         }
00063     }
00064     pPreset->type = PRESET_Invalid;
00065     return FALSE;
00066 }

Here is the call graph for this function:

void UI_main void   ) 
 

Function serves as user interface task handle.

This task is responsible to handle all menu browsing.

Definition at line 37 of file UI_main.c.

References st_MSG::d1, st_MSG::d2, st_MSG::id, MSG_createQ(), SSTATE_END, SSTATE_END_ACK, STATE, and UI_SF_powerup().

Referenced by SYS_createResidentTask().

00038 {   
00039     st_MSG      msgIN;
00040     st_MSG      msgOUT;
00041     MSG_ID      id;
00042     MSG_DATA    d1;
00043     MSG_DATA    d2;
00044     STATE       curstate = S_NULL;
00045     STATE       oldstate = S_NULL;
00046     SFHDL       SFHDL_TABLE[] = 
00047                 {           
00048                     UI_SF_null,
00049                     UI_SF_menu,
00050                     UI_SF_autoscan,
00051                     UI_SF_dbmenu,
00052                     UI_SF_powerup
00053                 };
00054 
00055     uiMsgQ = MSG_createQ(UI_MSG_Q_LENGTH);
00056     
00057     while(1)
00058     {
00059         mMSG_get(uiMsgQ, &msgIN, SYS_FOREVER);
00060         id = msgIN.id;     
00061         d1 = msgIN.d1; 
00062         d2 = msgIN.d2;
00063 
00064         curstate = UI_getSFhdl(oldstate)(&msgIN);
00065         while(curstate != oldstate) 
00066         {
00067             oldstate = curstate;
00068             _loadCurStateCode(curstate);
00069             
00070             msgOUT.id = SYS_MSG_ID;
00071             msgOUT.d1 = SSTATE_START;
00072             // msgIN.d2 is carried over here.
00073             msgOUT.d2 = msgIN.d2;
00074 
00075             curstate = UI_getSFhdl(oldstate)(&msgOUT);
00076         }   
00077     
00078         // Report to system the following message status.
00079         if( (SYS_MSG_ID == id)&&(SSTATE_END == d1) )
00080         {
00081             mMSG_send(sysMsgQ, SYS_MSG_ID, SSTATE_END_ACK, DONTCARE, SYS_FOREVER);
00082         }
00083             
00084         UI_stackassert(UI_MAIN);
00085     }
00086 }

Here is the call graph for this function:

void UI_menuBrowse MSG_DATA  msgD1,
MSG_DATA  msgD2,
MENU_STATE  menu
 

Function kicks off the generic menu browsing.

Menu system maintains its own history and returns the specified system message when browsing to where it was started.

NOTE: 1) It is the caller's responsibility to make sure request is NOT cascaded, in other words, do not send another browse request before current request reaches its root. 2) This API can NOT be called from UI task, it can be called from parent UI, child UI, system etc.

Parameters:
msgD1 Returning system message data1.
msgD2 Returning system message data2
menu Browsing menu ID.

Definition at line 49 of file UI_browse.c.

References SMENUBROWSE.

Referenced by SYS_kickoff().

00050 {   
00051     static UINT mbREQUEST[3];
00052     UINT *      pD = &mbREQUEST[0];
00053     *pD++ = (UINT)msgD2;
00054     *pD++ = (UINT)msgD1;
00055     *pD++ = (UINT)menu;
00056     mMSG_send(uiMsgQ, SYS_MSG_ID, SMENUBROWSE, (int)&mbREQUEST[0], SYS_FOREVER);
00057 }

STATE UI_MSF_audio st_MSG msgIN  ) 
 

Function serves as the audio db menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 41 of file UI_MSF_audio.c.

00042 {
00043     return S_MENU_STAY;
00044 }

STATE UI_MSF_autoff st_MSG msgIN  ) 
 

Function serves as the auto off menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 38 of file UI_MSF_autoff.c.

References st_SYSPARAM::autoOffTime, SYS_autoffDisable(), and SYS_autoffEnable().

00039 {
00040     MSG_ID          id = msgIN->id;     
00041     MSG_DATA        d1 = msgIN->d1; 
00042 
00043     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00044     {
00045         if(sysParam.autoOffTime == 1)   SYS_autoffDisable();
00046         else if(!SYS_isPlayActive())    SYS_autoffEnable();
00047     }
00048     
00049     return S_MENU_STAY;
00050 }

Here is the call graph for this function:

STATE UI_MSF_backlight st_MSG msgIN  ) 
 

Function serves as the backlight menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 41 of file UI_MSF_backlight.c.

References st_SYSPARAM::backlight, KBD_LED, LED_OFF, LED_ON, SYS_onOffLEDs(), TMR_BACKLIGHT, TMR_create(), TMR_delete(), and st_SYSPARAM::x_backlight.

00042 {
00043     MSG_ID          id = msgIN->id;     
00044     MSG_DATA        d1 = msgIN->d1; 
00045 
00046     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00047     {
00048         // Check to apply backlight control.
00049         if(!( (SYS_isPowerPlugged()) && (sysParam.x_backlight == XTRA_OFF) ))
00050 //      if(!SYS_isPowerPlugged())
00051         {
00052             if(sysParam.backlight != 1)
00053             {
00054                 ULONG backlite[2] = {500, 1500};
00055                 SYS_onOffLEDs(KBD_LED, LED_ON);
00056                 TMR_create(TMR_BACKLIGHT, backlite[sysParam.backlight-2], 
00057                             TBACKLIGHTOFF, 0, NO_RELOAD);
00058             }
00059             else 
00060             {
00061                 TMR_delete(TMR_BACKLIGHT);
00062                 SYS_onOffLEDs(KBD_LED, LED_OFF);
00063             }
00064         }
00065         else 
00066         {
00067             TMR_delete(TMR_BACKLIGHT);
00068             SYS_onOffLEDs(KBD_LED, LED_ON);
00069 //          if(sysParam.backlight != 1) SYS_onOffLEDs(KBD_LED, LED_ON);
00070 //          else SYS_onOffLEDs(KBD_LED, LED_OFF);
00071         }
00072     }
00073     
00074     return S_MENU_STAY;
00075 }

Here is the call graph for this function:

STATE UI_MSF_bkpkSwap st_MSG msgIN  ) 
 

Function serves as the backpack swap menu handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 40 of file UI_MSF_bkpkSwap.c.

References BTN_NULL, BTN_YES, SMSGBOX_EXIT, SYS_createDiskDbTask(), SYS_deleteDiskDbTask(), and UI_msgbxCreate().

00041 {
00042     MSG_ID          id = msgIN->id;     
00043     MSG_DATA        d1 = msgIN->d1; 
00044     MSG_DATA        d2 = msgIN->d2; 
00045 
00046     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00047     {
00048         switch(actvItem)
00049         {               
00050             case 1: // Controls.
00051                 GEN_pushStack(MENU_BKPKSWAP);
00052                 GEN_pushStack(MENU_BKPKSWAPCTLS);
00053                 return S_MENU;
00054             
00055             case 2: // Restore flash.
00056                 if( (SYS_isHDDpresent())&&(!(SYS_isNandRestoreFailed())) )
00057                 {
00058                     // Wait till disk/DB is ready.
00059                     if(FALSE == SYS_deleteDiskDbTask(0)) 
00060                         UI_msgbxCreate(MSGBX_SYSBUSY);
00061                     else
00062                         UI_msgbxCreate(MSGBX_NANDRESTOREQUERY);                 
00063                 }
00064                 break;
00065         }   
00066     }
00067     else if( (SYS_MSG_ID == id)&&(SMSGBOX_EXIT == d1) )
00068     {
00069         if( (BTN_YES == d2)&&(MENU_curMsgbx() == MSGBX_NANDRESTOREQUERY) )
00070         {
00071             UI_msgbxCreate(MSGBX_NANDRESTOREWAIT);
00072             SYS_createDiskDbTask(DDT_RESTORENAND);
00073         }
00074         else if( (BTN_NULL == d2)&&(MENU_curMsgbx() == MSGBX_NANDRESTOREWAIT) )
00075         {
00076             if(FALSE == SYS_deleteDiskDbTask(0)) 
00077             {
00078                 UI_msgbxCreate(MSGBX_NANDRESTOREWAIT);
00079             }
00080             else
00081             {
00082                 if(SYS_isNandRestoreFailed())
00083                 {
00084                     UI_msgbxCreate(MSGBX_NONANDBAKFILE);
00085                     if(SYS_isSyncDbNeeded())
00086                     {
00087                         MENU_voidMsgbx();
00088                         SYS_deleteDiskDbTask(SYS_FOREVER);
00089                         SYS_createDiskDbTask(DDT_SYNCDB);
00090                     }
00091                 }
00092                 else
00093                 {
00094                     mMSG_send(sysMsgQ, KBD_MSG_ID, KEY_HPLAY, DONTCARE, SYS_FOREVER);
00095                 }
00096             }
00097         }
00098     }   
00099     
00100     return S_MENU_STAY;
00101 }

Here is the call graph for this function:

STATE UI_MSF_diag_hdd st_MSG msgIN  ) 
 

Function serves as the hard drive diagnosis menu handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 40 of file UI_MSF_diag_hdd.c.

References BTN_NULL, BTN_YES, SMSGBOX_EXIT, SYS_createDiskDbTask(), SYS_deleteDiskDbTask(), and UI_msgbxCreate().

00041 {
00042     MSG_ID          id = msgIN->id;     
00043     MSG_DATA        d1 = msgIN->d1; 
00044     MSG_DATA        d2 = msgIN->d2; 
00045     
00046     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00047     {
00048         switch(actvItem)
00049         {               
00050             case 1: // format.
00051             case 2: // media format
00052                 UI_msgbxCreate(MSGBX_DIAG_FORMATDISK);
00053                 break;
00054         }   
00055     }   
00056     else if((SYS_MSG_ID == id)&&(SMSGBOX_EXIT == d1))
00057     {
00058         if(BTN_YES == d2)
00059         {
00060             UI_msgbxCreate(MSGBX_DIAG_FORMATWAIT);
00061             switch(actvItem)
00062             {               
00063                 case 2: // media format
00064                     SYS_forceMediaFormat();
00065                 case 1: // format.
00066                     SYS_createDiskDbTask(DDT_DIAG_FORMATHDD);
00067                     break;                  
00068             }
00069         }
00070         else if(BTN_NULL == d2)
00071         {
00072             if(MENU_curMsgbx() == MSGBX_DIAG_FORMATWAIT)
00073             {
00074                 if(FALSE == SYS_deleteDiskDbTask(0))
00075                     UI_msgbxCreate(MSGBX_DIAG_FORMATWAIT);
00076             }
00077         }
00078     }
00079     
00080     return S_MENU_STAY;
00081 }

Here is the call graph for this function:

STATE UI_MSF_diag_nand st_MSG msgIN  ) 
 

Function serves as the NAND diagnosis menu handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 40 of file UI_MSF_diag_nand.c.

References BTN_NULL, BTN_YES, SMSGBOX_EXIT, SYS_createDiskDbTask(), SYS_deleteDiskDbTask(), and UI_msgbxCreate().

00041 {
00042     MSG_ID          id = msgIN->id;     
00043     MSG_DATA        d1 = msgIN->d1; 
00044     MSG_DATA        d2 = msgIN->d2; 
00045     
00046     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00047     {
00048         switch(actvItem)
00049         {               
00050             case 1: // format.
00051             case 2: // revive.
00052                 UI_msgbxCreate(MSGBX_DIAG_FORMATDISK);
00053                 break;
00054         }   
00055     }   
00056     else if((SYS_MSG_ID == id)&&(SMSGBOX_EXIT == d1))
00057     {
00058         if(BTN_YES == d2)
00059         {
00060             UI_msgbxCreate(MSGBX_DIAG_FORMATWAIT);
00061             
00062             switch(actvItem)
00063             {               
00064                 case 1: // format.
00065                     SYS_createDiskDbTask(DDT_DIAG_FORMATNAND);                  
00066                     break;                  
00067                 case 2: // revive.
00068                     SYS_createDiskDbTask(DDT_DIAG_REVIVENAND);
00069                     break;
00070             }
00071         }
00072         else if(BTN_NULL == d2)
00073         {
00074             if(MENU_curMsgbx() == MSGBX_DIAG_FORMATWAIT)
00075             {
00076                 if(FALSE == SYS_deleteDiskDbTask(0))
00077                     UI_msgbxCreate(MSGBX_DIAG_FORMATWAIT);
00078             }
00079         }
00080     }
00081     
00082     return S_MENU_STAY;
00083 }

Here is the call graph for this function:

STATE UI_MSF_diagnosis st_MSG msgIN  ) 
 

Function serves as the diagnosis menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 41 of file UI_MSF_diagnosis.c.

References BOOT_MAIN.

00042 {
00043     MSG_ID          id = msgIN->id;     
00044     MSG_DATA        d1 = msgIN->d1; 
00045 
00046     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00047     {
00048         switch(actvItem)
00049         {               
00050             case 1: // nand
00051                 GEN_pushStack(MENU_DIAGNOSIS);
00052                 GEN_pushStack(MENU_DIAG_NAND);  
00053                 return S_MENU;
00054                 
00055             case 2: // hdd
00056                 if(SYS_isHDDpresent())
00057                 {
00058                     GEN_pushStack(MENU_DIAGNOSIS);
00059                     GEN_pushStack(MENU_DIAG_HDD);   
00060                     return S_MENU;
00061                 }
00062                 break;
00063                 
00064             case 3: // Exit
00065                 SYS_reboot(BOOT_MAIN);
00066         }   
00067     }
00068     
00069     return S_MENU_STAY;
00070 }

STATE UI_MSF_dj st_MSG msgIN  ) 
 

Function serves as the DJ selection menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 41 of file UI_MSF_dj.c.

00042 {
00043     return S_MENU_STAY;
00044 }

STATE UI_MSF_eq st_MSG msgIN  ) 
 

Function serves as the EQ selection menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 43 of file UI_MSF_eq.c.

References AUDIO_setEQ(), st_EQ::curEqIdx, st_NDSYSPARAM::eq, st_EQ::eqBands, and SYS_loadDefaultEq().

00044 {
00045     MSG_ID          id = msgIN->id;     
00046     MSG_DATA        d1 = msgIN->d1; 
00047 
00048     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00049     {
00050         if(1 == nandSysParam.eq.curEqIdx )
00051         {
00052             // Off
00053             if(SYS_isAudioActive())
00054             {
00055                 AUDIO_setEQ(NULL);
00056             }           
00057         }
00058         else if(8 == nandSysParam.eq.curEqIdx)
00059         {
00060             GEN_pushStack(MENU_EQ);
00061             hiliteItem = 0;
00062             SYS_loadDefaultEq();
00063             
00064             if(SYS_isAudioActive())
00065             {
00066                 AUDIO_setEQ(nandSysParam.eq.eqBands[nandSysParam.eq.curEqIdx-2]);   
00067             }
00068             return S_MENU;          
00069         }
00070         else
00071         {
00072             GEN_pushStack(MENU_EQ);
00073             GEN_pushStack(MENU_SETEQ);
00074             
00075             if(SYS_isAudioActive())
00076             {
00077                 AUDIO_setEQ(nandSysParam.eq.eqBands[nandSysParam.eq.curEqIdx-2]);   
00078             }
00079             
00080             return S_MENU;
00081         }
00082     }   
00083     return S_MENU_STAY;
00084 }

Here is the call graph for this function:

STATE UI_MSF_goup st_MSG msgIN  ) 
 

Function serves as the special go-up menu handle, returns the menu by one level up.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 212 of file UI_globals.c.

00212 {return S_MENU;}

STATE UI_MSF_hisi st_MSG msgIN  ) 
 

Function serves as the hisi setup menu handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 39 of file UI_MSF_hisi.c.

References st_DBNAV::failedhisi, st_DBNAV::idedhisi, SYS_deleteDiskDbTask(), UI_msgbxCreate(), and st_DBNAV::unidedhisi.

00040 {
00041     MSG_ID          id = msgIN->id;     
00042     MSG_DATA        d1 = msgIN->d1; 
00043     MSG_DATA        d2 = msgIN->d2; 
00044     DB_ID dbID;
00045     
00046     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00047     {
00048         // Wait till disk/DB is ready.
00049         if(FALSE == SYS_deleteDiskDbTask(0)) 
00050         {
00051             UI_msgbxCreate(MSGBX_SYSBUSY);
00052         }
00053         else
00054         {
00055             GEN_pushStack(MENU_HISI);
00056             switch(actvItem)
00057             {               
00058                 case 1: // ided.
00059                     dbID = DBnav.idedhisi;      break;
00060                 case 2: // unided.
00061                     dbID = DBnav.unidedhisi;    break;
00062                 case 3: // failed.
00063                     dbID = DBnav.failedhisi;    break;
00064             }   
00065     
00066             GEN_pushStack(S_MENU);
00067             GEN_pushStack(DB_INVALID_ID);
00068                 
00069             GEN_pushStack(1); // actvItem
00070             GEN_pushStack(0); // fldEntry
00071             GEN_pushStack(-1); // fldIdx
00072             GEN_pushStack(dbID);
00073                         
00074             return S_DBMENU;
00075         }
00076     }   
00077     
00078     return S_MENU_STAY;
00079 }

Here is the call graph for this function:

STATE UI_MSF_main st_MSG msgIN  ) 
 

Function serves as the main menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 52 of file UI_MSF_main.c.

References st_DBNAV::audio, KBD_isKeyDown(), KREWIND, st_DBNAV::pcaudio, SPOWERUP, SSTARTRADIO, SYS_deleteDiskDbTask(), UI_m3uEntryNum(), and UI_msgbxCreate().

00053 {
00054     MSG_ID          id = msgIN->id;     
00055     MSG_DATA        d1 = msgIN->d1; 
00056     MSG_DATA        d2 = msgIN->d2;
00057     USHORT          ii;
00058 
00059     if( (SYS_MSG_ID == id)&&(SPOWERUP == d1) )
00060     {
00061         GEN_pushStack(MENU_MAIN);
00062         return S_POWERUP;
00063     }
00064     else if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00065     {
00066         
00067         switch(actvItem)
00068         {
00069             case 4+_Q: // PC audio collection  
00070             #ifdef SP_SUPPORT
00071             {
00072                 if(FALSE == SYS_deleteDiskDbTask(0)) 
00073                 {
00074                     UI_msgbxCreate(MSGBX_SYSBUSY);
00075                     break;
00076                 }
00077                 GEN_pushStack(MENU_MAIN);               
00078                 GEN_pushStack(MENU_AUDIO);  return S_MENU;
00079             }           
00080             #endif
00081             case 1: // Audio. 
00082             {
00083                 DB_ID dbID;                                 
00084                 // Wait till disk/DB is ready.
00085                 if(FALSE == SYS_deleteDiskDbTask(0)) 
00086                 {
00087                     UI_msgbxCreate(MSGBX_SYSBUSY);
00088                     break;
00089                 }
00090                 
00091                 dbID = (actvItem == 1)? DBnav.audio:DBnav.pcaudio;
00092                 
00093                 GEN_pushStack(MENU_MAIN);               
00094                 GEN_pushStack(S_MENU);
00095                 GEN_pushStack(DB_INVALID_ID);
00096                 
00097                 GEN_pushStack(1); // dbEntry
00098                 GEN_pushStack(0); // fldEntry
00099                 GEN_pushStack(-1);// fldIdx
00100                 GEN_pushStack(dbID);
00101                 return S_DBMENU;
00102             }   
00103             case 2+_Q: // FM Radio.
00104             {
00105                 // Will eventually return to current menu.              
00106                 GEN_pushStack(MENU_MAIN);
00107                 GEN_pushStack(S_MENU);
00108                 
00109                 // This simply yields, don't send messages.
00110                 GEN_pushStack(DONTCARE);
00111                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SSTARTRADIO, DONTCARE, SYS_FOREVER);    
00112                 
00113                 if(KBD_isKeyDown(KREWIND)) SYS_HF_linkitEnable();           
00114                 return S_NULL;
00115             }
00116             case 3+_Q: // HiSi.
00117                 GEN_pushStack(MENU_MAIN);
00118                 GEN_pushStack(MENU_HISI);       return S_MENU;
00119             case 5+_Q: // Settings.                     
00120                 GEN_pushStack(MENU_MAIN);               
00121                 GEN_pushStack(MENU_SETTINGS);   return S_MENU;
00122                 
00123             #ifdef M3U_SUPPORT
00124             case 2: // Play Queue
00125                 // Wait till disk/DB is ready.
00126                 if(FALSE == SYS_deleteDiskDbTask(0)) 
00127                 {
00128                     UI_msgbxCreate(MSGBX_SYSBUSY);
00129                     break;
00130                 }
00131                 
00132                 if(0 == UI_m3uEntryNum(0))
00133                 {
00134                     UI_msgbxCreate(MSGBX_EMPTYQ);
00135                     break;
00136                 }
00137                 else
00138                 {
00139                     GEN_pushStack(MENU_MAIN);
00140                     GEN_pushStack(MENU_PLAYQ);  return S_MENU;
00141                 }
00142             #endif
00143             //case 6: // Now playing.
00144         }
00145     }
00146 
00147     return S_MENU_STAY;
00148 }

Here is the call graph for this function:

STATE UI_MSF_myfi st_MSG msgIN  ) 
 

Function serves as the myfi setup menu handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 42 of file UI_MSF_myfi.c.

References st_SYSPARAM::myfiMode, st_SYSPARAM::myfiQuality, and UI_msgbxCreate().

00043 {
00044     MSG_ID          id = msgIN->id;     
00045     MSG_DATA        d1 = msgIN->d1; 
00046     MSG_DATA        d2 = msgIN->d2; 
00047 
00048     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00049     {
00050         GEN_pushStack(MENU_MYFI);
00051         switch(actvItem)
00052         {               
00053             case 1: /* mode. */
00054                 oldMyfiMode = sysParam.myfiMode;
00055                 GEN_pushStack(MENU_MYFI_MODE);
00056                 return S_MENU;
00057             
00058             case 2: /* myfi quality. */
00059                 oldMyfiQuality = sysParam.myfiQuality;
00060                 GEN_pushStack(MENU_MYFI_QUALITY);
00061                 return S_MENU;
00062                 
00063             case 3: /* myfi gain. */
00064                 GEN_pushStack(MENU_MYFI_GAIN);
00065                 return S_MENU;
00066                 
00067             case 4: /* Auto scan. */            
00068                 if(SYS_isHPpresent()) return S_AUTOSCAN;
00069                 else 
00070                 {
00071                     UI_msgbxCreate(MSGBX_HEADPHONEPLUG);
00072                     GEN_popStack();
00073                 }
00074                 break;
00075         }   
00076     }
00077     
00078     return S_MENU_STAY;
00079 }

Here is the call graph for this function:

STATE UI_MSF_myfiMode st_MSG msgIN  ) 
 

Function serves as the myfi mode setup menu handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 90 of file UI_MSF_myfi.c.

References st_SYSPARAM::myfiMode, and SMIFIMODECHANGED.

00091 {
00092     MSG_ID          id = msgIN->id;     
00093     MSG_DATA        d1 = msgIN->d1; 
00094     
00095     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00096     {
00097         if( (SYS_isPlayActive())&&(oldMyfiMode != sysParam.myfiMode) )
00098         {
00099             oldMyfiMode = sysParam.myfiMode;
00100             mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMIFIMODECHANGED, DONTCARE, SYS_FOREVER);               
00101         }
00102     }
00103     
00104     return S_MENU_STAY;
00105 }

STATE UI_MSF_myfiQuality st_MSG msgIN  ) 
 

Function serves as the myfi quality setup menu handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 116 of file UI_MSF_myfi.c.

References st_SYSPARAM::myfiQuality, and SMIFIQUALITYCHANGED.

00117 {
00118     MSG_ID          id = msgIN->id;     
00119     MSG_DATA        d1 = msgIN->d1; 
00120     
00121     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00122     {
00123         if( (SYS_isPlayActive())&&(oldMyfiQuality != sysParam.myfiQuality) )
00124         {
00125             oldMyfiQuality = sysParam.myfiQuality;
00126             mMSG_send(uiParentMsgQ, SYS_MSG_ID, SMIFIQUALITYCHANGED, DONTCARE, SYS_FOREVER);                
00127         }
00128     }
00129     
00130     return S_MENU_STAY;
00131 }

STATE UI_MSF_playQueue st_MSG msgIN  ) 
 

Function serves as the play queue selection menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 44 of file UI_MSF_playQueue.c.

References BTN_YES, SMSGBOX_EXIT, SPLAYQCHANGED, SXIM_CREATE, SXIM_EXIT, UI_m3uActvItem(), UI_m3uClear(), UI_m3uEntryNum(), and UI_m3uRemove().

00045 {
00046     MSG_ID          id = msgIN->id;     
00047     MSG_DATA        d1 = msgIN->d1; 
00048     MSG_DATA        d2 = msgIN->d2;
00049     USHORT          ii;
00050 
00051     if( (SYS_MSG_ID == id)&&(SXIM_EXIT == d1) )
00052     {
00053         return(_ximAction(d2));
00054     }
00055     else if( (SYS_MSG_ID == id)&&(SMSGBOX_EXIT == d1) )
00056     {
00057         switch(MENU_curMsgbx())
00058         {
00059             case MSGBX_REMOVEQALL:
00060             {
00061                 if(BTN_YES == d2)
00062                 {
00063                     UI_m3uClear(0);
00064                     if( SYS_isPlayActive() )
00065                     {
00066                         mMSG_send(uiParentMsgQ, SYS_MSG_ID, SPLAYQCHANGED, 2, SYS_FOREVER);
00067                     }
00068                     return S_MENU;
00069                 }
00070                 break;
00071             }
00072             case MSGBX_REMOVEQRECORD:
00073             {
00074                 if(BTN_YES == d2)
00075                 {
00076                     UI_m3uRemove(0, UI_m3uActvItem(0));
00077                     if(UI_m3uEntryNum(0)) GEN_pushStack(MENU_PLAYQ);
00078                     if( SYS_isPlayActive() )
00079                     {
00080                         mMSG_send(uiParentMsgQ, SYS_MSG_ID, SPLAYQCHANGED, 1, SYS_FOREVER);
00081                     }                   
00082                     return S_MENU;
00083                 }
00084                 break;
00085             }
00086         }
00087     }
00088     else if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00089     {
00090         mMSG_send(uiChildMsgQ, SYS_MSG_ID, SXIM_CREATE, XIMWIN_PLAYQ, SYS_FOREVER);
00091     }
00092     return S_MENU_STAY;
00093 }

Here is the call graph for this function:

STATE UI_MSF_repeat st_MSG msgIN  ) 
 

Function serves as the repeat menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 38 of file UI_MSF_repeat.c.

References SREPEATCHANGED.

00039 {
00040     MSG_ID          id = msgIN->id;     
00041     MSG_DATA        d1 = msgIN->d1; 
00042 
00043     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00044     {
00045         if(SYS_isPlayActive())
00046         {
00047             mMSG_send(uiParentMsgQ, SYS_MSG_ID, SREPEATCHANGED, DONTCARE, SYS_FOREVER); 
00048         }
00049     }   
00050     return S_MENU_STAY;
00051 }

STATE UI_MSF_settings st_MSG msgIN  ) 
 

Function serves as the settings menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 39 of file UI_MSF_settings.c.

References BTN_YES, SMSGBOX_EXIT, SYS_defaultParams(), and UI_msgbxCreate().

00040 {
00041     MSG_ID          id = msgIN->id;     
00042     MSG_DATA        d1 = msgIN->d1; 
00043     MSG_DATA        d2 = msgIN->d2;
00044 
00045     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00046     {   
00047         GEN_pushStack(MENU_SETTINGS);           
00048         switch(actvItem){
00049                     
00050             case 1: // Auto OFF.
00051                 GEN_pushStack(MENU_AUTOFF);         return S_MENU;          
00052             case 2: // FM out
00053                 GEN_pushStack(MENU_MYFI);           return S_MENU;
00054             case 3: // Shuffle. 
00055                 GEN_pushStack(MENU_SHUFFLE);        return S_MENU;
00056             case 4: // Repeat.
00057                 GEN_pushStack(MENU_REPEAT);         return S_MENU;
00058             case 5: // EQ
00059                 GEN_pushStack(MENU_EQ);             return S_MENU;                      
00060             case 6: // Backpack Swap.
00061                 GEN_pushStack(MENU_BKPKSWAP);       return S_MENU;
00062             case 7: // Presets.
00063                 GEN_pushStack(MENU_PRESETREVIEW);   return S_MENU;
00064             case 8: // Backlight.
00065                 GEN_pushStack(MENU_BACKLIGHT);      return S_MENU;
00066             case 9: // Contrast.
00067                 GEN_pushStack(MENU_CONTRAST);       return S_MENU;
00068             case 10: // Synclog.
00069                 GEN_pushStack(MENU_SYNCLOG);        return S_MENU;
00070             case 11: // Record quality.
00071                 GEN_pushStack(MENU_RECORDQUALITY);  return S_MENU;
00072             case 12: // Date time
00073                 GEN_pushStack(MENU_DATETIME);       return S_MENU;
00074             case 13: // Restore default
00075                 UI_msgbxCreate(MSGBX_RESTOREDEFAULT);
00076                 break;
00077             case 14: // Properties.
00078                 GEN_pushStack(MENU_PROPERTIES);     return S_MENU;
00079 //DeepB
00080             case 15: // Xtra.
00081                 GEN_pushStack(MENU_XTRA);           return S_MENU;
00082         }
00083         GEN_popStack(); 
00084     }
00085     else if((SYS_MSG_ID == id)&&(SMSGBOX_EXIT == d1))
00086     {
00087         if(MENU_curMsgbx() == MSGBX_RESTOREDEFAULT)
00088         {
00089             if(BTN_YES == d2)
00090             {
00091                 SYS_defaultParams();
00092             }
00093         }
00094     }
00095     
00096     return S_MENU_STAY;
00097 }

Here is the call graph for this function:

STATE UI_MSF_shuffle st_MSG msgIN  ) 
 

Function serves as the shuffle menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 41 of file UI_MSF_shuffle.c.

References st_SYSPARAM::shuffle, and SSHUFFLECHANGED.

00042 {
00043     MSG_ID          id = msgIN->id;     
00044     MSG_DATA        d1 = msgIN->d1; 
00045 
00046     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00047     {
00048         if(SYS_isPlayActive())
00049         {
00050             if(oldShuffleMode != sysParam.shuffle)
00051             {
00052                 oldShuffleMode = sysParam.shuffle;
00053                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SSHUFFLECHANGED, DONTCARE, SYS_FOREVER);            
00054             }
00055         }
00056     }   
00057     return S_MENU_STAY;
00058 }

STATE UI_MSF_stay st_MSG msgIN  ) 
 

Function serves as the special stay menu handle, stays in current menu.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 223 of file UI_globals.c.

00223 {return S_MENU_STAY;}

STATE UI_MSF_xtra st_MSG msgIN  ) 
 

Function serves as the xtra menu state handle.

Parameters:
msgIN Input message from UI.
Returns:
Next UI state.

Definition at line 63 of file UI_MSF_xtra.c.

References UI_msgbxCreate().

00064 {
00065     MSG_ID          id = msgIN->id;     
00066     MSG_DATA        d1 = msgIN->d1; 
00067     MSG_DATA        d2 = msgIN->d2;
00068 
00069     if( (KBD_MSG_ID == id)&&(KEY_SELECT == d1) )
00070     {   
00071         GEN_pushStack(MENU_XTRA);           
00072         switch(actvItem){
00073                     
00074             case 1: // Layout 
00075 // Not Implemented warning
00076 //              UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00077 //              break;
00078                 GEN_pushStack(MENU_XTRA_LAYOUT);        return S_MENU;
00079             case 2: // Mute button.
00080 // Not Implemented warning
00081 //              UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00082 //              break;
00083                 GEN_pushStack(MENU_XTRA_MUTE);          return S_MENU;          
00084             case 3: // Hisi
00085 // Not Implemented warning
00086 //              UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00087 //              break;
00088                 GEN_pushStack(MENU_XTRA_HISI);          return S_MENU;
00089             case 4: // Backlight
00090 // Not Implemented warning
00091 //              UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00092 //              break;
00093                 GEN_pushStack(MENU_XTRA_BACKLIGHT);     return S_MENU;
00094             case 5: // Frequency Steps
00095 // Not Implemented warning
00096 //              UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00097 //              break;
00098                 GEN_pushStack(MENU_XTRA_GRANULARITY);       return S_MENU;
00099             case 6: // Car Mode
00100 // Not Implemented warning
00101 //              UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00102 //              break;
00103                 GEN_pushStack(MENU_XTRA_CARMODE);       return S_MENU;
00104             case 7: // Scrollwrap
00105 // Not Implemented warning
00106 //              UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00107 //              break;
00108                 GEN_pushStack(MENU_XTRA_SCROLLWRAP);        return S_MENU;
00109             default:
00110 // Not Implemented warning
00111                 UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);
00112                 break;
00113         }
00114         GEN_popStack(); 
00115     }
00116     
00117     return S_MENU_STAY;
00118 }

Here is the call graph for this function:

void UI_msgbxCreate MSGBX_ID  msgbx  ) 
 

Function sends out system message to create a message box menu.

Parameters:
msgbx Message box ID.

Definition at line 38 of file UI_msgbxCreate.c.

References SMSGBOX_CREATE.

Referenced by SYS_SF_idle(), UI_CSF_myfiChannel(), UI_MSF_bkpkSwap(), UI_MSF_diag_hdd(), UI_MSF_diag_nand(), UI_MSF_hisi(), UI_MSF_main(), UI_MSF_myfi(), UI_MSF_settings(), UI_MSF_xtra(), UI_PSF_hisi(), UI_PSF_null(), UI_PSF_play(), UI_PSF_record(), UI_SF_dbmenu(), UI_SF_menu(), and UI_SF_powerup().

00039 {       
00040     mMSG_send(uiChildMsgQ, SYS_MSG_ID, SMSGBOX_CREATE, msgbx, SYSTEM_TICK_SECOND*5);    
00041 }

void UI_parent void   ) 
 

Function serves as user interface parent task handle.

Parent task is responsible to handle macro level states, such as USB, playback, recording, radio etc.

Definition at line 62 of file UI_parent.c.

References st_MSG::d1, st_MSG::d2, st_MSG::id, MSG_createQ(), PARENT_STATE, SPOWERUP_SEQUENCEDONE, SSTART2HISI, SSTATE_END, SSTATE_END_ACK, SYS_autoffEnable(), SYS_deleteDiskDbTask(), UI_m3uInit(), UI_PSF_hisidone(), and USB_isCablePlugged().

Referenced by SYS_createResidentTask().

00063 {   
00064     st_MSG          msgIN;
00065     st_MSG          msgOUT;
00066     MSG_ID          id;
00067     MSG_DATA        d1;
00068     MSG_DATA        d2;
00069     PARENT_STATE    p_oldstate = P_NULL;
00070     PARENT_STATE    p_curstate = P_NULL;
00071     PSFHDL          PSFHDL_TABLE[] = 
00072                     {           
00073                         UI_PSF_null,
00074                         UI_PSF_sleep,
00075                         UI_PSF_autosync,
00076                         UI_PSF_play,
00077                         UI_PSF_radio,
00078                         UI_PSF_record,
00079                         UI_PSF_recorddone,
00080                         UI_PSF_hisi,
00081                         UI_PSF_hisidone
00082                     };
00083     
00084     uiParentMsgQ = MSG_createQ(UI_MSG_Q_LENGTH);
00085     
00086     while(1)
00087     {
00088         mMSG_get(uiParentMsgQ, &msgIN, SYS_FOREVER);
00089         
00090         id = msgIN.id;     
00091         d1 = msgIN.d1; 
00092         d2 = msgIN.d2;
00093         
00094         if( (SYS_MSG_ID == id)&&(SPOWERUP_SEQUENCEDONE == d1) )
00095         {
00096             SYS_deleteDiskDbTask(SYS_FOREVER);
00097             
00098             #ifdef M3U_SUPPORT
00099             UI_m3uInit();
00100             #endif
00101             
00102             // System has been fully powered up, check to auto-resume
00103             // if USB is not plugged and it is not hisi powerup.
00104             if(SYS_isHisiPowerup())
00105             {
00106                 SYS_powerupSequenceDone();
00107                 mMSG_send(sysMsgQ, SYS_MSG_ID, SSTART2HISI, DONTCARE, SYS_FOREVER);
00108                 continue;
00109             }
00110             
00111             if( (!USB_isCablePlugged())&&(!SYS_isLowBattery()) )
00112             {
00113                 if(FALSE == _autoResume())
00114                 {
00115                     SYS_autoffEnable();     
00116                 }
00117             }           
00118             SYS_usbEnabled();
00119             SYS_powerupSequenceDone();
00120             continue;
00121         }
00122         
00123         p_curstate = UI_getParentSFhdl(p_oldstate)(&msgIN);
00124         while(p_curstate != p_oldstate) 
00125         {
00126             p_oldstate = p_curstate;
00127             _loadCurStateCode(p_curstate);
00128             
00129             msgOUT.id = SYS_MSG_ID;
00130             msgOUT.d1 = SSTATE_START;
00131             // msgIN.d2 is carried over here.
00132             msgOUT.d2 = msgIN.d2;
00133 
00134             p_curstate = UI_getParentSFhdl(p_oldstate)(&msgOUT);
00135         }
00136         
00137         // Report to system the following message status.
00138         if( (SYS_MSG_ID == id)&&(SSTATE_END == d1) )
00139         {
00140             mMSG_send(sysMsgQ, SYS_MSG_ID, SSTATE_END_ACK, DONTCARE, SYS_FOREVER);  
00141         }
00142 
00143         UI_stackassert(UI_PARENT);
00144     }
00145 }

Here is the call graph for this function:

void UI_presetAudio int  presetIdx,
DB_ID  dbID,
DB_ENTRY  dbEntry,
DB_ENTRY  fldEntry,
DB_FIELDIDX  fldIdx,
ULONG  fptr
 

Function presets the specified audio playback controls.

Parameters:
presetIdx preset index starting from 1.
dbID Audio DB ID.
dbEntry NEUROS audio database record entry.
fldEntry NEUROS audio database field entry.
fldIdx NEUROS audio database field index.
fptr Bookmark file pointer.

Definition at line 152 of file UI_presetMgmt.c.

References st_PRESET::audio, st_NDSYSPARAM::audioPresetChksum, st_PRESET::chksum, DB_queryClose(), DB_queryFirst(), GEN_checksum(), st_NDSYSPARAM::preset, st_PRESET::share, and st_PRESET::type.

Referenced by UI_PSF_play(), UI_SF_dbmenu(), and UI_SF_menu().

00158 {
00159     st_PRESET *         pPreset = &nandSysParam.preset[presetIdx];
00160     st_AUDIOPRESET *    pAP;
00161     USHORT              buf[DB_MAXRECLEN];
00162     DB_HDL              hdl;
00163     
00164     pAP = &pPreset->share.audio;
00165     if(0x1234 == dbID)
00166     {
00167         // Play queue support.
00168         pPreset->type = PRESET_PLAYQ;
00169         pAP->dbId     = 0x1234;
00170         pAP->dbEntry  = dbEntry;
00171         pAP->fptr     = fptr;
00172         pPreset->chksum = GEN_checksum((USHORT*)pPreset, 7);
00173         return;
00174     }
00175     
00176     // Hard-coded to check preset category.
00177     switch(fldIdx)
00178     {
00179         case 1: pPreset->type = PRESET_PLAYLIST;    break;
00180         case 2: pPreset->type = PRESET_ARTIST;      break;
00181         case 3: pPreset->type = PRESET_ALBUM;       break;
00182         case 4: pPreset->type = PRESET_GENRE;       break;
00183         case 5: pPreset->type = PRESET_RECORDINGS;  break;
00184         default: pPreset->type = PRESET_SONGS;      break;
00185     }
00186     //pPreset->type = PRESET_AUDIO;
00187     pAP->dbId     = dbID;
00188     pAP->dbEntry  = dbEntry;
00189     pAP->fldEntry = fldEntry;
00190     pAP->fldIdx   = fldIdx;
00191     pAP->fptr     = fptr;
00192     pPreset->chksum = GEN_checksum((USHORT*)pPreset, 7);
00193     
00194     // Apply checksum logic only to formal presets.
00195     if(0 != presetIdx)
00196     {
00197         // Calculate record checksum.
00198         //if(pPreset->type == PRESET_SONGS)
00199             hdl = DB_queryFirst(pAP->dbId, pAP->fldIdx, pAP->fldEntry, pAP->dbEntry, buf);
00200         //else 
00201         //  hdl = DB_queryFirst(DB_childID(pAP->dbId, pAP->fldIdx), 0, 0, pAP->fldEntry, buf);
00202     
00203         if(hdl != DB_INVALID_HDL)
00204         {
00205             nandSysParam.audioPresetChksum[presetIdx] = GEN_checksum(buf+3, strlen((const char*)buf+3));
00206             DB_queryClose(hdl);
00207         }
00208     }
00209 }

Here is the call graph for this function:

void UI_presetMyFi int  presetIdx,
USHORT  station
 

Function presets the specified MyFi station.

Parameters:
presetIdx preset index starting from 1.
station MyFi channel in 100KHz.

Definition at line 127 of file UI_presetMgmt.c.

References st_NDSYSPARAM::myfi.

Referenced by UI_CSF_myfiChannel().

00128 {
00129     st_RADIOPRESET *    pPreset = &nandSysParam.myfi[presetIdx];
00130     
00131     pPreset->station = station;
00132 }

void UI_presetRadio int  presetIdx,
USHORT  station
 

Function presets the specified radio station.

Parameters:
presetIdx preset index starting from 1.
station FM channel in 100KHz.

Definition at line 108 of file UI_presetMgmt.c.

References st_PRESET::chksum, GEN_checksum(), st_NDSYSPARAM::preset, st_PRESET::radio, st_PRESET::share, and st_PRESET::type.

Referenced by UI_PSF_radio().

00109 {
00110     st_PRESET *     pPreset = &nandSysParam.preset[presetIdx];
00111     
00112     pPreset->type                = PRESET_RADIO;
00113     pPreset->share.radio.station = station;
00114     pPreset->chksum              = GEN_checksum((USHORT*)pPreset, 7);
00115 }

Here is the call graph for this function:

PARENT_STATE UI_PSF_autosync st_MSG msgIN  ) 
 

Function serves as the autosync state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 83 of file UI_PSF_autosync.c.

References MENU_buf, MENU_CLOSE, SSTATE_START, SUSB_START, SUSB_STOP, SUSB_UNPLUG, SYS_createDiskDbTask(), TMR_AUTOSYNC, TMR_create(), TMR_delete(), TMR_ZEROTRAFFIC, USB_is20active(), and USB_isCableRemoved().

00084 {   
00085     MSG_ID          id = msgIN->id;     
00086     MSG_DATA        d1 = msgIN->d1; 
00087     MSG_DATA        d2 = msgIN->d2;
00088     ULONG           dptr;
00089 
00090     switch(id)
00091     {
00092     case SYS_MSG_ID:
00093         if(SSTATE_START == d1)
00094         {
00095             // Make sure the cable is still plugged.
00096             if(USB_isCableRemoved())
00097             {
00098                 SYS_createDiskDbTask(DDT_AFTERSYNC);
00099                 return P_NULL;
00100             }
00101             
00102             // Create GUI.
00103             MENU_buf[0] = DP_AUTOSYNC;                              
00104             menu = mMENU_create((void *)&MENU_buf[0]);
00105             
00106             // Tell system to start USB interface.
00107             mMSG_send(sysMsgQ, SYS_MSG_ID, SUSB_START, d2, SYS_FOREVER);    
00108             
00109             TMR_create(TMR_AUTOSYNC, 4, TSYNCDISPLAY, 0, AUTO_RELOAD);
00110             bZero = FALSE;
00111             return P_AUTOSYNC;
00112         }
00113         
00114         if(SUSB_UNPLUG == d1)
00115         {
00116             SYS_createDiskDbTask(DDT_AFTERSYNC);
00117             mMSG_send(sysMsgQ, SYS_MSG_ID, SUSB_STOP, DONTCARE, SYS_FOREVER);               
00118             TMR_delete(TMR_AUTOSYNC);
00119             mMENU_action(menu, MENU_CLOSE);             
00120             return P_NULL;
00121         }
00122         break;
00123     
00124     case TMR_MSG_ID:
00125         
00126         if(TSYNCDISPLAY == d1)
00127         {
00128             #ifdef USB20_SUPPORT
00129             if(TRUE == USB_is20active())
00130             {
00131                 if(USB20_isTrafficPresent()) 
00132                 {
00133                     bZero = FALSE;
00134                     TMR_create(TMR_ZEROTRAFFIC, 320, TZEROTRAFFIC, 0, NO_RELOAD);
00135                 }
00136             }
00137             else
00138             #endif
00139             {
00140                 BOOL  removeAllowed;
00141                 ULONG txRate;
00142                 ULONG rxRate;
00143                 
00144                 USB_isRemoveAllowed(&removeAllowed);
00145                 USB_getTxRate(&txRate);
00146                 USB_getRxRate(&rxRate);
00147                 
00148                 if( (FALSE == removeAllowed) || (txRate+rxRate > 300) )
00149                 {
00150                     bZero = FALSE;
00151                     TMR_create(TMR_ZEROTRAFFIC, 320, TZEROTRAFFIC, 0, NO_RELOAD);
00152                 }           
00153             }
00154             
00155             if(bZero == FALSE)
00156             {
00157 //DeepB
00158 //              dptr = syncIconList[counter];
00159 //              mMENU_update(menu, 1, dptr, FALSE);
00160                 
00161                 mMENU_update(menu, 2, 0,    FALSE);
00162                 mMENU_update(menu, 4, 0,    FALSE);
00163                 mMENU_refresh(menu);
00164             }           
00165             
00166 //          if(++counter == 33) counter = 1;
00167             return P_AUTOSYNC;
00168         }
00169         
00170         if(TZEROTRAFFIC == d1)
00171         {
00172             bZero = TRUE;
00173 //DeepB
00174 //          dptr = syncIconList[0];
00175 //          mMENU_update(menu, 1, dptr, FALSE);             
00176             mMENU_update(menu, 3, 0,    FALSE);
00177             mMENU_update(menu, 5, 0,    FALSE);             
00178             mMENU_refresh(menu);
00179             return P_AUTOSYNC;
00180         }
00181     }
00182     
00183     return P_AUTOSYNC;
00184 }

Here is the call graph for this function:

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:

PARENT_STATE UI_PSF_hisidone st_MSG msgIN  ) 
 

Function serves as the parent HiSi complete state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 60 of file UI_PSF_hisidone.c.

References AI_SHUTDOWN, AUDIO_setInterface(), BTN_YES, ENCODER_getSource(), FAT_delete(), st_UI::fname, MENU_buf, MENU_CLOSE, st_UI::path, SMSGBOX_EXIT, SSTATE_END, SSTATE_START, SXIM_CREATE, SXIM_EXIT, TMR_create(), TMR_delete(), and TMR_HISIDONE.

Referenced by UI_parent().

00061 {   
00062     MSG_ID          id = msgIN->id;     
00063     MSG_DATA        d1 = msgIN->d1; 
00064     MSG_DATA        d2 = msgIN->d2;
00065     
00066     switch(id)
00067     {
00068     case SYS_MSG_ID:
00069         
00070         switch(d1)
00071         {
00072             case SSTATE_START:
00073             {
00074                 _loadHisiDoneTmplt(Ui.fname, (int)ENCODER_getSource());
00075                 menu = mMENU_create((void *)&MENU_buf[0]);
00076                 TMR_create(TMR_HISIDONE, 250, THISIDONE, 0, NO_RELOAD);
00077                 return P_HISIDONE;
00078             }
00079             case SSTATE_END:
00080             {
00081                 mMENU_action(menu, MENU_CLOSE);
00082                 TMR_delete(TMR_HISIDONE);
00083                 _addHisi2Db();
00084                 if(SYS_isRadioActive()) 
00085                 {
00086                     AUDIO_setInterface(AI_SHUTDOWN);
00087                 }
00088                 return P_NULL;
00089             }
00090             case SMSGBOX_EXIT:
00091             {
00092                 if(MENU_curMsgbx() == MSGBX_DELETEHISICLIP)
00093                 {
00094                     if(BTN_YES == d2)
00095                     {
00096                         mMENU_action(menu, MENU_CLOSE);
00097                         TMR_delete(TMR_HISIDONE);
00098                         FAT_delete(Ui.path);
00099                         
00100                         if(SYS_isRadioActive()) return P_RADIO;
00101                         return P_NULL;                      
00102                     }
00103                     else TMR_create(TMR_HISIDONE, 250, THISIDONE, 0, NO_RELOAD);
00104                 }               
00105             }
00106             case SXIM_EXIT: return _ximAction(msgIN);   
00107         }   
00108         break;
00109     
00110     case TMR_MSG_ID:
00111         switch(d1)
00112         {
00113             case THISIDONE:
00114             {
00115                 mMENU_action(menu, MENU_CLOSE);
00116                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SSTATE_END, DONTCARE, SYS_FOREVER);
00117                 _addHisi2Db();
00118                 if(SYS_isRadioActive()) return P_RADIO;
00119                 return P_NULL;
00120             }
00121         }
00122         break;
00123         
00124     case KBD_MSG_ID:
00125         switch(d1)
00126         {
00127             case KEY_BACK:
00128                 TMR_delete(TMR_HISIDONE);
00129                 mMENU_action(menu, MENU_CLOSE);
00130                 _addHisi2Db();
00131                 if(SYS_isRadioActive()) return P_RADIO;
00132                 return P_NULL;
00133 
00134             case KEY_PLAY:
00135                 _playHisi(msgIN);
00136                 return P_PLAY;
00137             
00138             case KEY_SELECT:
00139                 TMR_delete(TMR_HISIDONE);
00140                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SXIM_CREATE, XIMWIN_HISIDONE, SYS_FOREVER);
00141                 break;          
00142         }
00143         break;
00144     }
00145     
00146     return P_HISIDONE;
00147 }

Here is the call graph for this function:

PARENT_STATE UI_PSF_null st_MSG msgIN  ) 
 

Function serves as the parent null state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 56 of file UI_PSF_null.c.

References BAT_calibrate(), HISI_LED, KBD_isKeyDown(), KFORWARD, LED_OFF, LED_ON, SBROWSE, SDIAGNOSIS, SENDOFMENU, SFORCEOFF, SGO2PRESET, SHIDDENFEATURE, SMSGBOX_EXIT, SPSF_NULL, SSHUT_DOWN, SSTART2HISI, SSTART2PLAY, SSTART2RECORD, SSTARTRADIO, SSTATE_END, SSTATE_START, st_SYSPARAM::station, SUSB_PLUG, SYS_createDiskDbTask(), SYS_deleteDiskDbTask(), SYS_onOffLEDs(), SYS_serialNumber(), UI_m3uClose(), and UI_msgbxCreate().

00057 {   
00058     MSG_ID          id = msgIN->id;     
00059     MSG_DATA        d1 = msgIN->d1; 
00060     MSG_DATA        d2 = msgIN->d2;
00061         
00062     switch(id)
00063     {
00064     case SYS_MSG_ID:
00065         switch(d1)
00066         {
00067             case SSTATE_START: 
00068             case SDIAGNOSIS:
00069             case SENDOFMENU:
00070             {
00071                 mMSG_send(uiMsgQ, SYS_MSG_ID, SBROWSE, DONTCARE, SYS_FOREVER);
00072                 break;
00073             }
00074             case SSTATE_END:
00075             {
00076                 mMSG_send(sysMsgQ, SYS_MSG_ID, SPSF_NULL, DONTCARE, SYS_FOREVER);
00077                 break;
00078             }
00079             case SUSB_PLUG:
00080             {
00081                 // GUI level clean up before switching to USB mode.
00082                 #ifdef M3U_SUPPORT
00083                 UI_m3uClose(0);
00084                 #endif
00085                 
00086                 SYS_createDiskDbTask(DDT_2SYNC);                
00087                 // Ready the disk.
00088                 SYS_deleteDiskDbTask(SYS_FOREVER);
00089                 return P_AUTOSYNC;
00090             }
00091             case SSHUT_DOWN:
00092             {
00093                 // GUI level clean up before shutting down.
00094                 #ifdef M3U_SUPPORT
00095                 UI_m3uClose(0);
00096                 #endif
00097                 
00098                 UI_msgbxCreate(MSGBX_SHUTDOWN);
00099                 SYS_deleteDiskDbTask(SYS_FOREVER);
00100                 SYS_createDiskDbTask(DDT_SHUTDOWN);
00101                 break;
00102             }
00103             case SSTARTRADIO:   return P_RADIO;
00104             case SSTART2PLAY:   return P_PLAY;
00105             case SSTART2RECORD: 
00106             case SSTART2HISI:   
00107             {
00108                 // Ready the disk.
00109                 SYS_deleteDiskDbTask(SYS_FOREVER);
00110                 return((SSTART2RECORD == d1)? P_RECORD:P_HISI);
00111             }
00112             case SMSGBOX_EXIT:
00113             {
00114                 if(MENU_curMsgbx() == MSGBX_SHUTDOWN)
00115                 {
00116                     if(FALSE == SYS_deleteDiskDbTask(0))
00117                     {
00118                         UI_msgbxCreate(MSGBX_SHUTDOWN);
00119                     }
00120                     else return P_SLEEP;
00121                 }
00122                 break;
00123             }
00124             case SGO2PRESET:
00125             {
00126                 if(UI_presetType(d2) == PRESET_RADIO)
00127                 {
00128                     sysParam.station = UI_presetStation(d2);
00129                     return P_RADIO;
00130                 }
00131                 else 
00132                 {
00133                     SYS_deleteDiskDbTask(SYS_FOREVER);
00134                     return P_PLAY;
00135                 }
00136             }
00137             case SHIDDENFEATURE:
00138             {
00139                 if(1 == d2)
00140                 {
00141                     SYS_serialNumber(SN_FILEREAD, NULL);
00142                     SYS_onOffLEDs(HISI_LED, LED_ON);
00143                     SYS_HF_batCaliEnable();
00144                     BAT_caliEnable();
00145                 }
00146                 break;
00147             }
00148             case SFORCEOFF: return P_SLEEP;
00149         }
00150         break;
00151         
00152     case KBD_MSG_ID:
00153         switch(d1)
00154         {
00155             case KEY_PLAY:
00156             {
00157                 // Prepare for playback, properly shut down any msgbox, xim, ready
00158                 // the data etc.
00159                 if(!SYS_isDiagnosisMode())
00160                 {
00161                     if(KBD_isKeyDown(KFORWARD))
00162                     {
00163                         mMSG_send(sysMsgQ, SYS_MSG_ID, SSTART2PLAY, 0xA5A5, SYS_FOREVER);
00164                     }                   
00165                     else mMSG_send(sysMsgQ, SYS_MSG_ID, SSTART2PLAY, DONTCARE, SYS_FOREVER);
00166                 }
00167                 break;
00168             }
00169             case KEY_HBACK:
00170             {
00171                 if(SYS_HF_batCalibration()) _batCalibrate();
00172                 break;          
00173             }
00174             case KEY_HHISI:
00175             {
00176                 if(SYS_HF_batCalibration())
00177                 {
00178                     BAT_calibrate();
00179                     SYS_HF_batCaliDisable();
00180                     BAT_caliDisable();
00181                     SYS_onOffLEDs(HISI_LED, LED_OFF);       
00182                 }
00183                 break;
00184             }           
00185         }
00186         break;
00187         
00188     case TMR_MSG_ID:
00189         break;
00190     }
00191     
00192     return P_NULL;
00193 }

Here is the call graph for this function:

PARENT_STATE UI_PSF_play st_MSG msgIN  ) 
 

Function serves as the parent play state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 126 of file UI_PSF_play.c.

References st_UI::abMode, st_UI::abStart, AF_ILINK, AI_PAUSE, AI_START, AI_UNMUTE, st_PLAYQ::album, AM_ILINK, AM_MYFI, st_UI::aPtr, st_PLAYQ::artist, st_PRESET::audio, st_DBNAV::audio, Audio, AUDIO_getCacheTrackFile(), AUDIO_getFilePtr(), AUDIO_initInterface(), AUDIO_resetMyfiQuality(), AUDIO_setCurrentTrack(), AUDIO_setFilePtr(), AUDIO_setInterface(), BTN_CANCEL, BTN_NEUROS, BTN_PCDELETE, BTN_YES, CLOCK_PLAY, D2PEAR_ID, DB_deleteRecordByMdb(), DECODER_cacheDepthReset(), st_PLAYQ::duration, st_DBNAV::failedhisi, FAT_delete(), st_PLAYQ::fname, st_PLAYQ::genre, st_DBNAV::idedhisi, st_PLAYQ::mdb, MENU_buf, MENU_CLOSE, MENU_isValid(), MENU_TXTSCROLL, st_AUDIO::mode, st_SYSPARAM::myfiChannel, st_SYSPARAM::myfiMode, PEAR_DATA, st_AUDIO::playtime, st_NDSYSPARAM::preset, SAUDIOTIME_UPDT, SBROWSE, SCURRENTAUDIOFILE, SENDOFMENU, SENDOFMUSIC, st_PRESET::share, st_PLAYQ::size, SMIFIMODECHANGED, SMIFIQUALITYCHANGED, SMSGBOX_EXIT, SMYFICHANNELCHANGED, SMYMIXCHANGED, SNEXTAUDIOFILE, SPLAYQCHANGED, SPRESET, SRESUMEPLAY, SSHUFFLECHANGED, SSTARTRADIO, SSTATE_END, SSTATE_START, SXIM_CREATE, SXIM_EXIT, SYS_clockSetup(), SYS_die(), st_PLAYQ::title, UI_audioPresetUpdate(), UI_earPut(), UI_m3uActvItemPtr(), UI_m3uChgOrder(), UI_m3uPut(), UI_m3uRemove(), UI_msgbxCreate(), UI_playQcurrent(), UI_playQreset(), UI_presetAudio(), UI_updateMembar(), st_DBNAV::unidedhisi, and st_SYSPARAM::x_granularity.

00127 {   
00128     MSG_ID          id = msgIN->id;     
00129     MSG_DATA        d1 = msgIN->d1; 
00130     MSG_DATA        d2 = msgIN->d2;
00131     
00132     switch(id)
00133     {
00134     case SYS_MSG_ID:
00135         
00136         switch(d1)
00137         {
00138             case SSTATE_START:
00139             {
00140                 SYS_clockSetup(CLOCK_PLAY);
00141                 if(SYS_HF_linkit())
00142                 {
00143                     AUDIO_initInterface(AM_ILINK, AF_ILINK, 0, 0);
00144                     AUDIO_setInterface(AI_START);
00145                     SYS_audioNotPaused();
00146                     _linkitGUIon(TRUE);
00147                     return P_PLAY;
00148                 }
00149                 
00150                 #ifdef DJ_SUPPORT
00151                 _abInit();
00152                 #endif
00153                 return _startPlay(d2, TRUE);
00154             }
00155             case SSTATE_END:
00156             {
00157                 if(SYS_HF_linkit())
00158                 {
00159                     _stopPlay();
00160                     return P_NULL;
00161                 }
00162                 return(_stateEnd());
00163             }
00164             case SSTARTRADIO: 
00165                 _stopPlay();
00166                 return P_RADIO;
00167                 
00168             case SRESUMEPLAY:
00169             case SENDOFMENU:
00170             {
00171                 if(MENU_isValid(menu) == FALSE )
00172                 {
00173                     _setupPlayMenu(UI_playQcurrent());
00174                     menu = mMENU_create((void*)&MENU_buf[0]);
00175                     _displayMyfiChannel();
00176                     if(SYS_isAudioPaused()) 
00177                     {
00178                         mMENU_update(menu, 5, (ULONG)graf_icon_pause, FALSE);
00179                     }
00180                     else                    
00181                     {
00182                         mMENU_update(menu, 5, (ULONG)graf_icon_play, FALSE);
00183                     }
00184                     _updatePlayTime();
00185                 }
00186                 return P_PLAY;          
00187             }
00188             case SPRESET:
00189             {
00190                 if(SYS_isPresetable())
00191                 {
00192                     ULONG fptr;
00193 //DeepB
00194 // Bugzilla #213
00195 // Only get file pointer while paused
00196                     if (SYS_isAudioPaused())
00197                         fptr = AUDIO_getFilePtr();
00198                     else
00199                         fptr = 0;
00200                     UI_presetAudio(d2, UI_presetDbId(0),
00201                                     UI_playQcurrent()->actvTrack, 
00202                                     UI_presetFldEntry(0),
00203                                     UI_presetFldIdx(0), 
00204                                     fptr);
00205                     switch(UI_presetFldIdx(0))
00206                     {
00207                         case 1:  UI_msgbxCreate(MSGBX_PLAYLIST_PRESETDONE); break;
00208                         case 2:  UI_msgbxCreate(MSGBX_ARTIST_PRESETDONE);   break;
00209                         case 3:  UI_msgbxCreate(MSGBX_ALBUM_PRESETDONE);    break;
00210                         case 4:  UI_msgbxCreate(MSGBX_GENRE_PRESETDONE);    break;
00211                         case 5:  UI_msgbxCreate(MSGBX_RECORDING_PRESETDONE);break;
00212                         default: UI_msgbxCreate(MSGBX_SONGS_PRESETDONE);    break;
00213                     }
00214                 }
00215                 return P_PLAY;
00216             }
00217             case SAUDIOTIME_UPDT:
00218             {
00219                 #ifdef DJ_SUPPORT
00220                 _abCheck();
00221                 #endif
00222                 _updatePlayTime();
00223                 return P_PLAY;
00224             }
00225             case SENDOFMUSIC:
00226             {
00227                 #ifdef DJ_SUPPORT
00228                 if( (Ui.abMode)&&(2 == Ui.abStart) ) return _prevNextMusic(0);
00229                 #endif
00230                 DECODER_cacheDepthReset(1);
00231                 return _prevNextMusic(1);
00232             }
00233             case SPLAYQCHANGED: 
00234             {
00235                 #ifdef M3U_SUPPORT
00236                 if( UI_getPlaySource() != PLAY_FROM_PLAYQ )
00237                 {
00238                     st_PLAYQ * q = UI_playQcurrent();
00239                     
00240                     UI_presetAudio(0, 0x1234, 1, DONTCARE, DONTCARE, 0);
00241                             
00242                     DB_LOCK(SYS_FOREVER);
00243                     UI_m3uPut(0, q->fname, q->artist, q->title, q->album, q->genre, q->duration, q->size);
00244                     *UI_m3uActvItemPtr(0) = 2;
00245                     UI_m3uChgOrder(0, 0);
00246                     DB_UNLOCK();
00247                     UI_playQreset(0x1234);
00248                     return P_PLAY;
00249                 }
00250                 #endif
00251             }
00252             case SMYMIXCHANGED:
00253             {
00254                 if(FALSE == UI_playQreset(d2))
00255                 {
00256                     // No playable contents.
00257                     _stopPlay();
00258                     UI_msgbxCreate(MSGBX_CONTENTSNA);
00259                     return P_NULL;
00260                 }
00261                 return P_PLAY;
00262             }
00263             case SSHUFFLECHANGED:
00264             {
00265                 UI_playQreset(DONTCARE);
00266                 return P_PLAY;
00267             }
00268             case SMIFIQUALITYCHANGED:
00269             {
00270                 AUDIO_resetMyfiQuality();
00271                 return P_PLAY;
00272             }
00273             case SMIFIMODECHANGED:
00274             {
00275                 // Check new myfi mode.
00276                 if( ((sysParam.myfiMode == 1) // off.
00277                     &&(AUDIO_isMyfiActive())) ||
00278 //DeepB
00279                     ((sysParam.myfiMode == 2) // on
00280                     && (!AUDIO_isMyfiActive())) ||
00281 //Auto detectar
00282                     ((sysParam.myfiMode == 3) // auto-detect.
00283                     &&((AUDIO_isMyfiActive()) == (SYS_isHPpresent()))) )
00284                 {
00285                     // Restart.
00286                     UI_presetAudio(0, UI_presetDbId(0),
00287                             UI_playQcurrent()->actvTrack, 
00288                             UI_presetFldEntry(0),
00289                             UI_presetFldIdx(0), 
00290                             AUDIO_getFilePtr());
00291                     _stopPlay();
00292                     return _startPlay(0, FALSE);
00293                 }
00294                 break;
00295             }
00296             case SMYFICHANNELCHANGED:
00297             {
00298                 _displayMyfiChannel();
00299                 return P_PLAY;
00300             }
00301             case SXIM_EXIT: 
00302             {
00303                 return(_ximAction(d2));
00304             }
00305             case SMSGBOX_EXIT:
00306             {
00307                 if(MENU_curMsgbx() == MSGBX_CONTENTSNA)
00308                 {
00309                     return P_NULL;
00310                 }
00311                 else if(MENU_curMsgbx() == MSGBX_REMOVEQRECORD)
00312                 {
00313                     if(BTN_YES == d2)
00314                     {
00315                         _stateEnd();
00316                         UI_m3uRemove(0, UI_playQcurrent()->actvTrack);
00317                         // Start next track from the very beginning.
00318                         nandSysParam.preset[0].share.audio.fptr = 0L;
00319                         return _startPlay(0, TRUE);                                     
00320                     }
00321                     else return P_PLAY;
00322                 }
00323                 else if(MENU_curMsgbx() == MSGBX_DELETERECORD)
00324                 {
00325                     D2PEAR_ID   earID;
00326                     st_PLAYQ *  q = UI_playQcurrent();
00327                     
00328                     if( BTN_CANCEL == d2 ) return P_PLAY;
00329                     
00330                     if( (BTN_NEUROS == d2)||(BTN_PCDELETE == d2) )
00331                     {
00332                         _stateEnd();
00333                         FAT_delete(q->fname);
00334                         switch(UI_getPlaySource())
00335                         {
00336                             case PLAY_FROM_IDEDHISI:
00337                                 DB_deleteRecordByMdb(DBnav.idedhisi, q->mdb);
00338                                 break;
00339                             case PLAY_FROM_FAILEDHISI:
00340                                 DB_deleteRecordByMdb(DBnav.failedhisi, q->mdb);
00341                                 break;
00342                             case PLAY_FROM_AUDIODB:
00343                                 DB_deleteRecordByMdb(DBnav.audio, q->mdb);
00344                                 UI_audioPresetUpdate(-1);
00345                                 break;
00346                             default: SYS_die(UI_PSF_PLAY);
00347                         }     
00348                     }
00349                     
00350                     earID = (BTN_NEUROS == d2)? DELETE_NEUROS_AUDIO: DELETE_PC_AUDIO;
00351                     
00352                     if(SYS_isHDDpresent())
00353                     {
00354                         UI_earPut(strDISKC, earID,(PEAR_DATA)q->fname,strlen(q->fname)+1, 0);
00355                         SYS_NAND_DBMOD_2HDD_PENDING();
00356                     }
00357                     else
00358                     {
00359                         UI_earPut(strDISKD, earID,(PEAR_DATA)q->fname,strlen(q->fname)+1, 0);
00360                         SYS_NAND_CONTENTS_CHANGED();
00361                     }   
00362                     // Start next track from the very beginning.
00363                     nandSysParam.preset[0].share.audio.fptr = 0L;
00364                     return _startPlay(0, TRUE);                                     
00365                 }
00366                 else if(MENU_curMsgbx() == MSGBX_DELETERECORDFILE)
00367                 {
00368                     if(BTN_YES == d2)
00369                     {
00370                         st_PLAYQ *  q = UI_playQcurrent();
00371                         _stateEnd();
00372                         FAT_delete(q->fname);
00373                         UI_updateMembar();
00374                         return P_NULL;
00375                     }
00376                 }
00377                 else if(MENU_curMsgbx() == MSGBX_DELETEHISICLIP)
00378                 {
00379                     if(BTN_YES == d2)
00380                     {
00381                         st_PLAYQ *  q = UI_playQcurrent();
00382                         
00383                         _stateEnd();
00384                         FAT_delete(q->fname);
00385                         if(UI_getPlaySource() == PLAY_FROM_UNIDEDHISI)
00386                         {
00387                             DB_deleteRecordByMdb(DBnav.unidedhisi, q->mdb);
00388                             UI_earPut(SYS_isHDDpresent()? strDISKC:strDISKD,
00389                                         HISI_DELETE_UNIDED_CLIP,(PEAR_DATA)q->fname, strlen(q->fname)+1, 0);
00390                             
00391                             if(SYS_isHDDpresent())
00392                             {
00393                                 SYS_NAND_DBMOD_2HDD_PENDING();
00394                             }
00395                             else
00396                             {
00397                                 SYS_NAND_CONTENTS_CHANGED();
00398                             }
00399                         }
00400                         return P_NULL;
00401                     }
00402                 }
00403                 return P_PLAY;
00404             }
00405             case SCURRENTAUDIOFILE:
00406             {
00407                 AUDIO_setCurrentTrack();
00408                 return P_PLAY;
00409             }
00410             case SNEXTAUDIOFILE:
00411             {
00412                 AUDIO_getCacheTrackFile(d2);
00413                 return P_PLAY;
00414             }
00415         }   
00416         break;
00417     
00418     case TMR_MSG_ID:
00419         switch(d1)
00420         {
00421             case TTXTSCROLL: 
00422                 mMENU_action(menu, MENU_TXTSCROLL);
00423                 return P_PLAY;
00424         }
00425         break;
00426         
00427     case KBD_MSG_ID:
00428         switch(d1)
00429         {
00430             case KEY_BACK:
00431                 if(SYS_HF_linkit())
00432                 {
00433                     _stopPlay();
00434                     return P_NULL;
00435                 }
00436                 
00437                 if(!PLAY_isFromDb())
00438                 { 
00439                     _stopPlay();
00440                     return (SYS_wasFromHisi())? P_HISIDONE:P_RECORDDONE;
00441                 }
00442                 mMENU_action(menu, MENU_CLOSE);
00443                 // Auto resume play window.
00444                 SYS_autoResumePlayEnable();
00445                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SBROWSE, DONTCARE, SYS_FOREVER);
00446                 return P_PLAY;
00447             
00448             case KEY_HREWIND:
00449                 if(SYS_HF_myfiTest())
00450                 {
00451                     //sysParam.myfiChannel = 911;
00452                     sysParam.myfiChannel = 875;
00453                     _updateLinkitDisplay(sysParam.myfiChannel, menu);
00454                     XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00455                 }
00456             case KEY_RREWIND:
00457                 if(SYS_HF_linkit()) return P_PLAY;
00458                 DECODER_frwd();
00459                 return P_PLAY;
00460                 
00461             case KEY_REWIND:    
00462                 if(SYS_HF_linkit()) return P_PLAY;
00463                 DECODER_cacheDepthReset(0);
00464                 #ifdef DJ_SUPPORT
00465                 if(Ui.abStart == 2)
00466                 {
00467                     AUDIO_setFilePtr(Ui.aPtr);
00468                     return P_PLAY;
00469                 }
00470                 #endif
00471 //DeepB
00472 // To previous song
00473 // if on first 5 seconds
00474 // of non-paused song
00475                 if((Audio.playtime < 5) && !(SYS_isAudioPaused())) return _prevNextMusic(-1);
00476                 else return _prevNextMusic(0);          
00477                     
00478             case KEY_FORWARD:           
00479                 if(SYS_HF_linkit()) return P_PLAY;
00480                 DECODER_cacheDepthReset(0);
00481                 #ifdef DJ_SUPPORT
00482                 if(Ui.abStart == 2) 
00483                 {
00484                     AUDIO_setFilePtr(Ui.aPtr);
00485                     return P_PLAY;
00486                 }
00487                 #endif
00488                 return _prevNextMusic(1);
00489                 
00490             case KEY_HFORWARD:
00491                 if(SYS_HF_myfiTest())
00492                 {
00493                     //sysParam.myfiChannel = 1049;
00494                     sysParam.myfiChannel = 1041;
00495                     _updateLinkitDisplay(sysParam.myfiChannel, menu);
00496                     XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00497                 }
00498             case KEY_RFORWARD:
00499                 if(SYS_HF_linkit()) return P_PLAY;
00500                 DECODER_ffwd();
00501                 return P_PLAY;  
00502                 
00503             case KEY_PLAY:
00504                 
00505                 SYS_toggleAudioPaused();
00506                 if(SYS_isAudioPaused()) 
00507                 {
00508                     PLAY_setPaused();
00509                     AUDIO_setInterface(AI_PAUSE);
00510                     if(SYS_HF_linkit()) 
00511                         mMENU_update(menu, 7, (ULONG)text_tunermuted, FALSE);
00512                     else
00513                         mMENU_update(menu, 5, (ULONG)graf_icon_pause, FALSE);
00514                 }
00515                 else
00516                 {
00517                     PLAY_unsetPaused();
00518                     AUDIO_setInterface(AI_START);
00519                     AUDIO_setInterface(AI_UNMUTE);
00520                     if(SYS_HF_linkit()) 
00521                         mMENU_update(menu, 7, (ULONG)text_null, FALSE); 
00522                     else
00523                         mMENU_update(menu, 5, (ULONG)graf_icon_play, FALSE);
00524                 }
00525                 mMENU_refresh(menu);
00526                 return P_PLAY;
00527                 
00528             case KEY_HUP:
00529             case KEY_UP:
00530             case KEY_RUP:
00531                 if(SYS_HF_linkit())
00532                 {
00533                     if(sysParam.myfiChannel < MAX_CHANNEL) 
00534                     {
00535                         sysParam.myfiChannel+=sysParam.x_granularity;
00536                         _updateLinkitDisplay(sysParam.myfiChannel, menu);
00537                         XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00538                     }
00539                     return P_PLAY;
00540                 }
00541             case KEY_HDOWN:
00542             case KEY_DOWN:
00543             case KEY_RDOWN:
00544                 if(SYS_HF_linkit())
00545                 {
00546                     if(sysParam.myfiChannel > MIN_CHANNEL)
00547                     { 
00548                         sysParam.myfiChannel-=sysParam.x_granularity;
00549                         _updateLinkitDisplay(sysParam.myfiChannel, menu);
00550                         XMIT_SetFreq(XMIT_SET, (MAX_CHANNEL-sysParam.myfiChannel)/2);
00551                     }
00552                     return P_PLAY;
00553                 }           
00554                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, (AM_MYFI == Audio.mode)?
00555                             SMYFICHANNELWIN_CREATE:SVOLWIN_CREATE, DONTCARE, SYS_FOREVER);
00556                 return P_PLAY;
00557                 
00558             case KEY_SELECT:
00559             {
00560                 int ximPtr;
00561 
00562                 if(SYS_HF_linkit()) return P_PLAY;
00563                 SYS_autoResumePlayEnable();
00564                 
00565                 if(PLAY_FROM_PLAYQ == UI_getPlaySource())
00566                 {
00567                     ximPtr = (AM_MYFI == Audio.mode)? XIMWIN_PLAYER_MYFIQ:XIMWIN_PLAYERQ;
00568                 }
00569                 else
00570                 {
00571                     ximPtr = (AM_MYFI == Audio.mode)? XIMWIN_PLAYER_MYFI:XIMWIN_PLAYER;
00572                     
00573                     if(PLAY_FROM_AUDIODB == UI_getPlaySource())                     
00574                     {
00575                         if(FALSE == _playFromMymix())
00576                         {
00577                             ximPtr = (AM_MYFI == Audio.mode)? 
00578                                 XIMWIN_PLAYER_MYFI_ADD2MYMIX:XIMWIN_PLAYER_ADD2MYMIX;
00579                         }
00580                     }                   
00581                 }
00582                 
00583                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SXIM_CREATE, ximPtr, SYS_FOREVER);
00584                 return P_PLAY;
00585             }
00586         }
00587         break;
00588     }
00589     
00590     return P_PLAY;
00591 }

Here is the call graph for this function:

PARENT_STATE UI_PSF_radio st_MSG msgIN  ) 
 

Function serves as the parent FM radio state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 82 of file UI_PSF_radio.c.

References AF_PCM, AI_SHUTDOWN, AI_START, AM_FMRADIO, AUDIO_initInterface(), AUDIO_setInterface(), CLOCK_FMTUNER, CODEC_hpVolume(), st_SYSPARAM::myfiChannel, SBROWSE, SENDOFMENU, SGO2PRESET, SHIDDENFEATURE, SPRESET, SRESUMEPLAY, SSTART2HISI, SSTART2PLAY, SSTART2RECORD, SSTARTRADIO, SSTATE_END, SSTATE_START, st_SYSPARAM::station, SVOLWIN_CREATE, SXIM_CREATE, SXIM_EXIT, SYS_clockSetup(), SYS_delayMicrosecond(), SYS_deleteDiskDbTask(), TMR_delete(), TMR_TUNERSEEK, TUNER_control(), TUNER_initFIR(), TUNER_tune(), UI_presetRadio(), and st_SYSPARAM::volume.

00083 {   
00084     MSG_ID          id = msgIN->id;     
00085     MSG_DATA        d1 = msgIN->d1; 
00086     MSG_DATA        d2 = msgIN->d2;
00087     
00088     switch(id)
00089     {
00090     case SYS_MSG_ID:
00091         
00092         switch(d1)
00093         {
00094             case SSTATE_START:
00095             {
00096                 SYS_clockSetup(CLOCK_FMTUNER);
00097                 SYS_presetable();               
00098                 if(!SYS_isRadioActive())
00099                 {
00100                     SYS_radioActive();
00101                         
00102                     TUNER_control(ON);
00103                     TUNER_initFIR();
00104                     SYS_delayMicrosecond(300000);
00105                     AUDIO_initInterface(AM_FMRADIO, AF_PCM, 0, 0);
00106                     AUDIO_setInterface(AI_START);
00107                     TUNER_tune(TUNER_SET, sysParam.station);
00108                     CODEC_hpVolume(sysParam.volume);
00109                     SYS_audioNotPaused();
00110                     HDD_shutdown();
00111                 }                                   
00112                 _radioGUIon(TRUE, d2);
00113                 return P_RADIO;
00114             }
00115             case SHIDDENFEATURE:
00116             {
00117                 if(1 != d2) break;
00118                 _stateEnd();
00119                 SYS_HF_myfiTestEnable();
00120                 sysParam.myfiChannel = 963;
00121                 mMSG_send(sysMsgQ, SYS_MSG_ID, SSTART2PLAY, 0xA5A5, SYS_FOREVER);
00122                 return P_NULL;
00123             }
00124             case SSTATE_END:
00125             {
00126                 return _stateEnd();
00127             }
00128             case SGO2PRESET:
00129             {
00130                 if(UI_presetType(d2) == PRESET_RADIO)
00131                 {
00132                     int station = UI_presetStation(d2);
00133                     if(sysParam.station != station)
00134                     {
00135                         sysParam.station = station;                 
00136                         TUNER_tune(TUNER_SET, station);
00137                     }
00138                     _radioGUIon(TRUE, d2);
00139                 }
00140                 else 
00141                 {
00142                     _radioGUIon(FALSE, d2);
00143                     AUDIO_setInterface(AI_SHUTDOWN);
00144                     return P_PLAY;
00145                 }
00146                 return P_RADIO;
00147             }
00148             case SSTARTRADIO:
00149             case SRESUMEPLAY:
00150             case SENDOFMENU:
00151             {
00152                 _radioGUIon(TRUE, curPresetIdx);
00153                 return P_RADIO;         
00154             }
00155             case SPRESET:
00156             {
00157                 UI_presetRadio(d2, sysParam.station);
00158                 _updateRadioDisplay(sysParam.station, menu, d2);
00159                 return P_RADIO;
00160             }
00161             case SSTART2RECORD: 
00162             case SSTART2HISI:
00163             {
00164                 SYS_deleteDiskDbTask(SYS_FOREVER);
00165 // Bugzilla #157 Pt. 2b
00166                 if(SYS_isAudioPaused())
00167                 {
00168                     SYS_toggleAudioPaused();                
00169                     mMENU_update(menu, 7, (ULONG)text_null, FALSE);
00170                     CODEC_hpVolume(sysParam.volume);
00171                 }
00172                 mMENU_refresh(menu);
00173                 _radioGUIon(FALSE, DONTCARE);
00174                 return((SSTART2RECORD == d1)? P_RECORD:P_HISI);
00175             }
00176             case SXIM_EXIT: 
00177             {
00178                 return(_ximAction(d2));
00179             }
00180         }   
00181         break;
00182 
00183     case KBD_MSG_ID:
00184         switch(d1)
00185         {
00186             case KEY_HSELECT:
00187                 sysParam.station = TUNER_tune(TUNER_SET, TUN_MAX_REAL_FREQ);
00188                 _updateRadioDisplay(sysParam.station, menu, DONTCARE);
00189                 return P_RADIO;
00190             case KEY_HBACK:
00191                 sysParam.station = TUNER_tune(TUNER_SET, TUN_MIN_REAL_FREQ);
00192                 _updateRadioDisplay(sysParam.station, menu, DONTCARE);
00193                 return P_RADIO;
00194             case KEY_BACK:
00195                 // Auto resume play window.
00196                 SYS_autoResumePlayEnable();
00197                 _radioGUIon(FALSE, DONTCARE);
00198                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SBROWSE, DONTCARE, SYS_FOREVER);
00199                 return P_RADIO;
00200             
00201             case KEY_HREWIND:
00202             case KEY_RREWIND:
00203                 sysParam.station = TUNER_tune(TUNER_DEC, sysParam.station);
00204                 _updateRadioDisplay(sysParam.station, menu, DONTCARE);
00205                 return P_RADIO;
00206                 
00207             case KEY_REWIND:
00208                 _seeksetup(TUNER_SEEK_DOWN);
00209                 return P_RADIO;
00210                 
00211             case KEY_FORWARD:  
00212                 _seeksetup(TUNER_SEEK_UP);
00213                 return P_RADIO;
00214                 
00215             case KEY_HFORWARD:
00216             case KEY_RFORWARD:
00217                 sysParam.station = TUNER_tune(TUNER_INC, sysParam.station);
00218                 _updateRadioDisplay(sysParam.station, menu, DONTCARE);
00219                 return P_RADIO; 
00220                 
00221             case KEY_PLAY:
00222                 SYS_toggleAudioPaused();                
00223                 if(SYS_isAudioPaused())
00224                 {
00225                     mMENU_update(menu, 7, (ULONG)text_tunermuted, FALSE);
00226                     CODEC_hpVolume(0);  
00227                 }
00228                 else
00229                 {
00230                     mMENU_update(menu, 7, (ULONG)text_null, FALSE); 
00231                     CODEC_hpVolume(sysParam.volume);
00232                 }
00233                 mMENU_refresh(menu);
00234                 return P_RADIO;
00235                 
00236             case KEY_UP:
00237             case KEY_HUP:
00238             case KEY_DOWN:
00239             case KEY_HDOWN:
00240                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SVOLWIN_CREATE, DONTCARE, SYS_FOREVER);
00241                 return P_RADIO;
00242                 
00243             case KEY_SELECT:
00244                 SYS_autoResumePlayEnable();
00245                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SXIM_CREATE, XIMWIN_RADIO, SYS_FOREVER);
00246                 return P_RADIO;
00247         }
00248         break;
00249     
00250     case TMR_MSG_ID:
00251         switch(d1)
00252         {
00253             case TFRWD_DOUBLECLICK:
00254                 if(TUNER_SEEK_DOWN == d2)   
00255                     sysParam.station = TUNER_tune(TUNER_DEC, sysParam.station);
00256                 else                        
00257                     sysParam.station = TUNER_tune(TUNER_INC, sysParam.station);
00258                 _updateRadioDisplay(sysParam.station, menu, DONTCARE);
00259                 break;
00260             
00261             case TTUNERSEEK:
00262                 if( _SEEK_DONE != _seektest())
00263                 {
00264                     unsigned int oldStation;
00265                     oldStation = sysParam.station;
00266                     if(TUNER_SEEK_DOWN == d2)   
00267                     {
00268                         sysParam.station = TUNER_tune(TUNER_DEC, sysParam.station);
00269                         if(oldStation < sysParam.station) {_seekdone(oldStation);}
00270                         else _seekcontinue();
00271                     }
00272                     else
00273                     {                       
00274                         sysParam.station = TUNER_tune(TUNER_INC, sysParam.station);
00275                         if(oldStation > sysParam.station) {_seekdone(oldStation);}
00276                         else _seekcontinue();
00277                     }               
00278                 }
00279                 else 
00280                 {
00281                     TMR_delete(TMR_TUNERSEEK);
00282 // Bugzilla #157 Pt. 2a
00283                     if(SYS_isAudioPaused())
00284                     {
00285                         SYS_toggleAudioPaused();                
00286                         mMENU_update(menu, 7, (ULONG)text_null, FALSE);
00287                         CODEC_hpVolume(sysParam.volume);
00288                     }
00289                     mMENU_refresh(menu);
00290                 }
00291                 _updateRadioDisplay(sysParam.station, menu, DONTCARE);
00292                 break;
00293         }   
00294         break;      
00295     }
00296     
00297     return P_RADIO;
00298 }

Here is the call graph for this function:

PARENT_STATE UI_PSF_record st_MSG msgIN  ) 
 

Function serves as the parent record state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 83 of file UI_PSF_record.c.

References AI_START, Audio, AUDIO_initInterface(), AUDIO_setInterface(), CLOCK_MP3RECORD, ENCODER_getAudioFormat(), ENCODER_getAudioMode(), ENCODER_setSource(), ES_SOURCE, st_AUDIOENERGY::FastPeak, st_AUDIOENERGY::FastPeakdB, FAT_delete(), FAT_freeSpace(), st_UI::fname, st_AUDIO::freeSpace, GEN_int2ASCII(), MENU_buf, st_AUDIO::mode, st_UI::path, st_SYSPARAM::recordTime, SAUDIOTIME_UPDT, st_AUDIOENERGY::SlowPeak, st_AUDIOENERGY::SlowPeakdB, SMEDIAFULL, SMSGBOX_EXIT, SSTATE_END, SSTATE_START, SYS_clockSetup(), TMR_create(), TMR_RECORDER, TMR_RECORDER_VU, and UI_msgbxCreate().

00084 {   
00085     MSG_ID          id = msgIN->id;     
00086     MSG_DATA        d1 = msgIN->d1; 
00087     MSG_DATA        d2 = msgIN->d2;
00088 //DeepB
00089 /*
00090     ULONG           recordIconList[4] = {   (ULONG)graf_icon_record1,
00091                                             (ULONG)graf_icon_record2,
00092                                             (ULONG)graf_icon_record3,
00093                                             (ULONG)graf_icon_record4};
00094 */
00095     switch(id)
00096     {
00097     case SYS_MSG_ID:
00098         
00099         switch(d1)
00100         {
00101             case SSTATE_START:
00102             {
00103                 SYS_clockSetup(CLOCK_MP3RECORD);
00104                 BAT_setLowThreshold(0x3a66); //3.65V*4096.
00105                 
00106                 ENCODER_setSource((ES_SOURCE)d2);
00107                 
00108                 Audio.freeSpace = FAT_freeSpace(SYS_isHDDpresent()?DISK_C:DISK_D);
00109                 if(Audio.freeSpace < DISK_RESERVED_SPACE)
00110                 {
00111                     UI_msgbxCreate(MSGBX_DISKFULL);
00112                     return P_RECORD;
00113                 }
00114                 
00115                 if(RFC_SUCCESS != _createRecFile(Ui.path, (ES_SOURCE)d2))
00116                 {
00117                     return P_NULL;
00118                 }
00119                 
00120                 AUDIO_initInterface(ENCODER_getAudioMode((USHORT)d2), 
00121                                     ENCODER_getAudioFormat(), 0, 0);
00122                 AUDIO_setInterface(AI_START);
00123 
00124                 _loadRecorderTmplt(Ui.fname, (int)d2);
00125                 menu = mMENU_create((void *)&MENU_buf[0]);
00126                 _gainDisplay();
00127                 _updateRecordTime(0);
00128                 mMENU_update(menu, 11, 0, FALSE);
00129                 TMR_create(TMR_RECORDER_VU, 10, TRECVUMETER, 0, AUTO_RELOAD);
00130                 if (sysParam.recordTime > 0) TMR_create(TMR_RECORDER, 39, TRECANIMATION, 0, AUTO_RELOAD);
00131 //              iconCount = 0;
00132                 if (sysParam.recordTime > 0) _togglePause();
00133                 return P_RECORD;
00134             }
00135             case SSTATE_END:
00136             {
00137                 _stopRecord();
00138                 return P_RECORDDONE;
00139             }
00140             case SAUDIOTIME_UPDT:
00141             {
00142                 _updateRecordTime(SYS_getCurRecordDuration());
00143                 return P_RECORD;
00144             }
00145             case SMSGBOX_EXIT:
00146             {
00147                 if(MENU_curMsgbx() == MSGBX_DISKFULL) 
00148                 {
00149                     SYS_usbEnabled();
00150                     SYS_recordNotActive();
00151                     return (Audio.mode == AM_RECFM) ? P_RADIO: P_NULL;
00152                 }
00153                 break;
00154             }
00155             case SMEDIAFULL:
00156             {
00157             }
00158         }   
00159         break;
00160     
00161     case TMR_MSG_ID:
00162         switch(d1)
00163         {
00164             case TRECVUMETER:
00165             {
00166                 unsigned short  i;
00167                 char            strLevel[8];
00168                 LeftInputEnergy.SlowPeakdB = AUDIO_Convert2dB(&LeftInputEnergy.SlowPeak);
00169                 RightInputEnergy.SlowPeakdB = AUDIO_Convert2dB(&RightInputEnergy.SlowPeak);
00170                 LeftInputEnergy.FastPeakdB = AUDIO_Convert2dB(&LeftInputEnergy.FastPeak);
00171                 RightInputEnergy.FastPeakdB = AUDIO_Convert2dB(&RightInputEnergy.FastPeak);
00172                 
00173                 LeftInputEnergy.FastPeakdB = (LeftInputEnergy.FastPeakdB > 60)? 60 : LeftInputEnergy.FastPeakdB;
00174                 RightInputEnergy.FastPeakdB = (RightInputEnergy.FastPeakdB > 60)? 60 : RightInputEnergy.FastPeakdB;
00175                 
00176                 lpeak = (lpeak < LeftInputEnergy.SlowPeakdB) ? lpeak : LeftInputEnergy.SlowPeakdB;
00177                 rpeak = (rpeak < RightInputEnergy.SlowPeakdB) ? rpeak : RightInputEnergy.SlowPeakdB;
00178                 
00179                 // Do Left Level
00180                 i = 0;
00181                 if (LeftInputEnergy.SlowPeakdB != 0) strLevel[i++] = '-';
00182                 i += GEN_int2ASCII( LeftInputEnergy.SlowPeakdB, &strLevel[i], FALSE, 0);
00183                 strLevel[i++] = 'd';
00184                 strLevel[i++] = 'B';
00185                 strLevel[i++] = '\0';
00186                 mMENU_update(menu, 5, (ULONG)strLevel, FALSE);
00187                 i = 0;
00188                 if (lpeak != 0) strLevel[i++] = '-';
00189                 i += GEN_int2ASCII( lpeak, &strLevel[i], FALSE, 0);
00190                 strLevel[i++] = '\0';
00191                 mMENU_update(menu, 8, (ULONG)strLevel, FALSE);
00192         
00193                 // Do Right Level       
00194                 i = 0;
00195                 if (RightInputEnergy.SlowPeakdB != 0) strLevel[i++] = '-';
00196                 i += GEN_int2ASCII( RightInputEnergy.SlowPeakdB, &strLevel[i], FALSE, 0);
00197                 strLevel[i++] = 'd';
00198                 strLevel[i++] = 'B';
00199                 strLevel[i++] = '\0';
00200                 mMENU_update(menu, 6, (ULONG)strLevel, FALSE);
00201                 i = 0;
00202                 if (rpeak != 0) strLevel[i++] = '-';
00203                 i += GEN_int2ASCII( rpeak, &strLevel[i], FALSE, 0);
00204                 strLevel[i++] = '\0';
00205                 mMENU_update(menu, 9, (ULONG)strLevel, FALSE);
00206                 _updateLevelBarGraphs();
00207                 mMENU_refresh(menu);
00208                 break;  
00209             }
00210             case TRECANIMATION:
00211             {
00212                 if ((SYS_getCurRecordDuration()) >= (sysParam.recordTime * 60) && (sysParam.recordTime != 0) )
00213                 {
00214                     _stopRecord();
00215                     return P_RECORDDONE;
00216                 }
00217                 break;
00218             }
00219         }
00220         break;
00221         
00222     case KBD_MSG_ID:
00223         switch(d1)
00224         {
00225             case KEY_HSELECT:
00226                 lpeak = 255;
00227                 rpeak = lpeak;
00228                 break;
00229 //DeepB
00230 // Stop recordings only with the HiSi button
00231 //          case KEY_BACK:
00232             case KEY_HISI:
00233                 _stopRecord();
00234                 
00235                 if( 5 > SYS_getCurRecordDuration())
00236                 {
00237                     FAT_delete(Ui.path);
00238                     
00239                     if (SYS_isHDDpresent()) HDD_setPowerMode(HDD_POWEROFF, 0);
00240                     
00241                     return (SYS_isRadioActive())? P_RADIO: P_NULL;
00242                 }
00243 
00244                 return P_RECORDDONE;
00245                 
00246             case KEY_PLAY:
00247                 _togglePause();
00248                 return P_RECORD;
00249                 
00250             case KEY_FORWARD:           
00251             case KEY_RFORWARD:          
00252             case KEY_HFORWARD:          
00253                 _timeUp();
00254                 return P_RECORD;
00255                 
00256             case KEY_REWIND:    
00257             case KEY_RREWIND:
00258             case KEY_HREWIND:
00259                 _timeDown();
00260                 return P_RECORD;
00261             case KEY_HUP:
00262             case KEY_UP:
00263             case KEY_RUP:
00264                 _gainUp();
00265                 return P_RECORD;
00266             case KEY_HDOWN:
00267             case KEY_DOWN:
00268             case KEY_RDOWN:
00269                 _gainDown();
00270                 return P_RECORD;
00271         }
00272         break;
00273     }
00274     
00275     return P_RECORD;
00276 }

Here is the call graph for this function:

PARENT_STATE UI_PSF_recorddone st_MSG msgIN  ) 
 

Function serves as the parent record complete state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 56 of file UI_PSF_recorddone.c.

References AI_SHUTDOWN, AUDIO_setInterface(), BTN_YES, ENCODER_getSource(), FAT_delete(), st_UI::fname, GEN_createTimeString(), MENU_buf, MENU_CLOSE, st_UI::path, SMSGBOX_EXIT, SSTATE_END, SSTATE_START, SXIM_CREATE, SXIM_EXIT, TMR_create(), TMR_delete(), and TMR_RECORDDONE.

00057 {   
00058     MSG_ID          id = msgIN->id;     
00059     MSG_DATA        d1 = msgIN->d1; 
00060     MSG_DATA        d2 = msgIN->d2;
00061 
00062     switch(id)
00063     {
00064     case SYS_MSG_ID:
00065         
00066         switch(d1)
00067         {
00068             case SSTATE_START:
00069             {
00070                 char    strDuration[16];                
00071 
00072                 _loadRecorderDoneTmplt(Ui.fname, (int)ENCODER_getSource());
00073                 menu = mMENU_create((void *)&MENU_buf[0]);
00074                 GEN_createTimeString(SYS_getCurRecordDuration(), strDuration);          
00075                 mMENU_update(menu, 4, (ULONG)strDuration, FALSE);
00076                 mMENU_refresh(menu);
00077                 TMR_create(TMR_RECORDDONE, 250, TRECORDDONE, 0, NO_RELOAD);
00078 
00079                 return P_RECORDDONE;
00080             }
00081             case SSTATE_END:
00082             {
00083                 mMENU_action(menu, MENU_CLOSE);
00084                 TMR_delete(TMR_RECORDDONE);
00085 
00086                 _addRecord2Db();
00087 
00088                 if(SYS_isRadioActive()) 
00089                 {
00090                     AUDIO_setInterface(AI_SHUTDOWN);
00091                 }
00092                 return P_NULL;
00093             }
00094             case SMSGBOX_EXIT:
00095             {
00096                 if(MENU_curMsgbx() == MSGBX_DELETERECORDFILE)
00097                 {
00098                     if(BTN_YES == d2)
00099                     {
00100                         mMENU_action(menu, MENU_CLOSE);
00101                         TMR_delete(TMR_RECORDDONE);
00102                         FAT_delete(Ui.path);
00103                         
00104                         if(SYS_isRadioActive()) return P_RADIO;
00105                         return P_NULL;                      
00106                     }
00107                     else TMR_create(TMR_RECORDDONE, 250, TRECORDDONE, 0, NO_RELOAD);
00108                 }               
00109             }
00110             case SXIM_EXIT: return _ximAction(msgIN);   
00111         }   
00112         break;
00113     
00114     case TMR_MSG_ID:
00115         switch(d1)
00116         {
00117             case TRECORDDONE:
00118             {
00119                 mMENU_action(menu, MENU_CLOSE);
00120                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SSTATE_END, DONTCARE, SYS_FOREVER);
00121                 _addRecord2Db();
00122                 if(SYS_isRadioActive()) return P_RADIO;
00123                 return P_NULL;
00124             }
00125         }
00126         break;
00127                 
00128     case KBD_MSG_ID:
00129         switch(d1)
00130         {
00131             case KEY_BACK:
00132                 TMR_delete(TMR_RECORDDONE);
00133                 mMENU_action(menu, MENU_CLOSE);
00134                 _addRecord2Db();
00135                 if(SYS_isRadioActive()) return P_RADIO;
00136                 return P_NULL;
00137 
00138             case KEY_PLAY:
00139                 _playRecord(msgIN);
00140                 return P_PLAY;
00141             
00142             case KEY_SELECT:
00143                 TMR_delete(TMR_RECORDDONE);
00144                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SXIM_CREATE, XIMWIN_RECORDDONE, SYS_FOREVER);
00145                 break;          
00146         }
00147         break;
00148     }
00149     
00150     return P_RECORDDONE;
00151 }

Here is the call graph for this function:

PARENT_STATE UI_PSF_sleep st_MSG msgIN  ) 
 

Function serves as the parent sleep state handle.

This is where system gets shutdown with the power cable plugged in. When coming here, only following 4 messages can possibly wake system up, 1), PLAY press; 2), HiSi press; 3), USB plug; 4), Alarm fired. and 5) Unplug of power cabe or hold key-back will completely shut down system.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 65 of file UI_PSF_sleep.c.

References ALL_LED, BOOT_AUTOLAUNCH1, BOOT_HHISI, BOOT_MAIN, KBD_isKeyDown(), KDOWN, LCD_power(), LED_OFF, SPOWER_UNPLUG, SPSF_NULL, SSHUT_DOWN, SSTART2HISI, SSTART2RECORD, SSTATE_END, SSTATE_START, SUSB_PLUG, SYS_autoffDisable(), SYS_delayMicrosecond(), SYS_onOffLEDs(), USB_cableStatusInit(), and st_SYSPARAM::x_hisibutton.

00066 {   
00067     st_MSG          msgOUT;
00068     MSG_ID          id = msgIN->id;     
00069     MSG_DATA        d1 = msgIN->d1; 
00070     MSG_DATA        d2 = msgIN->d2;
00071 
00072     if( (SYS_MSG_ID == id)&&(SSTATE_START == d1) )
00073     {
00074         // Wait till system status is stable.
00075         SYS_delayMicrosecond(300000);
00076             
00077         if( (!SYS_isPowerPlugged()) || (SYS_isBatDead()) ||
00078             !( (HDD_ID == 0xA017) || (HDD_ID == 0xA018) ) ) // is a usb 2.0 backpack? -wk
00079         {
00080             LCD_power(LCD_POWER_OFF, 0);    
00081             SYS_onOffLEDs(ALL_LED, LED_OFF);
00082 
00083             // Wait till LCD stably shuts down.
00084             SYS_delayMicrosecond(1000000);
00085             _shutDown();
00086         }
00087         else
00088         {
00089             //SYS_clockSetup(CLOCK_SLEEP);
00090             SYS_autoffDisable();
00091             
00092             USB_cableStatusInit();
00093             SYS_usbEnabled();
00094             
00095             // Tell system to do the charge animation.
00096             SYS_batteryAnimation();
00097 
00098             // Reenble keyboard routine here.
00099             SYS_kbdEnabled();
00100         }
00101     }
00102     else if( ((KBD_MSG_ID == id)&&((KEY_PPLAY == d1)||(KEY_PLAY == d1)))||
00103         ((SYS_MSG_ID == id)&&((SUSB_PLUG == d1)||(SSHUT_DOWN == d1))) ) 
00104 //DeepB
00105 // Disable USB Cable detection
00106 //  else if( ((KBD_MSG_ID == id)&&((KEY_PPLAY == d1)||(KEY_PLAY == d1)))||
00107 //      ((SYS_MSG_ID == id)&&(SSHUT_DOWN == d1)) ) 
00108     {
00109         if(TRUE == KBD_isKeyDown(KDOWN))
00110         {           
00111             SYS_reboot(BOOT_AUTOLAUNCH1);
00112         }
00113         SYS_reboot(BOOT_MAIN);          
00114     }
00115 //DeepB
00116     else if( (((SYS_MSG_ID == id)&&(SSTART2RECORD == d1))||
00117         ((SYS_MSG_ID == id)&&(SSTART2HISI == d1)) ) && (sysParam.x_hisibutton < XTRA_HISI_OFF))
00118     {
00119         SYS_reboot(BOOT_HHISI);         
00120     }
00121     else if( ( (SYS_MSG_ID == id) && (SPOWER_UNPLUG == d1) ) || 
00122              ( (KBD_MSG_ID == id) && (KEY_HBACK == d1) ) // check for key-left -wk
00123              )
00124     {
00125             _shutDown();
00126     }
00127     else if( (SYS_MSG_ID == id)&&(SSTATE_END == d1) )
00128     {
00129         mMSG_send(sysMsgQ, SYS_MSG_ID, SPSF_NULL, DONTCARE, SYS_FOREVER);
00130         return P_SLEEP;
00131     }
00132     //else if alarm here...
00133     return P_SLEEP;
00134 }

Here is the call graph for this function:

void UI_readRTC st_DATETIME pDateTime  ) 
 

Function reads back the RTC time in UI format.

Parameters:
pDateTime GUI date time structure pointer.

Definition at line 38 of file UI_rtc.c.

References RTC_BCD2INT(), RTC_readTime(), and st_SYSPARAM::year.

Referenced by UI_MENU_dateTime().

00039 {
00040     st_TIME     t;
00041     RTC_readTime(&t);
00042             
00043     pDateTime->month = RTC_BCD2INT(MONTH, t.Month);
00044     pDateTime->day = RTC_BCD2INT(DAY, t.Day);
00045             
00046 
00047     /* High bits of year are stored away in E2ROM. */
00048     pDateTime->year = (sysParam.year/100)*100   + RTC_BCD2INT(YEAR, t.Year);
00049     pDateTime->hour = RTC_BCD2INT(HOUR, t.Hour);
00050 
00051     // be careful at the boundry
00052     if(pDateTime->hour > 12 )
00053     {   
00054         pDateTime->am = 0;  
00055         pDateTime->hour -= 12;
00056     }
00057     else 
00058     {   
00059         // 12:00 in 24 hr is 12:00pm in 12 hr
00060         if ( pDateTime->hour == 12 )
00061             pDateTime->am = 0;
00062         else 
00063         {       
00064             // 00:00 is 12:00am in 12 hr
00065             if ( pDateTime->hour == 0 )
00066                 pDateTime->hour = 12;
00067                 
00068             pDateTime->am = 1;
00069         }
00070     }
00071         
00072     pDateTime->minute = RTC_BCD2INT(MINUTE, t.Minute);
00073 }

Here is the call graph for this function:

void UI_removeXIM int *  pXIMbuf,
int  item
 

Function removes specified XIM item from XIM buffer.

Parameters:
pXIMbuf XIM data buffer.
item item specifier.

Definition at line 179 of file UI_CSF_xim.c.

00180 {
00181     int *   pData;
00182     int     len, tmp, itemNum;
00183     ULONG   dptr;
00184     
00185     len = *pXIMbuf;
00186     
00187     if(len == 0) return;
00188     else
00189     {   
00190         /* Get itemNum. */
00191         itemNum = pXIMbuf[1] & 0x007F;
00192     
00193         if(itemNum <= item) return;
00194         
00195         /* Decrease item number. */
00196         pXIMbuf[1] = itemNum - 1;
00197         
00198         if(pXIMbuf[1] == 0)
00199         {       
00200             pXIMbuf[0] = 0;
00201             return;
00202         }
00203             
00204         /* Adjustify pDspData and pActionData for all items */
00205         
00206         /* Points to first XIM item data pointer. */
00207         pData = pXIMbuf + 4;
00208         
00209         for( tmp = 0; tmp < itemNum; tmp++ )
00210         {   
00211             dptr = ((unsigned long)(*pData)<<16)|((unsigned short)*(pData+1));
00212             
00213             /* If NULL, no data associated. */
00214             if(dptr)
00215             {           
00216                 dptr -= XIM_ITEM_HEADER_LEN;
00217         
00218                 *pData++ = dptr >> 16;
00219             
00220                 *pData++ = dptr & 0xFFFF;
00221             }
00222             else pData += 2;
00223             
00224     
00225             dptr = ((unsigned long)(*pData)<<16)|((unsigned short)*(pData+1));
00226             
00227             /* If NULL, no data associated. */
00228             if(dptr)
00229             {           
00230                 dptr -= XIM_ITEM_HEADER_LEN;
00231         
00232                 *pData++ = dptr >> 16;
00233             
00234                 *pData++ = dptr & 0xFFFF;
00235             }
00236             else pData += 2;
00237         
00238             /* Points to next XIM item. */
00239             pData += 2;
00240         }
00241         
00242         
00243         /* Release removed item header. */
00244         pData = pXIMbuf + 2 + (item*XIM_ITEM_HEADER_LEN);
00245         
00246         memmove(    pData, 
00247                     pData + XIM_ITEM_HEADER_LEN, 
00248                     len - ((item+1)*XIM_ITEM_HEADER_LEN) - 2 );
00249     }
00250     
00251     /* Update XIM data len. */
00252     pXIMbuf[0] = len - XIM_ITEM_HEADER_LEN;
00253 }

void UI_setupTextMenu ULONG  tmpltStart,
UINT *  pValue,
UINT *  pActvItem,
ITEMICONCTL  icon
 

Function loads text menu controls into global menu buffer and ready the menu creation function.

Parameters:
tmpltStart Text menu template data pointer.
pValue Selected item value pointer.
pActvItem Active item value pointer if not NULL.
icon Associated item icon ID.

Definition at line 43 of file UI_setupTextMenu.c.

References ITEMICONCTL, and MENU_buf.

Referenced by UI_MENU_audio(), UI_MENU_autoff(), UI_MENU_backlight(), UI_MENU_bkpkSwap(), UI_MENU_bkpkSwapCtls(), UI_MENU_diag_hdd(), UI_MENU_diag_nand(), UI_MENU_diagnosis(), UI_MENU_eq(), UI_MENU_hisi(), UI_MENU_main(), UI_MENU_myfi(), UI_MENU_myfiMode(), UI_MENU_myfiQuality(), UI_MENU_recordQuality(), UI_MENU_repeat(), UI_MENU_settings(), UI_MENU_shuffle(), UI_MENU_xtra(), UI_MENU_xtra_backlight(), UI_MENU_xtra_carmode(), UI_MENU_xtra_granularity(), UI_MENU_xtra_hisi(), UI_MENU_xtra_layout(), UI_MENU_xtra_mute(), and UI_MENU_xtra_scrollwrap().

00047 {
00048     UINT        topItem;
00049     UINT        actvItem;
00050     USHORT *    pD;
00051     
00052     UI_assert((USHORT)pValue, UI_SETUPTEXTMENU);
00053     //UI_assert((USHORT)pActvItem, UI_SETUPTEXTMENU2);
00054 
00055     if(pActvItem) actvItem = *pActvItem;
00056     else          actvItem = *pValue;
00057     
00058     /* Calculate top item and adjust active item. */
00059     topItem = (actvItem>MENU_MAXITEMPERSCREEN)? actvItem-MENU_MAXITEMPERSCREEN+1 : 1;
00060     actvItem -= topItem;
00061     
00062     pD = (USHORT *)&MENU_buf[0];
00063     *pD++ = DP_LISTMENU;    
00064     GEN_readXdata(tmpltStart, pD++, 1);     // itemNum              
00065     *pD++ = actvItem;                       // actvItem             
00066     *pD++ = topItem;                        // topItem
00067     *pD++ = icon;                           // itemicon.
00068     *pD++ = ((ULONG)_getRomDptr>>16);
00069     *pD++ = ((ULONG)_getRomDptr) & 0xFFFF;
00070                 
00071     *pD++ = (USHORT)(tmpltStart>>16);       // getdptr controls
00072     *pD++ = (USHORT)(tmpltStart & 0xFFFF);
00073                 
00074     *pD++ = (USHORT)pValue;                 // pValue
00075     *pD   = (USHORT)pActvItem;              // pActvItem
00076     
00077 }

STATE UI_SF_autoscan st_MSG msgIN  ) 
 

Function serves as the autoscan state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 50 of file UI_SF_autoscan.c.

References MENU_buf, MENU_CLOSE, MSG_send(), st_SYSPARAM::myfiChannel, SBROWSE, SDBBROWSE, SMENUBROWSE, SSTART2PLAY, SSTATE_END, SSTATE_START, SYS_autoffDisable(), TMR_AUTOSCAN, TMR_create(), and TMR_delete().

00051 {   
00052     ULONG           dptr;
00053     MSG_ID          id = msgIN->id;     
00054     MSG_DATA        d1 = msgIN->d1; 
00055     MSG_DATA        d2 = msgIN->d2;
00056 //DeepB
00057 /*
00058     ULONG           scanIconList[12] = {            
00059                         (ULONG)graf_icon_seek1,
00060                         (ULONG)graf_icon_seek2,
00061                         (ULONG)graf_icon_seek3,
00062                         (ULONG)graf_icon_seek4,
00063                         (ULONG)graf_icon_seek5,
00064                         (ULONG)graf_icon_seek6,
00065                         (ULONG)graf_icon_seek7,                     
00066                         (ULONG)graf_icon_seek8,
00067                         (ULONG)graf_icon_seek9,
00068                         (ULONG)graf_icon_seek10,
00069                         (ULONG)graf_icon_seek11,
00070                         (ULONG)graf_icon_seek12
00071                         };
00072 */
00073     switch(id)
00074     {
00075     case SYS_MSG_ID:
00076         switch(d1)
00077         {
00078             case SSTATE_START:
00079             {
00080                 SYS_autoffDisable();
00081                 AUTOSCAN_init();
00082                 
00083                 TMR_create(TMR_AUTOSCAN, BASETIMER, TAUTOSCAN, 0, AUTO_RELOAD);
00084                 
00085 //DeepB
00086 //              animation = 0;
00087 //              iconCount = 0;
00088                 MENU_buf[0] = DP_AUTOSCAN;
00089                 menu = mMENU_create((void*)&MENU_buf[0]);
00090                 return S_AUTOSCAN;
00091             }
00092             case SSTATE_END:
00093             {
00094                 mMENU_action(menu, MENU_CLOSE);
00095                 TMR_delete(TMR_AUTOSCAN);
00096                 AUTOSCAN_stop();
00097                 return S_MENU;
00098             }
00099             case SBROWSE:
00100             case SMENUBROWSE:
00101             case SDBBROWSE:
00102             case SSTART2PLAY: return S_AUTOSCAN;
00103         }       
00104         break;
00105         
00106     case KBD_MSG_ID:
00107         switch(d1)
00108         {
00109         case KEY_BACK:
00110             mMENU_action(menu, MENU_CLOSE);
00111             TMR_delete(TMR_AUTOSCAN);
00112             AUTOSCAN_stop();
00113             return S_MENU;
00114         }
00115         break;
00116         
00117     case TMR_MSG_ID:
00118         
00119         if(TAUTOSCAN == d1)
00120         {
00121             BOOL ret;
00122             int  channel;
00123             
00124             if(!SYS_isHPpresent())
00125             {
00126                 mMENU_action(menu, MENU_CLOSE);
00127                 TMR_delete(TMR_AUTOSCAN);
00128                 AUTOSCAN_stop();
00129                 return S_MENU;
00130             }
00131             
00132             ret = AUTOSCAN_scan(&channel);
00133 //          if((++animation == ANIMATIONTIMER)||(TRUE == ret))
00134 //          {
00135 //DeepB
00136 //              animation = 0;  
00137 //              _displayMyfiChannel(channel);
00138 //              
00139 //              dptr = scanIconList[iconCount++];           
00140 //              mMENU_update(menu, 1, dptr, FALSE);
00141 //              if(iconCount == 12) iconCount = 0;
00142                 
00143                 if(TRUE == ret)
00144                 {
00145                     sysParam.myfiChannel = MAX_CHANNEL-(2*(channel));
00146                     mMENU_update(menu, 5, 0, FALSE);
00147                     TMR_delete(TMR_AUTOSCAN);
00148                 }               
00149                 mMENU_refresh(menu);
00150 //          }
00151             return S_AUTOSCAN;
00152         }
00153         
00154         break;
00155     }
00156     
00157     MSG_send(uiParentMsgQ, msgIN, SYS_FOREVER);
00158     return S_AUTOSCAN;
00159 }

Here is the call graph for this function:

STATE UI_SF_dbmenu st_MSG msgIN  ) 
 

Function serves as the DB menu state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 104 of file UI_SF_dbmenu.c.

References st_DBNAV::audio, BTN_NEUROS, BTN_PCDELETE, BTN_YES, DB_getSaiByMdb(), MENU_2NEXT, MENU_2PREV, MENU_action(), MENU_buf, MENU_CLOSE, MENU_JUMPDN, MENU_JUMPUP, MENU_SELECT, MENU_TNEXT, MENU_TPREV, MENU_TSELECT, MENU_TXTSCROLL, MSG_send(), st_DBNAV::pcaudio, SMENUBROWSE, SMSGBOX_EXIT, SRESUMEPLAY, SSTART2PLAY, SSTATE_END, SSTATE_START, SXIM_CREATE, SXIM_EXIT, UI_isPresetValid(), UI_m3uActvItem(), UI_m3uEntryNum(), UI_msgbxCreate(), and UI_presetAudio().

00105 {   
00106     MSG_ID          id = msgIN->id;     
00107     MSG_DATA        d1 = msgIN->d1; 
00108     MSG_DATA        d2 = msgIN->d2;
00109     USHORT          ii;
00110 
00111     switch(id)
00112     {
00113     case SYS_MSG_ID:
00114         switch(d1)
00115         {
00116             case SSTATE_START:
00117             {
00118                 // +-------------+
00119                 // | dbID        |
00120                 // +-------------+
00121                 // | fldIdx      |
00122                 // +-------------+
00123                 // | fldEntry    |
00124                 // +-------------+
00125                 // | actvItem    |
00126                 // +-------------+
00127                 // +-------------+
00128                 // | Invalid dbID|
00129                 // +-------------+
00130                 // | Caller State|
00131                 // +-------------+
00132                 DB_id       =   GEN_popStack();
00133                 DB_fldIdx =     GEN_popStack();
00134                 DB_fldEntry =   GEN_popStack();                     
00135                 DB_actvItem =   GEN_popStack();
00136                                         
00137                 if(_validateDB() == 0 )
00138                 {
00139                     UI_msgbxCreate(MSGBX_DBRECORDNA);
00140                     return(_dbStateEnd());
00141                     
00142                 }
00143                 else menu = mMENU_create((void*)&MENU_buf[0]);
00144                 return S_DBMENU;
00145             }
00146             case SSTATE_END:
00147             {
00148                 return(_dbStateEnd());
00149             }
00150             case SXIM_EXIT: 
00151             {
00152                 return(_ximAction(d2));
00153             }
00154             case SMSGBOX_EXIT:
00155             {
00156                 switch(MENU_curMsgbx())
00157                 {
00158                     case MSGBX_DELETEHISICLIP:
00159                     {
00160                         if(BTN_YES == d2)
00161                         {
00162                             mMENU_action(menu, MENU_CLOSE);
00163                             _deleteHisiClip();
00164                             if(_validateDB() == 0 )
00165                             {
00166                                 return(_dbStateEnd());
00167                             }
00168                             menu = mMENU_create((void*)&MENU_buf[0]);
00169                         }
00170                         break;
00171                     }
00172                     case MSGBX_DELETERECORD:
00173                     {
00174                         if(BTN_NEUROS == d2)
00175                         {
00176                             mMENU_action(menu, MENU_CLOSE);
00177                             _deleteRecord();
00178                             if(_validateDB() == 0 )
00179                             {
00180                                 return(_dbStateEnd());
00181                             }
00182                             menu = mMENU_create((void*)&MENU_buf[0]);
00183                         }
00184                         else if(BTN_PCDELETE == d2)
00185                         {
00186                             mMENU_action(menu, MENU_CLOSE);
00187                             _pcdeleteRecord();
00188                             if(_validateDB() == 0 )
00189                             {
00190                                 return(_dbStateEnd());
00191                             }
00192                             menu = mMENU_create((void*)&MENU_buf[0]);
00193                         }
00194                         break;
00195                     }
00196                     case MSGBX_DELETEONSYNC:
00197                     {
00198                         if(BTN_YES == d2)
00199                         {
00200                             _deleteOnsync();
00201                         }
00202                         break;
00203                     }
00204                     case MSGBX_REMOVERECORD:
00205                     {
00206                         if(BTN_YES == d2)
00207                         {   
00208                             mMENU_action(menu, MENU_CLOSE);
00209                             _removeRecord();
00210                             if(_validateDB() == 0 )
00211                             {
00212                                 return(_dbStateEnd());
00213                             }
00214                             menu = mMENU_create((void*)&MENU_buf[0]);
00215                         }
00216                         break;
00217                     }                   
00218                 }
00219                 return S_DBMENU;
00220             }
00221 //DeepB
00222 #ifdef USE_DATABASE_HACKS
00223             case SSTART2PLAY:
00224             {
00225                 mMENU_action(menu, MENU_SELECT);            
00226                 mMENU_action(menu, MENU_CLOSE);
00227 
00228                 GEN_pushStack(DB_actvItem); // actvItem
00229                 GEN_pushStack(DB_fldEntry); // fldEntry
00230                 GEN_pushStack(DB_fldIdx); // fldIdx
00231                 GEN_pushStack(DB_id);               
00232                 GEN_pushStack(S_DBMENU);
00233                 
00234                 SYS_notUseSavedRandomPattern();
00235                 
00236                 // Set up to play.
00237                 if( (DB_rootID(DB_id) == DBnav.pcaudio) )
00238                 {
00239                     // Play all if no history available and queue is empty.   
00240                     if( (FALSE == UI_isPresetValid(0))||(PRESET_RADIO == UI_presetType(0)) )
00241                     {
00242                         #ifdef M3U_SUPPORT
00243                         if(UI_m3uEntryNum(0))
00244                         {
00245                             UI_presetAudio(0, 0x1234, UI_m3uActvItem(0), DONTCARE, DONTCARE, 0);
00246                         }
00247                         else
00248                         #endif
00249                         {
00250                             UI_presetAudio(0, DBnav.audio, DONTCARE, 0, -1, 0);
00251                         }
00252                     }
00253                     else
00254                     {
00255                         SYS_useSavedRandomPattern();
00256                     }                   
00257                 }
00258                 else
00259                 {
00260                     // If nothing is specifically selected here, play all instead.
00261                     if(0 == DB_selected)
00262                     {
00263                         UI_presetAudio(0, DBnav.audio, DONTCARE, 0, -1, 0);
00264                     }
00265                 
00266                     else
00267                     {
00268                         if(DB_id == DB_rootID(DB_id))
00269                         {
00270                             UI_presetAudio(0, DB_id, DB_actvItem, DB_fldEntry, DB_fldIdx, 0);
00271                         }
00272                         else
00273                         {
00274                             DB_ENTRY fldEntry;
00275                             
00276                             // Hard-coded to support artist under album, in which case always play
00277                             // the first available album.
00278                             if(6 == DB_id)
00279                             {
00280                                 _navDB();
00281                                 {
00282                                     menu = mMENU_create((void*)&MENU_buf[0]);
00283                                     mMENU_action(menu, MENU_SELECT);
00284                                     mMENU_action(menu, MENU_CLOSE);
00285                                 }
00286                             }
00287                             
00288                             fldEntry = DB_getSaiByMdb(((ULONG)dbBUF[0]<<16)|dbBUF[1], DB_id);
00289                             
00290                 
00291                             //UI_presetAudio(0, DB_rootID(DB_id), DONTCARE, DB_actvItem, DB_fieldIndex(DB_id), 0);
00292                             UI_presetAudio(0, DB_rootID(DB_id), DONTCARE, fldEntry, DB_fieldIndex(DB_id), 0);
00293                         }
00294                     }
00295                 }
00296 
00297                 GEN_pushStack(DONTCARE);
00298                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SSTART2PLAY, 0, SYS_FOREVER);
00299                 return S_NULL;
00300             }
00301 #else // #ifdef USE_DATABASE_HACKS
00302 // I like this KISS approach better
00303             case SSTART2PLAY:
00304             {
00305                 mMENU_action(menu, MENU_SELECT);            
00306                 mMENU_action(menu, MENU_CLOSE);
00307                 
00308                 GEN_pushStack(DB_actvItem); // actvItem
00309                 GEN_pushStack(DB_fldEntry); // fldEntry
00310                 GEN_pushStack(DB_fldIdx); // fldIdx
00311                 GEN_pushStack(DB_id);               
00312                 GEN_pushStack(S_DBMENU);
00313 
00314                 if (_navDB())
00315                     UI_presetAudio(0, DB_id, DB_actvItem, DB_fldEntry, DB_fldIdx, 0);
00316                 else
00317                     UI_presetAudio(0, DBnav.audio, DONTCARE, 0, -1, 0);
00318                 
00319                 GEN_pushStack(DONTCARE);
00320                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SSTART2PLAY, 0, SYS_FOREVER);
00321                 return S_NULL;
00322             }
00323 #endif // #ifdef USE_DATABASE_HACKS
00324             case SRESUMEPLAY:
00325             {
00326                 mMENU_action(menu, MENU_SELECT);
00327                 mMENU_action(menu, MENU_CLOSE);
00328 
00329                 GEN_pushStack(DB_actvItem); // actvItem
00330                 GEN_pushStack(DB_fldEntry); // fldEntry
00331                 GEN_pushStack(DB_fldIdx); // fldIdx
00332                 GEN_pushStack(DB_id);
00333                 
00334                 GEN_pushStack(S_DBMENU);
00335                 
00336                 GEN_pushStack(DONTCARE);                
00337                 MSG_send(uiParentMsgQ, msgIN, SYS_FOREVER);
00338                 return S_NULL;
00339             }
00340             case SMENUBROWSE:
00341             {
00342                 UINT * pD = (UINT*)d2;
00343                 GEN_pushStack(S_NULL);
00344                             
00345                 GEN_pushStack(*pD++);
00346                 if(*pD != DONTCARE) GEN_pushStack(*pD);
00347                 pD++;
00348                 
00349                 GEN_pushStack(S_NULL);
00350                 GEN_pushStack(MENU_NULL);
00351                 GEN_pushStack(*pD);
00352                 return S_MENU;          
00353             }
00354         }                           
00355         break;
00356         
00357     case KBD_MSG_ID:
00358         switch(d1)
00359         {
00360         case KEY_PLAY:
00361             if(SYS_isAudioActive())
00362             {
00363                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SSTATE_END, DONTCARE, SYS_FOREVER); 
00364             }
00365             MSG_send(uiParentMsgQ, msgIN, SYS_FOREVER);
00366             return S_DBMENU;
00367                                 
00368         case KEY_DOWN:
00369         case KEY_HDOWN:
00370             mMENU_action(menu, MENU_2NEXT);
00371             return S_DBMENU;
00372         
00373         case KEY_RDOWN:
00374             ii = (d2/(KDOWN_HOLD_TIME>>1)) - 2;
00375             ii = (ii > 6)? 6 : ii;
00376             mMENU_action(menu, MENU_JUMPDN|(2<<ii));
00377             return S_DBMENU;
00378             
00379         case KEY_UP:
00380         case KEY_HUP:
00381             mMENU_action(menu, MENU_2PREV);
00382             return S_DBMENU;
00383 
00384         case KEY_RUP:
00385             ii = (d2/(KDOWN_HOLD_TIME>>1)) - 2;
00386             ii = (ii > 6)? 6 : ii;
00387             mMENU_action(menu, MENU_JUMPUP|(2<<ii));
00388             return S_DBMENU;
00389 
00390         case KEY_FORWARD:
00391         {
00392 //DeepB
00393 // Here is where i should check 
00394 // if the leading char is not a letter.
00395             unsigned char  curLeadCh = toupper(dbBUF[3]>>8);
00396             unsigned short curItem;
00397             
00398             mMENU_action(menu, MENU_2NEXT);
00399             mMENU_action(menu, MENU_SELECT);
00400             curItem = DB_actvItem;
00401             while(1)
00402             {
00403                 if(toupper(dbBUF[3]>>8) != curLeadCh) break;
00404                 mMENU_action(menu, MENU_TNEXT);
00405                 mMENU_action(menu, MENU_TSELECT);
00406                 if(DB_actvItem == curItem) break;
00407             }
00408             MENU_action(menu, MENU_JUMPDN);
00409             return S_DBMENU;
00410         }   
00411 
00412         case KEY_REWIND:
00413         {
00414             unsigned char  curLeadCh = toupper(dbBUF[3]>>8);
00415             unsigned short curItem;
00416             
00417             mMENU_action(menu, MENU_2PREV);
00418             mMENU_action(menu, MENU_SELECT);
00419             curItem = DB_actvItem;
00420             while(1)
00421             {
00422                 if(toupper(dbBUF[3]>>8) != curLeadCh) break;
00423                 mMENU_action(menu, MENU_TPREV);
00424                 mMENU_action(menu, MENU_TSELECT);
00425                 if(DB_actvItem == curItem) break;
00426             }
00427             MENU_action(menu, MENU_JUMPUP);
00428             return S_DBMENU;
00429         }   
00430 
00431 //DeepB
00432 // Creates Xi Menu for folders too.
00433 // Broken right now.
00434         case KEY_HSELECT:       
00435         {
00436             UI_msgbxCreate(MSGBX_NOTIMPLEMENTED);   
00437 //          mMENU_action(menu, MENU_SELECT);            
00438 //          _navDB();
00439 //          _setupDBxim(dbHdl);
00440 //          mMSG_send(uiChildMsgQ, SYS_MSG_ID, SXIM_CREATE, XIMWIN_DB|dbHdl, SYS_FOREVER);  
00441 //          return S_DBMENU;
00442         }
00443         break;
00444         case KEY_SELECT:        
00445         {
00446             int     navRet;
00447             DB_ID   _id;
00448             int     _fldIdx;
00449             int     _actvItem;
00450             int     _fldEntry;
00451 
00452             mMENU_action(menu, MENU_SELECT);            
00453 
00454             // Save a copy of controls.
00455             _actvItem = DB_actvItem;
00456             _fldEntry = DB_fldEntry;
00457             _fldIdx   = DB_fldIdx;
00458             _id       = DB_id;
00459                                     
00460             navRet =_navDB();
00461             if( 0 == navRet )
00462             {
00463                 // No record available, restore the original DB controls.
00464                 DB_id       = _id;
00465                 DB_fldIdx   = _fldIdx;
00466                 DB_fldEntry = _fldEntry;
00467                 DB_actvItem = _actvItem;
00468                 _validateDB();
00469                 
00470                 UI_msgbxCreate(MSGBX_DBRECORDNA);
00471             }
00472             else if( -1 == navRet )
00473             {
00474                 mMENU_action(menu, MENU_CLOSE);
00475                 // Nav forward, save history on stack.
00476                 GEN_pushStack(_actvItem); // actvItem
00477                 GEN_pushStack(_fldEntry); // fldEntry
00478                 GEN_pushStack(_fldIdx); // fldIdx
00479                 GEN_pushStack(_id);
00480                 menu = mMENU_create((void*)&MENU_buf[0]);
00481             }
00482             else
00483             {
00484                 _setupDBxim(dbHdl);
00485                 mMSG_send(uiChildMsgQ, SYS_MSG_ID, SXIM_CREATE, XIMWIN_DB|dbHdl, SYS_FOREVER);  
00486             } 
00487             return S_DBMENU;
00488         }
00489         case KEY_BACK: return(_dbStateEnd());
00490             
00491         }
00492         break;
00493         
00494     case TMR_MSG_ID:
00495         switch(d1)
00496         {
00497             case TTXTSCROLL:
00498                 mMENU_action(menu, MENU_TXTSCROLL);
00499                 return S_DBMENU;
00500         
00501         }
00502         break;
00503     }
00504     
00505     MSG_send(uiParentMsgQ, msgIN, SYS_FOREVER);
00506     return S_DBMENU;
00507 }

Here is the call graph for this function:

STATE UI_SF_menu st_MSG msgIN  ) 
 

Function serves as the menu state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 67 of file UI_SF_menu.c.

References st_DBNAV::audio, CODE_CONST, MENU_2NEXT, MENU_2PREV, MENU_buf, MENU_CLOSE, MENU_FWD, MENU_JUMPDN, MENU_JUMPUP, MENU_RWD, MENU_SELECT, MENU_TIME_UPDT, MENU_TXTSCROLL, MSG_send(), SAUDIOTIME_UPDT, st_SYSPARAM::sleepCount, st_SYSPARAM::sleepTimer, SMSGBOX_EXIT, SPOWERUP, SRESUMEPLAY, SRTC_UPDT, SSTART2PLAY, SSTATE_END, SSTATE_START, STATE, SXIM_EXIT, SYS_createDiskDbTask(), SYS_deleteDiskDbTask(), UI_isPresetValid(), UI_m3uActvItem(), UI_m3uEntryNum(), UI_msgbxCreate(), and UI_presetAudio().

00068 {   
00069     MSG_ID              id = msgIN->id;     
00070     MSG_DATA            d1 = msgIN->d1; 
00071     MSG_DATA            d2 = msgIN->d2;
00072     STATE               retState;
00073     
00074     switch(id)
00075     {
00076     case SYS_MSG_ID:
00077         switch(d1)
00078         {
00079             case SSTATE_START:
00080             {
00081                 // | curMenu     |
00082                 // +-------------+
00083                 // | ParentMenu  |
00084                 // +-------------+
00085                 // | Caller State|
00086                 // +-------------+
00087                 // If parentMenu == MENU_NULL, return to caller state.
00088                 // What menu needs to be displayed?
00089                 curMenu = (MENU_STATE)GEN_popStack();
00090                 
00091                 GEN_load((CODE_CONST)UI_getMenuCode(curMenu));
00092                 UI_getMenuHdl(curMenu)();
00093                 menu = mMENU_create((void*)&MENU_buf[0]);
00094                 return S_MENU;
00095             }
00096             case SSTATE_END:    return _menuStateEnd();
00097             case SXIM_EXIT:
00098             case SPOWERUP:
00099             case SMSGBOX_EXIT:  return _menuHdl(msgIN);
00100             case SSTART2PLAY:
00101             {
00102                 // Wait till disk/DB is ready.
00103                 if(FALSE == SYS_deleteDiskDbTask(0)) 
00104                 {
00105                     UI_msgbxCreate(MSGBX_SYSBUSY);
00106                     return S_MENU;
00107                 }
00108                 mMENU_action(menu, MENU_SELECT);            
00109                 mMENU_action(menu, MENU_CLOSE);
00110                 
00111                 // Specially handle DB Record Info menu, make sure it shutdown
00112                 // before playback window is set active. This is due to a 
00113                 // potential DB access conflict.
00114                 if(MENU_DBRECORDINFO == curMenu)
00115                 {
00116                     // Throw away MENU_NULL, and directly browse to S_DBMENU.
00117                     GEN_popStack();
00118                 }
00119                 else 
00120                 {
00121                     GEN_pushStack(curMenu);
00122                     GEN_pushStack(S_MENU);
00123                 }
00124                 
00125                 // Play history if available.
00126                 // Play from queue if not empty
00127                 // Play all else.
00128                 SYS_notUseSavedRandomPattern();
00129                 if( (FALSE == UI_isPresetValid(0))||
00130                     (PRESET_RADIO == UI_presetType(0))||
00131                     (MENU_PLAYQ == curMenu) )
00132                 {
00133                     #ifdef M3U_SUPPORT
00134                     if(UI_m3uEntryNum(0))
00135                     {
00136                         // play from queue.
00137                         UI_presetAudio(0, 0x1234, UI_m3uActvItem(0), DONTCARE, DONTCARE, 0);
00138                     }
00139                     else
00140                     #endif
00141                     {
00142                         // play all.
00143                         UI_presetAudio(0, DBnav.audio, DONTCARE, 0, -1, 0);
00144                     }
00145                 }
00146                 else
00147                 {
00148                     SYS_useSavedRandomPattern();
00149                 }
00150 
00151                 GEN_pushStack(DONTCARE);
00152                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SSTART2PLAY, 0, SYS_FOREVER);
00153                 
00154                 if(0xA5A5 == d2) SYS_HF_linkitEnable();
00155                 
00156                 return S_NULL;
00157             }
00158             case SRESUMEPLAY:
00159             {
00160                 mMENU_action(menu, MENU_SELECT);
00161                 mMENU_action(menu, MENU_CLOSE);
00162                 
00163                 // Specially handle DB Record Info menu, make sure it shutdown
00164                 // before playback window is set active. This is due to a 
00165                 // potential DB access conflict.
00166                 if(MENU_DBRECORDINFO == curMenu)
00167                 {
00168                     // Throw away MENU_NULL, and directly browse to S_DBMENU.
00169                     GEN_popStack();
00170                 }
00171                 else 
00172                 {
00173                     GEN_pushStack(curMenu);
00174                     GEN_pushStack(S_MENU);
00175                 }
00176                                 
00177                 GEN_pushStack(DONTCARE);
00178                 MSG_send(uiParentMsgQ, msgIN, SYS_FOREVER);
00179                 return S_NULL;
00180             }
00181             #ifdef DJ_SUPPORT       
00182             case SAUDIOTIME_UPDT:
00183             {
00184                 if(MENU_DJ == curMenu) mMENU_action(menu, MENU_TIME_UPDT);
00185                 break;
00186             }
00187             #endif
00188         }
00189         break;
00190         
00191     case KBD_MSG_ID:
00192         switch(d1)
00193         {
00194         case KEY_RDOWN:
00195         {
00196             unsigned short ii;
00197             ii = (d2/(KDOWN_HOLD_TIME>>1)) - 2;
00198             ii = (ii > 6)? 6 : ii;
00199             mMENU_action(menu, MENU_JUMPDN|(2*ii));
00200         }
00201         // Run through.
00202         case KEY_DOWN:
00203         case KEY_HDOWN:
00204             mMENU_action(menu, MENU_2NEXT);
00205             if(SYS_HF_sleepTimer())
00206             {
00207                 if(sysParam.sleepTimer>1) sysParam.sleepTimer--;
00208                 sysParam.sleepCount = sysParam.sleepTimer;
00209                 mMSG_send(sysMsgQ, SYS_MSG_ID, SRTC_UPDT, 0, 0);
00210             }
00211             return S_MENU;
00212 
00213         case KEY_RUP:
00214         {
00215             unsigned short ii;
00216             ii = (d2/(KDOWN_HOLD_TIME>>1)) - 2;
00217             ii = (ii > 6)? 6 : ii;
00218             mMENU_action(menu, MENU_JUMPUP|(2*ii));
00219         }
00220         // Run through.     
00221         case KEY_UP:
00222         case KEY_HUP:
00223             mMENU_action(menu, MENU_2PREV);
00224             if(SYS_HF_sleepTimer())
00225             {
00226                 if(sysParam.sleepTimer<480)sysParam.sleepTimer++;
00227                 sysParam.sleepCount = sysParam.sleepTimer;
00228                 mMSG_send(sysMsgQ, SYS_MSG_ID, SRTC_UPDT, 0, 0);
00229             }
00230             return S_MENU;
00231         
00232         case KEY_SELECT:        
00233             mMENU_action(menu, MENU_SELECT);
00234             return _menuHdl(msgIN);
00235         
00236         #ifdef M3U_SUPPORT
00237         case KEY_PLAY:
00238             if( (SYS_isAudioActive())&&(MENU_PLAYQ == curMenu) )
00239             {
00240                 mMSG_send(uiParentMsgQ, SYS_MSG_ID, SSTATE_END, DONTCARE, SYS_FOREVER); 
00241             }
00242             break;
00243         #endif
00244         case KEY_BACK:  return(_menuStateEnd());
00245         
00246         #ifdef DJ_SUPPORT
00247         case KEY_REWIND:
00248             if(MENU_DJ == curMenu)
00249             {
00250                 mMENU_action(menu, MENU_RWD);
00251                 return S_MENU;
00252             }
00253             break;
00254                 
00255         case KEY_FORWARD:
00256             if(MENU_DJ == curMenu)
00257             {
00258                 mMENU_action(menu, MENU_FWD);
00259                 return S_MENU;
00260             }
00261             break;
00262         #endif
00263         
00264         #ifdef SP_SUPPORT
00265         case KEY_HBACK:
00266             {
00267                 SYS_deleteDiskDbTask(SYS_FOREVER);
00268                 SYS_createDiskDbTask(DDT_PROFILER);
00269                 return S_MENU;
00270             }
00271         #endif
00272             
00273         }
00274         break;
00275         
00276     case TMR_MSG_ID:
00277         switch(d1)
00278         {
00279             case TTXTSCROLL:
00280                 mMENU_action(menu, MENU_TXTSCROLL);
00281                 return S_MENU;
00282         
00283         }
00284         break;
00285     }
00286     
00287     MSG_send(uiParentMsgQ, msgIN, SYS_FOREVER);
00288     return S_MENU;
00289 }

Here is the call graph for this function:

STATE UI_SF_null st_MSG msgIN  ) 
 

Function serves as the NULL state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 42 of file UI_SF_null.c.

References MENU_STATE, MSG_send(), SBROWSE, SDBBROWSE, SENDOFMENU, SMENUBROWSE, SSF_NULL, SSTATE_END, SSTATE_START, and STATE.

00043 {   
00044     MSG_ID          id = msgIN->id;     
00045     MSG_DATA        d1 = msgIN->d1; 
00046     MSG_DATA        d2 = msgIN->d2;
00047     
00048     switch(id)
00049     {
00050     case SYS_MSG_ID:
00051         switch(d1)
00052         {
00053             case SSTATE_START:
00054             {
00055                 // End of browsing, send system the message being
00056                 // waiting for.
00057                 MSG_DATA mD1 = (MSG_DATA)(GEN_popStack());
00058                 if(DONTCARE != mD1)
00059                 {
00060                     MSG_DATA mD2 = (MSG_DATA)(GEN_popStack());
00061                     mMSG_send(sysMsgQ, SYS_MSG_ID, mD1, mD2, SYS_FOREVER);
00062                 }
00063                 return S_NULL;
00064             }
00065             case SSTATE_END:
00066             {
00067                 mMSG_send(sysMsgQ, SYS_MSG_ID, SSF_NULL, DONTCARE, SYS_FOREVER);
00068                 return S_NULL;
00069             }
00070             case SBROWSE:
00071             {
00072                 STATE retstate = S_NULL;
00073                 if(GEN_stackDepth()) retstate = (STATE)GEN_popStack();
00074                 if(S_NULL == retstate)
00075                 {
00076                     MENU_STATE ms;
00077                     ms = (SYS_isDiagnosisMode())? MENU_DIAGNOSIS:MENU_MAIN;
00078                     GEN_pushStack(DONTCARE);
00079                     GEN_pushStack(SENDOFMENU);
00080                     GEN_pushStack(S_NULL);
00081                     GEN_pushStack(MENU_NULL);
00082                     GEN_pushStack(ms);                  
00083                     retstate = S_MENU;
00084                 }
00085                 return retstate;
00086             }
00087             case SMENUBROWSE:
00088             {
00089                 UINT * pD = (UINT*)d2;
00090                 //GEN_pushStack(S_NULL);
00091                             
00092                 GEN_pushStack(*pD++);
00093                 if(*pD != DONTCARE) GEN_pushStack(*pD);
00094                 pD++;
00095                 
00096                 GEN_pushStack(S_NULL);
00097                 GEN_pushStack(MENU_NULL);
00098                 GEN_pushStack(*pD);
00099                 return S_MENU;          
00100             }
00101             case SDBBROWSE:
00102             {
00103                 UINT * pD = (UINT*)d2;
00104                 //GEN_pushStack(S_NULL);
00105                             
00106                 GEN_pushStack(*pD++);
00107                 if(*pD != DONTCARE) GEN_pushStack(*pD);
00108                 pD++;
00109                 
00110                 GEN_pushStack(S_NULL);
00111                 GEN_pushStack(DB_INVALID_ID);
00112                             
00113                 GEN_pushStack(*pD++);
00114                 GEN_pushStack(*pD++);
00115                 GEN_pushStack(*pD++);
00116                 GEN_pushStack(*pD);
00117                 return S_DBMENU;
00118             }
00119         }       
00120         break;
00121     
00122     case TMR_MSG_ID:
00123         break;
00124     }
00125     
00126     // Route the rest of the messages to parent UI.
00127     MSG_send(uiParentMsgQ, msgIN, SYS_FOREVER);
00128     return S_NULL;
00129 }

Here is the call graph for this function:

STATE UI_SF_powerup st_MSG msgIN  ) 
 

Function serves as the powerup state handle.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 41 of file UI_SF_powerup.c.

References st_SYSPARAM::bkpkSwap, BTN_NO, BTN_OK, BTN_YES, SCREATETASK, SDIAGNOSIS, SMSGBOX_EXIT, SSTATE_START, SYS_createDiskDbTask(), SYS_deleteDiskDbTask(), and UI_msgbxCreate().

Referenced by UI_main().

00042 {   
00043     MSG_ID          id = msgIN->id;     
00044     MSG_DATA        d1 = msgIN->d1; 
00045     MSG_DATA        d2 = msgIN->d2;
00046 
00047     if(SYS_MSG_ID == id)
00048     {
00049         if( SSTATE_START == d1)
00050         {
00051             SYS_createDiskDbTask(DDT_STARTUP);
00052             SYS_deleteDiskDbTask(SYS_FOREVER);      
00053             
00054             if(SYS_isUnable2MountHDD())
00055             {
00056                 UI_msgbxCreate(MSGBX_HDDMOUNTFAILURE);
00057             }
00058             else if((SYS_isBkpkSwapPending())&&(1 == sysParam.bkpkSwap))
00059             {
00060                 UI_msgbxCreate(MSGBX_BKPKSWAPQUERY);
00061             }
00062             else
00063             {
00064                 mMSG_send(sysMsgQ, SYS_MSG_ID, SCREATETASK, DDT_SYNCDB, SYS_FOREVER);
00065                 return S_MENU;
00066             }
00067             return S_POWERUP;
00068         }
00069         else if(SMSGBOX_EXIT == d1)
00070         {
00071             if(BTN_YES == d2)
00072             {
00073                 if(MENU_curMsgbx() == MSGBX_BKPKSWAPQUERY)
00074                 {
00075                     UI_msgbxCreate(MSGBX_NANDBAKWAIT);
00076                     SYS_createDiskDbTask(DDT_SAVENAND);
00077                 }
00078                 else if(MENU_curMsgbx() == MSGBX_NANDSAVEFAILED)
00079                 {
00080                     mMSG_send(sysMsgQ, SYS_MSG_ID, SCREATETASK, DDT_SYNCDB, SYS_FOREVER);
00081                     return S_MENU;
00082                 }
00083                 return S_POWERUP;
00084             }
00085             else if(BTN_NO == d2)
00086             {
00087                 if(MENU_curMsgbx() == MSGBX_BKPKSWAPQUERY)
00088                 {
00089                     mMSG_send(sysMsgQ, SYS_MSG_ID, SCREATETASK, DDT_SYNCDB, SYS_FOREVER);
00090                     return S_MENU;
00091                 }
00092                 else if(MENU_curMsgbx() == MSGBX_NANDSAVEFAILED)
00093                 {
00094                     mMSG_send(sysMsgQ, KBD_MSG_ID, KEY_HPLAY, DONTCARE, SYS_FOREVER);
00095                     return S_MENU;
00096                 }
00097                 return S_POWERUP;
00098             }
00099             else if(BTN_OK == d2)
00100             {
00101                 if(MENU_curMsgbx() == MSGBX_HDDMOUNTFAILURE)
00102                 {
00103                     GEN_flushStack(0);
00104                     GEN_pushStack(DONTCARE);
00105                     GEN_pushStack(SDIAGNOSIS);
00106                     GEN_pushStack(S_NULL);
00107                     GEN_pushStack(MENU_NULL);
00108                     GEN_pushStack(MENU_DIAGNOSIS);
00109                     SYS_diagnosisMode();
00110                     return S_MENU;                  
00111                 }
00112             }
00113         }
00114     }
00115 
00116     if(MENU_curMsgbx() == MSGBX_NANDBAKWAIT)
00117     {
00118         if(FALSE == SYS_deleteDiskDbTask(0))
00119             UI_msgbxCreate(MSGBX_NANDBAKWAIT);
00120         else
00121         {
00122             if(!SYS_isNandBakDone())
00123             {
00124                 UI_msgbxCreate(MSGBX_NANDSAVEFAILED);
00125             }
00126             else
00127             {
00128                 mMSG_send(sysMsgQ, SYS_MSG_ID, SCREATETASK, DDT_SYNCDB, SYS_FOREVER);
00129                 return S_MENU;
00130             }
00131         }
00132     }
00133     
00134     return S_POWERUP;
00135 }

Here is the call graph for this function:


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