private void loadAudioData() {

    effectUtils = new EffectUtils(this);
    effectUtils.parseXml("effectcfg/effectlist.xml");

    if (PluginUtils.isPluginMounted()) {
      mEffects = new XEffects();
    }

    if (null == mMediaPlayer) {
      mMediaPlayer = new XMediaPlayer(this, mEffects, true);
      mMediaPlayer.setUpdateTimePeriod(0.1f);
      mMediaPlayer.setListener(new MyOnInfoListener());
      if (mainAudioPath != null) {
        mMediaPlayer.open(mainAudioPath);
        totalTime = mMediaPlayer.getTotalTime();
        audioMontageEndTime = totalTime;
        duration = (int) (totalTime);
        montageEndTime = (float) totalTime;
        tvAudioDuration.setText(
            EditVoiceMainFragment.convertTimeFormartMS("0")
                + "/"
                + EditVoiceMainFragment.convertTimeFormartMS(String.valueOf(duration)));
      }
    }
  }
 public void setMontageTimeRange(float startTime, float endTime) {
   Log.d(TAG, "setMontageTimeRange in startTime = " + startTime + " endTime = " + endTime);
   montageStartTime = startTime;
   montageEndTime = endTime;
   if (mainFragment != null) {
     mainFragment.setTimeRange((int) startTime, (int) endTime);
   }
 }
 @Override
 public void setSoundTrackText(String text) {
   // TODO Auto-generated method stub
   mainFragment.setSoundTrackText(text);
 }
 private void setAudioCurrentTime(int curTime) {
   String curTimeStr = EditVoiceMainFragment.convertTimeFormartMS(String.valueOf(curTime));
   String totalDuration = EditVoiceMainFragment.convertTimeFormartMS(String.valueOf(duration));
   tvAudioDuration.setText(curTimeStr + "/" + totalDuration);
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_voice_detail);

    detailMainFragment = new EditVoiceDetailMainFragment();
    tagFragment = new EditMediaTagFragment();
    posFragment = new EditMediaPositionFragment();
    soundFragment = new EditMediaBeautifySoundFragment();
    textFragment = new EditMediaTextInputFragment();
    mainFragment = new EditVoiceMainFragment();
    montageFragment = new EditVoiceMontageFragment();
    soundtrackFragment = new EditMediaSoundtrackFragment();

    fm = getSupportFragmentManager();

    ivBack = (ImageView) findViewById(R.id.iv_back);
    ivDone = (ImageView) findViewById(R.id.iv_edit_done);
    ivBack.setOnClickListener(this);
    ivDone.setOnClickListener(this);

    myLocInfo = MyLocationInfo.getInstance(this);
    myLoc = myLocInfo.getLocation();

    initView(this);

    mMapView = (MyMapView) findViewById(R.id.bmv_activity_edit_voice_detail_position);
    mMapView.setVisibility(View.GONE);
    myPositionLayout = (MyPositionLayout) findViewById(R.id.rl_activity_edit_media_my_position);
    myPositionLayout.setVisibility(View.GONE);
    myPositionLayout.setWillNotDraw(false);
    myPositionTv = (TextView) findViewById(R.id.tv_edit_media_myposition);
    myPositionTv.setVisibility(View.GONE);

    mainLayout = (RelativeLayout) findViewById(R.id.rl_activity_edit_voice_main);
    mainLayout.setOnClickListener(this);
    detailMainLayout = (LinearLayout) findViewById(R.id.ll_activity_edit_voice_detail_main);
    thumbView = (ImageView) findViewById(R.id.iv_edit_voice_thumbnails);
    thumbView.setOnClickListener(this);
    //		recPlayerView = (ImageView) findViewById(R.id.iv_edit_long_rec_player);
    //		recPlayerView.setOnClickListener(this);

    diaryUUID = getIntent().getStringExtra(DiaryDetailActivity.INTENT_ACTION_DIARY_UUID);
    diaryString = getIntent().getStringExtra(DiaryDetailActivity.INTENT_ACTION_DIARY_STRING);

    initAttachs();

    tvAudioDuration = (TextView) findViewById(R.id.tv_edit_voice_duration);
    if (mainAudioDuration != null) {
      tvAudioDuration.setText(
          EditVoiceMainFragment.convertTimeFormartMS("0")
              + "/"
              + EditVoiceMainFragment.convertTimeFormartMS(mainAudioDuration));
    }

    loadAudioData();

    ivPlay = (ImageView) findViewById(R.id.iv_edit_voice_play);
    ivPlay.setOnClickListener(this);

    playProcess = (SeekBar) findViewById(R.id.sk_edit_voice_seekbar);
    playProcess.setMax(100);
    playProcess.setProgress(0);
    seekBarBg = (ImageView) findViewById(R.id.v_seekbar_background);
    ViewTreeObserver vto2 = seekBarBg.getViewTreeObserver();
    vto2.addOnGlobalLayoutListener(
        new OnGlobalLayoutListener() {

          @Override
          public void onGlobalLayout() {
            // TODO Auto-generated method stub
            seekBarLength = seekBarBg.getMeasuredWidth();
          }
        });

    llXiaLa = (LinearLayout) findViewById(R.id.ll_edit_diary_style);
    llXiaLa.setOnClickListener(this);
    diaryEditStyle = (TextView) findViewById(R.id.tv_edit_name);
    inflater = LayoutInflater.from(this);
    rlTitleBar = findViewById(R.id.rl_title);

    handler = new Handler(this);

    if (mainAudioPath == null) {
      thumbView.setVisibility(View.INVISIBLE);
      thumbView.setClickable(false);
    }
    goToPage(FRAGMENT_DETAIL_MAIN_VIEW, false);
    getWindow()
        .setSoftInputMode(
            WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN
                | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

    overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
  }