📄 fmradiosrc.c
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* FMRadioSrc.c
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* FM Radio main program
*
* Author:
* -------
* Tim Chen
*
*==============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* $Log$
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
#include "MMI_features.h"
#ifdef __MMI_FM_RADIO__
#include "GlobalDefs.h"
#include "GlobalScrEnum.h"
#include "MainMenuDef.h"
#include "CommonScreens.h"
#include "wgui_categories_inputs.h"
#include "wgui_categories_popup.h"
#include "ProfilesDefs.h"
#include "ProfileGprots.h"
#include "NVRAMEnum.h"
#include "NVRAMProt.h"
#include "NVRAMType.h"
#ifdef __MMI_AUDIO_PLAYER__
extern void mmi_audply_stop_playing(void);
#endif
#include "aud_defs.h"
#include "mdi_datatype.h"
#include "mdi_audio.h"
#include "Device.h"
#include "SettingProfile.h"
#include "TimerEvents.h"
#include "FMRadioDef.h"
#include "FMRadioType.h"
#include "FMRadioProt.h"
#include "FMRadioMainScreen.h"
#if defined(__MMI_FM_RADIO_RECORD__)
#include "FS_Type.h"
#include "FileManagerDef.h"
#include "FileManagerGProt.h"
#include "FileMgr.h"
#include "FS_Func.h"
#include "FS_errcode.h"
#ifdef MMI_ON_HARDWARE_P
#include "Rtc_sw.h"
#endif
#include "USBDeviceGprot.h"
#endif /* defined(__MMI_FM_RADIO_RECORD__) */
mmi_fmrdo_struct g_fmrdo; /* all memeber variables are zero initial */
static BOOL channel_name_edit_done;
static U16 main_option_highlighted_item_text;
static U16 channel_list_highlighted_item_index;
static U16 channel_option_highlighted_item_text;
static U16 channel_name_edit_option_highlighted_item_text;
static UI_character_type channel_name_str[MAX_NAME_INPUT_LEN + 10]; /* used for showing channel_name or freq in idle screen or subLCD */
static S32 selected_background_play;
static S32 selected_skin_index;
static UI_character_type manual_input_buffer[MAX_MANUAL_INPUT_LEN];
static UI_character_type name_inline_editor_buffer[MAX_NAME_INPUT_LEN];
static UI_character_type freq_inline_editor_buffer[MAX_MANUAL_INPUT_LEN];
static UI_character_type name_text_editor_buffer[MAX_NAME_INPUT_LEN];
static UI_string_type background_play_texts[2];
static UI_string_type skin_texts[3];
#if defined(__MMI_FM_RADIO_LOUD_SPEAK__)
static S32 selected_speaker_status;
static UI_string_type speaker_status_texts[2];
#endif /* defined(__MMI_FM_RADIO_LOUD_SPEAK__) */
#if defined(__MMI_FM_RADIO_RECORD__)
static S32 selected_record_format;
static S32 selected_record_storage;
static UI_string_type record_format_texts[FM_REC_FORMAT_NUM];
static UI_character_type fmrdo_editor_buff[MAX_FM_INPUT_FILE_LEN + 2];
#endif /* defined(__MMI_FM_RADIO_RECORD__) */
extern wgui_inline_item wgui_inline_items[]; /* defined in wgui_inline_edit.c */
extern const mmi_fmrdo_skin_struct g_fmrdo_skins[]; /* defined in resource_fmradio_skins.c */
extern U8 isEarphonePlugged; /* definedin gpio.c */
extern void kal_wsprintf(unsigned short *outstr, char *fmt, ...);
extern void kal_get_time(kal_uint32 *ticks_ptr);
#ifdef __MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__
#ifdef MMI_ON_HARDWARE_P
extern BOOL FMR_IsChipValid(void); /* this function is definedin in l1audio */
#else
#define FMR_IsChipValid(x) (TRUE)
#endif
S32 g_fmrdo_menu_item_index;
/*****************************************************************************
* FUNCTION
* mmi_fmrdo_skip_highlight_hdlr
* DESCRIPTION
*
* PARAMETERS
* index [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_fmrdo_skip_highlight_hdlr(S32 index)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (g_fmrdo_menu_item_index >= 0 && index >= g_fmrdo_menu_item_index)
{
index++;
}
ExecuteCurrHiliteHandler(index);
}
/*****************************************************************************
* FUNCTION
* mmi_fmrdo_check_chip_or_hide
* DESCRIPTION
*
* PARAMETERS
* n_items [IN] U16* string_ids, U16* icon_ids
* string_ids [?]
* icon_ids [?]
* RETURNS
* U16
*****************************************************************************/
U16 mmi_fmrdo_check_chip_or_hide(U16 n_items, U16 *string_ids, U16 *icon_ids)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!FMR_IsChipValid())
{
/* hide FM Radio application menu item */
S16 i, j;
for (i = n_items - 1; i >= 0; i--)
{
if (string_ids[i] == STR_ID_FMRDO_TITLE) /* look for FM Radio application string id */
{
break;
}
}
g_fmrdo_menu_item_index = i;
if (i >= 0) /* found FM Radio application string id */
{
n_items--;
for (j = i; j < n_items; j++) /* move rest application string & image ids up */
{
string_ids[j] = string_ids[j + 1];
icon_ids[j] = icon_ids[j + 1];
}
}
}
else
{
g_fmrdo_menu_item_index = -1;
}
return n_items;
}
#endif /* __MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__ */
/*****************************************************************************
* FUNCTION
* mmi_fmrdo_set_subLCD_shown
* DESCRIPTION
*
* PARAMETERS
* is_shown [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_fmrdo_set_subLCD_shown(BOOL is_shown)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_fmrdo.is_subLCD_shown = is_shown;
}
/*****************************************************************************
* FUNCTION
* mmi_fmrdo_power_on_main_screen
* DESCRIPTION
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -