data State = State {
-- | The project name is used as the namespace of automatically created
-- IDs, so each project can import other projects without clashes. The
-- save file is also derived from the project name.
state_project :: Id.Namespace
, state_project_dir :: String
, state_views :: Map.Map ViewId Block.View
, state_blocks :: Map.Map BlockId Block.Block
-- | Track data also gets a symbol table. This is so that I can
-- efficiently compare a track for identity, and also so I can
-- change it here and all of its occurrances change.
, state_tracks :: Map.Map TrackId Track.Track
, state_rulers :: Map.Map RulerId Ruler.Ruler
-- | This maps the midi instruments used in this State to their Addrs.
, state_midi_config :: Instrument.Config
-- | Automatically created pitch tracks will have this scale. MIDI thru
-- will also use it when a scale can't be derived from focus.
, state_project_scale :: Pitch.ScaleId
} deriving (Read, Show, Generics.Typeable)
IDs enforce sharing and enable aliasing, effectively recovering pointer semantics.