Safe Haskell | None |
---|
- red :: Color
- orange :: Color
- yellow :: Color
- amber :: Color
- green :: Color
- controlColor :: Color
- data PureApp cfg mode state = PureApp {
- pAppConfig :: cfg
- pAppIniState :: (mode, state)
- pAppStartStop :: cfg -> Bool -> state -> state
- pAppRender :: cfg -> mode -> state -> Maybe Int -> [(Button, Color)]
- pAppButton :: cfg -> ButtonPress -> (mode, state) -> ((mode, state), [MidiMessage'])
- pAppSync :: cfg -> mode -> state -> Int -> (state, [MidiMessage'])
- safeRenderDiff :: [(Button, Color)] -> [(Button, Color)] -> Messages
- unsafeRenderDiff :: [(Button, Color)] -> [(Button, Color)] -> Messages
- theSyncCounter :: MVar Int
- thePlayingFlag :: MVar Bool
- theLaunchpadMode :: MVar Control
- theLedUpdateBuffer :: MVar [Messages]
- theLastScreen :: MVar [(Button, Color)]
- whenUser2 :: GlobalConfig -> IO () -> IO ()
- whenUser2' :: IO () -> IO ()
- pushUpdates :: Messages -> IO ()
- replaceMVar :: MVar a -> a -> IO ()
- forceList :: [a] -> [a]
- appUpdateLoop :: IO ()
- data GlobalConfig = GlobalConfig {}
- selectDevice :: String -> String -> IO (Source, Destination)
- runPureApp :: GlobalConfig -> PureApp cfg mode state -> IO ()
- appLaunchpadCallback :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> Connection -> MidiEvent -> IO ()
- appSyncHandler :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> Connection -> MidiEvent -> IO ()
- diffRender :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()
- fullRender :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()
- diffRender' :: Maybe Int -> (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()
- fullRender' :: Maybe Int -> (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()
simple colors
Default color of the control buttons (session, user modes, mixer), which is amber
pure interface
data PureApp cfg mode state Source
We suppose an application can have different modes (similarly as in Ableton one can have session, session overview, different mixer modes, etc), which are basically different "screens" on the Launchpad; and also a global state. See the example applications how it is intended to be used.
PureApp | |
|
render only the difference between old and new display
unsafeRenderDiff :: [(Button, Color)] -> [(Button, Color)] -> MessagesSource
Optimized led update. We assume that the inputs are sorted.
global variables
theSyncCounter :: MVar IntSource
24 tick per quarter note
theLaunchpadMode :: MVar ControlSource
We should only use user2 mode to be compatible with Ableton. We default to session mode (a hack, but who cares :)
theLastScreen :: MVar [(Button, Color)]Source
helper functions
pushUpdates :: Messages -> IO ()Source
replaceMVar :: MVar a -> a -> IO ()Source
update loop
run applications
data GlobalConfig Source
Global configuration of an app
GlobalConfig | |
|
selectDevice :: String -> String -> IO (Source, Destination)Source
runPureApp :: GlobalConfig -> PureApp cfg mode state -> IO ()Source
Executes a pure application
appLaunchpadCallback :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> Connection -> MidiEvent -> IO ()Source
appSyncHandler :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> Connection -> MidiEvent -> IO ()Source
render the buttons
diffRender :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()Source
fullRender :: (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()Source
diffRender' :: Maybe Int -> (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()Source
fullRender' :: Maybe Int -> (GlobalConfig, PureApp cfg mode state, MVar mode, MVar state) -> IO ()Source