Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

Ui.Meter.Mark

Synopsis

Documentation

data Marklist Source #

Instances

Instances details
Show Marklist Source # 
Instance details

Defined in Ui.Meter.Mark

Eq Marklist Source # 
Instance details

Defined in Ui.Meter.Mark

Pretty Marklist Source # 
Instance details

Defined in Ui.Meter.Mark

Serialize Marklist Source # 
Instance details

Defined in Cmd.Serialize

marklist :: [PosMark] -> Marklist Source #

to_list :: Marklist -> [PosMark] Source #

ascending :: ScoreTime -> Marklist -> [PosMark] Source #

Marks starting at the first mark >= the given pos, to the end.

descending :: ScoreTime -> Marklist -> [PosMark] Source #

Marks starting at the first mark below the given pos, to the beginning.

end :: Marklist -> ScoreTime Source #

Get the position of the last mark.

data Mark Source #

Constructors

Mark 

Fields

Instances

Instances details
Show Mark Source # 
Instance details

Defined in Ui.Meter.Mark

Methods

showsPrec :: Int -> Mark -> ShowS #

show :: Mark -> String #

showList :: [Mark] -> ShowS #

CStorable Mark Source # 
Instance details

Defined in Ui.RulerC

Methods

sizeOf :: Mark -> Int #

alignment :: Mark -> Int #

peekElemOff :: Ptr Mark -> Int -> IO Mark #

pokeElemOff :: Ptr Mark -> Int -> Mark -> IO () #

peekByteOff :: Ptr b -> Int -> IO Mark #

pokeByteOff :: Ptr b -> Int -> Mark -> IO () #

peek :: Ptr Mark -> IO Mark #

poke :: Ptr Mark -> Mark -> IO () #

DeepSeq.NFData Mark Source # 
Instance details

Defined in Ui.Meter.Mark

Methods

rnf :: Mark -> () #

Eq Mark Source # 
Instance details

Defined in Ui.Meter.Mark

Methods

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

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

Pretty Mark Source # 
Instance details

Defined in Ui.Meter.Mark

Serialize Mark Source # 
Instance details

Defined in Cmd.Serialize

for RulerC's eyes only

newtype MarklistPtr Source #

This should be opaque, but it needs to be exported for RulerC. Don't look inside if you're not RulerC, OK?

The Left value is actually not used, but prevents the unsafePerformIO from being floated out of the lambda.

I used to just copy the ruler each time, but it was actually pretty big. Rulers can have lots of marks, there are many rulers per block since each track has one. But many tracks share the same ruler, and they change rarely. All of these differences from Events push for passing by pointer rather than copying over the whole thing each time (as with the signal), or passing a callback that fetches the required range (as with events).

TODO I could share the memory by making MarklistVector into Vector.Storable PosMark. It's otherwise equivalant though, and the number of distinct rulers is probably small, so the memory savings doesn't seem that compelling.

marklist_fptr :: Marklist -> MarklistPtr Source #

This is a cache for the C-marshalled version of the marklist. It will be allocated if the Marklist is passed to C, and is managed with its own reference count.

I think this should be safe as long as marklist is the only constructor.