Пример #1
0
  /** open sub output and move the input source of main output to sub. */
  private void changeModeToPip() {
    //		 mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    //		 mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_PIP);
    //		 TVOutput mOutput = mTvInputManager.getOutput("main");
    //		 String mString = null;
    //		 if (null != mOutput) {
    //		 mString = mOutput.getInput().getName();
    //		 }
    //		 if (null != mString) {
    //		 mTvInputManager.changeInputSource("sub", mString);
    //		 setScreenPos();
    //		 setTvViewPosition();
    //		 mTvContent.setScreenPosition("sub", x, y, w, h);
    //		 }
    try {
      if (null != mtv) {
        mtv.enterOutputMode(ITVCommon.OUTPUT_MODE_APP_PIP);
      }

      //			TVCommonNative.getDefault(mContext)
    } catch (RemoteException e) {
      e.printStackTrace();
    }
    setScreenPos();
    setTvViewPosition();
    mTvContent.setScreenPosition("sub", x, y, w, h);
  }
Пример #2
0
  public void resumeMainOutputWithNoConnect() {
    setTvNormal(true);
    MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter resumeMainOutputWithNoConnect");

    mTvContent.enterTV();

    mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
  }
Пример #3
0
 public void pauseMainOutput() {
   setTvNormal(false);
   MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter pauseMainOutput");
   TVOutput output = mTvInputManager.getOutput("main");
   if (null != output) {
     output.stop();
   }
   mTvContent.leaveTV();
 }
Пример #4
0
 /** for user to set sub output to appropriate position. */
 public void changePipPosition() {
   if (isCurrentModePIP()) {
     currentPos++;
     if (currentPos > PIP_POS_FOUR) {
       currentPos = PIP_POS_ZERO;
     }
     setScreenPos();
     mTvContent.setScreenPosition("sub", x, y, w, h);
     setTvViewPosition();
   }
 }
Пример #5
0
  public void switchOutputMode() {
    if (TurnkeyUiMainActivity.isResume) {
      MtkLog.i(TAG, "tk ui is running, can't change output mode.");
      return;
    }

    GetCurrentTask ctask = GetCurrentTask.getInstance(mContext);

    if (ctask.isCurActivtyMeidaMainActivity()) {
      toastNofunction();
      return;
    }

    if (!ctask.isCurTaskTKUI() && null != mtv) {
      try {
        int currentOutputMode = mtv.getCurrentOutputMode();
        if (ITVCommon.OUTPUT_MODE_NORMAL == currentOutputMode) {
          pipOn = false;
        }
      } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      //			 if (isCurrentModePIP()) {
      //			 DestroyApp.getTVDialogView(mContext.getApplicationContext())
      //			 .hide();
      //			 // changeModeToNormal();
      //			 TVOutputCommon common = TVOutputCommon.getInstance(mContext);
      //			 common.stop("sub");
      //			 } else {
      //			 changeModeToPip();
      //			 DestroyApp.getTVDialogView(mContext.getApplicationContext())
      //			 .show(mContext);
      //			 }
      if (pipOn) {
        DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
        // changeModeToNormal();
        TVOutputCommon common = TVOutputCommon.getInstance(mContext);
        mTvContent.setScreenPosition("sub", 0, 0, 0, 0);
        // common.stop("sub");
        common.stopEx("sub", true);
        pipOn = false;
      } else {
        changeModeToPip();
        DestroyApp.getTVDialogView(mContext.getApplicationContext()).show(mContext);
        //				DestroyApp.getTVDialogView(mContext.getApplicationContext())
        //						.startCheckPosition();
        pipOn = true;
      }
    }
  }
Пример #6
0
 /** for user to set sub screen to appropriate size. */
 public void changePipSize() {
   if (isCurrentModePIP()) {
     currentSize++;
     if (currentSize > PIP_SIZE_LARGE) {
       currentSize = PIP_SIZE_SMALL;
     }
     setScreenPos();
     setTvViewPosition();
     DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
     mTvContent.setScreenPosition("sub", x, y, w, h);
     myHandler.removeMessages(MessageType.MESSAGE_FOR_PIPSIZE_DELAY);
     myHandler.sendEmptyMessageDelayed(
         MessageType.MESSAGE_FOR_PIPSIZE_DELAY, MessageType.FOR_PIPSIZE_DELAY_TIME);
   }
 }
Пример #7
0
  public void resumeMainOutput() {
    setTvNormal(true);
    MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter resumeMainOutput");

    mTvContent.enterTV();

    //		mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    try {
      if (null != mtv) {
        mtv.enterOutputMode(ITVCommon.OUTPUT_MODE_NORMAL);
      }

    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    TVOutput output = mTvInputManager.getOutput("main");
    if (null != output) {
      output.connect(output.getInput());
    }
    DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
  }
Пример #8
0
 private NewPipLogic(Context context) {
   mContext = context;
   mTvContent = TVContent.getInstance(context);
   mTvInputManager = mTvContent.getInputManager();
   mtv = TVCommonNative.getDefault(mContext);
 }
Пример #9
0
 public void channelDown() {
   if (isCurrentModePIP() && isSubInputsourceTV()) {
     TVChannelSelector mTvChannelSelector = mTvContent.getChannelSelector();
     mTvChannelSelector.channelDown();
   }
 }
  public void setAdapter(SetConfigListViewAdapter.DataItem mDataItem) {
    if (SaveValue.getInstance(mContext).readValue(MenuConfigManager.AUTO_SYNC) == 1) {
      TVContent tv = TVContent.getInstance(mContext);
      TVTimerManager tvManager = tv.getTimerManager();
      Long mBroadcastUTC = tvManager.getBroadcastUTC();
      SystemClock.setCurrentTimeMillis(mBroadcastUTC);
      Long mBroadcastTimeZone = tvManager.getBroadcastTZOffset();
      if (SaveValue.getInstance(mContext).readValue(MenuConfigManager.SETUP_TIME_ZONE) == 25) {
        boolean t = SystemClock.setCurrentTimeMillis(mBroadcastUTC + mBroadcastTimeZone);
      } else {
        boolean clock = SystemClock.setCurrentTimeMillis(mBroadcastUTC);
      }
    } else if (SaveValue.getInstance(mContext).readValue(MenuConfigManager.AUTO_SYNC) == 2) {
      NetworkTime netTime = NetworkTime.getInstance(mContext);
      SystemClock.setCurrentTimeMillis(netTime.getNetTime());
    }
    this.mDataItem = mDataItem;
    mTextViewName.setText(mDataItem.getmName());
    if ((MenuConfigManager.TIME_TIME).equals(mDataItem.getmItemID())) {
      // final DateTimeView timeView = (DateTimeView)
      // findViewById(R.id.common_datetimeview);
      final UpdateTime updateProcess = new UpdateTime(MenuConfigManager.TIME_TIME);
      updateProcess.startprocess(
          new UpdateTime.UpdateListener() {
            public void update(String mString) {
              mDateTimeView.setDateStr(mString, updateProcess);
              mDateTimeView.postInvalidate();
            }
          });
    } else if ((MenuConfigManager.TIME_DATE).equals(mDataItem.getmItemID())) {
      // final DateTimeView dateView = (DateTimeView)
      // findViewById(R.id.common_datetimeview);
      final UpdateTime updateProcess = new UpdateTime(MenuConfigManager.TIME_DATE);
      updateProcess.startprocess(
          new UpdateTime.UpdateListener() {
            public void update(String mString) {
              // TODO Auto-generated method stub
              mDateTimeView.setDateStr(mString, updateProcess);
              mDateTimeView.postInvalidate();
            }
          });

    } else if ((MenuConfigManager.TIMER2).equals(mDataItem.getmItemID())) {
      this.mDateTimeView.setDateStr(
          SaveValue.getInstance(context).readStrValue(MenuConfigManager.TIMER2), new UpdateTime());
      final UpdateTime updateProcess = new UpdateTime(MenuConfigManager.TIME_TIME);
      updateProcess.startprocess(
          new UpdateTime.UpdateListener() {
            public void update(String mString) {
              DateTimeInputView.this.mDateTimeView.postInvalidate();
            }
          });

    } else {
      this.mDateTimeView.setDateStr(
          SaveValue.getInstance(context).readStrValue(MenuConfigManager.TIMER1), new UpdateTime());
      final UpdateTime updateProcess = new UpdateTime(MenuConfigManager.TIME_TIME);
      updateProcess.startprocess(
          new UpdateTime.UpdateListener() {
            public void update(String mString) {
              DateTimeInputView.this.mDateTimeView.postInvalidate();
            }
          });
    }
    this.mDateTimeView.mType = mDataItem.getmDateTimeType();
  }