Karya, built on 2018-03-16T03:22:32 (patch df7306861219887e676081746f4a4edfe05eb0b5)

Safe HaskellNone



The selection type.



type Num = Int Source #

Index into the the selection list.

data Selection Source #




  • 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

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.