예제 #1
0
 public MusicPlaybackTrack(long id, long sourceId, Utils.MusicUtils.SourceTypeId sourceType, int sourcePos)
 {
     Id         = id;
     SourceId   = sourceId;
     SourceType = sourceType;
     SourcePos  = sourcePos;
 }
예제 #2
0
 public MusicPlaybackTrack(Parcel parcel)
 {
     Id         = parcel.ReadLong();
     SourceId   = parcel.ReadLong();
     SourceType = (Utils.MusicUtils.SourceTypeId)parcel.ReadInt();
     SourcePos  = parcel.ReadInt();
 }
 public static void PlayAll(Context context, long[] list, int position, long sourceId, Utils.MusicUtils.SourceTypeId sourceType, bool forceShuffle)
 {
     if (list == null || list.Length == 0 || Service == null)
     {
         return;
     }
     try
     {
         if (forceShuffle)
         {
             Service.SetShuffleMode(MusicService.SHUFFLE_NORMAL);
         }
         long currentId            = Service.GetAudioId();
         int  currentQueuePosition = GetQueuePosition();
         if (position != -1 && currentQueuePosition == position && currentId == list[position])
         {
             long[] playlist = GetQueue();
             if (Equals(list, playlist))
             {
                 Service.Play();
                 return;
             }
         }
         if (position < 0)
         {
             position = 0;
         }
         Service.Open(list, forceShuffle ? -1 : position, sourceId, (int)sourceType);
         Service.Play();
     }
     catch { }
 }