Skip to content

Commit

Permalink
Added keyboard to visually represent results
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHooper committed Oct 27, 2019
1 parent b65376f commit e9f6175
Show file tree
Hide file tree
Showing 334 changed files with 114,809 additions and 56 deletions.
Binary file modified .vs/MusicApp/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified .vs/MusicApp/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified .vs/MusicApp/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
114 changes: 114 additions & 0 deletions Music.App/Content/Site.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,118 @@ textarea {
display: block;
margin-left: auto;
margin-right: auto;
}

.container-fluid {
width: 940px;
.center-block();
}

* {
box-sizing: border-box;
}

body {
margin: 0;
background: #222;
color: #bbb;
}

.format-keys {
padding-top: 2em;
/*height: 17em;
width: 56em;
margin: 2em 0 2em 0;
padding: 1em 0 0 0;
position: relative;
border: 1px solid #160801;
border-radius: 1em;
box-shadow: 0 0 50px rgba(0,0,0,0.5) inset,0 1px rgba(212,152,125,0.2) inset,0 5px 15px rgba(0,0,0,0.5)*/
}

.format-form {
padding-top: 3em;
}

li {
margin: 0;
padding: 0;
list-style: none;
position: relative;
float: left
}

ul .white {
height: 16em;
width: 4em;
z-index: 1;
border-left: 1px solid #bbb;
border-bottom: 1px solid #bbb;
border-radius: 0 0 5px 5px;
box-shadow: -1px 0 0 rgba(255,255,255,0.8) inset,0 0 5px #ccc inset,0 0 3px rgba(0,0,0,0.2);
background: linear-gradient(to bottom,#eee 0%,#fff 100%)
}

ul .white:active {
border-top: 1px solid #777;
border-left: 1px solid #999;
border-bottom: 1px solid #999;
box-shadow: 2px 0 3px rgba(0,0,0,0.1) inset,-5px 5px 20px rgba(0,0,0,0.2) inset,0 0 3px rgba(0,0,0,0.2);
background: linear-gradient(to bottom,#fff 0%,#e9e9e9 100%)
}

ul .white-selected {
box-shadow: -1px 0 0 rgba(150,0,0,0.8) inset,0 0 5px #000 inset,0 0 3px rgba(0,0,0,0.2);
background: linear-gradient(to bottom,#ff5d5d 0%,#ff9595 100%);
border: #000;
}

ul .white-selected:active {
box-shadow: 2px 0 3px rgba(0,0,0,0.1) inset,-5px 5px 20px rgba(0,0,0,0.2) inset,0 0 3px rgba(0,0,0,0.2);
background: linear-gradient(to bottom,#fff 0%,#e9e9e9 100%);
border: #000;
}

.black {
height: 8em;
width: 2em;
margin: 0 0 0 -1em;
z-index: 2;
border: 1px solid #000;
border-radius: 0 0 3px 3px;
box-shadow: -1px -1px 2px rgba(255,255,255,0.2) inset,0 -5px 2px 3px rgba(0,0,0,0.6) inset,0 2px 4px rgba(0,0,0,0.5);
background: linear-gradient(45deg,#222 0%,#555 100%)
}

.black:active {
box-shadow: -1px -1px 2px rgba(255,255,255,0.2) inset,0 -2px 2px 3px rgba(0,0,0,0.6) inset,0 1px 2px rgba(0,0,0,0.5);
background: linear-gradient(to right,#444 0%,#222 100%)
}

ul .black-selected {
box-shadow: -1px 0 0 rgba(150,0,0,0.8) inset,0 0 5px #000 inset,0 0 3px rgba(0,0,0,0.2);
background: linear-gradient(to bottom,#ff6464 0%,#ff4343 100%);
border: #000;
}

ul .black-selected:active {
box-shadow: -1px -1px 2px rgba(255,255,255,0.2) inset,0 -2px 2px 3px rgba(0,0,0,0.6) inset,0 1px 2px rgba(0,0,0,0.5);
background: linear-gradient(to right,#444 0%,#222 100%);
border: #000;
}

.a, .g, .f, .d, .c {
margin: 0 0 0 -1em
}

.e, .b {
margin: 0 1em 0 -1em
}

ul li:first-child {
border-radius: 5px 0 5px 5px
}

ul li:last-child {
border-radius: 0 5px 5px 5px
}
67 changes: 61 additions & 6 deletions Music.App/Controllers/KeySignaturesController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using Music.BLL;
using Music.App.Models;


namespace Music.App.Controllers
{
Expand All @@ -9,11 +12,18 @@ public class KeySignaturesController : Controller
// GET: KeySignatures
public ActionResult Index()
{
ViewBag.Message = "Fill in your Key Signature here:";

ViewBag.KeyColor = "";
return View();
}

//public ActionResult Result()
//{
// ViewBag.Message = "Here is your Key Signature:";
// ViewBag.Title = "Result";

// return View();
//}

[HttpPost]
public ActionResult Index(KeySignatureForm keySignature)
{
Expand All @@ -23,12 +33,57 @@ public ActionResult Index(KeySignatureForm keySignature)
string mode = keySignature.Mode;
string customMode = keySignature.CustomMode;

// case switch default returns a viewbag saying error message to the user, need to add error message on the view
// pass input values from form to ModeResponse method in the BLL, assign results to string
string[] modeResult = KeySigGenerator.ModeResponse(key, accidential, mode, customMode);

ViewBag.Result = String.Format("The keys are: {0} {1} {2} {3} {4} {5} {6} {7}", modeResult[0], modeResult[1], modeResult[2], modeResult[3], modeResult[4], modeResult[5], modeResult[6], modeResult[7]);

string modeResult = KeySigGenerator.ModeResponse(key, accidential, mode, customMode);
for (int i = 0; i < 7; i++)
{
switch (modeResult[i])
{
case "C":
ViewBag.KeyColorC = "white-selected";
break;
case "D♭":
ViewBag.KeyColorCS = "black-selected";
break;
case "D":
ViewBag.KeyColorD = "white-selected";
break;
case "E♭":
ViewBag.KeyColorDS = "black-selected";
break;
case "E":
ViewBag.KeyColorE = "white-selected";
break;
case "F":
ViewBag.KeyColorF = "white-selected";
break;
case "G♭":
ViewBag.KeyColorFS = "black-selected";
break;
case "G":
ViewBag.KeyColorG = "white-selected";
break;
case "A♭":
ViewBag.KeyColorGS = "black-selected";
break;
case "A":
ViewBag.KeyColorA = "white-selected";
break;
case "B♭":
ViewBag.KeyColorAS = "black-selected";
break;
case "B":
ViewBag.KeyColorB = "white-selected";
break;
default:
ViewBag.KeyColorError = "The key color broke!";
break;
}
}

ViewBag.Result = modeResult;

return View();
}

Expand Down
14 changes: 14 additions & 0 deletions Music.App/Models/Key.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Music.App.Models
{
public class Key
{
public string KeyLabel { get; set; }
public int KeySortOrder { get; set; }
public string KeyHexColor { get; set; }
}
}
9 changes: 7 additions & 2 deletions Music.App/Music.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Models\Key.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand All @@ -147,6 +148,8 @@
<Content Include="Content\Site.css" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<None Include="Properties\PublishProfiles\MusicToolApp - Web Deploy.pubxml" />
<None Include="Scripts\jquery-3.3.1.intellisense.js" />
<Content Include="Scripts\jquery-3.3.1.js" />
<Content Include="Scripts\jquery-3.3.1.min.js" />
Expand All @@ -158,7 +161,10 @@
<Content Include="Scripts\jquery.validate.unobtrusive.js" />
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<Content Include="Web.config" />
<None Include="Views\KeySignatures\Result.cshtml" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
Expand All @@ -176,7 +182,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
Expand Down
1 change: 1 addition & 0 deletions Music.App/Music.App.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
<WebStackScaffolding_LayoutPageFile />
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<NameOfLastUsedPublishProfile>MusicToolApp - Web Deploy</NameOfLastUsedPublishProfile>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
Expand Down
18 changes: 18 additions & 0 deletions Music.App/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>bin\Release\Publish</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
Loading

0 comments on commit e9f6175

Please sign in to comment.