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() public void PrepareSmallPlayer()
{ {
Console.WriteLine("&Index = " + MusicPlayer.CurrentID());
Song current = MusicPlayer.queue[MusicPlayer.CurrentID()]; Song current = MusicPlayer.queue[MusicPlayer.CurrentID()];
CoordinatorLayout smallPlayer = FindViewById<CoordinatorLayout>(Resource.Id.smallPlayer); CoordinatorLayout smallPlayer = FindViewById<CoordinatorLayout>(Resource.Id.smallPlayer);
@@ -48,7 +48,6 @@ namespace MusicApp.Resources.Portable_Class
private Notification notification; private Notification notification;
private const int notificationID = 1000; private const int notificationID = 1000;
private bool stoped = false;
private static long progress; private static long progress;
@@ -242,6 +241,8 @@ namespace MusicApp.Resources.Portable_Class
if(song.queueSlot == -1) if(song.queueSlot == -1)
song.queueSlot = CurrentID() + 1; song.queueSlot = CurrentID() + 1;
Console.WriteLine("&QueueSlot = " + song.queueSlot);
currentID = song.queueSlot; currentID = song.queueSlot;
CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt(), song.GetAlbum()); CreateNotification(song.GetName(), song.GetArtist(), song.GetAlbumArt(), song.GetAlbum());
@@ -515,7 +516,7 @@ namespace MusicApp.Resources.Portable_Class
public static int CurrentID() public static int CurrentID()
{ {
if (queue.Count - 1 < currentID) if (queue.Count < currentID)
currentID = -1; currentID = -1;
return currentID; return currentID;
} }
@@ -744,7 +745,7 @@ namespace MusicApp.Resources.Portable_Class
public void Resume() public void Resume()
{ {
if(player != null && !isRunning && !stoped) if(player != null && !isRunning)
{ {
isRunning = true; isRunning = true;
Intent tmpPauseIntent = new Intent(Application.Context, typeof(MusicPlayer)); Intent tmpPauseIntent = new Intent(Application.Context, typeof(MusicPlayer));
@@ -769,7 +770,6 @@ namespace MusicApp.Resources.Portable_Class
} }
else else
{ {
stoped = false;
Play(queue[CurrentID()], false, progress); Play(queue[CurrentID()], false, progress);
} }
} }
@@ -798,9 +798,6 @@ namespace MusicApp.Resources.Portable_Class
private void SleepPause() private void SleepPause()
{ {
Pause(); Pause();
StopForeground(true);
stoped = true;
progress = player.CurrentPosition;
} }
public static void Swap(int fromPosition, int toPosition) public static void Swap(int fromPosition, int toPosition)