Solving play next bug.

This commit is contained in:
Anonymous Raccoon
2018-05-25 19:42:55 +02:00
parent 20d127054a
commit 1efd5d4e4f
2 changed files with 5 additions and 7 deletions
+1
View File
@@ -847,6 +847,7 @@ namespace MusicApp
public void PrepareSmallPlayer()
{
Console.WriteLine("&Index = " + MusicPlayer.CurrentID());
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
CoordinatorLayout smallPlayer = FindViewById<CoordinatorLayout>(Resource.Id.smallPlayer);
@@ -48,7 +48,6 @@ namespace MusicApp.Resources.Portable_Class
private Notification notification;
private const int notificationID = 1000;
private bool stoped = false;
private static long progress;
@@ -242,6 +241,8 @@ namespace MusicApp.Resources.Portable_Class
if(song.queueSlot == -1)
song.queueSlot = CurrentID() + 1;
Console.WriteLine("&QueueSlot = " + song.queueSlot);
currentID = song.queueSlot;
CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt(), song.GetAlbum());
@@ -515,7 +516,7 @@ namespace MusicApp.Resources.Portable_Class
public static int CurrentID()
{
if (queue.Count - 1 < currentID)
if (queue.Count < currentID)
currentID = -1;
return currentID;
}
@@ -744,7 +745,7 @@ namespace MusicApp.Resources.Portable_Class
public void Resume()
{
if(player != null && !isRunning && !stoped)
if(player != null && !isRunning)
{
isRunning = true;
Intent tmpPauseIntent = new Intent(Application.Context, typeof(MusicPlayer));
@@ -769,7 +770,6 @@ namespace MusicApp.Resources.Portable_Class
}
else
{
stoped = false;
Play(queue[CurrentID()], false, progress);
}
}
@@ -798,9 +798,6 @@ namespace MusicApp.Resources.Portable_Class
private void SleepPause()
{
Pause();
StopForeground(true);
stoped = true;
progress = player.CurrentPosition;
}
public static void Swap(int fromPosition, int toPosition)