diff --git a/Mear/Mear/Mear.csproj b/Mear/Mear/Mear.csproj
index 2bddbb3..0bd109c 100644
--- a/Mear/Mear/Mear.csproj
+++ b/Mear/Mear/Mear.csproj
@@ -38,6 +38,9 @@
MSBuild:UpdateDesignTimeXaml
+
+ MSBuild:UpdateDesignTimeXaml
+
MSBuild:UpdateDesignTimeXaml
diff --git a/Mear/Mear/Models/Song.cs b/Mear/Mear/Models/Song.cs
index f96ea4c..2b6c2cc 100644
--- a/Mear/Mear/Models/Song.cs
+++ b/Mear/Mear/Models/Song.cs
@@ -1,13 +1,18 @@
using System;
using System.Collections.Generic;
+using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
+using SQLite;
namespace Mear.Models
{
+ [DataContract]
+ [Table("Song")]
public class Song
{
+ [PrimaryKey, Column("Id"), AutoIncrement]
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("title")]
@@ -24,7 +29,7 @@ namespace Mear.Models
public int? Duration { get; set; }
[JsonProperty("filename")]
public string Filename { get; set; }
- [JsonProperty("song_path")]
+ [JsonIgnore]
public string SongPath { set; get; }
}
}
diff --git a/Mear/Mear/Playback/MearPlayer.cs b/Mear/Mear/Playback/MearPlayer.cs
index 6507ca3..be40a58 100644
--- a/Mear/Mear/Playback/MearPlayer.cs
+++ b/Mear/Mear/Playback/MearPlayer.cs
@@ -55,7 +55,8 @@ namespace Mear.Playback
var response = client.DownloadData(request);
await CrossMediaManager.Current.Play(tmpFile);
- var title = CrossMediaManager.Current.MediaQueue.Title;
+ var title = CrossMediaManager.Current.MediaQueue.Current.Title;
+ var ttl = CrossMediaManager.Current.MediaQueue.Title;
}
}
catch (Exception ex)
diff --git a/Mear/Mear/Repositories/Database/DBSongRepository.cs b/Mear/Mear/Repositories/Database/DBSongRepository.cs
new file mode 100644
index 0000000..088ce53
--- /dev/null
+++ b/Mear/Mear/Repositories/Database/DBSongRepository.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using SQLite;
+
+using Mear.Constants.App;
+using Mear.Models;
+
+namespace Mear.Repositories.Database
+{
+ public class DBSongRepository : DBRepository
+ {
+ #region Fields
+ #endregion
+
+
+ #region Properties
+ #endregion
+
+
+ #region Constructors
+ public DBSongRepository()
+ {
+ Initialize();
+ }
+ #endregion
+
+
+ #region Methods
+ public Song RetrieveSong(int id)
+ {
+ try
+ {
+ var song = _Db.Table().Where(s => s.Id == id).First();
+
+ return song;
+ }
+ catch (Exception ex)
+ {
+ var msg = ex.Message;
+ }
+
+ return null;
+ }
+ public Song RetrieveSong(string artist, string title)
+ {
+ try
+ {
+ var song = _Db.Table().Where(s =>
+ (s.Artist.Equals(artist) && s.Title.Equals(title))).First();
+
+ return song;
+ }
+ catch (Exception ex)
+ {
+ var msg = ex.Message;
+ }
+
+ return null;
+ }
+
+ public void SaveSong(Song song)
+ {
+ if (!DoesTableExist("Song"))
+ {
+ _Db.CreateTable();
+ }
+
+ _Db.Insert(song);
+ }
+ public void UpdateSong(Song song)
+ {
+ if (!DoesTableExist("Song"))
+ {
+ return;
+ }
+
+ // TODO: Implement functionality for udpating song
+ }
+ #endregion
+ }
+}
diff --git a/Mear/Mear/Views/MearPlayerView.xaml b/Mear/Mear/Views/MearPlayerView.xaml
new file mode 100644
index 0000000..58b9394
--- /dev/null
+++ b/Mear/Mear/Views/MearPlayerView.xaml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mear/Mear/Views/MearPlayerView.xaml.cs b/Mear/Mear/Views/MearPlayerView.xaml.cs
new file mode 100644
index 0000000..c0cc809
--- /dev/null
+++ b/Mear/Mear/Views/MearPlayerView.xaml.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms;
+using Xamarin.Forms.Xaml;
+
+namespace Mear.Views
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class MearPlayerView : ContentPage
+ {
+ public MearPlayerView()
+ {
+ InitializeComponent();
+ }
+
+ private void Previous_Clicked(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Play_Clicked(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Next_Clicked(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Mear/Mear/Views/SongView.xaml.cs b/Mear/Mear/Views/SongView.xaml.cs
index cd44f71..e3893a1 100644
--- a/Mear/Mear/Views/SongView.xaml.cs
+++ b/Mear/Mear/Views/SongView.xaml.cs
@@ -50,6 +50,7 @@ namespace Mear.Views
{
var song = (Song)SongListView.SelectedItem;
await MearPlayer.StreamSongDemoAsync(song);
+ await Navigation.PushModalAsync(new MearPlayerView());
}
catch (Exception ex)
{