A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Start flattening the tree

+150 -168
+20 -17
src/Applications/UI.elm
··· 24 24 import Time 25 25 import Tracks 26 26 import Tracks.Encoding as Tracks 27 + import UI.Adjunct as Adjunct 27 28 import UI.Alfred.State as Alfred 28 29 import UI.Audio.State as Audio 29 30 import UI.Audio.Types as Audio ··· 162 163 Reply.translate reply 163 164 164 165 ----------------------------------------- 166 + -- Alfred 167 + ----------------------------------------- 168 + AssignAlfred a -> 169 + Alfred.assign a 170 + 171 + GotAlfredInput a -> 172 + Alfred.gotInput a 173 + 174 + SelectAlfredItem a -> 175 + Alfred.runAction a 176 + 177 + ----------------------------------------- 165 178 -- Authentication 166 179 ----------------------------------------- 167 180 AuthenticationBootFailure a -> ··· 281 294 HideOverlay -> 282 295 Interface.hideOverlay 283 296 284 - KeyboardMsg a -> 285 - Interface.keyboardMsg a 286 - 287 297 PreferredColorSchemaChanged a -> 288 298 Interface.preferredColorSchemaChanged a 289 299 ··· 369 379 User.saveEnclosedUserData 370 380 371 381 ----------------------------------------- 382 + -- 🦉 Adjunct 383 + ----------------------------------------- 384 + KeyboardMsg a -> 385 + Adjunct.keyboardInput a 386 + 387 + ----------------------------------------- 372 388 -- 📭 Et Cetera 373 389 ----------------------------------------- 374 390 SetCurrentTime a -> ··· 378 394 EtCetera.setIsOnline a 379 395 380 396 ----------------------------------------- 381 - -- 🦉 Nested 397 + -- TODO 382 398 ----------------------------------------- 383 - Alfred a -> 384 - Alfred.update a 385 - 386 399 Audio a -> 387 400 Audio.update a 388 401 ··· 396 409 Sub.batch 397 410 [ Audio.subscriptions model 398 411 , Ports.fromAlien alien 399 - 400 - ----------------------------------------- 401 - -- Alfred 402 - ----------------------------------------- 403 - , case model.alfred of 404 - Just _ -> 405 - Alfred.subscriptions 406 - 407 - Nothing -> 408 - Sub.none 409 412 410 413 ----------------------------------------- 411 414 -- Backdrop
+83
src/Applications/UI/Adjunct.elm
··· 1 + module UI.Adjunct exposing (..) 2 + 3 + import Keyboard 4 + import Maybe.Extra as Maybe 5 + import Return 6 + import Return.Ext as Return exposing (communicate) 7 + import UI.Alfred.State as Alfred 8 + import UI.Authentication as Authentication 9 + import UI.Interface.State exposing (hideOverlay) 10 + import UI.Reply as Reply exposing (Reply) 11 + import UI.Types as UI exposing (..) 12 + 13 + 14 + 15 + -- 📣 16 + 17 + 18 + keyboardInput : Keyboard.Msg -> Manager 19 + keyboardInput msg model = 20 + (\m -> 21 + let 22 + skip = 23 + Return.singleton m 24 + 25 + authenticated = 26 + case model.authentication of 27 + Authentication.Authenticated _ -> 28 + True 29 + 30 + _ -> 31 + False 32 + in 33 + if m.focusedOnInput || not authenticated then 34 + -- Stop here if using input or not authenticated 35 + skip 36 + 37 + else if Maybe.isJust model.alfred then 38 + case m.pressedKeys of 39 + [ Keyboard.ArrowDown ] -> 40 + Alfred.selectPrevious m 41 + 42 + [ Keyboard.ArrowUp ] -> 43 + Alfred.selectNext m 44 + 45 + [ Keyboard.Enter ] -> 46 + Alfred.runSelectedAction m 47 + 48 + _ -> 49 + skip 50 + 51 + else 52 + case m.pressedKeys of 53 + [ Keyboard.Escape ] -> 54 + hideOverlay m 55 + 56 + [ Keyboard.ArrowLeft ] -> 57 + Return.performance (Reply Reply.RewindQueue) m 58 + 59 + [ Keyboard.ArrowRight ] -> 60 + Return.performance (Reply Reply.ShiftQueue) m 61 + 62 + [ Keyboard.ArrowUp ] -> 63 + Return.performance (Reply (Reply.Seek <| (m.audio.position - 10) / m.audio.duration)) m 64 + 65 + [ Keyboard.ArrowDown ] -> 66 + Return.performance (Reply (Reply.Seek <| (m.audio.position + 10) / m.audio.duration)) m 67 + 68 + [ Keyboard.Character "N" ] -> 69 + Return.performance (Reply Reply.ScrollToNowPlaying) m 70 + 71 + [ Keyboard.Character "P" ] -> 72 + Return.performance (Reply Reply.TogglePlayPause) m 73 + 74 + [ Keyboard.Character "R" ] -> 75 + Return.performance (Reply Reply.ToggleRepeat) m 76 + 77 + [ Keyboard.Character "S" ] -> 78 + Return.performance (Reply Reply.ToggleShuffle) m 79 + 80 + _ -> 81 + skip 82 + ) 83 + { model | pressedKeys = Keyboard.update msg model.pressedKeys }
+32 -63
src/Applications/UI/Alfred/State.elm
··· 16 16 import Return.Ext as Return 17 17 import String.Ext as String 18 18 import Task 19 - import UI.Alfred.Types as Alfred exposing (..) 20 19 import UI.Types as UI exposing (Manager) 21 20 22 21 ··· 24 23 -- 📣 25 24 26 25 27 - update : Alfred.Msg UI.Msg -> Manager 28 - update msg = 29 - case msg of 30 - Assign a -> 31 - assign a 32 - 33 - DetermineResults a -> 34 - determineResults a 35 - 36 - KeyDown a -> 37 - keyDown a 38 - 39 - RunAction a -> 40 - runAction a 41 - 42 - 43 - 44 - -- 🔱 45 - 46 - 47 26 assign : Alfred UI.Msg -> Manager 48 27 assign instance model = 49 28 return ··· 54 33 ) 55 34 56 35 57 - determineResults : String -> Manager 58 - determineResults searchTerm model = 36 + gotInput : String -> Manager 37 + gotInput searchTerm model = 59 38 model.alfred 60 - |> Maybe.map (determineResults_ searchTerm) 39 + |> Maybe.map (determineResults searchTerm) 61 40 |> (\a -> Return.singleton { model | alfred = a }) 62 41 63 42 ··· 77 56 Return.singleton { model | alfred = Nothing } 78 57 79 58 80 - keyDown : Maybe Keyboard.Key -> Manager 81 - keyDown maybeKey model = 82 - case maybeKey of 83 - Just Keyboard.ArrowDown -> 84 - case model.alfred of 85 - Just instance -> 86 - instance 87 - |> (\i -> { i | focus = min (i.focus + 1) (List.length i.results - 1) }) 88 - |> (\i -> { model | alfred = Just i }) 89 - |> Return.singleton 59 + runSelectedAction : Manager 60 + runSelectedAction model = 61 + case model.alfred of 62 + Just instance -> 63 + runAction instance.focus model 64 + 65 + Nothing -> 66 + Return.singleton model 90 67 91 - Nothing -> 92 - Return.singleton model 93 68 94 - Just Keyboard.ArrowUp -> 95 - case model.alfred of 96 - Just instance -> 97 - instance 98 - |> (\i -> { i | focus = max (i.focus - 1) 0 }) 99 - |> (\i -> { model | alfred = Just i }) 100 - |> Return.singleton 69 + selectNext : Manager 70 + selectNext model = 71 + case model.alfred of 72 + Just instance -> 73 + instance 74 + |> (\i -> { i | focus = min (i.focus + 1) (List.length i.results - 1) }) 75 + |> (\i -> { model | alfred = Just i }) 76 + |> Return.singleton 101 77 102 - Nothing -> 103 - Return.singleton model 78 + Nothing -> 79 + Return.singleton model 104 80 105 - Just Keyboard.Enter -> 106 - case model.alfred of 107 - Just instance -> 108 - update (RunAction instance.focus) model 109 81 110 - Nothing -> 111 - Return.singleton model 82 + selectPrevious : Manager 83 + selectPrevious model = 84 + case model.alfred of 85 + Just instance -> 86 + instance 87 + |> (\i -> { i | focus = max (i.focus - 1) 0 }) 88 + |> (\i -> { model | alfred = Just i }) 89 + |> Return.singleton 112 90 113 - _ -> 91 + Nothing -> 114 92 Return.singleton model 115 93 116 94 ··· 118 96 -- ⚗️ 119 97 120 98 121 - determineResults_ : String -> Alfred UI.Msg -> Alfred UI.Msg 122 - determineResults_ searchTerm alfred = 99 + determineResults : String -> Alfred UI.Msg -> Alfred UI.Msg 100 + determineResults searchTerm alfred = 123 101 let 124 102 lowerSearchTerm = 125 103 searchTerm ··· 141 119 | searchTerm = Nothing 142 120 , results = alfred.index 143 121 } 144 - 145 - 146 - 147 - -- 📰 148 - 149 - 150 - subscriptions : Sub UI.Msg 151 - subscriptions = 152 - Keyboard.downs (Keyboard.anyKeyUpper >> KeyDown >> UI.Alfred)
-19
src/Applications/UI/Alfred/Types.elm
··· 1 - module UI.Alfred.Types exposing (..) 2 - 3 - import Alfred exposing (Alfred) 4 - import Keyboard 5 - import UI.Reply exposing (Reply) 6 - 7 - 8 - 9 - -- 📣 10 - 11 - 12 - type Msg action 13 - = Assign (Alfred action) 14 - | DetermineResults String 15 - | RunAction Int 16 - ----------------------------------------- 17 - -- Keyboard 18 - ----------------------------------------- 19 - | KeyDown (Maybe Keyboard.Key)
+2 -3
src/Applications/UI/Alfred/View.elm
··· 12 12 import Material.Icons as Icons 13 13 import Material.Icons.Types exposing (Coloring(..)) 14 14 import String.Ext as String 15 - import UI.Alfred.Types exposing (..) 16 15 import UI.Types as UI 17 16 18 17 ··· 72 71 Html.input 73 72 [ autofocus True 74 73 , id "diffuse__alfred" 75 - , onInput (UI.Alfred << DetermineResults) 74 + , onInput UI.GotAlfredInput 76 75 , placeholder "Type to search or create" 77 76 , type_ "text" 78 77 ] ··· 116 115 (List.indexedMap 117 116 (\idx result -> 118 117 brick 119 - [ onTapPreventDefault (UI.Alfred <| RunAction idx) ] 118 + [ onTapPreventDefault (UI.SelectAlfredItem idx) ] 120 119 [ C.p_4 121 120 , C.relative 122 121 , C.truncate
+1 -1
src/Applications/UI/Common/State.elm
··· 9 9 10 10 11 11 12 - -- 🔱 12 + -- 📣 13 13 14 14 15 15 showNotification : Notification Reply -> Manager
-57
src/Applications/UI/Interface/State.elm
··· 2 2 3 3 import Common exposing (Switch(..)) 4 4 import Debouncer.Basic as Debouncer 5 - import Keyboard 6 5 import Maybe.Extra as Maybe 7 6 import Monocle.Lens as Lens 8 7 import Return exposing (return) 9 8 import Return.Ext as Return exposing (communicate) 10 - import UI.Authentication as Authentication 11 9 import UI.Common.State as Common exposing (modifySingleton) 12 10 import UI.DnD as DnD 13 11 import UI.Page as Page 14 12 import UI.Ports as Ports 15 13 import UI.Queue as Queue 16 14 import UI.Queue.State as Queue 17 - import UI.Reply as Reply 18 15 import UI.Sources.State as Sources 19 16 import UI.Tracks as Tracks 20 17 import UI.Tracks.Scene.List ··· 67 64 , confirmation = Nothing 68 65 , contextMenu = Nothing 69 66 } 70 - 71 - 72 - keyboardMsg : Keyboard.Msg -> Manager 73 - keyboardMsg msg model = 74 - (\m -> 75 - let 76 - skip = 77 - Return.singleton m 78 - 79 - authenticated = 80 - case model.authentication of 81 - Authentication.Authenticated _ -> 82 - True 83 - 84 - _ -> 85 - False 86 - in 87 - if m.focusedOnInput || not authenticated then 88 - -- Stop here if using input or not authenticated 89 - skip 90 - 91 - else 92 - case m.pressedKeys of 93 - [ Keyboard.Escape ] -> 94 - hideOverlay m 95 - 96 - [ Keyboard.ArrowLeft ] -> 97 - Return.performance (Reply Reply.RewindQueue) m 98 - 99 - [ Keyboard.ArrowRight ] -> 100 - Return.performance (Reply Reply.ShiftQueue) m 101 - 102 - [ Keyboard.ArrowUp ] -> 103 - Return.performance (Reply (Reply.Seek <| (m.audio.position - 10) / m.audio.duration)) m 104 - 105 - [ Keyboard.ArrowDown ] -> 106 - Return.performance (Reply (Reply.Seek <| (m.audio.position + 10) / m.audio.duration)) m 107 - 108 - [ Keyboard.Character "N" ] -> 109 - Return.performance (Reply Reply.ScrollToNowPlaying) m 110 - 111 - [ Keyboard.Character "P" ] -> 112 - Return.performance (Reply Reply.TogglePlayPause) m 113 - 114 - [ Keyboard.Character "R" ] -> 115 - Return.performance (Reply Reply.ToggleRepeat) m 116 - 117 - [ Keyboard.Character "S" ] -> 118 - Return.performance (Reply Reply.ToggleShuffle) m 119 - 120 - _ -> 121 - skip 122 - ) 123 - { model | pressedKeys = Keyboard.update msg model.pressedKeys } 124 67 125 68 126 69 preferredColorSchemaChanged : { dark : Bool } -> Manager
+1 -3
src/Applications/UI/Reply/Translate.elm
··· 37 37 import Task 38 38 import Tracks 39 39 import Tracks.Encoding as Tracks 40 - import UI.Alfred.Types as Alfred 41 40 import UI.Audio.State as Audio 42 41 import UI.Audio.Types as Audio 43 42 import UI.Authentication as Authentication ··· 418 417 model.playlists.collection 419 418 |> List.filterNot .autoGenerated 420 419 |> UI.Playlists.Alfred.create tracks 421 - |> Alfred.Assign 422 - |> Alfred 420 + |> AssignAlfred 423 421 |> Return.performanceF model 424 422 425 423 -----------------------------------------
+11 -4
src/Applications/UI/Types.elm
··· 39 39 import Time 40 40 import Tracks 41 41 import Tracks.Encoding as Tracks 42 - import UI.Alfred.Types as Alfred 43 42 import UI.Audio.Types as Audio 44 43 import UI.Authentication as Authentication 45 44 import UI.Authentication.ContextMenu as Authentication ··· 133 132 = Bypass 134 133 | Reply Reply 135 134 ----------------------------------------- 135 + -- Alfred 136 + ----------------------------------------- 137 + | AssignAlfred (Alfred Msg) 138 + | GotAlfredInput String 139 + | SelectAlfredItem Int 140 + ----------------------------------------- 136 141 -- Authentication 137 142 ----------------------------------------- 138 143 | AuthenticationBootFailure String ··· 162 167 | Debounce (Debouncer.Msg Msg) 163 168 | FocusedOnInput 164 169 | HideOverlay 165 - | KeyboardMsg Keyboard.Msg 166 170 | PreferredColorSchemaChanged { dark : Bool } 167 171 | RemoveQueueSelection 168 172 | RemoveTrackSelection ··· 202 206 | LoadHypaethralUserData Json.Decode.Value 203 207 | SaveEnclosedUserData 204 208 ----------------------------------------- 209 + -- 🦉 Adjunct 210 + ----------------------------------------- 211 + | KeyboardMsg Keyboard.Msg 212 + ----------------------------------------- 205 213 -- 📭 Et Cetera 206 214 ----------------------------------------- 207 215 | SetCurrentTime Time.Posix 208 216 | SetIsOnline Bool 209 217 ----------------------------------------- 210 - -- 🦉 Nested 218 + -- TODO 211 219 ----------------------------------------- 212 - | Alfred (Alfred.Msg Msg) 213 220 | Audio Audio.Msg 214 221 215 222
-1
src/Applications/UI/View.elm
··· 24 24 import Sources.Encoding as Sources 25 25 import Tracks 26 26 import Tracks.Encoding as Tracks 27 - import UI.Alfred.Types as Alfred 28 27 import UI.Alfred.View as Alfred 29 28 import UI.Authentication as Authentication 30 29 import UI.Authentication.ContextMenu as Authentication