Drop support for PracticeMode

For now, I'd like to support selecting keys and whitelisting inversions.
This commit is contained in:
William Carroll 2020-04-19 18:23:01 +01:00
parent d134db700f
commit 14f11823ff
2 changed files with 3 additions and 43 deletions

View file

@ -150,13 +150,5 @@ render model =
{ tempo = model.tempo { tempo = model.tempo
, handleInput = State.SetTempo , handleInput = State.SetTempo
} }
, case model.practiceMode of , keyCheckboxes model
State.KeyMode ->
keyCheckboxes model
State.FineTuneMode ->
div []
[ inversionCheckboxes model.whitelistedInversions
, chordTypeCheckboxes model.whitelistedChordTypes
]
] ]

View file

@ -16,7 +16,6 @@ type Msg
| TogglePitchClass Theory.PitchClass | TogglePitchClass Theory.PitchClass
| ToggleKey Theory.Key | ToggleKey Theory.Key
| DoNothing | DoNothing
| SetPracticeMode PracticeMode
| SetView View | SetView View
| ToggleFlashCard | ToggleFlashCard
@ -27,13 +26,6 @@ type View
| Overview | Overview
{-| Control the type of practice you'd like.
-}
type PracticeMode
= KeyMode
| FineTuneMode
type alias Model = type alias Model =
{ whitelistedChords : List Theory.Chord { whitelistedChords : List Theory.Chord
, whitelistedChordTypes : List Theory.ChordType , whitelistedChordTypes : List Theory.ChordType
@ -45,7 +37,6 @@ type alias Model =
, tempo : Int , tempo : Int
, firstNote : Theory.Note , firstNote : Theory.Note
, lastNote : Theory.Note , lastNote : Theory.Note
, practiceMode : PracticeMode
, view : View , view : View
, showFlashCard : Bool , showFlashCard : Bool
} }
@ -70,24 +61,9 @@ init =
keys = keys =
[ { pitchClass = Theory.C, mode = Theory.MajorMode } ] [ { pitchClass = Theory.C, mode = Theory.MajorMode } ]
practiceMode =
KeyMode
in in
{ practiceMode = practiceMode { whitelistedChords =
, whitelistedChords =
case practiceMode of
KeyMode ->
keys |> List.concatMap Theory.chordsForKey keys |> List.concatMap Theory.chordsForKey
FineTuneMode ->
Theory.allChords
{ start = firstNote
, end = lastNote
, inversions = inversions
, chordTypes = chordTypes
, pitchClasses = pitchClasses
}
, whitelistedChordTypes = chordTypes , whitelistedChordTypes = chordTypes
, whitelistedInversions = inversions , whitelistedInversions = inversions
, whitelistedPitchClasses = pitchClasses , whitelistedPitchClasses = pitchClasses
@ -110,14 +86,6 @@ update msg model =
DoNothing -> DoNothing ->
( model, Cmd.none ) ( model, Cmd.none )
SetPracticeMode practiceMode ->
( { model
| practiceMode = practiceMode
, isPaused = True
}
, Cmd.none
)
SetView x -> SetView x ->
( { model ( { model
| view = x | view = x