Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Ui.Sel

Description

The selection type.

Synopsis

Documentation

type Num = Int Source #

Index into the the selection list.

data Selection Source #

Constructors

Selection 

Fields

  • start_track :: !Types.TrackNum

    The position the selection was established at. Since a selection can logically go off the edge of a block, this is not necessarily a valid TrackNum!

  • start_pos :: !TrackTime
     
  • cur_track :: !Types.TrackNum

    The position the selection is now at. The tracks are an inclusive range, the pos are half-open. This is because these pairs are meant to be symmetrical, but the c++ layer only supports half-open pos ranges. I don't think there's much I can do about this.

    Unlike start_track, this should be a valid TrackNum, because cmds want to use it as the focused track.

  • cur_pos :: !TrackTime
     
  • orientation :: !Orientation
     

Instances

Instances details
Read Selection Source # 
Instance details

Defined in Ui.Sel

Show Selection Source # 
Instance details

Defined in Ui.Sel

Eq Selection Source # 
Instance details

Defined in Ui.Sel

Ord Selection Source # 
Instance details

Defined in Ui.Sel

Pretty Selection Source # 
Instance details

Defined in Ui.Sel

Serialize Selection Source # 
Instance details

Defined in Cmd.Serialize

data Orientation Source #

None is used for display selections, which don't need arrows on them.

Constructors

None 
Positive 
Negative 

Instances

Instances details
Bounded Orientation Source # 
Instance details

Defined in Ui.Sel

Enum Orientation Source # 
Instance details

Defined in Ui.Sel

Read Orientation Source # 
Instance details

Defined in Ui.Sel

Show Orientation Source # 
Instance details

Defined in Ui.Sel

Eq Orientation Source # 
Instance details

Defined in Ui.Sel

Ord Orientation Source # 
Instance details

Defined in Ui.Sel

Serialize Orientation Source # 
Instance details

Defined in Cmd.Serialize

point :: Types.TrackNum -> TrackTime -> Orientation -> Selection Source #

A point is a selection with no duration.

track_range :: Selection -> (Types.TrackNum, Types.TrackNum) Source #

Start and end tracks, from small to large.

tracknums :: Types.TrackNum -> Selection -> [Types.TrackNum] Source #

TrackNums covered by the selection. Since Selections may have out of range tracks, I need the number of tracks to generate a list of valid TrackNums.

range :: Selection -> (TrackTime, TrackTime) Source #

Start and end points, from small to large.

merge :: Selection -> Selection -> Selection Source #

Extend the current track and pos, but keep the start track and pos the same.

union :: Selection -> Selection -> Selection Source #

Make a selection that covers both the given selections. It tries to set start and cur values based on the direction of the merge, assuming you are starting with the first selection and adding the second.