package com.tcl.factory.view;
import android.view.KeyEvent;

import com.tcl.factory.bsp.TV;
import com.tcl.factory.bsp.TVDefine;
 

public class PModeUSBCloneMenu extends SubMenu
{
	private int modeType=0;
	public static  String MenuInfos_PModeUSBCloneMenu[][]={
		{"USB Clone Mode","All"},
		{"TV TO USB",">"},
		{"USB TO TV",">"}
	};
	public PModeUSBCloneMenu(){
		menuInfos=MenuInfos_PModeUSBCloneMenu;
		menuLabel = "Factory\\USB Colne";
		super.setTAG();
		modeType=0;
		menuInfos[0][1]="All ";
		updateMenuInfos();
	}
	public void KeyEvent(int keyCode,int pos){
		switch(keyCode)
		{
		case KeyEvent.KEYCODE_DPAD_LEFT:
		case KeyEvent.KEYCODE_DPAD_RIGHT:
		{
			switch(pos)
			{
			case 0:usbCloneModeChanges(keyCode) ;break;
			case 1:nvmToUsb() ;break;
			case 2:usbToNvm() ;break;
			}
		}
		break;
		default:
			break;
		}
	}
	

 
	/* (non-Javadoc)
	 * Factory
	 */
	@Override
	public void updateMenuInfos() {
		// TODO Auto-generated method stub
	}

/****************************************************************************************/

	
	
	private void nvmToUsb() {	
//	USBCloneDialog  usbCloneDialog=new USBCloneDialog( TCL.mContext,DEFS.NVM_TO_USB ,modeType);
		TV.writeV(TVDefine.NVM2USB,modeType);
	}

	private void usbToNvm() {
//		USBCloneDialog  usbCloneDialog=new USBCloneDialog( TCL.mContext,DEFS.USB_TO_NVM,modeType);
		TV.writeV(TVDefine.USB2NVM,modeType);
	}

//  update usbclonemode
	private void usbCloneModeChanges(int keyCode) {
		String str="";
		modeType=dataDeal(keyCode,modeType,3);	
		switch(modeType)
		{
		case 0:str="All ";break;
		case 1:str="ChannelList";break;
		case 2:str="EEPROM ";break;
		case 3:str="Users Settings ";break;
		}
		menuInfos[0][1]=str;
	}

}