Merge master -> dev-tu
continuous-integration/drone/push Build is failing Details

pull/39/head
Corentin LEMAIRE 2 years ago
commit a8060dd65e

@ -49,11 +49,10 @@ steps:
path: /docs
commands:
- /entrypoint.sh
environment:
NODOXYGEN: true
when:
branch:
- master
- dev-doxygen
event:
- push
- pull_request

@ -5,7 +5,7 @@ DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Linaris"
PROJECT_NUMBER = 1.0.0
PROJECT_BRIEF = "Music player and manager"
PROJECT_LOGO = appicon.svg
PROJECT_LOGO = appicon.png
OUTPUT_DIRECTORY = /docs/doxygen
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = NO
@ -226,7 +226,7 @@ HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES = images/CodeFirst.png images/clubinfo.png
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 215
HTML_COLORSTYLE_SAT = 45
HTML_COLORSTYLE_GAMMA = 240

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

@ -1,4 +1,4 @@
# Linaris_MAUI_SAE_201
# Linaris
[![Build Status](https://codefirst.iut.uca.fr/api/badges/corentin.lemaire/Linaris_MAUI_SAE_201/status.svg)](https://codefirst.iut.uca.fr/corentin.lemaire/Linaris_MAUI_SAE_201)
@ -9,9 +9,15 @@
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
<iframe allowfullscreen src='https://opencast.dsi.uca.fr/paella/ui/embed.html?id=41e87f72-a922-44a3-ad2c-1432540bace0' width='640' height='480' frameborder='0' scrolling='no' marginwidth='0' marginheight='0' allowfullscreen='true' webkitallowfullscreen='true' mozallowfullscreen='true' ></iframe>
[![Trailer](Images/logo.png)](https://opencast.dsi.uca.fr/paella/ui/watch.html?id=41e87f72-a922-44a3-ad2c-1432540bace0)
## 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)
You can find all the documentation [here](https://codefirst.iut.uca.fr/git/corentin.lemaire/Linaris_MAUI_SAE_201#documentation-1)
### Prerequisites

@ -13,10 +13,6 @@
<None Remove="xml\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Plugin.Maui.Audio" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>

@ -1,3 +1,4 @@
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Views;
using Model;
@ -20,7 +21,7 @@ public partial class AlbumPage : ContentPage
{
InitializeComponent();
album = (Application.Current as App).Manager.CurrentAlbum;
BindingContext = album;
BindingContext = Album;
}
@ -33,9 +34,16 @@ public partial class AlbumPage : ContentPage
}
}
protected override void OnAppearing()
{
base.OnAppearing();
GetFooterData();
}
protected override void OnDisappearing()
{
base.OnDisappearing();
SetFooterData();
ContentView footer = this.FindByName<ContentView>("Footer");
var musicElement = footer?.FindByName<MediaElement>("music");
if (musicElement != null)
@ -43,4 +51,50 @@ public partial class AlbumPage : ContentPage
musicElement.Stop();
}
}
private void GetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
Footer.CurrentPlaying = FooterPage.CurrentPlaying;
Footer.PlayImage = FooterPage.PlayImage;
Footer.LoopImage = FooterPage.LoopImage;
Footer.ShuffleImage = FooterPage.ShuffleImage;
Footer.Volume = FooterPage.Volume;
Footer.Position = FooterPage.Position;
Footer.Duration = FooterPage.Duration;
Footer.SliderPosition = FooterPage.SliderPosition;
// Place l'index de lecture de la musique à la position du slider
var musicElement = Footer?.FindByName<MediaElement>("music");
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;
});
}
public void SetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
FooterPage.CurrentPlaying = (Application.Current as App).Manager.CurrentPlaying;
FooterPage.PlayImage = Footer.PlayImage;
FooterPage.LoopImage = Footer.LoopImage;
FooterPage.ShuffleImage = Footer.ShuffleImage;
FooterPage.Volume = Footer.Volume;
FooterPage.Position = Footer.Position;
FooterPage.Duration = Footer.Duration;
FooterPage.SliderPosition = Footer.SliderPosition;
var musicElement = Footer?.FindByName<MediaElement>("music");
(Application.Current as App).MusicPosition = musicElement.Position;
(Application.Current as App).MediaState = musicElement.CurrentState;
}
}

@ -12,3 +12,4 @@
</ResourceDictionary>
</Application.Resources>
</Application>

@ -1,15 +1,27 @@
using Model.Serialization;
using CommunityToolkit.Maui.Core.Primitives;
using Model.Serialization;
using Model.Stub;
using System.Diagnostics;
namespace Linaris;
public partial class App : Application
{
public Manager Manager = new(new LinqXmlSerialization(Path.Combine(FileSystem.Current.AppDataDirectory, "Data")));
public Manager Manager { get; set; }
public FooterPage FooterPage { get; set; }
public TimeSpan MusicPosition { get; set; }
public MediaElementState MediaState { get; set; }
public App()
{
InitializeComponent();
MusicPosition = TimeSpan.FromSeconds(0);
MediaState = MediaElementState.Paused;
Manager = new Manager(new LinqXmlSerialization(FileSystem.Current.AppDataDirectory));
FooterPage = new FooterPage();
MainPage = new AppShell();
}

@ -1,22 +1,21 @@
using System;
namespace Linaris.Converters
namespace Linaris.Converters;
public class InverseBooleanConverter : IValueConverter
{
public class InverseBooleanConverter : IValueConverter
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
if (value is bool boolValue)
{
if (value is bool boolValue)
{
return !boolValue;
}
return value;
return !boolValue;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return Convert(value, targetType, parameter, culture);
}
}

@ -38,12 +38,9 @@ public partial class EditPlaylistPage : ContentPage
return;
}
if (sender is Image image)
if (sender is Image image && image.BindingContext is Playlist p)
{
if (image.BindingContext is Playlist playlist)
{
playlist.ImageURL = result.FullPath;
}
p.ImageURL = result.FullPath;
}
}

@ -1,20 +1,40 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Linaris"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:model="clr-namespace:Model;assembly=Model"
x:Class="Linaris.FooterPage">
<Grid Grid.ColumnSpan="2" Grid.Row="1" BackgroundColor="Gray" ColumnDefinitions="16*,7*">
<Grid Grid.ColumnSpan="2" Grid.Row="1" BackgroundColor="Gray" BindingContext="{Binding CurrentPlaying}">
<toolkit:MediaElement x:Name="music" Source="{Binding Path}" BackgroundColor="Transparent" ShouldShowPlaybackControls="True" ShouldAutoPlay="True" Grid.Column="0" Speed="1" ShouldKeepScreenOn="false" MediaEnded="OnCompleted"/>
<toolkit:MediaElement IsVisible="False" x:Name="music" Source="{Binding Path}" BackgroundColor="Transparent" ShouldShowPlaybackControls="False" ShouldAutoPlay="True" Grid.Column="0" ShouldKeepScreenOn="false" MediaEnded="OnCompleted"/>
<Grid Grid.Column="1" HorizontalOptions="CenterAndExpand" RowDefinitions="*,*" ColumnDefinitions="*,*">
<ImageButton Style="{StaticResource FooterButton}" Clicked="ShuffleButton_Clicked" Source="rdm.png" Grid.Row="0" Grid.Column="0"/>
<ImageButton Style="{StaticResource FooterButton}" Clicked="LoopButton_Clicked" Source="loop.png" Grid.Row="0" Grid.Column="1"/>
<ImageButton Style="{StaticResource FooterButton}" Clicked="RewindButton_Clicked" Source="back.png" Grid.Row="1" Grid.Column="0"/>
<ImageButton Style="{StaticResource FooterButton}" Clicked="NextButton_Clicked" Source="next.png" Grid.Row="1" Grid.Column="1"/>
</Grid>
<Grid ColumnDefinitions="*,3*,*" RowDefinitions="8*,3*">
<Label Style="{StaticResource FooterTitleTrigger}" Text="{Binding Name}" TextColor="PeachPuff" x:Name="Title" HorizontalOptions="Center" VerticalOptions="Center" LineBreakMode="TailTruncation" Grid.Row="0"/>
<Grid ColumnDefinitions="*,3*,*" Grid.ColumnSpan="3" RowDefinitions="8*,3*" Grid.RowSpan="2">
<HorizontalStackLayout Grid.Row="0" Grid.Column="1" HorizontalOptions="Center">
<ImageButton Style="{StaticResource FooterButton}" Clicked="LoopButton_Clicked" Source="{Binding Source={RelativeSource AncestorType={x:Type ContentView}}, Path=LoopImage}"/>
<ImageButton Style="{StaticResource FooterButton}" Clicked="RewindButton_Clicked" Source="back.png"/>
<ImageButton Clicked="PlayButton_Clicked" WidthRequest="30" Source="{Binding Source={RelativeSource AncestorType={x:Type ContentView}}, Path=PlayImage}" Aspect="AspectFit" BackgroundColor="Transparent" Margin="0,10,8,10"/>
<ImageButton Style="{StaticResource FooterButton}" Clicked="NextButton_Clicked" Source="next.png"/>
<ImageButton Style="{StaticResource FooterButton}" Clicked="ShuffleButton_Clicked" Source="{Binding Source={RelativeSource AncestorType={x:Type ContentView}}, Path=ShuffleImage}"/>
</HorizontalStackLayout>
<Grid ColumnDefinitions="*,4*,*" Grid.Row="1" Style="{StaticResource FooterSliderTrigger}">
<Label Text="{Binding Source={RelativeSource AncestorType={x:Type ContentView}}, Path=Position}" Grid.Column="0" HorizontalTextAlignment="End" Margin="0,0,5,0" VerticalOptions="Center"/>
<Slider Value="{Binding Source={RelativeSource AncestorType={x:Type ContentView}}, Path=SliderPosition, Mode=TwoWay}" Grid.Column="1" x:Name="TimeSlider"/>
<Label Text="{Binding Source={RelativeSource AncestorType={x:Type ContentView}}, Path=Duration}" Grid.Column="2" Margin="5,0,0,0" VerticalOptions="Center"/>
</Grid>
</Grid>
<VerticalStackLayout Style="{StaticResource FooterVolumeTrigger}" Grid.Column="2" VerticalOptions="Center">
<Image Source="volume.png" WidthRequest="35" HeightRequest="35"/>
<Slider Value="{Binding Source={RelativeSource AncestorType={x:Type ContentView}}, Path=Volume}" x:Name="VolumeSlider" WidthRequest="100" VerticalOptions="Center" Margin="5,0,0,0"/>
</VerticalStackLayout>
</Grid>
</Grid>
</ContentView>

@ -1,29 +1,178 @@
using CommunityToolkit.Maui.Core.Primitives;
using Model;
using Model.Stub;
using System.ComponentModel;
using System.Configuration;
using System.Runtime.CompilerServices;
namespace Linaris;
public partial class FooterPage : ContentView, INotifyPropertyChanged
{
public new event PropertyChangedEventHandler PropertyChanged;
private readonly Manager Manager = (Application.Current as App).Manager;
private CustomTitle currentPlaying;
public CustomTitle CurrentPlaying
{
get => currentPlaying;
set
{
currentPlaying = value;
OnPropertyChanged();
}
}
private string playImage = "play.png";
public string PlayImage
{
get => playImage;
set
{
playImage = value;
OnPropertyChanged();
}
}
private string loopImage = "loop.png";
public string LoopImage
{
get => loopImage;
set
{
loopImage = value;
OnPropertyChanged();
}
}
private string shuffleImage = "rdm.png";
public string ShuffleImage
{
get => shuffleImage;
set
{
shuffleImage = value;
OnPropertyChanged();
}
}
private double volume = 1;
public double Volume
{
get => volume;
set
{
volume = value;
OnPropertyChanged();
}
}
private string position = "00:00:00";
public string Position
{
get => position;
set
{
position = value;
OnPropertyChanged();
}
}
private string duration = "00:00:00";
public string Duration
{
get => duration;
set
{
duration = value;
OnPropertyChanged();
}
}
private double sliderPosition = 0;
public double SliderPosition
{
get => sliderPosition;
set
{
sliderPosition = value;
OnPropertyChanged();
}
}
private readonly Manager manager = (Application.Current as App).Manager;
public Manager Manager
{
get => manager;
}
public FooterPage()
{
InitializeComponent();
BindingContext = Manager.CurrentPlaying;
music.StateChanged += Music_StateChanged;
TimeSlider.ValueChanged += TimeSlider_ValueChanged;
VolumeSlider.ValueChanged += VolumeSlider_ValueChanged;
music.PositionChanged += Music_PositionChanged;
CurrentPlaying = Manager.CurrentPlaying;
BindingContext = this;
}
private void Music_PositionChanged(object sender, EventArgs e)
{
SliderPosition = music.Position.TotalSeconds / music.Duration.TotalSeconds;
Position = music.Position.ToString(@"hh\:mm\:ss");
Duration = music.Duration.ToString(@"hh\:mm\:ss");
}
private void VolumeSlider_ValueChanged(object sender, ValueChangedEventArgs e)
{
Volume = VolumeSlider.Value;
music.Volume = Volume;
}
private void TimeSlider_ValueChanged(object sender, ValueChangedEventArgs e)
{
if ((TimeSlider.Value * music.Duration.TotalSeconds) - music.Position.TotalSeconds <= 1 && (TimeSlider.Value * music.Duration.TotalSeconds) - music.Position.TotalSeconds >= -1)
{
return;
}
TimeSpan PositionTimeSpan = TimeSpan.FromSeconds(TimeSlider.Value * music.Duration.TotalSeconds);
music.SeekTo(PositionTimeSpan);
Position = music.Position.ToString(@"hh\:mm\:ss");
Duration = music.Duration.ToString(@"hh\:mm\:ss");
}
private void Music_StateChanged(object sender, MediaStateChangedEventArgs e)
{
if (music.CurrentState == MediaElementState.Paused || music.CurrentState == MediaElementState.Stopped)
{
PlayImage = "play.png";
}
else
{
PlayImage = "pause.png";
}
}
public void RewindButton_Clicked(object sender, EventArgs e)
{
if (Manager.CurrentPlaylist == null || Manager.CurrentPlaying == null) return;
Manager.PreviousTitle();
CurrentPlaying = Manager.CurrentPlaying;
Dispatcher.DispatchAsync(() =>
{
music.Source = Manager.CurrentPlaying.Path;
music.SeekTo(TimeSpan.FromSeconds(0));
Duration = music.Duration.ToString(@"hh\:mm\:ss");
});
}
@ -31,29 +180,56 @@ public partial class FooterPage : ContentView, INotifyPropertyChanged
{
if (Manager.CurrentPlaylist == null || Manager.CurrentPlaying == null) return;
Manager.NextTitle();
CurrentPlaying = Manager.CurrentPlaying;
Dispatcher.DispatchAsync(() =>
{
music.Source = Manager.CurrentPlaying.Path;
music.SeekTo(TimeSpan.FromSeconds(0));
Duration = music.Duration.ToString(@"hh\:mm\:ss");
});
}
public void ShuffleButton_Clicked(object sender, EventArgs e)
{
Manager.Shuffle();
if (ShuffleImage == "rdm.png")
{
ShuffleImage = "rdm2.png";
} else {
ShuffleImage = "rdm.png";
}
}
public void LoopButton_Clicked(object sender, EventArgs e)
{
Manager.Loop();
if (LoopImage == "loop.png")
{
LoopImage = "loop2.png";
}
else
{
LoopImage = "loop.png";
}
}
public void OnCompleted(object sender, EventArgs e)
{
if (Manager.CurrentPlaying == null) return;
Manager.NextTitle();
Dispatcher.DispatchAsync(() =>
NextButton_Clicked(sender, e);
}
public void PlayButton_Clicked(object sender, EventArgs e)
{
if (music.CurrentState == MediaElementState.Paused || music.CurrentState == MediaElementState.Stopped)
{
music.Source = Manager.CurrentPlaying.Path;
});
music.Play();
}
else
{
music.Pause();
}
}
protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

@ -1,3 +1,4 @@
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Views;
using Model;
@ -27,9 +28,16 @@ public partial class InfoTitlePage : ContentPage
BindingContext = this;
}
protected override void OnAppearing()
{
base.OnAppearing();
GetFooterData();
}
protected override void OnDisappearing()
{
base.OnDisappearing();
SetFooterData();
ContentView footer = this.FindByName<ContentView>("Footer");
var musicElement = footer?.FindByName<MediaElement>("music");
if (musicElement != null)
@ -37,4 +45,50 @@ public partial class InfoTitlePage : ContentPage
musicElement.Stop();
}
}
private void GetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
Footer.CurrentPlaying = FooterPage.CurrentPlaying;
Footer.PlayImage = FooterPage.PlayImage;
Footer.LoopImage = FooterPage.LoopImage;
Footer.ShuffleImage = FooterPage.ShuffleImage;
Footer.Volume = FooterPage.Volume;
Footer.Position = FooterPage.Position;
Footer.Duration = FooterPage.Duration;
Footer.SliderPosition = FooterPage.SliderPosition;
// Place l'index de lecture de la musique à la position du slider
var musicElement = Footer?.FindByName<MediaElement>("music");
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;
});
}
public void SetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
FooterPage.CurrentPlaying = (Application.Current as App).Manager.CurrentPlaying;
FooterPage.PlayImage = Footer.PlayImage;
FooterPage.LoopImage = Footer.LoopImage;
FooterPage.ShuffleImage = Footer.ShuffleImage;
FooterPage.Volume = Footer.Volume;
FooterPage.Position = Footer.Position;
FooterPage.Duration = Footer.Duration;
FooterPage.SliderPosition = Footer.SliderPosition;
var musicElement = Footer?.FindByName<MediaElement>("music");
(Application.Current as App).MusicPosition = musicElement.Position;
(Application.Current as App).MediaState = musicElement.CurrentState;
}
}

@ -11,50 +11,21 @@ public partial class Layout : ContentView
private async void Go_Home(object sender, EventArgs e)
{
StopMusic();
await Navigation.PopToRootAsync();
}
private async void Go_Playlists(object sender, EventArgs e)
{
StopMusic();
await Navigation.PushAsync(new PlaylistsPage());
}
private async void Go_Back(object sender, EventArgs e)
{
StopMusic();
await Navigation.PopAsync();
}
private async void Go_Files(object sender, EventArgs e)
{
StopMusic();
await Navigation.PushAsync(new LocalFilesPage());
}
private void StopMusic()
{
var parentPage = GetParentPage(this);
if (parentPage == null) return;
ContentView footer = parentPage.FindByName<ContentView>("Footer");
var musicElement = footer?.FindByName<MediaElement>("music");
if (musicElement != null)
{
musicElement.Stop();
}
}
private ContentPage GetParentPage(Element element)
{
Element parent = element?.Parent;
while (parent != null)
{
if (parent is ContentPage contentPage)
{
return contentPage;
}
parent = parent.Parent;
}
return null;
}
}

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
@ -30,6 +29,16 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
<PackageCertificateThumbprint>D9EF0E98B2CABE92C87A46ACC4954059B92B6346</PackageCertificateThumbprint>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppInstallerUri>D:\Bureau</AppInstallerUri>
<HoursBetweenUpdateChecks>24</HoursBetweenUpdateChecks>
<DefaultLanguage>fr</DefaultLanguage>
</PropertyGroup>
<ItemGroup>
@ -52,10 +61,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui.MediaElement" Version="1.0.2" />
<PackageReference Include="CommunityToolkit.Maui.MediaElement" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="NAudio" Version="2.1.0" />
<PackageReference Include="Plugin.Maui.Audio" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
@ -81,6 +88,9 @@
<MauiXaml Update="AlbumPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="App.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="EditPlaylistPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
@ -96,6 +106,9 @@
<MauiXaml Update="LocalFilesPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PlaylistPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
@ -123,4 +136,6 @@
<Folder Include="Resources\Musics\" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionLinarisHideInfoBar="True" /></VisualStudio></ProjectExtensions>
</Project>

@ -14,7 +14,7 @@
<Grid Style="{StaticResource GridFlyoutTrigger}" RowDefinitions="*,100">
<local:Layout Grid.Column="0"/>
<ScrollView Grid.Column="1" Grid.Row="0" BackgroundColor="#404040">
<ScrollView Grid.Column="1" Grid.Row="0" BackgroundColor="#404040" x:Name="MainScrollView">
<VerticalStackLayout>
<local:SearchBarView/>
@ -33,19 +33,19 @@
</VerticalStackLayout>
<Grid IsVisible="{Binding IsSubMenuVisible}" BackgroundColor="Grey" HeightRequest="125" WidthRequest="155" Grid.Column="0" RowDefinitions="*,*,*,*">
<Button Grid.Row="0" Text="Jouer" Clicked="Play"/>
<Button Grid.Row="1" Text="Ajouter à une playlist" Clicked="ShowPlaylistMenu"/>
<Button Grid.Row="2" Text="Supprimer" Clicked="RemoveCustomTitle"/>
<Button Grid.Row="3" Text="Changer l'image" Clicked="ChangeImage"/>
<Button Grid.Row="0" Text="Jouer" Clicked="Play" BackgroundColor="DimGrey" Padding="0,2"/>
<Button Grid.Row="1" Text="Ajouter à une playlist" Clicked="ShowPlaylistMenu" BackgroundColor="DimGrey" Padding="0,2"/>
<Button Grid.Row="2" Text="Supprimer" Clicked="RemoveCustomTitle" BackgroundColor="DimGrey" Padding="0,2"/>
<Button Grid.Row="3" Text="Changer l'image" Clicked="ChangeImage" BackgroundColor="DimGrey" Padding="0,2"/>
</Grid>
<ScrollView Grid.Column="1" IsVisible="{Binding IsPlaylistMenuVisible}" BackgroundColor="Grey" WidthRequest="150" HeightRequest="200">
<StackLayout>
<Button Text="+ Nouvelle playlist" TextColor="CornflowerBlue" FontAttributes="Bold" Clicked="ShowNewPlaylistMenu" IsVisible="{Binding IsNewPlaylistMenuVisible, Converter={StaticResource InverseBooleanConverter}}"/>
<Button Padding="0,5" Text="+ Nouvelle playlist" TextColor="CornflowerBlue" FontAttributes="Bold" Clicked="ShowNewPlaylistMenu" IsVisible="{Binding IsNewPlaylistMenuVisible, Converter={StaticResource InverseBooleanConverter}}"/>
<Entry Placeholder="Nom de la playlist" PlaceholderColor="LightGrey" IsVisible="{Binding IsNewPlaylistMenuVisible}" Completed="AddPlaylist"/>
<StackLayout BindableLayout.ItemsSource="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=Playlists}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Button Text="{Binding Name}" Clicked="AddToPlaylist"/>
<Button Text="{Binding Name}" Clicked="AddToPlaylist" Padding="0,5"/>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>

@ -1,7 +1,12 @@
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Views;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Platform;
using Model;
using Model.Stub;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
namespace Linaris;
@ -31,19 +36,19 @@ public partial class LocalFilesPage : ContentPage
void ResetAll(object sender, EventArgs e)
{
ResetSubMenus(sender, e);
ResetSubMenus();
}
void ResetSubMenus(object sender, EventArgs e)
void ResetSubMenus()
{
foreach (var CustomTitle in customTitles)
{
CustomTitle.IsSubMenuVisible = false;
}
ResetPlaylistMenu(sender, e);
ResetPlaylistMenu();
}
void ResetPlaylistMenu(object sender, EventArgs e)
void ResetPlaylistMenu()
{
foreach (CustomTitle customTitle in CustomTitles)
{
@ -87,11 +92,15 @@ public partial class LocalFilesPage : ContentPage
return;
}
if (sender is Button button)
foreach (var result in results)
{
foreach (var result in results)
string path = Path.Combine(FileSystem.Current.AppDataDirectory, "customs");
if (!Path.Exists(path)) Directory.CreateDirectory(path);
string fullPath = Path.Combine(path, result.FileName);
if (!File.Exists(fullPath))
{
CustomTitle custom = new CustomTitle(result.FileName, "none.png", "", result.FullPath);
File.Copy(result.FullPath, fullPath);
CustomTitle custom = new(result.FileName, "none.png", "", fullPath);
if (!IsCustomTitleInCollection(custom))
{
AddCustomTitle(custom);
@ -149,6 +158,8 @@ 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);
}
}
}
@ -156,22 +167,20 @@ public partial class LocalFilesPage : ContentPage
// Show methods
void ShowSubMenu(object sender, EventArgs e)
async void ShowSubMenu(object sender, EventArgs e)
{
if (sender is Image image)
if (sender is Image image && image.BindingContext is CustomTitle customTitle)
{
if (image.BindingContext is CustomTitle customTitle)
if (!customTitle.IsSubMenuVisible)
{
if (!customTitle.IsSubMenuVisible)
{
ResetAll(sender, e);
customTitle.IsSubMenuVisible = true;
}
else
{
ResetSubMenus(sender, e);
}
ResetAll(sender, e);
customTitle.IsSubMenuVisible = true;
}
else
{
ResetSubMenus();
}
await MainScrollView.ScrollToAsync(image, ScrollToPosition.Center, true);
}
}
@ -254,9 +263,17 @@ public partial class LocalFilesPage : ContentPage
return false;
}
protected override void OnAppearing()
{
base.OnAppearing();
GetFooterData();
}
protected override void OnDisappearing()
{
base.OnDisappearing();
ResetSubMenus();
SetFooterData();
ContentView footer = this.FindByName<ContentView>("Footer");
var musicElement = footer?.FindByName<MediaElement>("music");
if (musicElement != null)
@ -265,6 +282,55 @@ public partial class LocalFilesPage : ContentPage
}
}
private void GetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
Footer.CurrentPlaying = FooterPage.CurrentPlaying;
Footer.PlayImage = FooterPage.PlayImage;
Footer.LoopImage = FooterPage.LoopImage;
Footer.ShuffleImage = FooterPage.ShuffleImage;
Footer.Volume = FooterPage.Volume;
Footer.Position = FooterPage.Position;
Footer.Duration = FooterPage.Duration;
Footer.SliderPosition = FooterPage.SliderPosition;
// Place l'index de lecture de la musique à la position du slider
var musicElement = Footer?.FindByName<MediaElement>("music");
musicElement.Dispatcher.StartTimer(TimeSpan.FromMilliseconds(1000), () =>
{
musicElement.SeekTo((Application.Current as App).MusicPosition);
if ((Application.Current as App).MediaState == MediaElementState.Playing)
{
musicElement.Play();
}
else
{
musicElement.Pause();
}
return false;
});
}
public void SetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
FooterPage.CurrentPlaying = (Application.Current as App).Manager.CurrentPlaying;
FooterPage.PlayImage = Footer.PlayImage;
FooterPage.LoopImage = Footer.LoopImage;
FooterPage.ShuffleImage = Footer.ShuffleImage;
FooterPage.Volume = Footer.Volume;
FooterPage.Position = Footer.Position;
FooterPage.Duration = Footer.Duration;
FooterPage.SliderPosition = Footer.SliderPosition;
var musicElement = Footer?.FindByName<MediaElement>("music");
(Application.Current as App).MusicPosition = musicElement.Position;
(Application.Current as App).MediaState = musicElement.CurrentState;
}
// Others
private void Play(object sender, EventArgs e)
{
if (sender is Button button && button.BindingContext is CustomTitle customTitle)
@ -275,7 +341,15 @@ public partial class LocalFilesPage : ContentPage
if (musicElement != null)
{
musicElement.Source = customTitle.Path;
musicElement.SeekTo(TimeSpan.FromSeconds(0));
musicElement.Play();
}
if (footer is FooterPage footerPage)
{
footerPage.CurrentPlaying = customTitle;
}
(Application.Current as App).Manager.CurrentPlaylist = null;
(Application.Current as App).Manager.CurrentPlaying = customTitle;
}
}
}

@ -1,4 +1,5 @@
using CommunityToolkit.Maui.Views;
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Views;
using Model;
using System.Collections.ObjectModel;
@ -7,7 +8,7 @@ namespace Linaris;
public partial class MainPage : ContentPage
{
private readonly ObservableCollection<Album> albums = (Application.Current as App).Manager.GetAlbums();
private readonly ObservableCollection<Album> albums;
public ObservableCollection<Album> Albums
{
@ -17,24 +18,29 @@ public partial class MainPage : ContentPage
public MainPage()
{
InitializeComponent();
BindingContext = this;
albums = (Application.Current as App).Manager.GetAlbums();
BindingContext = this;
}
async void GoToAlbum(object sender, EventArgs e)
async void GoToAlbum(object sender, EventArgs e)
{
if (sender is Image image)
if (sender is Image image && image.BindingContext is Album album)
{
if (image.BindingContext is Album album)
{
(Application.Current as App).Manager.CurrentAlbum = album;
await Navigation.PushAsync(new AlbumPage());
}
(Application.Current as App).Manager.CurrentAlbum = album;
await Navigation.PushAsync(new AlbumPage());
}
}
protected override void OnAppearing()
{
base.OnAppearing();
GetFooterData();
}
protected override void OnDisappearing()
{
base.OnDisappearing();
SetFooterData();
ContentView footer = this.FindByName<ContentView>("Footer");
var musicElement = footer?.FindByName<MediaElement>("music");
if (musicElement != null)
@ -42,5 +48,51 @@ public partial class MainPage : ContentPage
musicElement.Stop();
}
}
private void GetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
Footer.CurrentPlaying = FooterPage.CurrentPlaying;
Footer.PlayImage = FooterPage.PlayImage;
Footer.LoopImage = FooterPage.LoopImage;
Footer.ShuffleImage = FooterPage.ShuffleImage;
Footer.Volume = FooterPage.Volume;
Footer.Position = FooterPage.Position;
Footer.Duration = FooterPage.Duration;
Footer.SliderPosition = FooterPage.SliderPosition;
// Place l'index de lecture de la musique à la position du slider
var musicElement = Footer?.FindByName<MediaElement>("music");
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;
});
}
public void SetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
FooterPage.CurrentPlaying = (Application.Current as App).Manager.CurrentPlaying;
FooterPage.PlayImage = Footer.PlayImage;
FooterPage.LoopImage = Footer.LoopImage;
FooterPage.ShuffleImage = Footer.ShuffleImage;
FooterPage.Volume = Footer.Volume;
FooterPage.Position = Footer.Position;
FooterPage.Duration = Footer.Duration;
FooterPage.SliderPosition = Footer.SliderPosition;
var musicElement = Footer?.FindByName<MediaElement>("music");
(Application.Current as App).MusicPosition = musicElement.Position;
(Application.Current as App).MediaState = musicElement.CurrentState;
}
}

@ -6,7 +6,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<Identity Name="maui-package-name-placeholder" Publisher="CN=coren" Version="0.0.3.0" />
<mp:PhoneIdentity PhoneProductId="FAE74902-2FAE-40B1-9171-6989A858C6A6" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

@ -22,9 +22,9 @@
<Label Text="{Binding Description}" Style="{StaticResource SousTitre}"/>
<Grid BackgroundColor="Transparent" MinimumHeightRequest="0" Margin="0,20,0,0">
<FlexLayout Direction="Row" AlignItems="Center" JustifyContent="SpaceEvenly" Wrap="Wrap">
<Button Text="Aléatoire" Style="{StaticResource PlayButton}" Clicked="RdmPlay"/>
<Button Text="Lecture" Style="{StaticResource PlayButton}" Clicked="Play"/>
<Button Text="Modifier" Style="{StaticResource PlayButton}" Clicked="EditPlaylist"/>
<Button Text="Aléatoire" Style="{StaticResource PlayButton}" Clicked="RdmPlay" Padding="10,5"/>
<Button Text="Lecture" Style="{StaticResource PlayButton}" Clicked="Play" Padding="10,5"/>
<Button Text="Modifier" Style="{StaticResource PlayButton}" Clicked="EditPlaylist" Padding="10,5"/>
</FlexLayout>
</Grid>
@ -35,8 +35,8 @@
<ViewCell.ContextActions>
<MenuItem Text="Supprimer" Clicked="RemoveCustomTitle"/>
</ViewCell.ContextActions>
<Frame Style="{StaticResource Song}">
<Label Text="{Binding Name}" FontSize="20" TextColor="white" HorizontalTextAlignment="Center"/>
<Frame Style="{StaticResource Song}" Padding="0">
<Label Text="{Binding Name}" FontSize="20" TextColor="white" HorizontalTextAlignment="Center" VerticalOptions="Center" LineBreakMode="TailTruncation"/>
</Frame>
</ViewCell>
</DataTemplate>

@ -1,3 +1,4 @@
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Views;
using Model;
using Model.Stub;
@ -45,6 +46,12 @@ public partial class PlaylistPage : ContentPage
{
if (Manager.CurrentPlaying == null) return;
musicElement.Source = Manager.CurrentPlaying.Path;
musicElement.SeekTo(TimeSpan.FromSeconds(0));
musicElement.Play();
}
if (footer is FooterPage footerPage)
{
footerPage.CurrentPlaying = Manager.CurrentPlaying;
}
}
}
@ -65,14 +72,28 @@ public partial class PlaylistPage : ContentPage
{
if (Manager.CurrentPlaying == null) return;
musicElement.Source = Manager.CurrentPlaying.Path;
musicElement.SeekTo(TimeSpan.FromSeconds(0));
musicElement.Play();
if (footer is FooterPage footerPage)
{
footerPage.ShuffleImage = "rdm2.png";
footerPage.CurrentPlaying = (Application.Current as App).Manager.CurrentPlaying;
}
}
}
}
}
protected override void OnAppearing()
{
base.OnAppearing();
GetFooterData();
}
protected override void OnDisappearing()
{
base.OnDisappearing();
SetFooterData();
ContentView footer = this.FindByName<ContentView>("Footer");
var musicElement = footer?.FindByName<MediaElement>("music");
if (musicElement != null)
@ -80,4 +101,50 @@ public partial class PlaylistPage : ContentPage
musicElement.Stop();
}
}
private void GetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
Footer.CurrentPlaying = FooterPage.CurrentPlaying;
Footer.PlayImage = FooterPage.PlayImage;
Footer.LoopImage = FooterPage.LoopImage;
Footer.ShuffleImage = FooterPage.ShuffleImage;
Footer.Volume = FooterPage.Volume;
Footer.Position = FooterPage.Position;
Footer.Duration = FooterPage.Duration;
Footer.SliderPosition = FooterPage.SliderPosition;
// Place l'index de lecture de la musique à la position du slider
var musicElement = Footer?.FindByName<MediaElement>("music");
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;
});
}
public void SetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
FooterPage.CurrentPlaying = (Application.Current as App).Manager.CurrentPlaying;
FooterPage.PlayImage = Footer.PlayImage;
FooterPage.LoopImage = Footer.LoopImage;
FooterPage.ShuffleImage = Footer.ShuffleImage;
FooterPage.Volume = Footer.Volume;
FooterPage.Position = Footer.Position;
FooterPage.Duration = Footer.Duration;
FooterPage.SliderPosition = Footer.SliderPosition;
var musicElement = Footer?.FindByName<MediaElement>("music");
(Application.Current as App).MusicPosition = musicElement.Position;
(Application.Current as App).MediaState = musicElement.CurrentState;
}
}

@ -1,3 +1,4 @@
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Views;
using Model;
using System.Collections.ObjectModel;
@ -114,9 +115,16 @@ public partial class PlaylistsPage : ContentPage
await Navigation.PushAsync(new PlaylistPage());
}
protected override void OnAppearing()
{
base.OnAppearing();
GetFooterData();
}
protected override void OnDisappearing()
{
base.OnDisappearing();
SetFooterData();
ContentView footer = this.FindByName<ContentView>("Footer");
var musicElement = footer?.FindByName<MediaElement>("music");
if (musicElement != null)
@ -124,4 +132,50 @@ public partial class PlaylistsPage : ContentPage
musicElement.Stop();
}
}
private void GetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
Footer.CurrentPlaying = FooterPage.CurrentPlaying;
Footer.PlayImage = FooterPage.PlayImage;
Footer.LoopImage = FooterPage.LoopImage;
Footer.ShuffleImage = FooterPage.ShuffleImage;
Footer.Volume = FooterPage.Volume;
Footer.Position = FooterPage.Position;
Footer.Duration = FooterPage.Duration;
Footer.SliderPosition = FooterPage.SliderPosition;
// Place l'index de lecture de la musique à la position du slider
var musicElement = Footer?.FindByName<MediaElement>("music");
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;
});
}
public void SetFooterData()
{
FooterPage FooterPage = (Application.Current as App).FooterPage;
FooterPage.CurrentPlaying = (Application.Current as App).Manager.CurrentPlaying;
FooterPage.PlayImage = Footer.PlayImage;
FooterPage.LoopImage = Footer.LoopImage;
FooterPage.ShuffleImage = Footer.ShuffleImage;
FooterPage.Volume = Footer.Volume;
FooterPage.Position = Footer.Position;
FooterPage.Duration = Footer.Duration;
FooterPage.SliderPosition = Footer.SliderPosition;
var musicElement = Footer?.FindByName<MediaElement>("music");
(Application.Current as App).MusicPosition = musicElement.Position;
(Application.Current as App).MediaState = musicElement.CurrentState;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@ -361,6 +361,100 @@
</Setter>
</Style>
<Style TargetType="Label" x:Key="FooterTitleTrigger">
<Setter Property="VisualStateManager.VisualStateGroups">
<Setter.Value>
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Narrow">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Grid.RowSpan" Value="1"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="600"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Grid.RowSpan" Value="2"/>
<Setter Property="FontSize" Value="30"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="VerticalStackLayout" x:Key="FooterVolumeTrigger">
<Setter Property="VisualStateManager.VisualStateGroups">
<Setter.Value>
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Narrow">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Grid.RowSpan" Value="1"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="600"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Grid.RowSpan" Value="2"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Grid" x:Key="FooterSliderTrigger">
<Setter Property="VisualStateManager.VisualStateGroups">
<Setter.Value>
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Narrow">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Grid.ColumnSpan" Value="3"/>
<Setter Property="Grid.Column" Value="0"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="600"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Grid.ColumnSpan" Value="1"/>
<Setter Property="Grid.Column" Value="1"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ImageButton" x:Key="FooterButton">
<Setter Property="Margin" Value="0,10,8,10"/>
<Setter Property="WidthRequest" Value="25"/>
@ -391,27 +485,11 @@
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
</Style>
<!--<Style TargetType="Button">
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Blue200Accent}}" />
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Blue200Accent}, Dark={StaticResource White}}" />
<Setter Property="FontFamily" Value="OpenSansRegular"/>
<Setter Property="FontSize" Value="14"/>
<Style TargetType="Button">
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="14,10"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>-->
<Setter Property="BackgroundColor" Value="DimGrey"/>
<Setter Property="Padding" Value="0,2"/>
</Style>
<Style TargetType="CheckBox">
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />

@ -11,38 +11,11 @@ public partial class SearchBarView : ContentView
{
Manager Manager { get; set; } = (Application.Current as App).Manager;
private ObservableCollection<Album> albums = new ObservableCollection<Album>();
public ObservableCollection<Album> Albums { get; set; } = new();
public ObservableCollection<Album> Albums
{
get => albums;
set
{
albums = value;
}
}
public ObservableCollection<InfoTitle> InfoTitles { get; set; } = new();
private ObservableCollection<InfoTitle> infoTitles = new ObservableCollection<InfoTitle>();
public ObservableCollection<InfoTitle> InfoTitles
{
get => infoTitles;
set
{
infoTitles = value;
}
}
private ObservableCollection<Playlist> playlists = new ObservableCollection<Playlist>();
public ObservableCollection<Playlist> Playlists
{
get => playlists;
set
{
playlists = value;
}
}
public ObservableCollection<Playlist> Playlists { get; set; } = new();
public SearchBarView()
{

@ -3,11 +3,15 @@ using System.Collections.ObjectModel;
namespace Model
{
/// <remarks>
/// Classe Album
/// </remarks>
public class Album
{
private static long nbAlbum = 0;
private long id;
private readonly long id;
public long ID
{
@ -85,43 +89,64 @@ namespace Model
private string information = Manager.DEFAULT_DESC;
public ObservableCollection<InfoTitle> InfoTitles
{
get => infoTitles;
set
{
infoTitles = value;
}
}
private ObservableCollection<InfoTitle> infoTitles = new ObservableCollection<InfoTitle>();
public ObservableCollection<InfoTitle> InfoTitles { get; set; } = new();
/// <summary>
/// Constructeur de la classe Album
/// </summary>
/// <param name="name">Nom de l'Album</param>
/// <param name="imageURL">Chemin d'accès de l'image de l'Album</param>
/// <param name="artist">Artiste de l'Album</param>
/// <param name="description">Description de l'Album</param>
/// <param name="information">Informations complémentaires sur un Album</param>
public Album(string name, string imageURL, Artist artist, string description, string information)
{
id = nbAlbum;
nbAlbum++;
IncrementNbAlbum();
Name = name;
ImageURL = imageURL;
Artist = artist;
Description = description;
Information = information;
}
/// <summary>
/// Constructeur par défaut de la classe Album
/// </summary>
public Album()
{
Artist = new Artist(Manager.DEFAULT_NAME);
IncrementNbAlbum();
}
public static void IncrementNbAlbum()
{
nbAlbum++;
}
/// <summary>
/// Permet d'ajouter l'InfoTitle passé en paramètre à la liste
/// </summary>
/// <param name="title">Titre à rajouter à l'album</param>
public void AddTitle(InfoTitle title)
{
infoTitles.Add(title);
InfoTitles.Add(title);
}
/// <summary>
/// Permet de supprimer l'InfoTitle passé en paramètre si il est présent dans la liste
/// </summary>
/// <param name="title">Titre à supprimer de l'album</param>
public void RemoveTitle(InfoTitle title)
{
infoTitles.Remove(title);
InfoTitles.Remove(title);
}
/// <summary>
/// Fonction qui permet de déterminer si deux objets Album sont égaux
/// </summary>
/// <param name="obj">Objet comparé à l'album actuel</param>
/// <returns>Un booléen indiquant si l'objet est égal</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
@ -130,11 +155,19 @@ namespace Model
else return false;
}
/// <summary>
/// Permet de déterminer le hash d'un objet Album
/// </summary>
/// <returns>Hash de l'attribut Name</returns>
public override int GetHashCode()
{
return ImageURL.GetHashCode();
return Name.GetHashCode();
}
/// <summary>
/// Permet de convertir un objet Album en string
/// </summary>
/// <returns>Une nouvelle chaîne caractères contenant le nom de l'Album et le nom de l'Artist</returns>
public override string ToString()
{
return $"Name : {Name}, Artist : {Artist}";

@ -1,50 +1,75 @@
using Model.Stub;
using System.Xml.Serialization;
namespace Model;
public class Artist
namespace Model
{
public string Name
/// <remarks>
/// Classe Artist
/// </remarks>
public class Artist
{
get => name;
set
public string Name
{
if (value != null && value.Length < Manager.MAX_NAME_LENGTH)
get => name;
set
{
name = value;
if (value != null && value.Length < Manager.MAX_NAME_LENGTH)
{
name = value;
}
}
}
}
private string name = Manager.DEFAULT_NAME;
private string name = Manager.DEFAULT_NAME;
public Artist(string name)
{
Name = name;
}
/// <summary>
/// Constructeur de la classe Artist
/// </summary>
/// <param name="name">Nom de l'artiste</param>
public Artist(string name)
{
Name = name;
}
public Artist()
{
/// <summary>
/// Constructeur par défaut de la classe Artist
/// </summary>
public Artist()
{
}
}
public override bool Equals(object obj)
{
if(obj == null) return false;
if(obj.GetType() != typeof(Artist)) return false;
if(obj is Artist artist && Name == artist.Name) return true;
else return false;
}
/// <summary>
/// Fonction qui permet de déterminer si deux objets Artist sont égaux
/// </summary>
/// <param name="obj"></param>
/// <returns>Un booléen indiquant si l'objet est égal</returns>
public override bool Equals(object obj)
{
if (obj == null) return false;
if (obj.GetType() != typeof(Artist)) return false;
if (obj is Artist artist && Name == artist.Name) return true;
else return false;
}
public override int GetHashCode()
{
return Name.GetHashCode();
}
/// <summary>
/// Permet de déterminer le hash d'un objet Artist
/// </summary>
/// <returns>Hash de l'attribut Name</returns>
public override int GetHashCode()
{
return Name.GetHashCode();
}
public override string ToString()
{
return $"{Name}";
/// <summary>
/// Permet de convertir un objet Artist en string
/// </summary>
/// <returns>Une nouvelle chaîne caractères contenant le nom de l'Artist</returns>
public override string ToString()
{
return $"{Name}";
}
}
}
}

@ -1,98 +1,119 @@
using Model.Stub;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Model;
public class CustomTitle : Title, INotifyPropertyChanged
namespace Model
{
public string Path
/// <remarks>
/// Classe CustomTitle
/// </remarks>
public class CustomTitle : Title
{
get => path;
set
public string Path
{
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
get => path;
set
{
path = value;
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
{
path = value;
}
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private string path = Manager.DEFAULT_URL;
private string path = Manager.DEFAULT_URL;
public bool IsSubMenuVisible
{
get => isSubMenuVisible;
set
public bool IsSubMenuVisible
{
if (isSubMenuVisible != value)
get => isSubMenuVisible;
set
{
isSubMenuVisible = value;
if (isSubMenuVisible != value)
{
isSubMenuVisible = value;
}
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private bool isSubMenuVisible = false;
private bool isSubMenuVisible = false;
public bool IsPlaylistMenuVisible
{
get => isPlaylistMenuVisible;
set
public bool IsPlaylistMenuVisible
{
if (isPlaylistMenuVisible != value)
get => isPlaylistMenuVisible;
set
{
isPlaylistMenuVisible = value;
if (isPlaylistMenuVisible != value)
{
isPlaylistMenuVisible = value;
}
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private bool isPlaylistMenuVisible = false;
private bool isPlaylistMenuVisible = false;
public bool IsNewPlaylistMenuVisible
{
get => isNewPlaylistMenuVisible;
set
public bool IsNewPlaylistMenuVisible
{
if (isNewPlaylistMenuVisible != value)
get => isNewPlaylistMenuVisible;
set
{
isNewPlaylistMenuVisible = value;
if (isNewPlaylistMenuVisible != value)
{
isNewPlaylistMenuVisible = value;
}
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private bool isNewPlaylistMenuVisible = false;
public CustomTitle(string name, string imageURL, string information, string path) : base(name, imageURL, information)
{
Path = path;
}
public CustomTitle() : base(Manager.DEFAULT_NAME, Manager.DEFAULT_URL, Manager.DEFAULT_DESC) { }
private bool isNewPlaylistMenuVisible = false;
public bool Equals(CustomTitle other)
=> Path.Equals(other?.Path);
/// <summary>
/// Constructeur de la classe Album
/// </summary>
/// <param name="name">Nom du CustomTitle</param>
/// <param name="imageURL">Chemin d'accès de l'image du CustomTitle</param>
/// <param name="information">Informations sur un CustomTitle</param>
/// <param name="path">Chemin d'accès du CustomTitle</param>
public CustomTitle(string name, string imageURL, string information, string path) : base(name, imageURL, information)
{
Path = path;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(obj, null)) return false;
if (ReferenceEquals(this, obj)) return true;
if (GetType() != obj.GetType()) return false;
return Equals(obj as CustomTitle);
}
/// <summary>
/// Constructeur par défaut de la classe CustomTitle
/// </summary>
public CustomTitle() : base(Manager.DEFAULT_NAME, Manager.DEFAULT_URL, Manager.DEFAULT_DESC) { }
/// <summary>
/// Fonction qui permet de déterminer si deux objets CustomTitle sont égaux selon leurs chemin d'accès
/// </summary>
/// <param name="obj"></param>
/// <returns>Un booléen indiquant si l'objet est égal</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(CustomTitle)) return false;
if (obj is CustomTitle custom && Path == custom.Path) return true;
else return false;
}
public override int GetHashCode()
{
return ImageURL.GetHashCode();
}
/// <summary>
/// Permet de déterminer le hash d'un objet CustomTitle
/// </summary>
/// <returns>Hash de l'attribut Path</returns>
public override int GetHashCode()
{
return Path.GetHashCode();
}
public override string ToString()
{
return $"Name : {Name}, Path : {Path}";
/// <summary>
/// Permet de convertir un objet CustomTitle en string
/// </summary>
/// <returns>Une nouvelle chaîne caractères contenant le nom du CustomTitle et le chemin d'accès</returns>
public override string ToString()
{
return $"Name : {Name}, Path : {Path}";
}
}
}
}

@ -1,7 +1,11 @@
namespace Model;
public enum Genre
namespace Model
{
HIP_HOP, POP, ROCK, ELECTRO, CLASSIQUE, JAZZ, VARIETE_FRANCAISE, VARIETE_INTERNATIONALE, REGGAE, RAP, RNB, DISCO, BLUES, COUNTRY, FUNK, GOSPEL,
METAL, K_POP
}
/// <remarks>
/// Enum des diffénres genres référencés.
/// </remarks>
public enum Genre
{
HIP_HOP, POP, ROCK, ELECTRO, CLASSIQUE, JAZZ, VARIETE_FRANCAISE, VARIETE_INTERNATIONALE, REGGAE, RAP, RNB, DISCO, BLUES, COUNTRY, FUNK, GOSPEL,
METAL, K_POP
}
}

@ -1,123 +1,422 @@
using System.Collections.ObjectModel;
namespace Model;
public interface IDataManager
namespace Model
{
// Create
void AddAlbum(Album album);
void AddAlbums(List<Album> albumsList);
void AddArtist(Artist artist);
void AddArtists(List<Artist> artistsList);
void AddPlaylist(Playlist playlist);
void AddPlaylists(List<Playlist> playlistsList);
void AddCustomTitle(CustomTitle title);
void AddCustomTitles(List<CustomTitle> customTitlesList);
void AddInfoTitle(InfoTitle title);
void AddInfoTitles(List<InfoTitle> infoTitlesList);
// Read
ObservableCollection<CustomTitle> GetCustomTitles();
CustomTitle GetCustomTitleByPath(string custom);
ObservableCollection<InfoTitle> GetInfoTitles();
InfoTitle GetInfoTitleByName(string name);
ObservableCollection<Album> GetAlbums();
Album GetAlbumByName(string name);
Album GetAlbumById(long id);
List<Artist> GetArtists();
Artist GetArtistByName(string name);
ObservableCollection<Playlist> GetPlaylists();
Playlist GetPlaylistByName(string name);
// Update
void UpdateCustomTitle(CustomTitle title, string name, string url, string info, string path);
void UpdateCustomTitleByPath(string path, string name, string newUrl, string info, string newPath);
void UpdateInfoTitle(InfoTitle title, string name, string url, string info, Artist artist, string description, Genre genre);
void UpdateInfoTitleByName(string name, string newUrl, string info, Artist artist, string description, Genre genre);
void UpdateAlbum(Album album, string name, string url, Artist artist, string description, string info);
void UpdateAlbumByName(string name, string newUrl, Artist artist, string description, string info);
void UpdateAlbumByArtistName(Album album, string name, string url, string artist, string description, string info);
void UpdateAlbumByNameByArtistName(string name, string newUrl, string artist, string description, string info);
void UpdatePlaylist(Playlist playlist, string name, string description, string url);
void UpdatePlaylistByName(string name, string description, string newUrl);
void UpdateArtist(Artist artist, string name);
void UpdateArtistByName(string name, string newName);
// Delete
void RemoveAlbum(Album album);
void RemoveAlbums(List<Album> albumsList);
void RemoveArtist(Artist artist);
void RemoveArtists(List<Artist> artistsList);
void RemovePlaylist(Playlist playlist);
void RemovePlaylists(List<Playlist> playlistsList);
void RemoveCustomTitle(CustomTitle title);
void RemoveCustomTitles(List<CustomTitle> customTitlesList);
void RemoveInfoTitle(InfoTitle title);
void RemoveInfoTitles(List<InfoTitle> infoTitlesList);
// Serialization
void LoadSerialization();
void SaveSerialization();
// Exists
bool ExistsPlaylist(Playlist playlist);
bool ExistsPlaylistByName(string name);
bool ExistsAlbum(Album album);
bool ExistsAlbumByName(string name);
bool ExistsArtist(Artist artist);
bool ExistsArtistByName(string name);
bool ExistsCustomTitle(CustomTitle title);
bool ExistsCustomTitleByName(string name);
bool ExistsInfoTitle(InfoTitle title);
bool ExistsInfoTitleByName(string name);
public interface IDataManager
{
// Create
/// <summary>
/// Permet d'ajouter un objet Album à l'application
/// </summary>
/// <param name="album">Album à ajouter</param>
void AddAlbum(Album album);
/// <summary>
/// Permet d'ajouter des objets Album à l'application
/// </summary>
/// <param name="albumsList">Liste d'Album à ajouter</param>
void AddAlbums(List<Album> albumsList);
/// <summary>
/// Permet d'ajouter un objet Artist à l'application
/// </summary>
/// <param name="artist">Artist à ajouter</param>
void AddArtist(Artist artist);
/// <summary>
/// Permet d'ajouter des objets Artist à l'application
/// </summary>
/// <param name="artistsList">Liste d'Artist à ajouter</param>
void AddArtists(List<Artist> artistsList);
/// <summary>
/// Permet d'ajouter un objet Playlist à l'application
/// </summary>
/// <param name="playlist">Playlist à ajouter</param>
void AddPlaylist(Playlist playlist);
/// <summary>
/// Permet d'ajouter des objets Playlist à l'application
/// </summary>
/// <param name="playlistsList">Liste de Playlist à ajouter</param>
void AddPlaylists(List<Playlist> playlistsList);
/// <summary>
/// Permet d'ajouter un objet CustomTitle à l'application
/// </summary>
/// <param name="title">CustomTitle à ajouter</param>
void AddCustomTitle(CustomTitle title);
/// <summary>
/// Permet d'ajouter des objets CustomTitle à l'application
/// </summary>
/// <param name="customTitlesList">Liste de CustomTitle à ajouter</param>
void AddCustomTitles(List<CustomTitle> customTitlesList);
/// <summary>
/// Permet d'ajouter un objet InfoTitle à l'application
/// </summary>
/// <param name="title">InfoTitle à ajouter</param>
void AddInfoTitle(InfoTitle title);
/// <summary>
/// Permet d'ajouter des objets InfoTitle à l'application
/// </summary>
/// <param name="infoTitlesList">Liste d'InfoTitle à ajouter</param>
void AddInfoTitles(List<InfoTitle> infoTitlesList);
// Read
/// <summary>
/// Permet d'obtenir une liste d'objets CustomTitle
/// </summary>
/// <returns>Retourne une liste d'objets CustomTitle</returns>
ObservableCollection<CustomTitle> GetCustomTitles();
/// <summary>
/// Permet d'obtenir un objet CustomTitle à partir de son chemin d'accès
/// </summary>
/// <param name="custom">Chemin d'accès de l'objet CustomTitle</param>
/// <returns>Retourne l'objet CustomTitle avec un chemin d'accès équivalent à celui donné en paramètre</returns>
CustomTitle GetCustomTitleByPath(string custom);
/// <summary>
/// Permet d'obtenir une liste d'objets InfoTitle
/// </summary>
/// <returns>Retourne une liste d'objets InfoTitle</returns>
ObservableCollection<InfoTitle> GetInfoTitles();
/// <summary>
/// Permet d'obtenir un objet InfoTitle à partir de son nom
/// </summary>
/// <param name="name">Nom de l'objet InfoTitle</param>
/// <returns>Retourne l'objet InfoTitle avec un nom équivalent à celui donné en paramètre</returns>
InfoTitle GetInfoTitleByName(string name);
/// <summary>
/// Permet d'obtenir une liste d'objets Album
/// </summary>
/// <returns>Retourne une liste d'objets Album</returns>
ObservableCollection<Album> GetAlbums();
/// <summary>
/// Permet d'obtenir un objet Album à partir de son nom
/// </summary>
/// <param name="name">Nom de l'objet Album</param>
/// <returns>Retourne l'objet Album avec un nom équivalent à celui donné en paramètre</returns>
Album GetAlbumByName(string name);
/// <summary>
/// Permet d'obtenir un objet Album à partir de son ID
/// </summary>
/// <param name="id">ID de l'objet Album</param>
/// <returns>Retourne l'objet Album avec un ID équivalent à celui donné en paramètre</returns>
Album GetAlbumById(long id);
/// <summary>
/// Permet d'obtenir une liste d'objets Artist
/// </summary>
/// <returns>Retourne une liste d'objets Artist</returns>
List<Artist> GetArtists();
/// <summary>
/// Permet d'obtenir un objet Artist à partir de son nom
/// </summary>
/// <param name="name">Nom de l'objet Artist</param>
/// <returns>Retourne l'objet Artist avec un nom équivalent à celui donné en paramètre</returns>
Artist GetArtistByName(string name);
/// <summary>
/// Permet d'obtenir une liste d'objets Playlist
/// </summary>
/// <returns>Retourne une liste d'objets Playlist</returns>
ObservableCollection<Playlist> GetPlaylists();
/// <summary>
/// Permet d'obtenir un objet Playlist à partir de son nom
/// </summary>
/// <param name="name">Nom de l'objet Playlist</param>
/// <returns>Retourne l'objet Playlist avec un nom équivalent à celui donné en paramètre</returns>
Playlist GetPlaylistByName(string name);
// Update
/// <summary>
/// Modifie un objet CustomTitle avec les informations données en paramètre
/// </summary>
/// <param name="title">CustomTitle à modifier</param>
/// <param name="name">Nom de l'objet CustomTitle</param>
/// <param name="url">Chemin d'accès de l'image de l'objet CustomTitle</param>
/// <param name="info">Informations de l'objet CustomTitle</param>
/// <param name="path">Chemin d'accès de l'objet CustomTitle</param>
void UpdateCustomTitle(CustomTitle title, string name, string url, string info, string path);
/// <summary>
/// Modifie un objet CustomTitle avec les informations données en paramètre
/// </summary>
/// <param name="path">Chemin d'accès du CustomTitle à modifier</param>
/// <param name="name">Nom de l'objet CustomTitle</param>
/// <param name="newUrl">Chemin d'accès de l'image de l'objet CustomTitle</param>
/// <param name="info">Informations de l'objet CustomTitle</param>
/// <param name="newPath">Chemin d'accès de l'objet CustomTitle</param>
void UpdateCustomTitleByPath(string path, string name, string newUrl, string info, string newPath);
/// <summary>
/// Modifie un objet InfoTitle avec les informations données en paramètre
/// </summary>
/// <param name="title">InfoTitle à modifier</param>
/// <param name="name">Nom de l'objet InfoTitle</param>
/// <param name="url">Chemin d'accès de l'image de l'objet InfoTitle</param>
/// <param name="info">Informations de l'objet InfoTitle</param>
/// <param name="artist">Artist de l'objet InfoTitle</param>
/// <param name="description">Description de l'objet InfoTitle</param>
/// <param name="genre">Genre de l'objet InfoTitle</param>
void UpdateInfoTitle(InfoTitle title, string name, string url, string info, Artist artist, string description, Genre genre);
/// <summary>
/// Modifie un objet InfoTitle avec les informations données en paramètre
/// </summary>
/// <param name="name">Nom de l'objet InfoTitle à modifier</param>
/// <param name="newUrl">Chemin d'accès de l'image de l'objet InfoTitle</param>
/// <param name="info">Informations de l'objet InfoTitle</param>
/// <param name="artist">Artist de l'objet InfoTitle</param>
/// <param name="description">Description de l'objet InfoTitle</param>
/// <param name="genre">Genre de l'objet InfoTitle</param>
void UpdateInfoTitleByName(string name, string newUrl, string info, Artist artist, string description, Genre genre);
/// <summary>
/// Modifie un objet Album avec les informations données en paramètre
/// </summary>
/// <param name="album">Album à modifier</param>
/// <param name="name">Nom de l'objet Album</param>
/// <param name="url">Chemin d'accès de l'image de l'objet Album</param>
/// <param name="artist">Artist de l'objet Album</param>
/// <param name="description">Description de l'objet Album</param>
/// <param name="info">Informations de l'objet Album</param>
void UpdateAlbum(Album album, string name, string url, Artist artist, string description, string info);
/// <summary>
/// Modifie un objet Album avec les informations données en paramètre
/// </summary>
/// <param name="name">Nom de l'objet Album à modifier</param>
/// <param name="newUrl">Chemin d'accès de l'image de l'objet Album</param>
/// <param name="artist">Artist de l'objet Album</param>
/// <param name="description">Description de l'objet Album</param>
/// <param name="info">Informations de l'objet Album</param>
void UpdateAlbumByName(string name, string newUrl, Artist artist, string description, string info);
/// <summary>
/// Modifie un objet Album avec les informations données en paramètre
/// </summary>
/// <param name="album">Album à modifier</param>
/// <param name="name">Nom de l'objet Album</param>
/// <param name="url">Chemin d'accès de l'image de l'objet Album</param>
/// <param name="artist">Nom de l'artiste de l'objet Album</param>
/// <param name="description">Description de l'objet Album</param>
/// <param name="info">Informations de l'objet Album</param>
void UpdateAlbumByArtistName(Album album, string name, string url, string artist, string description, string info);
/// <summary>
/// Modifie un objet Album avec les informations données en paramètre
/// </summary>
/// <param name="name">Nom de l'objet Album à modifier</param>
/// <param name="newUrl">Chemin d'accès de l'image de l'objet Album</param>
/// <param name="artist">Nom de l'artiste de l'objet Album</param>
/// <param name="description">Description de l'objet Album</param>
/// <param name="info">Informations de l'objet Album</param>
void UpdateAlbumByNameByArtistName(string name, string newUrl, string artist, string description, string info);
/// <summary>
/// Modifie un objet Playlist avec les informations données en paramètre
/// </summary>
/// <param name="playlist">Playlist à modifier</param>
/// <param name="name">Nom de l'objet Playlist</param>
/// <param name="description">Description de l'objet Playlist</param>
/// <param name="url">Chemin d'accès de l'image de l'objet Playlist</param>
void UpdatePlaylist(Playlist playlist, string name, string description, string url);
/// <summary>
/// Modifie un objet Playlist avec les informations données en paramètre
/// </summary>
/// <param name="name">Nom de l'objet Playlist à modifier</param>
/// <param name="description">Description de l'objet Playlist</param>
/// <param name="newUrl">Chemin d'accès de l'image de l'objet Playlist</param>
void UpdatePlaylistByName(string name, string description, string newUrl);
/// <summary>
/// Modifie un objet Artist avec les informations données en paramètre
/// </summary>
/// <param name="artist">Artiste à modifier</param>
/// <param name="name">Nom de l'objet Artist</param>
void UpdateArtist(Artist artist, string name);
/// <summary>
/// Modifie un objet Artist avec les informations données en paramètre
/// </summary>
/// <param name="name">Nom de l'objet Artist à modifier</param>
/// <param name="newName">Nouveau nom de l'objet Artist</param>
void UpdateArtistByName(string name, string newName);
// Delete
/// <summary>
/// Permet de retirer un objet Album de l'application
/// </summary>
/// <param name="album">Album à retirer</param>
void RemoveAlbum(Album album);
/// <summary>
/// Permet de retirer des objets Album de l'application
/// </summary>
/// <param name="albumsList">Liste des objets Album à retirer de l'application</param>
void RemoveAlbums(List<Album> albumsList);
/// <summary>
/// Permet de retirer un objet Artist de l'application
/// </summary>
/// <param name="artist">Artist à retirer</param>
void RemoveArtist(Artist artist);
/// <summary>
/// Permet de retirer des objets Artist de l'application
/// </summary>
/// <param name="artistsList">Liste des objets Artist à retirer de l'application</param>
void RemoveArtists(List<Artist> artistsList);
/// <summary>
/// Permet de retirer un objet Playlist de l'application
/// </summary>
/// <param name="playlist">Playlist à retirer</param>
void RemovePlaylist(Playlist playlist);
/// <summary>
/// Permet de retirer des objets Playlist de l'application
/// </summary>
/// <param name="playlistsList">Liste des objets Playlist à retirer de l'application</param>
void RemovePlaylists(List<Playlist> playlistsList);
/// <summary>
/// Permet de retirer un objet CustomTitle de l'application
/// </summary>
/// <param name="title">CustomTitle à retirer</param>
void RemoveCustomTitle(CustomTitle title);
/// <summary>
/// Permet de retirer des objets CustomTitle de l'application
/// </summary>
/// <param name="customTitlesList">Liste des objets CustomTitle à retirer de l'application</param>
void RemoveCustomTitles(List<CustomTitle> customTitlesList);
/// <summary>
/// Permet de retirer un objet InfoTitle de l'application
/// </summary>
/// <param name="title">InfoTitle à retirer</param>
void RemoveInfoTitle(InfoTitle title);
/// <summary>
/// Permet de retirer des objets InfoTitle de l'application
/// </summary>
/// <param name="infoTitlesList">Liste des objets InfoTitle à retirer de l'application</param>
void RemoveInfoTitles(List<InfoTitle> infoTitlesList);
// Serialization
/// <summary>
/// Permet de charger les données
/// </summary>
void LoadSerialization();
/// <summary>
/// Permet de sauvegarder l'état de l'application
/// </summary>
void SaveSerialization();
// Exists
/// <summary>
/// Permet de savoir si un objet Playlist appartient ou non à l'application
/// </summary>
/// <param name="playlist">Playlist à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsPlaylist(Playlist playlist);
/// <summary>
/// Permet de savoir si un objet Playlist appartient ou non à l'application selon son nom
/// </summary>
/// <param name="name">Nom de l'objet Playlist à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsPlaylistByName(string name);
/// <summary>
/// Permet de savoir si un objet Album appartient ou non à l'application
/// </summary>
/// <param name="album">Album à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsAlbum(Album album);
/// <summary>
/// Permet de savoir si un objet Album appartient ou non à l'application selon son nom
/// </summary>
/// <param name="name">Nom de l'objet Album à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsAlbumByName(string name);
/// <summary>
/// Permet de savoir si un objet Artist appartient ou non à l'application
/// </summary>
/// <param name="artist">Artist à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsArtist(Artist artist);
/// <summary>
/// Permet de savoir si un objet Artist appartient ou non à l'application selon son nom
/// </summary>
/// <param name="name">Nom de l'objet Artist à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsArtistByName(string name);
/// <summary>
/// Permet de savoir si un objet CustomTitle appartient ou non à l'application selon son nom
/// </summary>
/// <param name="title">Nom de l'objet CustomTitle à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsCustomTitle(CustomTitle title);
/// <summary>
/// Permet de savoir si un objet CustomTitle appartient ou non à l'application selon son nom
/// </summary>
/// <param name="name">Nom de l'objet CustomTitle à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsCustomTitleByName(string name);
/// <summary>
/// Permet de savoir si un objet InfoTitle appartient ou non à l'application
/// </summary>
/// <param name="title">InfoTitle à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsInfoTitle(InfoTitle title);
/// <summary>
/// Permet de savoir si un objet InfoTitle appartient ou non à l'application selon son nom
/// </summary>
/// <param name="name">Nom de l'objet InfoTitle à vérifier</param>
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
bool ExistsInfoTitleByName(string name);
}
}

@ -1,87 +1,117 @@
using System.Xml.Serialization;
using Model.Stub;
namespace Model;
public class InfoTitle : Title
namespace Model
{
public string Description
/// <remarks>
/// Classe InfoTitle
/// </remarks>
public class InfoTitle : Title
{
get => description;
set
public string Description
{
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
get => description;
set
{
description = value;
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
{
description = value;
}
}
}
}
private string description = Manager.DEFAULT_DESC;
private string description = Manager.DEFAULT_DESC;
private List<Artist> feat = new List<Artist>();
private List<Artist> feat = new();
public IEnumerable<Artist> Feat
{
get
public IEnumerable<Artist> Feat
{
return new List<Artist>(feat);
get
{
return new List<Artist>(feat);
}
}
}
public Genre Genre { get; set; }
public Genre Genre { get; set; }
private long albumID;
public long AlbumID { get; set; }
public long AlbumID
{
get => albumID;
set
/// <summary>
/// Constructeur de la classe InfoTitle
/// </summary>
/// <param name="name">Nom de l'InfoTitle</param>
/// <param name="imageURL">Chemin d'accès de l'image de l'InfoTitle</param>
/// <param name="information">Informations complémentaires sur l'InfoTitle</param>
/// <param name="description">Description de l'InfoTitle</param>
/// <param name="genre">Genre de l'InfoTitle</param>
/// <param name="albumID">ID de l'album auquel appartient l'InfoTitle</param>
public InfoTitle(string name, string imageURL, string description, string information, Genre genre, long albumID) : base(name, imageURL, information)
{
albumID = value;
Description = description;
Genre = genre;
AlbumID = albumID;
}
}
public InfoTitle(string name, string imageURL, string information, string description, Genre genre, long albumID) : base(name,imageURL,information)
{
Description = description;
Genre = genre;
AlbumID = albumID;
}
/// <summary>
/// Constructeur par défaut de la classe InfoTitle
/// </summary>
public InfoTitle() : base(Manager.DEFAULT_NAME, Manager.DEFAULT_URL, Manager.DEFAULT_DESC)
{
public InfoTitle() : base(Manager.DEFAULT_NAME, Manager.DEFAULT_URL, Manager.DEFAULT_DESC)
{
}
}
public void AddFeat(Artist artist)
{
feat.Add(artist);
}
public void RemoveFeat(Artist artiste)
{
foreach (var item in Feat)
/// <summary>
/// Ajoute un artiste en tant que Feat de l'InfoTitle
/// </summary>
/// <param name="artist"></param>
public void AddFeat(Artist artist)
{
feat = Feat.Where(item => item != artiste).ToList();
feat.Add(artist);
}
}
public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(InfoTitle)) return false;
if (obj is InfoTitle infoTitle && Name == infoTitle.Name) return true;
else return false;
}
/// <summary>
/// Enlève un artiste des feats de l'InfoTitle
/// </summary>
/// <param name="artiste"></param>
public void RemoveFeat(Artist artiste)
{
foreach (var item in Feat)
{
feat = Feat.Where(item => item != artiste).ToList();
}
}
public override int GetHashCode()
{
return ImageURL.GetHashCode();
}
/// <summary>
/// Fonction qui permet de déterminer si deux objets InfoTitle sont égaux
/// </summary>
/// <param name="obj"></param>
/// <returns>Un booléen indiquant si l'objet est égal</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(InfoTitle)) return false;
if (obj is InfoTitle infoTitle && Name == infoTitle.Name) return true;
else return false;
}
public override string ToString()
{
return $"Name : {Name}, ImageUrl : {ImageURL}";
/// <summary>
/// Permet de déterminer le hash d'un objet InfoTitle
/// </summary>
/// <returns>Hash de l'attribut Name</returns>
public override int GetHashCode()
{
return Name.GetHashCode();
}
/// <summary>
/// Permet de convertir un objet InfoTitle en string
/// </summary>
/// <returns>Une nouvelle chaîne caractères contenant le nom de l'InfoTitle et le chemin d'accès à l'image</returns>
public override string ToString()
{
return $"Name : {Name}, ImageUrl : {ImageURL}";
}
}
}

@ -2,323 +2,451 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Model.Stub;
public class Manager : INotifyPropertyChanged
namespace Model.Stub
{
public event PropertyChangedEventHandler PropertyChanged;
public readonly static int MAX_NAME_LENGTH = 75;
/// <remarks>
/// Classe Manager
/// </remarks>
public class Manager : INotifyPropertyChanged
{
public readonly static int MAX_DESCRIPTION_LENGTH = 500;
public event PropertyChangedEventHandler PropertyChanged;
public readonly static string DEFAULT_NAME = "Unknown";
public readonly static int MAX_NAME_LENGTH = 75;
public readonly static string DEFAULT_URL = "none.png";
public readonly static int MAX_DESCRIPTION_LENGTH = 500;
public readonly static string DEFAULT_DESC = "";
public readonly static string DEFAULT_NAME = "Unknown";
public IDataManager DataManager { get; set; }
public readonly static string DEFAULT_URL = "none.png";
private ObservableCollection<Album> albums;
public readonly static string DEFAULT_DESC = "";
public ObservableCollection<Album> Albums
{
get
{
return new ObservableCollection<Album>(albums);
}
}
public IDataManager DataManager { get; set; }
private ObservableCollection<CustomTitle> customTitles;
private ObservableCollection<Album> albums;
public ObservableCollection<CustomTitle> CustomTitles
{
get
public ObservableCollection<Album> Albums
{
return new ObservableCollection<CustomTitle>(customTitles);
get
{
return new ObservableCollection<Album>(albums);
}
}
}
private ObservableCollection<InfoTitle> infoTitles;
private ObservableCollection<CustomTitle> customTitles;
public ObservableCollection<InfoTitle> InfoTitles
{
get
public ObservableCollection<CustomTitle> CustomTitles
{
return new ObservableCollection<InfoTitle>(infoTitles);
get
{
return new ObservableCollection<CustomTitle>(customTitles);
}
}
}
private ObservableCollection<Playlist> playlists;
private ObservableCollection<InfoTitle> infoTitles;
public ObservableCollection<Playlist> Playlists
{
get
public ObservableCollection<InfoTitle> InfoTitles
{
return new ObservableCollection<Playlist>(playlists);
get
{
return new ObservableCollection<InfoTitle>(infoTitles);
}
}
}
private List<Artist> artists;
private ObservableCollection<Playlist> playlists;
public IEnumerable<Artist> Artists
{
get
public ObservableCollection<Playlist> Playlists
{
return new List<Artist>(artists);
get
{
return new ObservableCollection<Playlist>(playlists);
}
}
}
private Album currentAlbum;
private List<Artist> artists;
public Album CurrentAlbum
{
get => currentAlbum;
set
public IEnumerable<Artist> Artists
{
currentAlbum = value;
OnPropertyChanged();
get
{
return new List<Artist>(artists);
}
}
}
private Playlist currentPlaylist;
private Album currentAlbum;
public Playlist CurrentPlaylist
{
get => currentPlaylist;
set
public Album CurrentAlbum
{
currentPlaylist = value;
OnPropertyChanged();
get => currentAlbum;
set
{
currentAlbum = value;
OnPropertyChanged();
}
}
}
private InfoTitle currentInfoTitle;
private Playlist currentPlaylist;
public InfoTitle CurrentInfoTitle
{
get => currentInfoTitle;
set
public Playlist CurrentPlaylist
{
currentInfoTitle = value;
OnPropertyChanged();
get => currentPlaylist;
set
{
currentPlaylist = value;
OnPropertyChanged();
}
}
}
private CustomTitle currentPlaying;
private InfoTitle currentInfoTitle;
public CustomTitle CurrentPlaying
{
get => currentPlaying;
set
public InfoTitle CurrentInfoTitle
{
currentPlaying = value;
OnPropertyChanged();
get => currentInfoTitle;
set
{
currentInfoTitle = value;
OnPropertyChanged();
}
}
}
private Dictionary<string, IEnumerable<Album>> albumsFromArtist;
private CustomTitle currentPlaying;
public Dictionary<string, IEnumerable<Album>> AlbumsFromArtist
{
get => albumsFromArtist;
set
public CustomTitle CurrentPlaying
{
albumsFromArtist = value;
get => currentPlaying;
set
{
currentPlaying = value;
OnPropertyChanged();
}
}
}
private Dictionary<string, IEnumerable<InfoTitle>> infoTitlesFromArtist;
public Dictionary<string, IEnumerable<Album>> AlbumsFromArtist { get; set; }
public Dictionary<string, IEnumerable<InfoTitle>> InfoTitlesFromArtist
{
get => infoTitlesFromArtist;
set
{
infoTitlesFromArtist = value;
}
}
public Dictionary<string, IEnumerable<InfoTitle>> InfoTitlesFromArtist { get; set; }
public Manager(IDataManager dataManager)
{
DataManager = dataManager;
/// <summary>
/// Constructeur de la classe Manager
/// </summary>
/// <param name="dataManager">Méthode de sérialisation, gestionnaire des données</param>
public Manager(IDataManager dataManager)
{
DataManager = dataManager;
albums = DataManager.GetAlbums();
customTitles = DataManager.GetCustomTitles();
infoTitles = DataManager.GetInfoTitles();
playlists = DataManager.GetPlaylists();
artists = DataManager.GetArtists();
albums = DataManager.GetAlbums();
customTitles = DataManager.GetCustomTitles();
infoTitles = DataManager.GetInfoTitles();
playlists = DataManager.GetPlaylists();
artists = DataManager.GetArtists();
currentAlbum = albums.First();
currentPlaylist = playlists.FirstOrDefault();
currentInfoTitle = null;
currentPlaying = null;
currentAlbum = albums.First();
currentPlaylist = playlists.FirstOrDefault();
currentInfoTitle = null;
currentPlaying = null;
LoadDictionaries();
}
LoadDictionaries();
}
public void LoadDictionaries()
{
albumsFromArtist = albums.GroupBy(album => album.Artist.Name).ToDictionary(group => group.Key, group => group.AsEnumerable());
infoTitlesFromArtist = infoTitles.GroupBy(infoTitle => GetAlbumById(infoTitle.AlbumID).Artist.Name).ToDictionary(group => group.Key, group => group.AsEnumerable());
}
/// <summary>
/// Remplis les dictionnaire grâce aux stubs et à LINQ
/// </summary>
public void LoadDictionaries()
{
AlbumsFromArtist = albums.GroupBy(album => album.Artist.Name).ToDictionary(group => group.Key, group => group.AsEnumerable());
InfoTitlesFromArtist = infoTitles.GroupBy(infoTitle => GetAlbumById(infoTitle.AlbumID).Artist.Name).ToDictionary(group => group.Key, group => group.AsEnumerable());
}
public void NextTitle()
{
if (currentPlaylist == null) return;
currentPlaying = currentPlaylist.NextTitle();
}
/// <summary>
/// Actualise le morceau en cours CurrentTitle avec le morceau suivant
/// </summary>
public void NextTitle()
{
if (currentPlaylist == null) return;
currentPlaying = currentPlaylist.NextTitle();
}
public void PreviousTitle()
{
if (CurrentPlaying == null) return;
currentPlaying = currentPlaylist.PreviousTitle();
}
/// <summary>
/// Actualise le morceau en cours CurrentTitle avec le morceau précédent
/// </summary>
public void PreviousTitle()
{
if (CurrentPlaying == null) return;
currentPlaying = currentPlaylist.PreviousTitle();
}
public CustomTitle CurrentTitle()
{
if (CurrentPlaylist == null) return null;
return currentPlaylist.GetCurrentTitle();
}
/// <summary>
/// Permet de connaître le titre en cours
/// </summary>
/// <returns>Retourne le titre actuel</returns>
public CustomTitle CurrentTitle()
{
if (CurrentPlaylist == null) return null;
return currentPlaylist.GetCurrentTitle();
}
public void Loop()
{
if (CurrentPlaylist == null) return;
currentPlaylist.LoopTitle = !currentPlaylist.LoopTitle;
}
/// <summary>
/// Permet d'activer/désactiver l'option de boucle
/// </summary>
public void Loop()
{
if (CurrentPlaylist == null) return;
currentPlaylist.LoopTitle = !currentPlaylist.LoopTitle;
}
public void Shuffle()
{
if (CurrentPlaylist == null) return;
currentPlaylist.Shuffle = !currentPlaylist.Shuffle;
}
/// <summary>
/// Permet d'activer/désactiver l'option de l'aléatoire
/// </summary>
public void Shuffle()
{
if (CurrentPlaylist == null) return;
currentPlaylist.Shuffle = !currentPlaylist.Shuffle;
}
public void AddAlbum(Album album)
{
if (GetAlbumByName(album.Name) != null) return;
DataManager.AddAlbum(album);
albums = DataManager.GetAlbums();
}
/// <summary>
/// Permet d'ajouter un Album à l'application
/// </summary>
/// <param name="album">Album à ajouter</param>
public void AddAlbum(Album album)
{
if (GetAlbumByName(album.Name) != null) return;
DataManager.AddAlbum(album);
albums = DataManager.GetAlbums();
}
public void AddCustomTitle(CustomTitle title)
{
if (GetInfoTitleByName(title.Name) != null) return;
DataManager.AddCustomTitle(title);
customTitles = DataManager.GetCustomTitles();
}
/// <summary>
/// Permet d'ajouter un CustomTitle à l'application
/// </summary>
/// <param name="title">CustomTitle à ajouter</param>
public void AddCustomTitle(CustomTitle title)
{
if (GetInfoTitleByName(title.Name) != null) return;
DataManager.AddCustomTitle(title);
customTitles = DataManager.GetCustomTitles();
}
public void AddInfoTitle(InfoTitle title)
{
if (GetInfoTitleByName(title.Name) != null) return;
DataManager.AddInfoTitle(title);
infoTitles = DataManager.GetInfoTitles();
}
/// <summary>
/// Permet d'ajouter un InfoTitle à l'application
/// </summary>
/// <param name="title">InfoTitle à ajouter</param>
public void AddInfoTitle(InfoTitle title)
{
if (GetInfoTitleByName(title.Name) != null) return;
DataManager.AddInfoTitle(title);
infoTitles = DataManager.GetInfoTitles();
}
public void AddPlaylist(Playlist playlist)
{
if (GetPlaylistByName(playlist.Name) != null) return;
DataManager.AddPlaylist(playlist);
playlists = DataManager.GetPlaylists();
}
/// <summary>
/// Permet d'ajouter une Playlist à l'application
/// </summary>
/// <param name="playlist">Playlist à ajouter</param>
public void AddPlaylist(Playlist playlist)
{
if (GetPlaylistByName(playlist.Name) != null) return;
DataManager.AddPlaylist(playlist);
playlists = DataManager.GetPlaylists();
}
public void AddArtist(Artist artist)
{
if (GetArtistByName(artist.Name) != null) return;
DataManager.AddArtist(artist);
artists = DataManager.GetArtists();
}
/// <summary>
/// Permet d'ajouter un Artist à l'application
/// </summary>
/// <param name="artist">Artist à ajouter</param>
public void AddArtist(Artist artist)
{
if (GetArtistByName(artist.Name) != null) return;
DataManager.AddArtist(artist);
artists = DataManager.GetArtists();
}
public void RemoveAlbum(Album album)
{
DataManager.RemoveAlbum(album);
albums = DataManager.GetAlbums();
}
/// <summary>
/// Permet de retirer un Album de l'application
/// </summary>
/// <param name="album">Album à retirer</param>
public void RemoveAlbum(Album album)
{
DataManager.RemoveAlbum(album);
albums = DataManager.GetAlbums();
}
public void RemoveCustomTitle(CustomTitle title)
{
DataManager.RemoveCustomTitle(title);
customTitles = DataManager.GetCustomTitles();
}
/// <summary>
/// Permet de retirer un CustomTitle de l'application
/// </summary>
/// <param name="title">CustomTitle à retirer</param>
public void RemoveCustomTitle(CustomTitle title)
{
DataManager.RemoveCustomTitle(title);
customTitles = DataManager.GetCustomTitles();
}
public void RemoveInfoTitle(InfoTitle title)
{
DataManager.RemoveInfoTitle(title);
infoTitles = DataManager.GetInfoTitles();
}
/// <summary>
/// Permet de retirer un InfoTitle de l'application
/// </summary>
/// <param name="title">InfoTitle à retirer</param>
public void RemoveInfoTitle(InfoTitle title)
{
DataManager.RemoveInfoTitle(title);
infoTitles = DataManager.GetInfoTitles();
}
public void RemovePlaylist(Playlist playlist)
{
DataManager.RemovePlaylist(playlist);
playlists = DataManager.GetPlaylists();
}
/// <summary>
/// Permet de retirer une Playlist de l'application
/// </summary>
/// <param name="playlist">Playlist à retirer</param>
public void RemovePlaylist(Playlist playlist)
{
DataManager.RemovePlaylist(playlist);
playlists = DataManager.GetPlaylists();
}
public ObservableCollection<Playlist> GetPlaylists()
{
return DataManager.GetPlaylists();
}
/// <summary>
/// Permet d'obtenir la liste des objets Playlist de l'application
/// </summary>
/// <returns>Reourne la liste des objets Playlist de l'application</returns>
public ObservableCollection<Playlist> GetPlaylists()
{
return DataManager.GetPlaylists();
}
public ObservableCollection<Album> GetAlbums()
{
return DataManager.GetAlbums();
}
/// <summary>
/// Permet d'obtenir la liste des objets Album de l'application
/// </summary>
/// <returns>Reourne la liste des objets Album de l'application</returns>
public ObservableCollection<Album> GetAlbums()
{
return DataManager.GetAlbums();
}
public ObservableCollection<CustomTitle> GetCustomTitles()
{
return DataManager.GetCustomTitles();
}
/// <summary>
/// Permet d'obtenir la liste des objets CustomTitle de l'application
/// </summary>
/// <returns>Reourne la liste des objets CustomTitle de l'application</returns>
public ObservableCollection<CustomTitle> GetCustomTitles()
{
return DataManager.GetCustomTitles();
}
public ObservableCollection<InfoTitle> GetInfoTitles()
{
return DataManager.GetInfoTitles();
}
/// <summary>
/// Permet d'obtenir la liste des objets InfoTitle de l'application
/// </summary>
/// <returns>Reourne la liste des objets InfoTitle de l'application</returns>
public ObservableCollection<InfoTitle> GetInfoTitles()
{
return DataManager.GetInfoTitles();
}
public IEnumerable<Artist> GetArtists()
{
return DataManager.GetArtists();
}
/// <summary>
/// Permet d'obtenir la liste des objets Artist de l'application
/// </summary>
/// <returns>Reourne la liste des objets Artist de l'application</returns>
public IEnumerable<Artist> GetArtists()
{
return DataManager.GetArtists();
}
public void LoadSerialization()
{
DataManager.LoadSerialization();
}
/// <summary>
/// Permet de charger l'état sauvegardé précédemment dans l'application
/// </summary>
public void LoadSerialization()
{
DataManager.LoadSerialization();
}
public void SaveSerialization()
{
DataManager.SaveSerialization();
}
/// <summary>
/// Permet de sauvegarder l'état de l'application
/// </summary>
public void SaveSerialization()
{
DataManager.SaveSerialization();
}
public Playlist GetPlaylistByName(string name)
{
return DataManager.GetPlaylistByName(name);
}
/// <summary>
/// Permet d'obtenir une Playlist selon son nom
/// </summary>
/// <param name="name">Nom de la Playlist</param>
/// <returns>Retourne la Playlist correspondant au nom donné en paramètre</returns>
public Playlist GetPlaylistByName(string name)
{
return DataManager.GetPlaylistByName(name);
}
public Artist GetArtistByName(string name)
{
return DataManager.GetArtistByName(name);
}
/// <summary>
/// Permet d'obtenir un Artist selon son nom
/// </summary>
/// <param name="name">Nom de l'Artist</param>
/// <returns>Retourne l'Artist correspondant au nom donné en paramètre</returns>
public Artist GetArtistByName(string name)
{
return DataManager.GetArtistByName(name);
}
public CustomTitle GetCustomTitleByPath(string path)
{
return DataManager.GetCustomTitleByPath(path);
}
/// <summary>
/// Permet d'obtenir un CustomTitle selon son chemin d'accès
/// </summary>
/// <param name="path">Chemin d'accès du CustomTitle</param>
/// <returns>Retourne le CustomTitle correspondant au chemin d'accès donné en paramètre</returns>
public CustomTitle GetCustomTitleByPath(string path)
{
return DataManager.GetCustomTitleByPath(path);
}
public InfoTitle GetInfoTitleByName(string name)
{
return DataManager.GetInfoTitleByName(name);
}
/// <summary>
/// Permet d'obtenir un InfoTitle selon son nom
/// </summary>
/// <param name="name">Nom de l'InfoTitle</param>
/// <returns>Retourne l'InfoTitle correspondant au nom donné en paramètre</returns>
public InfoTitle GetInfoTitleByName(string name)
{
return DataManager.GetInfoTitleByName(name);
}
public Album GetAlbumByName(string name)
{
return DataManager.GetAlbumByName(name);
}
/// <summary>
/// Permet d'obtenir un Album selon son nom
/// </summary>
/// <param name="name">Nom de l'Album</param>
/// <returns>Retourne l'Album correspondant au nom donné en paramètre</returns>
public Album GetAlbumByName(string name)
{
return DataManager.GetAlbumByName(name);
}
public Album GetAlbumById(long id)
{
return DataManager.GetAlbumById(id);
}
/// <summary>
/// Permet d'obtenir un Album selon son ID
/// </summary>
/// <param name="id">ID de l'Album</param>
/// <returns>Retourne l'Album correspondant au ID donné en paramètre</returns>
public Album GetAlbumById(long id)
{
return DataManager.GetAlbumById(id);
}
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
/// <summary>
/// Permet d'enlever un titre supprimé de toutes les playlists
/// </summary>
/// <param name="title">Titre à supprimer</param>
public void RemoveCustomTitleFromPlaylists(CustomTitle title)
{
foreach(Playlist p in DataManager.GetPlaylists())
{
List<CustomTitle> ToDelete = new();
foreach (CustomTitle ct in p.Titles)
{
if (ct == title)
{
ToDelete.Add(ct);
}
}
foreach(CustomTitle ct in ToDelete)
{
p.RemoveTitle(ct);
}
}
}
/// <summary>
/// Permet la notification, et donc l'actualisation des objets connectés à l'événement lorsque la méthode est appelée
/// </summary>
/// <param name="propertyName">Nom de la propriété modifiée</param>
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
@ -19,8 +18,4 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Plugin.Maui.Audio" Version="1.0.0" />
</ItemGroup>
</Project>

@ -1,9 +1,8 @@
using System;
namespace Model
namespace Model;
// All the code in this file is only included on Tizen.
public class PlatformClass1
{
// All the code in this file is only included on Tizen.
public class PlatformClass1
{
}
}

@ -4,252 +4,328 @@ using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
namespace Model;
public class Playlist : INotifyPropertyChanged
namespace Model
{
public event PropertyChangedEventHandler PropertyChanged;
public string Name
/// <remarks>
/// Classe Playlist
/// </remarks>
public class Playlist : INotifyPropertyChanged
{
get => name;
set
public event PropertyChangedEventHandler PropertyChanged;
public string Name
{
if (string.IsNullOrEmpty(value) || value.Length > Manager.MAX_NAME_LENGTH)
get => name;
set
{
return;
if (string.IsNullOrEmpty(value) || value.Length > Manager.MAX_NAME_LENGTH)
{
return;
}
name = value;
OnPropertyChanged();
}
name = value;
OnPropertyChanged();
}
}
private string name = Manager.DEFAULT_NAME;
public string Description
{
get => description;
private string name = Manager.DEFAULT_NAME;
set
public string Description
{
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
get => description;
set
{
description = value;
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
{
description = value;
}
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private string description = Manager.DEFAULT_DESC;
private string description = Manager.DEFAULT_DESC;
public ObservableCollection<CustomTitle> Titles
{
get
public ObservableCollection<CustomTitle> Titles
{
return titles;
}
private set
{
titles = value;
OnPropertyChanged();
}
}
private ObservableCollection<CustomTitle> titles = new ObservableCollection<CustomTitle>();
public string ImageURL
{
get => imageURL;
set
{
if (value == null || !value.Contains('.'))
get
{
value = "none.png";
imageURL = value;
return titles;
}
else if (value.Contains('.'))
private set
{
imageURL = value;
titles = value;
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private string imageURL = Manager.DEFAULT_URL;
public int Index
{
get => index;
private ObservableCollection<CustomTitle> titles = new ObservableCollection<CustomTitle>();
set
public string ImageURL
{
if (value < titles.Count)
get => imageURL;
set
{
index = value;
if (value == null || !value.Contains('.'))
{
value = "none.png";
imageURL = value;
}
else if (value.Contains('.'))
{
imageURL = value;
}
OnPropertyChanged();
}
else
}
private string imageURL = Manager.DEFAULT_URL;
public int Index
{
get => index;
set
{
index = 0;
if (value < titles.Count)
{
index = value;
}
else
{
index = 0;
}
}
}
}
private int index = -1;
private int index = -1;
public bool Shuffle { get; set; } = false;
public bool Shuffle { get; set; } = false;
public bool LoopTitle { get; set; } = false;
public bool LoopTitle { get; set; } = false;
private readonly List<int> played = new List<int>();
private readonly List<int> played = new List<int>();
public IEnumerable<int> Played
{
get
public IEnumerable<int> Played
{
return new List<int>(played);
get
{
return new List<int>(played);
}
}
}
public bool IsSubMenuVisible
{
get => isSubMenuVisible;
set
public bool IsSubMenuVisible
{
if (isSubMenuVisible != value)
get => isSubMenuVisible;
set
{
isSubMenuVisible = value;
if (isSubMenuVisible != value)
{
isSubMenuVisible = value;
}
OnPropertyChanged(nameof(IsSubMenuVisible));
}
OnPropertyChanged(nameof(IsSubMenuVisible));
}
}
private bool isSubMenuVisible;
public Playlist(string nom, string description, string imageURL)
{
Name = nom;
Description = description;
ImageURL = imageURL;
}
public Playlist() { }
public void AddTitle(CustomTitle morceau)
{
titles.Add(morceau);
}
private bool isSubMenuVisible;
public void RemoveTitle(CustomTitle morceau)
{
titles.Remove(morceau);
}
public CustomTitle NextTitle()
{
if (titles.Count < 1) return null;
if (LoopTitle)
/// <summary>
/// Constructeur de la classe Playlist
/// </summary>
/// <param name="nom">Nom de la Playlist</param>
/// <param name="description">Description de la Playlist</param>
/// <param name="imageURL">Chemin d'accès de l'image de la Playlist</param>
public Playlist(string nom, string description, string imageURL)
{
return GetCurrentTitle();
Name = nom;
Description = description;
ImageURL = imageURL;
}
if (!Shuffle)
{
Index++;
played.Add(Index);
return GetCurrentTitle();
}
else
/// <summary>
/// Constructeur par défaut de la Playlist
/// </summary>
public Playlist() { }
/// <summary>
/// Ajoute un titre à la Playlist
/// </summary>
/// <param name="morceau">Morceau à ajouter à la Playlist</param>
public void AddTitle(CustomTitle morceau)
{
Index = RandomGenerator(titles.Count);
played.Add(Index);
return GetCurrentTitle();
titles.Add(morceau);
}
}
public CustomTitle PreviousTitle()
{
if (LoopTitle)
/// <summary>
/// Supprime un titre de la playlist
/// </summary>
/// <param name="morceau">Morceau à supprimer</param>
public void RemoveTitle(CustomTitle morceau)
{
return GetCurrentTitle();
titles.Remove(morceau);
}
if(!Shuffle)
/// <summary>
/// Permet de connaître le prochain morceau à jouer dans la playlist
/// </summary>
/// <returns>Retourne le CustomTitle suivant selon les options indiquées par l'utilisateur</returns>
/// Vérifie s'il y a des morceaux dans la playlist, puis vérifie si l'option de boucle du morceau est activé.
/// Si elle est activée, cela renvoie le même morceau. Sinon, si l'option aléatoire N'est PAS activée, cela renvoie
/// simplement le morceau à la suite dans la liste des titres de la playlist. Sinon, l'option aléatoire est activée, cela
/// appelle donc une méthode de génération d'un index aléatoire pour avoir un morceau aléatoire dans la liste de la playlist.
public CustomTitle NextTitle()
{
if(Index != 0)
if (titles.Count < 1) return null;
if (LoopTitle)
{
Index--;
played.RemoveAt(played.Count - 1);
return GetCurrentTitle();
}
if (!Shuffle)
{
Index++;
played.Add(Index);
return GetCurrentTitle();
}
else
{
Index = RandomGenerator(titles.Count);
played.Add(Index);
return GetCurrentTitle();
}
}
else
/// <summary>
/// Permet de connaître le titre précédentà jouer dans la playlist
/// </summary>
/// <returns>Retourne le CustomTitle précédent selon les options indiquées par l'utilisateur</returns>
/// Vérifie s'il y a des morceaux dans la playlist, puis vérifie si l'option de boucle du morceau est activé.
/// Si elle est activée, cela renvoie le même morceau. Sinon, si l'option aléatoire N'est PAS activée, cela renvoie
/// simplement le morceau précédent celui actuel dans la liste des titres de la playlist. Si le morceau actuel est le
/// premier, le morceau précédent est le dernier de la playlist.
/// Sinon, l'option aléatoire est activée, la liste des morceaux jouée est analysée. Si elle est vide, le morceau
/// actuel est retourné. Sinon, cela renvoie le dernier élément de la liste des morceaux joués. A noter que cette liste ne
/// stocke que les index des titres présents dans la playlist.
public CustomTitle PreviousTitle()
{
if (!played.Any())
if (titles.Count < 1) return null;
if (LoopTitle)
{
return GetCurrentTitle();
}
if (!Shuffle)
{
if (Index != 0)
{
Index--;
played.RemoveAt(played.Count - 1);
return GetCurrentTitle();
}
else
{
return GetCurrentTitle();
}
}
else
{
if (!played.Any())
{
return GetCurrentTitle();
}
Index = played[played.Count - 1];
played.RemoveAt(played.Count - 1);
return GetCurrentTitle();
}
Index = played[played.Count - 1];
played.RemoveAt(played.Count - 1);
return GetCurrentTitle();
}
}
public CustomTitle GetCurrentTitle()
{
if (Index < 0) Index = 0;
if (Index < titles.Count)
/// <summary>
/// Permet de connaître le morceau actuel de la playlist.
/// </summary>
/// <returns>Retourne le morceau actuel de la playlist</returns>
/// Tout d'abord, des tests de vérification sur l'index sont effectués pour éviter les bugs. Puis, cela renvoie le morceau
/// à l'index de la playlist dans la liste.
public CustomTitle GetCurrentTitle()
{
return titles[Index];
if (Index < 0) Index = 0;
if (Index < titles.Count)
{
return titles[Index];
}
else
{
return null;
}
}
else
/// <summary>
/// Fonction qui permet de déterminer si deux objets Playlist sont égaux
/// </summary>
/// <param name="obj"></param>
/// <returns>Un booléen indiquant si l'objet est égal</returns>
public override bool Equals(object obj)
{
return null;
if (obj is null) return false;
if (obj.GetType() != typeof(Playlist)) return false;
if (obj is Playlist playlist && Name == playlist.Name) return true;
else return false;
}
}
public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(Playlist)) return false;
if (obj is Playlist playlist && Name == playlist.Name) return true;
else return false;
}
public override int GetHashCode()
{
return ImageURL.GetHashCode();
}
/// <summary>
/// Permet de déterminer le hash d'un objet Playlist
/// </summary>
/// <returns>Hash de l'attribut Name</returns>
public override int GetHashCode()
{
return Name.GetHashCode();
}
public override string ToString()
{
return $"Name : {Name}";
}
/// <summary>
/// Permet de convertir un objet Playlist en string
/// </summary>
/// <returns>Une nouvelle chaîne caractères contenant le nom de la Playlist</returns>
public override string ToString()
{
return $"Name : {Name}";
}
static int RandomGenerator(int n)
{
RandomNumberGenerator rng = RandomNumberGenerator.Create();
byte[] randomBytes = new byte[4];
rng.GetBytes(randomBytes);
uint randomNumber = BitConverter.ToUInt32(randomBytes, 0);
return (int)(randomNumber % n) + 1;
}
/// <summary>
/// Permet de générer un nombre entre 0 et n
/// </summary>
/// <param name="n">Limite supérieure du nombre à générer</param>
/// <returns>Retourne un nombre entre 0 et n</returns>
/// Cette méthode est effectuée via RandomNumberGenerator afin d'obtenir un aléatoire moins prévisible.
static int RandomGenerator(int n)
{
RandomNumberGenerator rng = RandomNumberGenerator.Create();
byte[] randomBytes = new byte[4];
rng.GetBytes(randomBytes);
uint randomNumber = BitConverter.ToUInt32(randomBytes, 0);
return (int)(randomNumber % n) + 1;
}
public bool HasCustomTitle(CustomTitle customTitle)
{
foreach(CustomTitle custom in Titles)
/// <summary>
/// Vérifie si la Playlist contient un certain CustomTitle
/// </summary>
/// <param name="customTitle">CustomTitle à vérifier</param>
/// <returns>Booléen True si le CustomTitle est contenu dans la Playlist, False sinon</returns>
public bool HasCustomTitle(CustomTitle customTitle)
{
if(custom == customTitle) return true;
foreach (CustomTitle custom in Titles)
{
if (custom == customTitle) return true;
}
return false;
}
return false;
}
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// Permet la notification, et donc l'actualisation des objets connectés à l'événement lorsque la méthode est appelée
/// </summary>
/// <param name="propertyName">Nom de la propriété modifiée</param>
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}

File diff suppressed because it is too large Load Diff

@ -1,70 +1,93 @@
using System.Collections.ObjectModel;
using System.Linq;
namespace Model.Stub;
public class StubAlbum
namespace Model.Stub
{
public StubArtist StubArtist
public class StubAlbum
{
get
public StubArtist StubArtist
{
return stubArtist;
get
{
return stubArtist;
}
}
}
private readonly StubArtist stubArtist;
private readonly StubArtist stubArtist;
public ObservableCollection<Album> Albums
{
get => albums;
}
public ObservableCollection<Album> Albums
{
get => albums;
}
private readonly ObservableCollection<Album> albums;
private readonly ObservableCollection<Album> albums;
public StubAlbum()
{
stubArtist = new StubArtist();
albums = new ObservableCollection<Album>()
/// <summary>
/// Constructeur de la classe StubAlbum
/// </summary>
public StubAlbum()
{
new Album("Adios Bahamas", "album1.jpg", StubArtist.GetArtistByName("Nepal") ?? new Artist("Nepal"), "Album post-mortem qui signé également le dernier de l'artiste", "Sortie : 2020"),
new Album("445e Nuit", "album2.jpg", StubArtist.GetArtistByName("Nepal") ?? new Artist("Nepal"), "", "Sortie : 2017\n8 titres - 24 min"),
new Album("Fenêtre Sur Rue", "album3.jpg", StubArtist.GetArtistByName("Hugo TSR") ?? new Artist("Hugo TSR"), "", "Sortie : 2012\n14 titres - 46 min"),
new Album("Temps Mort", "album4.jpg", StubArtist.GetArtistByName("Booba") ?? new Artist("Booba"), "Premier album de Booba", "Sortie : 2002\n14 titres - 57 min"),
new Album("Opéra Puccino", "album5.jpg", StubArtist.GetArtistByName("Oxmo Puccino") ?? new Artist("Oxmo Puccino"), "", "Sortie : 1998\n18 titres - 1h08min"),
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"), "", "")
};
}
stubArtist = new StubArtist();
albums = new ObservableCollection<Album>()
{
new Album("Adios Bahamas", "album1.jpg", StubArtist.GetArtistByName("Népal") ?? new Artist("Népal"), "Album post-mortem qui signé également le dernier de l'artiste", "Sortie : 2020"),
new Album("445e Nuit", "album2.jpg", StubArtist.GetArtistByName("Népal") ?? new Artist("Népal"), "", "Sortie : 2017\n8 titres - 24 min"),
new Album("Fenêtre Sur Rue", "album3.jpg", StubArtist.GetArtistByName("Hugo TSR") ?? new Artist("Hugo TSR"), "", "Sortie : 2012\n14 titres - 46 min"),
new Album("Temps Mort", "album4.jpg", StubArtist.GetArtistByName("Booba") ?? new Artist("Booba"), "Premier album de Booba", "Sortie : 2002\n14 titres - 57 min"),
new Album("Opéra Puccino", "album5.jpg", StubArtist.GetArtistByName("Oxmo Puccino") ?? new Artist("Oxmo Puccino"), "", "Sortie : 1998\n18 titres - 1h08min"),
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"), "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.")
};
}
public ObservableCollection<Album> GetAlbums()
{
return albums;
}
public Album GetAlbumByName(string name)
{
foreach(Album album in albums)
/// <summary>
/// Permet d'obtenir la liste des albums
/// </summary>
/// <returns>Retourne la liste des albums</returns>
public ObservableCollection<Album> GetAlbums()
{
return albums;
}
/// <summary>
/// Permet d'obtenir un album selon son nom
/// </summary>
/// <param name="name">Nom de l'album recherché</param>
/// <returns>Retourne l'album correspondant au nom donné en paramètre</returns>
public Album GetAlbumByName(string name)
{
if (name == album.Name)
foreach (Album album in albums)
{
return album;
if (name == album.Name)
{
return album;
}
}
return null;
}
/// <summary>
/// Permet d'ajouter un album à la liste des albums
/// </summary>
/// <param name="album">Album à ajouter</param>
public void AddAlbum(Album album)
{
albums.Add(album);
}
/// <summary>
/// Permet de retirer un album de la liste des albums
/// </summary>
/// <param name="album">Album à retirer</param>
public void RemoveAlbum(Album album)
{
albums.Remove(album);
}
return null;
}
public void AddAlbum(Album album)
{
albums.Add(album);
}
public void RemoveAlbum(Album album)
{
albums.Remove(album);
}
}
}

@ -1,49 +1,72 @@
namespace Model.Stub;
public class StubArtist
{
public List<Artist> Artists
namespace Model.Stub {
public class StubArtist
{
get => artists;
}
public List<Artist> Artists
{
get => artists;
}
private readonly List<Artist> artists;
private readonly List<Artist> artists;
public StubArtist()
{
artists = new List<Artist>()
/// <summary>
/// Constructeur de la classe StubArtist
/// </summary>
public StubArtist()
{
new Artist("Imagine Dragons"),
new Artist("Nepal"),
new Artist("Hugo TSR"),
new Artist("Booba"),
new Artist("Oxmo Puccino"),
new Artist("IAM"),
new Artist("PNL")
};
}
artists = new List<Artist>()
{
new Artist("Imagine Dragons"),
new Artist("Népal"),
new Artist("Hugo TSR"),
new Artist("Booba"),
new Artist("Oxmo Puccino"),
new Artist("IAM"),
new Artist("PNL")
};
}
public List<Artist> GetArtists()
{
return artists;
}
public Artist GetArtistByName(string name)
{
foreach (var artist in artists)
/// <summary>
/// Permet d'obtenir la liste des artistes
/// </summary>
/// <returns>Retourne la liste des artistes</returns>
public List<Artist> GetArtists()
{
return artists;
}
/// <summary>
/// Permet d'obtenir un artiste selon son nom
/// </summary>
/// <param name="name">Nom de l'artiste recherché</param>
/// <returns>Retourne l'artiste correspondant au nom donné en paramètre</returns>
public Artist GetArtistByName(string name)
{
if (artist.Name == name)
foreach (var artist in artists)
{
return artist;
if (artist.Name == name)
{
return artist;
}
}
return null;
}
/// <summary>
/// Permet d'ajouter un artiste à la liste des artistes
/// </summary>
/// <param name="artist">Artiste à ajouter</param>
public void AddArtist(Artist artist)
{
artists.Add(artist);
}
/// <summary>
/// Permet de retirer un artiste de la liste des artistes
/// </summary>
/// <param name="artist">Artiste à retirer</param>
public void RemoveArtist(Artist artist)
{
artists.Remove(artist);
}
return null;
}
public void AddArtist(Artist artist)
{
artists.Add(artist);
}
public void RemoveArtist(Artist artist)
{
artists.Remove(artist);
}
}
}

@ -1,62 +1,86 @@
using System.Collections.ObjectModel;
namespace Model.Stub;
public class StubCustomTitle
namespace Model.Stub
{
public ObservableCollection<CustomTitle> CustomTitles
public class StubCustomTitle
{
get => customTitles;
}
private readonly ObservableCollection<CustomTitle> customTitles;
public ObservableCollection<CustomTitle> CustomTitles
{
get => customTitles;
}
public StubCustomTitle()
{
CustomTitle Custom1 = new CustomTitle("MaMusique", "mp3.png", "info1", "chemin1");
CustomTitle Custom2 = new CustomTitle("MusiqueGeniale", "wav.png", "info2", "chemin2");
CustomTitle Custom3 = new CustomTitle("custom3", "midi.png", "info3", "chemin3");
CustomTitle Custom4 = new CustomTitle("custom4", "ogg.png", "info4", "chemin4");
CustomTitle Custom5 = new CustomTitle("custom5", "mp3.png", "info5", "chemin5");
CustomTitle Custom6 = new CustomTitle("custom6", "mp3.png", "info6", "chemin6");
CustomTitle Custom7 = new CustomTitle("custom7", "wav.png", "info7", "chemin7");
CustomTitle Custom8 = new CustomTitle("custom8", "ogg.png", "info8", "chemin8");
CustomTitle Custom9 = new CustomTitle("custom9", "mp3.png", "info9", "chemin9");
CustomTitle Custom10 = new CustomTitle("custom10", "wav.png", "info10", "chemin10");
CustomTitle Custom11 = new CustomTitle("custom11", "mp3.png", "info11", "chemin11");
customTitles = new ObservableCollection<CustomTitle>()
private readonly ObservableCollection<CustomTitle> customTitles;
/// <summary>
/// Constructeur de la classe StubCustomTitle
/// </summary>
public StubCustomTitle()
{
Custom1, Custom2, Custom3, Custom4, Custom5, Custom6, Custom7, Custom8, Custom9, Custom10, Custom11
};
}
CustomTitle Custom1 = new CustomTitle("MaMusique", "mp3.png", "info1", "chemin1");
CustomTitle Custom2 = new CustomTitle("MusiqueGeniale", "wav.png", "info2", "chemin2");
CustomTitle Custom3 = new CustomTitle("custom3", "midi.png", "info3", "chemin3");
CustomTitle Custom4 = new CustomTitle("custom4", "ogg.png", "info4", "chemin4");
CustomTitle Custom5 = new CustomTitle("custom5", "mp3.png", "info5", "chemin5");
CustomTitle Custom6 = new CustomTitle("custom6", "mp3.png", "info6", "chemin6");
CustomTitle Custom7 = new CustomTitle("custom7", "wav.png", "info7", "chemin7");
CustomTitle Custom8 = new CustomTitle("custom8", "ogg.png", "info8", "chemin8");
CustomTitle Custom9 = new CustomTitle("custom9", "mp3.png", "info9", "chemin9");
CustomTitle Custom10 = new CustomTitle("custom10", "wav.png", "info10", "chemin10");
CustomTitle Custom11 = new CustomTitle("custom11", "mp3.png", "info11", "chemin11");
public ObservableCollection<CustomTitle> GetCustomTitles()
{
return customTitles;
}
public List<CustomTitle> GetCustomTitlesByNames(List<string> names)
{
List<CustomTitle> Customs = new List<CustomTitle>();
foreach(var name in names)
customTitles = new ObservableCollection<CustomTitle>()
{
Custom1, Custom2, Custom3, Custom4, Custom5, Custom6, Custom7, Custom8, Custom9, Custom10, Custom11
};
}
/// <summary>
/// Permet d'obtenir la liste des CustomTitle
/// </summary>
/// <returns>Retourne la liste des CustomTitle</returns>
public ObservableCollection<CustomTitle> GetCustomTitles()
{
foreach (var title in customTitles)
return customTitles;
}
/// <summary>
/// Permet d'obtenir une liste de CustomTitle selon les noms donnés en paramètre
/// </summary>
/// <param name="names">Liste des noms des CustomTitle recherchés</param>
/// <returns>Retourne la liste des CustomTitle correspondant aux noms donnés en paramètre</returns>
public List<CustomTitle> GetCustomTitlesByNames(List<string> names)
{
List<CustomTitle> Customs = new List<CustomTitle>();
foreach (var name in names)
{
if (name == title.Name)
foreach (var title in customTitles)
{
Customs.Add(title);
if (name == title.Name)
{
Customs.Add(title);
}
}
}
return Customs;
}
/// <summary>
/// Permet d'ajouter un CustomTitle à la liste des CustomTitle
/// </summary>
/// <param name="customTitle">CustomTitle à ajouter</param>
public void AddCustomTitle(CustomTitle customTitle)
{
customTitles.Add(customTitle);
}
/// <summary>
/// Permet de retirer un CustomTitle de la liste des CustomTitle
/// </summary>
/// <param name="customTitle">CustomTitle à retirer</param>
public void RemoveCustomTitle(CustomTitle customTitle)
{
customTitles.Remove(customTitle);
}
return Customs;
}
public void AddCustomTitle(CustomTitle customTitle)
{
customTitles.Add(customTitle);
}
public void RemoveCustomTitle(CustomTitle customTitle)
{
customTitles.Remove(customTitle);
}
}
}

@ -1,311 +1,347 @@
using System.Collections.ObjectModel;
namespace Model.Stub;
public class StubInfoTitle
namespace Model.Stub
{
public StubAlbum StubAlbum
public class StubInfoTitle
{
get
public StubAlbum StubAlbum
{
return stubAlbum;
get
{
return stubAlbum;
}
}
}
private readonly StubAlbum stubAlbum;
private readonly StubAlbum stubAlbum;
public ObservableCollection<InfoTitle> InfoTitles
{
get => infoTitles;
}
public ObservableCollection<InfoTitle> InfoTitles
{
get => infoTitles;
}
private readonly ObservableCollection<InfoTitle> infoTitles;
private readonly ObservableCollection<InfoTitle> infoTitles;
public StubInfoTitle()
{
stubAlbum = new StubAlbum();
Artist ImagineDragons = StubAlbum.StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons");
Artist PNL = StubAlbum.StubArtist.GetArtistByName("PNL") ?? new Artist("PNL");
Artist Nepal = StubAlbum.StubArtist.GetArtistByName("Népal") ?? new Artist("Népal");
Artist Booba = StubAlbum.StubArtist.GetArtistByName("Booba") ?? new Artist("Booba");
Artist IAM = StubAlbum.StubArtist.GetArtistByName("IAM") ?? new Artist("IAM");
Artist Hugo = StubAlbum.StubArtist.GetArtistByName("Hugo TSR") ?? new Artist("Hugo TSR");
Artist Oxmo = StubAlbum.StubArtist.GetArtistByName("Oxmo Puccino") ?? new Artist("Oxmo Puccino");
Album MercuryAct2 = stubAlbum.GetAlbumByName("Mercury Act 2") ?? new Album("Mercury Act 2", "album14.png", ImagineDragons, "desc", "infos");
Album MercuryAct1 = stubAlbum.GetAlbumByName("Mercury Act 1") ?? new Album("Mercury Act 1", "album13.png", ImagineDragons, "desc", "infos");
Album Origins = stubAlbum.GetAlbumByName("Origins") ?? new Album("Origins", "album12.png", ImagineDragons, "desc", "infos");
Album Evolve = stubAlbum.GetAlbumByName("Evolve") ?? new Album("Evolve", "album11.png", ImagineDragons, "desc", "infos");
Album SmokeAndMirrors = stubAlbum.GetAlbumByName("Smoke & Mirrors") ?? new Album("Smoke & Mirrors", "album11.png", ImagineDragons, "desc", "infos");
Album NightVisions = stubAlbum.GetAlbumByName("Night Visions") ?? new Album("Night Visions", "album11.png", ImagineDragons, "desc", "infos");
Album AB = stubAlbum.GetAlbumByName("Adios Bahamas") ?? new Album("Adios Bahamas", "album1.jpg", Nepal, "Album post-mortem qui signé également le dernier de l'artiste", "Sortie : 2020");
Album E445 = stubAlbum.GetAlbumByName("445e Nuit") ?? new Album("445e Nuit", "album2.jpg", Nepal, "", "Sortie : 2017\n8 titres - 24 min");
Album FSR = stubAlbum.GetAlbumByName("Fenêtre Sur Rue") ?? new Album("Fenêtre Sur Rue", "album3.jpg", Hugo, "", "Sortie : 2012\n14 titres - 46 min");
Album TM = stubAlbum.GetAlbumByName("Temps Mort") ?? new Album("Temps Mort", "album4.jpg", Booba, "Premier album de Booba", "Sortie : 2002\n14 titres - 57 min");
Album OP = stubAlbum.GetAlbumByName("Opéra Puccino") ?? new Album("Opéra Puccino", "album5.jpg", Oxmo, "", "Sortie : 1998\n18 titres - 1h08min");
Album EMA = stubAlbum.GetAlbumByName("L'école du micro d'argent") ?? new Album("L'école du micro d'argent", "album6.jpg", IAM, "", "Sortie : 1997\n16 titres - 1h13min");
Album DF = stubAlbum.GetAlbumByName("Deux Frères") ?? new Album("Deux Frères", "album7.png", PNL, "", "Sortie : 2019\n22 titres");
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<InfoTitle>()
/// <summary>
/// Constructeur de la classe StubInfoTitle
/// </summary>
public StubInfoTitle()
{
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),
stubAlbum = new StubAlbum();
Artist ImagineDragons = StubAlbum.StubArtist.GetArtistByName("Imagine Dragons") ?? new Artist("Imagine Dragons");
Artist PNL = StubAlbum.StubArtist.GetArtistByName("PNL") ?? new Artist("PNL");
Artist Nepal = StubAlbum.StubArtist.GetArtistByName("Népal") ?? new Artist("Népal");
Artist Booba = StubAlbum.StubArtist.GetArtistByName("Booba") ?? new Artist("Booba");
Artist IAM = StubAlbum.StubArtist.GetArtistByName("IAM") ?? new Artist("IAM");
Artist Hugo = StubAlbum.StubArtist.GetArtistByName("Hugo TSR") ?? new Artist("Hugo TSR");
Artist Oxmo = StubAlbum.StubArtist.GetArtistByName("Oxmo Puccino") ?? new Artist("Oxmo Puccino");
Album MercuryAct2 = stubAlbum.GetAlbumByName("Mercury Act 2") ?? new Album("Mercury Act 2", "album14.png", ImagineDragons, "desc", "infos");
Album MercuryAct1 = stubAlbum.GetAlbumByName("Mercury Act 1") ?? new Album("Mercury Act 1", "album13.png", ImagineDragons, "desc", "infos");
Album Origins = stubAlbum.GetAlbumByName("Origins") ?? new Album("Origins", "album12.png", ImagineDragons, "desc", "infos");
Album Evolve = stubAlbum.GetAlbumByName("Evolve") ?? new Album("Evolve", "album11.png", ImagineDragons, "desc", "infos");
Album SmokeAndMirrors = stubAlbum.GetAlbumByName("Smoke & Mirrors") ?? new Album("Smoke & Mirrors", "album11.png", ImagineDragons, "desc", "infos");
Album NightVisions = stubAlbum.GetAlbumByName("Night Visions") ?? new Album("Night Visions", "album11.png", ImagineDragons, "desc", "infos");
Album AB = stubAlbum.GetAlbumByName("Adios Bahamas") ?? new Album("Adios Bahamas", "album1.jpg", Nepal, "Album post-mortem qui signé également le dernier de l'artiste", "Sortie : 2020");
Album E445 = stubAlbum.GetAlbumByName("445e Nuit") ?? new Album("445e Nuit", "album2.jpg", Nepal, "", "Sortie : 2017\n8 titres - 24 min");
Album FSR = stubAlbum.GetAlbumByName("Fenêtre Sur Rue") ?? new Album("Fenêtre Sur Rue", "album3.jpg", Hugo, "", "Sortie : 2012\n14 titres - 46 min");
Album TM = stubAlbum.GetAlbumByName("Temps Mort") ?? new Album("Temps Mort", "album4.jpg", Booba, "Premier album de Booba", "Sortie : 2002\n14 titres - 57 min");
Album OP = stubAlbum.GetAlbumByName("Opéra Puccino") ?? new Album("Opéra Puccino", "album5.jpg", Oxmo, "", "Sortie : 1998\n18 titres - 1h08min");
Album EMA = stubAlbum.GetAlbumByName("L'école du micro d'argent") ?? new Album("L'école du micro d'argent", "album6.jpg", IAM, "", "Sortie : 1997\n16 titres - 1h13min");
Album DF = stubAlbum.GetAlbumByName("Deux Frères") ?? new Album("Deux Frères", "album7.png", PNL, "", "Sortie : 2019\n22 titres");
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<InfoTitle>()
{
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),
new InfoTitle("My life", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Lonely", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Wrecked", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Monday", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("#1", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Easy come easy go", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Giants", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("It's ok", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Dull knives", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Follow you", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Cutthroat", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("No time for toxic people", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("One day", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Enemy", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("My life", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Lonely", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Wrecked", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Monday", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("#1", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Easy come easy go", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Giants", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("It's ok", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Dull knives", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Follow you", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Cutthroat", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("No time for toxic people", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("One day", MercuryAct1.ImageURL, "infos", "desc", Genre.POP, MercuryAct1.ID),
new InfoTitle("Natural", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Boomerang", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Machine", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Cool out", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Bad Liar", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("West coast", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Zero", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Bullet in a gun", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Digital", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Only", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Stuck", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Love", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Natural", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Boomerang", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Machine", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Cool out", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Bad Liar", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("West coast", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Zero", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Bullet in a gun", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Digital", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Only", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Stuck", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("Love", Origins.ImageURL, "infos", "desc", Genre.POP, Origins.ID),
new InfoTitle("I don't know why", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Whatever it takes", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Believer", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Walking the wire", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Rise up", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("I'll make it up to you", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Yesterday", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Mouth of the river", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Thunder", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Start over", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Dancing in the dark", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("I don't know why", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Whatever it takes", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Believer", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Walking the wire", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Rise up", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("I'll make it up to you", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Yesterday", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Mouth of the river", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Thunder", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Start over", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Dancing in the dark", Evolve.ImageURL, "infos", "desc", Genre.POP, Evolve.ID),
new InfoTitle("Shots", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Gold", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Smoke and Mirrors", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("I'm so sorry", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("I bet my life", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Polaroid", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Friction", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("It comes back to you", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Dream", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Trouble", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Summer", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Hopeless Opus", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("The fall", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Thief", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("The Unknown", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Second chances", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Release", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Warriors", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Shots", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Gold", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Smoke and Mirrors", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("I'm so sorry", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("I bet my life", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Polaroid", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Friction", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("It comes back to you", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Dream", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Trouble", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Summer", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Hopeless Opus", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("The fall", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Thief", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("The Unknown", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Second chances", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Release", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Warriors", SmokeAndMirrors.ImageURL, "infos", "desc", Genre.POP, SmokeAndMirrors.ID),
new InfoTitle("Radioactive", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Tiptoe", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("It's time", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Demons", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("On top of the world", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Amsterdam", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Hear me", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Every night", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Bleeding out", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Underdog", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Nothing left to say / Rocks", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Cha-ching (till we grow older)", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Working man", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("My fault", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Round and round", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("The river", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("America", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Selene", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Fallen", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Cover up", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Love of mine", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Bubble", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Tokyo", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Radioactive", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Tiptoe", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("It's time", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Demons", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("On top of the world", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Amsterdam", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Hear me", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Every night", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Bleeding out", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Underdog", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Nothing left to say / Rocks", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Cha-ching (till we grow older)", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Working man", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("My fault", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Round and round", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("The river", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("America", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Selene", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Fallen", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Cover up", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Love of mine", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Bubble", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Tokyo", NightVisions.ImageURL, "infos", "desc", Genre.POP, NightVisions.ID),
new InfoTitle("Opening", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Ennemis, Pt. 2", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("En face", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Trajectoire", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Vibe", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Lemonade", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Là-bas", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Sundance", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Milionaire", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Sans voir", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Crossfader", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Daruma", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Opening", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Ennemis, Pt. 2", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("En face", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Trajectoire", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Vibe", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Lemonade", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Là-bas", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Sundance", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Milionaire", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Sans voir", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Crossfader", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Daruma", AB.ImageURL, "infos", "desc", Genre.HIP_HOP, AB.ID),
new InfoTitle("Niveau 1", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Maladavexa", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Love64 (Interlude)", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Deadpornstars", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Jugements", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Insomnie", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Kodak White", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Kamehouse", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Niveau 1", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Maladavexa", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Love64 (Interlude)", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Deadpornstars", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Jugements", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Insomnie", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Kodak White", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Kamehouse", E445.ImageURL, "infos", "desc", Genre.HIP_HOP, E445.ID),
new InfoTitle("Temps Mort", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Independants", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Ecoute bien", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Ma définition", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Jusqu'ici tout va bien", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Repose en paix", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Le Bitume avec une plume", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Animals", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Sans ratures", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("100-8 zoo", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("On m'a dit", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Nouvelle école", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("De mauvaise augure", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Strass et paillettes", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Temps Mort", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Independants", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Ecoute bien", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Ma définition", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Jusqu'ici tout va bien", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Repose en paix", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Le Bitume avec une plume", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Animals", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Sans ratures", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("100-8 zoo", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("On m'a dit", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Nouvelle école", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("De mauvaise augure", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Strass et paillettes", TM.ImageURL, "infos", "desc", Genre.HIP_HOP, TM.ID),
new InfoTitle("Visions de vie", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Black Mafioso (Interlude)", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Hitman", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Qui peut le nier !", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Peur noire", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("L'enfant seul", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Alias Jon Smoke", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Peu de gens le savent (Interlude)", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Amour & jalousie", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("24 heures à vivre", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Sacré samedi soir", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Le jour où tu partiras", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Sortilège", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Black Cyrano de Bergerac (Interlude)", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Mensongeur", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("La lettre", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("La loi du point final", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Mourir 1000 fois", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Visions de vie", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Black Mafioso (Interlude)", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Hitman", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Qui peut le nier !", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Peur noire", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("L'enfant seul", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Alias Jon Smoke", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Peu de gens le savent (Interlude)", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Amour & jalousie", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("24 heures à vivre", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Sacré samedi soir", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Le jour où tu partiras", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Sortilège", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Black Cyrano de Bergerac (Interlude)", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Mensongeur", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("La lettre", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("La loi du point final", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("Mourir 1000 fois", OP.ImageURL, "infos", "desc", Genre.HIP_HOP, OP.ID),
new InfoTitle("L'école du micro d'argent", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Dangereux", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Nés sous la même étoile", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("La Saga", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Petit frère", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Elle donne son corps avant son nom", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("L'empire du côté obscur", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Regarde", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("L'Enfer", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Quand tu allais, on revenait", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Chez le mac", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Un bon son brut pour les truands", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Bouger la tête", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Un cri court dans la nuit", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Libère mon imagination", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Demain, c'est loin", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("L'école du micro d'argent", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Dangereux", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Nés sous la même étoile", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("La Saga", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Petit frère", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Elle donne son corps avant son nom", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("L'empire du côté obscur", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Regarde", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("L'Enfer", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Quand tu allais, on revenait", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Chez le mac", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Un bon son brut pour les truands", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Bouger la tête", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Un cri court dans la nuit", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Libère mon imagination", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Demain, c'est loin", EMA.ImageURL, "infos", "desc", Genre.HIP_HOP, EMA.ID),
new InfoTitle("Au DD", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Autre monde", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Chang", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Blanka", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("91's", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("À l'ammoniaque", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Celsius", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Deux frères", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Hasta la Vista", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Coeurs", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Shenmue", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Kuta Ubud", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Menace", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Zoulou Tchaing", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Déconnecté", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("La misère est si belle", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Au DD", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Autre monde", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Chang", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Blanka", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("91's", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("À l'ammoniaque", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Celsius", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Deux frères", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Hasta la Vista", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Coeurs", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Shenmue", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Kuta Ubud", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Menace", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Zoulou Tchaing", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("Déconnecté", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("La misère est si belle", DF.ImageURL, "infos", "desc", Genre.HIP_HOP, DF.ID),
new InfoTitle("DA", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Naha", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Dans la légende", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Mira", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("J'suis QLF", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("La vie est belle", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Kratos", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Luz de Luna", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Tu sais pas", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Sheita", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Humain", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Bambina", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Bené", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Uranus", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Onizuka", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Jusqu'au dernier gramme", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("DA", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Naha", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Dans la légende", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Mira", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("J'suis QLF", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("La vie est belle", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Kratos", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Luz de Luna", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Tu sais pas", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Sheita", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Humain", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Bambina", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Bené", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Uranus", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Onizuka", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Jusqu'au dernier gramme", DLL.ImageURL, "infos", "desc", Genre.HIP_HOP, DLL.ID),
new InfoTitle("Point de départ", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Ugotrip", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Alors dites pas", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Coma artificiel", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Fenêtre sur rue", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("La ligne verte", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Eldorado", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Interlude", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Dojo", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Piège à loup", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Intact", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Dégradation", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Old Boy", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Point final", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID)
};
}
new InfoTitle("Point de départ", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Ugotrip", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Alors dites pas", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Coma artificiel", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Fenêtre sur rue", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("La ligne verte", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Eldorado", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Interlude", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Dojo", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Piège à loup", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Intact", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Dégradation", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Old Boy", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID),
new InfoTitle("Point final", FSR.ImageURL, "infos", "desc", Genre.HIP_HOP, FSR.ID)
};
}
public ObservableCollection<InfoTitle> GetInfoTitles()
{
return infoTitles;
}
public List<InfoTitle> GetInfoTitlesByNames(List<string> names)
{
List<InfoTitle> infos = new List<InfoTitle>();
foreach(var name in names)
/// <summary>
/// Permet d'obtenir une liste des InfoTitle
/// </summary>
/// <returns>Retourne une liste des InfoTitle</returns>
public ObservableCollection<InfoTitle> GetInfoTitles()
{
foreach(var titles in infoTitles)
return infoTitles;
}
/// <summary>
/// Permet d'obtenir des InfoTitle selon les noms donnés en paramètre
/// </summary>
/// <param name="names">Liste des noms des InfoTitle recherchés</param>
/// <returns>Retourne la liste des InfoTitle correspondant aux noms passés en paramètre</returns>
public List<InfoTitle> GetInfoTitlesByNames(List<string> names)
{
List<InfoTitle> infos = new List<InfoTitle>();
foreach (var name in names)
{
if (name == titles.Name)
foreach (var titles in infoTitles)
{
infos.Add(titles);
if (name == titles.Name)
{
infos.Add(titles);
}
}
}
return infos;
}
/// <summary>
/// Permet d'ajouter un InfoTitle à la liste des InfoTitle
/// </summary>
/// <param name="title">InfoTitle à ajouter</param>
public void AddInfoTitle(InfoTitle title)
{
infoTitles.Add(title);
}
/// <summary>
/// Permet de retirer un InfoTitle de la liste des InfoTitle
/// </summary>
/// <param name="title">InfoTitle à retirer</param>
public void RemoveInfoTitle(InfoTitle title)
{
infoTitles.Remove(title);
}
/// <summary>
/// Permet d'ajouter un artiste à la liste des feat d'un InfoTitle
/// </summary>
/// <param name="infoTitle">InfoTitle dans lequel ajouter le feat</param>
/// <param name="artist">Artist à ajouter dans la liste des feats de l'InfoTitle</param>
public static void AddFeat(InfoTitle infoTitle, Artist artist)
{
infoTitle.AddFeat(artist);
}
/// <summary>
/// Permet de retirer un artiste de la liste des feat d'un InfoTitle
/// </summary>
/// <param name="infoTitle">InfoTitle depuis lequel retirer le feat</param>
/// <param name="artist">Artist à retirer de la liste des feats de l'InfoTitle</param>
public static void RemoveFeat(InfoTitle infoTitle, Artist artist)
{
infoTitle.RemoveFeat(artist);
}
return infos;
}
public void AddInfoTitle(InfoTitle title)
{
infoTitles.Add(title);
}
public void RemoveInfoTitle(InfoTitle title)
{
infoTitles.Remove(title);
}
public static void AddFeat(InfoTitle infoTitle, Artist artist)
{
infoTitle.AddFeat(artist);
}
public static void RemoveFeat(InfoTitle infoTitle, Artist artist)
{
infoTitle.RemoveFeat(artist);
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,55 +1,79 @@
using System.Collections.ObjectModel;
namespace Model.Stub;
public class StubPlaylist
namespace Model.Stub
{
public ObservableCollection<Playlist> Playlists
public class StubPlaylist
{
get => playlists;
}
private readonly ObservableCollection<Playlist> playlists;
public ObservableCollection<Playlist> Playlists
{
get => playlists;
}
public StubPlaylist()
{
Playlist Playlist1 = new Playlist("Playlist1", "desc1", "url1.png");
Playlist Playlist2 = new Playlist("Playlist2", "desc2", "url2.png");
Playlist Playlist3 = new Playlist("Playlist3", "desc3", "url3.png");
Playlist Playlist4 = new Playlist("Playlist4", "desc4", "url4.png");
Playlist Playlist5 = new Playlist("Playlist5", "desc5", "url5.png");
Playlist Playlist6 = new Playlist("Playlist6", "desc6", "url6.png");
Playlist Playlist7 = new Playlist("Playlist7", "desc7", "url7.png");
Playlist Playlist8 = new Playlist("Playlist8", "desc8", "url8.png");
Playlist Playlist9 = new Playlist("Playlist9", "desc9", "url9.png");
playlists = new ObservableCollection<Playlist>()
private readonly ObservableCollection<Playlist> playlists;
/// <summary>
/// Constructeur de la classe StubPlaylist
/// </summary>
public StubPlaylist()
{
Playlist1, Playlist2, Playlist3, Playlist4, Playlist5, Playlist6, Playlist7, Playlist8, Playlist9
};
}
Playlist Playlist1 = new Playlist("Playlist1", "desc1", "url1.png");
Playlist Playlist2 = new Playlist("Playlist2", "desc2", "url2.png");
Playlist Playlist3 = new Playlist("Playlist3", "desc3", "url3.png");
Playlist Playlist4 = new Playlist("Playlist4", "desc4", "url4.png");
Playlist Playlist5 = new Playlist("Playlist5", "desc5", "url5.png");
Playlist Playlist6 = new Playlist("Playlist6", "desc6", "url6.png");
Playlist Playlist7 = new Playlist("Playlist7", "desc7", "url7.png");
Playlist Playlist8 = new Playlist("Playlist8", "desc8", "url8.png");
Playlist Playlist9 = new Playlist("Playlist9", "desc9", "url9.png");
playlists = new ObservableCollection<Playlist>()
{
Playlist1, Playlist2, Playlist3, Playlist4, Playlist5, Playlist6, Playlist7, Playlist8, Playlist9
};
}
public ObservableCollection<Playlist> GetPlaylists()
{
return playlists;
}
public Playlist GetPlaylistByName(string name)
{
foreach(var playlist in playlists)
/// <summary>
/// Permet d'obtenir la liste des Playlist
/// </summary>
/// <returns>Retourne la liste des Playlist</returns>
public ObservableCollection<Playlist> GetPlaylists()
{
if (playlist.Name == name)
return playlists;
}
/// <summary>
/// Permet d'obtenir une Playlist selon son nom
/// </summary>
/// <param name="name">Nom de la Playlist recherchée</param>
/// <returns>Retourne la Playlist correspondant au nom donné en paramètre</returns>
public Playlist GetPlaylistByName(string name)
{
foreach (var playlist in playlists)
{
return playlist;
if (playlist.Name == name)
{
return playlist;
}
}
return null;
}
/// <summary>
/// Permet d'ajouter une Playlist à la liste des Playlist
/// </summary>
/// <param name="playlist"></param>
public void AddPlaylist(Playlist playlist)
{
playlists.Add(playlist);
}
/// <summary>
/// Permet de retirer une Playlist de la liste des Playlist
/// </summary>
/// <param name="playlist"></param>
public void RemovePlaylist(Playlist playlist)
{
playlists.Remove(playlist);
}
return null;
}
public void AddPlaylist(Playlist playlist)
{
playlists.Add(playlist);
}
public void RemovePlaylist(Playlist playlist)
{
playlists.Remove(playlist);
}
}
}

@ -3,92 +3,119 @@ using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
namespace Model;
public class Title
namespace Model
{
public event PropertyChangedEventHandler PropertyChanged;
public string Name
/// <remarks>
/// Classe Title
/// </remarks>
public class Title : INotifyPropertyChanged
{
get => name;
set
public event PropertyChangedEventHandler PropertyChanged;
public string Name
{
if (string.IsNullOrWhiteSpace(value) || value.Length > Manager.MAX_NAME_LENGTH)
get => name;
set
{
value = "IncorrectName";
if (string.IsNullOrWhiteSpace(value) || value.Length > Manager.MAX_NAME_LENGTH)
{
value = "IncorrectName";
}
name = value;
OnPropertyChanged();
}
name = value;
OnPropertyChanged();
}
}
private string name = Manager.DEFAULT_NAME;
public string ImageURL
{
get => imageURL;
private string name = Manager.DEFAULT_NAME;
set
public string ImageURL
{
if (value == null || !value.Contains('.'))
{
value = "none.png";
imageURL = value;
}
else if (value.Contains('.'))
get => imageURL;
set
{
imageURL = value;
if (value == null || !value.Contains('.'))
{
value = "none.png";
imageURL = value;
}
else if (value.Contains('.'))
{
imageURL = value;
}
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private string imageURL = Manager.DEFAULT_URL;
public string Information
{
get => information;
private string imageURL = Manager.DEFAULT_URL;
set
public string Information
{
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
get => information;
set
{
information = value;
if (value != null && value.Length < Manager.MAX_DESCRIPTION_LENGTH)
{
information = value;
}
OnPropertyChanged();
}
OnPropertyChanged();
}
}
private string information = Manager.DEFAULT_DESC;
private string information = Manager.DEFAULT_DESC;
public Title(string nom, string file_Name, string informations)
{
Name = nom;
ImageURL = file_Name;
Information = informations;
}
/// <summary>
/// Constructeur de la classe Title
/// </summary>
/// <param name="nom">Nom du Title</param>
/// <param name="file_Name">Chemin d'accès de l'image du Title</param>
/// <param name="informations">Informations sur le Title</param>
public Title(string nom, string file_Name, string informations)
{
Name = nom;
ImageURL = file_Name;
Information = informations;
}
public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(Title)) return false;
if (obj is Title title && Name == title.Name) return true;
else return false;
}
/// <summary>
/// Fonction qui permet de déterminer si deux objets Title sont égaux
/// </summary>
/// <param name="obj"></param>
/// <returns>Un booléen indiquant si l'objet est égal</returns>
public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(Title)) return false;
if (obj is Title title && Name == title.Name) return true;
else return false;
}
public override int GetHashCode()
{
return ImageURL.GetHashCode();
}
/// <summary>
/// Permet de déterminer le hash d'un objet Title
/// </summary>
/// <returns>Hash de l'attribut Name</returns>
public override int GetHashCode()
{
return Name.GetHashCode();
}
public override string ToString()
{
return $"Name : {Name}";
}
/// <summary>
/// Permet de convertir un objet Title en string
/// </summary>
/// <returns>Une nouvelle chaîne caractères contenant le nom du Title</returns>
public override string ToString()
{
return $"Name : {Name}";
}
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// Permet la notification, et donc l'actualisation des objets connectés à l'événement lorsque la méthode est appelée
/// </summary>
/// <param name="propertyName">Nom de la propriété modifiée</param>
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}

@ -10,7 +10,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Plugin.Maui.Audio" Version="1.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Loading…
Cancel
Save