diff --git a/Sources/Linaris/FooterPage.xaml b/Sources/Linaris/FooterPage.xaml index f1ad801..316c6ba 100644 --- a/Sources/Linaris/FooterPage.xaml +++ b/Sources/Linaris/FooterPage.xaml @@ -1,45 +1,18 @@ - + - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/Sources/Linaris/FooterPage.xaml.cs b/Sources/Linaris/FooterPage.xaml.cs index 1bd4920..17ca4a5 100644 --- a/Sources/Linaris/FooterPage.xaml.cs +++ b/Sources/Linaris/FooterPage.xaml.cs @@ -5,57 +5,12 @@ namespace Linaris; public partial class FooterPage : ContentView { - /*WaveOutEvent outputDevice; - AudioFileReader audioFile; - System.Timers.Timer timer; - bool changementManuel = true; - bool closing = false; - string morceauEnCours;*/ - public FooterPage() { InitializeComponent(); - /*outputDevice = new WaveOutEvent();*/ - - // (s,a) = convention, s = sender, a = arguments, si appli fermée, on free tout - /*outputDevice.PlaybackStopped += PlaybackStoppedHandler; - - morceauEnCours = Path.Combine(AppContext.BaseDirectory, "Resources", "Musics", "winter.mp3"); - audioFile = new AudioFileReader(morceauEnCours); - outputDevice.Init(audioFile);*/ - } - - public void PlayAudio(string path) - { - using (var stream = File.OpenRead(path)) - { - var audioPlayer = AudioManager.Current.CreatePlayer(stream); - audioPlayer.Volume = 100.0f; - audioPlayer.Play(); - } + BindingContext = (Application.Current as App).Manager; } - public void PlayButton_Clicked(object sender, EventArgs e) - { - string CurrentPath = (Application.Current as App).Manager.CurrentPlaying.Path; - if (CurrentPath == null) return; - PlayAudio(CurrentPath); - /*string url = ((FileImageSource)Play.Source).File;*/ - /*if (url == "play.png") - { - outputDevice?.Play(); - Play.Source = "pause.png"; - Timer_Elapsed(sender, e); - timer = new System.Timers.Timer(1000); - timer.Elapsed += Timer_Elapsed; - timer.Enabled = true; - } - else - { - outputDevice?.Pause(); - Play.Source = "play.png"; - }*/ - } public void RewindButton_Clicked(Object sender, EventArgs e) { diff --git a/Sources/Linaris/Linaris.csproj b/Sources/Linaris/Linaris.csproj index 588adb8..d3bd266 100644 --- a/Sources/Linaris/Linaris.csproj +++ b/Sources/Linaris/Linaris.csproj @@ -52,6 +52,7 @@ + diff --git a/Sources/Linaris/LocalFilesPage.xaml.cs b/Sources/Linaris/LocalFilesPage.xaml.cs index 6a86604..d5c1fa4 100644 --- a/Sources/Linaris/LocalFilesPage.xaml.cs +++ b/Sources/Linaris/LocalFilesPage.xaml.cs @@ -1,9 +1,5 @@ using Model; -using Model.Serialization; -using Model.Stub; -using System; using System.Collections.ObjectModel; -using System.Diagnostics.Eventing.Reader; namespace Linaris { @@ -96,6 +92,20 @@ namespace Linaris } } + string SaveIconToDataFolder(MemoryStream stream, string iconName) + { + string dataFolderPath = FileSystem.AppDataDirectory; + string iconPath = Path.Combine(dataFolderPath, $"{iconName}.png"); + + using (FileStream fileStream = new FileStream(iconPath, FileMode.Create, FileAccess.Write)) + { + stream.Position = 0; + stream.CopyTo(fileStream); + } + + return iconPath; + } + async void AddToPlaylist(object sender, EventArgs e) { if (sender is Button button) diff --git a/Sources/Linaris/MainPage.xaml b/Sources/Linaris/MainPage.xaml index 9837833..5881f1a 100644 --- a/Sources/Linaris/MainPage.xaml +++ b/Sources/Linaris/MainPage.xaml @@ -2,6 +2,7 @@ @@ -12,10 +13,8 @@ - - -