mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-05 23:31:52 +00:00
Solving play next bug.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user