diff --git a/ArchitectureOverview.xopp b/ArchitectureOverview.xopp new file mode 100644 index 0000000..67e418a Binary files /dev/null and b/ArchitectureOverview.xopp differ diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..d09857b --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/QuickPlay.sln b/QuickPlay.sln index 54c5126..64c209c 100644 --- a/QuickPlay.sln +++ b/QuickPlay.sln @@ -5,10 +5,17 @@ VisualStudioVersion = 16.0.31112.23 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickPlay", "QuickPlay\QuickPlay.csproj", "{FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MpcNET", "..\..\Third-party\MpcNET\Source\MpcNET\MpcNET.csproj", "{9477D75F-2F50-41A8-A082-B43873FFE0B4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MpcCore", "..\..\Third-party\mpcCore\src\MpcCore\MpcCore.csproj", "{D0A5AD05-B98C-45E6-B61D-4700F7AA72CF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPDConsoleTests", "..\MPDConsoleTests\MPDConsoleTests.csproj", "{8A1047BF-5D07-4242-9DB8-1D419B953E34}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU + Release-Stable|Any CPU = Release-Stable|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -17,6 +24,27 @@ Global {FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}.Release|Any CPU.ActiveCfg = Release|Any CPU {FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}.Release|Any CPU.Build.0 = Release|Any CPU {FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}.Release|Any CPU.Deploy.0 = Release|Any CPU + {FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {FDBCCBF8-7CA5-4719-8CBB-8E33C464B27C}.Release-Stable|Any CPU.Deploy.0 = Release|Any CPU + {9477D75F-2F50-41A8-A082-B43873FFE0B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9477D75F-2F50-41A8-A082-B43873FFE0B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9477D75F-2F50-41A8-A082-B43873FFE0B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9477D75F-2F50-41A8-A082-B43873FFE0B4}.Release|Any CPU.Build.0 = Release|Any CPU + {9477D75F-2F50-41A8-A082-B43873FFE0B4}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU + {9477D75F-2F50-41A8-A082-B43873FFE0B4}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU + {D0A5AD05-B98C-45E6-B61D-4700F7AA72CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0A5AD05-B98C-45E6-B61D-4700F7AA72CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0A5AD05-B98C-45E6-B61D-4700F7AA72CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0A5AD05-B98C-45E6-B61D-4700F7AA72CF}.Release|Any CPU.Build.0 = Release|Any CPU + {D0A5AD05-B98C-45E6-B61D-4700F7AA72CF}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {D0A5AD05-B98C-45E6-B61D-4700F7AA72CF}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {8A1047BF-5D07-4242-9DB8-1D419B953E34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A1047BF-5D07-4242-9DB8-1D419B953E34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A1047BF-5D07-4242-9DB8-1D419B953E34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A1047BF-5D07-4242-9DB8-1D419B953E34}.Release|Any CPU.Build.0 = Release|Any CPU + {8A1047BF-5D07-4242-9DB8-1D419B953E34}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {8A1047BF-5D07-4242-9DB8-1D419B953E34}.Release-Stable|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/QuickPlay/Configuration.cs b/QuickPlay/Configuration.cs index 723e4b4..16771e0 100644 --- a/QuickPlay/Configuration.cs +++ b/QuickPlay/Configuration.cs @@ -1,14 +1,30 @@ using System; using System.IO; -namespace QuickPlayer +namespace QuickPlay { /// /// Application (global) configuration data class /// - class AppConfiguration + [Serializable] + sealed class AppConfiguration { + public readonly string playerConfigUrl; + public static AppConfiguration loadSavedConfiguration() + { + throw new NotImplementedException(); + } + + public void saveConfiguration() + { + + + + // Make sure that the configuration is same + var newConfig = AppConfiguration.loadSavedConfiguration(); + if (this != newConfig) throw new InvalidDataException("Saved configuration is different from the supplied one."); + } } /// @@ -31,12 +47,15 @@ namespace QuickPlayer sealed class NetworkConfigurationProvider : IPlayerConfigurationProvider { - + PlayerConfiguration IPlayerConfigurationProvider.GetConfiguration() + { + throw new NotImplementedException(); + } } sealed class FileConfigurationProvider : IPlayerConfigurationProvider { - public readonly StreamReader reader; + StreamReader reader; public FileConfigurationProvider(StreamReader reader) { this.reader = reader; diff --git a/QuickPlay/Interfaces.cs b/QuickPlay/Interfaces.cs index dd4c473..0f3e44d 100644 --- a/QuickPlay/Interfaces.cs +++ b/QuickPlay/Interfaces.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; // MPD client abstractions and simplifications -namespace QuickPlayer +namespace QuickPlay { /// /// Simplified abstraction of possible players. Only methods needed are included. diff --git a/QuickPlay/MainActivity.cs b/QuickPlay/MainActivity.cs index 531edb4..f61e704 100644 --- a/QuickPlay/MainActivity.cs +++ b/QuickPlay/MainActivity.cs @@ -1,60 +1,58 @@ using System; using Android.App; using Android.OS; -using Android.Runtime; -using Android.Views; -using AndroidX.AppCompat.Widget; -using AndroidX.AppCompat.App; -using Google.Android.Material.FloatingActionButton; -using Google.Android.Material.Snackbar; +//using Android.Runtime; +//using Android.Views; +//using AndroidX.AppCompat.Widget; +//using AndroidX.AppCompat.App; +//using Google.Android.Material.FloatingActionButton; +//using Google.Android.Material.Snackbar; +using Android.Support.V7.App; +using Toolbar = Android.Support.V7.Widget.Toolbar; + +using System.Net; +//using MpcNET; +//using MpcNET.Commands.Playback; +//using MpcCore; +//using MpcCore.Commands.Player; +//using MpcCore.Response; +using System.Collections.Generic; namespace QuickPlay { - [Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true)] + [Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)] public class MainActivity : AppCompatActivity { + private AppConfiguration appConfig; + private List playerConfigs; + protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); - Xamarin.Essentials.Platform.Init(this, savedInstanceState); - SetContentView(Resource.Layout.activity_main); - - Toolbar toolbar = FindViewById(Resource.Id.toolbar); - SetSupportActionBar(toolbar); - FloatingActionButton fab = FindViewById(Resource.Id.fab); - fab.Click += FabOnClick; - } - - public override bool OnCreateOptionsMenu(IMenu menu) - { - MenuInflater.Inflate(Resource.Menu.menu_main, menu); - return true; - } - public override bool OnOptionsItemSelected(IMenuItem item) - { - int id = item.ItemId; - if (id == Resource.Id.action_settings) - { - return true; - } + // App initialization + //appConfig = AppConfiguration.loadSavedConfiguration(); + //playerConfigs = acquirePlayerConfigs(); - return base.OnOptionsItemSelected(item); - } + // UI initialization + SetContentView(Resource.Layout.activity_main); - private void FabOnClick(object sender, EventArgs eventArgs) - { - View view = (View) sender; - Snackbar.Make(view, "Replace with your own action", Snackbar.LengthLong) - .SetAction("Action", (View.IOnClickListener)null).Show(); + // UI Toolbar initialization + // var toolbar = FindViewById(Resource.Id.toolbar); + // SetSupportActionBar(toolbar); + // ActionBar.Title = "My Toolbar"; } - public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) + List acquirePlayerConfigs() { - Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); + // FIXME: Bad! We have IPlayerConfigurationProviders + ///var url = appConfig.playerConfigUrl; + // TODO: Learn cURL and get configs :-) - base.OnRequestPermissionsResult(requestCode, permissions, grantResults); + return null; + throw new NotImplementedException(); } - } + + } } diff --git a/QuickPlay/MpdMonitorService.cs b/QuickPlay/MpdMonitorService.cs new file mode 100644 index 0000000..bef31d7 --- /dev/null +++ b/QuickPlay/MpdMonitorService.cs @@ -0,0 +1,34 @@ +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace QuickPlay +{ + [Service(Exported = true, Name = "cz.ledoian.quickplay.mpdmonior")] + class MpdMonitorService : Service + { + public override void OnCreate() + { + base.OnCreate(); + } + public override IBinder OnBind(Intent intent) + { + throw new NotImplementedException(); + } + public override bool OnUnbind(Intent intent) + { + return base.OnUnbind(intent); + } + public override void OnDestroy() + { + base.OnDestroy(); + } + } +} \ No newline at end of file diff --git a/QuickPlay/Properties/AndroidManifest.xml b/QuickPlay/Properties/AndroidManifest.xml index 889595d..a10ecfd 100644 --- a/QuickPlay/Properties/AndroidManifest.xml +++ b/QuickPlay/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/QuickPlay/QuickPlay.csproj b/QuickPlay/QuickPlay.csproj index 0e5a4c9..3db59f7 100644 --- a/QuickPlay/QuickPlay.csproj +++ b/QuickPlay/QuickPlay.csproj @@ -36,11 +36,13 @@ 4 True None - true + false false false false false + false + false True @@ -64,6 +66,9 @@ + + + @@ -108,12 +113,18 @@ - - - 2.1.0.8 + + 28.0.0.3 - - + + 28.0.0.3 + + + + + {d0a5ad05-b98c-45e6-b61d-4700f7aa72cf} + MpcCore + + + + + - - - - + + + diff --git a/QuickPlay/Resources/layout/content_main.xml b/QuickPlay/Resources/layout/content_main.xml index 5662d6d..050b6e9 100644 --- a/QuickPlay/Resources/layout/content_main.xml +++ b/QuickPlay/Resources/layout/content_main.xml @@ -1,10 +1,10 @@ + QuickPlay Settings + Not Connected! diff --git a/QuickPlay/Resources/values/styles.xml b/QuickPlay/Resources/values/styles.xml index fef37f9..545b9c6 100644 --- a/QuickPlay/Resources/values/styles.xml +++ b/QuickPlay/Resources/values/styles.xml @@ -1,7 +1,7 @@ - -