SettingScreenProf.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:477k
源码类别:
MTK
开发平台:
C/C++
- * Setting Ringtone ID.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetCoverCloseToneId(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryScrSetPowerOffToneIdCountId(EntryScrSetCoverCloseToneId_Ext);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetCoverCloseToneId_Ext
- * DESCRIPTION
- * Setting Ringtone ID.
- * PARAMETERS
- * ExtMelodyFlag [IN]
- * ringTone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetCoverCloseToneId_Ext(U8 ExtMelodyFlag, U16 ringTone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- TONE_SETUP tone;
- tone.coverCloseTone= ringTone;
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- if (ExtMelodyFlag == MMI_TRUE)
- {
- prfset_conf_type = PRFSET_MELODY_TYPE_COVERCLOSE;
- PmgSetToneType( prfset_conf_type); //Joey added for changing the MS tone style on 2007-4-05
- EntryPrfSetPOnOffToneExtMelody();
- }
- else
- #endif /* __MMI_PROFILE_EXTMELODY_SUPPORT__ */
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- SetCoverCloseToneType(tone);
- DeleteScreenIfPresent(SCR_COVERCLOSE_TONE_SETUP);
- }
- }
- void StopExtCoverOpenTone()
- {
- stopRequestedTone(COVER_OPEN_TONE);
- }
- void StopExtCoverCloseTone()
- {
- stopRequestedTone(COVER_CLOSE_TONE);
- }
- #else
- //KP Jerry add for changing the style of message tone list on 2007-4-10 end
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesCoverOpenToneSetup
- * DESCRIPTION
- * Showing profile Cover Open Tone Setup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesCoverOpenToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 UnicodenStrItemList[10]; /* Stores the strings id of submenus returned */
- U8 AsciinStrItemList[4]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 i = 0;
- COVER_OPEN_TONE_ENUM data = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(
- SCR_COVEROPEN_TONE_SETUP,
- ExitScrProfilesCoverOpenToneSetup,
- EntryScrProfilesCoverOpenToneSetup,
- NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_COVEROPEN_TONE_SETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = gtotalGeneralToneId + 1;
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_TONE_SETUP_COVEROPEN_TONE);
- memset((S8*) subMenuDataPtrs[0], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[0], (S8*) GetString(STR_PROFILES_SILENT), MAX_SUBMENU_CHARACTERS);
- for (i = 1; i <= gtotalGeneralToneId; i++)
- {
- S32 len = 0;
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- sprintf((PS8) AsciinStrItemList, "%d", i);
- AnsiiToUnicodeString((PS8) UnicodenStrItemList, (PS8) AsciinStrItemList);
- len = pfnUnicodeStrlen((PS8) UnicodenStrItemList);
- len = MAX_SUBMENU_CHARACTERS - len;
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], (S8*) GetString(STR_PROFILES_TONE), MAX_SUBMENU_CHARACTERS);
- pfnUnicodeStrcat((PS8) subMenuDataPtrs[i], (PS8) UnicodenStrItemList);
- }
- /* 6 Set current parent id */
- SetParentHandler(MENU_TONE_SETUP_COVEROPEN_TONE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(GetCurrScreenHandlerfive);
- /* 8 Display Category Screen */
- if (gprofiles[gprofileId].toneSetup.coverOpenTone != COVER_OPEN_SILENT)
- {
- data = (gprofiles[gprofileId].toneSetup.coverOpenTone - gstartGeneralToneId) + 1;
- }
- else
- {
- data = 0;
- }
- ShowCategory89Screen(
- STR_COVEROPEN_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- subMenuDataPtrs,
- NULL,
- 0,
- (U16) data,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntryScrSetCoverOpenTone, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler(SCR_COVEROPEN_TONE_SETUP, ExitScrProfilesCoverOpenToneSetup); */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetCoverOpenTone
- * DESCRIPTION
- * Set Cover open tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetCoverOpenTone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP tonesetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gcurrHiliteIndexOne == 0)
- {
- tonesetup.coverOpenTone = COVER_OPEN_SILENT;
- }
- else
- {
- tonesetup.coverOpenTone = (gcurrHiliteIndexOne + gstartGeneralToneId) - 1;
- }
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- SetCoverOpenToneType(tonesetup);
- DeleteScreenIfPresent(SCR_COVEROPEN_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesCoverCloseToneSetup
- * DESCRIPTION
- * Showing profile Cover Close Tone Setup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesCoverCloseToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 UnicodenStrItemList[10]; /* Stores the strings id of submenus returned */
- U8 AsciinStrItemList[4]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 i = 0;
- COVER_CLOSE_TONE_ENUM data = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(
- SCR_COVERCLOSE_TONE_SETUP,
- ExitScrProfilesCoverCloseToneSetup,
- EntryScrProfilesCoverCloseToneSetup,
- NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_COVERCLOSE_TONE_SETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = gtotalGeneralToneId + 1;
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_TONE_SETUP_COVERCLOSE_TONE);
- memset((S8*) subMenuDataPtrs[0], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[0], (S8*) GetString(STR_PROFILES_SILENT), MAX_SUBMENU_CHARACTERS);
- for (i = 1; i <= gtotalGeneralToneId; i++)
- {
- S32 len = 0;
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- sprintf((PS8) AsciinStrItemList, "%d", i);
- AnsiiToUnicodeString((PS8) UnicodenStrItemList, (PS8) AsciinStrItemList);
- len = pfnUnicodeStrlen((PS8) UnicodenStrItemList);
- len = MAX_SUBMENU_CHARACTERS - len;
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], (S8*) GetString(STR_PROFILES_TONE), MAX_SUBMENU_CHARACTERS);
- pfnUnicodeStrcat((PS8) subMenuDataPtrs[i], (PS8) UnicodenStrItemList);
- }
- /* 6 Set current parent id */
- SetParentHandler(MENU_TONE_SETUP_COVERCLOSE_TONE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(GetCurrScreenHandlerfive);
- /* 8 Display Category Screen */
- if (gprofiles[gprofileId].toneSetup.coverCloseTone != COVER_CLOSE_SILENT)
- {
- data = (gprofiles[gprofileId].toneSetup.coverCloseTone - gstartGeneralToneId) + 1;
- }
- else
- {
- data = 0;
- }
- ShowCategory89Screen(
- STR_COVERCLOSE_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- subMenuDataPtrs,
- NULL,
- 0,
- (U16) data,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntryScrSetCoverCloseTone, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler(SCR_COVERCLOSE_TONE_SETUP,ExitScrProfilesCoverCloseToneSetup); */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetCoverCloseTone
- * DESCRIPTION
- * Set Cover close tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetCoverCloseTone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP tonesetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gcurrHiliteIndexOne == 0)
- {
- tonesetup.coverCloseTone = COVER_CLOSE_SILENT;
- }
- else
- {
- tonesetup.coverCloseTone = (gcurrHiliteIndexOne + gstartGeneralToneId) - 1;
- }
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- SetCoverCloseToneType(tonesetup);
- DeleteScreenIfPresent(SCR_COVERCLOSE_TONE_SETUP);
- }
- #endif //KP Jerry add for changing the style of message tone list on 2007-4-10
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesCoverCloseToneSetup
- * DESCRIPTION
- * Exit profile Cover Close ToneSetup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfilesCoverCloseToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (glastaudioId != POWERON_SILENT);
- StopToneAudio();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesCoverOpenToneSetup
- * DESCRIPTION
- * Exit profile Cover Open ToneSetup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfilesCoverOpenToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (glastaudioId != POWERON_SILENT);
- StopToneAudio();
- }
- #endif /* __MMI_CLAMSHELL__ */
- //KP Jerry add for changing the style of message tone list on 2007-4-10 start
- #ifdef __MMI_TONE_LIST_STYLE_CHANGED__
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesMessageToneSetup
- * DESCRIPTION
- * Showing profile Message Tone Setup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesMessageToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nDispAttribute; /* Stores display attribue */
- U16 selecteditem = 0;
- U8 totalItems = 0;
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_MESSAGE_TONE_SETUP, ExitScrProfilesMessageToneSetup, EntryScrProfilesMessageToneSetup, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_MESSAGE_TONE_SETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- totalItems =mmi_profiles_get_ms_tone_list((U16)gprofiles[gprofileId].toneSetup.messageTone, &selecteditem);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_TONE_SETUP_MESSAGE_TONE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- /* 6 Set current parent id */
- SetParentHandler(MENU_TONE_SETUP_MESSAGE_TONE);
- /* 7 Register highlight handler to be called in menu screen */
- /* MTK Brian modified for playing message tone, 2003/11/7 */
- RegisterHighlightHandler(mmi_profiles_ms_tone_list_highlight_hdlr);
- /* 8 Display Category Screen */
- ShowCategory89Screen(
- STR_MESSAGE_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- totalItems,
- subMenuDataPtrs,
- hintDataPtrs,
- 0,
- selecteditem,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntryScrSetMSToneId, KEY_EVENT_UP);//EntryScrSetMessageTone
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 10. Register Exit handler */
- /* SetExitHandler(SCR_MESSAGE_TONE_SETUP,ExitScrProfilesMessageToneSetup); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_get_melody_list
- * DESCRIPTION
- * Build melody list
- * PARAMETERS
- * CurMelodyID [IN]
- * selecteditem [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U8 mmi_profiles_get_ms_tone_list(U16 CurMelodyID, U16 *selecteditem)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- U8 UnicodenStrItemList[10]; /* Stores the strings id of submenus returned */
- U8 AsciinStrItemList[4]; /* Stores the strings id of submenus returned */
- U8 i = 0;
- /*----------------------------------------------------------------*/
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- DYNEXTMELODYINFO *ExtMSMelodyInfo;
- #endif
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- DYNAUDIOINFO *DownloadThemeTones;
- #endif
- int index, data;
- U16 nNumofItem = gtotalMiscToneId + 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* init hint data */
- memset(hintData, 0, sizeof(hintData));
- for (data = 0; data < MAX_SUB_MENUS; data++)
- {
- hintDataPtrs[data] = hintData[data];
- }
- memset((S8*) subMenuDataPtrs[0], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[0], (S8*) GetString(STR_PROFILES_SILENT), MAX_SUBMENU_CHARACTERS);
- for (i = 1; i <= gtotalMiscToneId; i++)
- {
- S32 len = 0;
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- sprintf((PS8) AsciinStrItemList, "%d", i);
- AnsiiToUnicodeString((PS8) UnicodenStrItemList, (PS8) AsciinStrItemList);
- len = pfnUnicodeStrlen((PS8) UnicodenStrItemList);
- len = MAX_SUBMENU_CHARACTERS - len;
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], (S8*) GetString(STR_PROFILES_TONE), MAX_SUBMENU_CHARACTERS);
- pfnUnicodeStrcat((PS8) subMenuDataPtrs[i], (PS8) UnicodenStrItemList);
- }
- /* make a listing of ext melodies. */
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- PmgSetToneType( PRFSET_MELODY_TYPE_MS);
- MSPmgGetExtMelodyInfo(&ExtMSMelodyInfo);
- for (index = nNumofItem, data = 0; data < MAXIMUM_EXT_MELODY_NUM; index++, data++)
- {
- if (MSPmgIsEmptySlot((U8) data) == MMI_FALSE)
- {
- if (MSPmgQueryFileExistBySlot((U8) data) == MMI_FALSE)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_TONE_FILE_NOT_EXIST));
- }
- if (IS_EXTMELODY_SHORTNAME(ExtMSMelodyInfo->info[data].filepath))
- {
- mmi_chset_mixed_text_to_ucs2_str(
- subMenuDataPtrs[index],
- (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
- (U8*) ExtMSMelodyInfo->info[data].filename,
- g_chset_text_encoding);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) subMenuDataPtrs[index], (S8*) ((ExtMSMelodyInfo->info[data]).filename));
- }
- #if (!defined(__MMI_SHOW_FILE_EXT__))
- PmgRemoveFileExt((S8*) subMenuDataPtrs[index]);
- #elif (!defined(__MMI_SHOW_DAF_FILE_EXT__))
- PmgRemoveFileDAFExt((S8*) subMenuDataPtrs[index]);
- #endif
- }
- else
- {
- pfnUnicodeStrcpy((S8*) subMenuDataPtrs[index], (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- }
- #endif /* __MMI_PROFILE_EXTMELODY_SUPPORT__ */
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- if (GetThemeV2TonesInfo(&DownloadThemeTones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- pfnUnicodeStrcpy((S8*) subMenuDataPtrs[index++], (S8*) GetString(STR_PROFILES_CURR_THEME));
- }
- #endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */
- /* find highlight selection */
- if (CurMelodyID >= gstartMiscToneId && CurMelodyID < gstartMiscToneId + gtotalMiscToneId)
- {
- *selecteditem = CurMelodyID - gstartMiscToneId + 1;
- }
- else if (MESSAGE_SILENT==CurMelodyID)
- {
- *selecteditem = 0;
- }
- else
- {
- BOOL selected = FALSE;
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- for (data = 0; data < MAXIMUM_EXT_MELODY_NUM; data++)
- {
- if (MSPmgIsEmptySlot((U8) data) == MMI_FALSE && CurMelodyID == (ExtMSMelodyInfo->info[data]).id)
- {
- *selecteditem = nNumofItem + data;
- selected = TRUE;
- break;
- }
- }
- nNumofItem += MAXIMUM_EXT_MELODY_NUM;
- #endif /* __MMI_PROFILE_EXTMELODY_SUPPORT__ */
- #if defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__)
- if (!selected)
- {
- if (GetThemeV2TonesInfo(&DownloadThemeTones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- if ((U16)DownloadThemeTones[0].AudioId == CurMelodyID)
- {
- selected = TRUE;
- *selecteditem = nNumofItem;
- if (AudioFileDeletedFromFmgr(CurMelodyID))
- {
- pfnUnicodeStrcpy((S8*) hintData[nNumofItem], GetString(STR_TONE_FILE_NOT_EXIST));
- }
- }
- }
- }
- #endif /* defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) */
- ASSERT(selected);
- }
- return (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_melody_list_highlight_hdlr
- * DESCRIPTION
- * Getting Current Screen Handler
- * PARAMETERS
- * item_index [IN]
- * index_index(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_profiles_ms_tone_list_highlight_hdlr(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL play_it = TRUE;
- U16 numOfItem = gtotalMiscToneId + 1;// gtotalRingId + gtotalMidiId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gcurrHiliteIndexOne = (U16) item_index;
- StopToneAudio();
- if (0 == gcurrHiliteIndexOne)
- {
- gcurrentaudioId = 0;
- glastaudioId = gcurrentaudioId;
- /* MTK Brian added for stop timer in case of 0-->0, 2003/11/18 */
- }
- else if (gcurrHiliteIndexOne < numOfItem)
- {
- gcurrentaudioId = gcurrHiliteIndexOne + gstartMiscToneId - 1;
- }
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- else if (gcurrHiliteIndexOne < numOfItem + MAXIMUM_EXT_MELODY_NUM)
- {
- g_ms_ext_melody_idx = (U8) (gcurrHiliteIndexOne - numOfItem);
- gcurrentaudioId = (U16) g_ms_ext_melody_idx + PMG_EXT_MS_MELODY_BEGIN;
- }
- #endif /* defined(__MMI_PROFILE_EXTMELODY_SUPPORT__) */
- else
- {
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- numOfItem += MAXIMUM_EXT_MELODY_NUM;
- #endif
- #if defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__)
- if (gcurrHiliteIndexOne == numOfItem)
- {
- DYNAUDIOINFO *download_theme_tones;
- if (GetThemeV2TonesInfo(&download_theme_tones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- gcurrentaudioId = (U16) download_theme_tones[0].AudioId;
- if (AudioFileDeletedFromFmgr(gcurrentaudioId))
- {
- play_it = FALSE;
- }
- }
- else
- {
- ASSERT(0);
- }
- }
- #endif /* defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) */
- }
- if (play_it)
- {
- StartTimer(TIMER_PROFILES_TONE_PLAY, 1000, PlayToneAudio);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PrfCallBackExtMldReplace
- * DESCRIPTION
- *
- * PARAMETERS
- * path [?]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PrfCallBackExtMldMSReplace(void *path, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *filepath = (S8*) path;
- PMG_ADDFILE_ERRNO err = PMG_ADDFILE_ERR_UNKNOWN;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (filepath)
- {
- #if defined(__DRM_SUPPORT__) && defined(MMI_ON_HARDWARE_P)
- if (!mmi_profiles_check_DRM_content_forwardable((UI_string_type) filepath))
- {
- err = PMG_ADDFILE_ERR_DRM_PROHIBTED;
- }
- else
- #endif /* defined(__DRM_SUPPORT__) && defined(MMI_ON_HARDWARE_P) */
- if (PmgCheckImyMidFileSize(filepath) == PMG_ADDFILE_ERR_FILE_TOO_LARGE)
- {
- err = PMG_ADDFILE_ERR_FILE_TOO_LARGE;
- }
- else
- {
- MSPmgSetShortFileName((BOOL) is_short);
- if (MSPmgIsEmptySlot(g_ms_ext_melody_idx) == MMI_FALSE)
- {
- err = MSPmgReplaceExtMelodyBySlotPathFileName(filepath, g_ms_ext_melody_idx);
- }
- else
- {
- err = MSPmgAddExtMelodyBySlotPathFileName(filepath, g_ms_ext_melody_idx);
- }
- }
- switch (err)
- {
- case PMG_ADDFILE_ERR_SUCCESS:
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- break;
- case PMG_ADDFILE_ERR_STR_TOO_LONG:
- case PMG_ADDFILE_ERR_STRFILE_TOO_LONG:
- case PMG_ADDFILE_ERR_STRPATH_TOO_LONG:
- DisplayPopup(
- (PU8) GetString(STR_PROFILES_RING_TONE_SETUP_NAMETOOLONG),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- break;
- case PMG_ADDFILE_ERR_SLOT_FULL:
- DisplayPopup(
- (PU8) GetString(STR_PROFILES_RING_TONE_SETUP_LISTFULL),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- break;
- case PMG_ADDFILE_ERR_FILE_TOO_LARGE:
- DisplayPopup(
- (PU8) GetString(STR_PROFILES_RING_TONE_SETUP_FILETOOLARGE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- break;
- case PMG_ADDFILE_ERR_DUPLICATED:
- DisplayPopup(
- (PU8) GetString(STR_PROFILES_RING_TONE_SETUP_DUPLICATED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- break;
- #if defined(__DRM_SUPPORT__) && defined(MMI_ON_HARDWARE_P)
- case PMG_ADDFILE_ERR_DRM_PROHIBTED:
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DRM_PROHIBITED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- break;
- #endif /* defined(__DRM_SUPPORT__) && defined(MMI_ON_HARDWARE_P) */
- default:
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- break;
- }
- //Joey added for changing the MS tone style on 2007-4-03
- if (prfset_conf_type == PRFSET_MELODY_TYPE_MS)
- {
- DeleteUptoScrID(MENU_TONE_SETUP_MS_TONE_EXT_MELODY);//MENU_TONE_SETUP_MS_TONE_EXT_MELODY
- DeleteScreenIfPresent(MENU_TONE_SETUP_MS_TONE_EXT_MELODY);//MENU_TONE_SETUP_MS_TONE_EXT_MELODY
- }
- else
- {
- DeleteUptoScrID(MENU_TONE_SETUP_RING_TONE_EXT_MELODY);
- DeleteScreenIfPresent(MENU_TONE_SETUP_RING_TONE_EXT_MELODY);
- }
- }
- else
- {
- if (prfset_conf_type == PRFSET_MELODY_TYPE_MS)
- {
- GoBackToHistory(MENU_TONE_SETUP_MS_TONE_EXT_MELODY);//
- }
- else
- {
- GoBackToHistory(MENU_TONE_SETUP_RING_TONE_EXT_MELODY);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PrfSetMSToneConvertEmptySlotMenuList
- * DESCRIPTION
- *
- * PARAMETERS
- * idx [IN]
- * RETURNS
- * If change it or not ? decided by the global g_ext_melody_idx
- *****************************************************************************/
- static U8 PrfSetMSToneConvertEmptySlotMenuList(U8 idx)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PmgSetToneType( prfset_conf_type);
- if (MSPmgIsEmptySlot(g_ms_ext_melody_idx) == MMI_FALSE)
- { /* Not Empty slot */
- return idx;
- }
- else
- {
- if (idx == 0)
- {
- return PRF_MENU_EXTMLD_ADD; /* PRF_MENU_EXTMLD_DONE */
- }
- #if MMI_ON_HARDWARE_P
- else
- {
- MMI_ASSERT(MMI_FALSE);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- return PRF_MENU_EXTMLD_MAX;
- }
- /*****************************************************************************
- * FUNCTION
- * PrfSetMSExtMelodyDrvSelect
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PrfSetMSExtMelodyDrvSelect(void)
- {
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 phoneDrvLetter, cardDrvLetter;
- S8 temp[3];
- UI_character_type dir_phone_root[4];
- UI_character_type dir_card_root[4];
- FMGR_FILTER filter;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET_AUDIO(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER_DOT);
- //#define MMI_PUBLIC_DRV FS_GetDrive(FS_DRIVE_V_NORMAL, 2, FS_DRIVE_V_NORMAL | FS_DRIVE_I_SYSTEM)
- //#define MMI_CARD_DRV FS_GetDrive(FS_DRIVE_V_REMOVABLE, 1, FS_NO_ALT_DRIVE)
- phoneDrvLetter = FS_GetDrive(FS_DRIVE_V_NORMAL, 2, FS_DRIVE_I_SYSTEM | FS_DRIVE_V_NORMAL);
- cardDrvLetter = FS_GetDrive(FS_DRIVE_V_REMOVABLE, 1, FS_NO_ALT_DRIVE);
- sprintf(temp, "%c:\", (S8) phoneDrvLetter);
- AnsiiToUnicodeString((S8*) dir_phone_root, temp);
- sprintf(temp, "%c:\", (S8) cardDrvLetter);
- AnsiiToUnicodeString((S8*) dir_card_root, temp);
- PmgSetToneType( prfset_conf_type);
- if (ms_extMldHlitItem == PRF_MENU_EXTMLD_DRV_CARD)
- {
- mmi_fmgr_select_path_and_enter(
- APP_PROFILES,
- FMGR_SELECT_FILE,
- filter,
- (PS8) dir_card_root,
- PrfCallBackExtMldMSReplace);
- }
- else /* if( extMldHlitItem == PRF_MENU_EXTMLD_DRV_PHONE) */
- {
- mmi_fmgr_select_path_and_enter(
- APP_PROFILES,
- FMGR_SELECT_FILE,
- filter,
- (PS8) dir_phone_root,
- PrfCallBackExtMldMSReplace);
- }
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPrfSetMSToneExtMelodyDrv
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPrfSetMSToneExtMelodyDrv(void)
- {
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* 0 */
- U8 *nStrItemList[PRF_MENU_EXTMLD_DRV_MAX];
- U8 nNumofItem = (U8) PRF_MENU_EXTMLD_DRV_MAX;
- U8 *guiBuffer;
- S16 CardDrv = -1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- // #define MMI_CARD_DRV FS_GetDrive(FS_DRIVE_V_REMOVABLE, 1, FS_NO_ALT_DRIVE)
- CardDrv = FS_GetDrive(FS_DRIVE_V_REMOVABLE, 1, FS_NO_ALT_DRIVE);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- if (CardDrv > 0) /* Card Storage is present */
- {
- U16 StrIDTitle = 0;
- StrIDTitle = STR_MESSAGE_TONE_CAPTION;
- nStrItemList[PRF_MENU_EXTMLD_DRV_PHONE] = (U8*) GetString(STR_PROFILES_RING_TONE_SETUP_DRV_PHONE);
- nStrItemList[PRF_MENU_EXTMLD_DRV_CARD] = (U8*) GetString(STR_PROFILES_RING_TONE_SETUP_DRV_CARD);
- EntryNewScreen(MENU_TONE_SETUP_MS_TONE_EXT_MELODY_DRV, NULL, EntryPrfSetMSToneExtMelodyDrv, NULL);
- guiBuffer = GetCurrGuiBuffer(MENU_TONE_SETUP_MS_TONE_EXT_MELODY_DRV);
- RegisterHighlightHandler(HighlightPrfSetMSToneExtMelody);
- ShowCategory56Screen(
- StrIDTitle,
- (U16) (prfset_conf_type == PRFSET_MELODY_TYPE_PHB_RING ? IMG_SCR_PBOOK_CAPTION : IMG_PROFILES_TITLEE),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (S32) nNumofItem,
- nStrItemList,
- NULL,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(PrfSetMSExtMelodyDrvSelect, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* SetExitHandler (MENU_TONE_SETUP_RING_TONE_EXT_MELODY_DRV, ExitPrfSetRingToneExtMelodyDrv); */
- }
- else /* Card Storage not present */
- {
- ms_extMldHlitItem = PRF_MENU_EXTMLD_DRV_PHONE;
- PrfSetMSExtMelodyDrvSelect();
- }
- #endif /* 0 */
- }
- /*****************************************************************************
- * FUNCTION
- * PrfSetMSToneExtMelody
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PrfSetMSToneExtMelody(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 idx = PrfSetMSToneConvertEmptySlotMenuList(ms_extMldHlitItem);
- TONE_SETUP tone;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PmgSetToneType( PRFSET_MELODY_TYPE_MS);
- if (idx == PRF_MENU_EXTMLD_DONE)
- {
- if (MSPmgIsEmptySlot(g_ms_ext_melody_idx) == MMI_FALSE)
- {
- tone.messageTone=PMG_EXT_MS_MELODY_BEGIN + g_ms_ext_melody_idx;
- SetMessageToneType(tone);
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- }
- }
- else if (idx == PRF_MENU_EXTMLD_DEL)
- {
- if (MSPmgDelExtMelodyById((U16) (PMG_EXT_MS_MELODY_BEGIN + g_ms_ext_melody_idx)) == MMI_TRUE)
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- }
- }
- else if (idx == PRF_MENU_EXTMLD_ADD)
- {
- EntryPrfSetMSToneExtMelodyDrv();
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPrfMSToneExtMelody
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPrfSetMSToneExtMelody(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ms_extMldHlitItem = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPrfSetRingToneExtMelody
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPrfSetMSToneExtMelody(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *nStrItemList[PRF_MENU_EXTMLD_MAX];
- U8 nNumofItem = 0;
- U8 *guiBuffer;
- U16 StrIDToneSet = 0, StrIDToneDel = 0, StrIDToneAdd = 0, StrIDTitle = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PmgSetToneType( prfset_conf_type);
- if(prfset_conf_type == PRFSET_MELODY_TYPE_MS)
- {
- StrIDToneSet = STR_TONE_SETUP_RING_TONE_EXT_SET;
- StrIDToneDel = STR_TONE_SETUP_RING_TONE_EXT_DEL;
- StrIDToneAdd = STR_TONE_SETUP_RING_TONE_EXT_ADD;
- StrIDTitle = STR_MESSAGE_TONE_CAPTION;
- }
- if (MSPmgIsEmptySlot(g_ms_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(MENU_TONE_SETUP_MS_TONE_EXT_MELODY, NULL, EntryPrfSetMSToneExtMelody, NULL);
- guiBuffer = GetCurrGuiBuffer(MENU_TONE_SETUP_MS_TONE_EXT_MELODY);
- RegisterHighlightHandler(HighlightPrfSetMSToneExtMelody);
- ShowCategory56Screen(
- StrIDTitle,
- (U16) (prfset_conf_type == PRFSET_MELODY_TYPE_PHB_RING ? IMG_SCR_PBOOK_CAPTION : IMG_PROFILES_TITLEE),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (S32) nNumofItem,
- nStrItemList,
- NULL,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(PrfSetMSToneExtMelody, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* SetExitHandler (MENU_TONE_SETUP_RING_TONE_EXT_MELODY, ExitPrfSetRingToneExtMelody); */
- }
- /*****************************************************************************
- * FUNCTION
- * PrfSetMSToneConfType
- * DESCRIPTION
- *
- * PARAMETERS
- * type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PrfSetMSToneConfType(PRFSET_MELODY_CONF_TYPE type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- prfset_conf_type = type;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetRingToneId
- * DESCRIPTION
- * Setting Ringtone ID.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetMSToneId(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryScrSetMSToneIdCountId(EntryScrSetMSToneId_Ext);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetRingToneIdCountId
- * DESCRIPTION
- * Count Ringtone ID.
- * PARAMETERS
- * Func_Callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetMSToneIdCountId(void (*Func_Callback) (U8, U16))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 is_ext_melody = MMI_FALSE;
- U16 numOfItem = gtotalMiscToneId + 1;// gtotalRingId + gtotalMidiId;
- U16 mstone_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(0==gcurrHiliteIndexOne )
- {
- mstone_id = MESSAGE_SILENT;
- }
- else if(gcurrHiliteIndexOne < numOfItem)//g_profiles_melody_list_index
- {
- mstone_id = gcurrHiliteIndexOne + gstartMiscToneId - 1;//
- }
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- else if (gcurrHiliteIndexOne < numOfItem + MAXIMUM_EXT_MELODY_NUM)//g_profiles_melody_list_index
- {
- g_ms_ext_melody_idx = (U8) (gcurrHiliteIndexOne - numOfItem); //g_profiles_melody_list_index
- mstone_id = (U16) g_ms_ext_melody_idx + PMG_EXT_MS_MELODY_BEGIN;
- is_ext_melody = MMI_TRUE;
- }
- #endif /* defined(__MMI_PROFILE_EXTMELODY_SUPPORT__) */
- else
- {
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- numOfItem += MAXIMUM_EXT_MELODY_NUM;
- #endif
- #if defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__)
- if (gcurrHiliteIndexOne == numOfItem) //g_profiles_melody_list_index
- {
- DYNAUDIOINFO *download_theme_tones;
- if (GetThemeV2TonesInfo(&download_theme_tones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- mstone_id = (U16) download_theme_tones[0].AudioId;
- }
- else
- {
- ASSERT(0);
- }
- }
- #endif /* defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) */
- }
- Func_Callback(is_ext_melody, mstone_id);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetRingToneId_Ext
- * DESCRIPTION
- * Setting Ringtone ID.
- * PARAMETERS
- * ExtMelodyFlag [IN]
- * ringTone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetMSToneId_Ext(U8 ExtMelodyFlag, U16 msTone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- TONE_SETUP ms_tone;
- ms_tone.messageTone = msTone;
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- if (ExtMelodyFlag == MMI_TRUE)
- {
- prfset_conf_type = PRFSET_MELODY_TYPE_MS;
- PmgSetToneType( prfset_conf_type);
- EntryPrfSetMSToneExtMelody();
- }
- else
- #endif /* __MMI_PROFILE_EXTMELODY_SUPPORT__ */
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- SetMessageToneType(ms_tone);
- DeleteScreenIfPresent(SCR_MESSAGE_TONE_SETUP);
- }
- }
- void StopExtMSTone()
- {
- stopRequestedTone(MESSAGE_TONE);
- }
- #else
- //KP Jerry add for changing the style of message tone list on 2007-4-10 end
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesMessageToneSetup
- * DESCRIPTION
- * Showing profile Message Tone Setup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesMessageToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 UnicodenStrItemList[10]; /* Stores the strings id of submenus returned */
- U8 AsciinStrItemList[4]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 i = 0;
- MESSAGE_TONE_ENUM data = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_MESSAGE_TONE_SETUP, ExitScrProfilesMessageToneSetup, EntryScrProfilesMessageToneSetup, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_MESSAGE_TONE_SETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = gtotalMiscToneId + 1;
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_TONE_SETUP_MESSAGE_TONE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- memset((S8*) subMenuDataPtrs[0], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[0], (S8*) GetString(STR_PROFILES_SILENT), MAX_SUBMENU_CHARACTERS);
- for (i = 1; i <= gtotalMiscToneId; i++)
- {
- S32 len = 0;
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- sprintf((PS8) AsciinStrItemList, "%d", i);
- AnsiiToUnicodeString((PS8) UnicodenStrItemList, (PS8) AsciinStrItemList);
- len = pfnUnicodeStrlen((PS8) UnicodenStrItemList);
- len = MAX_SUBMENU_CHARACTERS - len;
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], (S8*) GetString(STR_PROFILES_TONE), MAX_SUBMENU_CHARACTERS);
- pfnUnicodeStrcat((PS8) subMenuDataPtrs[i], (PS8) UnicodenStrItemList);
- }
- /* 6 Set current parent id */
- SetParentHandler(MENU_TONE_SETUP_MESSAGE_TONE);
- /* 7 Register highlight handler to be called in menu screen */
- /* MTK Brian modified for playing message tone, 2003/11/7 */
- RegisterHighlightHandler(GetCurrScreenHandlersix);
- /* 8 Display Category Screen */
- if (gprofiles[gprofileId].toneSetup.messageTone != MESSAGE_SILENT)
- {
- data = (gprofiles[gprofileId].toneSetup.messageTone - gstartMiscToneId) + 1;
- }
- else
- {
- data = 0;
- }
- ShowCategory89Screen(
- STR_MESSAGE_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- subMenuDataPtrs,
- NULL,
- 0,
- (U16) data,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntryScrSetMessageTone, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 10. Register Exit handler */
- /* SetExitHandler(SCR_MESSAGE_TONE_SETUP,ExitScrProfilesMessageToneSetup); */
- }
- #endif //KP Jerry add for changing the style of message tone list on 2007-4-10
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetMessageTone
- * DESCRIPTION
- * Set Message Tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetMessageTone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP tonesetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gcurrHiliteIndexOne == 0)
- {
- tonesetup.messageTone = MESSAGE_SILENT;
- }
- else
- {
- tonesetup.messageTone = (gcurrHiliteIndexOne + gstartMiscToneId) - 1;
- }
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- SetMessageToneType(tonesetup);
- DeleteScreenIfPresent(SCR_MESSAGE_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesMessageToneSetup
- * DESCRIPTION
- * Exit profile Message ToneSetup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfilesMessageToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (glastaudioId != POWERON_SILENT);
- StopToneAudio();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesKeypadToneSetup
- * DESCRIPTION
- * Showing profile Keypad Tone Setup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesKeypadToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[15]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- KEYPAD_TONE_ENUM data = 0;
- U8 i = 0;
- U16 ProfileMenuID;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_KEYPAD_TONE_SETUP, NULL, EntryScrProfilesKeypadToneSetup, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_KEYPAD_TONE_SETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_TONE_SETUP_KEYPAD_TONE);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_TONE_SETUP_KEYPAD_TONE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_TONE_SETUP_KEYPAD_TONE, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_TONE_SETUP_KEYPAD_TONE);
- /* 7 Register highlight handler to be called in menu screen */
- /* 8 Display Category Screen */
- i = gprofiles[gprofileId].toneSetup.keypadTone;
- switch (i)
- {
- case KEYPAD_SILENT:
- ProfileMenuID = MENU_KEYPAD_TONE_SILENT;
- break;
- case KEYPAD_CLICK:
- ProfileMenuID = MENU_KEYPAD_TONE_CLICK;
- break;
- case KEYPAD_TONE:
- ProfileMenuID = MENU_KEYPAD_TONE_TONE;
- break;
- #if defined(__MMI_HUMAN_VOICE_KEYPAD_TONE__)
- case KEYPAD_TONE_HUMAN_VOICE_1:
- ProfileMenuID = MENU_KEYPAD_TONE_HUMAN_VOICE_1;
- break;
- case KEYPAD_TONE_HUMAN_VOICE_2:
- ProfileMenuID = MENU_KEYPAD_TONE_HUMAN_VOICE_2;
- break;
- case KEYPAD_TONE_HUMAN_VOICE_3:
- ProfileMenuID = MENU_KEYPAD_TONE_HUMAN_VOICE_3;
- break;
- case KEYPAD_TONE_HUMAN_VOICE_4:
- ProfileMenuID = MENU_KEYPAD_TONE_HUMAN_VOICE_4;
- break;
- case KEYPAD_TONE_HUMAN_VOICE_5:
- ProfileMenuID = MENU_KEYPAD_TONE_HUMAN_VOICE_5;
- break;
- case KEYPAD_TONE_HUMAN_VOICE_6:
- ProfileMenuID = MENU_KEYPAD_TONE_HUMAN_VOICE_6;
- break;
- #endif /* defined(__MMI_HUMAN_VOICE_KEYPAD_TONE__) */
- #if defined(__MMI_CUST_KEYPAD_TONE__)
- case KEYPAD_TONE_CUST_1:
- ProfileMenuID = MENU_KEYPAD_TONE_CUST_1;
- break;
- case KEYPAD_TONE_CUST_2:
- ProfileMenuID = MENU_KEYPAD_TONE_CUST_2;
- break;
- case KEYPAD_TONE_CUST_3:
- ProfileMenuID = MENU_KEYPAD_TONE_CUST_3;
- break;
- case KEYPAD_TONE_CUST_4:
- ProfileMenuID = MENU_KEYPAD_TONE_CUST_4;
- break;
- case KEYPAD_TONE_CUST_5:
- ProfileMenuID = MENU_KEYPAD_TONE_CUST_5;
- break;
- case KEYPAD_TONE_CUST_6:
- ProfileMenuID = MENU_KEYPAD_TONE_CUST_6;
- break;
- #endif /* defined(__MMI_CUST_KEYPAD_TONE__) */
- default:
- ProfileMenuID = 0;
- break;
- }
- data = GetIndexOfStringId(MENU_TONE_SETUP_KEYPAD_TONE, ProfileMenuID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory11Screen(
- STR_KEYPAD_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- nNumofItem,
- nStrItemList,
- (U16) data,
- guiBuffer);
- /* SetExitHandler(SCR_KEYPAD_TONE_SETUP,ExitScrProfilesKeypadToneSetup); */
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneSilent
- * DESCRIPTION
- * Set KeyPad Tone as Silent
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneSilent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_SILENT);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneClick
- * DESCRIPTION
- * Set KeyPad Tone as Click
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneClick(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_CLICK);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneTone
- * DESCRIPTION
- * Set KeyPad Tone as Tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneTone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- #if defined(__MMI_HUMAN_VOICE_KEYPAD_TONE__)
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneHumanVoice1
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneHumanVoice1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_HUMAN_VOICE_1);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneHumanVoice2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneHumanVoice2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_HUMAN_VOICE_2);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneHumanVoice3
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneHumanVoice3(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_HUMAN_VOICE_3);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneHumanVoice4
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneHumanVoice4(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_HUMAN_VOICE_4);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneHumanVoice5
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneHumanVoice5(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_HUMAN_VOICE_5);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneHumanVoice6
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneHumanVoice6(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_HUMAN_VOICE_6);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- #endif /* defined(__MMI_HUMAN_VOICE_KEYPAD_TONE__) */
- #if defined(__MMI_CUST_KEYPAD_TONE__)
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneCust1
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneCust1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_CUST_1);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneCust2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneCust2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_CUST_2);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneCust3
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneCust3(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_CUST_3);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneCust4
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneCust4(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_CUST_4);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneCust5
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneCust5(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_CUST_5);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeyPadToneCust6
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetKeyPadToneCust6(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeypadToneType(KEYPAD_TONE_CUST_6);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_KEYPAD_TONE_SETUP);
- }
- #endif /* defined(__MMI_CUST_KEYPAD_TONE__) */
- #ifndef __MMI_ALM_CUSTOMIZE_TONE__
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesAlarmToneSetup
- * DESCRIPTION
- * Showing profile Alarm Tone Setup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesAlarmToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U16 nDispAttribute; /* Stores display attribue */
- U16 selecteditem = 0;
- U8 totalItems = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_ALARM_TONE_SETUP, ExitScrProfilesAlarmToneSetup, EntryScrProfilesAlarmToneSetup, NULL);
- gcurrHiliteIndexOne = 0;
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ALARM_TONE_SETUP);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_TONE_SETUP_ALARM_TONE);
- /* 3. Retrieve no of child of menu item to be displayed */
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- totalItems = mmi_profiles_get_melody_list(gprofiles[gprofileId].toneSetup.alarmTone, &selecteditem);
- /* 6 Set current parent id */
- SetParentHandler(MENU_TONE_SETUP_ALARM_TONE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(mmi_profiles_melody_list_highlight_hdlr);
- /* 8 Display Category Screen */
- 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);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntryScrSetAlarmtone, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetAlarmtone
- * DESCRIPTION
- * Set Alarm Tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetAlarmtone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 is_ext_melody = MMI_FALSE;
- U16 numOfItem = gtotalRingId + gtotalMidiId;
- U16 ring_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_profiles_melody_list_index < gtotalRingId)
- {
- ring_id = g_profiles_melody_list_index + gstartRingId;
- }
- else if (g_profiles_melody_list_index < numOfItem)
- {
- ring_id = g_profiles_melody_list_index + gstartMidiId - gtotalRingId;
- }
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- else if (g_profiles_melody_list_index < numOfItem + MAXIMUM_EXT_MELODY_NUM)
- {
- g_ext_melody_idx = (U8) (g_profiles_melody_list_index - numOfItem);
- ring_id = (U16) g_ext_melody_idx + PMG_EXT_MELODY_BEGIN;
- is_ext_melody = MMI_TRUE;
- }
- #endif /* defined(__MMI_PROFILE_EXTMELODY_SUPPORT__) */
- else
- {
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- numOfItem += MAXIMUM_EXT_MELODY_NUM;
- #endif
- #if defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__)
- if (g_profiles_melody_list_index == numOfItem)
- {
- DYNAUDIOINFO *download_theme_tones;
- if (GetThemeV2TonesInfo(&download_theme_tones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- ring_id = (U16) download_theme_tones[0].AudioId;
- }
- else
- {
- ASSERT(0);
- }
- }
- #endif /* defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) */
- }
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- if (is_ext_melody == MMI_TRUE)
- {
- prfset_conf_type = PRFSET_MELODY_TYPE_ALARM;
- EntryPrfSetRingToneExtMelody();
- }
- else
- #endif /* defined(__MMI_PROFILE_EXTMELODY_SUPPORT__) */
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- SetAlarmToneID(ring_id);
- DeleteScreenIfPresent(SCR_ALARM_TONE_SETUP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesAlarmToneSetup
- * DESCRIPTION
- * Exit profile Alarm ToneSetup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfilesAlarmToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopToneAudio();
- }
- #endif /* __MMI_ALM_CUSTOMIZE_TONE__ */
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesExtraToneSetup
- * DESCRIPTION
- * Showing profile Extra Tone Setup Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesExtraToneSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[15]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 i = 0;
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_EXTRA_TONE_SETUP, NULL, EntryScrProfilesExtraToneSetup, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_EXTRA_TONE_SETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_EXTRA_TONE);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_EXTRA_TONE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_EXTRA_TONE, nStrItemList);
- for (i = 0; i < nNumofItem; i++)
- {
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], GetString(nStrItemList[i]), MAX_SUBMENU_CHARACTERS);
- }
- /* 6 Set current parent id */
- SetParentHandler(MENU_EXTRA_TONE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- fieldStatesExtraTone[0] = (U8) gprofiles[gprofileId].extraTone.warningTone;
- fieldStatesExtraTone[1] = (U8) gprofiles[gprofileId].extraTone.errorTone;
- fieldStatesExtraTone[2] = (U8) gprofiles[gprofileId].extraTone.campOnTone;
- fieldStatesExtraTone[3] = (U8) gprofiles[gprofileId].extraTone.connectTone;
- SetCheckboxToggleRightSoftkeyFunctions(ProfilesExtraTonePopup, GoBackHistory);
- /* 8 Display Category Screen */
- ShowCategory140Screen(
- STR_EXTRA_TONE_CAPTION,
- IMG_PROFILES_TITLEE,
- nNumofItem,
- (U8 **) subMenuDataPtrs,
- fieldStatesExtraTone,
- 0,
- guiBuffer);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 10. Register Exit handler */
- /* SetExitHandler(SCR_EXTRA_TONE_SETUP,ExitScrProfilesExtraToneSetup); */
- }
- /*****************************************************************************
- * FUNCTION
- * SetExtraToneValues
- * DESCRIPTION
- * Set Extra Tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetExtraToneValues(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EXTRA_TONE extraTone;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- extraTone.warningTone = gprofiles[gprofileId].extraTone.warningTone = fieldStatesExtraTone[0];
- extraTone.errorTone = gprofiles[gprofileId].extraTone.errorTone = fieldStatesExtraTone[1];
- extraTone.campOnTone = gprofiles[gprofileId].extraTone.campOnTone = fieldStatesExtraTone[2];
- extraTone.connectTone = gprofiles[gprofileId].extraTone.connectTone = fieldStatesExtraTone[3];
- SetExtraTone(extraTone);
- /* DisplayPopupCheckBox((PU8)GetString(STR_GLOBAL_DONE) ,IMG_GLOBAL_ACTIVATED, 1,UI_POPUP_NOTIFYDURATION_TIME,SUCCESS_TONE); */
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_EXTRA_TONE_SETUP);
- }
- /*****************************************************************************
- * FUNCTION
- * ProfilesExtraTonePopup
- * DESCRIPTION
- * Set the call back functios for Extra tone setup
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ProfilesExtraTonePopup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryScrProfilesQueryPopup(SetExtraToneValues, ProfileGoBack2History);
- }
- /*****************************************************************************
- * FUNCTION
- * PlayToneAudio
- * DESCRIPTION
- * PlayToneAudio
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PlayToneAudio(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(TIMER_PROFILES_TONE_PLAY);
- glastaudioId = gcurrentaudioId;
- if (!IsSilentModeActivated() && !isInCall()) /* need to check if it's in call because phonebook use this function, too */
- {
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- AudioPlayReq(gcurrentaudioId, (U8) DEVICE_AUDIO_PLAY_INFINITE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * StopToneAudio
- * DESCRIPTION
- * Stop Tone Audio
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StopToneAudio(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(TIMER_PROFILES_TONE_PLAY);
- if (!IsSilentModeActivated() && !isInCall()) /* need to check if it's in call because phonebook use this function, too */
- {
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- {
- if (glastaudioId != 0)
- {
- AudioStopReq(glastaudioId);
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * showAlertStatusIcons
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void showAlertStatusIcons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static S16 currentStatusIcon;
- /* MTK Brian added for wrap sublcd display, 2003/10/18 */
- #ifdef __MMI_SUBLCD__
- static S16 currentStatusSubLcdIcon;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (currentStatusSubLcdIcon != 0)
- {
- HideStatusIcon(currentStatusSubLcdIcon);
- }
- #endif /* __MMI_SUBLCD__ */
- if (currentStatusIcon != 0)
- {
- HideStatusIcon(currentStatusIcon);
- }
- if (gactivatedprofile == MMI_PROFILE_SILENT)
- {
- currentStatusIcon = STATUS_ICON_VIBRATION;
- ShowStatusIcon(currentStatusIcon);
- /* MTK Brian added for wrap sublcd display, 2003/10/18 */
- #ifdef __MMI_SUBLCD__
- currentStatusSubLcdIcon = STATUS_ICON_SUBLCD_VIBRATE;
- ShowStatusIcon(currentStatusSubLcdIcon);
- #endif /* __MMI_SUBLCD__ */
- }
- else
- {
- switch (gcurrentprofile.mtCallAlertTypeEnum)
- {
- case 1:
- currentStatusIcon = STATUS_ICON_RING;
- ShowStatusIcon(currentStatusIcon);
- /* MTK Brian added for wrap sublcd display, 2003/10/18 */
- #ifdef __MMI_SUBLCD__
- currentStatusSubLcdIcon = STATUS_ICON_SUBLCD_RING;
- ShowStatusIcon(currentStatusSubLcdIcon);
- #endif /* __MMI_SUBLCD__ */
- break;
- case 2:
- currentStatusIcon = STATUS_ICON_VIBRATION;
- ShowStatusIcon(currentStatusIcon);
- /* MTK Brian added for wrap sublcd display, 2003/10/18 */
- #ifdef __MMI_SUBLCD__
- currentStatusSubLcdIcon = STATUS_ICON_SUBLCD_VIBRATE;
- ShowStatusIcon(currentStatusSubLcdIcon);
- #endif /* __MMI_SUBLCD__ */
- break;
- case 3:
- currentStatusIcon = STATUS_ICON_VIBRATE_AND_RING;
- ShowStatusIcon(currentStatusIcon);
- /* MTK Brian added for wrap sublcd display, 2003/10/18 */
- #ifdef __MMI_SUBLCD__
- currentStatusSubLcdIcon = STATUS_ICON_SUBLCD_VIBRATE_AND_RING;
- ShowStatusIcon(currentStatusSubLcdIcon);
- #endif /* __MMI_SUBLCD__ */
- break;
- case 4:
- currentStatusIcon = STATUS_ICON_VIBRATE_THEN_RING;
- ShowStatusIcon(currentStatusIcon);
- /* MTK Brian added for wrap sublcd display, 2003/10/18 */
- #ifdef __MMI_SUBLCD__
- currentStatusSubLcdIcon = STATUS_ICON_SUBLCD_VIBRATE_THEN_RING;
- ShowStatusIcon(currentStatusSubLcdIcon);
- #endif /* __MMI_SUBLCD__ */
- break;
- case 5:
- currentStatusIcon = STATUS_ICON_SILENT;
- ShowStatusIcon(currentStatusIcon);
- /* MTK Brian added for wrap sublcd display, 2003/10/18 */
- #ifdef __MMI_SUBLCD__
- currentStatusSubLcdIcon = STATUS_ICON_SUBLCD_SILENT;
- ShowStatusIcon(currentStatusSubLcdIcon);
- #endif /* __MMI_SUBLCD__ */
- break;
- default:
- currentStatusIcon = STATUS_ICON_RING;
- ShowStatusIcon(currentStatusIcon);
- #ifdef __MMI_SUBLCD__
- currentStatusSubLcdIcon = STATUS_ICON_SUBLCD_RING;
- ShowStatusIcon(currentStatusSubLcdIcon);
- #endif /* __MMI_SUBLCD__ */
- break;
- }
- }
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * ReturnRequiredNumberImageId
- * DESCRIPTION
- *
- * PARAMETERS
- * imageId [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 ReturnRequiredNumberImageId(U8 imageId)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("n@@@@@ [.c] ReturnRequiredImageId @@@@@"));
- switch (imageId + 1)
- {
- case 1:
- return IMG_GLOBAL_L1;
- break;
- case 2:
- return IMG_GLOBAL_L2;
- break;
- case 3:
- return IMG_GLOBAL_L3;
- break;
- case 4:
- return IMG_GLOBAL_L4;
- break;
- case 5:
- return IMG_GLOBAL_L5;
- break;
- case 6:
- return IMG_GLOBAL_L6;
- break;
- case 7:
- return IMG_GLOBAL_L7;
- break;
- case 8:
- return IMG_GLOBAL_L8;
- break;
- case 9:
- return IMG_GLOBAL_L9;
- break;
- case 10:
- return IMG_GLOBAL_L10;
- break;
- case 11:
- return IMG_GLOBAL_L11;
- break;
- case 12:
- return IMG_GLOBAL_L12;
- break;
- case 13:
- return IMG_GLOBAL_L13;
- break;
- case 14:
- return IMG_GLOBAL_L14;
- break;
- case 15:
- return IMG_GLOBAL_L15;
- break;
- case 16:
- return IMG_GLOBAL_L16;
- break;
- case 17:
- return IMG_GLOBAL_L17;
- break;
- case 18:
- return IMG_GLOBAL_L18;
- break;
- case 19:
- return IMG_GLOBAL_L19;
- break;
- case 20:
- return IMG_GLOBAL_L20;
- break;
- case 21:
- return IMG_GLOBAL_L21;
- break;
- case 22:
- return IMG_GLOBAL_L22;
- break;
- case 23:
- return IMG_GLOBAL_L23;
- break;
- case 24:
- return IMG_GLOBAL_L24;
- break;
- case 25:
- return IMG_GLOBAL_L25;
- break;
- case 26:
- return IMG_GLOBAL_L26;
- break;
- case 27:
- return IMG_GLOBAL_L27;
- break;
- case 28:
- return IMG_GLOBAL_L28;
- break;
- case 29:
- return IMG_GLOBAL_L29;
- break;
- case 30:
- return IMG_GLOBAL_L30;
- break;
- default:
- return IMG_GLOBAL_QUESTION;
- break;
- }
- }
- /**************************************************/
- /* General Functions */
- /**************************************************/
- /*****************************************************************************
- * FUNCTION
- * playcolorID
- * DESCRIPTION
- * play color id
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void playcolorID(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- glastColorID = gcurrentColorId;
- PlayPatternCallerGroup(gcurrentColorId);
- }
- /*****************************************************************************
- * FUNCTION
- * StopColorId
- * DESCRIPTION
- * stop color id
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StopColorId(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(TIMER_PROFILES_TONE_PLAY);
- if (glastColorID)
- {
- StopPatternCallerGroup(glastColorID);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetDynamicToneIds
- * DESCRIPTION
- * Get Dynamic tone ids
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GetDynamicToneIds(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GetRingToneRange((PU8) & gstartRingId, (PU8) & gtotalRingId);
- #ifdef MMI_ON_WIN32
- gstartRingId = 101;
- gtotalRingId = 10;
- #endif /* MMI_ON_WIN32 */
- GetMidiRange((PU8) & gstartMidiId, (PU8) & gtotalMidiId);
- #ifdef MMI_ON_WIN32
- gstartMidiId = 151;
- #endif
- GetToneRange((PU8) & gstartGeneralToneId, (PU8) & gtotalGeneralToneId);
- #ifdef MMI_ON_WIN32
- gstartGeneralToneId = 166;
- #endif
- GetMiscToneRange((PU8) & gstartMiscToneId, (PU8) & gtotalMiscToneId);
- #ifdef MMI_ON_WIN32
- gstartMiscToneId = 166;
- #endif
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- PmgGetExtMelodyRange(&gstartExtMelodyId, >otalExtMelodyId);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesQueryPopup
- * DESCRIPTION
- * General Pop Up function for Query screens of profiles
- * PARAMETERS
- * fn_lsk [IN]
- * fn_rsk [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesQueryPopup(void (*fn_lsk) (void), void (*fn_rsk) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gfnprofilelsk = fn_lsk;
- gfnprofilersk = fn_rsk;
- EntryPorfPopup();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPorfPopup
- * DESCRIPTION
- * entry fn of query screens
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPorfPopup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(gfnprofilelsk, KEY_EVENT_UP);
- SetRightSoftkeyFunction(gfnprofilersk, KEY_EVENT_UP);
- /* SetExitHandler(SCR_POPUP_PROFILES_QEURY, ExitScrProfilesQueryPopup); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesQueryPopup
- * DESCRIPTION
- * exit fn
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfilesQueryPopup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCurrScreenHandler
- * DESCRIPTION
- * Getting Current Screen Handler
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void GetCurrScreenHandler(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gcurrHiliteIndexOne = item_index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_melody_list_highlight_hdlr
- * DESCRIPTION
- * Getting Current Screen Handler
- * PARAMETERS
- * item_index [IN]
- * index_index(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_profiles_melody_list_highlight_hdlr(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL play_it = TRUE;
- U16 numOfItem = gtotalRingId + gtotalMidiId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_profiles_melody_list_index = (U16) item_index;
- StopToneAudio();
- if (g_profiles_melody_list_index < gtotalRingId)
- {
- gcurrentaudioId = g_profiles_melody_list_index + gstartRingId;
- }
- else if (g_profiles_melody_list_index < numOfItem)
- {
- gcurrentaudioId = g_profiles_melody_list_index + gstartMidiId - gtotalRingId;
- }
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- else if (g_profiles_melody_list_index < numOfItem + MAXIMUM_EXT_MELODY_NUM)
- {
- g_ext_melody_idx = (U8) (g_profiles_melody_list_index - numOfItem);
- gcurrentaudioId = (U16) g_ext_melody_idx + PMG_EXT_MELODY_BEGIN;
- }
- #endif /* defined(__MMI_PROFILE_EXTMELODY_SUPPORT__) */
- else
- {
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- numOfItem += MAXIMUM_EXT_MELODY_NUM;
- #endif
- #if defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__)
- if (g_profiles_melody_list_index == numOfItem)
- {
- DYNAUDIOINFO *download_theme_tones;
- if (GetThemeV2TonesInfo(&download_theme_tones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- gcurrentaudioId = (U16) download_theme_tones[0].AudioId;
- if (AudioFileDeletedFromFmgr(gcurrentaudioId))
- {
- play_it = FALSE;
- }
- }
- else
- {
- ASSERT(0);
- }
- }
- #endif /* defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) */
- }
- if (play_it)
- {
- StartTimer(TIMER_PROFILES_TONE_PLAY, 1000, PlayToneAudio);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetCurrScreenHandlerfour
- * DESCRIPTION
- * Getting Current Screen Handler
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void GetCurrScreenHandlerfour(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gcurrHiliteIndexOne = item_index;
- StopColorId();
- if (gcurrHiliteIndexOne)
- {
- gcurrentColorId = (MMI_LEDLIGHT_STATUS_ENUM) gcurrHiliteIndexOne;
- StartTimer(TIMER_PROFILES_TONE_PLAY, 1000, playcolorID);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetCurrScreenHandlerfive
- * DESCRIPTION
- * Getting Current Screen Handler
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void GetCurrScreenHandlerfive(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gcurrHiliteIndexOne = item_index;
- if (glastaudioId > 0)
- {
- StopToneAudio();
- }
- if (gcurrHiliteIndexOne == 0)
- {
- gcurrentaudioId = 0;
- glastaudioId = gcurrentaudioId;
- /* MTK Brian added for stop timer in case of 0-->0, 2003/11/18 */
- StopTimer(TIMER_PROFILES_TONE_PLAY);
- }
- else
- {
- gcurrentaudioId = gcurrHiliteIndexOne + gstartGeneralToneId - 1;
- StartTimer(TIMER_PROFILES_TONE_PLAY, 1000, PlayToneAudio);
- }
- }
- /* MTK Brian added for playing message tone, 2003/11/7 */
- /*****************************************************************************
- * FUNCTION
- * GetCurrScreenHandlersix
- * DESCRIPTION
- * Getting Current Screen Handler
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void GetCurrScreenHandlersix(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gcurrHiliteIndexOne = item_index;
- if (glastaudioId > 0)
- {
- StopToneAudio();
- }
- if (gcurrHiliteIndexOne == 0)
- {
- gcurrentaudioId = 0;
- glastaudioId = gcurrentaudioId;
- /* MTK Brian added for stop timer in case of 0-->0, 2003/11/18 */
- StopTimer(TIMER_PROFILES_TONE_PLAY);
- }
- else
- {
- gcurrentaudioId = gcurrHiliteIndexOne + gstartMiscToneId - 1;
- StartTimer(TIMER_PROFILES_TONE_PLAY, 1000, PlayToneAudio);
- }
- }
- /* MTK end */
- #if defined(__MMI_INTELLIGENT_CALL_ALERT__)
- /*****************************************************************************
- * FUNCTION
- * EntryScrIntelligentCallAlert
- * DESCRIPTION
- * EntryScrIntelligentCallAlert
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIntelligentCallAlert(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- S8 i = 0;
- /* U8* PopUpList[MAX_SUB_MENUS]; */
- MMI_INTELLIGENT_CALL_ALERT_TYPE data = 0;
- U16 ProfileMenuID[] = {MENU_INTELLIGENT_CALL_ALERT_OFF, MENU_INTELLIGENT_CALL_ALERT_ON};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_INTELLIGENT_CALL_ALERT, NULL, EntryScrIntelligentCallAlert, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_INTELLIGENT_CALL_ALERT);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_INTELLIGENT_CALL_ALERT);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_INTELLIGENT_CALL_ALERT);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_INTELLIGENT_CALL_ALERT, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_INTELLIGENT_CALL_ALERT);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- i = gprofiles[gprofileId].intelligentCallAlert;
- data = GetIndexOfStringId(MENU_INTELLIGENT_CALL_ALERT, ProfileMenuID[i]);
- /* 8 Display Category Screen */
- ShowCategory11Screen(
- STR_PROFILES_INTELLIGENT_CALL_ALERT,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16) data,
- guiBuffer);
- }
- #endif /* defined(__MMI_INTELLIGENT_CALL_ALERT__) */
- /*********************************************************
- *
- *
- * For Hint Handlers
- *
- *
- **********************************************************/
- /*****************************************************************************
- * FUNCTION
- * HandleMelodyHintFunc
- * DESCRIPTION
- * Hint handlers for Incoming call / Alarm tone
- * PARAMETERS
- * ToneID [IN]
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HandleMelodyHintFunc(U16 ToneID, U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- DYNEXTMELODYINFO *ExtMelodyStruct;
- #endif
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- DYNAUDIOINFO *DownloadThemeTones;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (ToneID >= gstartRingId && ToneID < gstartRingId + gtotalRingId)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], GetString((U16) (STR_PROFILES_RING_1 + ToneID - gstartRingId)));
- }
- else if (ToneID >= gstartMidiId && ToneID < gstartMidiId + gtotalMidiId)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], GetString((U16) (STR_PROFILES_MIDI_1 + ToneID - gstartMidiId)));
- }
- else
- {
- BOOL selected = FALSE;
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- PmgGetExtMelodyInfo(&ExtMelodyStruct);
- for (data = 0; data < MAXIMUM_EXT_MELODY_NUM; data++)
- {
- if (PmgIsEmptySlot(data) == MMI_FALSE && ToneID == ExtMelodyStruct->info[data].id)
- {
- if (IS_EXTMELODY_SHORTNAME(ExtMelodyStruct->info[data].filepath))
- {
- mmi_chset_mixed_text_to_ucs2_str(
- hintData[(index)],
- (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
- (U8*) ExtMelodyStruct->info[data].filename,
- g_chset_text_encoding);
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[(index)], (PS8) (ExtMelodyStruct->info[data].filename));
- }
- #if (!defined(__MMI_SHOW_FILE_EXT__))
- PmgRemoveFileExt((S8*) hintData[(index)]);
- #elif (!defined(__MMI_SHOW_DAF_FILE_EXT__))
- PmgRemoveFileDAFExt((S8*) hintData[(index)]);
- #endif
- selected = TRUE;
- break;
- }
- }
- #endif /* defined(__MMI_PROFILE_EXTMELODY_SUPPORT__) */
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- if (!selected)
- {
- DYNAUDIOINFO *download_theme_tones;
- if (GetThemeV2TonesInfo(&download_theme_tones) != 0 && mmi_tm_get_current_theme_ringtone())
- {
- if (ToneID == (U16) download_theme_tones[0].AudioId)
- {
- pfnUnicodeStrcpy((PS8) hintData[(index)], GetString((U16) STR_PROFILES_CURR_THEME));
- selected = TRUE;
- }
- }
- }
- #endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */
- ASSERT(selected);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintHandlerIncomingCall
- * DESCRIPTION
- * Hint handlers for Incoming call tone
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintHandlerIncomingCall(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HandleMelodyHintFunc(gprofiles[gprofileId].toneSetup.ringTone, index);
- }
- #ifndef __MMI_ALM_CUSTOMIZE_TONE__
- /*****************************************************************************
- * FUNCTION
- * HintHandlerAlarmTone
- * DESCRIPTION
- * Hint handlers for Alarm Tone
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintHandlerAlarmTone(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HandleMelodyHintFunc(gprofiles[gprofileId].toneSetup.alarmTone, index);
- }
- #endif /* __MMI_ALM_CUSTOMIZE_TONE__ */
- //KP Jerry add for changing the style of message tone list on 2007-4-10 start
- #ifdef __MMI_TONE_LIST_STYLE_CHANGED__
- /*****************************************************************************
- * FUNCTION
- * HintHandlerPowerOnTone
- * DESCRIPTION
- * Hint handlers for Power On Tone
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintHandlerPowerOnTone(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 UnicodenStrItemList[10]; /* Stores the strings id of submenus returned */
- U8 AsciinStrItemList[4]; /* Stores the strings id of submenus returned */
- U8 data = 0;
- U16 ToneID;
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- DYNEXTMELODYINFO *ExtMelodyStruct;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ToneID = gprofiles[gprofileId].toneSetup.powerOnTone;
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (ToneID >= gstartGeneralToneId && ToneID < gstartGeneralToneId + gtotalGeneralToneId)
- {
- S32 len = 0;
- data = ((gprofiles[gprofileId].toneSetup.powerOnTone) - (gstartGeneralToneId));
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- sprintf((PS8) AsciinStrItemList, "%d", data + 1);
- AnsiiToUnicodeString((PS8) UnicodenStrItemList, (PS8) AsciinStrItemList);
- len = pfnUnicodeStrlen((PS8) UnicodenStrItemList);
- len = MAX_SUBMENU_CHARACTERS - len;
- pfnUnicodeStrncpy((S8*) hintData[(index)], GetString(STR_PROFILES_TONE), MAX_SUBMENU_CHARACTERS);
- pfnUnicodeStrcat((S8*) hintData[(index)], (PS8) UnicodenStrItemList);
- }
- else if(ToneID == MESSAGE_SILENT)
- {
- pfnUnicodeStrncpy((S8*) hintData[(index)], (S8*) GetString(STR_PROFILES_SILENT), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- BOOL selected = FALSE;
- #if defined(__MMI_PROFILE_EXTMELODY_SUPPORT__)
- POnOffPmgGetExtMelodyInfo(&ExtMelodyStruct);
- for (data = 0; data < MAXIMUM_EXT_MELODY_NUM; data++)
- {
- if (POnOffPmgIsEmptySlot(data) == MMI_FALSE && ToneID == ExtMelodyStruct->info[data].id)
- {
- if (IS_EXTMELODY_SHORTNAME(ExtMelodyStruct->info[data].filepath))
- {
- mmi_chset_mixed_text_to_ucs2_str(
- hintData[(index)],
- (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
- (U8*) ExtMelodyStruct->info[data].filename,
- g_chset_text_encoding);