Esempio n. 1
0
 public void pauseSubOutput() {
   MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter pauseSubOutput");
   TVOutput subOutput = mTvInputManager.getOutput("sub");
   if (null != subOutput) {
     subOutput.stop();
   }
 }
Esempio n. 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();
  }
Esempio n. 3
0
 public void pauseMainOutput() {
   setTvNormal(false);
   MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter pauseMainOutput");
   TVOutput output = mTvInputManager.getOutput("main");
   if (null != output) {
     output.stop();
   }
   mTvContent.leaveTV();
 }
Esempio n. 4
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;
      }
    }
  }
Esempio n. 5
0
 protected void sortFile() {
   MtkLog.i("sort", "sortFile");
   int type = MultiFilesManager.getInstance(mContext).getSortType();
   if (FilesManager.SORT_BY_NAME == type) {
     new com.mediatek.ui.mmp.util.SortList().sort(mFiles, "getName", null);
   } else if (FilesManager.SORT_BY_DATE == type) {
     int source = MultiFilesManager.getInstance(mContext).getCurrentSourceType();
     if (MultiFilesManager.SOURCE_DLNA != source) {
       new com.mediatek.ui.mmp.util.SortList().sort(mFiles, "getSize", null);
     }
   } else if (FilesManager.SORT_BY_TYPE == type) {
     new com.mediatek.ui.mmp.util.SortList().sort(mFiles, "getSuffix", "getName");
   }
 }
Esempio n. 6
0
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case MessageType.MESSAGE_FOR_PIPSIZE_DELAY:
       //				setTvViewPosition();
       DestroyApp.getTVDialogView(mContext.getApplicationContext()).show(mContext);
       break;
     case MessageType.MESSAGE_FOR_CHECK_SWAP:
       MtkLog.d(TAG, "come in myHandler MESSAGE_FOR_CHECK_SWAP");
       GetCurrentTask currentTask = GetCurrentTask.getInstance(mContext);
       if (currentTask.isCurActivityTkuiMainActivity() && !isTvNormal()) {
         MtkLog.d(TAG, "come in myHandler MESSAGE_FOR_CHECK_SWAP to resume TV");
         resumeMainOutput();
       } else {
         MtkLog.i(TAG, "~~~~~~~~~~~~" + currentTask.getCurRunningClass());
       }
       break;
     default:
       break;
   }
 }
Esempio n. 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();
  }
Esempio n. 8
0
  private void setScreenPos() {
    switch (currentPos) {
      case PIP_POS_ZERO:
        if (currentSize == PIP_SIZE_SMALL) {
          x = 0.1f;
          y = 0.7f;
          w = 0.3f;
          h = 0.9f;
        } else if (currentSize == PIP_SIZE_MIDDLE) {
          x = 0.1f;
          y = 0.6f;
          w = 0.4f;
          h = 0.9f;
        } else {
          x = 0.1f;
          y = 0.5f;
          w = 0.5f;
          h = 0.9f;
        }
        break;

      case PIP_POS_ONE:
        if (currentSize == PIP_SIZE_SMALL) {
          x = 0.7f;
          y = 0.7f;
          w = 0.9f;
          h = 0.9f;
        } else if (currentSize == PIP_SIZE_MIDDLE) {
          x = 0.6f;
          y = 0.6f;
          w = 0.9f;
          h = 0.9f;
        } else {
          x = 0.5f;
          y = 0.5f;
          w = 0.9f;
          h = 0.9f;
        }
        break;

      case PIP_POS_TWO:
        if (currentSize == PIP_SIZE_SMALL) {
          x = 0.4f;
          y = 0.4f;
          w = 0.6f;
          h = 0.6f;
        } else if (currentSize == PIP_SIZE_MIDDLE) {
          x = 0.35f;
          y = 0.35f;
          w = 0.65f;
          h = 0.65f;
        } else {
          x = 0.3f;
          y = 0.3f;
          w = 0.7f;
          h = 0.7f;
        }
        break;

      case PIP_POS_THREE:
        if (currentSize == PIP_SIZE_SMALL) {
          x = 0.7f;
          y = 0.1f;
          w = 0.9f;
          h = 0.3f;
        } else if (currentSize == PIP_SIZE_MIDDLE) {
          x = 0.6f;
          y = 0.1f;
          w = 0.9f;
          h = 0.4f;
        } else {
          x = 0.5f;
          y = 0.1f;
          w = 0.9f;
          h = 0.5f;
        }
        break;

      case PIP_POS_FOUR:
        if (currentSize == PIP_SIZE_SMALL) {
          x = 0.1f;
          y = 0.1f;
          w = 0.3f;
          h = 0.3f;
        } else if (currentSize == PIP_SIZE_MIDDLE) {
          x = 0.1f;
          y = 0.1f;
          w = 0.4f;
          h = 0.4f;
        } else {
          x = 0.1f;
          y = 0.1f;
          w = 0.5f;
          h = 0.5f;
        }
        break;

      default:
        break;
    }

    MtkLog.i("SCAL", "~~~~~~~(x,y,w,h)" + "(" + x + "," + y + "," + w + "," + h + ")");
  }