Skip to content

Commit

Permalink
Merge pull request #17 from Difegue/dev
Browse files Browse the repository at this point in the history
1.5.0
  • Loading branch information
Difegue authored Jan 11, 2021
2 parents 6f5cb32 + cfa297c commit 1a62d5b
Show file tree
Hide file tree
Showing 47 changed files with 1,469 additions and 312 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ You can easily contribute translations to Stylophone! To help translate, follow

## Screenshots

![Screen1](Screenshots/Screen1.png)
![Screen2](Screenshots/Screen2.png)
![Screen3](Screenshots/Screen3.png)
![Screen1](Screenshots/Screen1.jpg)
![Screen2](Screenshots/Screen2.jpg)
![Screen3](Screenshots/Screen3.jpg)
![Screen4](Screenshots/Screen4.jpg)
![Screen5](Screenshots/Screen5.jpg)
![Screen6](Screenshots/Screen6.jpg)
Expand Down
Binary file added Screenshots/Screen1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Screenshots/Screen1.png
Binary file not shown.
Binary file added Screenshots/Screen2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Screenshots/Screen2.png
Binary file not shown.
Binary file added Screenshots/Screen3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Screenshots/Screen3.png
Binary file not shown.
Binary file modified Screenshots/Screen4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/Screen5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/Screen6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Sources/FluentMPC/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ protected override async void OnLaunched(LaunchActivatedEventArgs args)
Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
Windows.ApplicationModel.Core.CoreApplication.EnablePrelaunch(true);

// https://docs.microsoft.com/en-us/windows/uwp/design/devices/designing-for-tv#custom-visual-state-trigger-for-xbox
ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);

// Compact sizing
var isCompactEnabled = await ApplicationData.Current.LocalSettings.ReadAsync<bool>("IsCompactSizing");
if (isCompactEnabled)
Expand Down
42 changes: 37 additions & 5 deletions Sources/FluentMPC/FluentMPC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
<PackageCertificateThumbprint>B531E204B87F721D074590440536659EA5743070</PackageCertificateThumbprint>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
</PropertyGroup>
<PropertyGroup>
<!-- This is what will cause the templates to be transformed when the project is built (default is false) -->
<TransformOnBuild>true</TransformOnBuild>
<!-- Set to true to force overwriting of read-only output files, e.g. if they're not checked out (default is false) -->
<OverwriteReadOnlyOutputFiles>true</OverwriteReadOnlyOutputFiles>
<!-- Set to false to transform files even if the output appears to be up-to-date (default is true) -->
<TransformOutOfDateOnly>false</TransformOutOfDateOnly>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
Expand Down Expand Up @@ -197,6 +205,7 @@
<Compile Include="Services\MPDConnectionService.cs" />
<Compile Include="Services\ThemeSelectorService.cs" />
<Compile Include="Services\NotificationService.cs" />
<Compile Include="ViewModels\SearchResultsViewModel.cs" />
<Compile Include="ViewModels\FoldersViewModel.cs" />
<Compile Include="ViewModels\Items\FilePathViewModel.cs" />
<Compile Include="ViewModels\AlbumDetailViewModel.cs" />
Expand All @@ -218,6 +227,9 @@
<Compile Include="Views\FoldersPage.xaml.cs">
<DependentUpon>FoldersPage.xaml</DependentUpon>
</Compile>
<Compile Include="Views\SearchResultsPage.xaml.cs">
<DependentUpon>SearchResultsPage.xaml</DependentUpon>
</Compile>
<Compile Include="Views\LibraryDetailPage.xaml.cs">
<DependentUpon>LibraryDetailPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -285,6 +297,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\SearchResultsPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\LibraryDetailPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -322,11 +338,6 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Compile Include="Helpers\ResourceExtensions.cs" />
</ItemGroup>
Expand Down Expand Up @@ -378,6 +389,17 @@
<Content Include="Assets\Wide310x150Logo.scale-150.png" />
<Content Include="Assets\Wide310x150Logo.scale-400.png" />
<None Include="FluentMPC_TemporaryKey.pfx" />
<Content Include="Package.tt">
<SubType>Designer</SubType>
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Package.appxmanifest</LastGenOutput>
</Content>
<AppxManifest Include="Package.appxmanifest">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Package.tt</DependentUpon>
<SubType>Designer</SubType>
</AppxManifest>
<None Include="Package.StoreAssociation.xml" />
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\SplashScreen.scale-200.png" />
Expand All @@ -402,10 +424,20 @@
<Name>MpcNET</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<ItemGroup>
<T4ParameterValues Include="BuildConfiguration">
<Value>$(Configuration)</Value>
<Visible>false</Visible>
</T4ParameterValues>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
38 changes: 38 additions & 0 deletions Sources/FluentMPC/Helpers/MiscHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
using ColorThiefDotNet;
using System;
using System.IO;
using System.Linq;
using Windows.System;
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;

namespace FluentMPC.Helpers
{
public static class MiscHelpers
{

// If no items are selected, select the one underneath us.
// https://github.com/microsoft/microsoft-ui-xaml/issues/911
public static void SelectItemOnFlyoutRightClick<T>(ListView QueueList, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
{
// We can get the correct TrackViewModel by looking at the OriginalSource of the right-click event.
var s = (FrameworkElement)e.OriginalSource;
var d = s.DataContext;

if (d is T && !QueueList.SelectedItems.Contains(d))
{
var state = CoreWindow.GetForCurrentThread().GetKeyState(VirtualKey.Shift);

// Don't clear selectedItems if shift is pressed (multi-selection)
if ((state & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down)
{
var pos1 = QueueList.Items.IndexOf(QueueList.SelectedItems.First());
var pos2 = QueueList.Items.IndexOf(d);

if (pos2 < pos1)
QueueList.SelectRange(new ItemIndexRange(pos2, (uint)(pos1 - pos2)));
else
QueueList.SelectRange(new ItemIndexRange(pos1, (uint)(pos2 - pos1 + 1)));
}
else
{
QueueList.SelectedItems.Clear();
QueueList.SelectedItems.Add(d);
}
}
}

/// <summary>
/// Formats a timespan into a human
/// readable form.
Expand Down
14 changes: 7 additions & 7 deletions Sources/FluentMPC/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
Expand All @@ -9,15 +9,15 @@
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
IgnorableNamespaces="uap mp genTemplate uap3">

<Identity
Name="13459Difegue.Stylophone"
<Identity
Name="StylophoneDebug"
Publisher="CN=B2F6FFCA-07C7-479C-AC33-2C75463C7DCE"
Version="1.4.1.0" />
Version="1.5.0.0" />

<mp:PhoneIdentity PhoneProductId="6aab9ef0-77d1-4922-a9da-497e36a34491" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>Stylophone</DisplayName>
<DisplayName>Stylophone (Dev)</DisplayName>
<PublisherDisplayName>Difegue</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
Expand All @@ -35,7 +35,7 @@
Executable="$targetnametoken$.exe"
EntryPoint="FluentMPC.App">
<uap:VisualElements
DisplayName="ms-resource:AppDisplayName"
DisplayName="Stylophone (Dev)"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="ms-resource:AppDescription"
Expand Down
122 changes: 122 additions & 0 deletions Sources/FluentMPC/Package.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<#@ template hostspecific="true" language="C#" #>
<#@ output extension=".appxmanifest" #>
<#@ parameter type="System.String" name="BuildConfiguration" #>
<#
string version = "1.5.0.0";

// Get configuration name at Build time
string configName = Host.ResolveParameterValue("-", "-", "BuildConfiguration");
if (string.IsNullOrWhiteSpace(configName))
{
// Default to Debug at Design Time.
configName = "Debug";
}
#>
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
xmlns:genTemplate="http://schemas.microsoft.com/appx/developer/windowsTemplateStudio"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
IgnorableNamespaces="uap mp genTemplate uap3">

<#
if (configName == "Debug")
{
#><Identity
Name="StylophoneDebug"
Publisher="CN=B2F6FFCA-07C7-479C-AC33-2C75463C7DCE"
Version="<#=version#>" />
<#
}
else
{
#><Identity
Name="13459Difegue.Stylophone"
Publisher="CN=B2F6FFCA-07C7-479C-AC33-2C75463C7DCE"
Version="<#=version#>" />
<#
}
#>

<mp:PhoneIdentity PhoneProductId="6aab9ef0-77d1-4922-a9da-497e36a34491" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<#
if (configName == "Debug")
{
#> <DisplayName>Stylophone (Dev)</DisplayName>
<#
}
else
{
#> <DisplayName>Stylophone</DisplayName>
<#
}
#>
<PublisherDisplayName>Difegue</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="FluentMPC.App">
<uap:VisualElements
<#
if (configName == "Debug")
{
#> DisplayName="Stylophone (Dev)"
<#
}
else
{
#> DisplayName="ms-resource:AppDisplayName"
<#
}
#>
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="ms-resource:AppDescription"
BackgroundColor="#404040">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="wide310x150Logo"/>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="square310x310Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile >
<uap:SplashScreen Image="Assets\SplashScreen.png" uap5:Optional="true"/>
</uap:VisualElements>

<Extensions>
</Extensions>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
<Capability Name="privateNetworkClientServer"/>
<uap3:Capability Name="backgroundMediaPlayback"/>
</Capabilities>

<genTemplate:Metadata>
<genTemplate:Item Name="generator" Value="Windows Template Studio"/>
<genTemplate:Item Name="wizardVersion" Version="v3.6.20139.1" />
<genTemplate:Item Name="templatesVersion" Version="v3.6.20139.1" />
<genTemplate:Item Name="projectType" Value="SplitView" />
<genTemplate:Item Name="framework" Value="MVVMBasic" />
<genTemplate:Item Name="platform" Value="Uwp" />
</genTemplate:Metadata>
</Package>
25 changes: 20 additions & 5 deletions Sources/FluentMPC/Services/MPDConnectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public static bool IsConnected
{
_connected = value;
ConnectionChanged?.Invoke(Application.Current, new EventArgs());

// If IsConnected = false, the RetryAttempter will call TryConnect() every five seconds.
_connectionRetryAttempter?.Cancel();
if (!value)
{
_connectionRetryAttempter = ThreadPoolTimer.CreatePeriodicTimer(async (source) => await TryConnecting(), TimeSpan.FromSeconds(5));
}
}
}

Expand All @@ -59,6 +66,7 @@ public static bool IsConnected
private static IPEndPoint _mpdEndpoint;

private static ThreadPoolTimer _statusUpdater;
private static ThreadPoolTimer _connectionRetryAttempter;
private static CancellationTokenSource _cancelIdle;

public static async Task InitializeAsync()
Expand All @@ -72,7 +80,13 @@ public static async Task InitializeAsync()

_idleConnection = null;
_statusConnection = null;
IsConnected = false;
_connected = false;

await TryConnecting();
}

public static async Task TryConnecting()
{
try
{
IPAddress.TryParse(Singleton<SettingsViewModel>.Instance.ServerHost, out var ipAddress);
Expand Down Expand Up @@ -175,7 +189,7 @@ private static void InitializeStatusUpdater(CancellationToken token = default)
if (idleChanges.IsResponseValid)
await HandleIdleResponseAsync(idleChanges.Response.Content);
else
IsConnected = false; //TODO handle reconnection attempts?
IsConnected = false;
}
});
Expand Down Expand Up @@ -231,8 +245,9 @@ private async static Task UpdateStatusAsync(MpcConnection connection)
}
}
else
IsConnected = false; //TODO handle reconnection attempts?
} catch (Exception e)
IsConnected = false;
}
catch
{
IsConnected = false;
}
Expand All @@ -251,7 +266,7 @@ private async static Task UpdatePlaylistsAsync()
PlaylistsChanged?.Invoke(Application.Current, new EventArgs());
}
else
IsConnected = false; //TODO handle reconnection attempts?*/
IsConnected = false;
}

/// <summary>
Expand Down
Loading

0 comments on commit 1a62d5b

Please sign in to comment.