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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DrumKit/UI/MainPage.xaml.cs b/DrumKit/UI/MainPage.xaml.cs
index fcf6bd7..5f62dc4 100644
--- a/DrumKit/UI/MainPage.xaml.cs
+++ b/DrumKit/UI/MainPage.xaml.cs
@@ -1,350 +1,389 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.Storage;
-using Windows.System;
-using Windows.UI.ApplicationSettings;
-using Windows.UI.ViewManagement;
-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 Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
-
-namespace DrumKit
-{
- ///
- /// An empty page that can be used on its own or navigated to within a Frame.
- ///
- public sealed partial class MainPage : Page
- {
- #region Fields: Private members
- private Dictionary DrumUIs { get; set; }
- private Dictionary Keymap { get; set; }
- private int CurrentLayout { get; set; }
-
- #endregion
-
- #region Initialization
- ///
- /// Creates a new instance of MainPage.
- ///
- public MainPage()
- {
- // Create private members
- this.DrumUIs = new Dictionary();
- this.Keymap = new Dictionary();
- CurrentLayout = 0;
-
- // Initialize page
- this.InitializeComponent();
- this.SizeChanged += MainPage_SizeChanged;
- this.Loaded += MainPage_Loaded;
-
- SettingsPane.GetForCurrentView().CommandsRequested += MainPage_CommandsRequested;
-
- // Initialize drums
- this.InitializeDrums();
- }
-
- ///
- /// Sets up a single drum
- ///
- /// The drum.
- private void InitializeDrum(Drum drum)
- {
- // Create object
- DrumPlayUI d = new DrumPlayUI(drum);
-
- // Set up callbacks
- d.Hit += HandlerDrumPointerPressed;
-
- // Add to lists
- canvas.Children.Add(d);
- this.DrumUIs.Add(drum.Id, d);
- }
-
- ///
- /// Sets up the drums.
- ///
- private void InitializeDrums()
- {
- // Clear previous stuff if any
- this.DrumUIs.Clear();
- this.Keymap.Clear();
-
- // Load drums
- foreach (var i in DataController.CurrentDrumkit.DrumsList)
- InitializeDrum(i);
-
- // Load drum configurations
- foreach (var i in DataController.CurrentConfig.DrumsList)
- {
- // Unload if disabled
- if (!i.IsEnabled)
- {
- canvas.Children.Remove(this.DrumUIs[i.TargetId]);
- this.DrumUIs.Remove(i.TargetId);
- }
-
- // Keyboard mapping
- if (!Keymap.ContainsKey(i.Key))
- Keymap.Add(i.Key, i.TargetId);
- }
- }
-
- #endregion
-
- #region UI: Settings charm
- ///
- /// Triggered when the settings pane requests commands/
- ///
- void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
- {
- args.Request.ApplicationCommands.Clear();
- SettingsCommand general = new SettingsCommand("general", "General", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
- SettingsCommand drumkits = new SettingsCommand("drumkits", "Manage drumkits", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
- SettingsCommand drums = new SettingsCommand("drums", "Manage drums", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
- SettingsCommand layouts = new SettingsCommand("layouts", "Layouts", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
-
- args.Request.ApplicationCommands.Add(general);
- args.Request.ApplicationCommands.Add(drumkits);
- args.Request.ApplicationCommands.Add(drums);
- args.Request.ApplicationCommands.Add(layouts);
- }
-
- ///
- /// Handles the settings charms
- ///
- void MainPage_SettingsCommand(Windows.UI.Popups.IUICommand command)
- {
- Frame.Navigate(typeof(SettingsPage), command.Id);
- }
-
- #endregion
-
- #region Layouts
-
- ///
- /// Figures out which is the best layout available, and uses it.
- ///
- private int PickBestLayout()
- {
- // Smaller index is better
- int[] picks = {-1, -1, -1, -1, -1, -1};
-
- // Get current layout
- var view = UIHelper.ToDrumkitLayoutView(Windows.UI.ViewManagement.ApplicationView.Value);
-
- // Find best option
- for (int index = 0; index < DataController.CurrentLayouts.Items.Count; index++ )
- {
- var i = DataController.CurrentLayouts.Items[index];
-
- bool isSame = (i.TargetView == view);
- bool contains = (i.TargetView & view) > 0;
- bool all = i.TargetView == DrumkitLayoutTargetView.All;
-
- if (i.IsDefault)
- {
- if (isSame) picks[0] = index;
- if (contains) picks[1] = index;
- if (all) picks[2] = index;
- }
-
- else
- {
- if (isSame) picks[3] = index;
- if (contains) picks[4] = index;
- if (all) picks[5] = index;
- }
- }
-
- // Return first value different than -1, or 0
- foreach (var i in picks)
- if (i != -1) return i;
-
- return 0;
- }
-
- ///
- /// Sets up the layout
- ///
- private void ReloadLayout()
- {
- // Get current size
- double w = canvas.ActualWidth;
- double h = canvas.ActualHeight;
-
- if (double.IsNaN(w) || double.IsNaN(h) || double.IsInfinity(w) || double.IsInfinity(h))
- return;
-
- // Pick a layout
- this.CurrentLayout = PickBestLayout();
-
- Log.Write("Layout change: picked_layout={0}, w={1}, h={2}", this.CurrentLayout, w, h);
-
- // Apply layout
- foreach (var i in DataController.CurrentLayouts.Items[CurrentLayout].Drums)
- {
- if (!DrumUIs.ContainsKey(i.Key))
- continue;
-
- // Set angle
- DrumUIs[i.Key].Angle = i.Value.Angle;
-
- // Set scale
- DrumUIs[i.Key].Width = i.Value.Size * w;
- DrumUIs[i.Key].Height = i.Value.Size * w;
-
- // Set position
- Canvas.SetLeft(DrumUIs[i.Key], w * i.Value.X);
- Canvas.SetTop(DrumUIs[i.Key], h * i.Value.Y);
- }
- }
-
- #endregion
-
- #region UI: Drums
- ///
- /// Handles drum hit using mouse/finger
- ///
- void HandlerDrumPointerPressed(object sender, PointerRoutedEventArgs e)
- {
- var button = sender as DrumPlayUI;
-
- if (button != null)
- this.HandlerDrumClickedCommon(button.DrumID);
- }
-
- ///
- /// Handles drum hit using keyboard
- ///
- public void HandlerKeyDown(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.KeyEventArgs args)
- {
- string drum;
-
- // Key repeat or something
- if (args.KeyStatus.WasKeyDown)
- return;
-
- // If key in key map, perform "click"
- if (this.Keymap.TryGetValue(args.VirtualKey, out drum))
- HandlerDrumClickedCommon(drum);
- }
-
- ///
- /// Handles drum hit.
- ///
- private void HandlerDrumClickedCommon(string drum_id)
- {
- try
- {
- DataController.PlaySound(drum_id, 0);
-
- if (DataController.Settings.Animations)
- this.DrumUIs[drum_id].PerformHit();
- }
-
- catch (Exception ex)
- {
- Log.Error("Error at playback!!! Drum id: {0}", drum_id);
- Log.Except(ex);
- }
- }
-
- #endregion
-
- #region UI: Page events
- ///
- /// Handles page size change event.
- ///
- void MainPage_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- this.ReloadLayout();
- this.ReloadLayout();
- }
-
- ///
- /// Handles page load event.
- ///
- void MainPage_Loaded(object sender, RoutedEventArgs e)
- {
- // Set layout
- this.ReloadLayout();
-
- // Set toggles
- buttonAnimations.IsChecked = DataController.Settings.Animations;
- }
-
- ///
- /// Invoked when this page is about to be displayed in a Frame.
- ///
- /// Event data that describes how this page was reached. The Parameter
- /// property is typically used to configure the page.
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- Log.Write("Navigated to main page.");
-
- Window.Current.CoreWindow.KeyDown += this.HandlerKeyDown;
- }
-
- ///
- /// Invoked when the page is about to be destroyed.
- ///
- protected override void OnNavigatedFrom(NavigationEventArgs e)
- {
- Window.Current.CoreWindow.KeyDown -= this.HandlerKeyDown;
- }
-
- #endregion
-
- #region UI: Buttons
- ///
- /// Handles the edit button, going into the editor.
- ///
- private void ButtonEditMode_Click(object sender, RoutedEventArgs e)
- {
- Frame.Navigate(typeof(EditorPage), DataController.CurrentLayouts.Items[CurrentLayout]);
- }
-
- ///
- /// Handles the animations enabled toggle button.
- ///
- private void buttonAnimations_Click(object sender, RoutedEventArgs e)
- {
- var button = sender as ToggleButton;
- if (button == null) return;
-
- bool isChecked = (button.IsChecked.HasValue && button.IsChecked.Value);
-
- // Fix togglebuton style bug
- VisualStateManager.GoToState(button, isChecked ? "Checked" : "Unchecked", false);
-
- // Change animation setting
- DataController.Settings.Animations = isChecked;
-
- // Save modified setting
- DataController.SaveSettings();
- }
-
- ///
- /// Goes to application settings.
- ///
- private void ButtonSettings_Click(object sender, RoutedEventArgs e)
- {
- Frame.Navigate(typeof(SettingsPage), this);
- }
-
- #endregion
-
- }
-}
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.Storage;
+using Windows.System;
+using Windows.UI.ApplicationSettings;
+using Windows.UI.ViewManagement;
+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 Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace DrumKit
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class MainPage : Page
+ {
+ #region Fields: Private members
+ private Dictionary DrumUIs { get; set; }
+ private Dictionary Keymap { get; set; }
+ private int CurrentLayout { get; set; }
+
+ #endregion
+
+ #region Initialization
+ ///
+ /// Creates a new instance of MainPage.
+ ///
+ public MainPage()
+ {
+ // Create private members
+ this.DrumUIs = new Dictionary();
+ this.Keymap = new Dictionary();
+ CurrentLayout = 0;
+
+ // Initialize page
+ this.InitializeComponent();
+ this.SizeChanged += MainPage_SizeChanged;
+ this.Loaded += MainPage_Loaded;
+
+ SettingsPane.GetForCurrentView().CommandsRequested += MainPage_CommandsRequested;
+
+ // Initialize drums
+ this.InitializeDrums();
+ }
+
+ ///
+ /// Sets up a single drum
+ ///
+ /// The drum.
+ private void InitializeDrum(Drum drum)
+ {
+ // Create object
+ DrumPlayUI d = new DrumPlayUI(drum);
+
+ // Set up callbacks
+ d.Hit += HandlerDrumPointerPressed;
+
+ // Add to lists
+ canvas.Children.Add(d);
+ this.DrumUIs.Add(drum.Id, d);
+ }
+
+ ///
+ /// Sets up the drums.
+ ///
+ private void InitializeDrums()
+ {
+ // Clear previous stuff if any
+ this.DrumUIs.Clear();
+
+ // Load drums
+ foreach (var i in DataController.CurrentDrumkit.DrumsList)
+ InitializeDrum(i);
+
+ UpdateDrumConfig();
+ }
+
+ ///
+ /// Sets up the drum configurations
+ ///
+ private void UpdateDrumConfig()
+ {
+ this.Keymap.Clear();
+
+ // Load drum configurations
+ foreach (var i in DataController.CurrentConfig.DrumsList)
+ {
+ // Unload if disabled
+ if (!i.IsEnabled)
+ {
+ canvas.Children.Remove(this.DrumUIs[i.TargetId]);
+ this.DrumUIs.Remove(i.TargetId);
+ }
+
+ else
+ {
+ // Set drum key
+ this.DrumUIs[i.TargetId].KeyString = UIHelper.GetPrettifiedVKeyName(i.Key);
+ this.DrumUIs[i.TargetId].IsKeyVisible = DataController.Settings.ShowKeyBindings;
+
+ // Keyboard mapping
+ if (!Keymap.ContainsKey(i.Key))
+ Keymap.Add(i.Key, i.TargetId);
+ }
+ }
+ }
+
+ #endregion
+
+ #region UI: Settings charm
+ ///
+ /// Triggered when the settings pane requests commands/
+ ///
+ void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
+ {
+ args.Request.ApplicationCommands.Clear();
+ SettingsCommand general = new SettingsCommand("general", "General", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
+ SettingsCommand drumkits = new SettingsCommand("drumkits", "Manage drumkits", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
+ SettingsCommand drums = new SettingsCommand("drums", "Manage drums", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
+ SettingsCommand layouts = new SettingsCommand("layouts", "Layouts", new Windows.UI.Popups.UICommandInvokedHandler(MainPage_SettingsCommand));
+
+ args.Request.ApplicationCommands.Add(general);
+ args.Request.ApplicationCommands.Add(drumkits);
+ args.Request.ApplicationCommands.Add(drums);
+ args.Request.ApplicationCommands.Add(layouts);
+ }
+
+ ///
+ /// Handles the settings charms
+ ///
+ void MainPage_SettingsCommand(Windows.UI.Popups.IUICommand command)
+ {
+ Frame.Navigate(typeof(SettingsPage), command.Id);
+ }
+
+ #endregion
+
+ #region Layouts
+
+ ///
+ /// Figures out which is the best layout available, and uses it.
+ ///
+ private int PickBestLayout()
+ {
+ // Smaller index is better
+ int[] picks = {-1, -1, -1, -1, -1, -1};
+
+ // Get current layout
+ var view = UIHelper.ToDrumkitLayoutView(Windows.UI.ViewManagement.ApplicationView.Value);
+
+ // Find best option
+ for (int index = 0; index < DataController.CurrentLayouts.Items.Count; index++ )
+ {
+ var i = DataController.CurrentLayouts.Items[index];
+
+ bool isSame = (i.TargetView == view);
+ bool contains = (i.TargetView & view) > 0;
+ bool all = i.TargetView == DrumkitLayoutTargetView.All;
+
+ if (i.IsDefault)
+ {
+ if (isSame) picks[0] = index;
+ if (contains) picks[1] = index;
+ if (all) picks[2] = index;
+ }
+
+ else
+ {
+ if (isSame) picks[3] = index;
+ if (contains) picks[4] = index;
+ if (all) picks[5] = index;
+ }
+ }
+
+ // Return first value different than -1, or 0
+ foreach (var i in picks)
+ if (i != -1) return i;
+
+ return 0;
+ }
+
+ ///
+ /// Sets up the layout
+ ///
+ private void ReloadLayout()
+ {
+ // Get current size
+ double w = canvas.ActualWidth;
+ double h = canvas.ActualHeight;
+
+ if (double.IsNaN(w) || double.IsNaN(h) || double.IsInfinity(w) || double.IsInfinity(h))
+ return;
+
+ // Pick a layout
+ this.CurrentLayout = PickBestLayout();
+
+ Log.Write("Layout change: picked_layout={0}, w={1}, h={2}", this.CurrentLayout, w, h);
+
+ // Apply layout
+ foreach (var i in DataController.CurrentLayouts.Items[CurrentLayout].Drums)
+ {
+ if (!DrumUIs.ContainsKey(i.Key))
+ continue;
+
+ // Set angle
+ DrumUIs[i.Key].Angle = i.Value.Angle;
+
+ // Set scale
+ DrumUIs[i.Key].Width = i.Value.Size * w;
+ DrumUIs[i.Key].Height = i.Value.Size * w;
+
+ // Set position
+ Canvas.SetLeft(DrumUIs[i.Key], w * i.Value.X);
+ Canvas.SetTop(DrumUIs[i.Key], h * i.Value.Y);
+ }
+ }
+
+ #endregion
+
+ #region UI: Drums
+ ///
+ /// Handles drum hit using mouse/finger
+ ///
+ void HandlerDrumPointerPressed(object sender, PointerRoutedEventArgs e)
+ {
+ var button = sender as DrumPlayUI;
+
+ if (button != null)
+ this.HandlerDrumClickedCommon(button.DrumID);
+ }
+
+ ///
+ /// Handles drum hit using keyboard
+ ///
+ public void HandlerKeyDown(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.KeyEventArgs args)
+ {
+ string drum;
+
+ // Key repeat or something
+ if (args.KeyStatus.WasKeyDown)
+ return;
+
+ // If key in key map, perform "click"
+ if (this.Keymap.TryGetValue(args.VirtualKey, out drum))
+ HandlerDrumClickedCommon(drum);
+ }
+
+ ///
+ /// Handles drum hit.
+ ///
+ private void HandlerDrumClickedCommon(string drum_id)
+ {
+ try
+ {
+ DataController.PlaySound(drum_id, 0);
+
+ if (DataController.Settings.Animations)
+ this.DrumUIs[drum_id].PerformHit();
+ }
+
+ catch (Exception ex)
+ {
+ Log.Error("Error at playback!!! Drum id: {0}", drum_id);
+ Log.Except(ex);
+ }
+ }
+
+ #endregion
+
+ #region UI: Page events
+ ///
+ /// Handles page size change event.
+ ///
+ void MainPage_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ this.ReloadLayout();
+ this.ReloadLayout();
+ }
+
+ ///
+ /// Handles page load event.
+ ///
+ void MainPage_Loaded(object sender, RoutedEventArgs e)
+ {
+ // Set layout
+ this.ReloadLayout();
+
+ // Set toggles
+ buttonAnimations.IsChecked = DataController.Settings.Animations;
+ buttonKeys.IsChecked = DataController.Settings.ShowKeyBindings;
+ }
+
+ ///
+ /// Invoked when this page is about to be displayed in a Frame.
+ ///
+ /// Event data that describes how this page was reached. The Parameter
+ /// property is typically used to configure the page.
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ Log.Write("Navigated to main page.");
+
+ Window.Current.CoreWindow.KeyDown += this.HandlerKeyDown;
+ }
+
+ ///
+ /// Invoked when the page is about to be destroyed.
+ ///
+ protected override void OnNavigatedFrom(NavigationEventArgs e)
+ {
+ Window.Current.CoreWindow.KeyDown -= this.HandlerKeyDown;
+ }
+
+ #endregion
+
+ #region UI: Buttons
+ ///
+ /// Handles the edit button, going into the editor.
+ ///
+ private void ButtonEditMode_Click(object sender, RoutedEventArgs e)
+ {
+ Frame.Navigate(typeof(EditorPage), DataController.CurrentLayouts.Items[CurrentLayout]);
+ }
+
+ ///
+ /// Handles the animations enabled toggle button.
+ ///
+ private void buttonAnimations_Click(object sender, RoutedEventArgs e)
+ {
+ var button = sender as ToggleButton;
+ if (button == null) return;
+
+ bool isChecked = (button.IsChecked.HasValue && button.IsChecked.Value);
+
+ // Fix togglebuton style bug
+ VisualStateManager.GoToState(button, isChecked ? "Checked" : "Unchecked", false);
+
+ // Change animation setting
+ DataController.Settings.Animations = isChecked;
+
+ // Save modified setting
+ DataController.SaveSettings();
+ }
+
+ ///
+ /// Handles the 'show keys' toggle button
+ ///
+ private void buttonKeys_Click(object sender, RoutedEventArgs e)
+ {
+ var button = sender as ToggleButton;
+ if (button == null) return;
+
+ bool isChecked = (button.IsChecked.HasValue && button.IsChecked.Value);
+
+ // Fix togglebuton style bug
+ VisualStateManager.GoToState(button, isChecked ? "Checked" : "Unchecked", false);
+
+ // Change setting
+ DataController.Settings.ShowKeyBindings = isChecked;
+
+ // Update UI
+ UpdateDrumConfig();
+
+ // Save modified setting
+ DataController.SaveSettings();
+ }
+
+ ///
+ /// Goes to application settings.
+ ///
+ private void ButtonSettings_Click(object sender, RoutedEventArgs e)
+ {
+ Frame.Navigate(typeof(SettingsPage), this);
+ }
+
+ #endregion
+ }
+}
diff --git a/DrumKit/UI/Settings/DrumsSettingsControl.xaml b/DrumKit/UI/Settings/DrumsSettingsControl.xaml
index 5582867..d660ef6 100644
--- a/DrumKit/UI/Settings/DrumsSettingsControl.xaml
+++ b/DrumKit/UI/Settings/DrumsSettingsControl.xaml
@@ -1,164 +1,164 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DrumKit/UI/Settings/DrumsSettingsControl.xaml.cs b/DrumKit/UI/Settings/DrumsSettingsControl.xaml.cs
index edeb463..620ca41 100644
--- a/DrumKit/UI/Settings/DrumsSettingsControl.xaml.cs
+++ b/DrumKit/UI/Settings/DrumsSettingsControl.xaml.cs
@@ -1,236 +1,221 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.System;
-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 DrumsSettingsControl : UserControl
- {
- #region Initialization
- ///
- /// Creates a new instance of DrumsSettingsControl
- ///
- public DrumsSettingsControl()
- {
- this.InitializeComponent();
- this.Loaded += DrumsSettingsControl_Loaded;
- }
-
-
- ///
- /// Loads drum list at startup
- ///
- void DrumsSettingsControl_Loaded(object sender, RoutedEventArgs e)
- {
- ReloadDrums();
- }
-
- #endregion
-
- #region Reloads the list of drums
-
- ///
- /// Reloads the list of drums
- ///
- async void ReloadDrums()
- {
- // Clear previous stuff
- listDrums.Items.Clear();
-
- // Add new stuff
- foreach (var i in DataController.CurrentDrumkit.Drums)
- this.listDrums.Items.Add(i.Value);
-
- // Wait for containers to be generated
- await System.Threading.Tasks.Task.Delay(50);
-
- // Update visual stuff
- DrumConfig config = null;
- foreach (var i in this.listDrums.Items)
- {
- // Get drum and configuration
- var drum = i as Drum;
- if (drum != null)
- DataController.CurrentConfig.Drums.TryGetValue(drum.Id, out config);
-
- // No drum, no configuration?
- if (drum == null || config == null)
- continue;
-
- // Set up other properties
- var container = listDrums.ItemContainerGenerator.ContainerFromItem(i) as FrameworkElement;
-
- ToggleButton enabled = UIHelper.FindChildByName(container, "toggleEnabled") as ToggleButton;
- if (enabled != null) enabled.IsChecked = config.IsEnabled;
-
- Slider volumeL = UIHelper.FindChildByName(container, "sliderVolumeL") as Slider;
- if (volumeL != null) volumeL.Value = config.VolumeL;
-
- Slider volumeR = UIHelper.FindChildByName(container, "sliderVolumeR") as Slider;
- if (volumeR != null) volumeR.Value = config.VolumeR;
- }
-
- ReloadKeys();
- }
-
- void ReloadKeys()
- {
- DrumConfig config = null;
- foreach (var i in this.listDrums.Items)
- {
- // Get drum and configuration
- var drum = i as Drum;
- if (drum != null)
- DataController.CurrentConfig.Drums.TryGetValue(drum.Id, out config);
-
- // No drum, no configuration?
- if (drum == null || config == null)
- continue;
-
- // Set up key
- var container = listDrums.ItemContainerGenerator.ContainerFromItem(i) as FrameworkElement;
- TextBox key = UIHelper.FindChildByName(container, "textKey") as TextBox;
-
- if (key != null)
- {
- if (Enum.IsDefined(typeof(VirtualKey), config.Key))
- {
- // Get name
- string text = Enum.GetName(typeof(VirtualKey), config.Key);
-
- // 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
- key.Text = text;
- }
-
- else key.Text = string.Format("Unnamed ({0})", (int)config.Key);
- }
- }
- }
-
- #endregion
-
- #region UI Handlers: Items
-
- ///
- /// Handles "Landscape" toggle button.
- ///
- private void ToggleEnabled_Click(object sender, RoutedEventArgs e)
- {
- // Get drum object
- var button = sender as ToggleButton;
- var drum = (sender as FrameworkElement).DataContext as Drum;
-
- // Change enabled property
- if (drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
- {
- DataController.CurrentConfig.Drums[drum.Id].IsEnabled = button.IsChecked.HasValue && button.IsChecked.Value;
-
- DataController.SaveConfig();
- }
- }
-
- ///
- /// Handles the "key press" event in the textbox
- ///
- ///
- ///
- private void TextKey_KeyUp(object sender, KeyRoutedEventArgs e)
- {
- // Get drum object
- var text = sender as TextBox;
- var drum = (sender as FrameworkElement).DataContext as Drum;
-
- // Set key
- if (text != null && drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
- {
- // Remove duplicates
- RemoveKeys(e.Key, drum.Id);
-
- // Set key
- DataController.CurrentConfig.Drums[drum.Id].Key = e.Key;
-
- // Display
- ReloadKeys();
-
- // Save
- DataController.SaveConfig();
- }
- }
-
- private void sliderVolumeL_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
- {
- // Get drum object
- var slider = sender as Slider;
- var drum = (sender as FrameworkElement).DataContext as Drum;
-
- // Set value
- if (slider != null && drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
- {
- DataController.CurrentConfig.Drums[drum.Id].VolumeL = e.NewValue;
- DataController.SaveConfig();
- }
- }
-
- private void sliderVolumeR_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
- {
- // Get drum object
- var slider = sender as Slider;
- var drum = (sender as FrameworkElement).DataContext as Drum;
-
- // Set value
- if (slider != null && drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
- {
- DataController.CurrentConfig.Drums[drum.Id].VolumeR = e.NewValue;
- DataController.SaveConfig();
- }
- }
-
- #endregion
-
- #region Misc
- ///
- /// Sets the keyboart shortcut to None for all the drums that have this key.
- ///
- /// The keyboard shortcut
- private void RemoveKeys(VirtualKey key, string exception_id=null)
- {
- // See if any other drum has the same key
- foreach (var i in DataController.CurrentConfig.Drums)
- if (i.Value.Key == key && i.Key != exception_id)
- {
- // Set to none
- i.Value.Key = VirtualKey.None;
-
- // Get drum
- var drum = DataController.CurrentDrumkit.Drums[i.Key];
-
- // Get key text box
- var container = listDrums.ItemContainerGenerator.ContainerFromItem(drum) as FrameworkElement;
- TextBox keytxt = UIHelper.FindChildByName(container, "textKey") as TextBox;
- keytxt.Text = Enum.GetName(typeof(VirtualKey), i.Value.Key);
- }
- }
-
- #endregion
-
- }
-}
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.System;
+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 DrumsSettingsControl : UserControl
+ {
+ #region Initialization
+ ///
+ /// Creates a new instance of DrumsSettingsControl
+ ///
+ public DrumsSettingsControl()
+ {
+ this.InitializeComponent();
+ this.Loaded += DrumsSettingsControl_Loaded;
+ }
+
+
+ ///
+ /// Loads drum list at startup
+ ///
+ void DrumsSettingsControl_Loaded(object sender, RoutedEventArgs e)
+ {
+ ReloadDrums();
+ }
+
+ #endregion
+
+ #region Reloads the list of drums
+
+ ///
+ /// Reloads the list of drums
+ ///
+ async void ReloadDrums()
+ {
+ // Clear previous stuff
+ listDrums.Items.Clear();
+
+ // Add new stuff
+ foreach (var i in DataController.CurrentDrumkit.Drums)
+ this.listDrums.Items.Add(i.Value);
+
+ // Wait for containers to be generated
+ await System.Threading.Tasks.Task.Delay(50);
+
+ // Update visual stuff
+ DrumConfig config = null;
+ foreach (var i in this.listDrums.Items)
+ {
+ // Get drum and configuration
+ var drum = i as Drum;
+ if (drum != null)
+ DataController.CurrentConfig.Drums.TryGetValue(drum.Id, out config);
+
+ // No drum, no configuration?
+ if (drum == null || config == null)
+ continue;
+
+ // Set up other properties
+ var container = listDrums.ItemContainerGenerator.ContainerFromItem(i) as FrameworkElement;
+
+ ToggleButton enabled = UIHelper.FindChildByName(container, "toggleEnabled") as ToggleButton;
+ if (enabled != null) enabled.IsChecked = config.IsEnabled;
+
+ Slider volumeL = UIHelper.FindChildByName(container, "sliderVolumeL") as Slider;
+ if (volumeL != null) volumeL.Value = config.VolumeL;
+
+ Slider volumeR = UIHelper.FindChildByName(container, "sliderVolumeR") as Slider;
+ if (volumeR != null) volumeR.Value = config.VolumeR;
+ }
+
+ ReloadKeys();
+ }
+
+ void ReloadKeys()
+ {
+ DrumConfig config = null;
+ foreach (var i in this.listDrums.Items)
+ {
+ // Get drum and configuration
+ var drum = i as Drum;
+ if (drum != null)
+ DataController.CurrentConfig.Drums.TryGetValue(drum.Id, out config);
+
+ // No drum, no configuration?
+ if (drum == null || config == null)
+ continue;
+
+ // Set up key
+ var container = listDrums.ItemContainerGenerator.ContainerFromItem(i) as FrameworkElement;
+ TextBox key = UIHelper.FindChildByName(container, "textKey") as TextBox;
+
+ if (key != null)
+ {
+ key.Text = UIHelper.GetPrettifiedVKeyName(config.Key);
+ }
+ }
+ }
+
+ #endregion
+
+ #region UI Handlers: Items
+
+ ///
+ /// Handles "Landscape" toggle button.
+ ///
+ private void ToggleEnabled_Click(object sender, RoutedEventArgs e)
+ {
+ // Get drum object
+ var button = sender as ToggleButton;
+ var drum = (sender as FrameworkElement).DataContext as Drum;
+
+ // Change enabled property
+ if (drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
+ {
+ DataController.CurrentConfig.Drums[drum.Id].IsEnabled = button.IsChecked.HasValue && button.IsChecked.Value;
+
+ DataController.SaveConfig();
+ }
+ }
+
+ ///
+ /// Handles the "key press" event in the textbox
+ ///
+ ///
+ ///
+ private void TextKey_KeyUp(object sender, KeyRoutedEventArgs e)
+ {
+ // Get drum object
+ var text = sender as TextBox;
+ var drum = (sender as FrameworkElement).DataContext as Drum;
+
+ // Set key
+ if (text != null && drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
+ {
+ // Remove duplicates
+ RemoveKeys(e.Key, drum.Id);
+
+ // Set key
+ DataController.CurrentConfig.Drums[drum.Id].Key = e.Key;
+
+ // Display
+ ReloadKeys();
+
+ // Save
+ DataController.SaveConfig();
+ }
+ }
+
+ private void sliderVolumeL_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
+ {
+ // Get drum object
+ var slider = sender as Slider;
+ var drum = (sender as FrameworkElement).DataContext as Drum;
+
+ // Set value
+ if (slider != null && drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
+ {
+ DataController.CurrentConfig.Drums[drum.Id].VolumeL = e.NewValue;
+ DataController.SaveConfig();
+ }
+ }
+
+ private void sliderVolumeR_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
+ {
+ // Get drum object
+ var slider = sender as Slider;
+ var drum = (sender as FrameworkElement).DataContext as Drum;
+
+ // Set value
+ if (slider != null && drum != null && DataController.CurrentConfig.Drums.ContainsKey(drum.Id))
+ {
+ DataController.CurrentConfig.Drums[drum.Id].VolumeR = e.NewValue;
+ DataController.SaveConfig();
+ }
+ }
+
+ #endregion
+
+ #region Misc
+ ///
+ /// Sets the keyboart shortcut to None for all the drums that have this key.
+ ///
+ /// The keyboard shortcut
+ private void RemoveKeys(VirtualKey key, string exception_id=null)
+ {
+ // See if any other drum has the same key
+ foreach (var i in DataController.CurrentConfig.Drums)
+ if (i.Value.Key == key && i.Key != exception_id)
+ {
+ // Set to none
+ i.Value.Key = VirtualKey.None;
+
+ // Get drum
+ var drum = DataController.CurrentDrumkit.Drums[i.Key];
+
+ // Get key text box
+ var container = listDrums.ItemContainerGenerator.ContainerFromItem(drum) as FrameworkElement;
+ TextBox keytxt = UIHelper.FindChildByName(container, "textKey") as TextBox;
+ keytxt.Text = Enum.GetName(typeof(VirtualKey), i.Value.Key);
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/DrumKit/UI/Settings/GeneralSettingsControl.xaml b/DrumKit/UI/Settings/GeneralSettingsControl.xaml
index 065cde8..19c3024 100644
--- a/DrumKit/UI/Settings/GeneralSettingsControl.xaml
+++ b/DrumKit/UI/Settings/GeneralSettingsControl.xaml
@@ -1,174 +1,174 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- About
-
-
-
- Drumkit website
-
-
-
-
-
- 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