diff --git a/Images/[TRAILER]Linaris.mp4 b/Images/[TRAILER]Linaris.mp4 new file mode 100644 index 0000000..5a3546e Binary files /dev/null and b/Images/[TRAILER]Linaris.mp4 differ diff --git a/README.md b/README.md index 0199dc7..21f4fde 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ Linaris is a music and playlist management application, as well as a source of information about various popular albums and tracks. Our app is available on Windows and Android platforms through Visual Studio. +## Trailer + +![Trailer](Images/[TRAILER]Linaris.mp4) + ## Documentation You can find all the documentation [here](https://codefirst.iut.uca.fr/git/corentin.lemaire/Linaris_MAUI_SAE_201/src/branch/dev-doc#user-content-documentation-1) diff --git a/Sources/Linaris/AlbumPage.xaml.cs b/Sources/Linaris/AlbumPage.xaml.cs index 92fe516..9b0952f 100644 --- a/Sources/Linaris/AlbumPage.xaml.cs +++ b/Sources/Linaris/AlbumPage.xaml.cs @@ -21,7 +21,7 @@ public partial class AlbumPage : ContentPage { InitializeComponent(); album = (Application.Current as App).Manager.CurrentAlbum; - BindingContext = album; + BindingContext = Album; } @@ -69,16 +69,16 @@ public partial class AlbumPage : ContentPage musicElement.Dispatcher.StartTimer(TimeSpan.FromMilliseconds(100), () => { musicElement.SeekTo((Application.Current as App).MusicPosition); + if ((Application.Current as App).MediaState == MediaElementState.Playing) + { + musicElement.Play(); + } + else + { + musicElement.Pause(); + } return false; }); - if ((Application.Current as App).MediaState == MediaElementState.Playing) - { - musicElement.Play(); - } - else - { - musicElement.Pause(); - } } public void SetFooterData() diff --git a/Sources/Linaris/InfoTitlePage.xaml.cs b/Sources/Linaris/InfoTitlePage.xaml.cs index a3e432e..679cb58 100644 --- a/Sources/Linaris/InfoTitlePage.xaml.cs +++ b/Sources/Linaris/InfoTitlePage.xaml.cs @@ -63,16 +63,16 @@ public partial class InfoTitlePage : ContentPage musicElement.Dispatcher.StartTimer(TimeSpan.FromMilliseconds(300), () => { musicElement.SeekTo((Application.Current as App).MusicPosition); + if ((Application.Current as App).MediaState == MediaElementState.Playing) + { + musicElement.Play(); + } + else + { + musicElement.Pause(); + } return false; }); - if ((Application.Current as App).MediaState == MediaElementState.Playing) - { - musicElement.Play(); - } - else - { - musicElement.Pause(); - } } public void SetFooterData() diff --git a/Sources/Linaris/LocalFilesPage.xaml.cs b/Sources/Linaris/LocalFilesPage.xaml.cs index e91eb01..4ebb1ad 100644 --- a/Sources/Linaris/LocalFilesPage.xaml.cs +++ b/Sources/Linaris/LocalFilesPage.xaml.cs @@ -159,6 +159,7 @@ public partial class LocalFilesPage : ContentPage (Application.Current as App).Manager.RemoveCustomTitle(titleToRemove); customTitles.Remove(titleToRemove); File.Delete(titleToRemove.Path); + (Application.Current as App).Manager.RemoveCustomTitleFromPlaylists(titleToRemove); } } } diff --git a/Sources/Linaris/MainPage.xaml.cs b/Sources/Linaris/MainPage.xaml.cs index 0c3f141..a0da7e5 100644 --- a/Sources/Linaris/MainPage.xaml.cs +++ b/Sources/Linaris/MainPage.xaml.cs @@ -65,16 +65,16 @@ public partial class MainPage : ContentPage musicElement.Dispatcher.StartTimer(TimeSpan.FromMilliseconds(100), () => { musicElement.SeekTo((Application.Current as App).MusicPosition); + if ((Application.Current as App).MediaState == MediaElementState.Playing) + { + musicElement.Play(); + } + else + { + musicElement.Pause(); + } return false; }); - if ((Application.Current as App).MediaState == MediaElementState.Playing) - { - musicElement.Play(); - } - else - { - musicElement.Pause(); - } } public void SetFooterData() diff --git a/Sources/Linaris/PlaylistPage.xaml.cs b/Sources/Linaris/PlaylistPage.xaml.cs index c9f81dd..4282358 100644 --- a/Sources/Linaris/PlaylistPage.xaml.cs +++ b/Sources/Linaris/PlaylistPage.xaml.cs @@ -119,16 +119,16 @@ public partial class PlaylistPage : ContentPage musicElement.Dispatcher.StartTimer(TimeSpan.FromMilliseconds(100), () => { musicElement.SeekTo((Application.Current as App).MusicPosition); + if ((Application.Current as App).MediaState == MediaElementState.Playing) + { + musicElement.Play(); + } + else + { + musicElement.Pause(); + } return false; }); - if ((Application.Current as App).MediaState == MediaElementState.Playing) - { - musicElement.Play(); - } - else - { - musicElement.Pause(); - } } public void SetFooterData() diff --git a/Sources/Linaris/PlaylistsPage.xaml.cs b/Sources/Linaris/PlaylistsPage.xaml.cs index 3ab7e7d..d7e143f 100644 --- a/Sources/Linaris/PlaylistsPage.xaml.cs +++ b/Sources/Linaris/PlaylistsPage.xaml.cs @@ -150,16 +150,16 @@ public partial class PlaylistsPage : ContentPage musicElement.Dispatcher.StartTimer(TimeSpan.FromMilliseconds(100), () => { musicElement.SeekTo((Application.Current as App).MusicPosition); + if ((Application.Current as App).MediaState == MediaElementState.Playing) + { + musicElement.Play(); + } + else + { + musicElement.Pause(); + } return false; }); - if ((Application.Current as App).MediaState == MediaElementState.Playing) - { - musicElement.Play(); - } - else - { - musicElement.Pause(); - } } public void SetFooterData() diff --git a/Sources/Model/InfoTitle.cs b/Sources/Model/InfoTitle.cs index 52b57b4..247b89a 100644 --- a/Sources/Model/InfoTitle.cs +++ b/Sources/Model/InfoTitle.cs @@ -47,7 +47,7 @@ namespace Model /// Description de l'InfoTitle /// Genre de l'InfoTitle /// ID de l'album auquel appartient l'InfoTitle - public InfoTitle(string name, string imageURL, string information, string description, Genre genre, long albumID) : base(name, imageURL, information) + public InfoTitle(string name, string imageURL, string description, string information, Genre genre, long albumID) : base(name, imageURL, information) { Description = description; Genre = genre; diff --git a/Sources/Model/Manager.cs b/Sources/Model/Manager.cs index 1edcfe8..67ce5c4 100644 --- a/Sources/Model/Manager.cs +++ b/Sources/Model/Manager.cs @@ -419,6 +419,29 @@ namespace Model.Stub return DataManager.GetAlbumById(id); } + /// + /// Permet d'enlever un titre supprimé de toutes les playlists + /// + /// Titre à supprimer + public void RemoveCustomTitleFromPlaylists(CustomTitle title) + { + foreach(Playlist p in DataManager.GetPlaylists()) + { + List ToDelete = new(); + foreach (CustomTitle ct in p.Titles) + { + if (ct == title) + { + ToDelete.Add(ct); + } + } + foreach(CustomTitle ct in ToDelete) + { + p.RemoveTitle(ct); + } + } + } + /// /// Permet la notification, et donc l'actualisation des objets connectés à l'événement lorsque la méthode est appelée /// diff --git a/Sources/Model/Stub/StubAlbum.cs b/Sources/Model/Stub/StubAlbum.cs index 744abca..3d38a61 100644 --- a/Sources/Model/Stub/StubAlbum.cs +++ b/Sources/Model/Stub/StubAlbum.cs @@ -37,12 +37,12 @@ namespace Model.Stub new Album("L'école du micro d'argent", "album6.jpg", StubArtist.GetArtistByName("IAM") ?? new Artist("IAM"), "", "Sortie : 1997\n16 titres - 1h13min"), new Album("Deux Frères", "album7.png", StubArtist.GetArtistByName("PNL") ?? new Artist("PNL"), "", "Sortie : 2019\n22 titres"), new Album("Dans la légende", "album8.jpg", StubArtist.GetArtistByName("PNL") ?? new Artist("PNL"), "", "Sortie : 2016\n16 titres - 1h06"), - new Album("Night Visions", "album9.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "", ""), - new Album("Smoke & Mirrors", "album10.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "", ""), - new Album("Evolve", "album11.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "", ""), - new Album("Origins", "album12.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "", ""), - new Album("Mercury Act 1", "album13.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "", ""), - new Album("Mercury Act 2", "album14.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "", "") + new Album("Night Visions", "album9.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "Premier album d'Imagine Dragons", "Night Visions est le premier album studio du groupe de rock alternatif américain Imagine Dragons, sorti le 5 septembre 2012\nÀ sa sortie aux États-Unis, l'album entre directement en seconde position du Billboard 200, s'écoulant à plus de 83 000 unités en une semaine. Il a également atteint la première position du Billboard Alternative Album Chart et du Billboard Rock Albums Chart, ainsi que la dixième position au Canada."), + new Album("Smoke & Mirrors", "album10.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "Deuxième album d'Imagine Dragons", "Smoke + Mirrors est le deuxième album studio du groupe de rock alternatif américain Imagine Dragons, sorti le 17 février 2015."), + new Album("Evolve", "album11.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "Troisième album d'Imagine Dragons", "Evolve (stylisé ƎVOLVE) est le troisième album studio du groupe de rock alternatif américain Imagine Dragons sorti le 23 juin 2017."), + new Album("Origins", "album12.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "Quatrième album d'Imagine Dragons", "Origins est le quatrième album studio du groupe de rock alternatif américain Imagine Dragons, sorti le 9 novembre 2018."), + new Album("Mercury Act 1", "album13.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "Première partie du cinquième album d'Imagine Dragons", "Mercury - Act 1 est le cinquième album studio du groupe de pop rock américain Imagine Dragons, sorti le 3 septembre 2021 par Kidinakorner et Interscope Records aux États-Unis."), + new Album("Mercury Act 2", "album14.jpg", StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons"), "Deuxième partie du cinquième album d'Imagine Dragons", "Mercury – Acts 1 & 2 est le cinquième album studio du groupe de rock alternatif américain Imagine Dragons. Il s'agit d'un double album, dont le premier acte est sorti le 3 septembre 2021 et le second le 1 juillet 2022.") }; } diff --git a/Sources/Model/Stub/StubInfoTitle.cs b/Sources/Model/Stub/StubInfoTitle.cs index 2f69b80..8173570 100644 --- a/Sources/Model/Stub/StubInfoTitle.cs +++ b/Sources/Model/Stub/StubInfoTitle.cs @@ -50,23 +50,23 @@ namespace Model.Stub Album DLL = stubAlbum.GetAlbumByName("Dans la légende") ?? new Album("Dans la légende", "album8.jpg", PNL, "", "Sortie : 2016\n16 titres - 1h06"); infoTitles = new ObservableCollection() { - new InfoTitle("Bones", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Symphony", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Sharks", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("I don't like myself", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Blur", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Higher ground", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Crushed", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Take it easy", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Waves", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("I'm happy", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Ferris wheel", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Peace of mind", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Sirens", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Tied", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Younger", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("Continual", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), - new InfoTitle("They don't know you like I do", MercuryAct2.ImageURL, "infos", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Bones", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "La chanson \"Bones\" a été publiée en tant que premier single de Mercury - Act 2 le 11 mars 2022. La chanson a été utilisée pour promouvoir la troisième saison de la série Amazon Prime Video The Boys. La sortie du clip de la chanson le 6 avril a coïncidé avec la précommande de l'album.", Genre.POP, MercuryAct2.ID), + new InfoTitle("Symphony", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "\"Symphony\" a été envoyé à la radio en Italie le 25 novembre 2022, en tant que quatrième single de l'album.", Genre.POP, MercuryAct2.ID), + new InfoTitle("Sharks", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "Le deuxième single de l'album, \"Sharks\", est sorti le 24 juin 2022, accompagné d'un clip vidéo. Il a été envoyé aux radios italiennes le 1er juillet 2022.", Genre.POP, MercuryAct2.ID), + new InfoTitle("I don't like myself", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "Le troisième single de l'album, \"I Don't Like Myself\", est sorti le 10 octobre 2022, accompagné d'un clip vidéo pour la Journée mondiale de la santé mentale. À cette occasion, le groupe s'est associé à Crisis Text Line pour une campagne de collecte de fonds.", Genre.POP, MercuryAct2.ID), + new InfoTitle("Blur", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Higher ground", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Crushed", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "\"Crushed\" a été annoncé comme le cinquième single, avec une date de sortie fixée au 10 mai 2023. Le clip vidéo qui l'accompagne a été publié à la même date. La vidéo a été filmée en Ukraine en partenariat avec United24.", Genre.POP, MercuryAct2.ID), + new InfoTitle("Take it easy", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Waves", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("I'm happy", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Ferris wheel", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Peace of mind", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Sirens", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Tied", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Younger", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("Continual", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), + new InfoTitle("They don't know you like I do", MercuryAct2.ImageURL, "Titre de l'album Mercury Act 2", "desc", Genre.POP, MercuryAct2.ID), new InfoTitle("Enemy", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),