Commit 26e4be7d authored by Axelander's avatar Axelander

Merge branch 'develop' into 'master'

Merge project files and changes for v2.4 into master

See merge request !2
parents faba47fe 5c0c519d
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Xx]64/
[Xx]86/
[Bb]uild/
bld/
[Bb]in/
[Oo]bj/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Un-comment the next line if you do not want to checkin
# your web deploy settings because they may include unencrypted
# passwords
#*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Microsoft Azure ApplicationInsights config file
ApplicationInsights.config
# Windows Store app package directory
AppPackages/
BundleArtifacts/
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# LightSwitch generated files
GeneratedArtifacts/
ModelManifest.xml
# Paket dependency manager
.paket/paket.exe
# FAKE - F# Make
.fake/
\ No newline at end of file
### 2.4 Build xxxx (2017-xx-xx)
* [New]: MusicBrainz Support
* [New]: Settings Page shows now the size of the local track cache
* [New]: Added links on Settings Page for license and gitlab repo
* [Changed]: Modified and extended views with artist info
* [Fixed]: Data loss while getting metadata of current track in playback
* [Fixed]: Page title on detailed album view
* [Fixed]: Newest album ordering on HomePage for mobile devices
* [Fixed]: Missing Cover in System Media Transport Controls (SMTC)
### 2.3 Build 6239 (2017-01-30)
* [Changed] Updated links on info view for the new domain axelander.net
* [Changed]: Updated links on info view for the new domain axelander.net
### 2.3 Build 6235 (2017-01-27)
* [Fixed] Unable to connect to server in the local network
* [Fixed]: Unable to connect to server in the local network
### 2.3 Build 6224 (2017-01-16)
* [Fixed] Broken views due to missing cover for Madsonic server
* [Fixed]: Broken views due to missing cover for Madsonic server
### 2.3 Build 6213 (2017-01-10)
......@@ -26,9 +37,9 @@
### 2.2.0 (2016-09-28)
* [New] Support for Xbox One
* [New] Added Volume Control (known from the Windows 8.1 version)
* [Changed] Reworked Background Media Playback with the new Single Process Model
* [New]: Support for Xbox One
* [New]: Added Volume Control (known from the Windows 8.1 version)
* [Changed]: Reworked Background Media Playback with the new Single Process Model
### 2.1.0 (2016-07-10)
......@@ -77,15 +88,15 @@ Phone:
### 1.2.2 / 1.2.3 (2015-05-11)
* [Fixed] Crashes due to invalid XML data
* [Fixed]: Crashes due to invalid XML data
### 1.2.1 (2015-03-27)
WinRT / Windows Phone:
* [Fixed] App initialization will no longer overwrite roaming settings. Scrobbling should now work after app restart
* [Fixed] Logout should now clear app data accordingly. It may happened that you saw old data after switching to another server.
* [Changed] Improved synchronization of existing playlists
* [Fixed]: App initialization will no longer overwrite roaming settings. Scrobbling should now work after app restart
* [Fixed]: Logout should now clear app data accordingly. It may happened that you saw old data after switching to another server.
* [Changed]: Improved synchronization of existing playlists
Windows Phone:
......@@ -95,20 +106,20 @@ Windows Phone:
### 1.2.0 (2015-03-22)
* [New] LastFM scrobble
* [Fixed] Fixed current track on playback view for Windows Phone
* [New]: LastFM scrobble
* [Fixed]: Fixed current track on playback view for Windows Phone
### 1.1.0 (2015-03-02)
* [New] Start Page has now two new sections (most played, frequent played)
* [New] LastFM Section which shows some information about the artist
* [New] Login Page: Pressing Enter in password box starts connection process
* [New] Seach Page: Pressing Enter in search box starts search
* [Changed] Optimized Views for dynamic screen resolution
* [Changed] New Icon in Folder Browser
* [Changed] Snapped Player in expanded mode is now integrated in views (Player is no longer an overlay)
* [Changed] Snapped Player is now a bit wider and track list has now more space
* [Fixed] Privacy Policy Menu Duplicate after logout
* [New]: Start Page has now two new sections (most played, frequent played)
* [New]: LastFM Section which shows some information about the artist
* [New]: Login Page: Pressing Enter in password box starts connection process
* [New]: Seach Page: Pressing Enter in search box starts search
* [Changed]: Optimized Views for dynamic screen resolution
* [Changed]: New Icon in Folder Browser
* [Changed]: Snapped Player in expanded mode is now integrated in views (Player is no longer an overlay)
* [Changed]: Snapped Player is now a bit wider and track list has now more space
* [Fixed]: Privacy Policy Menu Duplicate after logout
### 1.0.0 (2015-02-23)
......@@ -116,12 +127,12 @@ Windows Phone:
### 1.0.7 (2015-02-09)
* [New] SuspensionManager – If you resume the App after suspension some settings will be restored (e.g. playback and current track).
* [New] Improved Playback handling – After switching from shuffled play mode to the normal mode the original track order of the playback will be restored.
* [New] Improved Cover Download – Cover images are downloaded in required sizes and not in the original size (reduces traffic).
* [New] Shuffle and Repeat Mode are also part of Roaming Settings.
* [Changed] Font color of selected items on Album / Artist Page changed to white.
* [Fixed] AppBar on Folder Page should work now during track selection.
* [New]: SuspensionManager – If you resume the App after suspension some settings will be restored (e.g. playback and current track).
* [New]: Improved Playback handling – After switching from shuffled play mode to the normal mode the original track order of the playback will be restored.
* [New]: Improved Cover Download – Cover images are downloaded in required sizes and not in the original size (reduces traffic).
* [New]: Shuffle and Repeat Mode are also part of Roaming Settings.
* [Changed]: Font color of selected items on Album / Artist Page changed to white.
* [Fixed]: AppBar on Folder Page should work now during track selection.
### 1.0.0 (2014-11-30)
......
Fair Source License, version 0.9
SonicStreamer License, version 0.1
Copyright (C) 2017 Alexander Preibisch
......@@ -6,21 +6,20 @@ Licensor: Alexander Preibisch
Software: SonicStreamer
Use Limitation: 10 users
License Grant. Licensor hereby grants to each recipient of the
Software ("you") a non-exclusive, non-transferable, royalty-free and
fully-paid-up license, under all of the Licensor's copyright and
patent rights, to use, copy, distribute, prepare derivative works of,
publicly perform and display the Software, subject to the Use
Limitation and the conditions set forth below.
Use Limitation. The license granted above allows use by up to the
number of users per entity set forth above (the "Use Limitation"). For
determining the number of users, "you" includes all affiliates,
meaning legal entities controlling, controlled by, or under common
control with you. If you exceed the Use Limitation, your use is
subject to payment of Licensor's then-current list price for licenses.
publicly perform and display the Software, subject to the conditions
set forth below.
Prohibited Commercial Usage. Under no circumstances shall you be
permitted, allowed or authorized to commercially exploit the Software.
Neither you nor anyone at your direction shall do any of the following
acts with regard to the Software, or any portion thereof: Rent; Sell;
Lease; Offer on a pay-per-play basis; Distribute for money or any other
consideration; In any other manner and through any medium whatsoever
commercially exploit or use for any commercial purpose.
Conditions. Redistribution in source code or other forms must include
a copy of this license document to be provided in a reasonable
......
-----------------------------------------------------------------------------
The MIT License (MIT)
applies to:
- MusicBrainz C# library, Copyright (c) 2013 avatar29A
-----------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.Media;
using Windows.Media.Playback;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using SonicStreamer.Common.System;
using SonicStreamer.Subsonic.Data;
namespace SonicStreamer.Test.Common
{
[TestClass]
public class PlaybackServiceTest
{
[TestInitialize]
public async Task InitAsync()
{
await SubsonicConnector.Current.SetSubsonicTestServerAsync();
}
private async Task<List<Track>> GetSampleTracks()
{
return await SubsonicConnector.Current.CurrentConnection.GetAlbumTracksAsync("50");
}
[TestMethod]
public async Task AddToPlaybackTestAsync()
{
var tracks = await GetSampleTracks();
await PlaybackService.Current.AddToPlaybackAsync(tracks);
Assert.AreEqual(tracks.Count, PlaybackService.Current.Playback.Items.Count);
// Duplicate Check
await PlaybackService.Current.AddToPlaybackAsync(tracks, false);
Assert.AreEqual(tracks.Count, PlaybackService.Current.Playback.Items.Count);
// Replace Playback
tracks.RemoveAt(0);
await PlaybackService.Current.AddToPlaybackAsync(tracks);
Assert.AreEqual(tracks.Count, PlaybackService.Current.Playback.Items.Count);
PlaybackService.Current.ResetPlayabck();
}
private string GetTrackIdOrder()
{
if (PlaybackService.Current.Playback.ShuffleEnabled)
{
return PlaybackService.Current.Playback.ShuffledItems.Aggregate(string.Empty, (current, item) =>
current + item.Source.CustomProperties[Constants.PlaybackTrackId].ToString());
}
return PlaybackService.Current.Playback.Items.Aggregate(string.Empty, (current, item) =>
current + item.Source.CustomProperties[Constants.PlaybackTrackId].ToString());
}
[TestMethod]
public async Task ShuffleModeTestAsync()
{
var tracks = await GetSampleTracks();
PlaybackService.Current.SetShuffleMode(false);
await PlaybackService.Current.AddToPlaybackAsync(tracks);
var playbackItem = PlaybackService.Current.Playback.Items.First();
var displayProperties = playbackItem.GetDisplayProperties();
Assert.AreEqual(tracks.First().Id,
playbackItem.Source.CustomProperties[Constants.PlaybackTrackId].ToString());
Assert.AreEqual(tracks.First().ArtistId,
playbackItem.Source.CustomProperties[Constants.PlaybackArtistId].ToString());
Assert.AreEqual(tracks.First().Cover,
playbackItem.Source.CustomProperties[Constants.PlaybackCover] as CoverArt);
Assert.AreEqual(tracks.First().Duration,
playbackItem.Source.CustomProperties[Constants.PlaybackDuration].ToString());
// delay required to wait for updated CurrentItem
await Task.Delay(2000);
Assert.AreEqual(playbackItem.Source.CustomProperties[Constants.PlaybackTrackId].ToString(),
PlaybackService.Current.Playback.CurrentItem.Source.CustomProperties[Constants.PlaybackTrackId].ToString
());
Assert.AreEqual(MediaPlaybackType.Music, displayProperties.Type);
Assert.AreEqual(tracks.First().Name, displayProperties.MusicProperties.Title);
Assert.AreEqual(tracks.First().Artist, displayProperties.MusicProperties.Artist);
Assert.AreEqual(tracks.First().Album, displayProperties.MusicProperties.AlbumTitle);
var oldOrder = GetTrackIdOrder();
PlaybackService.Current.SetShuffleMode(true);
Assert.IsTrue(PlaybackService.Current.Playback.ShuffleEnabled);
var newOrder = GetTrackIdOrder();
Assert.AreNotEqual(oldOrder, newOrder);
await PlaybackService.Current.AddToPlaybackAsync(tracks);
Assert.AreNotEqual(newOrder, GetTrackIdOrder());
PlaybackService.Current.ResetPlayabck();
}
[TestMethod]
public async Task PlayPauseTestAsync()
{
var tracks = await GetSampleTracks();
// Add only one track to trigger Play mode
await PlaybackService.Current.AddToPlaybackAsync(tracks.First());
await Task.Delay(2000);
Assert.AreEqual(MediaPlaybackState.Playing, PlaybackService.Current.Player.PlaybackSession.PlaybackState);
// Pause test from Playing state
PlaybackService.Current.PlayPause();
await Task.Delay(2000);
Assert.AreEqual(MediaPlaybackState.Paused, PlaybackService.Current.Player.PlaybackSession.PlaybackState);
// Add now all tracks to test correct Play/Pause behaviour
await PlaybackService.Current.AddToPlaybackAsync(tracks, false);
await Task.Delay(2000);
Assert.AreEqual(MediaPlaybackState.Paused, PlaybackService.Current.Player.PlaybackSession.PlaybackState);
// Play test from Paused state
PlaybackService.Current.PlayPause();
await Task.Delay(2000);
Assert.AreEqual(MediaPlaybackState.Playing, PlaybackService.Current.Player.PlaybackSession.PlaybackState);
// Test reset playback
PlaybackService.Current.ResetPlayabck();
await Task.Delay(2000);
Assert.AreNotEqual(MediaPlaybackState.Playing, PlaybackService.Current.Player.PlaybackSession.PlaybackState);
// Test Auto Play for empty playback
await PlaybackService.Current.AddToPlaybackAsync(tracks, false);
await Task.Delay(2000);
Assert.AreEqual(MediaPlaybackState.Playing, PlaybackService.Current.Player.PlaybackSession.PlaybackState);
PlaybackService.Current.ResetPlayabck();
}
[TestMethod]
public async Task PlayNextPreviousTestAsync()
{
var tracks = await GetSampleTracks();
PlaybackService.Current.SetShuffleMode(false);