Skip to content

Commit

Permalink
minors
Browse files Browse the repository at this point in the history
Comments
Clean unused parameters and funcs
Renaming
  • Loading branch information
cbossut committed Apr 24, 2021
1 parent f4646ba commit f011629
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Data/Wheel.elm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fromContent c =
type Mod
= None
| Selectable
| Selected Bool
| Selected Bool -- First selected
| Resizing


Expand Down
28 changes: 22 additions & 6 deletions src/Editor/Mobile.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ viewContent ( model, mobile ) =
_ ->
Wheel.None

Just ( IResizeHandle iid _, mode ) ->
Just ( IResizeHandle iid _, _ ) ->
if iid /= id then
Wheel.None

Expand Down Expand Up @@ -1282,6 +1282,7 @@ viewContent ( model, mobile ) =
wheel =
g.wheel

-- BLINK
w =
case model.dragging of
Alterning ( idd, [] ) mayId ( b, _ ) ->
Expand All @@ -1303,6 +1304,7 @@ viewContent ( model, mobile ) =
_ ->
wheel
in
-- VIEW WHEEL
Wheel.view w
g.pos
(Mobile.getLength g mobile.gears)
Expand Down Expand Up @@ -1332,6 +1334,7 @@ viewContent ( model, mobile ) =
<|
Coll.toList mobile.gears
)
-- VIEW DRAGGING
++ (case model.dragging of
HalfLink ( id, pos ) ->
case model.tool of
Expand Down Expand Up @@ -1411,6 +1414,7 @@ viewContent ( model, mobile ) =
[]
)
++ (case model.tool of
-- VIEW MOTOR LINKS
Play _ _ ->
let
cuts =
Expand All @@ -1429,7 +1433,9 @@ viewContent ( model, mobile ) =
<|
Motor.getAllLinks mobile.gears

-- VIEW HARMO LINKS
Harmonize ->
-- HOVERED FRACTION
(case Interact.getInteract model.interact of
Just ( ILink l, _ ) ->
Link.viewFractOnLink (toDrawLink mobile.gears l) <|
Expand All @@ -1441,10 +1447,12 @@ viewContent ( model, mobile ) =
_ ->
[]
)
-- ALL HARMO LINKS
++ (List.concatMap (\l -> Link.viewFractLink (toDrawLink mobile.gears l) (ILink l)) <|
List.concatMap (.harmony >> Harmo.getLinks) <|
Coll.values mobile.gears
)
-- SELECTED LINK
++ (case model.link of
Just { link, fractInput } ->
Link.viewSelectedLink (toDrawLink mobile.gears link) <|
Expand All @@ -1463,6 +1471,7 @@ viewContent ( model, mobile ) =
[]
)

-- COLLAR CURSOR
Edit _ ->
case model.edit of
[ id ] ->
Expand Down Expand Up @@ -2474,7 +2483,7 @@ manageInteractEvent event model mobile =
g =
Coll.get id mobile.gears
in
case interactWave g event model mobile of
case interactWave g event model of
Just (ReturnWheel subMsg) ->
update (WheelMsgs [ ( ( id, [] ), subMsg ) ]) ( model, mobile )

Expand Down Expand Up @@ -2742,7 +2751,7 @@ interactEdit event model mobile =
_ ->
Just { return | newModel = { model | edit = [ id ] } }

-- CTRL/CMD/SHIFT CLIC
-- CTRL/CMD/ALT CLIC
( IWheel ( id, _ ), Interact.Clicked _, _ ) ->
let
already =
Expand Down Expand Up @@ -2839,6 +2848,7 @@ interactMove event model mobile =
}
in
case ( event.item, event.action, model.dragging ) of
-- START MOVE
( IWheel ( id, [] ), Interact.Dragged { newPos } ZSurface _, _ ) ->
let
gearUp =
Expand All @@ -2860,9 +2870,11 @@ interactMove event model mobile =
, cmd = Cmd.map WaveMsg cmd
}

-- END MOVE
( _, Interact.DragEnded _, Moving ) ->
Just { return | model = { model | dragging = NoDrag }, mobile = mobile, toUndo = Do }

-- START PACKING
( IWheel ( id, [] ), Interact.Dragged { newPos } ZPack _, _ ) ->
Just
{ return
Expand All @@ -2883,12 +2895,14 @@ interactMove event model mobile =
}
}

( IWheel ( id, [] ), Interact.DragEnded True, Packing ) ->
-- END PACKING
( IWheel ( _, [] ), Interact.DragEnded True, Packing ) ->
Just
{ return
| model = { model | dragging = NoDrag, pack = Pack.update Pack.PackIt model.pack }
}

-- START WAVING
( IWheel _, Interact.Dragged { absD } ZWave _, Waving ) ->
let
( wave, cmd ) =
Expand All @@ -2901,6 +2915,7 @@ interactMove event model mobile =
, cmd = Cmd.map WaveMsg cmd
}

-- MOVE WAVE SEL
( IWheel ( id, [] ), Interact.Dragged { oldPos } ZWave _, _ ) ->
case model.edit of
[ waveId ] ->
Expand Down Expand Up @@ -2934,6 +2949,7 @@ interactMove event model mobile =
_ ->
Nothing

-- END WAVING
( IWheel ( id, [] ), Interact.DragEnded True, Waving ) ->
case model.edit of
[ waveId ] ->
Expand Down Expand Up @@ -3010,8 +3026,8 @@ type InteractWaveReturn
| ReturnWave Waveform.Msg


interactWave : Geer -> Interact.Event Interactable Zone -> Model -> Mobeel -> Maybe InteractWaveReturn
interactWave g event model mobile =
interactWave : Geer -> Interact.Event Interactable Zone -> Model -> Maybe InteractWaveReturn
interactWave g event model =
let
move part =
case part of
Expand Down
4 changes: 2 additions & 2 deletions src/Harmony.elm
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ makeCopy id newId coll =


getLengthId : (Harmonized g -> Float) -> Id (Harmonized g) -> Coll (Harmonized g) -> Float
getLengthId f id coll =
getLength f (Coll.get id coll) coll
getLengthId getContentLength id coll =
getLength getContentLength (Coll.get id coll) coll


getLength : (Harmonized g -> Float) -> Harmonized g -> Coll (Harmonized g) -> Float
Expand Down
8 changes: 0 additions & 8 deletions src/Sound.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ type Sound
}



{- }
fromPath : String -> Sound
fromPath p =
S { path = p }
-}


noSound =
S { path = "NO_SOUND", duration = 0, startPercent = 0, endPercent = 0 }

Expand Down

0 comments on commit f011629

Please sign in to comment.