diff --git a/DrumKit.sln b/DrumKit.sln index 9ed48a2..8703ae7 100644 --- a/DrumKit.sln +++ b/DrumKit.sln @@ -1,64 +1,66 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrumKit", "DrumKit\DrumKit.csproj", "{9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tarball", "Tarball\Tarball.csproj", "{5CB567D7-572E-4BAE-802F-7E3F62CDDF64}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|ARM.ActiveCfg = Debug|ARM - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|ARM.Build.0 = Debug|ARM - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|ARM.Deploy.0 = Debug|ARM - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x64.ActiveCfg = Debug|x64 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x64.Build.0 = Debug|x64 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x64.Deploy.0 = Debug|x64 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x86.ActiveCfg = Debug|x86 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x86.Build.0 = Debug|x86 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x86.Deploy.0 = Debug|x86 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|Any CPU.Build.0 = Release|Any CPU - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|Any CPU.Deploy.0 = Release|Any CPU - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|ARM.ActiveCfg = Release|ARM - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|ARM.Build.0 = Release|ARM - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|ARM.Deploy.0 = Release|ARM - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x64.ActiveCfg = Release|x64 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x64.Build.0 = Release|x64 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x64.Deploy.0 = Release|x64 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x86.ActiveCfg = Release|x86 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x86.Build.0 = Release|x86 - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x86.Deploy.0 = Release|x86 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|ARM.ActiveCfg = Debug|ARM - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|ARM.Build.0 = Debug|ARM - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x64.ActiveCfg = Debug|x64 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x64.Build.0 = Debug|x64 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x86.ActiveCfg = Debug|x86 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x86.Build.0 = Debug|x86 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|Any CPU.Build.0 = Release|Any CPU - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|ARM.ActiveCfg = Release|ARM - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|ARM.Build.0 = Release|ARM - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x64.ActiveCfg = Release|x64 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x64.Build.0 = Release|x64 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x86.ActiveCfg = Release|x86 - {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrumKit", "DrumKit\DrumKit.csproj", "{9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tarball", "Tarball\Tarball.csproj", "{5CB567D7-572E-4BAE-802F-7E3F62CDDF64}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|ARM.ActiveCfg = Debug|ARM + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|ARM.Build.0 = Debug|ARM + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|ARM.Deploy.0 = Debug|ARM + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x64.ActiveCfg = Debug|x64 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x64.Build.0 = Debug|x64 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x64.Deploy.0 = Debug|x64 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x86.ActiveCfg = Debug|x86 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x86.Build.0 = Debug|x86 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Debug|x86.Deploy.0 = Debug|x86 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|Any CPU.Build.0 = Release|Any CPU + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|Any CPU.Deploy.0 = Release|Any CPU + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|ARM.ActiveCfg = Release|ARM + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|ARM.Build.0 = Release|ARM + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|ARM.Deploy.0 = Release|ARM + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x64.ActiveCfg = Release|x64 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x64.Build.0 = Release|x64 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x64.Deploy.0 = Release|x64 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x86.ActiveCfg = Release|x86 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x86.Build.0 = Release|x86 + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D}.Release|x86.Deploy.0 = Release|x86 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|ARM.ActiveCfg = Debug|ARM + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|ARM.Build.0 = Debug|ARM + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x64.ActiveCfg = Debug|x64 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x64.Build.0 = Debug|x64 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x86.ActiveCfg = Debug|x86 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Debug|x86.Build.0 = Debug|x86 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|Any CPU.Build.0 = Release|Any CPU + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|ARM.ActiveCfg = Release|ARM + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|ARM.Build.0 = Release|ARM + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x64.ActiveCfg = Release|x64 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x64.Build.0 = Release|x64 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x86.ActiveCfg = Release|x86 + {5CB567D7-572E-4BAE-802F-7E3F62CDDF64}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DrumKit/Assets/ApplicationData.tar b/DrumKit/Assets/ApplicationData.tar index 01c0d9c..6154f7e 100644 Binary files a/DrumKit/Assets/ApplicationData.tar and b/DrumKit/Assets/ApplicationData.tar differ diff --git a/DrumKit/Common/StandardStyles.xaml b/DrumKit/Common/StandardStyles.xaml index 64bdeed..fb592d2 100644 --- a/DrumKit/Common/StandardStyles.xaml +++ b/DrumKit/Common/StandardStyles.xaml @@ -1,1856 +1,1858 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mouse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DrumKit/DrumKit.csproj b/DrumKit/DrumKit.csproj index d5646a7..f7df985 100644 --- a/DrumKit/DrumKit.csproj +++ b/DrumKit/DrumKit.csproj @@ -1,314 +1,316 @@ - - - - - Debug - AnyCPU - {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D} - AppContainerExe - Properties - DrumKit - DrumKit - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - DrumKit_StoreKey.pfx - True - 4FCCD6DD6F5D1EEA43AC26BB8D451F1B54209922 - True - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE;NETFX_CORE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE;NETFX_CORE - prompt - 4 - - - true - bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - ARM - false - prompt - true - - - bin\ARM\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - ARM - false - prompt - true - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - true - - - - App.xaml - - - - - - - - - DrumPlayUI.xaml - - - DrumEditUI.xaml - - - EditorPage.xaml - - - LayoutsSettingsControl.xaml - - - - ExperimentsSettingsControl.xaml - - - FileControl.xaml - - - DrumsSettingsControl.xaml - - - DrumkitsSettingsControl.xaml - - - GeneralSettingsControl.xaml - - - - - - SettingsPage.xaml - - - - - - - - - - - - - - - LoadingPage.xaml - - - MainPage.xaml - - - - - - LogControl.xaml - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - PreserveNewest - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - - - False - ..\..\..\..\WebDownloads\SharpDX242\Bin\Signed-winrt\SharpDX.dll - - - False - ..\..\..\..\WebDownloads\SharpDX242\Bin\Signed-winrt\SharpDX.XAudio2.dll - - - - - {5cb567d7-572e-4bae-802f-7e3f62cddf64} - Tarball - - - - 11.0 - - - - "$(ProjectDir)\Build\7z.exe" a -ttar -y "$(ProjectDir)\Assets\ApplicationData.tar" "$(ProjectDir)\Build\ApplicationData\*" - - + + + + + Debug + AnyCPU + {9A5D3F55-DFD5-45DB-99FF-C82EFCC3294D} + AppContainerExe + Properties + DrumKit + DrumKit + en-US + 512 + {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + DrumKit_StoreKey.pfx + True + 4FCCD6DD6F5D1EEA43AC26BB8D451F1B54209922 + True + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE;NETFX_CORE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE;NETFX_CORE + prompt + 4 + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + ARM + false + prompt + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x64 + false + prompt + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x86 + false + prompt + true + + + + App.xaml + + + + + + + + + DrumPlayUI.xaml + + + DrumEditUI.xaml + + + EditorPage.xaml + + + LayoutsSettingsControl.xaml + + + + ExperimentsSettingsControl.xaml + + + FileControl.xaml + + + DrumsSettingsControl.xaml + + + DrumkitsSettingsControl.xaml + + + GeneralSettingsControl.xaml + + + + + + SettingsPage.xaml + + + + + + + + + + + + + + + LoadingPage.xaml + + + MainPage.xaml + + + + + + LogControl.xaml + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + PreserveNewest + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + + + {5cb567d7-572e-4bae-802f-7e3f62cddf64} + Tarball + + + + + + + + ..\packages\SharpDX.2.5.0\lib\win8\SharpDX.dll + + + ..\packages\SharpDX.XAudio2.2.5.0\lib\win8\SharpDX.XAudio2.dll + + + + 11.0 + + + + "$(ProjectDir)\Build\7z.exe" a -ttar -y "$(ProjectDir)\Assets\ApplicationData.tar" "$(ProjectDir)\Build\ApplicationData\*" + + \ No newline at end of file diff --git a/DrumKit/UI/DrumPlayUI.xaml b/DrumKit/UI/DrumPlayUI.xaml index b130c15..72006fa 100644 --- a/DrumKit/UI/DrumPlayUI.xaml +++ b/DrumKit/UI/DrumPlayUI.xaml @@ -1,65 +1,88 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DrumKit/UI/DrumPlayUI.xaml.cs b/DrumKit/UI/DrumPlayUI.xaml.cs index f480c6d..53f9ba0 100644 --- a/DrumKit/UI/DrumPlayUI.xaml.cs +++ b/DrumKit/UI/DrumPlayUI.xaml.cs @@ -1,122 +1,162 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 - -namespace DrumKit -{ - public sealed partial class DrumPlayUI : UserControl - { - #region Public events - public event PointerEventHandler Hit; - - #endregion - - #region Properties - /// - /// Gets or sets the rotation of the drum - /// - public double Angle - { - get - { - // Get rotated grid - var transform = grid.RenderTransform as RotateTransform; - - // Get angle - if (transform != null) - return transform.Angle; - - // No rotation - return 0; - } - - set - { - // Set rotation transformation - RotateTransform rot = new RotateTransform(); - rot.CenterX = this.Width / 2; - rot.CenterY = this.Height / 2; - rot.Angle = value; - - grid.RenderTransform = rot; - } - } - - /// - /// Gets the drum id. - /// - public string DrumID { get; private set; } - - /// - /// Enables or disables the hit animation. - /// - private bool IsAnimationEnabled { - get { - return DataController.Settings.Animations; - } - } - #endregion - - #region Constructor - - /// - /// Creates a new instance of DrumPlayUI - /// - /// - public DrumPlayUI(Drum drum) - { - // Initialize - this.InitializeComponent(); - - // Set drum properties - this.DrumID = drum.Id; - // TODO: key - this.image.Source = drum.LoadedImageSource; - this.imagePressed.Source = drum.LoadedImagePressedSource; - } - - #endregion - - #region UI handlers - /// - /// Handles the drum pressed event. - /// - private void Grid_PointerPressed(object sender, PointerRoutedEventArgs e) - { - // Call hit event immediately - if (this.Hit != null) - this.Hit(this, e); - - // Play animation - this.PerformHit(); - } - - #endregion - - #region Misc - - public void PerformHit() - { - // Play animation - if (this.IsAnimationEnabled) - { - VisualStateManager.GoToState(this, "DrumHit", true); - VisualStateManager.GoToState(this, "DrumNormal", true); - } - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 + +namespace DrumKit +{ + public sealed partial class DrumPlayUI : UserControl + { + #region Public events + public event PointerEventHandler Hit; + + #endregion + + #region Properties + /// + /// Gets or sets the rotation of the drum + /// + public double Angle + { + get + { + // Get rotated grid + var transform = grid.RenderTransform as RotateTransform; + + // Get angle + if (transform != null) + return transform.Angle; + + // No rotation + return 0; + } + + set + { + // Set rotation transformation + RotateTransform rot = new RotateTransform(); + rot.CenterX = this.Width / 2; + rot.CenterY = this.Height / 2; + rot.Angle = value; + + grid.RenderTransform = rot; + } + } + + /// + /// Gets the drum id. + /// + public string DrumID { get; private set; } + + /// + /// Enables or disables the hit animation. + /// + private bool IsAnimationEnabled + { + get + { + return DataController.Settings.Animations; + } + } + + /// + /// Sets the key string for display + /// + public string KeyString + { + set + { + if (!String.IsNullOrEmpty(value)) + this.textKey.Text = String.Format("{0} [{1}]", DrumName, value); + + else this.textKey.Text = DrumName; + } + } + + /// + /// Gets or sets a value indicating if the key is visible + /// + public bool IsKeyVisible + { + get + { + return this.textKey.Visibility == Windows.UI.Xaml.Visibility.Visible; + } + set + { + this.textKey.Visibility = (value) ? Visibility.Visible : Visibility.Collapsed; + this.textKeyShadow.Visibility = (value) ? Visibility.Visible : Visibility.Collapsed; + } + } + + + /// + /// Gets or sets the drum name + /// + private string DrumName { get; set; } + + #endregion + + #region Constructor + + /// + /// Creates a new instance of DrumPlayUI + /// + /// + public DrumPlayUI(Drum drum) + { + // Initialize + this.InitializeComponent(); + + // Set drum properties + this.DrumID = drum.Id; + this.DrumName = drum.Name; + this.KeyString = null; + this.image.Source = drum.LoadedImageSource; + this.imagePressed.Source = drum.LoadedImagePressedSource; + } + + #endregion + + #region UI handlers + /// + /// Handles the drum pressed event. + /// + private void Grid_PointerPressed(object sender, PointerRoutedEventArgs e) + { + // Call hit event immediately + if (this.Hit != null) + this.Hit(this, e); + + // Play animation + this.PerformHit(); + } + + #endregion + + #region Misc + + public void PerformHit() + { + // Play animation + if (this.IsAnimationEnabled) + { + VisualStateManager.GoToState(this, "DrumHit", true); + VisualStateManager.GoToState(this, "DrumNormal", true); + } + } + + #endregion + } +} diff --git a/DrumKit/UI/MainPage.xaml b/DrumKit/UI/MainPage.xaml index 11d5374..15d85e6 100644 --- a/DrumKit/UI/MainPage.xaml +++ b/DrumKit/UI/MainPage.xaml @@ -1,97 +1,104 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Support - - - - - - - Version - - - 1.0 - - - - - - Sound - - - - Master volume - - - - - - Polyphony* - - - - - - Interface - - - - Animations - - - - - - - - - Miscellaneous - - - - Debugging mode - - - - - Factory reset* - - - - - - - * Will be applied after the application is restarted. - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + About + + + + Drumkit website + + + + + + Support + + + + + + + Version + + + 1.0 + + + + + + Sound + + + + Master volume + + + + + + Polyphony* + + + + + + Interface + + + + Animations + + + + + + Display key bindings + + + + + + Miscellaneous + + + + Debugging mode + + + + + Factory reset* + + + + + + + * Will be applied after the application is restarted. + + + + diff --git a/DrumKit/UI/Settings/GeneralSettingsControl.xaml.cs b/DrumKit/UI/Settings/GeneralSettingsControl.xaml.cs index 943bc9b..c9f3f1c 100644 --- a/DrumKit/UI/Settings/GeneralSettingsControl.xaml.cs +++ b/DrumKit/UI/Settings/GeneralSettingsControl.xaml.cs @@ -1,120 +1,120 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; -using System.Reflection; -using Windows.UI.Popups; - -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 - -namespace DrumKit -{ - public sealed partial class GeneralSettingsControl : UserControl - { - public GeneralSettingsControl() - { - this.InitializeComponent(); - this.LoadSettings(); - } - - private void LoadSettings() - { - // Version - var version = typeof(GeneralSettingsControl).GetTypeInfo().Assembly.GetName().Version; - this.textVersion.Text = String.Format("{0}.{1}", version.Major, version.Minor); - - // Other - this.masterVolumeSlider.Value = DataController.MasterVolume * 100; - this.polyphonySlider.Value = DataController.Settings.Polyphony; - this.animationsToggle.IsOn = DataController.Settings.Animations; - //this.keyBindingsToggle.IsOn = DataController.Settings.ShowKeyBindings; - this.debuggingModeToggle.IsOn = DataController.Settings.DebugMode; - - // Set up events - masterVolumeSlider.ValueChanged += masterVolumeSlider_ValueChanged; - polyphonySlider.ValueChanged += polyphonySlider_ValueChanged; - animationsToggle.Toggled += animationsToggle_Toggled; - //keyBindingsToggle.Toggled += keyBindingsToggle_Toggled; - buttonWebsite.Click += buttonWebsite_Click; - buttonSupport.Click += buttonSupport_Click; - buttonReset.Click += buttonReset_Click; - debuggingModeToggle.Toggled += debuggingModeToggle_Toggled; - } - - private void masterVolumeSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) - { - DataController.MasterVolume = Convert.ToSingle(masterVolumeSlider.Value) / 100.0f; - DataController.SaveSettings(); - } - - void polyphonySlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) - { - DataController.Settings.Polyphony = Convert.ToInt32(polyphonySlider.Value); - DataController.SaveSettings(); - } - - private void animationsToggle_Toggled(object sender, RoutedEventArgs e) - { - DataController.Settings.Animations = this.animationsToggle.IsOn; - DataController.SaveSettings(); - } - - //private void keyBindingsToggle_Toggled(object sender, RoutedEventArgs e) - //{ - // DataController.Settings.ShowKeyBindings = this.keyBindingsToggle.IsOn; - // DataController.SaveSettings(); - //} - - private async void buttonWebsite_Click(object sender, RoutedEventArgs e) - { - await Windows.System.Launcher.LaunchUriAsync(new Uri("http://drumkit8.blogspot.com/")); - } - - private async void buttonSupport_Click(object sender, RoutedEventArgs e) - { - await Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:chibicitiberiu@outlook.com")); - } - - private async void buttonReset_Click(object sender, RoutedEventArgs e) - { - // Notify that the application needs to be restarted - MessageDialog dialog = new MessageDialog("The application needs to be restarted in " + - "order to reset to factory settings. Note that every customisation will be deleted.", - "Application restart required"); - - dialog.Commands.Add(new UICommand("Continue", new UICommandInvokedHandler(UICommandFactoryResetHandler))); - dialog.Commands.Add(new UICommand("Cancel")); - dialog.DefaultCommandIndex = 1; - - await dialog.ShowAsync(); - } - - /// - /// UI Command that restarts the application, when current drumkit changes - /// - private void UICommandFactoryResetHandler(Windows.UI.Popups.IUICommand cmd) - { - if (Window.Current.Content is Frame) - { - Frame frame = (Frame) Window.Current.Content; - frame.Navigate(typeof(LoadingPage), "reset"); - } - } - - private void debuggingModeToggle_Toggled(object sender, RoutedEventArgs e) - { - DataController.Settings.DebugMode = this.debuggingModeToggle.IsOn; - DataController.SaveSettings(); - } - - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; +using System.Reflection; +using Windows.UI.Popups; + +// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 + +namespace DrumKit +{ + public sealed partial class GeneralSettingsControl : UserControl + { + public GeneralSettingsControl() + { + this.InitializeComponent(); + this.LoadSettings(); + } + + private void LoadSettings() + { + // Version + var version = typeof(GeneralSettingsControl).GetTypeInfo().Assembly.GetName().Version; + this.textVersion.Text = String.Format("{0}.{1}", version.Major, version.Minor); + + // Other + this.masterVolumeSlider.Value = DataController.MasterVolume * 100; + this.polyphonySlider.Value = DataController.Settings.Polyphony; + this.animationsToggle.IsOn = DataController.Settings.Animations; + this.keyBindingsToggle.IsOn = DataController.Settings.ShowKeyBindings; + this.debuggingModeToggle.IsOn = DataController.Settings.DebugMode; + + // Set up events + masterVolumeSlider.ValueChanged += masterVolumeSlider_ValueChanged; + polyphonySlider.ValueChanged += polyphonySlider_ValueChanged; + animationsToggle.Toggled += animationsToggle_Toggled; + keyBindingsToggle.Toggled += keyBindingsToggle_Toggled; + buttonWebsite.Click += buttonWebsite_Click; + buttonSupport.Click += buttonSupport_Click; + buttonReset.Click += buttonReset_Click; + debuggingModeToggle.Toggled += debuggingModeToggle_Toggled; + } + + private void masterVolumeSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) + { + DataController.MasterVolume = Convert.ToSingle(masterVolumeSlider.Value) / 100.0f; + DataController.SaveSettings(); + } + + void polyphonySlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) + { + DataController.Settings.Polyphony = Convert.ToInt32(polyphonySlider.Value); + DataController.SaveSettings(); + } + + private void animationsToggle_Toggled(object sender, RoutedEventArgs e) + { + DataController.Settings.Animations = this.animationsToggle.IsOn; + DataController.SaveSettings(); + } + + private void keyBindingsToggle_Toggled(object sender, RoutedEventArgs e) + { + DataController.Settings.ShowKeyBindings = this.keyBindingsToggle.IsOn; + DataController.SaveSettings(); + } + + private async void buttonWebsite_Click(object sender, RoutedEventArgs e) + { + await Windows.System.Launcher.LaunchUriAsync(new Uri("http://drumkit8.blogspot.com/")); + } + + private async void buttonSupport_Click(object sender, RoutedEventArgs e) + { + await Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:chibicitiberiu@outlook.com")); + } + + private async void buttonReset_Click(object sender, RoutedEventArgs e) + { + // Notify that the application needs to be restarted + MessageDialog dialog = new MessageDialog("The application needs to be restarted in " + + "order to reset to factory settings. Note that every customisation will be deleted.", + "Application restart required"); + + dialog.Commands.Add(new UICommand("Continue", new UICommandInvokedHandler(UICommandFactoryResetHandler))); + dialog.Commands.Add(new UICommand("Cancel")); + dialog.DefaultCommandIndex = 1; + + await dialog.ShowAsync(); + } + + /// + /// UI Command that restarts the application, when current drumkit changes + /// + private void UICommandFactoryResetHandler(Windows.UI.Popups.IUICommand cmd) + { + if (Window.Current.Content is Frame) + { + Frame frame = (Frame) Window.Current.Content; + frame.Navigate(typeof(LoadingPage), "reset"); + } + } + + private void debuggingModeToggle_Toggled(object sender, RoutedEventArgs e) + { + DataController.Settings.DebugMode = this.debuggingModeToggle.IsOn; + DataController.SaveSettings(); + } + + } +} diff --git a/DrumKit/Utils/UIHelper.cs b/DrumKit/Utils/UIHelper.cs index 414a019..0a55c0c 100644 --- a/DrumKit/Utils/UIHelper.cs +++ b/DrumKit/Utils/UIHelper.cs @@ -1,55 +1,75 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.ViewManagement; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Media; - -namespace DrumKit -{ - static class UIHelper - { - public static DrumkitLayoutTargetView ToDrumkitLayoutView(ApplicationViewState state) - { - switch (state) - { - case ApplicationViewState.Filled: - return DrumkitLayoutTargetView.Filled; - - case ApplicationViewState.FullScreenLandscape: - return DrumkitLayoutTargetView.Landscape; - - case ApplicationViewState.FullScreenPortrait: - return DrumkitLayoutTargetView.Portrait; - - case ApplicationViewState.Snapped: - return DrumkitLayoutTargetView.Snapped; - } - - return DrumkitLayoutTargetView.None; - } - - public static FrameworkElement FindChildByName(FrameworkElement el, string name) - { - if (el == null || string.IsNullOrEmpty(name)) - return null; - - if (name == el.Name) - return el; - - for (int i = 0; i < VisualTreeHelper.GetChildrenCount(el); i++) - { - var element = VisualTreeHelper.GetChild(el, i) as FrameworkElement; - var result = FindChildByName(element, name); - - if (result != null) - return result; - } - - return null; - } - - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.System; +using Windows.UI.ViewManagement; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Media; + +namespace DrumKit +{ + static class UIHelper + { + public static DrumkitLayoutTargetView ToDrumkitLayoutView(ApplicationViewState state) + { + switch (state) + { + case ApplicationViewState.Filled: + return DrumkitLayoutTargetView.Filled; + + case ApplicationViewState.FullScreenLandscape: + return DrumkitLayoutTargetView.Landscape; + + case ApplicationViewState.FullScreenPortrait: + return DrumkitLayoutTargetView.Portrait; + + case ApplicationViewState.Snapped: + return DrumkitLayoutTargetView.Snapped; + } + + return DrumkitLayoutTargetView.None; + } + + public static FrameworkElement FindChildByName(FrameworkElement el, string name) + { + if (el == null || string.IsNullOrEmpty(name)) + return null; + + if (name == el.Name) + return el; + + for (int i = 0; i < VisualTreeHelper.GetChildrenCount(el); i++) + { + var element = VisualTreeHelper.GetChild(el, i) as FrameworkElement; + var result = FindChildByName(element, name); + + if (result != null) + return result; + } + + return null; + } + + public static string GetPrettifiedVKeyName(VirtualKey vkey) + { + if (Enum.IsDefined(typeof(VirtualKey), vkey)) + { + // Get name + string text = Enum.GetName(typeof(VirtualKey), vkey); + + // Prettify the name + if (text.StartsWith("Number")) + text = text.Substring("Number".Length); + + text = System.Text.RegularExpressions.Regex.Replace(text, "([a-z])([A-Z])", "${1} ${2}"); + + // Set the text + return text; + } + + else return string.Format("Unnamed ({0})", (int)vkey); + } + } +} diff --git a/DrumKit/packages.config b/DrumKit/packages.config new file mode 100644 index 0000000..b030c3d --- /dev/null +++ b/DrumKit/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file