private void playMusic(int iPosition) { AudioVO mAudio = null; if ((iType == 0) || (iType == 1)) mAudio = (AudioVO) mAudioList.getItem(iPosition); else mAudio = (AudioVO) mDragAudioList.getItem(iPosition); mTxtTitle.setText((CharSequence) mAudio.getTitle()); mTxtDescription.setText((CharSequence) mAudio.getDescription()); startMediaPlayer( 2, iType, iPosition, 0, 0, mAudio.getId(), mAudio.getTitle(), mAudio.getDescription()); }
// 上一首 private void FrontMusic() { if ((iType == 0) || (iType == 1)) iListCount = mAudioList.getCount() - 1; else iListCount = mDragAudioList.getCount() - 1; if (--iChapter < 0) iChapter = iListCount; /* if (NewPlayMusicActivity.iAudioPlayerState > 2){ Intent intent = new Intent(NewPlayMusicActivity.this, PlayMusicService.class); stopService(intent); iAudioPlayerState= 0; } */ playMusic(iChapter); }
// 下一首 private void nextMusic() { // TODO Auto-generated method stub if ((iType == 0) || (iType == 1)) iListCount = mAudioList.getCount() - 1; else iListCount = mDragAudioList.getCount() - 1; if (++iChapter > iListCount) iChapter = 0; /* if (NewPlayMusicActivity.iAudioPlayerState > 2){ Intent intent = new Intent(NewPlayMusicActivity.this, PlayMusicService.class); stopService(intent); iAudioPlayerState= 0; } */ playMusic(iChapter); }