Alarm.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:158k
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * Alarm.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file implements Alarm application related screens.
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**************************************************************
- FILENAME : Alarm.c
- PURPOSE : Handling of Alarm Application
- REMARKS : nil
- AUTHOR : Neeraj Sharma, Gautam Saluja
- DATE : June 9,03
- **************************************************************/
- #ifndef _MMI_ALARM_C
- #define _MMI_ALARM_C
- #include "MMI_features.h"
- /* Include: MMI header file */
- #include "PixtelDataTypes.h"
- #include "GlobalDefs.h"
- #include "ProtocolEvents.h"
- #include "TimerEvents.h"
- #include "HistoryGprot.h"
- #include "SubLCDHistoryGprot.h"
- #include "wgui_categories.h"
- #include "wgui_status_icons.h"
- #include "wgui_categories_inputs.h"
- #include "gpioInc.h"
- #include "DateTimeGprot.h"
- #include "AlarmProt.h"
- #include "AlarmDef.h"
- #include "AlarmGProt.h"
- #include "AlarmFrameworkProt.h"
- #include "FileMgr.h"
- #include "ProfileGprots.h"
- #include "ProfileMgrGProt.h"
- #include "Profiles_prot.h"
- #include "KeyBrd.h" /* for ClearKeyEvents */
- #include "Unicodexdcl.h"
- #include "CustDataRes.h"
- #include "DebugInitDef.h"
- #include "SettingProfile.h"
- #include "NVRAMEnum.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "AudioInc.h"
- #include "TimerEvents.h"
- #include "OrganizerDef.h"
- #include "ProfilesDefs.h"
- #include "WrapperGprot.h"
- #include "SimDetectionGexdcl.h"
- #include "ExtDeviceDefs.h"
- #include "CommonScreens.h"
- #include "Wgui_categories_popup.h"
- #include "Wgui_status_icons.h"
- #if defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__)
- #include "DownloadDefs.h"
- #include "DownloadProtos.h"
- #include "ThemeManager.h"
- #endif /* defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) */
- #ifdef __MMI_ALM_AUDIO_OPTIONS__
- #include "FMRadioDef.h"
- #include "FMRadioType.h"
- #include "FMRadioProt.h"
- #include "MainMenuDef.h"
- #include "Aud_Defs.h"
- #include "FS_Type.h"
- #include "FS_Func.h"
- #include "conversions.h"
- #include "ScrMemMgrGProt.h"
- extern mmi_fmrdo_struct g_fmrdo; /* defined in FMRadioSrc.c */
- extern pBOOL mmi_fmrdo_channel_list_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask);
- extern S32 mmi_fmrdo_channel_list_item_hint(S32 item_index, UI_string_type *hint_array);
- extern void kal_wsprintf(unsigned short *outstr, char *fmt, ...);
- BOOL g_alm_aud_opt_selected = FALSE;
- extern U8 isEarphonePlugged;
- S8 *g_alm_audio_options_string[NUM_AUDIO_OPTIONS]; /* array to store the audio option strings */
- U16 g_alm_audio_options_curselitem[MAX_NAME_INPUT_LEN];
- S8 g_alm_aud_opt_curselitem_inline_index;
- S32 g_alm_audio_option_previndex; /* the index of the selected audio option i.e. FM or tone. */
- U8 g_alm_aud_opt_fmrdo_channel_index;
- U16 g_alm_aud_opt_fmrdo_channel_opt_index;
- U16 g_alm_fmrdo_man_inp_opt_index;
- U16 g_alm_fmrdo_prev_freq;
- static UI_character_type channel_manual_input_buffer[MAX_MANUAL_INPUT_LEN];
- static BOOL g_alm_fmrdo_read_channel_name = FALSE;
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- static PRFSET_MELODY_CONF_TYPE g_alm_tone_conf_type = 0;
- static U8 g_ext_melody_idx = 0;
- static U8 extMldHlitItem = 0;
- static U8* g_alm_ext_melody_short_name_ptr = NULL;
- #endif /* __MMI_PROFILE_EXTMELODY_SUPPORT__ */
- static S32 g_alm_tone_index;
- extern U8 mmi_profiles_get_melody_list(U16 CurMelodyID, U16 *selecteditem);
- extern U16 gstartRingId;
- extern U16 gtotalRingId;
- extern U16 gstartMidiId;
- extern U16 gtotalMidiId;
- extern U16 gcurrentaudioId;
- extern PROFILE gcurrentprofile;
- #endif /* __MMI_ALM_AUDIO_OPTIONS__ */
- /*
- * Define
- */
- /*
- * Typedef
- */
- /*
- * Local Variable
- */
- const U8 g_alm_freq_set[ALARM_FREQ_NUM] = {ALM_FREQ_ONCE, ALM_FREQ_EVERYDAY, ALM_FREQ_DAYS};
- /*
- * Local Function
- */
- /*
- * Global Variable
- */
- alm_context_struct g_alm_cntx;
- S8 *gAlmFreqList[ALM_FREQ_TOTAL]; /* array to store frequency type of alarm */
- S8 *gAlmOnOffString[NUM_STATE_FOR_ALM]; /* array to store on/off state of an alarm */
- U8 gAlmDaysStates[NUM_DAYS]; /* signifies the days alarm has been set for in case of freq weekdays */
- #ifdef __MMI_ALM_CUST_VOLUME__
- S8 *gAlmVolumeList[LEVEL7 + 1];
- const S8 gAlmVolumeString[LEVEL7 + 1][4] =
- {
- {'1', 0, 0, 0},
- {'2', 0, 0, 0},
- {'3', 0, 0, 0},
- {'4', 0, 0, 0},
- {'5', 0, 0, 0},
- {'6', 0, 0, 0},
- {'7', 0, 0, 0}
- };
- #endif /* __MMI_ALM_CUST_VOLUME__ */
- #ifdef __MMI_ALM_SNOOZE_SETTING__
- S8 *gAlmSettingSnooze[ALM_SNOOZE_INTERVAL_SETTING_NUM];
- #endif
- #ifdef __MMI_ALM_ALERT_TYPE__
- S8 *gAlmSettingAlertType[ALM_ALERT_TYPE_SETTING_NUM];
- #endif
- extern wgui_inline_item wgui_inline_items[];
- /*
- * Global Function
- */
- extern void AlarmDisplayCharging(void);
- extern void AudioPlayToneWithCallBackVolPath(U16 soundId, U8 style, U8 tone_type, U8 volume, U8 path);
- /*****************************************************************************
- * FUNCTION
- * HighlightAlmMenu
- * DESCRIPTION
- * Highlight handler of alarm menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightAlmMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(EntryAlmMenu, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(EntryAlmMenu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_alm_cntx.CurrHiliteAlarm = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * AlmInit
- * DESCRIPTION
- * Initailization function. Set the highlight handlers and get required strings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmInit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetHiliteHandler(ORGANIZER_ALARM_MENU, HighlightAlmMenu);
- }
- /*****************************************************************************
- * FUNCTION
- * AlmExpiryTimeCBH
- * DESCRIPTION
- * Callback handler to get information of alarm expiry setting.
- * PARAMETERS
- * index [IN]
- * alarmTime [?]
- * Freq [?]
- * WeekDays [?]
- * MYTIME(?) [IN/OUT] Expiry time set by user
- * U8(?) [IN/OUT] Expiry days of week
- * RETURNS
- * void
- *****************************************************************************/
- void AlmExpiryTimeCBH(U8 index, MYTIME *alarmTime, U8 *Freq, U8 *WeekDays, MYTIME *preReminder)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYTIME currTime, incTime;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DTGetRTCTime(&currTime);
- alarmTime->nYear = currTime.nYear;
- alarmTime->nMonth = currTime.nMonth;
- alarmTime->nDay = currTime.nDay;
- alarmTime->DayIndex = DOW(alarmTime->nYear, alarmTime->nMonth, alarmTime->nDay);
- alarmTime->nHour = g_alm_cntx.AlmList[index].Hour;
- alarmTime->nMin = g_alm_cntx.AlmList[index].Min;
- *Freq = g_alm_freq_set[g_alm_cntx.AlmList[index].Freq];
- *WeekDays = g_alm_cntx.AlmList[index].Days;
- if (g_alm_cntx.AlmList[index].Snooze)
- {
- memset(&incTime, 0, sizeof(MYTIME));
- incTime.nMin = AlmGetSnoozeInterval(index); /* ALM_SNOOZE_INTERVAL; */
- IncrementTime(currTime, incTime, alarmTime);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * AlmReInitQueueCBH
- * DESCRIPTION
- * Callback handler of reiniting alarm to alarm queue.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmReInitQueueCBH(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < NUM_OF_ALM; i++)
- {
- g_alm_cntx.AlmList[i].Snooze = 0;
- if (g_alm_cntx.AlmList[i].State == 1)
- {
- AlmInsertIntoQueue((U8) (i + ALM_ALM_START), FALSE);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * AlmExpiryHandlerCB
- * DESCRIPTION
- * CallBack handler to execute alarm expiry.
- * PARAMETERS
- * index [IN]
- * period [?]
- * power_on [IN]
- * BOOL(?) [IN] Power status
- * U8(?) [IN] Index of alarm item
- * RETURNS
- * void
- *****************************************************************************/
- U8 AlmExpiryHandlerCB(U8 index, U16 *period, BOOL power_on)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *period = ALM_DEFAULT_EXPIRY_PERIOD;
- /* For the situation of taking off the battery during alarm working.*/
- if (g_alm_freq_set[g_alm_cntx.AlmList[index].Freq] == ALM_FREQ_ONCE) /* reset the alarm state */
- {
- g_alm_cntx.AlmList[index].State = UNSET_STATE;
- AlmWriteToNvram();
- }
- if (power_on)
- {
- update_mainlcd_dt_display();
- EntryAlmIndicationScreen();
- }
- else
- {
- AlmInitLCDModule();
- EntryAlmIndicationScreen();
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: Alarm idle screen */
- }
- return ALM_HAS_IND;
- }
- /*****************************************************************************
- * FUNCTION
- * AlmFCBInit
- * DESCRIPTION
- * Set callback function needed by alarm framework
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmFCBInit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_alm_set_start_index(ALM_TYPE_ALARM, ALM_ALM_START);
- AlmSetExpiryTimeCB(ALM_TYPE_ALARM, AlmExpiryTimeCBH);
- AlmSetExpiryHandlerCB(ALM_TYPE_ALARM, AlmExpiryHandlerCB);
- AlmSetInitHandlerCB(ALM_TYPE_ALARM, AlmInitNvram, AlmReInitQueueCBH);
- AlmSetStopAlarmCB(ALM_TYPE_ALARM, AlmSnoozeHandler);
- }
- /*****************************************************************************
- * FUNCTION
- * AlarmDeInit
- * DESCRIPTION
- * Deinitailization function of alarm application.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlarmDeInit()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * AlmInitNvram
- * DESCRIPTION
- * Gets the information from NVRAM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmInitNvram(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 nvram_buf[NVRAM_ALM_ALARM_DATA_SIZE];
- #ifdef MMI_ON_WIN32
- S32 i;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadRecord(NVRAM_EF_ALM_ALARM_DATA_LID, 1, (void*)nvram_buf, NVRAM_ALM_ALARM_DATA_SIZE, &error);
- memcpy(g_alm_cntx.AlmList, nvram_buf, sizeof(g_alm_cntx.AlmList));
- #ifdef MMI_ON_WIN32
- for (i = 0; i < NUM_OF_ALM; i++)
- {
- if (g_alm_cntx.AlmList[i].Hour > 23 || g_alm_cntx.AlmList[i].Min > 59)
- {
- memset(&g_alm_cntx.AlmList[i], 0x0, sizeof(alm_nvram_struct));
- }
- }
- #endif /* MMI_ON_WIN32 */
- if (AlmIsAnyAlarmActivated())
- {
- AlmActivateIndicator();
- }
- else
- {
- AlmDeactivateIndicator();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightAlmIndex
- * DESCRIPTION
- * Highlight handler of alarm item in alarm screen.
- * Store current highlight index.
- * PARAMETERS
- * nIndex [IN]
- * S32(?) [IN] Index of current highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightAlmIndex(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_alm_cntx.CurrHiliteAlarm = (U8) nIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryAlmMenu
- * DESCRIPTION
- * Entry function of Alarm application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryAlmMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- S32 i;
- U16 alarm_states_icon[NUM_OF_ALM];
- MYTIME almTime;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Use FM radio list before FM radio initialize */
- #ifdef __MMI_ALM_AUDIO_OPTIONS__
- mmi_alm_aud_fmrdo_init_channe_list();
- #endif
- EntryNewScreen(SCR_ID_ALM_LIST, NULL, EntryAlmMenu, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_ALM_LIST);
- if (guiBuffer == NULL)
- {
- g_alm_cntx.CurrHiliteAlarm = 0;
- }
- g_alm_cntx.IsDOWSet = 0;
- /* construct displayed string and icon */
- for (i = 0; i < NUM_OF_ALM; i++)
- {
- almTime.nHour = g_alm_cntx.AlmList[i].Hour;
- almTime.nMin = g_alm_cntx.AlmList[i].Min;
- time_string(&almTime, (UI_string_type) subMenuDataPtrs[i], DT_IDLE_SCREEN);
- if (g_alm_cntx.AlmList[i].State == SET_STATE)
- {
- alarm_states_icon[i] = CHECKBOX_ON_IMAGE_ID;
- }
- else
- {
- alarm_states_icon[i] = CHECKBOX_OFF_IMAGE_ID;
- }
- }
- wgui_override_list_menu_slim_style(WGUI_LIST_MENU_SLIM_STYLE_DRAW_ICON);
- ShowCategory53Screen(
- ORGANIZER_MENU_ALARMS_STRINGID,
- GetRootTitleIcon(ORGANIZER_ALARM_MENU),
- ALARMS_EDIT_SOFTKEY_STRINGID,
- ALARMS_EDIT_SOFTKEY_IMAGEID,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- NUM_OF_ALM,
- subMenuDataPtrs,
- alarm_states_icon,
- 0,
- 0,
- (S32) g_alm_cntx.CurrHiliteAlarm,
- guiBuffer);
- wgui_restore_list_menu_slim_style();
- SetLeftSoftkeyFunction(AlmPrepareInlineScreen, KEY_EVENT_UP);
- SetKeyHandler(AlmPrepareInlineScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- RegisterHighlightHandler(HighlightAlmIndex);
- }
- /*****************************************************************************
- * FUNCTION
- * AlmGoBackAlarmMenu
- * DESCRIPTION
- * Go back to alarm menu list.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmGoBackAlarmMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackToHistory(SCR_ID_ALM_LIST);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryAlmSaveConfirmation
- * DESCRIPTION
- * Display confirmation screen for setting alarm.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryAlmSaveConfirmation(void)
- {
- #ifdef __MMI_ALM_AUDIO_OPTIONS__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((!
- ((g_alm_cntx.CurrHiliteAudioOption && g_alm_audio_option_previndex) ||
- (!g_alm_cntx.CurrHiliteAudioOption && !g_alm_audio_option_previndex))) ||
- (g_alm_cntx.CurrHiliteAudioOptionValue == 0))
- {
- DisplayConfirm(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- get_string(STR_ID_ALM_FMRDO_AUD_OPT_INCOMPLETE_NOTIFY),
- 0,
- WARNING_TONE);
- SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- /* check if the currently selected option is ALM_AUDIO_OPTIONS_FMRADIO_CHANNEL and some channel is selected for it */
- if (g_alm_cntx.CurrHiliteAudioOption == ALM_AUDIO_OPTIONS_FMRADIO_CHANNEL)
- {
- U16 index;
- BOOL valid_chan = TRUE;
- if (g_alm_cntx.CurrHiliteAudioOptionValue == 0 || g_alm_cntx.CurrHiliteAudioOptionValue > FM_RADIO_CHANNEL_NUM)
- {
- valid_chan = FALSE;
- }
- else
- {
- index = g_alm_cntx.CurrHiliteAudioOptionValue - 1;
- if (g_fmrdo.channel_list.freq[index] < MIN_FM_FREQUENCY ||
- g_fmrdo.channel_list.freq[index] > MAX_FM_FREQUENCY)
- {
- valid_chan = FALSE;
- }
- }
- if (!valid_chan)
- {
- DisplayConfirm(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- get_string(STR_ID_ALM_FMRDO_INCOMPLETE_CHANNEL_INFO),
- 0,
- WARNING_TONE);
- SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- }
- #endif /* __MMI_ALM_AUDIO_OPTIONS__ */
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(AlmSaveInlineEdit, KEY_EVENT_UP);
- SetRightSoftkeyFunction(AlmGoBackAlarmMenu, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * AlmPrepareInlineScreen
- * DESCRIPTION
- * This fuction builds the display information of the selected alarm, and then enter
- * alarm screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmPrepareInlineScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = g_alm_cntx.CurrHiliteAlarm;
- /* fill inline selection strings */
- gAlmOnOffString[0] = GetString(STR_GLOBAL_OFF);
- gAlmOnOffString[1] = GetString(STR_GLOBAL_ON);
- #ifdef __MMI_ALM_AUDIO_OPTIONS__
- g_alm_audio_options_string[0] = GetString(STR_ID_ALM_AUDIO_OPTIONS_TONE);
- g_alm_audio_options_string[1] = GetString(STR_ID_ALM_AUDIO_OPTIONS_FMRADIO);
- #endif /* __MMI_ALM_AUDIO_OPTIONS__ */
- /* time string */
- AlmGetStringValue(g_alm_cntx.HourBuf, g_alm_cntx.AlmList[i].Hour);
- AlmGetStringValue(g_alm_cntx.MinBuf, g_alm_cntx.AlmList[i].Min);
- g_alm_cntx.CurrHiliteState = g_alm_cntx.AlmList[i].State;
- g_alm_cntx.CurrHiliteFreq = g_alm_cntx.AlmList[i].Freq;
- #ifdef __MMI_ALM_CUST_VOLUME__
- g_alm_cntx.CurrHiliteVol = g_alm_cntx.AlmList[i].Volume;
- #endif
- if (g_alm_freq_set[g_alm_cntx.CurrHiliteFreq] == ALM_FREQ_DAYS) /* not Days */
- {
- for (j = 0; j < NUM_DAYS; j++)
- {
- gAlmDaysStates[j] = ((((g_alm_cntx.AlmList[i].Days) & (0x1 << j)) == 0) ? 0 : 1);
- }
- }
- else
- {
- memset(gAlmDaysStates, 0, 7);
- }
- /* Audio options in alarm */
- #ifdef __MMI_ALM_AUDIO_OPTIONS__
- g_alm_cntx.CurrHiliteAudioOption = g_alm_cntx.AlmList[i].AudioOption;
- if (g_alm_cntx.CurrHiliteAudioOption == ALM_AUDIO_OPTIONS_FMRADIO_CHANNEL)
- {
- U16 freq = 0;
- U16 index = g_alm_cntx.CurrHiliteAudioOptionValue = g_alm_cntx.AlmList[i].AudioOptionValue;
- if ((index > 0) && (index <= FM_RADIO_CHANNEL_NUM))
- {
- freq = g_fmrdo.channel_list.freq[index - 1];
- }
- /* In valid frequency, restore to default ring tone */
- if ((freq < MIN_FM_FREQUENCY) || (freq > MAX_FM_FREQUENCY))
- {
- g_alm_cntx.CurrHiliteAudioOption = ALM_AUDIO_OPTIONS_TONE;
- g_alm_cntx.CurrHiliteAudioOptionValue = (U16) (gstartMidiId + 1);
- }
- }
- else if (g_alm_cntx.CurrHiliteAudioOption == ALM_AUDIO_OPTIONS_FMRADIO_MANUAL)
- {
- g_alm_cntx.CurrHiliteAudioOptionValue = g_alm_cntx.AlmList[i].AudioOptionValue;
- }
- else /* ALM_AUDIO_OPTIONS_TONE */
- {
- #ifdef __MMI_ALM_CUSTOMIZE_TONE__
- if (g_alm_cntx.AlmList[i].AudioOptionValue > 0)
- {
- g_alm_cntx.CurrHiliteAudioOptionValue = g_alm_cntx.AlmList[i].AudioOptionValue;
- }
- else
- {
- g_alm_cntx.CurrHiliteAudioOptionValue = (U16) (gstartMidiId + 1);
- }
- #else /* __MMI_ALM_CUSTOMIZE_TONE__ */
- g_alm_cntx.CurrHiliteAudioOptionValue = gcurrentprofile.toneSetup.alarmTone;
- #endif /* __MMI_ALM_CUSTOMIZE_TONE__ */
- }
- #endif /* __MMI_ALM_AUDIO_OPTIONS__ */
- #ifdef __MMI_ALM_SNOOZE_SETTING__
- g_alm_cntx.CurrHilightSnoozeInterval = g_alm_cntx.AlmList[i].SnoozeInterval;
- #endif
- #ifdef __MMI_ALM_ALERT_TYPE__
- g_alm_cntx.CurrHilightAlertType = g_alm_cntx.AlmList[i].AlertType;
- #endif
- EntryAlmEditScreen();
- }
- #ifdef __MMI_ALM_CUST_VOLUME__
- /*****************************************************************************
- * FUNCTION
- * AlmPlayAlarmToneWithVol
- * DESCRIPTION
- * Play alarm tone with setting volume level.
- * PARAMETERS
- * volume [IN]
- * U8(?) [IN] Volumn level
- * RETURNS
- * void
- *****************************************************************************/
- void AlmPlayAlarmToneWithVol(U8 volume)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_alm_frm_cntx.IsAlmTonePlaying == FALSE)
- {
- #ifdef __MMI_PROFILE_ALERT_TYPE_DOMINANT__
- U8 alert_type = GetMtCallAlertTypeEnum();
- #endif
- VibratorOn();
- #ifdef __MMI_PROFILE_ALERT_TYPE_DOMINANT__
- if (alert_type != MMI_VIBRATION_ONLY && alert_type != MMI_SILENT)
- #endif
- {
- /* Added support for Alarm Audio Options i.e. FM Radio as alarm tone. */
- #ifdef __MMI_ALM_AUDIO_OPTIONS__
- if (g_alm_frm_cntx.CurrAlmIndex >= ALM_ALM_START && g_alm_frm_cntx.CurrAlmIndex < ALM_SPOF_START)
- {
- U8 alarm_index = g_alm_frm_cntx.CurrAlmIndex - ALM_ALM_START;
- if (g_alm_cntx.AlmList[alarm_index].AudioOption == ALM_AUDIO_OPTIONS_TONE)
- {
- #ifdef __MMI_ALM_CUSTOMIZE_TONE__
- AudioPlayToneWithCallBackVolPath(
- g_alm_cntx.AlmList[g_alm_frm_cntx.CurrAlmIndex - ALM_ALM_START].AudioOptionValue, /* current profile alarm tone id */
- DEVICE_AUDIO_PLAY_INFINITE,
- ALARM_TONE,
- volume, /* your volume level 0~6 */
- MDI_DEVICE_SPEAKER_BOTH);
- #else /* __MMI_ALM_CUSTOMIZE_TONE__ */
- AudioPlayToneWithCallBackVolPath(
- GetAlarmToneType(), /* current profile alarm tone id */
- DEVICE_AUDIO_PLAY_INFINITE,
- ALARM_TONE,
- volume, /* your volume level 0~6 */
- MDI_DEVICE_SPEAKER_BOTH);
- #endif /* __MMI_ALM_CUSTOMIZE_TONE__ */
- }
- else
- {
- mmi_alm_aud_fmrdo_play_alarm(alarm_index, volume);
- }
- }
- else
- #endif /* __MMI_ALM_AUDIO_OPTIONS__ */
- {
- AudioPlayToneWithCallBackVolPath(
- GetAlarmToneType(), /* current profile alarm tone id */
- DEVICE_AUDIO_PLAY_INFINITE,
- ALARM_TONE,
- volume, /* your volume level 0~6 */
- MDI_DEVICE_SPEAKER_BOTH);
- }
- }
- g_alm_frm_cntx.IsAlmTonePlaying = TRUE;
- }
- }
- #endif /* __MMI_ALM_CUST_VOLUME__ */
- /*****************************************************************************
- * FUNCTION
- * EntryAlmIndicationScreen
- * DESCRIPTION
- * Display indication screen and play alarm tone when alarm expires.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef IS_VSMJ_BASE_GAME //jerson add 20070619
- extern BOOL mmi_gx_vsmj_getplaystate(void); //KP Jerry add for avoid screen-display-error when vsmj is playing on 2007-3-24
- #endif
- void EntryAlmIndicationScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- MYTIME currTime;
- U8 timeString[SIZE_OF_DATE_STRING];
- static U8 dateString[SIZE_OF_ALARM_STRING + SIZE_OF_DATE_STRING];
- U8 almindex = g_alm_frm_cntx.CurrAlmIndex - ALM_ALM_START;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //KP Jerry add for avoid screen-display-error when vsmj is playing on 2007-3-24 start
- #ifdef IS_VSMJ_BASE_GAME //jerson add 20070619
- if(mmi_gx_vsmj_getplaystate())
- {
- GoBackHistory();
- }
- #endif
- //KP Jerry add for avoid screen-display-error when vsmj is playing on 2007-3-24 end
- StopTimer(ALARM_TIMER_WAIT_FOR_CALL);
- if (!IsMyTimerExist(ALARM_ALERT_NOTIFYDURATION_TIMER))
- {
- StartTimer(ALARM_ALERT_NOTIFYDURATION_TIMER, ALM_EXPIRE_DURATION, AlmHandleAlarmTimeout);
- }
- EntryNewScreen(SCR_ID_ALM_INDICATION, ExitAlmIndicationScreen, NULL, NULL);
- GetDateTime(&currTime);
- time_string(&currTime, (UI_string_type) timeString, DT_IDLE_SCREEN);
- /* prepare string to display */
- if (g_alm_frm_cntx.CurrAlmIndex == ALM_FACTORY)
- {
- memset(dateString, 0, ENCODING_LENGTH);
- pfnUnicodeStrcpy((S8*) dateString, (S8*) L"n");
- pfnUnicodeStrcat((S8*) dateString, (S8*) GetString(ALARMS_POWER_ON));
- pfnUnicodeStrcat((S8*) dateString, (S8*) L"?");
- }
- else
- {
- date_string(&currTime, (UI_string_type) dateString, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) dateString, (S8*) L"n");
- pfnUnicodeStrcat((S8*) dateString, (S8*) timeString);
- }
- /* flush key because alarm if some key is not released, the alarm may be stopped */
- ClearKeyEvents();
- g_alm_cntx.IsSaveToHistory = 1;
- guiBuffer = GetCurrGuiBuffer(SCR_ID_ALM_INDICATION);
- #ifdef __MMI_ALM_CUST_VOLUME__
- if (g_alm_frm_cntx.CurrAlmIndex != ALM_FACTORY)
- {
- AlmPlayAlarmToneWithVol(g_alm_cntx.AlmList[almindex].Volume);
- }
- else
- #endif /* __MMI_ALM_CUST_VOLUME__ */
- {
- AlmPlayAlarmTone();
- }
- ShowCategory121Screen(
- ALARMS_STOP_STRINGID,
- ALARMS_STOP_IMAGEID,
- ALARMS_SNOOZE_STRINGID,
- ALARMS_SNOOZE_IMAGEID,
- dateString,
- ALARM_ANIMATION_INDICATION_IMAGEID,
- guiBuffer,
- 1);
- TurnOnBacklight(1);
- if (g_alm_frm_cntx.CurrAlmIndex == ALM_FACTORY)
- {
- ChangeLeftSoftkey(STR_GLOBAL_YES, IMG_GLOBAL_YES);
- ChangeRightSoftkey(STR_GLOBAL_NO, IMG_GLOBAL_NO);
- SetLeftSoftkeyFunction(AlmSendPowerOn, KEY_EVENT_UP);
- SetRightSoftkeyFunction(AlmSendPowerOff, KEY_EVENT_UP);
- }
- else
- {
- if (g_alm_cntx.AlmList[almindex].Snooze >= MAX_SNOOZE_CHANCES)
- {
- ChangeRightSoftkey(0, 0);
- }
- else
- {
- SetRightSoftkeyFunction(AlmSnoozeHandler, KEY_EVENT_UP);
- #if defined(__MMI_ALARM_SIDE_KEY_CONTROL__)
- SetKeyHandler(AlmSnoozeHandler, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- #endif
- }
- SetLeftSoftkeyFunction(AlmStopHandler, KEY_EVENT_UP);
- SetKeyHandler(AlmStopHandler, KEY_END, KEY_EVENT_DOWN); /* SetKeyHandler(AlarmEndKeyPressed,KEY_END,KEY_EVENT_DOWN); */
- #if defined(__MMI_ALARM_SIDE_KEY_CONTROL__)
- SetKeyHandler(AlmStopHandler, KEY_VOL_UP, KEY_EVENT_DOWN);
- #endif
- }
- ForceSubLCDScreen(EntryAlmSubLcdScreen);
- /* register END key for power on alarm */
- if (g_alm_frm_cntx.IsPwronAlarm)
- {
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- #ifdef __MMI_POWER_ON_OFF_BY_POWER_KEY__
- ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
-
- ClearKeyHandler(KEY_POWER, KEY_EVENT_UP);
- ClearKeyHandler(KEY_POWER, KEY_EVENT_DOWN);
- SetKeyHandler(AlmHandleEndKey, KEY_POWER, KEY_LONG_PRESS);
- #else
- SetKeyHandler(AlmHandleEndKey, KEY_END, KEY_LONG_PRESS);
- #endif
- if (g_charbat_context.isChargerConnected && (!g_charbat_context.ChargingComplete))
- {
- AnimateStatusIcon(STATUS_ICON_BATTERY_STRENGTH);
- AnimateStatusIcon(STATUS_ICON_SUBLCD_BATTERY_STRENGTH);
- UpdateStatusIcons();
- }
- }
- #ifdef MMI_ON_WIN32
- SetRightSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * AlmHandleEndKey
- * DESCRIPTION
- * End key handler of alarm indication screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmHandleEndKey(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = g_alm_frm_cntx.CurrAlmIndex - ALM_ALM_START;
- AlmsStopAlarmTone();
- g_alm_cntx.AlmList[i].Snooze = 0;
- if (g_alm_freq_set[g_alm_cntx.AlmList[i].Freq] == ALM_FREQ_ONCE) /* reset the alarm state */
- {
- g_alm_cntx.AlmList[i].State = UNSET_STATE;
- }
- AlmWriteToNvram();
- AlmSendPowerOn();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitAlmIndicationScreen
- * DESCRIPTION
- * Exit function of alarm indication screen.
- * If exits screen because of interrupts, add screen to history.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitAlmIndicationScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- AlmsStopAlarmTone();
- if (g_alm_cntx.IsSaveToHistory) /* add screen to history */
- {
- GenericExitScreen(SCR_ID_ALM_INDICATION, EntryAlmIndicationScreen);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryAlmSubLcdScreen
- * DESCRIPTION
- * Display sub-lcd screen when alarm expires.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryAlmSubLcdScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExecSubLCDCurrExitHandler();
- ShowCategory304Screen(ALARM_ANIMATION_INDICATION_SUBLCD_IMAGEID, 0);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitAlmSubLcdScreen
- * DESCRIPTION
- * Exit function of EntryAlmSubLcdScreen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitAlmSubLcdScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- SubLCDHistoryNode SubLCDHistory;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SubLCDHistory.entryFuncPtr = EntryAlmSubLcdScreen;
- AddSubLCDHistoryWithScrID(&SubLCDHistory, SCR_ID_ALM_SUB_INDICATION);
- }
- /*****************************************************************************
- * FUNCTION
- * AlmCommonExitProcedure
- * DESCRIPTION
- * Stop alarm tone by user or timeout.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmCommonExitProcedure(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_alm_cntx.IsSaveToHistory = 0;
- TurnOffBacklight();
- AlmsStopAlarmTone();
- }
- /*****************************************************************************
- * FUNCTION
- * AlmExitIndScreen
- * DESCRIPTION
- * Exit alarm indication screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmExitIndScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetActiveScreenId() == SCR_ID_ALM_INDICATION)
- {
- if (GetSubLCDScreenCountInHistory() == 0)
- {
- GoBackHistory();
- }
- else
- {
- GoBackBothLCDHistory();
- }
- }
- else
- {
- DeleteScreenIfPresent(SCR_ID_ALM_INDICATION);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * AlmStopHandler
- * DESCRIPTION
- * Handler for stopping alarm.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmStopHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(ALARM_ALERT_NOTIFYDURATION_TIMER);
- AlmCommonExitProcedure();
- /* factory alarm does not have to re-schedule */
- if (g_alm_frm_cntx.CurrAlmIndex != ALM_FACTORY)
- {
- i = g_alm_frm_cntx.CurrAlmIndex - ALM_ALM_START;
- if (i >= NUM_OF_ALM)
- {
- return;
- }
-
- g_alm_cntx.AlmList[i].Snooze = 0;
- if (g_alm_freq_set[g_alm_cntx.AlmList[i].Freq] == ALM_FREQ_ONCE) /* reset the alarm state */
- {
- g_alm_cntx.AlmList[i].State = UNSET_STATE;
- if (!(AlmIsAnyAlarmActivated()))
- {
- AlmDeactivateIndicator();
- }
- }
- AlmWriteToNvram();
- }
- g_alm_frm_cntx.CurrAlmIndex = 0xff;
- if (g_alm_frm_cntx.IsPwronAlarm == FALSE)
- {
- AlmExitIndScreen();
- if (g_alm_frm_cntx.IsExitByTimer == FALSE)
- {
- AlmExecPwrOnAlarm();
- }
- }
- else
- {
- if (GetCurrScrnId() == (U16) SCR_ID_ALM_PWRON_CONFIRM
- #ifdef __NVRAM_IN_USB_MS__
- || (g_pwr_context.PowerOnMode == POWER_ON_USB)
- #endif
- )
- {
- AlmExitIndScreen();
- }
- else
- {
- EntryAlmPowerOnConfirmation();
- }
- #ifdef __MTK_TARGET__
- if (g_alm_frm_cntx.IsExitByTimer == FALSE)
- {
- AlmExecPwrOffAlarm();
- }
- #endif /* __MTK_TARGET__ */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * AlmSnoozeHandler
- * DESCRIPTION
- * Handler for snoozing alarm.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmSnoozeHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef MMI_ON_WIN32
- if (g_alm_frm_cntx.IsPwronAlarm)
- {
- AlmSendPowerOff();
- }
- #endif /* MMI_ON_WIN32 */
- StopTimer(ALARM_ALERT_NOTIFYDURATION_TIMER);
- i = g_alm_frm_cntx.CurrAlmIndex - ALM_ALM_START;
-
- if (i >= NUM_OF_ALM)
- {
- return;
- }
-
- g_alm_cntx.AlmList[i].Snooze++;
- g_alm_cntx.AlmList[i].State = SET_STATE;
- AlmCommonExitProcedure();
- if (g_alm_cntx.AlmList[i].Snooze <= MAX_SNOOZE_CHANCES)
- {
- AlmWriteToNvram();
- AlmInsertIntoQueue(g_alm_frm_cntx.CurrAlmIndex, TRUE);
- g_alm_frm_cntx.CurrAlmIndex = 0xff;
- if (g_alm_frm_cntx.IsPwronAlarm == FALSE)
- {
- /* GoBackBothLCDHistory(); */
- AlmExitIndScreen();
- }
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- else if (g_alm_frm_cntx.IsPwronAlarm && g_alm_frm_cntx.IsAppExecuting)
- {
- /* GoBackHistory(); */
- AlmExitIndScreen();
- }
- if (g_alm_frm_cntx.IsExitByTimer == FALSE)
- {
- if (g_alm_frm_cntx.IsPwronAlarm)
- {
- AlmExecPwrOffAlarm();
- }
- else
- {
- AlmExecPwrOnAlarm();
- }
- }
- }
- else
- {
- AlmStopHandler();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * AlmWriteToNvram
- * DESCRIPTION
- * Write alarm data to nvram
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmWriteToNvram(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 nvram_buf[NVRAM_ALM_ALARM_DATA_SIZE];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(nvram_buf, 0, NVRAM_ALM_ALARM_DATA_SIZE);
- memcpy(nvram_buf, g_alm_cntx.AlmList, sizeof(g_alm_cntx.AlmList));
- WriteRecord(NVRAM_EF_ALM_ALARM_DATA_LID, 1, (void*)nvram_buf, NVRAM_ALM_ALARM_DATA_SIZE, &error);
- }
- /*****************************************************************************
- * FUNCTION
- * AlmIsAnyAlarmActivated
- * DESCRIPTION
- * To check if there is any activated alarm.
- * PARAMETERS
- * void
- * RETURNS
- * 0 if no activated alarm; otherwise 0.
- *****************************************************************************/
- U8 AlmIsAnyAlarmActivated(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < NUM_OF_ALM; i++)
- if (g_alm_cntx.AlmList[i].State == SET_STATE)
- {
- return 1;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * AlmActivateIndicator
- * DESCRIPTION
- * Show alarm status icon in IDLE screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmActivateIndicator(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ShowStatusIcon(STATUS_ICON_ALARM);
- #ifndef __MMI_SUBLCD_SHORT_STATUSICON_LIST__
- ShowStatusIcon(STATUS_ICON_SUBLCD_ALARM);
- #endif
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * AlmDeactivateIndicator
- * DESCRIPTION
- * Hide alarm status icon in IDLE screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AlmDeactivateIndicator(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HideStatusIcon(STATUS_ICON_ALARM);
- #ifndef __MMI_SUBLCD_SHORT_STATUSICON_LIST__
- HideStatusIcon(STATUS_ICON_SUBLCD_ALARM);
- #endif
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_alm_check_history_and_poweroff
- * DESCRIPTION
- * Check history before sending power off request.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_alm_check_history_and_poweroff(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetScreenCountInHistory() > 0)
- {
- if (GetSubLCDScreenCountInHistory() == 0)
- {
- GoBackHistory();
- }
- else
- {
- GoBackBothLCDHistory();
- }
- }
- else
- {
- AlmSendPowerOff();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryAlmPowerOnConfirmation
- * DESCRIPTION
- * Display confirmation screen to decide power on or not.
- * This screen is used for power off alarm.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryAlmPowerOnConfirmation(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_alm_disable_pwroff();
- EntryNewScreen(SCR_ID_ALM_PWRON_CONFIRM, NULL, EntryAlmPowerOnConfirmation, NULL);
- /* to prevent power on confirmation screen from displaying twice */
- DeleteScreenIfPresent(SCR_ID_ALM_PWRON_CONFIRM);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_ALM_PWRON_CONFIRM);
- ShowCategory123Screen(
- ORGANIZER_MENU_ALARMS_STRINGID,
- ALARMS_MAIN_TITLE_IMAGEID,
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- ALARMS_POWER_ON,
- IMG_GLOBAL_QUESTION,
- guiBuffer);
- SetLeftSoftkeyFunction(AlmSendPowerOn, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_alm_check_history_and_poweroff, KEY_EVENT_UP);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(AlmSendPowerOn, KEY_END, KEY_LONG_PRESS);
- /* to prevent double displayed this screen */
- DeleteScreenIfPresent(SCR_ID_ALM_PWRON_CONFIRM);
- ForceSubLCDScreen(EntryAlmSubLcdScreen);
- #ifdef MMI_ON_WIN32
- SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
- SetRightSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
- SetKeyHandler(PopupNoSupport, KEY_END, KEY_LONG_PRESS);
- #endif /* MMI_ON_WIN32 */
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightAlmInlineRepeat
- * DESCRIPTION
- * Highlight handler of Repeat inline selection item in editor screen.
- * Enable DOW component when selecting "Days"
- * PARAMETERS
- * index [IN] Index of inline selection
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightAlmInlineRepeat(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_alm_freq_set[index] == ALM_FREQ_DAYS)
- {
- if (g_alm_cntx.IsDOWSet == 0)
- {
- /* if the user did not select DOW yet */
- if (g_alm_cntx.AlmList[g_alm_cntx.CurrHiliteAlarm].Days == 0)
- {
- memset(gAlmDaysStates, 1, 7);
- gAlmDaysStates[0] = 0;
- gAlmDaysStates[6] = 0;
- }
- else /* fill user-set value to DOW */
- {
- for (j = 0; j < NUM_DAYS; j++)
- {
- gAlmDaysStates[j] =
- ((((g_alm_cntx.AlmList[g_alm_cntx.CurrHiliteAlarm].Days) & (0x1 << j)) == 0) ? 0 : 1);
- }
- }
- g_alm_cntx.IsDOWSet = 1;
- EnableInlineItem(&wgui_inline_items[4], 4); /* multi select days */
- }
- }
- else
- {
- g_alm_cntx.IsDOWSet = 0;
- memset(gAlmDaysStates, 0, 7);
- DisableInlineItem(&wgui_inline_items[4], 4); /* multi select days */
- }
- RedrawCategory57Screen();
- }
- /* added the support for alarm audio options. */
- /*****************************************************************************
- * FUNCTION
- * AlmGetSnoozeInterval
- * DESCRIPTION
- * Get Snooze Interval
- * PARAMETERS
- * void
- * RETURNS
- * Snooze interval
- *****************************************************************************/
- U8 AlmGetSnoozeInterval(U8 almIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 snooze;
- #ifdef __MMI_ALM_SNOOZE_SETTING__
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- snooze = g_alm_cntx.AlmList[almIndex].SnoozeInterval;
- #endif /* __MMI_ALM_SNOOZE_SETTING__ */
- if (snooze == 0)
- {
- snooze = ALM_SNOOZE_INTERVAL;
- }
- /* ReadValue(NVRAM_ALM_SNOOZE_TIME, &snooze, DS_BYTE, &error); */
- return snooze;
- }
- #ifdef __MMI_ALM_AUDIO_OPTIONS__
- #ifdef __MMI_ALM_CUSTOMIZE_TONE__
- /*****************************************************************************
- * FUNCTION
- * mmi_alm_entry_aud_opt_tone
- * DESCRIPTION
- * The entry function for the screen displaying options for tone audio option.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_alm_entry_aud_opt_tone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 selecteditem = 0;
- U8 totalItems = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_ALM_TONE_SETUP, mmi_alm_exit_aud_opt_tone, mmi_alm_entry_aud_opt_tone, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_ALM_TONE_SETUP);
- SetParentHandler(MENU_ID_ALM_TONE_SETUP);
- RegisterHighlightHandler(mmi_alm_tone_setup_hilite_hdlr);
- /* Get the highlight index from profile */
- if (g_alm_cntx.CurrHiliteAudioOption != ALM_AUDIO_OPTIONS_TONE ||
- (g_alm_cntx.CurrHiliteAudioOption == ALM_AUDIO_OPTIONS_TONE && g_alm_cntx.CurrHiliteAudioOptionValue == 0))
- {
- totalItems = mmi_profiles_get_melody_list((U16) (gstartMidiId + 1), &selecteditem);
- }
- else
- {
- totalItems = mmi_profiles_get_melody_list(g_alm_cntx.CurrHiliteAudioOptionValue, &selecteditem);
- }
- ShowCategory89Screen(
- STR_ALARM_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- totalItems,
- subMenuDataPtrs,
- hintDataPtrs,
- 0,
- selecteditem,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_alm_entry_tone_setup_set_alarm_tone, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_alm_exit_aud_opt_tone
- * DESCRIPTION
- * The exit function for the screen displaying options for tone audio option.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_alm_exit_aud_opt_tone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopToneAudio();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_alm_entry_tone_setup_set_alarm_tone
- * DESCRIPTION
- * Setting Alarm tone ID.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_alm_entry_tone_setup_set_alarm_tone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP tonesetup;
- U32 tempval1 = 0, tempval2 = gtotalRingId;
- U32 data = 0;
- U8 ExtMelodyFlag = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (((g_alm_tone_index) >= (U8) tempval1) && ((g_alm_tone_index) < (U8) (tempval2)))
- {
- tonesetup.ringTone = g_alm_tone_index + gstartRingId;
- }
- tempval1 = tempval2;
- tempval2 = gtotalMidiId + gtotalRingId;
- if (((g_alm_tone_index) >= (U8) tempval1) && ((g_alm_tone_index) < (U8) (tempval2)))
- {
- tonesetup.ringTone = g_alm_tone_index + gstartMidiId - gtotalRingId;
- }
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- tempval1 = tempval2;
- tempval2 = gtotalMidiId + gtotalRingId + MAXIMUM_EXT_MELODY_NUM;
- if (((g_alm_tone_index) >= (U8) tempval1) && ((g_alm_tone_index) < (U8) (tempval2)))
- {
- /* data is zero based */
- data = g_alm_tone_index - (gtotalMidiId + gtotalRingId);
- g_ext_melody_idx = (U8) data;
- ExtMelodyFlag = MMI_TRUE;
- }
- if (ExtMelodyFlag == MMI_TRUE)
- {
- g_alm_tone_conf_type = PRFSET_MELODY_TYPE_ALARM;
- mmi_alm_entry_tone_setup_ext_melody();
- return;
- }
- #endif /* defined(__MMI_PROFILE_EXTMELODY_SUPPORT__) */
- #if defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__)
- if (g_alm_tone_index == tempval2)
- {
- DYNAUDIOINFO *download_theme_tones;
- if (GetThemeV2TonesInfo(&download_theme_tones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- tonesetup.ringTone = (U16) download_theme_tones[0].AudioId;
- }
- }
- #endif /* defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) */
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- g_alm_cntx.CurrHiliteAudioOptionValue = tonesetup.ringTone;
- g_alm_cntx.CurrHiliteAudioOption = ALM_AUDIO_OPTIONS_TONE;
- g_alm_aud_opt_selected = TRUE;
- StopToneAudio();
- DeleteScreenIfPresent(SCR_ID_ALM_TONE_SETUP);
- }
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- /*****************************************************************************
- * FUNCTION
- * mmi_alm_entry_tone_setup_ext_melody
- * DESCRIPTION
- * Entry function for the external melodies screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_alm_entry_tone_setup_ext_melody(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *nStrItemList[PRF_MENU_EXTMLD_MAX];
- U8 nNumofItem = 0;
- U8 *guiBuffer;
- U16 StrIDToneSet = 0, StrIDToneDel = 0, StrIDToneAdd = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StrIDToneSet = STR_TONE_SETUP_ALARM_TONE_EXT_SET;
- StrIDToneDel = STR_TONE_SETUP_ALARM_TONE_EXT_DEL;
- StrIDToneAdd = STR_TONE_SETUP_ALARM_TONE_EXT_ADD;
- if (PmgIsEmptySlot(g_ext_melody_idx) == MMI_FALSE) /* Not Empty Slot */
- {
- nStrItemList[PRF_MENU_EXTMLD_DONE] = (U8*) GetString(StrIDToneSet);
- nStrItemList[PRF_MENU_EXTMLD_DEL] = (U8*) GetString(StrIDToneDel);
- nStrItemList[PRF_MENU_EXTMLD_ADD] = (U8*) GetString(StrIDToneAdd);
- nNumofItem = (U8) PRF_MENU_EXTMLD_MAX;
- }
- else /* Empty slot, show replace only */
- {
- nStrItemList[0] = (U8*) GetString(StrIDToneAdd);
- nNumofItem = 1;
- }
- EntryNewScreen(SCR_ID_ALM_TONE_SETUP_EXT_MELODY, NULL, mmi_alm_entry_tone_setup_ext_melody, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_ALM_TONE_SETUP_EXT_MELODY);
- RegisterHighlightHandler(mmi_alm_tone_setup_ext_melody_hilight_hdlr);
- ShowCategory56Screen(
- STR_ALARM_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- NULL,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_alm_tone_setup_ext_melody_option, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_alm_tone_setup_ext_melody_hilight_hdlr
- * DESCRIPTION
- * Highlight handler for the external melodies options screen
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_alm_tone_setup_ext_melody_hilight_hdlr(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- extMldHlitItem = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_alm_tone_setup_ext_melody_option
- * DESCRIPTION
- * LSK fucntion for the external melodies options screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_alm_tone_setup_ext_melody_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 idx = mmi_alm_tone_setup_convert_empty_slot_menu_list(extMldHlitItem);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (idx == PRF_MENU_EXTMLD_DONE)
- {
- if (PmgIsEmptySlot(g_ext_melody_idx) == MMI_FALSE)
- {
- g_alm_cntx.CurrHiliteAudioOptionValue = PMG_EXT_MELODY_BEGIN + g_ext_melody_idx;
- g_alm_cntx.CurrHiliteAudioOption = ALM_AUDIO_OPTIONS_TONE;
- g_alm_aud_opt_selected = TRUE;
- if (g_alm_tone_conf_type != PRFSET_MELODY_TYPE_PHB_RING)
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,