Reorganization

This commit is contained in:
watsonb8 2019-07-05 14:17:09 -04:00
parent a01d399a1f
commit ec6a7586c7
76 changed files with 475 additions and 296 deletions

View File

@ -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
{
/// <summary>
/// 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.
/// </summary>
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);
}
}
}
}*/

View File

@ -1,26 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:converters="clr-namespace:Aurora.Frontend.Converters"
x:Class="Aurora.App">
<Application
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:converters="clr-namespace:Aurora.Design.Converters"
x:Class="Aurora.App">
<Application.Resources>
<ResourceDictionary>
<!-- GENERAL COLORS -->
<Color x:Key="WhiteColor">#FFFFFF</Color>
<Color x:Key="BlackColor">#000000</Color>
<!-- THEME COLORS -->
<Color x:Key="AccentColor">#F5C210</Color>
<Color x:Key="ToolbarColor">#151C25</Color>
<Color x:Key="BackgroundColor">#1E2634</Color>
<Color x:Key="DarkBackgroundColor">#151C25</Color>
<Color x:Key="MenuBackgroundColor">#44545C</Color>
<!-- CONVERTERS -->
<converters:InverseBoolConverter x:Key="InverseBoolConverter" />
<converters:ToUpperConverter x:Key="ToUpperConverter" />
<ResourceDictionary><!-- GENERAL COLORS -->
<Color
x:Key="WhiteColor">#FFFFFF</Color>
<Color
x:Key="BlackColor">#000000</Color><!-- THEME COLORS -->
<Color
x:Key="AccentColor">#F5C210</Color>
<Color
x:Key="ToolbarColor">#151C25</Color>
<Color
x:Key="BackgroundColor">#1E2634</Color>
<Color
x:Key="DarkBackgroundColor">#151C25</Color>
<Color
x:Key="MenuBackgroundColor">#44545C</Color><!-- CONVERTERS -->
<converters:InverseBoolConverter
x:Key="InverseBoolConverter"/>
<converters:ToUpperConverter
x:Key="ToUpperConverter"/>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@ -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;

View File

@ -1,52 +1,97 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project
Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProduceAssemblyReference>true</ProduceAssemblyReference>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
<PackageReference Include="Xamarin.Essentials" Version="1.0.1" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="3.1.0" />
<PackageReference Include="taglib-sharp-netstandard2.0" Version="2.1.0" />
<PackageReference Include="LibVLCSharp.Forms" Version="3.0.0" />
<PackageReference Include="VideoLAN.LibVLC.Mac" Version="3.1.3" />
<PackageReference Include="Grpc" Version="1.21.0" />
<PackageReference Include="Grpc.Tools" Version="1.21.0" PrivateAssests="All" />
<PackageReference Include="Google.Protobuf" Version="3.8.0" />
<PackageReference
Include="Xamarin.Forms"
Version="3.6.0.264807"/>
<PackageReference
Include="Xamarin.Essentials"
Version="1.0.1"/>
<PackageReference
Include="Xamarin.Forms.DataGrid"
Version="3.1.0"/>
<PackageReference
Include="taglib-sharp-netstandard2.0"
Version="2.1.0"/>
<PackageReference
Include="LibVLCSharp.Forms"
Version="3.0.0"/>
<PackageReference
Include="VideoLAN.LibVLC.Mac"
Version="3.1.3"/>
<PackageReference
Include="Grpc"
Version="1.21.0"/>
<PackageReference
Include="Grpc.Tools"
Version="1.21.0"
PrivateAssests="All"/>
<PackageReference
Include="Google.Protobuf"
Version="3.8.0"/>
<PackageReference
Include="Xam.Plugins.Settings"
Version="3.1.1"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Frontend\" />
<Folder Include="Backend\" />
<Folder Include="Frontend\Components\" />
<Folder Include="Frontend\Views\" />
<Folder Include="Frontend\Views\Songs\" />
<Folder Include="Frontend\Views\MainView\" />
<Folder Include="Frontend\Behaviors\" />
<Folder Include="Frontend\Components\NavigationMenu\" />
<Folder Include="Frontend\Views\Albums\" />
<Folder Include="Frontend\Views\Artists\" />
<Folder Include="Frontend\Views\Stations\" />
<Folder Include="Backend\Utils\" />
<Folder Include="Backend\Models\" />
<Folder Include="Backend\Services\" />
<Folder Include="Frontend\Views\Party\" />
<Folder Include="Frontend\Components\HostSelector\" />
<Folder Include="Frontend\Components\MemberList\" />
<Folder Include="Frontend\Components\Queue\" />
<Folder Include="Frontend\Views\Profile\" />
<Folder
Include="Design\"/>
<Folder
Include="Design\Components\"/>
<Folder
Include="Design\Views\"/>
<Folder
Include="Design\Views\Songs\"/>
<Folder
Include="Design\Views\MainView\"/>
<Folder
Include="Design\Behaviors\"/>
<Folder
Include="Design\Components\NavigationMenu\"/>
<Folder
Include="Design\Views\Albums\"/>
<Folder
Include="Design\Views\Artists\"/>
<Folder
Include="Design\Views\Stations\"/>
<Folder
Include="Utils\"/>
<Folder
Include="Models\"/>
<Folder
Include="Services\"/>
<Folder
Include="Design\Views\Party\"/>
<Folder
Include="Design\Components\HostSelector\"/>
<Folder
Include="Design\Components\MemberList\"/>
<Folder
Include="Design\Components\Queue\"/>
<Folder
Include="Design\Views\Profile\"/>
</ItemGroup>
<ItemGroup>
<Compile Update="Frontend\Components\MusicPlayer\Player.xaml.cs">
<Compile
Update="Design\Components\MusicPlayer\Player.xaml.cs">
<DependentUpon>Player.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Protobuf Include="Backend\Proto\general.proto" />
<Protobuf Include="Backend\Proto\party.proto" />
<Protobuf Include="Backend\Proto\playback.proto" />
<Protobuf
Include="Proto\general.proto"/>
<Protobuf
Include="Proto\party.proto"/>
<Protobuf
Include="Proto\playback.proto"/>
</ItemGroup>
</Project>

View File

@ -1,36 +0,0 @@
using System;
using Xamarin.Forms;
namespace Aurora.Backend.Services
{
public class SettingsService : BaseService<SettingsService>
{
private string _usernameKey = "Username";
public SettingsService()
{
}
public string Username
{
get
{
if (!Application.Current.Properties.ContainsKey(_usernameKey))
{
return "";
}
Application.Current.Properties.TryGetValue(_usernameKey, out object val);
return val as string;
}
set
{
if (Application.Current.Properties.ContainsKey(_usernameKey))
{
Application.Current.Properties.Remove(_usernameKey);
}
Application.Current.Properties.Add(_usernameKey, value);
}
}
}
}

View File

@ -1,7 +1,7 @@
using System;
using Xamarin.Forms;
namespace Aurora.Frontend.Behaviors
namespace Aurora.Design.Behaviors
{
public class BehaviorBase<T> : Behavior<T> where T : BindableObject
{

View File

@ -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<View>
{

View File

@ -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
{

View File

@ -2,7 +2,7 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Frontend.Components.HostSelector.HostSelector">
x:Class="Aurora.Design.Components.HostSelector.HostSelector">
<ContentView.Content>
<Grid>
<Grid.RowDefinitions>

View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using Xamarin.Forms;
namespace Aurora.Frontend.Components.HostSelector
namespace Aurora.Design.Components.HostSelector
{
public enum ConnectionType
{

View File

@ -2,7 +2,7 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Frontend.Components.MediaPlayer.Player">
x:Class="Aurora.Design.Components.MediaPlayer.Player">
<ContentView.Content>
<Grid>
<Grid.ColumnDefinitions>

View File

@ -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
{

View File

@ -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
{

View File

@ -2,8 +2,8 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:hl="clr-namespace:Aurora.Frontend.Components.HorizontalList"
x:Class="Aurora.Frontend.Components.MemberList.MemberList">
xmlns:hl="clr-namespace:Aurora.Design.Components.HorizontalList"
x:Class="Aurora.Design.Components.MemberList.MemberList">
<ContentView.Content>
<StackLayout>
<hl:HorizontalList

View File

@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Aurora.Frontend.Components.HorizontalList;
using Aurora.Design.Components.HorizontalList;
namespace Aurora.Frontend.Components.MemberList
namespace Aurora.Design.Components.MemberList
{
public partial class MemberList : ContentView
{

View File

@ -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<NavigationItem>
{

View File

@ -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
{

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Design.Components.NavigationMenu.NavigationMenu"
Title="Navigation">
<ContentView.Content>
<StackLayout>
<ListView
x:Name="MenuItemsListView"
SeparatorVisibility="None"
HasUnevenRows="true"
BackgroundColor="{StaticResource MenuBackgroundColor}"
IsGroupingEnabled="true"
CachingStrategy="RecycleElement">
<ListView.Header>
<Grid
BackgroundColor="#03A9F4">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="10"/>
<ColumnDefinition
Width="*"/>
<ColumnDefinition
Width="10"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition
Height="30"/>
<RowDefinition
Height="80"/>
<RowDefinition
Height="Auto"/>
<RowDefinition
Height="10"/>
</Grid.RowDefinitions>
<Label
Grid.Column="1"
Grid.Row="2"
Text="Aurora"
Style="{DynamicResource SubtitleStyle}"/>
</Grid>
</ListView.Header>
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<Label
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Start"
Text="{Binding GroupHeading}"
FontSize="18"
TextColor="White"/>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout
Padding="15,10"
HorizontalOptions="FillAndExpand">
<Label
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center"
Text="{Binding Title}"
FontSize="24"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentView.Content>
</ContentPage>

View File

@ -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
{

View File

@ -3,7 +3,7 @@
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:dg="clr-namespace:Xamarin.Forms.DataGrid;assembly=Xamarin.Forms.DataGrid"
x:Class="Aurora.Frontend.Components.Queue.Queue">
x:Class="Aurora.Design.Components.Queue.Queue">
<ContentView.Content>
<dg:DataGrid
x:Name="QueueDataGrid"

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using Xamarin.Forms;
using Xamarin.Forms.DataGrid;
using Aurora.Backend.Models.Media;
using Aurora.Models.Media;
namespace Aurora.Frontend.Components.Queue
namespace Aurora.Design.Components.Queue
{
public partial class Queue : ContentView
{

View File

@ -2,7 +2,7 @@
using System.Globalization;
using Xamarin.Forms;
namespace Aurora.Frontend.Converters
namespace Aurora.Design.Converters
{
public class InverseBoolConverter : IValueConverter
{

View File

@ -2,7 +2,7 @@
using System.Globalization;
using Xamarin.Forms;
namespace Aurora.Frontend.Converters
namespace Aurora.Design.Converters
{
public class ToUpperConverter : IValueConverter
{

View File

@ -2,7 +2,7 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Frontend.Views.Albums.AlbumsView">
x:Class="Aurora.Design.Views.Albums.AlbumsView">
<ContentPage.Content>
<Grid></Grid>
</ContentPage.Content>

View File

@ -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
{

View File

@ -1,5 +1,5 @@
using System;
namespace Aurora.Frontend.Views.Albums
namespace Aurora.Design.Views.Albums
{
public class AlbumsViewModel
{

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Design.Views.Artists.ArtistsView">
<ContentPage.Content></ContentPage.Content>
</ContentView>

View File

@ -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
{

View File

@ -1,5 +1,5 @@
using System;
namespace Aurora.Frontend.Views.Artists
namespace Aurora.Design.Views.Artists
{
public class ArtistsViewModel
{

View File

@ -2,7 +2,7 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Aurora.Frontend.Views
namespace Aurora.Design.Views
{
public class BaseViewModel : INotifyPropertyChanged
{

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<MasterDetailPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Aurora.Design.Views.MainView"
xmlns:navigation="clr-namespace:Aurora.Design.Components.NavigationMenu"
x:Class="Aurora.Design.Views.Main.MainView"
MasterBehavior="Split">
<MasterDetailPage.Master>
<navigation:NavigationMenu
x:Name="MasterPage"
Items="{Binding Pages}"/>
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
<NavigationPage>
<x:Arguments>
<views:PageContainer
x:Name="ContentPage"/>
</x:Arguments>
</NavigationPage>
</MasterDetailPage.Detail>
</MasterDetailPage>

View File

@ -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

View File

@ -2,15 +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.Frontend.Views.Profile;
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
{

View File

@ -2,9 +2,9 @@
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:components="clr-namespace:Aurora.Frontend.Components"
xmlns:mp="clr-namespace:Aurora.Frontend.Components.MediaPlayer"
x:Class="Aurora.Frontend.Views.MainView.PageContainer">
xmlns:components="clr-namespace:Aurora.Design.Components"
xmlns:mp="clr-namespace:Aurora.Design.Components.MediaPlayer"
x:Class="Aurora.Design.Views.MainView.PageContainer">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>

View File

@ -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
{

View File

@ -2,14 +2,15 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:hs="clr-namespace:Aurora.Frontend.Components.HostSelector"
xmlns:ml="clr-namespace:Aurora.Frontend.Components.MemberList"
xmlns:qu="clr-namespace:Aurora.Frontend.Components.Queue"
x:Class="Aurora.Frontend.Views.Party.PartyView">
xmlns:hs="clr-namespace:Aurora.Design.Components.HostSelector"
xmlns:ml="clr-namespace:Aurora.Design.Components.MemberList"
xmlns:qu="clr-namespace:Aurora.Design.Components.Queue"
x:Class="Aurora.Design.Views.Party.PartyView">
<ContentView.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition
Height="*"/>
</Grid.RowDefinitions>
<StackLayout
Grid.Row="0"
@ -20,7 +21,7 @@
VerticalOptions="FillAndExpand"
Members="{Binding Members}"/>
<Label
Text="Queue"/>
Text="Queue"/>
<qu:Queue/>
</StackLayout>
<hs:HostSelector
@ -30,7 +31,6 @@
HostCommand="{Binding HostCommand}"
JoinCommand="{Binding JoinCommand}"
IsVisible="{Binding IsSelectingHost}"/>
</Grid>
</ContentView.Content>
</ContentView>

View File

@ -1,7 +1,7 @@
using System;
using Xamarin.Forms;
namespace Aurora.Frontend.Views.Party
namespace Aurora.Design.Views.Party
{
public partial class PartyView : ContentView
{

View File

@ -1,11 +1,11 @@
using System;
using System.Collections.ObjectModel;
using Aurora.Backend.Executors;
using Aurora.Frontend.Components.HostSelector;
using Aurora.Backend.Services;
using Aurora.Executors;
using Aurora.Design.Components.HostSelector;
using Aurora.Services;
using Xamarin.Forms;
namespace Aurora.Frontend.Views.Party
namespace Aurora.Design.Views.Party
{
enum PartyState
{

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Design.Views.Profile.ProfileView">
<ContentView.Content>
<StackLayout
Orientation="Vertical">
<StackLayout
Orientation="Horizontal">
<Label
Text="Username"/>
<Entry
Text="{Binding Username}"/>
</StackLayout>
</StackLayout>
</ContentView.Content>
</ContentView>

View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using Xamarin.Forms;
namespace Aurora.Frontend.Views.Profile
namespace Aurora.Design.Views.Profile
{
public partial class ProfileView : ContentView
{

View File

@ -0,0 +1,23 @@
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");
}
}
}
}

View File

@ -2,9 +2,9 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:songs="clr-namespace:Aurora.Frontend.Views.Songs"
xmlns:songs="clr-namespace:Aurora.Design.Views.Songs"
xmlns:dg="clr-namespace:Xamarin.Forms.DataGrid;assembly=Xamarin.Forms.DataGrid"
x:Class="Aurora.Frontend.Views.Songs.SongsView">
x:Class="Aurora.Design.Views.Songs.SongsView">
<ContentPage.BindingContext>
<songs:SongsViewModel
x:Name="songsViewModel"/>

View File

@ -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
{

View File

@ -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
{

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Design.Views.Stations.StationsView">
<ContentPage.Content></ContentPage.Content>
</ContentView>

View File

@ -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
{

View File

@ -1,5 +1,5 @@
using System;
namespace Aurora.Frontend.Views.Stations
namespace Aurora.Design.Views.Stations
{
public class StationsViewModel
{

View File

@ -2,7 +2,7 @@ using System;
using System.Reflection;
using System.Linq;
namespace Aurora.Backend.Executors
namespace Aurora.Executors
{
public abstract class BaseExecutor
{

View File

@ -1,7 +1,7 @@
using System;
using Aurora.Backend.Executors;
using Aurora.Executors;
namespace Aurora.Backend.Executors
namespace Aurora.Executors
{
public class ClientExecutor : BaseExecutor
{

View File

@ -1,11 +1,11 @@
using System;
using System.Threading.Tasks;
using Aurora.Backend.Executors;
using Aurora.Backend.Services;
using Aurora.Backend.Proto;
using Aurora.Backend.RemoteImpl;
using Aurora.Executors;
using Aurora.Services;
using Aurora.Proto;
using Aurora.RemoteImpl;
namespace Aurora.Backend.Executors
namespace Aurora.Executors
{
public class HostExecutor : BaseExecutor
{
@ -14,7 +14,7 @@ namespace Aurora.Backend.Executors
public HostExecutor()
{
_remoteServiceImpl = new RemotePartyServiceImpl();
_remotePlaybackImpl = new RemotePlaybackServiceImpl();
}
public override void Initialize()

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Frontend.Components.NavigationMenu.NavigationMenu"
Title="Navigation">
<ContentView.Content>
<StackLayout>
<ListView x:Name="MenuItemsListView"
SeparatorVisibility="None"
HasUnevenRows="true"
BackgroundColor="{StaticResource MenuBackgroundColor}"
IsGroupingEnabled="true"
CachingStrategy="RecycleElement">
<ListView.Header>
<Grid BackgroundColor="#03A9F4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="10" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="80" />
<RowDefinition Height="Auto" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Label Grid.Column="1" Grid.Row="2" Text="Aurora" Style="{DynamicResource SubtitleStyle}" />
</Grid>
</ListView.Header>
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<Label VerticalOptions="FillAndExpand" VerticalTextAlignment="Start" Text="{Binding GroupHeading}" FontSize="18" TextColor="White"/>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="15,10" HorizontalOptions="FillAndExpand">
<Label VerticalOptions="FillAndExpand" VerticalTextAlignment="Center" Text="{Binding Title}" FontSize="24" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentView.Content>
</ContentPage>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Aurora.Frontend.Views.Artists.ArtistsView">
<ContentPage.Content>
</ContentPage.Content>
</ContentView>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Aurora.Frontend.Views.MainView"
xmlns:navigation="clr-namespace:Aurora.Frontend.Components.NavigationMenu"
x:Class="Aurora.Frontend.Views.Main.MainView"
MasterBehavior="Split">
<MasterDetailPage.Master>
<navigation:NavigationMenu x:Name="MasterPage" Items="{Binding Pages}"/>
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
<NavigationPage>
<x:Arguments>
<views:PageContainer x:Name="ContentPage" />
</x:Arguments>
</NavigationPage>
</MasterDetailPage.Detail>
</MasterDetailPage>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Aurora.Frontend.Views.Profile.ProfileView">
<ContentView.Content>
<Label Text="This is a profile"/>
</ContentView.Content>
</ContentView>

View File

@ -1,10 +0,0 @@
using System;
namespace Aurora.Frontend.Views.Profile
{
public class ProfileViewModel
{
public ProfileViewModel()
{
}
}
}

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Aurora.Frontend.Views.Stations.StationsView">
<ContentPage.Content>
</ContentPage.Content>
</ContentView>

View File

@ -1,6 +1,6 @@
using System;
namespace Aurora.Backend.Models.Media
namespace Aurora.Models.Media
{
public class AudioMetadata : BaseMetadata
{

View File

@ -1,7 +1,7 @@
using System;
using System.IO;
namespace Aurora.Backend.Models.Media
namespace Aurora.Models.Media
{
public abstract class BaseMedia
{

View File

@ -1,5 +1,5 @@
using System;
namespace Aurora.Backend.Models.Media
namespace Aurora.Models.Media
{
public class BaseMetadata
{

View File

@ -1,7 +1,7 @@
using System;
using System.IO;
namespace Aurora.Backend.Models.Media
namespace Aurora.Models.Media
{
public class LocalAudio : BaseMedia
{

View File

@ -1,5 +1,5 @@
using System;
namespace Aurora.Backend.Models.Media
namespace Aurora.Models.Media
{
public enum MediaTypeEnum
{

View File

@ -1,6 +1,6 @@
using System;
namespace Aurora.Backend.Models
namespace Aurora.Models
{
public class PartyMember
{

View File

@ -1,6 +1,6 @@
syntax = "proto3";
package Aurora.Backend.Proto;
package Aurora.Proto;
message Chunk {
bytes Content = 1;

View File

@ -1,8 +1,8 @@
syntax = "proto3";
package Aurora.Backend.Proto;
package Aurora.Proto;
import "Backend/Proto/general.proto";
import "Proto/general.proto";
service RemotePartyService {
//Party Service

View File

@ -1,8 +1,8 @@
syntax = "proto3";
package Aurora.Backend.Proto;
package Aurora.Proto;
import "Backend/Proto/general.proto";
import "Proto/general.proto";
service RemotePlaybackService {
//Playback Service

View File

@ -1,10 +1,11 @@
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using Aurora.Backend.Proto;
using Aurora.Backend.Models;
using Aurora.Proto;
using Aurora.Models;
using Aurora.Services;
namespace Aurora.Backend.RemoteImpl
namespace Aurora.RemoteImpl
{
public class RemotePartyServiceImpl : RemotePartyService.RemotePartyServiceBase
{
@ -16,6 +17,15 @@ namespace Aurora.Backend.RemoteImpl
public RemotePartyServiceImpl()
{
_partyMembers = new Dictionary<string, PartyMember>();
//Add self to members list
_partyMembers.Add(SettingsService.Instance.Username, new PartyMember
{
Username = SettingsService.Instance.Username,
Id = "asdf",
IpAddress = ServerService.Instance.Hostname,
Port = ServerService.Instance.Port.ToString()
});
}
public Dictionary<string, PartyMember> PartyMembers

View File

@ -1,13 +1,19 @@
using System;
using System.Threading.Tasks;
using System.IO;
using Aurora.Backend.Proto;
using Aurora.Backend.Models;
using Aurora.Proto;
using Aurora.Models;
namespace Aurora.Backend.RemoteImpl
namespace Aurora.RemoteImpl
{
public class RemotePlaybackServiceImpl : RemotePlaybackService.RemotePlaybackServiceBase
{
public RemotePlaybackServiceImpl()
{
}
public override async Task GetPartyStream(Empty empty,
Grpc.Core.IServerStreamWriter<Chunk> responseStream,
Grpc.Core.ServerCallContext context)

View File

@ -1,6 +1,6 @@
using System;
namespace Aurora.Backend.Services
namespace Aurora.Services
{
public abstract class BaseService<T> where T : class
{

View File

@ -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<LibraryService>
{

View File

@ -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);

View File

@ -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);

View File

@ -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<PlayerService>
{

View File

@ -1,9 +1,9 @@
using System;
using System.Threading.Tasks;
using Grpc.Core;
using Aurora.Backend.Proto;
using Aurora.Proto;
namespace Aurora.Backend.Services
namespace Aurora.Services
{
public class ServerService : BaseService<ServerService>
{
@ -18,6 +18,16 @@ namespace Aurora.Backend.Services
{
}
public int Port
{
get { return _port; }
}
public string Hostname
{
get { return _hostname; }
}
public void Initialize(string hostname, int port)
{
this._port = port;

View File

@ -0,0 +1,44 @@
using System;
using System.Threading;
using Plugin.Settings;
using Plugin.Settings.Abstractions;
namespace Aurora.Services
{
public class SettingsService : BaseService<SettingsService>
{
private Lazy<ISettings> _appSettings;
public SettingsService()
{
}
public ISettings AppSettings
{
get
{
if (_appSettings == null)
{
_appSettings = new Lazy<ISettings>(() => CrossSettings.Current, LazyThreadSafetyMode.PublicationOnly);
}
return _appSettings.Value;
}
set
{
_appSettings = new Lazy<ISettings>(() => value, LazyThreadSafetyMode.PublicationOnly);
}
}
private string _usernameKey = "username";
public string Username
{
get { return AppSettings.GetValueOrDefault(_usernameKey, ""); }
set
{
AppSettings.AddOrUpdateValue(_usernameKey, value);
}
}
}
}

View File

@ -5,7 +5,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Aurora.Backend.Utils
namespace Aurora.Utils
{
public class FileSystemUtils
{