Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Cmd.Ruler.RulerUtil

Contents

Description

Infrastructure for dealing with rulers in a higher level way than as a Ruler.Marklist.

Synopsis

Documentation

constructors

meter_ruler :: Meter.MeterConfig -> Meter.Duration -> [Meter.AbstractMeter] -> Ruler.Ruler Source #

Create a ruler with a meter of the given duration.

set_marklist :: Ui.M m => Id.RulerId -> Ruler.Name -> Maybe.Maybe Ruler.MeterType -> Ruler.Marklist -> m () Source #

Replace or add a marklist with the given name.

copy_marklist :: Ui.M m => Ruler.Name -> Id.RulerId -> Id.RulerId -> m () Source #

Copy a marklist from one ruler to another. If it already exists in the destination ruler, it will be replaced.

meter

data Scope Source #

The scope of a ruler modification.

Constructors

Block

Modify all rulers on the block.

Section !TrackNum

Modify the section_ruler_id. Section 0 is the Ui.block_ruler.

Tracks ![TrackNum]

Modify the given tracks.

Instances

Eq Scope # 

Methods

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

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

Show Scope # 

Methods

showsPrec :: Int -> Scope -> ShowS #

show :: Scope -> String #

showList :: [Scope] -> ShowS #

local

local :: Ui.M m => Scope -> Id.BlockId -> ModifyRuler -> m [Id.RulerId] Source #

Modify a ruler or rulers, making copies if they're shared outside of the Scope.

local_section Source #

Arguments

:: Ui.M m 
=> Id.BlockId 
-> TrackNum

Modify the section_ruler_id of this track.

-> ModifyRuler 
-> m Id.RulerId 

local_tracks :: Ui.M m => Id.BlockId -> [TrackNum] -> ModifyRuler -> m [Id.RulerId] Source #

Modify the given tracks, making copies if they're shared with other tracks.

local_ruler :: Ui.M m => Scope -> Id.BlockId -> Id.RulerId -> ModifyRuler -> m Id.RulerId Source #

Modify the given RulerId, making a copy if it's shared with another block.

rulers_in_scope Source #

Arguments

:: Ui.M m 
=> Scope 
-> Id.BlockId 
-> Id.RulerId 
-> m ([TrackNum], Bool)

(tracknums with the RulerId and in the scope, True if there are ones out of scope)

modify_copy :: Ui.M m => Id.BlockId -> Id.RulerId -> ModifyRuler -> m Id.RulerId Source #

Copy the ruler and modify the copy.

modify

modify :: Ui.M m => Scope -> Id.BlockId -> ModifyRuler -> m () Source #

Modify the ruler on the focused block. Other blocks with the same ruler will also be modified.

modify_block :: Ui.M m => Id.BlockId -> ModifyRuler -> m () Source #

Modify all rulers in the block.

modify_section :: Ui.M m => Id.BlockId -> TrackNum -> ModifyRuler -> m () Source #

Modify all rulers on the block in this section_ruler_id.

modify_ruler Source #

Arguments

:: Ui.M m 
=> Id.BlockId 
-> [TrackNum]

If given, these are the TrackIds that were intended to be modified. This is necessary if you try to modify Ui.no_ruler.

-> Id.RulerId 
-> ModifyRuler 
-> m () 

util

section_ruler_id :: Ui.M m => Id.BlockId -> TrackNum -> m Id.RulerId Source #

The section RulerId is the first ruler of the section. A section is defined by get_section, but in a normal block with one ruler track at tracknum 0, it will be tracknum 0.

get_section :: Ui.M m => Id.BlockId -> TrackNum -> m [(TrackNum, Block.TracklikeId)] Source #

Get the tracks of the section of the given track. A section extends from a ruler track until the next ruler track.

block_id_to_ruler :: Id.BlockId -> Id.Id Source #

Create a block-local RulerId. It gets the exact same name as the block, but is defined as a function so it's clear where this conversion is done.