private async void SaveArtist() { string coverArtist = ""; if (absolutePathCover != null) { coverArtist = Utils.Encoder.EncodeBase64(absolutePathCover); } Artist artist = new Artist(); artist.name = TextBox_name_artist.Text; artist.description = TextBox_description_artist.Text; artist.cover = coverArtist; artist.idAccount = idAccount; try { if (await ArtistRepository.CreateArtist(artist)) { SingletonMainWindows.GetSingletonWindow().ItemCreator.Visibility = Visibility.Visible; SingletonSesion.GetSingletonSesion().account.contentCreator = true; MessageBox.Show("Artist created"); SingletonMainWindows.GetSingletonWindow().ReloadArtist(); Window.GetWindow(this).Close(); } else { MessageBox.Show("Error to create artist"); } }catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void LogOut() { SingletonSesion.CleanSingleton(); SingletonMainWindows.CleanSingleton(); SingletonArtist.CleanSingleton(); StopTrack(); RpcStreamingService.Disconnect(); Login login = new Login(); login.Show(); this.Close(); }
private async void ListView_tracks_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Track track = (Track)ListView_tracks.SelectedValue; if (track != null) { var result = await Player.UploadTrackAsync(track); if (result) { SingletonMainWindows.GetSingletonWindow().UpdateInfoPlayer(track); } } }
public async void InitializeWindow() { SingletonMainWindows.SetSingletonWindow(this); loadProgressTrackTimer = new DispatcherTimer(); loadProgressTrackTimer.Tick += new EventHandler(PrintProgress); loadProgressTrackTimer.Interval = new TimeSpan(0, 0, 0, 1); if (SingletonSesion.GetSingletonSesion().account.contentCreator) { ItemCreator.Visibility = Visibility.Visible; if (await ArtistRepository.GetArtistOfAccount(SingletonSesion.GetSingletonSesion().account.idAccount)) { Console.WriteLine("Artist profile loaded: " + SingletonArtist.GetSingletonArtist().name); } } }
private async void ListView_tracks_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var personalTrack = (PersonalTrack)ListView_personal_tracks.SelectedItem; if (personalTrack != null) { Track trackAux = new Track(personalTrack.idPersonalTrack, personalTrack.title, 0, 0, personalTrack.fileTrack, personalTrack.avaialable, new MusicGender(), new Album()); trackAux.album.cover = "defaultAlbumCover.jpeg"; trackAux.album.artist.name = personalTrack.album; var result = await Player.UploadTrackAsync(trackAux); if (result) { SingletonMainWindows.GetSingletonWindow().UpdateInfoPlayer(trackAux); } } }
public static void PlayListTracks(List <Track> tracks) { Player.queueTracks.Clear(); Player.AddListTracksToQueue(tracks); SingletonMainWindows.GetSingletonWindow().GoToNextTrack(); }