csound-expression-typed-0.2.9.0: typed core for the library csound-expression
Safe HaskellSafe-Inferred
LanguageHaskell2010

Csound.Typed.Gui.Widget

Synopsis

Panels

panel :: Gui -> SE () Source #

Renders the GUI elements on the window. Rectangle is calculated automatically (window doesn't listens for keyboard events).

keyPanel :: Gui -> SE () Source #

Renders the GUI elements on the window. Rectangle is calculated automatically (window listens for keyboard events).

tabs :: [(Text, Gui)] -> SE () Source #

Renders the GUI elements with tabs. Rectangles are calculated automatically.

keyTabs :: [(Text, Gui)] -> SE () Source #

Renders the GUI elements with tabs. Rectangles are calculated automatically.

panels :: [Gui] -> SE () Source #

Renders a list of panels.

keyPanels :: [Gui] -> SE () Source #

Renders a list of panels. Panels are sensitive to keyboard events.

panelBy :: Text -> Maybe Rect -> Gui -> SE () Source #

Renders the GUI elements on the window. We can specify the window title and rectangle of the window.

keyPanelBy :: Text -> Maybe Rect -> Gui -> SE () Source #

Renders the GUI elements on the window. We can specify the window title and rectangle of the window. Panesls are sensitive to keyboard events.

tabsBy :: Text -> Maybe Rect -> [(Text, Maybe Rect, Gui)] -> SE () Source #

Renders the GUI elements with tabs. We can specify the window title and rectangles for all tabs and for the main window.

keyTabsBy :: Text -> Maybe Rect -> [(Text, Maybe Rect, Gui)] -> SE () Source #

Renders the GUI elements with tabs. We can specify the window title and rectangles for all tabs and for the main window. Tabs are sensitive to keyboard events.

Types

type Input a = a Source #

Widgets that produce something has inputs.

type Output a = a -> SE () Source #

Widgets that consume something has outputs.

type Inner = SE () Source #

Widgets that just do something inside them or have an inner state.

noInput :: Input () Source #

A value for widgets that produce nothing.

noOutput :: Output () Source #

A value for widgets that consume nothing.

noInner :: Inner Source #

A value for stateless widgets.

type Widget a b = SE (Gui, Output a, Input b, Inner) Source #

A widget consists of visible element (Gui), value consumer (Output) and producer (Input) and an inner state (Inner).

widget :: SE (Gui, Output a, Input b, Inner) -> Widget a b Source #

A widget constructor.

type Source a = SE (Gui, Input a) Source #

A producer of the values.

source :: SE (Gui, Input a) -> Source a Source #

A producer constructor.

type Sink a = SE (Gui, Output a) Source #

A consumer of the values.

sink :: SE (Gui, Output a) -> Sink a Source #

A consumer constructor.

type Display = SE Gui Source #

A static element. We can only look at it.

display :: SE Gui -> Display Source #

A display constructor.

type SinkSource a = SE (Gui, Output a, Input a) Source #

mapSource :: (a -> b) -> Source a -> Source b Source #

A handy function for transforming the value of producers.

mapGuiSource :: (Gui -> Gui) -> Source a -> Source a Source #

A handy function for transforming the GUIs of producers.

mhor :: Monoid a => [Source a] -> Source a Source #

Horizontal grouping of widgets that can produce monoidal values.

mver :: Monoid a => [Source a] -> Source a Source #

Vertical grouping of widgets that can produce monoidal values.

msca :: Double -> Source a -> Source a Source #

Scaling of widgets that can produce values.

Widgets

count :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source (Evt D) Source #

Allows the user to increase/decrease a value with mouse clicks on a corresponding arrow button. Output is an event stream that contains values when counter changes.

count diapason fineValStep maybeCoarseValStep initValue

doc: http://www.csounds.com/manual/html/FLcount.html

countSig :: ValDiap -> ValStep -> Maybe ValStep -> Double -> Source Sig Source #

A variance on the function count, but it produces a signal of piecewise constant function.

joy :: ValSpan -> ValSpan -> (Double, Double) -> Source (Sig, Sig) Source #

It is a squared area that allows the user to modify two output values at the same time. It acts like a joystick.

joy valueSpanX valueSpanY (initX, initY)

doc: http://www.csounds.com/manual/html/FLjoy.html

knob :: Text -> ValSpan -> Double -> Source Sig Source #

A FLTK widget opcode that creates a knob.

knob valueSpan initValue

doc: http://www.csounds.com/manual/html/FLknob.html

roller :: Text -> ValSpan -> ValStep -> Double -> Source Sig Source #

FLroller is a sort of knob, but put transversally.

roller valueSpan step initVal

doc: http://www.csounds.com/manual/html/FLroller.html

slider :: Text -> ValSpan -> Double -> Source Sig Source #

FLslider puts a slider into the corresponding container.

slider valueSpan initVal

doc: http://www.csounds.com/manual/html/FLslider.html

sliderBank :: Text -> [Double] -> Source [Sig] Source #

Constructs a list of linear unit sliders (ranges in [0, 1]). It takes a list of init values.

numeric :: Text -> ValDiap -> ValStep -> Double -> Source Sig Source #

numeric (originally FLtext in the Csound) allows the user to modify a parameter value by directly typing it into a text field.

numeric diapason step initValue

doc: http://www.csounds.com/manual/html/FLtext.html

meter :: Text -> ValSpan -> Double -> Sink Sig Source #

A slider that serves as indicator. It consumes values instead of producing.

meter valueSpan initValue

box :: Text -> Display Source #

A FLTK widget that displays text inside of a box. If the text is longer than 255 characters the text is split on several parts (Csound limitations).

box text

doc: http://www.csounds.com/manual/html/FLbox.html

button :: Text -> Source (Evt Unit) Source #

A FLTK widget opcode that creates a button.

button text

doc: http://www.csounds.com/manual/html/FLbutton.html

butBank :: Text -> Int -> Int -> (Int, Int) -> Source (Evt (D, D)) Source #

A FLTK widget opcode that creates a bank of buttons. Result is (x, y) coordinate of the triggered button.

butBank xNumOfButtons yNumOfButtons

doc: http://www.csounds.com/manual/html/FLbutBank.html

butBankSig :: Text -> Int -> Int -> (Int, Int) -> Source (Sig, Sig) Source #

A variance on the function butBank, but it produces a signal of piecewise constant function. Result is (x, y) coordinate of the triggered button.

butBank1 :: Text -> Int -> Int -> (Int, Int) -> Source (Evt D) Source #

A FLTK widget opcode that creates a bank of buttons.

butBank xNumOfButtons yNumOfButtons

doc: http://www.csounds.com/manual/html/FLbutBank.html

toggle :: Text -> Bool -> Source (Evt D) Source #

A FLTK widget opcode that creates a toggle button.

button text

doc: http://www.csounds.com/manual/html/FLbutton.html

toggleSig :: Text -> Bool -> Source Sig Source #

A variance on the function toggle, but it produces a signal of piecewise constant function.

setNumeric :: Text -> ValDiap -> ValStep -> Double -> Sink Sig Source #

FLtext that is sink shows current the value of a valuator in a text field.

Transformers

setTitle :: Text -> Gui -> SE Gui Source #

Appends a title to a group of widgets.

Keyboard

data KeyEvt Source #

Keyboard events.

Constructors

Press Key 
Release Key 

Instances

Instances details
Show KeyEvt Source # 
Instance details

Defined in Csound.Typed.GlobalState.GE

Eq KeyEvt Source # 
Instance details

Defined in Csound.Typed.GlobalState.GE

Methods

(==) :: KeyEvt -> KeyEvt -> Bool #

(/=) :: KeyEvt -> KeyEvt -> Bool #

keyIn :: KeyEvt -> Evt Unit Source #

The stream of keyboard press/release events.