Continuing work on the player view
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
<PackageReference Include="Plugin.MediaManager" Version="0.6.1" />
|
<PackageReference Include="Plugin.MediaManager" Version="0.6.1" />
|
||||||
<PackageReference Include="RestSharp" Version="106.6.9" />
|
<PackageReference Include="RestSharp" Version="106.6.9" />
|
||||||
<PackageReference Include="sqlite-net-pcl" Version="1.5.231" />
|
<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.Forms" Version="4.0.0.425677" />
|
||||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||||
</ItemGroup>
|
</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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,17 +12,36 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Image x:Name="SongCover"
|
<Image x:Name="SongCover"
|
||||||
Grid.Row="0"
|
Grid.Row="1"
|
||||||
Source="" />
|
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"
|
<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"
|
<Label x:Name="StartTime"
|
||||||
Text="0:00" />
|
Text="0:00" />
|
||||||
<ProgressBar x:Name="SongProgress"
|
<ProgressBar x:Name="SongProgress"
|
||||||
@@ -33,7 +52,7 @@
|
|||||||
</StackLayout>
|
</StackLayout>
|
||||||
<StackLayout Orientation="Horizontal"
|
<StackLayout Orientation="Horizontal"
|
||||||
HorizontalOptions="CenterAndExpand"
|
HorizontalOptions="CenterAndExpand"
|
||||||
Grid.Row="3"
|
Grid.Row="5"
|
||||||
Spacing="5">
|
Spacing="5">
|
||||||
<Button x:Name="Previous"
|
<Button x:Name="Previous"
|
||||||
Text="Prev"
|
Text="Prev"
|
||||||
|
|||||||
@@ -7,29 +7,76 @@ using System.Threading.Tasks;
|
|||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
using Mear.Models;
|
||||||
|
|
||||||
namespace Mear.Views
|
namespace Mear.Views
|
||||||
{
|
{
|
||||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
public partial class MearPlayerView : ContentPage
|
public partial class MearPlayerView : ContentPage
|
||||||
{
|
{
|
||||||
|
#region Fields
|
||||||
|
private Song _song;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
public MearPlayerView()
|
public MearPlayerView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
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 Previous_Clicked(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Play_Clicked(object sender, EventArgs e)
|
private void Play_Clicked(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Next_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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ namespace Mear.Views
|
|||||||
{
|
{
|
||||||
var song = (Song)SongListView.SelectedItem;
|
var song = (Song)SongListView.SelectedItem;
|
||||||
await MearPlayer.StreamSongDemoAsync(song);
|
await MearPlayer.StreamSongDemoAsync(song);
|
||||||
await Navigation.PushModalAsync(new MearPlayerView());
|
await Navigation.PushModalAsync(new MearPlayerView(song));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user