Exemplo n.º 1
0
 @Override
 public void setBeautifulSoundText(String text) {
   // TODO Auto-generated method stub
   detailMainFragment.setBeautifulSoundText(text);
 }
Exemplo n.º 2
0
  @Override
  public boolean handleMessage(Message msg) {
    // TODO Auto-generated method stub
    switch (msg.what) {
      case Requester2.RESPONSE_TYPE_MODIFY_TAG:
        Log.d(TAG, "handleMessage  RESPONSE_TYPE_MODIFY_TAG");
        GsonResponse2.modTagsOrPositionResponse tagandpositionResponse =
            (modTagsOrPositionResponse) msg.obj;
        if (tagandpositionResponse != null && "0".equals(tagandpositionResponse.status)) {
          Log.d(TAG, "handleMessage RESPONSE_TYPE_MODIFY_TAG successed");
          DiaryManager diarymanager = DiaryManager.getInstance();
          MyDiary myLocalDiary = diarymanager.findLocalDiaryByUuid(diaryUUID);
          if (myLocalDiary != null) {
            Log.d(TAG, "save myLocalDiary not null");
            myLocalDiary.position = myDiary.position;
            myLocalDiary.tags = getMyDiary().tags;
            DiaryManager.getInstance().diaryDataChanged(myDiary.diaryuuid);
          }
        }
        isTagPositionChangeDone = true;
        saveLocalDiaryAndFinish();
        break;
      case Requester2.RESPONSE_TYPE_CREATE_STRUCTURE:
        Log.d(TAG, "handleMessage RESPONSE_TYPE_CREATE_STRUCTURE");
        structureResponse = (createStructureResponse) msg.obj;

        if (getString(R.string.edit_media_cover).equals(getEditDiaryStyle())) { // 覆盖模式
          if (isDiaryCreated()) {
            if (structureResponse != null && "0".equals(structureResponse.status)) { // 创建日记结构成功
              new CreateDiarySucessedThread().start();
            } else { // 创建日记结构失败
              new CreateDiaryFailedThread().start();
            }
          } else {
            new CreateOfflineDiaryThread().start();
          }
        } else { // 另存为模式
          if (structureResponse != null) { // 创建另存为日记结构成功
            //					Log.d(TAG,"************attachsSize*******" + structureResponse.attachs.length);
            new CreateNewDiaryThread().start();
          }
        }
        break;
      case EditMediaDetailActivity.HANDLER_DISMISS_PROCESS_DIALOG:
        saveLocalDiaryAndFinish();
        break;
      case EditMediaDetailActivity.HANDLER_SOUND_DELETE:
        isDeleteSound = true;
        isAddSoundAttach = false;
        hasShortSound = false;
        checkAuxiliaryAttachEmpty();
        detailMainFragment.processDelShortSoundMsg();
        break;
        /*case DiaryDetailActivity.HANDLER_UPDATE_LONG_RECORD_PLAYER_COMPLETE:
        	isPlaying = false;
        	ivPlay.setImageResource(R.drawable.btn_edit_audio_play);
        	playProcess.setProgress(0);
        	setAudioCurrentTime(0);
        	break;
        case DiaryDetailActivity.HANDLER_UPDATE_LONG_RECORD_PLAYER_PROCESS:
        	if(playProcess!=null) {
        		int progress = (Integer)msg.obj;
        		playProcess.setProgress(progress);
        		setAudioCurrentTime(progress);
        	}
        	break;*/
      case EffectTransCodeUtil.HANDLER_PROCESS_EFFECTS_FINISH:
        Log.d(TAG, "VideoEffectTransCodeUtil.HANDLER_PROCESS_EFFECTS_FINISH");
        if (msg.arg1 == EffectTransCodeUtil.MAIN_AUDIO) {
          if (msg.obj != null) {
            effectAudioPath = (String) msg.obj;
          }
          threadsSignal.countDown();
          Log.d(TAG, "HANDLER_PROCESS_EFFECTS_FINISH SHORT_AUDIO audioPath = " + audioPath);
        } else if (msg.arg1 == EffectTransCodeUtil.SHORT_AUDIO) {
          if (msg.obj != null) {
            audioPath = (String) msg.obj;
          }
          shortAudioSignal.countDown();
          Log.d(TAG, "HANDLER_PROCESS_EFFECTS_FINISH SHORT_AUDIO audioPath = " + audioPath);
        }
        break;
      case EffectTransCodeUtil.HANDLER_PROCESS_EFFECTS_SCHEDULE:
        int percent = msg.arg2;
        Log.d(
            TAG, "VideoEffectTransCodeUtil.HANDLER_PROCESS_EFFECTS_SCHEDULE percent = " + percent);
        if (dialogTitle != null) {
          String titel = "";
          if (msg.arg1 == EffectTransCodeUtil.MAIN_AUDIO) {
            titel = getString(R.string.process_long_record_effect) + " " + percent + "%";
          } else if (msg.arg1 == EffectTransCodeUtil.SHORT_AUDIO) {
            titel = getString(R.string.process_short_record_effect) + " " + percent + "%";
          }
          dialogTitle.setText(titel);
        }
        break;
    }
    return false;
  }