Continuing work on the player view

This commit is contained in:
amazing-username
2019-05-31 22:29:25 -04:00
parent e0de184cc8
commit c1fe9d45a4
5 changed files with 113 additions and 6 deletions
+1
View File
@@ -15,6 +15,7 @@
<PackageReference Include="Plugin.MediaManager" Version="0.6.1" />
<PackageReference Include="RestSharp" Version="106.6.9" />
<PackageReference Include="sqlite-net-pcl" Version="1.5.231" />
<PackageReference Include="taglib" Version="2.1.0" />
<PackageReference Include="Xamarin.Forms" Version="4.0.0.425677" />
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
</ItemGroup>
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Text;
using TagLib;
using Mear.Models;
namespace Mear.Utilities
{
public class SongMetadataRetriever
{
#region Fields
#endregion
#region Properties
#endregion
#region Constructors
#endregion
#region Methods
public Song ExtractData(string songPath)
{
try
{
}
catch (Exception ex)
{
var msg = ex.Message;
}
return null;
}
#endregion
}
}
+22 -3
View File
@@ -12,17 +12,36 @@
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image x:Name="SongCover"
Grid.Row="0"
Grid.Row="1"
Source="" />
<StackLayout Grid.Row="2">
<Label x:Name="SongTitle"
Text="Title" />
<Label x:Name="ArtistName"
Text="Artist" />
<Label x:Name="AlbumName"
Text="Album"/>
</StackLayout>
<StackLayout Orientation="Horizontal"
Grid.Row="2">
Grid.Row="3">
<Button x:Name="Repeat"
Text="Rep"
Clicked="Repeat_Clicked" />
<Button x:Name="Shuffle"
Text="Shf"
Clicked="Shuffle_Clicked" />
</StackLayout>
<StackLayout Orientation="Horizontal"
Grid.Row="4">
<Label x:Name="StartTime"
Text="0:00" />
<ProgressBar x:Name="SongProgress"
@@ -33,7 +52,7 @@
</StackLayout>
<StackLayout Orientation="Horizontal"
HorizontalOptions="CenterAndExpand"
Grid.Row="3"
Grid.Row="5"
Spacing="5">
<Button x:Name="Previous"
Text="Prev"
+49 -2
View File
@@ -7,29 +7,76 @@ using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Mear.Models;
namespace Mear.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MearPlayerView : ContentPage
{
#region Fields
private Song _song;
#endregion
#region Properties
#endregion
#region Constructors
public MearPlayerView()
{
InitializeComponent();
Initialize();
}
public MearPlayerView(Song song)
{
InitializeComponent();
_song = song;
Initialize();
InitializeControls();
}
#endregion
#region Methods
private void Initialize()
{
SongTitle.Text = "";
ArtistName.Text = "";
AlbumName.Text = "";
EndTime.Text = "";
}
private void InitializeControls()
{
SongTitle.Text = _song.Title;
ArtistName.Text = _song.Artist;
AlbumName.Text = _song.Album;
EndTime.Text = $"{_song.Duration}";
}
#region Events
private void Previous_Clicked(object sender, EventArgs e)
{
}
private void Play_Clicked(object sender, EventArgs e)
{
}
private void Next_Clicked(object sender, EventArgs e)
{
}
private void Repeat_Clicked(object sender, EventArgs e)
{
}
private void Shuffle_Clicked(object sender, EventArgs e)
{
}
#endregion
#endregion
}
}
+1 -1
View File
@@ -50,7 +50,7 @@ namespace Mear.Views
{
var song = (Song)SongListView.SelectedItem;
await MearPlayer.StreamSongDemoAsync(song);
await Navigation.PushModalAsync(new MearPlayerView());
await Navigation.PushModalAsync(new MearPlayerView(song));
}
catch (Exception ex)
{