Exemplo n.º 1
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	//PRESULT ret = PROC_LEAVE;	
	VACTION unact;
	UINT8 bID,back_saved;
	win_popup_choice_t choice;
	UINT32 chunk_id, default_db_addr, default_db_len;

	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
		       ret = PROC_LEAVE;
			if(bID == BTN_NO_ID)
			{
				break;
			}
			
			//win_compopup_init(WIN_POPUP_TYPE_OKNO);
			//win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
			//win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
			//choice = win_compopup_open_ext(&back_saved);
			//if(choice == WIN_POP_CHOICE_YES)
			{
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
				win_compopup_open_ext(&back_saved);

				chunk_id = 0x03FC0100;
				api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
				set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

				sys_data_factroy_init(); 
				//sys_data_set_factory_reset(TRUE);
				sys_data_set_cur_chan_mode(TV_CHAN);
				sys_data_save(TRUE);
				sys_data_load();
				if(GetMuteState())
					SetMuteOnOff(FALSE);
				if(GetPauseState())
					SetPauseOnOff(FALSE);
				win_compopup_smsg_restoreback();
				// PRESULT ret = PROC_LEAVE;
				//ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_PALNTSC,FALSE);
			}
		
		}
		break;
	}

	return ret;
}
Exemplo n.º 2
0
static BOOL MPEGYT_player_init(void)
{
	POBJECT_HEAD pCtrl;
	PROGRESS_BAR* bar;
	RET_CODE ret;
	FileInfo file_node;
	char name[FULL_PATH_SIZE];

	MEMSET(&BarState, 0, sizeof(BarState));
	BarState.nRange = 100;
	BarState.State = NORMAL_MOVING;

	bar = &mpegYT_player_bar;
	OSD_SetProgressBarValue(bar, 100);
	OSD_SetProgressBarRange(bar, 0, 100);

	MEMSET(&MPEGYTInfo, 0, sizeof(MPEGYTInfo));
	MPEGYTInfo.PlayTime = 0;
	MPEGYTInfo.TotalTime = 0;

	MPEGYTInfo.PlaySpeed = 0;

	m_HideWindow = FALSE;
	mpegYT_timeout_id = OSAL_INVALID_ID;
	if (GetMuteState())
	{
		ShowMuteOnOff();
	}

	StartRefreshTimer();
	ret = get_file_from_file_list(win_file_list[VIDEO_FILE_LIST], mpegYTlist_idx, &file_node);
	if(ret == RET_FAILURE)
	{
		return FALSE;
	}
	win_get_fullname(name, file_node.path, file_node.name);
    video_dec_file(name, 0);

	MPEGYTInfo.TotalTime = get_video_total_time();
	MPEGYTInfo.PlayState = MPEG_PLAY;

	BarState.nRange = MPEGYTInfo.TotalTime;

	return TRUE;
}
Exemplo n.º 3
0
static PRESULT win_volume_bar_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	PROGRESS_BAR* bar;	
	SYSTEM_DATA* sys_data;
	UINT32 vkey;

	bar = (PROGRESS_BAR*)pObj;
	
	sys_data = sys_data_get();	

	switch(event)
	{
	case EVN_PRE_CHANGE:
		break;
	case EVN_POST_CHANGE:
		sys_data->volume = OSD_GetProgressBarPos(bar);
		if(sys_data->volume > 0 && GetMuteState() )
		{
			SetMuteOnOff(TRUE);
			//added by Sharon to resolve mute clear display bug
			restore_mute_bg();
		}
		api_audio_set_volume(sys_data->volume);
		api_stop_timer(&volume_timer);		 
		volume_timer = api_start_timer(VOLUME_TIMER_NAME,VOLUME_TIMER_TIME,volume_timer_func);
		ret = PROC_LOOP;
		break;
	case EVN_UNKNOWNKEY_GOT:
		ap_hk_to_vk(0, param1, &vkey);
		if(vkey == V_KEY_NULL)
		{
			ret = PROC_LOOP;
		}
		break;
	default:
		break;
	}

	return ret;		 
}
Exemplo n.º 4
0
static BOOL MPEGYT_player_init(void)
{
	POBJECT_HEAD pCtrl;
	PROGRESS_BAR* bar;
	UINT8 tmpurl[1024];
	MEMSET(&BarState, 0, sizeof(BarState));
	BarState.nRange = 100;
	BarState.State = NORMAL_MOVING;

	bar = &mpegYT_player_bar;
	OSD_SetProgressBarValue(bar, 100);
	OSD_SetProgressBarRange(bar, 0, 100);

	MEMSET(&MPEGYTInfo, 0, sizeof(MPEGYTInfo));
	MPEGYTInfo.PlayTime = 0;
	MPEGYTInfo.TotalTime = entry_youtube->info->duration;

	MPEGYTInfo.PlaySpeed = 0;

	m_HideWindow = FALSE;
	mpegYT_timeout_id = OSAL_INVALID_ID;
	//b_build_idx_tbl = FALSE;
	//b_vdec_support = TRUE;
	//b_audio_yt_support = TRUE;
	if (GetMuteState())
	{
		ShowMuteOnOff();
	}
	StartRefreshTimer();
	httpstrfile_url_gen(tmpurl, url_youtube, "mp4");
	video_dec_file(tmpurl, 0);
	s_is_in_parsing = 1;
	mpegYT_prompt_on_screen = 3;
	mpegYT_file_prompt("Loading, please wait...", TRUE);
	MPEGYTInfo.TotalTime = entry_youtube->info->duration; // we will get total time after parsing end
	MPEGYTInfo.PlayState = MPEG_PLAY;

	BarState.nRange = MPEGYTInfo.TotalTime;
	return TRUE;
}
Exemplo n.º 5
0
//static INT_PTR CALLBACK
INT_PTR CALLBACK
VolumeDlgProc(HWND hwndDlg,
              UINT uMsg,
              WPARAM wParam,
              LPARAM lParam)
{
    static IMGINFO ImgInfo;
    PGLOBAL_DATA pGlobalData;
    UNREFERENCED_PARAMETER(lParam);
    UNREFERENCED_PARAMETER(wParam);

    pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);



    switch(uMsg)
    {
        case MM_MIXM_LINE_CHANGE:
        {
            GetMuteState(pGlobalData);
            if (pGlobalData->muteVal)
            {
                SendDlgItemMessage(hwndDlg, IDC_MUTE_CHECKBOX, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
                SendDlgItemMessage(hwndDlg, IDC_MUTE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pGlobalData->hIconMuted);
            }
            else
            {
                SendDlgItemMessage(hwndDlg, IDC_MUTE_CHECKBOX, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
                SendDlgItemMessage(hwndDlg, IDC_MUTE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pGlobalData->hIconUnMuted);
            }
            break;
        }
        case MM_MIXM_CONTROL_CHANGE:
        {
            GetVolumeValue(pGlobalData);
            SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETSEL, (WPARAM)FALSE, (LPARAM)MAKELONG(pGlobalData->volumeMinimum, pGlobalData->volumeValue/VOLUME_DIVIDER));
            SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pGlobalData->volumeValue/VOLUME_DIVIDER);
            break;
        }
        case WM_INITDIALOG:
        {
            pGlobalData = (GLOBAL_DATA*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA));
            SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);

            pGlobalData->hIconUnMuted = LoadImage(hApplet, MAKEINTRESOURCE(IDI_CPLICON), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
            pGlobalData->hIconMuted = LoadImage(hApplet, MAKEINTRESOURCE(IDI_MUTED_ICON), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
            pGlobalData->hIconNoHW = LoadImage(hApplet, MAKEINTRESOURCE(IDI_NO_HW), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);

            InitImageInfo(&ImgInfo);
            InitVolumeControls(hwndDlg, pGlobalData);
            break;
        }

        case WM_DRAWITEM:
        {
            LPDRAWITEMSTRUCT lpDrawItem;
            lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
            if(lpDrawItem->CtlID == IDC_SPEAKIMG)
            {
                HDC hdcMem;
                LONG left;

                /* Position image in centre of dialog */
                left = (lpDrawItem->rcItem.right - ImgInfo.cxSource) / 2;

                hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
                if (hdcMem != NULL)
                {
                    SelectObject(hdcMem, ImgInfo.hBitmap);
                    BitBlt(lpDrawItem->hDC,
                           left,
                           lpDrawItem->rcItem.top,
                           lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
                           lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
                           hdcMem,
                           0,
                           0,
                           SRCCOPY);
                    DeleteDC(hdcMem);
                }
            }
            break;
        }

        case WM_COMMAND:
        {
            switch (LOWORD(wParam))
            {
                case IDC_MUTE_CHECKBOX:
                    if (HIWORD(wParam) == BN_CLICKED)
                    {
                        SwitchMuteState(pGlobalData);
                        if (pGlobalData->muteVal)
                        {
                            SendDlgItemMessage(hwndDlg, IDC_MUTE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pGlobalData->hIconMuted);
                        }
                        else
                        {
                            SendDlgItemMessage(hwndDlg, IDC_MUTE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pGlobalData->hIconUnMuted);
                        }

                        PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                    }
                    break;

                case IDC_ICON_IN_TASKBAR:
                    if (HIWORD(wParam) == BN_CLICKED)
                    {
                        PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                    }
                    break;

                case IDC_ADVANCED_BTN:
                    LaunchSoundControl(hwndDlg);
                    break;
            }
            break;
        }

        case WM_HSCROLL:
        {
            HWND hVolumeTrackbar = GetDlgItem(hwndDlg, IDC_VOLUME_TRACKBAR);
            if (hVolumeTrackbar == (HWND)lParam)
            {
                pGlobalData->volumeValue = (DWORD)SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_GETPOS, 0, 0)*VOLUME_DIVIDER;
                SetVolumeValue(pGlobalData);
                SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETSEL, (WPARAM)TRUE,
                    (LPARAM)MAKELONG(pGlobalData->volumeMinimum, pGlobalData->volumeValue/VOLUME_DIVIDER));
            }
            break;
        }

        case WM_DESTROY:
            mixerClose(pGlobalData->hMixer);
            DestroyIcon(pGlobalData->hIconMuted);
            DestroyIcon(pGlobalData->hIconUnMuted);
            DestroyIcon(pGlobalData->hIconNoHW);
            HeapFree(GetProcessHeap(), 0, pGlobalData);
            break;

        case WM_NOTIFY:
            if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
            {
                SaveData(hwndDlg);
            }
            return TRUE;
    }

    return FALSE;
}
Exemplo n.º 6
0
VOID
InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
{
    UINT NumMixers;
    MIXERCAPS mxc;
    TCHAR szNoDevices[256];

    CheckDlgButton(hwndDlg,
                   IDC_ICON_IN_TASKBAR,
                   GetSystrayVolumeIconState() ? BST_CHECKED : BST_UNCHECKED);

    LoadString(hApplet, IDS_NO_DEVICES, szNoDevices, _countof(szNoDevices));

    NumMixers = mixerGetNumDevs();
    if (!NumMixers)
    {
        EnableWindow(GetDlgItem(hwndDlg, IDC_VOLUME_TRACKBAR), FALSE);
        EnableWindow(GetDlgItem(hwndDlg, IDC_MUTE_CHECKBOX),   FALSE);
        EnableWindow(GetDlgItem(hwndDlg, IDC_ADVANCED_BTN),    FALSE);
        EnableWindow(GetDlgItem(hwndDlg, IDC_SPEAKER_VOL_BTN), FALSE);
        EnableWindow(GetDlgItem(hwndDlg, IDC_ADVANCED2_BTN),   FALSE);
        SendDlgItemMessage(hwndDlg, IDC_MUTE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pGlobalData->hIconNoHW);
        SetDlgItemText(hwndDlg, IDC_DEVICE_NAME, szNoDevices);
        return;
    }

    if (mixerOpen(&pGlobalData->hMixer, 0, PtrToUlong(hwndDlg), 0, MIXER_OBJECTF_MIXER | CALLBACK_WINDOW) != MMSYSERR_NOERROR)
    {
        MessageBox(hwndDlg, _T("Cannot open mixer"), NULL, MB_OK);
        return;
    }

    ZeroMemory(&mxc, sizeof(MIXERCAPS));
    if (mixerGetDevCaps(PtrToUint(pGlobalData->hMixer), &mxc, sizeof(MIXERCAPS)) != MMSYSERR_NOERROR)
    {
        MessageBox(hwndDlg, _T("mixerGetDevCaps failed"), NULL, MB_OK);
        return;
    }

    GetMuteControl(pGlobalData);
    GetMuteState(pGlobalData);
    if (pGlobalData->muteVal)
    {
        SendDlgItemMessage(hwndDlg, IDC_MUTE_CHECKBOX, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
        SendDlgItemMessage(hwndDlg, IDC_MUTE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pGlobalData->hIconMuted);
    }
    else
    {
        SendDlgItemMessage(hwndDlg, IDC_MUTE_CHECKBOX, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
        SendDlgItemMessage(hwndDlg, IDC_MUTE_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pGlobalData->hIconUnMuted);
    }

    GetVolumeControl(pGlobalData);
    GetVolumeValue(pGlobalData);

    SendDlgItemMessage(hwndDlg, IDC_DEVICE_NAME, WM_SETTEXT, 0, (LPARAM)mxc.szPname);
    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETRANGE, (WPARAM)TRUE,
        (LPARAM)MAKELONG(pGlobalData->volumeMinimum, pGlobalData->volumeMaximum/VOLUME_DIVIDER));
    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPAGESIZE, (WPARAM)FALSE, (LPARAM)1);
    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETSEL, (WPARAM)FALSE,
        (LPARAM)MAKELONG(pGlobalData->volumeMinimum, pGlobalData->volumeValue/VOLUME_DIVIDER));
    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pGlobalData->volumeValue/VOLUME_DIVIDER);
}
Exemplo n.º 7
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	VACTION unact;
	UINT8 bID,back_saved;
	UINT32 chunk_id, default_db_addr, default_db_len;
	S_NODE  s_node;
	bID = OSD_GetObjID(pObj);
	INT16 	i,n;
	UINT8 back_saved1;
	UINT16 sat_id;//-a by wangyang 2011-11-03 for factory set del sat program
	win_popup_choice_t choice = WIN_POP_CHOICE_NO;
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			switch(bID)
			{
				case IDC_CON1:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						chunk_id = 0x03FC0100;
						api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
						set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
						if(GetMuteState())
							SetMuteOnOff(FALSE);
						if(GetPauseState())
							SetPauseOnOff(FALSE);
						win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
						api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                           	 	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);
					#if defined(ORDER_GZ1010010)||defined(ORDER_GZ1011005)||defined(ORDER_GZ1104005)	
						system_config.tv_scan_mode = 0;
					#endif	

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
					break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_TV_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
 						osal_task_sleep(1500);

						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_RADIO_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
			        		win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
				   		api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                              	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                    			break;
//-a by wangyang 2011-11-03 for factory set del sat program{{
				case IDC_CON5:

				if(OSD_GetMultiselCount(&factoryset_sel5)==0)
				{
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_NO_CHANNELS);
					win_compopup_open_ext(&back_saved1);
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
				}
				else
				{
					sat_id=OSD_GetMultiselSel(&factoryset_sel5);
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
					//	mm_enter_stop_mode(FALSE);
					//	api_show_menu_logo();
						if(api_is_playing_tv()  || api_is_playing_radio())
						{
							api_stop_play(1);
						}
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						//n = get_sat_num(VIEW_ALL);
						
						recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE,0);
						//for(i=0;i<n;i++)
						{
							get_sat_at(sat_id, SET_SELECTED,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
						
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();
						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
				}
                        		break;
//-a by wangyang 2011-11-03 for factory set del sat program}}
				default:
					break;
			}
			
		}
		break;
	}

	return ret;
}
Exemplo n.º 8
0
static PRESULT mpvolume_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT16 vol_pos;
	SYSTEM_DATA *pSys;
	PPROGRESS_BAR  mpvol_bar;
	PPROGRESS_BAR  ban_bar;
	UINT32 msg_code; // construct virtual operation

	mpvol_bar = &mpvolume_bar;
	switch(event)
	{
	   	case EVN_PRE_OPEN:
			pSys = sys_data_get();	
			if(pSys->volume > 0 && GetMuteState() )
				SetMuteOnOff(TRUE);
			vol_pos = mp_vol_to_pos(pSys->volume);
			OSD_SetProgressBarValue(mpvol_bar,vol_pos);
			MPVOLUME_TIMER_TIME = pSys->osd_set.time_out;
			if(MPVOLUME_TIMER_TIME == 0 || MPVOLUME_TIMER_TIME>10)
				MPVOLUME_TIMER_TIME = 5;
			MPVOLUME_TIMER_TIME *= 1000;		
			break;
		case EVN_POST_OPEN:
			mpvolume_timer = api_start_timer("mpvol",MPVOLUME_TIMER_TIME,mpvolume_timer_func);
			break;
		case EVN_POST_CLOSE:
			api_stop_timer(&mpvolume_timer);		
			break;
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);
			switch(unact)
			{
			case VACT_VOL_UP:
			case VACT_VOL_DOWN:
				pSys = sys_data_get();	
				vol_pos = mp_vol_to_pos(pSys->volume);
				if(unact == VACT_VOL_DOWN)
					vol_pos--;
				else if(unact == VACT_VOL_UP)
					vol_pos++;
				OSD_SetProgressBarValue(mpvol_bar,vol_pos);
				pSys->volume = mp_pos_to_vol(OSD_GetProgressBarPos(mpvol_bar));
				if(pSys->volume > 0 && GetMuteState() )
					SetMuteOnOff(TRUE);
				api_audio_set_volume(pSys->volume);
				OSD_DrawObject((POBJECT_HEAD)mpvol_bar,C_UPDATE_ALL);	
				api_stop_timer(&mpvolume_timer);		 
				mpvolume_timer = api_start_timer("mpvol",MPVOLUME_TIMER_TIME,mpvolume_timer_func);
				break;
			case VACT_BALANCE_L:
			case VACT_BALANCE_R:
				break;
			default:
				break;
			}
			break;
		default:
			break;
	}
		
	return ret;
}
Exemplo n.º 9
0
static PRESULT win_volume_bar_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	PROGRESS_BAR* bar;	
	SYSTEM_DATA* sys_data;
	UINT32 vkey;
	static int  m=0;
	VACTION unact;
	
	bar = (PROGRESS_BAR*)pObj;
	
	sys_data = sys_data_get();	

	switch(event)
	{
	case EVN_PRE_CHANGE:
		unact = (VACTION)(param1>>16);
		if(unact==VACT_DECREASE)
			volume_flag = 0;
		else if(unact==VACT_INCREASE)
			volume_flag = 1;
		if(key_cnt==1)
			i=0;
		m=sys_data->volume = OSD_GetProgressBarPos(bar);
		if(sys_data->volume > 0 && GetMuteState() )
		{
			SetMuteOnOff(TRUE);
			restore_mute_bg();
		}
		if(key_cnt > 1)
		{
			 if(volume_flag)
			 {
			   	sys_data->volume = sys_data->volume +2*(++i);
			 }
			 else 
			 {
			       
			   	m = sys_data->volume -2*(++i);
				if(m<=0)
				{
					m=0;
				}
				sys_data->volume = m;
			 }
			 
		}
		if(sys_data->volume>=100)
		{
			sys_data->volume=100;
		}
		api_audio_set_volume(sys_data->volume);
		OSD_SetProgressBarPos(bar, sys_data->volume);
		break;
	case EVN_POST_CHANGE:
		api_stop_timer(&volume_timer);		 
		volume_timer = api_start_timer(VOLUME_TIMER_NAME,VOLUME_TIMER_TIME,volume_timer_func);
		ret = PROC_LOOP;
		break;
	case EVN_UNKNOWNKEY_GOT:
		ap_hk_to_vk(0, param1, &vkey);
		if(vkey == V_KEY_NULL)
		{
			ret = PROC_LOOP;
		}
		break;
	default:
		break;
	}

	return ret;		 
}
Exemplo n.º 10
0
static void reset_factory_setting()
{
	UINT8 bID, back_saved;
	win_popup_choice_t choice;
	UINT32 chunk_id, default_db_addr, default_db_len;
	
	CONTAINER *factory_msg_con;
	factory_msg_con = &fac_msg_con;
	TEXT_FIELD *factory_msg_txt;
	factory_msg_txt = &factoryset_msg;

	MULTISEL *factory_multisel;
	factory_multisel = &factory_state;
	api_stop_play(1);
	epg_reset();
	
	OSD_SetTextFieldContent(factory_msg_txt, STRING_ID, (UINT32)RS_FACTORY_RESTORING);
	OSD_DrawObject((POBJECT_HEAD)factory_msg_txt, C_UPDATE_ALL);
	OSD_DrawObject((POBJECT_HEAD)factory_msg_con, C_UPDATE_ALL);
	//老版本弹出恢复出厂信息
	//win_compopup_init(WIN_POPUP_TYPE_SMSG);
	//win_compopup_set_msg(NULL, NULL, RS_FACTORY_RESTORING);
	//win_compopup_open_ext(&back_saved);	
	
	sys_data_factroy_init();
	sys_data_set_factory_reset(TRUE);
	sys_data_set_cur_chan_mode(TV_CHAN);
	sys_data_save(TRUE);
	sys_data_load();

	chunk_id = STB_CHUNK_DEFAULT_DB_ID;
	api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
	set_default_value(DEFAULT_ALL_PROG, default_db_addr + 16);
    
	reset_search_param(); /*reset the local static param in full_band_search*/
	if (GetMuteState())
		SetMuteOnOff(FALSE);
	if (GetPauseState())
		SetPauseOnOff(FALSE);
#if(defined(MIS_AD) || defined(MIS_AD_NEW))
	MIS_SetOSDAlpha(0x00);
#endif
#ifdef MULTI_CAS
#if (CAS_TYPE == CAS_DVN)
	ap_cas_set_messageID(0);
	cas_flags_reset();
#elif(CAS_TYPE==CAS_IRDETO)
	setFirstIn(1);
#elif (CAS_TYPE == CAS_CDCA)
	api_mcas_stop_transponder();
#endif				
#endif
	setMtxt(0);
	//win_compopup_smsg_restoreback();消除完成恢复出厂设置后出现的小黑框现象---#JingJin
	
	OSD_SetTextFieldContent(factory_msg_txt, STRING_ID, (UINT32)RS_FACTORY_DONE);
	OSD_DrawObject((POBJECT_HEAD)factory_msg_txt, C_UPDATE_ALL);
	
	OSD_SetTextFieldContent(factory_msg_txt, STRING_ID, (UINT32)RS_FACTORY_USER_SURE);

	OSD_SetMultiselSel(factory_multisel, 0);
	OSD_TrackObject((POBJECT_HEAD)factory_multisel, C_DRAW_TYPE_HIGHLIGHT);
	
	//老版本弹出恢复出厂信息
	//win_compopup_init(WIN_POPUP_TYPE_SMSG);
	//win_compopup_set_msg(NULL, NULL, RS_FACTORY_DONE);
	//win_compopup_open_ext(&back_saved);	
}
Exemplo n.º 11
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	//PRESULT ret = PROC_LEAVE;	
	VACTION unact;
	UINT8 bID,back_saved;
	win_popup_choice_t choice;
	UINT32 chunk_id, default_db_addr, default_db_len;

	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
		       ret = PROC_LEAVE;
			if(bID == BTN_NO_ID)
			{
				break;
			}
      
			
			//win_compopup_init(WIN_POPUP_TYPE_OKNO);
			//win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
			//win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
			//choice = win_compopup_open_ext(&back_saved);
			//if(choice == WIN_POP_CHOICE_YES)
			{
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
				win_compopup_open_ext(&back_saved);

				chunk_id = 0x03FC0100;
				api_get_chunk_add_len(chunk_id, &default_db_addr, &default_db_len);
				//here may reset CI+ Service Shunning parameter, 20100803
				#ifdef CI_PLUS_SERVICESHUNNING
				ci_service_shunning_reset();
				#endif
				set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

				sys_data_factroy_init(); 
				//sys_data_set_factory_reset(TRUE);
				sys_data_set_cur_chan_mode(TV_CHAN);
				sys_data_save(TRUE);
				sys_data_load();
				if(GetMuteState())
					SetMuteOnOff(FALSE);
				if(GetPauseState())
					SetPauseOnOff(FALSE);
				win_compopup_smsg_restoreback();
                power_off_process(); //初始化后重新启动xiaosaifei
				power_on_process();
				// PRESULT ret = PROC_LEAVE;
				//ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT_ROOT, (UINT32)&g_win_PALNTSC,FALSE);
			}

    #ifdef SHOW_WELCOME_SCREEN				
			POBJECT_HEAD submenu;
			extern void set_win_lang_as_welcome(BOOL iswelcome);
			set_win_lang_as_welcome(TRUE);
			submenu = (POBJECT_HEAD) & win_lan_con;
			if (OSD_ObjOpen(submenu, 0xFFFFFFFF) != PROC_LEAVE)
			{
				menu_stack_pop();
				menu_stack_push(submenu);
				ret = PROC_LOOP;
			}
							
    #endif
		
		
		}
		break;
	}

	return ret;
}