diff --git a/Aurora.gtk/Aurora.gtk.csproj b/Aurora.gtk/Aurora.gtk.csproj
index 570b39c..ed2848c 100644
--- a/Aurora.gtk/Aurora.gtk.csproj
+++ b/Aurora.gtk/Aurora.gtk.csproj
@@ -1,5 +1,6 @@
+
Debug
@@ -110,6 +111,25 @@
..\packages\LibVLCSharp.Forms.GTK.3.0.0\lib\net47\LibVLCSharp.Forms.Platforms.GTK.dll
+
+ ..\packages\Google.Protobuf.3.8.0\lib\net45\Google.Protobuf.dll
+
+
+ ..\packages\System.Interactive.Async.3.2.0\lib\net46\System.Interactive.Async.dll
+
+
+ ..\packages\Grpc.Core.Api.1.21.0\lib\net45\Grpc.Core.Api.dll
+
+
+
+ ..\packages\Grpc.Core.1.21.0\lib\net45\Grpc.Core.dll
+
+
+ ..\packages\Xam.Plugins.Settings.3.1.1\lib\net45\Plugin.Settings.Abstractions.dll
+
+
+ ..\packages\Xam.Plugins.Settings.3.1.1\lib\net45\Plugin.Settings.dll
+
@@ -134,6 +154,7 @@
+
@@ -463,4 +484,6 @@
+
+
\ No newline at end of file
diff --git a/Aurora.gtk/Helpers/Settings.cs b/Aurora.gtk/Helpers/Settings.cs
new file mode 100644
index 0000000..301f469
--- /dev/null
+++ b/Aurora.gtk/Helpers/Settings.cs
@@ -0,0 +1,44 @@
+/*
+// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
+using Plugin.Settings;
+using Plugin.Settings.Abstractions;
+
+namespace Aurora.gtk.Helpers
+{
+ ///
+ /// This is the Settings static class that can be used in your Core solution or in any
+ /// of your client applications. All settings are laid out the same exact way with getters
+ /// and setters.
+ ///
+ public static class Settings
+ {
+ private static ISettings AppSettings
+ {
+ get
+ {
+ return CrossSettings.Current;
+ }
+ }
+
+ #region Setting Constants
+
+ private const string SettingsKey = "settings_key";
+ private static readonly string SettingsDefault = string.Empty;
+
+ #endregion
+
+
+ public static string GeneralSettings
+ {
+ get
+ {
+ return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
+ }
+ set
+ {
+ AppSettings.AddOrUpdateValue(SettingsKey, value);
+ }
+ }
+
+ }
+}*/
\ No newline at end of file
diff --git a/Aurora.gtk/packages.config b/Aurora.gtk/packages.config
index 1d268c1..1f0276f 100644
--- a/Aurora.gtk/packages.config
+++ b/Aurora.gtk/packages.config
@@ -1,5 +1,10 @@
+
+
+
+
+
@@ -7,6 +12,7 @@
+
@@ -14,6 +20,7 @@
+
diff --git a/Aurora/App.xaml b/Aurora/App.xaml
index f452747..f995cb5 100644
--- a/Aurora/App.xaml
+++ b/Aurora/App.xaml
@@ -1,26 +1,29 @@
-
+
-
-
-
- #FFFFFF
- #000000
-
-
- #F5C210
- #151C25
- #1E2634
- #151C25
- #44545C
-
-
-
-
-
+
+ #FFFFFF
+ #000000
+ #F5C210
+ #151C25
+ #1E2634
+ #151C25
+ #44545C
+
+
\ No newline at end of file
diff --git a/Aurora/App.xaml.cs b/Aurora/App.xaml.cs
index 2faa215..cc5f24c 100644
--- a/Aurora/App.xaml.cs
+++ b/Aurora/App.xaml.cs
@@ -1,5 +1,5 @@
using System;
-using Aurora.Frontend.Views.Main;
+using Aurora.Design.Views.Main;
using LibVLCSharp.Shared;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
diff --git a/Aurora/Aurora.csproj b/Aurora/Aurora.csproj
index 99cc804..a6be19b 100644
--- a/Aurora/Aurora.csproj
+++ b/Aurora/Aurora.csproj
@@ -1,45 +1,97 @@
-
-
-
- netstandard2.0
- true
-
-
-
- pdbonly
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Player.xaml
-
-
+
+
+ netstandard2.0
+ true
+
+
+ pdbonly
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Player.xaml
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Frontend/Behaviors/BehaviorBase.cs b/Aurora/Design/Behaviors/BehaviorBase.cs
similarity index 96%
rename from Aurora/Frontend/Behaviors/BehaviorBase.cs
rename to Aurora/Design/Behaviors/BehaviorBase.cs
index b353a54..70993eb 100644
--- a/Aurora/Frontend/Behaviors/BehaviorBase.cs
+++ b/Aurora/Design/Behaviors/BehaviorBase.cs
@@ -1,7 +1,7 @@
using System;
using Xamarin.Forms;
-namespace Aurora.Frontend.Behaviors
+namespace Aurora.Design.Behaviors
{
public class BehaviorBase : Behavior where T : BindableObject
{
diff --git a/Aurora/Frontend/Behaviors/EventToCommandBehavior.cs b/Aurora/Design/Behaviors/EventToCommandBehavior.cs
similarity index 99%
rename from Aurora/Frontend/Behaviors/EventToCommandBehavior.cs
rename to Aurora/Design/Behaviors/EventToCommandBehavior.cs
index 329be79..b8c111a 100644
--- a/Aurora/Frontend/Behaviors/EventToCommandBehavior.cs
+++ b/Aurora/Design/Behaviors/EventToCommandBehavior.cs
@@ -3,7 +3,7 @@ using System.Reflection;
using System.Windows.Input;
using Xamarin.Forms;
-namespace Aurora.Frontend.Behaviors
+namespace Aurora.Design.Behaviors
{
public class EventToCommandBehavior : BehaviorBase
{
diff --git a/Aurora/Frontend/Components/HorizontalList/HorizontalList.cs b/Aurora/Design/Components/HorizontalList/HorizontalList.cs
similarity index 99%
rename from Aurora/Frontend/Components/HorizontalList/HorizontalList.cs
rename to Aurora/Design/Components/HorizontalList/HorizontalList.cs
index 446718f..75e9577 100755
--- a/Aurora/Frontend/Components/HorizontalList/HorizontalList.cs
+++ b/Aurora/Design/Components/HorizontalList/HorizontalList.cs
@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Windows.Input;
using Xamarin.Forms;
-namespace Aurora.Frontend.Components.HorizontalList
+namespace Aurora.Design.Components.HorizontalList
{
public class HorizontalList : Grid
{
diff --git a/Aurora/Design/Components/HostSelector/HostSelector.xaml b/Aurora/Design/Components/HostSelector/HostSelector.xaml
new file mode 100644
index 0000000..dfd13e2
--- /dev/null
+++ b/Aurora/Design/Components/HostSelector/HostSelector.xaml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Design/Components/HostSelector/HostSelector.xaml.cs b/Aurora/Design/Components/HostSelector/HostSelector.xaml.cs
new file mode 100644
index 0000000..763d95f
--- /dev/null
+++ b/Aurora/Design/Components/HostSelector/HostSelector.xaml.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+
+namespace Aurora.Design.Components.HostSelector
+{
+ public enum ConnectionType
+ {
+ Host,
+ Client,
+ }
+
+ public enum SelectorState
+ {
+ SelectingHost,
+ EnteringCredentials,
+ }
+
+ public partial class HostSelector : ContentView
+ {
+
+ public HostSelector()
+ {
+ InitializeComponent();
+ //Set initial conditions
+ CredentialEditorLayout.IsVisible = true;
+
+ buttonHost.Clicked += OnButtonHostClicked;
+ buttonClient.Clicked += OnButtonClientClicked;
+ HostnameEntry.TextChanged += (sender, e) =>
+ {
+ Hostname = e.NewTextValue;
+ };
+ }
+
+
+ ///
+ /// On the host button clicked.
+ ///
+ /// Sender.
+ /// E.
+ void OnButtonHostClicked(object sender, EventArgs e)
+ {
+ if (HostCommand.CanExecute(null))
+ {
+ HostCommand.Execute(null);
+ }
+ }
+
+ ///
+ /// On the client button clicked.
+ ///
+ /// Sender.
+ /// E.
+ void OnButtonClientClicked(object sender, EventArgs e)
+ {
+ if (JoinCommand.CanExecute(null))
+ {
+ JoinCommand.Execute(null);
+ }
+ }
+
+ #region Host Selected Command
+ public static readonly BindableProperty HostCommandProperty =
+ BindableProperty.Create(propertyName: "HostSelectedCommand",
+ returnType: typeof(Command),
+ declaringType: typeof(HostSelector));
+
+ public Command HostCommand
+ {
+ get { return (Command)GetValue(HostCommandProperty); }
+ set { SetValue(HostCommandProperty, value); }
+ }
+
+ #endregion Host Selected Command
+
+ #region Client Selected Command
+ public static readonly BindableProperty JoinCommandProperty =
+ BindableProperty.Create(propertyName: "JoinSelectedCommand",
+ returnType: typeof(Command),
+ declaringType: typeof(HostSelector));
+
+ public Command JoinCommand
+ {
+ get { return (Command)GetValue(JoinCommandProperty); }
+ set { SetValue(JoinCommandProperty, value); }
+ }
+
+ #endregion Client Selected Command
+
+ #region Hostname property
+ public static readonly BindableProperty HostnameProperty =
+ BindableProperty.Create(propertyName: "Hostname",
+ returnType: typeof(string),
+ declaringType: typeof(HostSelector),
+ defaultBindingMode: BindingMode.TwoWay,
+ propertyChanged: OnHostNameChanged);
+
+ public string Hostname
+ {
+ get { return (string)GetValue(HostnameProperty); }
+ set { SetValue(HostnameProperty, value); }
+ }
+
+ private static void OnHostNameChanged(BindableObject bindable, object oldValue, object newValue)
+ {
+ string newVal = newValue as string;
+ HostSelector instance = bindable as HostSelector;
+ if (instance.HostnameEntry.Text != newVal)
+ {
+ instance.HostnameEntry.Text = newVal;
+ }
+
+ }
+
+ #endregion Hostname property
+
+
+ }
+
+}
diff --git a/Aurora/Frontend/Components/MediaPlayer/Player.xaml b/Aurora/Design/Components/MediaPlayer/Player.xaml
similarity index 95%
rename from Aurora/Frontend/Components/MediaPlayer/Player.xaml
rename to Aurora/Design/Components/MediaPlayer/Player.xaml
index 1d6a20f..3adaf56 100644
--- a/Aurora/Frontend/Components/MediaPlayer/Player.xaml
+++ b/Aurora/Design/Components/MediaPlayer/Player.xaml
@@ -2,7 +2,7 @@
+ x:Class="Aurora.Design.Components.MediaPlayer.Player">
diff --git a/Aurora/Frontend/Components/MediaPlayer/Player.xaml.cs b/Aurora/Design/Components/MediaPlayer/Player.xaml.cs
similarity index 84%
rename from Aurora/Frontend/Components/MediaPlayer/Player.xaml.cs
rename to Aurora/Design/Components/MediaPlayer/Player.xaml.cs
index aa70bdf..66aa244 100644
--- a/Aurora/Frontend/Components/MediaPlayer/Player.xaml.cs
+++ b/Aurora/Design/Components/MediaPlayer/Player.xaml.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using Xamarin.Forms;
-namespace Aurora.Frontend.Components.MediaPlayer
+namespace Aurora.Design.Components.MediaPlayer
{
public partial class Player : ContentView
{
diff --git a/Aurora/Frontend/Components/MediaPlayer/PlayerViewModel.cs b/Aurora/Design/Components/MediaPlayer/PlayerViewModel.cs
similarity index 96%
rename from Aurora/Frontend/Components/MediaPlayer/PlayerViewModel.cs
rename to Aurora/Design/Components/MediaPlayer/PlayerViewModel.cs
index 0e64edb..1232c5e 100644
--- a/Aurora/Frontend/Components/MediaPlayer/PlayerViewModel.cs
+++ b/Aurora/Design/Components/MediaPlayer/PlayerViewModel.cs
@@ -1,10 +1,10 @@
using System;
using Xamarin.Forms;
-using Aurora.Frontend.Views;
-using Aurora.Backend.Services.PlayerService;
-using Aurora.Backend.Models.Media;
+using Aurora.Design.Views;
+using Aurora.Services.PlayerService;
+using Aurora.Models.Media;
-namespace Aurora.Frontend.Components.MediaPlayer
+namespace Aurora.Design.Components.MediaPlayer
{
public class PlayerViewModel : BaseViewModel
{
diff --git a/Aurora/Frontend/Components/MemberList/MemberList.xaml b/Aurora/Design/Components/MemberList/MemberList.xaml
similarity index 79%
rename from Aurora/Frontend/Components/MemberList/MemberList.xaml
rename to Aurora/Design/Components/MemberList/MemberList.xaml
index f6fcc1b..ba3e38d 100644
--- a/Aurora/Frontend/Components/MemberList/MemberList.xaml
+++ b/Aurora/Design/Components/MemberList/MemberList.xaml
@@ -2,8 +2,8 @@
+ xmlns:hl="clr-namespace:Aurora.Design.Components.HorizontalList"
+ x:Class="Aurora.Design.Components.MemberList.MemberList">
+ Text="{Binding Username}"/>
diff --git a/Aurora/Frontend/Components/MemberList/MemberList.xaml.cs b/Aurora/Design/Components/MemberList/MemberList.xaml.cs
similarity index 72%
rename from Aurora/Frontend/Components/MemberList/MemberList.xaml.cs
rename to Aurora/Design/Components/MemberList/MemberList.xaml.cs
index 01d4e7d..3294e5b 100644
--- a/Aurora/Frontend/Components/MemberList/MemberList.xaml.cs
+++ b/Aurora/Design/Components/MemberList/MemberList.xaml.cs
@@ -1,12 +1,14 @@
using System;
-using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
using Xamarin.Forms;
-using Aurora.Frontend.Components.HorizontalList;
+using Aurora.Proto;
-namespace Aurora.Frontend.Components.MemberList
+namespace Aurora.Design.Components.MemberList
{
public partial class MemberList : ContentView
{
+ private static ObservableCollection _newSource;
public MemberList()
{
InitializeComponent();
@@ -21,7 +23,7 @@ namespace Aurora.Frontend.Components.MemberList
///
public static readonly BindableProperty MembersProperty =
BindableProperty.Create(propertyName: "Members",
- returnType: typeof(IEnumerable),
+ returnType: typeof(ObservableCollection),
declaringType: typeof(MemberList),
defaultBindingMode: BindingMode.Default,
propertyChanged: OnMembersChanged);
@@ -30,11 +32,11 @@ namespace Aurora.Frontend.Components.MemberList
/// Backing property for MembersProperty
///
///
- public IEnumerable Members
+ public ObservableCollection Members
{
get
{
- return (IEnumerable)GetValue(MembersProperty);
+ return (ObservableCollection)GetValue(MembersProperty);
}
set
{
@@ -54,8 +56,10 @@ namespace Aurora.Frontend.Components.MemberList
var membersList = control.FindByName("MembersHorizontalList") as HorizontalList.HorizontalList;
if (membersList != null)
{
- membersList.ItemsSource = newValue as IEnumerable;
+ _newSource = newValue as ObservableCollection;
+ membersList.ItemsSource = newValue as ObservableCollection;
}
}
}
}
+
diff --git a/Aurora/Frontend/Components/NavigationMenu/NavigationGroupItem.cs b/Aurora/Design/Components/NavigationMenu/NavigationGroupItem.cs
similarity index 89%
rename from Aurora/Frontend/Components/NavigationMenu/NavigationGroupItem.cs
rename to Aurora/Design/Components/NavigationMenu/NavigationGroupItem.cs
index 2688b8d..3876274 100644
--- a/Aurora/Frontend/Components/NavigationMenu/NavigationGroupItem.cs
+++ b/Aurora/Design/Components/NavigationMenu/NavigationGroupItem.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
-namespace Aurora.Frontend.Components.NavigationMenu
+namespace Aurora.Design.Components.NavigationMenu
{
public class NavigationGroupItem : List
{
diff --git a/Aurora/Frontend/Components/NavigationMenu/NavigationItem.cs b/Aurora/Design/Components/NavigationMenu/NavigationItem.cs
similarity index 81%
rename from Aurora/Frontend/Components/NavigationMenu/NavigationItem.cs
rename to Aurora/Design/Components/NavigationMenu/NavigationItem.cs
index c7107ed..f2101c1 100644
--- a/Aurora/Frontend/Components/NavigationMenu/NavigationItem.cs
+++ b/Aurora/Design/Components/NavigationMenu/NavigationItem.cs
@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Aurora.Frontend.Views.Main;
+using Aurora.Design.Views.Main;
-namespace Aurora.Frontend.Components.NavigationMenu
+namespace Aurora.Design.Components.NavigationMenu
{
public class NavigationItem
{
diff --git a/Aurora/Design/Components/NavigationMenu/NavigationMenu.xaml b/Aurora/Design/Components/NavigationMenu/NavigationMenu.xaml
new file mode 100644
index 0000000..99798d5
--- /dev/null
+++ b/Aurora/Design/Components/NavigationMenu/NavigationMenu.xaml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Frontend/Components/NavigationMenu/NavigationMenu.xaml.cs b/Aurora/Design/Components/NavigationMenu/NavigationMenu.xaml.cs
similarity index 98%
rename from Aurora/Frontend/Components/NavigationMenu/NavigationMenu.xaml.cs
rename to Aurora/Design/Components/NavigationMenu/NavigationMenu.xaml.cs
index 150d282..eb950a0 100644
--- a/Aurora/Frontend/Components/NavigationMenu/NavigationMenu.xaml.cs
+++ b/Aurora/Design/Components/NavigationMenu/NavigationMenu.xaml.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using Xamarin.Forms;
-namespace Aurora.Frontend.Components.NavigationMenu
+namespace Aurora.Design.Components.NavigationMenu
{
public partial class NavigationMenu : ContentPage
{
diff --git a/Aurora/Frontend/Components/Queue/Queue.xaml b/Aurora/Design/Components/Queue/Queue.xaml
similarity index 94%
rename from Aurora/Frontend/Components/Queue/Queue.xaml
rename to Aurora/Design/Components/Queue/Queue.xaml
index 34740ae..0849ed7 100644
--- a/Aurora/Frontend/Components/Queue/Queue.xaml
+++ b/Aurora/Design/Components/Queue/Queue.xaml
@@ -1,9 +1,9 @@
-
+
+ x:Class="Aurora.Design.Components.Queue.Queue">
+ x:Class="Aurora.Design.Views.Albums.AlbumsView">
diff --git a/Aurora/Frontend/Views/Albums/AlbumsView.xaml.cs b/Aurora/Design/Views/Albums/AlbumsView.xaml.cs
similarity index 85%
rename from Aurora/Frontend/Views/Albums/AlbumsView.xaml.cs
rename to Aurora/Design/Views/Albums/AlbumsView.xaml.cs
index c94ed87..5463a48 100644
--- a/Aurora/Frontend/Views/Albums/AlbumsView.xaml.cs
+++ b/Aurora/Design/Views/Albums/AlbumsView.xaml.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using Xamarin.Forms;
-namespace Aurora.Frontend.Views.Albums
+namespace Aurora.Design.Views.Albums
{
public partial class AlbumsView : ContentView
{
diff --git a/Aurora/Frontend/Views/Albums/AlbumsViewModel.cs b/Aurora/Design/Views/Albums/AlbumsViewModel.cs
similarity index 75%
rename from Aurora/Frontend/Views/Albums/AlbumsViewModel.cs
rename to Aurora/Design/Views/Albums/AlbumsViewModel.cs
index b301c62..9c50673 100644
--- a/Aurora/Frontend/Views/Albums/AlbumsViewModel.cs
+++ b/Aurora/Design/Views/Albums/AlbumsViewModel.cs
@@ -1,5 +1,5 @@
using System;
-namespace Aurora.Frontend.Views.Albums
+namespace Aurora.Design.Views.Albums
{
public class AlbumsViewModel
{
diff --git a/Aurora/Design/Views/Artists/ArtistsView.xaml b/Aurora/Design/Views/Artists/ArtistsView.xaml
new file mode 100644
index 0000000..4ab6661
--- /dev/null
+++ b/Aurora/Design/Views/Artists/ArtistsView.xaml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Frontend/Views/Artists/ArtistsView.xaml.cs b/Aurora/Design/Views/Artists/ArtistsView.xaml.cs
similarity index 84%
rename from Aurora/Frontend/Views/Artists/ArtistsView.xaml.cs
rename to Aurora/Design/Views/Artists/ArtistsView.xaml.cs
index 93d2bc3..d6ee899 100644
--- a/Aurora/Frontend/Views/Artists/ArtistsView.xaml.cs
+++ b/Aurora/Design/Views/Artists/ArtistsView.xaml.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using Xamarin.Forms;
-namespace Aurora.Frontend.Views.Artists
+namespace Aurora.Design.Views.Artists
{
public partial class ArtistsView : ContentView
{
diff --git a/Aurora/Frontend/Views/Artists/ArtistsViewModel.cs b/Aurora/Design/Views/Artists/ArtistsViewModel.cs
similarity index 75%
rename from Aurora/Frontend/Views/Artists/ArtistsViewModel.cs
rename to Aurora/Design/Views/Artists/ArtistsViewModel.cs
index c8455e0..e01cdd6 100644
--- a/Aurora/Frontend/Views/Artists/ArtistsViewModel.cs
+++ b/Aurora/Design/Views/Artists/ArtistsViewModel.cs
@@ -1,5 +1,5 @@
using System;
-namespace Aurora.Frontend.Views.Artists
+namespace Aurora.Design.Views.Artists
{
public class ArtistsViewModel
{
diff --git a/Aurora/Frontend/Views/BaseViewModel.cs b/Aurora/Design/Views/BaseViewModel.cs
similarity index 96%
rename from Aurora/Frontend/Views/BaseViewModel.cs
rename to Aurora/Design/Views/BaseViewModel.cs
index f30f12d..8de444d 100644
--- a/Aurora/Frontend/Views/BaseViewModel.cs
+++ b/Aurora/Design/Views/BaseViewModel.cs
@@ -2,7 +2,7 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
-namespace Aurora.Frontend.Views
+namespace Aurora.Design.Views
{
public class BaseViewModel : INotifyPropertyChanged
{
diff --git a/Aurora/Design/Views/MainView/MainView.xaml b/Aurora/Design/Views/MainView/MainView.xaml
new file mode 100644
index 0000000..3e88e21
--- /dev/null
+++ b/Aurora/Design/Views/MainView/MainView.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Frontend/Views/MainView/MainView.xaml.cs b/Aurora/Design/Views/MainView/MainView.xaml.cs
similarity index 93%
rename from Aurora/Frontend/Views/MainView/MainView.xaml.cs
rename to Aurora/Design/Views/MainView/MainView.xaml.cs
index e476054..d05174d 100644
--- a/Aurora/Frontend/Views/MainView/MainView.xaml.cs
+++ b/Aurora/Design/Views/MainView/MainView.xaml.cs
@@ -1,12 +1,12 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
-using Aurora.Frontend.Components.NavigationMenu;
-using Aurora.Frontend.Views.MainView;
+using Aurora.Design.Components.NavigationMenu;
+using Aurora.Design.Views.MainView;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
-namespace Aurora.Frontend.Views.Main
+namespace Aurora.Design.Views.Main
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MainView : MasterDetailPage
diff --git a/Aurora/Frontend/Views/MainView/MainViewModel.cs b/Aurora/Design/Views/MainView/MainViewModel.cs
similarity index 79%
rename from Aurora/Frontend/Views/MainView/MainViewModel.cs
rename to Aurora/Design/Views/MainView/MainViewModel.cs
index c72f18f..ab57e18 100644
--- a/Aurora/Frontend/Views/MainView/MainViewModel.cs
+++ b/Aurora/Design/Views/MainView/MainViewModel.cs
@@ -2,14 +2,15 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
-using Aurora.Frontend.Components.NavigationMenu;
-using Aurora.Frontend.Views.Albums;
-using Aurora.Frontend.Views.Artists;
-using Aurora.Frontend.Views.Songs;
-using Aurora.Frontend.Views.Stations;
-using Aurora.Frontend.Views.Party;
+using Aurora.Design.Components.NavigationMenu;
+using Aurora.Design.Views.Albums;
+using Aurora.Design.Views.Artists;
+using Aurora.Design.Views.Songs;
+using Aurora.Design.Views.Stations;
+using Aurora.Design.Views.Party;
+using Aurora.Design.Views.Profile;
-namespace Aurora.Frontend.Views.MainView
+namespace Aurora.Design.Views.MainView
{
public class MainViewModel : BaseViewModel
{
@@ -32,7 +33,7 @@ namespace Aurora.Frontend.Views.MainView
_pages = new ObservableCollection(new[]
{
new NavigationItem { Id = 4, Title = "Party", Group="Social", TargetType = typeof(PartyView)},
- new NavigationItem { Id = 5, Title = "Profile", Group="Social", TargetType = typeof(ArtistsView)},
+ new NavigationItem { Id = 5, Title = "Profile", Group="Social", TargetType = typeof(ProfileView)},
new NavigationItem { Id = 0, Title = "Songs", Group="Library", TargetType = typeof(SongsView) },
new NavigationItem { Id = 1, Title = "Artists", Group="Library", TargetType = typeof(ArtistsView)},
new NavigationItem { Id = 2, Title = "Albums", Group="Library", TargetType = typeof(AlbumsView)},
diff --git a/Aurora/Frontend/Views/MainView/PageContainer.xaml b/Aurora/Design/Views/MainView/PageContainer.xaml
similarity index 79%
rename from Aurora/Frontend/Views/MainView/PageContainer.xaml
rename to Aurora/Design/Views/MainView/PageContainer.xaml
index 79ad17e..7b17e87 100644
--- a/Aurora/Frontend/Views/MainView/PageContainer.xaml
+++ b/Aurora/Design/Views/MainView/PageContainer.xaml
@@ -2,9 +2,9 @@
+ xmlns:components="clr-namespace:Aurora.Design.Components"
+ xmlns:mp="clr-namespace:Aurora.Design.Components.MediaPlayer"
+ x:Class="Aurora.Design.Views.MainView.PageContainer">
diff --git a/Aurora/Frontend/Views/MainView/PageContainer.xaml.cs b/Aurora/Design/Views/MainView/PageContainer.xaml.cs
similarity index 84%
rename from Aurora/Frontend/Views/MainView/PageContainer.xaml.cs
rename to Aurora/Design/Views/MainView/PageContainer.xaml.cs
index 735a905..f810e60 100644
--- a/Aurora/Frontend/Views/MainView/PageContainer.xaml.cs
+++ b/Aurora/Design/Views/MainView/PageContainer.xaml.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using Xamarin.Forms;
-namespace Aurora.Frontend.Views.MainView
+namespace Aurora.Design.Views.MainView
{
public partial class PageContainer : ContentPage
{
diff --git a/Aurora/Design/Views/Party/PartyView.xaml b/Aurora/Design/Views/Party/PartyView.xaml
new file mode 100644
index 0000000..007db4d
--- /dev/null
+++ b/Aurora/Design/Views/Party/PartyView.xaml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Frontend/Views/Party/PartyView.xaml.cs b/Aurora/Design/Views/Party/PartyView.xaml.cs
similarity index 76%
rename from Aurora/Frontend/Views/Party/PartyView.xaml.cs
rename to Aurora/Design/Views/Party/PartyView.xaml.cs
index 6d461fb..4e044fe 100644
--- a/Aurora/Frontend/Views/Party/PartyView.xaml.cs
+++ b/Aurora/Design/Views/Party/PartyView.xaml.cs
@@ -1,8 +1,7 @@
using System;
-using System.Collections.Generic;
using Xamarin.Forms;
-namespace Aurora.Frontend.Views.Party
+namespace Aurora.Design.Views.Party
{
public partial class PartyView : ContentView
{
diff --git a/Aurora/Design/Views/Party/PartyViewModel.cs b/Aurora/Design/Views/Party/PartyViewModel.cs
new file mode 100644
index 0000000..e70f6e4
--- /dev/null
+++ b/Aurora/Design/Views/Party/PartyViewModel.cs
@@ -0,0 +1,126 @@
+using System;
+using System.Collections.ObjectModel;
+using Aurora.Executors;
+using Aurora.Proto;
+using Xamarin.Forms;
+
+namespace Aurora.Design.Views.Party
+{
+ enum PartyState
+ {
+ SelectingHost,
+ InParty,
+ Connecting,
+ }
+
+ public class PartyViewModel : BaseViewModel
+ {
+ private PartyState _state;
+
+ private BaseExecutor _executor;
+
+ private string _hostname;
+
+ private ObservableCollection _members;
+
+
+ public PartyViewModel()
+ {
+ this.JoinCommand = new Command(OnJoinExecute, CanJoinExecute);
+ this.HostCommand = new Command(OnHostExecute, CanHostExecute);
+ _members = new ObservableCollection();
+
+ State(PartyState.SelectingHost);
+ }
+ #region Properties
+
+ public ObservableCollection Members
+ {
+ get
+ {
+ return _members;
+ }
+ set { SetProperty(ref _members, value); }
+ }
+
+ public bool IsSelectingHost
+ {
+ get { return _state == PartyState.SelectingHost; }
+ }
+
+ public bool IsNotSelectingHost
+ {
+ get { return _state != PartyState.SelectingHost; }
+ }
+
+ public Command JoinCommand { get; set; }
+ public Command HostCommand { get; set; }
+
+ public string Hostname
+ {
+ get { return _hostname; }
+ set { SetProperty(ref _hostname, value); }
+ }
+
+ #endregion Properties
+
+
+ private void State(PartyState state)
+ {
+ _state = state;
+ OnPropertyChanged("IsSelectingHost");
+ OnPropertyChanged("IsNotSelectingHost");
+ }
+
+ #region Commands
+ private void OnJoinExecute()
+ {
+ _executor = BaseExecutor.CreateExecutor();
+ _executor.Connect(this.Hostname);
+
+ SetUpMembers();
+
+ State(PartyState.Connecting);
+ }
+
+ private bool CanJoinExecute()
+ {
+ return true;
+ }
+
+ private void OnHostExecute()
+ {
+
+ //Instantiate and initialize all executors
+ _executor = BaseExecutor.CreateExecutor();
+ _executor.Connect(this.Hostname);
+
+ SetUpMembers();
+
+ //Change state
+ State(PartyState.Connecting);
+ }
+
+ private bool CanHostExecute()
+ {
+ return true;
+ }
+
+
+ #endregion Commands
+
+ private void SetUpMembers()
+ {
+ _members = _executor.PartyMembers;
+ OnPropertyChanged("Members");
+ _executor.PartyMembers.CollectionChanged += (sender, e) =>
+ {
+ if (_executor != null)
+ {
+ _members = _executor.PartyMembers;
+ }
+ OnPropertyChanged("Members");
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/Aurora/Design/Views/Profile/ProfileView.xaml b/Aurora/Design/Views/Profile/ProfileView.xaml
new file mode 100644
index 0000000..58bdbf2
--- /dev/null
+++ b/Aurora/Design/Views/Profile/ProfileView.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Design/Views/Profile/ProfileView.xaml.cs b/Aurora/Design/Views/Profile/ProfileView.xaml.cs
new file mode 100644
index 0000000..b4d8ba2
--- /dev/null
+++ b/Aurora/Design/Views/Profile/ProfileView.xaml.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+
+namespace Aurora.Design.Views.Profile
+{
+ public partial class ProfileView : ContentView
+ {
+ public ProfileView()
+ {
+ InitializeComponent();
+ BindingContext = new ProfileViewModel();
+ }
+ }
+}
diff --git a/Aurora/Design/Views/Profile/ProfileViewModel.cs b/Aurora/Design/Views/Profile/ProfileViewModel.cs
new file mode 100644
index 0000000..b71e876
--- /dev/null
+++ b/Aurora/Design/Views/Profile/ProfileViewModel.cs
@@ -0,0 +1,34 @@
+using System;
+using Aurora.Services;
+
+namespace Aurora.Design.Views.Profile
+{
+ public class ProfileViewModel : BaseViewModel
+ {
+
+ public ProfileViewModel()
+ {
+ }
+
+ public string Username
+ {
+ get { return SettingsService.Instance.Username; }
+ set
+ {
+ SettingsService.Instance.Username = value;
+ OnPropertyChanged("Username");
+ }
+ }
+
+ public string Port
+ {
+ get { return SettingsService.Instance.DefaultPort.ToString(); }
+ set
+ {
+ Int32.TryParse(value, out int portNum);
+ SettingsService.Instance.DefaultPort = portNum;
+ OnPropertyChanged("Port");
+ }
+ }
+ }
+}
diff --git a/Aurora/Frontend/Views/Songs/SongsView.xaml b/Aurora/Design/Views/Songs/SongsView.xaml
similarity index 95%
rename from Aurora/Frontend/Views/Songs/SongsView.xaml
rename to Aurora/Design/Views/Songs/SongsView.xaml
index 8b827a5..7f3a9a3 100644
--- a/Aurora/Frontend/Views/Songs/SongsView.xaml
+++ b/Aurora/Design/Views/Songs/SongsView.xaml
@@ -2,9 +2,9 @@
+ x:Class="Aurora.Design.Views.Songs.SongsView">
diff --git a/Aurora/Frontend/Views/Songs/SongsView.xaml.cs b/Aurora/Design/Views/Songs/SongsView.xaml.cs
similarity index 85%
rename from Aurora/Frontend/Views/Songs/SongsView.xaml.cs
rename to Aurora/Design/Views/Songs/SongsView.xaml.cs
index 973fe5a..5982e5b 100644
--- a/Aurora/Frontend/Views/Songs/SongsView.xaml.cs
+++ b/Aurora/Design/Views/Songs/SongsView.xaml.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using Xamarin.Forms;
-namespace Aurora.Frontend.Views.Songs
+namespace Aurora.Design.Views.Songs
{
public partial class SongsView : ContentView
{
diff --git a/Aurora/Frontend/Views/Songs/SongsViewModel.cs b/Aurora/Design/Views/Songs/SongsViewModel.cs
similarity index 89%
rename from Aurora/Frontend/Views/Songs/SongsViewModel.cs
rename to Aurora/Design/Views/Songs/SongsViewModel.cs
index f7b4028..0d5e4dc 100644
--- a/Aurora/Frontend/Views/Songs/SongsViewModel.cs
+++ b/Aurora/Design/Views/Songs/SongsViewModel.cs
@@ -1,10 +1,10 @@
using System.Collections.ObjectModel;
-using Aurora.Backend.Models.Media;
-using Aurora.Backend.Services;
-using Aurora.Backend.Services.PlayerService;
+using Aurora.Models.Media;
+using Aurora.Services;
+using Aurora.Services.PlayerService;
using Xamarin.Forms;
-namespace Aurora.Frontend.Views.Songs
+namespace Aurora.Design.Views.Songs
{
public class SongsViewModel : BaseViewModel
{
diff --git a/Aurora/Design/Views/Stations/StationsViewModel.xaml b/Aurora/Design/Views/Stations/StationsViewModel.xaml
new file mode 100644
index 0000000..24c901f
--- /dev/null
+++ b/Aurora/Design/Views/Stations/StationsViewModel.xaml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/Aurora/Frontend/Views/Stations/StationsViewModel.xaml.cs b/Aurora/Design/Views/Stations/StationsViewModel.xaml.cs
similarity index 84%
rename from Aurora/Frontend/Views/Stations/StationsViewModel.xaml.cs
rename to Aurora/Design/Views/Stations/StationsViewModel.xaml.cs
index 8827397..c4accc1 100644
--- a/Aurora/Frontend/Views/Stations/StationsViewModel.xaml.cs
+++ b/Aurora/Design/Views/Stations/StationsViewModel.xaml.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using Xamarin.Forms;
-namespace Aurora.Frontend.Views.Stations
+namespace Aurora.Design.Views.Stations
{
public partial class StationsView : ContentView
{
diff --git a/Aurora/Frontend/Views/Stations/StatiosnViewModel.cs b/Aurora/Design/Views/Stations/StatiosnViewModel.cs
similarity index 75%
rename from Aurora/Frontend/Views/Stations/StatiosnViewModel.cs
rename to Aurora/Design/Views/Stations/StatiosnViewModel.cs
index 18b7392..27dd73b 100644
--- a/Aurora/Frontend/Views/Stations/StatiosnViewModel.cs
+++ b/Aurora/Design/Views/Stations/StatiosnViewModel.cs
@@ -1,5 +1,5 @@
using System;
-namespace Aurora.Frontend.Views.Stations
+namespace Aurora.Design.Views.Stations
{
public class StationsViewModel
{
diff --git a/Aurora/Executors/BaseExecutor.cs b/Aurora/Executors/BaseExecutor.cs
new file mode 100644
index 0000000..6033039
--- /dev/null
+++ b/Aurora/Executors/BaseExecutor.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Reflection;
+using System.Linq;
+using System.Collections.ObjectModel;
+using Aurora.Proto;
+
+namespace Aurora.Executors
+{
+ public abstract class BaseExecutor
+ {
+ protected BaseExecutor()
+ {
+ }
+
+ public Type ExecutorType { get; protected set; }
+
+ public abstract ObservableCollection PartyMembers { get; }
+
+ public static BaseExecutor CreateExecutor()
+ {
+
+ BaseExecutor executor = null;
+ if (typeof(T) == typeof(HostExecutor))
+ {
+ executor = new HostExecutor();
+ executor.ExecutorType = typeof(HostExecutor);
+ }
+ else if (typeof(T) == typeof(ClientExecutor))
+ {
+ executor = new ClientExecutor();
+ executor.ExecutorType = typeof(ClientExecutor);
+ }
+ else
+ {
+ throw new InvalidOperationException("Cannot create an executor of type: " + nameof(T));
+ }
+
+ return executor;
+ }
+
+ public abstract void Connect(string hostname);
+
+ public abstract void Close();
+
+ public abstract ObservableCollection GetMembers();
+
+ public abstract void GetQueue();
+
+ public abstract void AddToQueue();
+
+ public abstract void RemoveFromQueue();
+ }
+
+ public enum ExecutorType
+ {
+ Server,
+ Client
+ }
+}
\ No newline at end of file
diff --git a/Aurora/Executors/ClientExecutor.cs b/Aurora/Executors/ClientExecutor.cs
new file mode 100644
index 0000000..60ce8e6
--- /dev/null
+++ b/Aurora/Executors/ClientExecutor.cs
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.ObjectModel;
+using Grpc.Core;
+using Aurora.Proto;
+using Aurora.Models;
+using Aurora.Services;
+namespace Aurora.Executors
+{
+ public class ClientExecutor : BaseExecutor
+ {
+ private Channel _channel;
+ private RemotePartyService.RemotePartyServiceClient _remotePartyClient;
+ private RemotePlaybackService.RemotePlaybackServiceClient _remotePlaybackClient;
+
+ private ObservableCollection _partyMembers;
+
+ public ClientExecutor()
+ {
+ _partyMembers = new ObservableCollection();
+ }
+
+ #region Properties
+ public override ObservableCollection PartyMembers
+ {
+ get { return _partyMembers; }
+ }
+
+ #endregion Properties
+
+ public override void Connect(string hostname)
+ {
+ _channel = new Channel(string.Format("{0}:{1}", hostname, SettingsService.Instance.DefaultPort), ChannelCredentials.Insecure);
+
+ _remotePartyClient = new RemotePartyService.RemotePartyServiceClient(_channel);
+ _remotePlaybackClient = new RemotePlaybackService.RemotePlaybackServiceClient(_channel);
+
+ JoinParty();
+ }
+
+ public override async void Close()
+ {
+ await _channel.ShutdownAsync();
+ }
+
+ public override void AddToQueue()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override ObservableCollection GetMembers()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void GetQueue()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void RemoveFromQueue()
+ {
+ throw new NotImplementedException();
+ }
+
+ private async void JoinParty()
+ {
+ await _remotePartyClient.JoinPartyAsync(new JoinPartyRequest
+ {
+ UserName = SettingsService.Instance.Username,
+ });
+
+ MembersResponse resposne = _remotePartyClient.GetPartyMembers(new Empty());
+ //Add members
+ foreach (PartyMember member in resposne.Members)
+ {
+ _partyMembers.Add(member);
+ }
+
+ //Remove out of date members
+ foreach (PartyMember member in _partyMembers)
+ {
+ if (!resposne.Members.Contains(member))
+ {
+ _partyMembers.Remove(member);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Aurora/Executors/HostExecutor.cs b/Aurora/Executors/HostExecutor.cs
new file mode 100644
index 0000000..001d609
--- /dev/null
+++ b/Aurora/Executors/HostExecutor.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Threading.Tasks;
+using System.Collections.ObjectModel;
+using Aurora.Models;
+using Aurora.Executors;
+using Aurora.Services;
+using Aurora.Proto;
+using Aurora.RemoteImpl;
+
+namespace Aurora.Executors
+{
+ public class HostExecutor : BaseExecutor
+ {
+ RemotePartyServiceImpl _remotePartyServiceImpl;
+ RemotePlaybackServiceImpl _remotePlaybackImpl;
+ public HostExecutor()
+ {
+ _remotePartyServiceImpl = new RemotePartyServiceImpl();
+ _remotePlaybackImpl = new RemotePlaybackServiceImpl();
+ }
+
+ public override void Connect(string hostname)
+ {
+ //Initialize gRPC server
+ ServerService.Instance.Initialize(hostname);
+
+ //Register grpc RemoteService with singleton server service
+ ServerService.Instance.RegisterService(RemotePartyService.BindService(_remotePartyServiceImpl));
+ ServerService.Instance.RegisterService(RemotePlaybackService.BindService(_remotePlaybackImpl));
+
+ //start gRPC server
+ ServerService.Instance.Start();
+ }
+
+ #region Properties
+ public override ObservableCollection PartyMembers
+ {
+ get { return _remotePartyServiceImpl.PartyMembers; }
+ }
+
+ #endregion Properties
+
+ public override async void Close()
+ {
+ await ServerService.Instance.Stop();
+ }
+
+ public override void AddToQueue()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override ObservableCollection GetMembers()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void GetQueue()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void RemoveFromQueue()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Aurora/Frontend/Components/HostSelector/HostSelector.xaml b/Aurora/Frontend/Components/HostSelector/HostSelector.xaml
deleted file mode 100644
index 6b0144d..0000000
--- a/Aurora/Frontend/Components/HostSelector/HostSelector.xaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/Aurora/Frontend/Components/HostSelector/HostSelector.xaml.cs b/Aurora/Frontend/Components/HostSelector/HostSelector.xaml.cs
deleted file mode 100644
index 8ccd5b0..0000000
--- a/Aurora/Frontend/Components/HostSelector/HostSelector.xaml.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Xamarin.Forms;
-
-namespace Aurora.Frontend.Components.HostSelector
-{
- public partial class HostSelector : ContentView
- {
- public HostSelector()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Aurora/Frontend/Components/NavigationMenu/NavigationMenu.xaml b/Aurora/Frontend/Components/NavigationMenu/NavigationMenu.xaml
deleted file mode 100644
index f247cfa..0000000
--- a/Aurora/Frontend/Components/NavigationMenu/NavigationMenu.xaml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Aurora/Frontend/Views/Artists/ArtistsView.xaml b/Aurora/Frontend/Views/Artists/ArtistsView.xaml
deleted file mode 100644
index ec87834..0000000
--- a/Aurora/Frontend/Views/Artists/ArtistsView.xaml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/Aurora/Frontend/Views/MainView/MainView.xaml b/Aurora/Frontend/Views/MainView/MainView.xaml
deleted file mode 100644
index a91b75e..0000000
--- a/Aurora/Frontend/Views/MainView/MainView.xaml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Aurora/Frontend/Views/Party/PartyView.xaml b/Aurora/Frontend/Views/Party/PartyView.xaml
deleted file mode 100644
index 144705d..0000000
--- a/Aurora/Frontend/Views/Party/PartyView.xaml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Aurora/Frontend/Views/Party/PartyViewModel.cs b/Aurora/Frontend/Views/Party/PartyViewModel.cs
deleted file mode 100644
index fe7fb3c..0000000
--- a/Aurora/Frontend/Views/Party/PartyViewModel.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.ObjectModel;
-
-namespace Aurora.Frontend.Views.Party
-{
- public class PartyViewModel : BaseViewModel
- {
- private ObservableCollection _members;
- public PartyViewModel()
- {
- _members = new ObservableCollection()
- {
- "Kevin",
- "Brandon",
- "Sheila",
- "Dale",
- "Austin",
- "Tori",
- "Ashley",
- "Spencer",
- };
- OnPropertyChanged("Members");
- }
-
- public ObservableCollection Members
- {
- get { return _members; }
- set { SetProperty(ref _members, value); }
- }
- }
-}
\ No newline at end of file
diff --git a/Aurora/Frontend/Views/Stations/StationsViewModel.xaml b/Aurora/Frontend/Views/Stations/StationsViewModel.xaml
deleted file mode 100644
index 8909877..0000000
--- a/Aurora/Frontend/Views/Stations/StationsViewModel.xaml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Aurora/Backend/Models/Media/AudioMetadata.cs b/Aurora/Models/Media/AudioMetadata.cs
similarity index 95%
rename from Aurora/Backend/Models/Media/AudioMetadata.cs
rename to Aurora/Models/Media/AudioMetadata.cs
index 6410c0c..0a415b0 100644
--- a/Aurora/Backend/Models/Media/AudioMetadata.cs
+++ b/Aurora/Models/Media/AudioMetadata.cs
@@ -1,6 +1,6 @@
using System;
-namespace Aurora.Backend.Models.Media
+namespace Aurora.Models.Media
{
public class AudioMetadata : BaseMetadata
{
diff --git a/Aurora/Backend/Models/Media/BaseMedia.cs b/Aurora/Models/Media/BaseMedia.cs
similarity index 96%
rename from Aurora/Backend/Models/Media/BaseMedia.cs
rename to Aurora/Models/Media/BaseMedia.cs
index a33b26c..4527a79 100644
--- a/Aurora/Backend/Models/Media/BaseMedia.cs
+++ b/Aurora/Models/Media/BaseMedia.cs
@@ -1,7 +1,7 @@
using System;
using System.IO;
-namespace Aurora.Backend.Models.Media
+namespace Aurora.Models.Media
{
public abstract class BaseMedia
{
diff --git a/Aurora/Backend/Models/Media/BaseMetadata.cs b/Aurora/Models/Media/BaseMetadata.cs
similarity index 87%
rename from Aurora/Backend/Models/Media/BaseMetadata.cs
rename to Aurora/Models/Media/BaseMetadata.cs
index 328cb9b..be38fba 100644
--- a/Aurora/Backend/Models/Media/BaseMetadata.cs
+++ b/Aurora/Models/Media/BaseMetadata.cs
@@ -1,5 +1,5 @@
using System;
-namespace Aurora.Backend.Models.Media
+namespace Aurora.Models.Media
{
public class BaseMetadata
{
diff --git a/Aurora/Backend/Models/Media/LocalAudio.cs b/Aurora/Models/Media/LocalAudio.cs
similarity index 97%
rename from Aurora/Backend/Models/Media/LocalAudio.cs
rename to Aurora/Models/Media/LocalAudio.cs
index ed23b31..c96d8d4 100644
--- a/Aurora/Backend/Models/Media/LocalAudio.cs
+++ b/Aurora/Models/Media/LocalAudio.cs
@@ -1,7 +1,7 @@
using System;
using System.IO;
-namespace Aurora.Backend.Models.Media
+namespace Aurora.Models.Media
{
public class LocalAudio : BaseMedia
{
diff --git a/Aurora/Backend/Models/Media/MediaTypeEnum.cs b/Aurora/Models/Media/MediaTypeEnum.cs
similarity index 70%
rename from Aurora/Backend/Models/Media/MediaTypeEnum.cs
rename to Aurora/Models/Media/MediaTypeEnum.cs
index 10cfc65..0083ec8 100644
--- a/Aurora/Backend/Models/Media/MediaTypeEnum.cs
+++ b/Aurora/Models/Media/MediaTypeEnum.cs
@@ -1,5 +1,5 @@
using System;
-namespace Aurora.Backend.Models.Media
+namespace Aurora.Models.Media
{
public enum MediaTypeEnum
{
diff --git a/Aurora/Proto/general.proto b/Aurora/Proto/general.proto
new file mode 100644
index 0000000..77b62ed
--- /dev/null
+++ b/Aurora/Proto/general.proto
@@ -0,0 +1,10 @@
+syntax = "proto3";
+
+package Aurora.Proto;
+
+message Chunk {
+ bytes Content = 1;
+}
+
+message Empty{
+}
\ No newline at end of file
diff --git a/Aurora/Proto/party.proto b/Aurora/Proto/party.proto
new file mode 100644
index 0000000..625ab14
--- /dev/null
+++ b/Aurora/Proto/party.proto
@@ -0,0 +1,46 @@
+syntax = "proto3";
+
+package Aurora.Proto;
+
+import "Proto/general.proto";
+
+service RemotePartyService {
+ //Party Service
+ rpc JoinParty(JoinPartyRequest) returns (JoinPartyResponse);
+ rpc LeaveParty(LeavePartyRequest) returns (LeavePartyResponse);
+ rpc GetPartyMembers(Empty) returns (MembersResponse);
+}
+
+message JoinPartyRequest {
+ string userName = 2;
+}
+
+message JoinPartyResponse {
+ PartyJoinedStatusEnum status = 1;
+}
+
+message LeavePartyRequest {
+ string clientId = 1;
+}
+
+message LeavePartyResponse {
+ PartyJoinedStatusEnum status = 1;
+}
+
+message PartyMember {
+ string userName = 1;
+ string id = 2;
+ string ipAddress = 3;
+ int32 port = 4;
+}
+
+message MembersResponse {
+ repeated PartyMember members = 1;
+}
+
+
+
+enum PartyJoinedStatusEnum {
+ Connected = 0;
+ Disconnected = 1;
+}
diff --git a/Aurora/Proto/playback.proto b/Aurora/Proto/playback.proto
new file mode 100644
index 0000000..22b741f
--- /dev/null
+++ b/Aurora/Proto/playback.proto
@@ -0,0 +1,21 @@
+syntax = "proto3";
+
+package Aurora.Proto;
+
+import "Proto/general.proto";
+
+service RemotePlaybackService {
+ //Playback Service
+ rpc GetPartyStream(Empty) returns (stream Chunk) {};
+}
+
+enum TransferStatusCode {
+ Unknown = 0;
+ Ok = 1;
+ Failed = 2;
+}
+
+message TransferStatus {
+ string Message = 1;
+ TransferStatusCode Code = 2;
+}
\ No newline at end of file
diff --git a/Aurora/RemoteImpl/RemotePartyImpl.cs b/Aurora/RemoteImpl/RemotePartyImpl.cs
new file mode 100644
index 0000000..34bb207
--- /dev/null
+++ b/Aurora/RemoteImpl/RemotePartyImpl.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Threading.Tasks;
+using System.Collections.ObjectModel;
+using System.Linq;
+using Aurora.Proto;
+using Aurora.Models;
+using Aurora.Services;
+
+namespace Aurora.RemoteImpl
+{
+ public class RemotePartyServiceImpl : RemotePartyService.RemotePartyServiceBase
+ {
+ ///
+ /// Dictionary of party members. Key -> ClientId
+ ///
+ private ObservableCollection _partyMembers;
+
+ public RemotePartyServiceImpl()
+ {
+ _partyMembers = new ObservableCollection();
+
+ //Add self to members list
+ _partyMembers.Add(new PartyMember
+ {
+ UserName = SettingsService.Instance.Username,
+ Id = "asdf",
+ IpAddress = ServerService.Instance.Hostname,
+ Port = ServerService.Instance.Port
+ });
+ }
+
+ public ObservableCollection PartyMembers
+ {
+ get
+ {
+ return _partyMembers;
+ }
+ }
+
+ public override Task JoinParty(JoinPartyRequest request, Grpc.Core.ServerCallContext context)
+ {
+ _partyMembers.Add(new PartyMember()
+ {
+ UserName = request.UserName,
+ IpAddress = context.Host,
+ });
+
+ JoinPartyResponse response = new JoinPartyResponse() { Status = PartyJoinedStatusEnum.Connected };
+ return Task.FromResult(response);
+ }
+
+ public override Task LeaveParty(LeavePartyRequest request, Grpc.Core.ServerCallContext context)
+ {
+ _partyMembers.Remove(_partyMembers.Where(e => e.Id == request.ClientId).Single());
+ LeavePartyResponse response = new LeavePartyResponse() { Status = PartyJoinedStatusEnum.Disconnected };
+ return Task.FromResult(response);
+ }
+
+ public override Task GetPartyMembers(Empty empty, Grpc.Core.ServerCallContext context)
+ {
+ MembersResponse response = new MembersResponse();
+ response.Members.AddRange(_partyMembers);
+ return Task.FromResult(response);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Aurora/RemoteImpl/RemotePlaybackImpl.cs b/Aurora/RemoteImpl/RemotePlaybackImpl.cs
new file mode 100644
index 0000000..8470eb1
--- /dev/null
+++ b/Aurora/RemoteImpl/RemotePlaybackImpl.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Threading.Tasks;
+using System.IO;
+using Aurora.Proto;
+using Aurora.Models;
+
+namespace Aurora.RemoteImpl
+{
+ public class RemotePlaybackServiceImpl : RemotePlaybackService.RemotePlaybackServiceBase
+ {
+
+ public RemotePlaybackServiceImpl()
+ {
+
+ }
+
+ public override async Task GetPartyStream(Empty empty,
+ Grpc.Core.IServerStreamWriter responseStream,
+ Grpc.Core.ServerCallContext context)
+ {
+ throw new NotImplementedException("Working on it");
+ // //Send stream
+ // string cwd = Directory.GetCurrentDirectory();
+ // using (FileStream fs = System.IO.File.OpenRead(Path.Combine(cwd, request.FileName)))
+ // {
+ // Console.WriteLine("Begin sending file");
+ // byte[] buffer = new byte[2048]; // read in chunks of 2KB
+ // int bytesRead;
+ // while ((bytesRead = fs.Read(buffer, 0, buffer.Length)) > 0)
+ // {
+ // Google.Protobuf.ByteString bufferByteString = Google.Protobuf.ByteString.CopyFrom(buffer);
+ // await responseStream.WriteAsync(new Chunk { Content = bufferByteString });
+ // }
+ // Console.WriteLine("Done sending file");
+ // };
+ }
+ }
+}
\ No newline at end of file
diff --git a/Aurora/Backend/Services/BaseService.cs b/Aurora/Services/BaseService.cs
similarity index 92%
rename from Aurora/Backend/Services/BaseService.cs
rename to Aurora/Services/BaseService.cs
index c7523d8..db02456 100644
--- a/Aurora/Backend/Services/BaseService.cs
+++ b/Aurora/Services/BaseService.cs
@@ -1,6 +1,6 @@
using System;
-namespace Aurora.Backend.Services
+namespace Aurora.Services
{
public abstract class BaseService where T : class
{
diff --git a/Aurora/Backend/Services/LibraryService.cs b/Aurora/Services/LibraryService.cs
similarity index 94%
rename from Aurora/Backend/Services/LibraryService.cs
rename to Aurora/Services/LibraryService.cs
index 30a03eb..1771c82 100644
--- a/Aurora/Backend/Services/LibraryService.cs
+++ b/Aurora/Services/LibraryService.cs
@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
-using Aurora.Backend.Models.Media;
-using Aurora.Backend.Utils;
+using Aurora.Models.Media;
+using Aurora.Utils;
-namespace Aurora.Backend.Services
+namespace Aurora.Services
{
public class LibraryService : BaseService
{
diff --git a/Aurora/Backend/Services/PlayerService/MediaChangedEvent.cs b/Aurora/Services/PlayerService/MediaChangedEvent.cs
similarity index 80%
rename from Aurora/Backend/Services/PlayerService/MediaChangedEvent.cs
rename to Aurora/Services/PlayerService/MediaChangedEvent.cs
index d8dd542..868edf3 100644
--- a/Aurora/Backend/Services/PlayerService/MediaChangedEvent.cs
+++ b/Aurora/Services/PlayerService/MediaChangedEvent.cs
@@ -1,7 +1,7 @@
using System;
-using Aurora.Backend.Models.Media;
+using Aurora.Models.Media;
-namespace Aurora.Backend.Services.PlayerService
+namespace Aurora.Services.PlayerService
{
public delegate void MediaChangedEventHandler(object source, MediaChangedEventArgs e);
diff --git a/Aurora/Backend/Services/PlayerService/PlaybackState.cs b/Aurora/Services/PlayerService/PlaybackState.cs
similarity index 100%
rename from Aurora/Backend/Services/PlayerService/PlaybackState.cs
rename to Aurora/Services/PlayerService/PlaybackState.cs
diff --git a/Aurora/Backend/Services/PlayerService/PlaybackStateChangedEvent.cs b/Aurora/Services/PlayerService/PlaybackStateChangedEvent.cs
similarity index 85%
rename from Aurora/Backend/Services/PlayerService/PlaybackStateChangedEvent.cs
rename to Aurora/Services/PlayerService/PlaybackStateChangedEvent.cs
index a498df6..2decee4 100644
--- a/Aurora/Backend/Services/PlayerService/PlaybackStateChangedEvent.cs
+++ b/Aurora/Services/PlayerService/PlaybackStateChangedEvent.cs
@@ -1,7 +1,7 @@
using System;
-using Aurora.Backend.Models.Media;
+using Aurora.Models.Media;
-namespace Aurora.Backend.Services.PlayerService
+namespace Aurora.Services.PlayerService
{
public delegate void PlaybackStateChangedEventHandler(object source, PlaybackStateChangedEventArgs e);
diff --git a/Aurora/Backend/Services/PlayerService/PlayerService.cs b/Aurora/Services/PlayerService/PlayerService.cs
similarity index 97%
rename from Aurora/Backend/Services/PlayerService/PlayerService.cs
rename to Aurora/Services/PlayerService/PlayerService.cs
index d163871..61501dc 100644
--- a/Aurora/Backend/Services/PlayerService/PlayerService.cs
+++ b/Aurora/Services/PlayerService/PlayerService.cs
@@ -1,8 +1,8 @@
using System;
-using Aurora.Backend.Models.Media;
+using Aurora.Models.Media;
using LibVLCSharp.Shared;
-namespace Aurora.Backend.Services.PlayerService
+namespace Aurora.Services.PlayerService
{
public class PlayerService : BaseService
{
diff --git a/Aurora/Services/ServerService.cs b/Aurora/Services/ServerService.cs
new file mode 100644
index 0000000..dd18d10
--- /dev/null
+++ b/Aurora/Services/ServerService.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Threading.Tasks;
+using Grpc.Core;
+using Aurora.Proto;
+
+namespace Aurora.Services
+{
+ public class ServerService : BaseService
+ {
+ private string _hostname = "127.0.0.1";
+ private int _port = SettingsService.Instance.DefaultPort;
+ private Grpc.Core.Server _server;
+
+ ///
+ /// Constructor. Registers GRPC service implementations.
+ ///
+ public ServerService()
+ {
+ }
+
+ public int Port
+ {
+ get { return _port; }
+ }
+
+ public string Hostname
+ {
+ get { return _hostname; }
+ }
+
+ public void Initialize(string hostname)
+ {
+ this._hostname = hostname;
+ _server = new Grpc.Core.Server
+ {
+ Ports = { new ServerPort(_hostname, _port, ServerCredentials.Insecure) }
+ };
+ }
+
+ ///
+ /// Start Server
+ ///
+ public void Start()
+ {
+ try
+ {
+ Console.WriteLine(string.Format("Starting gRPC server at hostname: {0}, port: {1}", _hostname, _port));
+ _server.Start();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(string.Format("Error starting gRPC server: {0}", ex.Message));
+ }
+ }
+
+ ///
+ /// Shutdown server async.
+ ///
+ /// Task
+ public async Task Stop()
+ {
+ await _server.ShutdownAsync();
+ }
+
+ public async Task Reset()
+ {
+ await Stop();
+ _server = new Grpc.Core.Server
+ {
+ Ports = { new ServerPort("localhost", _port, ServerCredentials.Insecure) }
+ };
+ }
+
+ public void RegisterService(ServerServiceDefinition definition)
+ {
+ _server.Services.Add(definition);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Aurora/Services/SettingsService.cs b/Aurora/Services/SettingsService.cs
new file mode 100644
index 0000000..ae12dc3
--- /dev/null
+++ b/Aurora/Services/SettingsService.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Threading;
+using Plugin.Settings;
+using Plugin.Settings.Abstractions;
+
+namespace Aurora.Services
+{
+ public class SettingsService : BaseService
+ {
+ private Lazy _appSettings;
+ private string _usernameKey = "username";
+ private string _defaultPortKey = "port";
+
+ public SettingsService()
+ {
+ }
+
+ public ISettings AppSettings
+ {
+ get
+ {
+ if (_appSettings == null)
+ {
+ _appSettings = new Lazy(() => CrossSettings.Current, LazyThreadSafetyMode.PublicationOnly);
+ }
+
+ return _appSettings.Value;
+ }
+ set
+ {
+ _appSettings = new Lazy(() => value, LazyThreadSafetyMode.PublicationOnly);
+ }
+ }
+
+ public string Username
+ {
+ get { return AppSettings.GetValueOrDefault(_usernameKey, ""); }
+ set
+ {
+ AppSettings.AddOrUpdateValue(_usernameKey, value);
+ }
+ }
+
+ public int DefaultPort
+ {
+ get { return AppSettings.GetValueOrDefault(_defaultPortKey, 4005); }
+ set { AppSettings.AddOrUpdateValue(_defaultPortKey, value); }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Aurora/Backend/Utils/FileSystemUtils.cs b/Aurora/Utils/FileSystemUtils.cs
similarity index 98%
rename from Aurora/Backend/Utils/FileSystemUtils.cs
rename to Aurora/Utils/FileSystemUtils.cs
index 6049256..3828f90 100644
--- a/Aurora/Backend/Utils/FileSystemUtils.cs
+++ b/Aurora/Utils/FileSystemUtils.cs
@@ -5,7 +5,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
-namespace Aurora.Backend.Utils
+namespace Aurora.Utils
{
public class FileSystemUtils
{
diff --git a/start_second.sh b/start_second.sh
new file mode 100755
index 0000000..655142c
--- /dev/null
+++ b/start_second.sh
@@ -0,0 +1 @@
+mono --debug Aurora.gtk/bin/Debug/Aurora.gtk.exe