Skip to content

Commit

Permalink
available audio samples can be inspected on new Resources tab of sett…
Browse files Browse the repository at this point in the history
…ings pane
  • Loading branch information
dktr0 committed Oct 3, 2023
1 parent 42dd907 commit 60de54c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion client/src/Estuary/Types/Term.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ data Term =
TerminalViewCommands |
Voices |
AddATitle |
Tap
Tap |
Resources
deriving (Show,Eq)

translate :: Term -> Language -> Text
Expand Down Expand Up @@ -226,4 +227,6 @@ translate Voices English = "voices"

translate Tap English = "Tap"

translate Resources English = "Resources"

translate x _ = translate x English
2 changes: 2 additions & 0 deletions client/src/Estuary/Widgets/AudioMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import TextShow
import Data.List (nub)
import Data.Tuple.Select
import Control.Monad.Fix (MonadFix)
import Control.Monad.IO.Class

import Estuary.Widgets.W
import Estuary.Resources.LocMap
import Estuary.Widgets.Reflex (traceDynamic)


audioMapWidget :: (Reflex t, Monad m, MonadFix m, Adjustable t m, PostBuild t m, MonadHold t m, DomBuilder t m) => W t m ()
Expand Down
2 changes: 1 addition & 1 deletion client/src/Estuary/Widgets/Reflex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ traceDynamic msg x = do
let u = traceEvent msg (updated x)
holdDyn i u

traceDynamicWith :: (MonadIO m, Reflex t, MonadSample t m, MonadHold t m, Show a) => (a -> String) -> Dynamic t a -> m (Dynamic t a)
traceDynamicWith :: (MonadIO m, Reflex t, MonadSample t m, MonadHold t m) => (a -> String) -> Dynamic t a -> m (Dynamic t a)
traceDynamicWith f x = do
i <- sample $ current x
let i' = f i
Expand Down
5 changes: 4 additions & 1 deletion client/src/Estuary/Widgets/Sidebar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import Estuary.Widgets.W
import Estuary.Widgets.Reflex
import Estuary.Widgets.Reference
import Estuary.Widgets.Config
import Estuary.Widgets.AudioMap
import Estuary.Types.Term
import Estuary.Types.RenderInfo

sidebarWidget :: MonadWidget t m => W t m ()
sidebarWidget = do
referenceEvent <- fmap (1 <$) $ clickableDiv "sidebar-tab" $ (dynText =<< term Reference)
configEvent <- fmap (2 <$) $ clickableDiv "sidebar-tab" $ (dynText =<< term Settings)
curPage <- holdDyn 1 $ leftmost [referenceEvent,configEvent]
resourcesEvent <- fmap (3 <$) $ clickableDiv "sidebar-tab" $ (dynText =<< term Resources)
curPage <- holdDyn 1 $ leftmost [referenceEvent,configEvent,resourcesEvent]
hideableWidget (fmap (==1) curPage) "reference" $ navigation -- Reference panel
hideableWidget (fmap (==2) curPage) "config-options" configWidget
hideableWidget (fmap (==3) curPage) "reference" $ audioMapWidget

0 comments on commit 60de54c

Please sign in to comment.