Exemplo n.º 1
0
        private void onPlayState(UInt32 queueId, MusicPlayState playState)
        {
            var demandInfo = m_demandMusicQue.GetInfo(queueId);

            if (demandInfo == null)
            {
                Debug.WriteLine("Play state: already remove " + queueId);
                return;
            }

            switch (playState)
            {
            case MusicPlayState.Stop:
                demandInfo.Status = DemandSongStatus.PlayEnd;
                removeDemandInfo(demandInfo); //删除
                tryPlayMusic();               //尝试播放下一个
                break;

            case MusicPlayState.Pause:
                break;

            case MusicPlayState.Playing:
                demandInfo.Status = DemandSongStatus.Playing;
                postDemandInfo(demandInfo);
                break;

            case MusicPlayState.Resume:
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
 private void tryPostPlayState(MusicPlayState state, UInt32 playerId)
 {
     if (playerId != 0 && MusicPlayStateEvent != null)
     {
         MusicPlayStateEvent(playerId, state);
     }
 }