public async Task No_Click() { BackgroundCommunicator.SendSongXML(CurrentSong); await SetAllSkipSongs(); await RemoveSkipSongAndSave(CurrentSong); }
public void Delete(Playlist playlist) { if (IsEmpty || playlist.PlaylistIndex == -1) { return; } BackgroundCommunicator.SendRemovePlaylist(playlist); Playlist oldCurrentPlaylist = CurrentPlaylist; playlists.Remove(playlist); playlists = new List <Playlist>(playlists); SetPlaylistToCurrentPlaylist(oldCurrentPlaylist); if (isForeground) { ViewModel.Current.UpdatePlaylists(); ViewModel.Current.UpdateCurrentPlaylistIndexAndRest(); if (IsEmpty) { CurrentSong.Current.Unset(); SaveLibray.Delete(); LibraryIO.SaveText(DateTime.Now.Ticks.ToString(), "LibraryDeletedDelete.txt"); } } }
private void Window_Activated(object sender, WindowActivatedEventArgs e) { try { if (e.WindowActivationState == CoreWindowActivationState.PointerActivated) { return; } bool isActiv = e.WindowActivationState == CoreWindowActivationState.CodeActivated; if (!isActiv) { ChangeTimer(false); } else if (BackgroundMediaPlayer.Current.CurrentState == MediaPlayerState.Playing) { ChangeTimer(true); } BackgroundCommunicator.SendIsWindowActiv(isActiv); SaveTextClass.SaveText(e.WindowActivationState.ToString()); } catch { } }
private async void GetLibraryData() { while (!Library.IsLoaded) { BackgroundMediaPlayer.Current.Pause(); BackgroundCommunicator.SendGetXmlText(); await Task.Delay(5000); } }
public void SetNextLoop() { iLoop = iLoop.GetNext(); if (Library.Current.IsForeground) { BackgroundCommunicator.SendLoop(this); UpdateLoopIcon(); } }
private void UpdateAndSendToBackground() { if (!Library.Current.IsForeground) { return; } BackgroundCommunicator.SendPlaylistXML(this); UpdateSongsAndShuffleListSongs(); UpdateCurrentSongIndex(); UpdateSongCount(); UpdateCurrentSong(); ViewModel.Current.ChangeSliderMaximumAndSliderValue(); }
public void GenerateShuffleList() { shuffleList = iShuffle.GenerateShuffleList(SongsIndex, Songs.Count); if (Library.Current.IsForeground) { BackgroundCommunicator.SendShuffle(this); UpdateSongsAndShuffleListSongs(); UpdateCurrentSongIndex(); } Library.Current.FireScrollEvent(this); }
public async void Refresh() { naturalDurationMilliseconds = 1; try { StorageFile file = await GetStorageFileAsync(); await SetTitleAndArtist(file); } catch { SetEmptyOrLoading(); } isLoading = false; BackgroundCommunicator.SendSongXML(this); UpdateTitleAndArtist(); }
public void RemoveSong(int songsIndex) { if (IsEmptyOrLoading) { return; } if (Library.Current.IsForeground) { BackgroundCommunicator.SendRemoveSong(PlaylistIndex, songsIndex); } List <Song> updatedSongs = new List <Song>(Songs); updatedSongs.RemoveAt(songsIndex); shuffleList = iShuffle.RemoveSongsIndex(songsIndex, shuffleList, updatedSongs.Count); songs = updatedSongs; if (SongsIndex > songsIndex) { this.songsIndex--; } else if (SongsIndex == songsIndex) { SongPositionMilliseconds = 0; } if (Library.Current.IsForeground) { UpdateSongsAndShuffleListSongs(); UpdateCurrentSong(); } if (IsEmptyOrLoading) { Library.Current.Delete(this); } }
public void SetIsForeground() { isForeground = true; BackgroundCommunicator.SetReceivedEvent(); BackgroundCommunicator.SendGetXmlText(); }
private void Playlist_Tapped(object sender, TappedRoutedEventArgs e) { BackgroundCommunicator.SendPause(); Library.Current.CurrentPlaylist = (sender as Grid).DataContext as Playlist; }