wx-controls-extra-0.0: A set of custom widgets for wxHaskell.ContentsIndex
Graphics.UI.WX.Controls.EnvelopeWidget
Description

A custom envelope widget for wxHaskell. The word "envelope" is understood as in ADSR. The envelope is built from linear or cubic bezier segments.

The code is very ugly and hackish. You have been warned.

Synopsis
data SegmentType
= LinearS
| CubicS
data EnvSegment a = EnvSegment {
es_type :: SegmentType
es_left :: a
es_ctrl1 :: a
es_ctrl2 :: a
es_right :: a
}
data Envelope t a = Envelope Int (Envelope' t a)
type Envelope' t a = [(EnvSegment a, t)]
calcEnvelopeSegment :: Floating a => a -> EnvSegment a -> a
calcEnvelope :: RealFloat a => a -> Envelope a a -> a
makeEnvelopeWidget :: Window a -> Int -> Bool -> [Prop EnvelopeWidget] -> IO EnvelopeWidget
Documentation
data SegmentType
Constructors
LinearS
CubicS
show/hide Instances
data EnvSegment a
Constructors
EnvSegment
es_type :: SegmentType
es_left :: a
es_ctrl1 :: a
es_ctrl2 :: a
es_right :: a
show/hide Instances
data Envelope t a
Constructors
Envelope Int (Envelope' t a)
show/hide Instances
(Read t, Read a) => Read (Envelope t a)
(Show t, Show a) => Show (Envelope t a)
type Envelope' t a = [(EnvSegment a, t)]
An envelope on the interval [0,1], made up from (scaled) segments.
calcEnvelopeSegment :: Floating a => a -> EnvSegment a -> a
Computes the value of an envelope segment at a 0<=t<=1.
calcEnvelope :: RealFloat a => a -> Envelope a a -> a
makeEnvelopeWidget
::
=> Window aparent window
-> Intmaximal number of segments (8 is a sane default)
-> Boolsigned envelope? (that is, range is [-1,1] or [0,1])
-> [Prop EnvelopeWidget]properties (eg. selection or tooltip)
-> IO EnvelopeWidget
Produced by Haddock version 2.4.1